Bug 1387933 Part 2: Gecko-side add a reusable sheets parameter to Servo_StyleSheet_FromUTF8Bytes, and mark a test as passing.
MozReview-Commit-ID: 9wqJW3SqbbM
--- a/layout/inspector/tests/mochitest.ini
+++ b/layout/inspector/tests/mochitest.ini
@@ -28,10 +28,9 @@ support-files =
getCSSStyleRules-2.css
[test_getCSSPseudoElementNames.html]
[test_getRelativeRuleLine.html]
[test_get_all_style_sheets.html]
[test_is_valid_css_color.html]
[test_isinheritableproperty.html]
[test_parseStyleSheet.html]
[test_parseStyleSheetImport.html]
-fail-if = stylo # bug 1387933
[test_selectormatcheselement.html]
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -40,17 +40,18 @@ SERVO_BINDING_FUNC(Servo_Element_IsDispl
// Styleset and Stylesheet management
SERVO_BINDING_FUNC(Servo_StyleSheet_FromUTF8Bytes, RawServoStyleSheetContentsStrong,
mozilla::css::Loader* loader,
mozilla::ServoStyleSheet* gecko_stylesheet,
const nsACString* data,
mozilla::css::SheetParsingMode parsing_mode,
RawGeckoURLExtraData* extra_data,
uint32_t line_number_offset,
- nsCompatibility quirks_mode)
+ nsCompatibility quirks_mode,
+ mozilla::css::LoaderReusableStyleSheets* reusable_sheets)
SERVO_BINDING_FUNC(Servo_StyleSheet_Empty, RawServoStyleSheetContentsStrong,
mozilla::css::SheetParsingMode parsing_mode)
SERVO_BINDING_FUNC(Servo_StyleSheet_HasRules, bool,
RawServoStyleSheetContentsBorrowed sheet)
SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong,
RawServoStyleSheetContentsBorrowed sheet)
SERVO_BINDING_FUNC(Servo_StyleSheet_Clone, RawServoStyleSheetContentsStrong,
RawServoStyleSheetContentsBorrowed sheet,
--- a/layout/style/ServoStyleSheet.cpp
+++ b/layout/style/ServoStyleSheet.cpp
@@ -206,17 +206,17 @@ ServoStyleSheet::ParseSheet(css::Loader*
MOZ_ASSERT(!mMedia || mMedia->IsServo());
RefPtr<URLExtraData> extraData =
new URLExtraData(aBaseURI, aSheetURI, aSheetPrincipal);
NS_ConvertUTF16toUTF8 input(aInput);
Inner()->mContents =
Servo_StyleSheet_FromUTF8Bytes(
aLoader, this, &input, mParsingMode, extraData,
- aLineNumber, aCompatMode
+ aLineNumber, aCompatMode, aReusableSheets
).Consume();
Inner()->mURLData = extraData.forget();
return NS_OK;
}
nsresult
ServoStyleSheet::ReparseSheet(const nsAString& aInput)
--- a/layout/style/test/gtest/StyloParsingBench.cpp
+++ b/layout/style/test/gtest/StyloParsingBench.cpp
@@ -26,17 +26,17 @@ static void ServoParsingBench() {
ASSERT_TRUE(IsUTF8(css));
RefPtr<URLExtraData> data = new URLExtraData(
NullPrincipalURI::Create(), nullptr, NullPrincipal::Create());
for (int i = 0; i < PARSING_REPETITIONS; i++) {
RefPtr<RawServoStyleSheetContents> stylesheet =
Servo_StyleSheet_FromUTF8Bytes(
nullptr, nullptr, &css, eAuthorSheetFeatures,
- data, 0, eCompatibility_FullStandards
+ data, 0, eCompatibility_FullStandards, nullptr
).Consume();
}
}
MOZ_GTEST_BENCH(Stylo, Servo_StyleSheet_FromUTF8Bytes_Bench, ServoParsingBench);
#endif