Changeset 251655 in webkit
- Timestamp:
- Oct 28, 2019, 9:02:53 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
- 1 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/text/font-face-javascript-expected.txt (modified) (2 diffs)
-
LayoutTests/fast/text/font-face-javascript.html (modified) (2 diffs)
-
LayoutTests/fast/text/unicode-range-javascript-expected.txt (modified) (1 diff)
-
LayoutTests/fast/text/unicode-range-javascript.html (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Headers.cmake (modified) (1 diff)
-
Source/WebCore/WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
Source/WebCore/css/CSSKeyframeRule.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSKeyframesRule.cpp (modified) (2 diffs)
-
Source/WebCore/css/CSSPropertySourceData.h (modified) (2 diffs)
-
Source/WebCore/css/CSSRule.cpp (modified) (1 diff)
-
Source/WebCore/css/CSSUnicodeRangeValue.cpp (modified) (1 diff)
-
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (modified) (1 diff)
-
Source/WebCore/css/StyleRule.cpp (modified) (15 diffs)
-
Source/WebCore/css/StyleRule.h (modified) (5 diffs)
-
Source/WebCore/css/StyleRuleImport.cpp (modified) (1 diff)
-
Source/WebCore/css/StyleRuleImport.h (modified) (2 diffs)
-
Source/WebCore/css/StyleRuleType.h (copied) (copied from trunk/Source/WebCore/css/CSSUnicodeRangeValue.cpp ) (2 diffs)
-
Source/WebCore/css/StyleSheetContents.cpp (modified) (3 diffs)
-
Source/WebCore/css/parser/CSSParser.cpp (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserContext.h (modified) (3 diffs)
-
Source/WebCore/css/parser/CSSParserImpl.cpp (modified) (22 diffs)
-
Source/WebCore/css/parser/CSSParserImpl.h (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserObserver.h (modified) (1 diff)
-
Source/WebCore/css/parser/CSSPropertyParser.cpp (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSPropertyParser.h (modified) (1 diff)
-
Source/WebCore/css/parser/CSSTokenizer.cpp (modified) (1 diff)
-
Source/WebCore/inspector/InspectorStyleSheet.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r251648 r251655 1 2019-10-28 Simon Fraser <simon.fraser@apple.com> 2 3 Can't change @font-face descriptors from fontFaceRule.style.setProperty() 4 https://bugs.webkit.org/show_bug.cgi?id=177975 5 <rdar://problem/56648761> 6 7 Reviewed by Antti Koivisto. 8 9 Fix tests for the urange serialization fix. 10 11 * fast/text/font-face-javascript-expected.txt: 12 * fast/text/font-face-javascript.html: 13 * fast/text/unicode-range-javascript-expected.txt: 14 * fast/text/unicode-range-javascript.html: 15 1 16 2019-10-28 Antoine Quint <graouts@apple.com> 2 17 -
trunk/LayoutTests/fast/text/font-face-javascript-expected.txt
r230838 r251655 18 18 PASS new FontFace('family_name', 'url(\'asdf\')', {'weight': 'inherit'}).weight threw exception SyntaxError: The string did not match the expected pattern.. 19 19 PASS new FontFace('family_name', 'url(\'asdf\')', {'stretch': 'ultra-expanded'}).stretch is "ultra-expanded" 20 PASS new FontFace('family_name', 'url(\'asdf\')', {'unicodeRange': 'U+26'}).unicodeRange is "U+26 -26"20 PASS new FontFace('family_name', 'url(\'asdf\')', {'unicodeRange': 'U+26'}).unicodeRange is "U+26" 21 21 PASS new FontFace('family_name', 'url(\'asdf\')', {'unicodeRange': 'U+0-7F'}).unicodeRange is "U+0-7f" 22 22 PASS new FontFace('family_name', 'url(\'asdf\')', {'variant': 'variant_name'}).variant threw exception SyntaxError: The string did not match the expected pattern.. … … 27 27 PASS everything.weight is "bold" 28 28 PASS everything.stretch is "extra-expanded" 29 PASS everything.unicodeRange is "U+26 -26"29 PASS everything.unicodeRange is "U+26" 30 30 PASS everything.variant is "small-caps" 31 31 PASS everything.featureSettings is "\"titl\"" -
trunk/LayoutTests/fast/text/font-face-javascript.html
r230838 r251655 26 26 shouldThrow("new FontFace('family_name', 'url(\\'asdf\\')', {'weight': 'inherit'}).weight"); 27 27 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'stretch': 'ultra-expanded'}).stretch", "ultra-expanded"); 28 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'unicodeRange': 'U+26'}).unicodeRange", "U+26 -26");28 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'unicodeRange': 'U+26'}).unicodeRange", "U+26"); 29 29 shouldBeEqualToString("new FontFace('family_name', 'url(\\'asdf\\')', {'unicodeRange': 'U+0-7F'}).unicodeRange", "U+0-7f"); 30 30 shouldThrow("new FontFace('family_name', 'url(\\'asdf\\')', {'variant': 'variant_name'}).variant"); … … 37 37 shouldBeEqualToString("everything.weight", "bold"); 38 38 shouldBeEqualToString("everything.stretch", "extra-expanded"); 39 shouldBeEqualToString("everything.unicodeRange", "U+26 -26");39 shouldBeEqualToString("everything.unicodeRange", "U+26"); 40 40 shouldBeEqualToString("everything.variant", "small-caps"); 41 41 shouldBeEqualToString("everything.featureSettings", "\"titl\""); -
trunk/LayoutTests/fast/text/unicode-range-javascript-expected.txt
r203092 r251655 5 5 6 6 PASS faces.length is 1 7 PASS faces[0].unicodeRange is "U+41 -41"7 PASS faces[0].unicodeRange is "U+41" 8 8 PASS document.fonts.check('14px WebFont', 'A') is true 9 9 PASS faces.length is 1 10 10 PASS faces[0].family is "WebFont" 11 PASS faces[0].unicodeRange is "U+41 -41"11 PASS faces[0].unicodeRange is "U+41" 12 12 PASS document.fonts.check('14px WebFont3', 'A') is false 13 13 PASS document.fonts.check('14px WebFont3', 'A') is true -
trunk/LayoutTests/fast/text/unicode-range-javascript.html
r203092 r251655 54 54 faces = facesArgument; 55 55 shouldBe("faces.length", "1"); 56 shouldBeEqualToString("faces[0].unicodeRange", "U+41 -41");56 shouldBeEqualToString("faces[0].unicodeRange", "U+41"); 57 57 shouldBeTrue("document.fonts.check('14px WebFont', 'A')"); 58 58 return document.fonts.load("14px WebFont, WebFont2", "A"); … … 61 61 shouldBe("faces.length", "1"); 62 62 shouldBeEqualToString("faces[0].family", "WebFont"); 63 shouldBeEqualToString("faces[0].unicodeRange", "U+41 -41");63 shouldBeEqualToString("faces[0].unicodeRange", "U+41"); 64 64 shouldBeFalse("document.fonts.check('14px WebFont3', 'A')"); 65 65 for (let f of document.fonts) { 66 if (f.family == "WebFont3" && f.unicodeRange == "U+41 -41")66 if (f.family == "WebFont3" && f.unicodeRange == "U+41") 67 67 return f.load(); 68 68 } -
trunk/LayoutTests/imported/w3c/ChangeLog
r251649 r251655 1 2019-10-28 Simon Fraser <simon.fraser@apple.com> 2 3 Can't change @font-face descriptors from fontFaceRule.style.setProperty() 4 https://bugs.webkit.org/show_bug.cgi?id=177975 5 <rdar://problem/56648761> 6 7 Reviewed by Antti Koivisto. 8 9 More passing subtests. 10 11 * web-platform-tests/css/css-syntax/urange-parsing-expected.txt: 12 1 13 2019-10-27 Antoine Quint <graouts@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-syntax/urange-parsing-expected.txt
r251635 r251655 1 1 2 FAIL "u/**/+/**/a/**/?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got " "3 FAIL "u+abc" => "U+ABC" assert_equals: expected "U+ABC" but got "" 4 FAIL "U+abc" => "U+ABC" assert_equals: expected "U+ABC" but got "" 5 FAIL "u+ABC" => "U+ABC" assert_equals: expected "U+ABC" but got "" 6 FAIL "U+ABC" => "U+ABC" assert_equals: expected "U+ABC" but got "" 7 FAIL "u+AbC" => "U+ABC" assert_equals: expected "U+ABC" but got "" 8 FAIL "u+efg" is invalid assert_equals: expected "U+1357" but got "" 9 FAIL "u+ abc" is invalid assert_equals: expected "U+1357" but got "" 10 FAIL "u +abc" is invalid assert_equals: expected "U+1357" but got "" 11 FAIL "u + abc" is invalid assert_equals: expected "U+1357" but got "" 12 FAIL "U + a b c" is invalid assert_equals: expected "U+1357" but got "" 13 FAIL "u+a" => "U+A" assert_equals: expected "U+A" but got "" 14 FAIL "u+aa" => "U+AA" assert_equals: expected "U+AA" but got "" 15 FAIL "u+aaa" => "U+AAA" assert_equals: expected "U+AAA" but got "" 16 FAIL "u+aaaa" => "U+AAAA" assert_equals: expected "U+AAAA" but got "" 17 FAIL "u+aaaaa" => "U+AAAAA" assert_equals: expected "U+AAAAA" but got "" 18 FAIL "u+aaaaaaa" is invalid assert_equals: expected "U+1357" but got "" 19 FAIL "u+a?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got "" 20 FAIL "u+a??" => "U+A00-AFF" assert_equals: expected "U+A00-AFF" but got "" 21 FAIL "u+a???" => "U+A000-AFFF" assert_equals: expected "U+A000-AFFF" but got "" 22 FAIL "u+a????" => "U+A0000-AFFFF" assert_equals: expected "U+A0000-AFFFF" but got "" 23 FAIL "u+aaaaaa?" is invalid assert_equals: expected "U+1357" but got "" 24 FAIL "u+aaaaa??" is invalid assert_equals: expected "U+1357" but got "" 25 FAIL "u+aaaa???" is invalid assert_equals: expected "U+1357" but got "" 26 FAIL "u+aaa????" is invalid assert_equals: expected "U+1357" but got "" 27 FAIL "u+aa?????" is invalid assert_equals: expected "U+1357" but got "" 28 FAIL "u+a??????" is invalid assert_equals: expected "U+1357" but got "" 29 FAIL "u+a?a" is invalid assert_equals: expected "U+1357" but got "" 30 FAIL "u+aaaaaa" is invalid assert_equals: expected "U+1357" but got " "31 FAIL "u+a?????" is invalid assert_equals: expected "U+1357" but got " "32 FAIL "u/**/+0a/**/?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got " "33 FAIL "u+0a" => "U+A" assert_equals: expected "U+A" but got "" 34 FAIL "U+0a0" => "U+A0" assert_equals: expected "U+A0" but got "" 35 FAIL "u+0aaaaa" => "U+AAAAA" assert_equals: expected "U+AAAAA" but got "" 36 FAIL "u+0aaaaaa" is invalid assert_equals: expected "U+1357" but got "" 37 FAIL "u+0a0000" => "U+A0000" assert_equals: expected "U+A0000" but got "" 38 FAIL "u+0a00000" is invalid assert_equals: expected "U+1357" but got "" 39 FAIL "u+0aaaaa0" is invalid assert_equals: expected "U+1357" but got "" 40 FAIL "u+00000a" => "U+A" assert_equals: expected "U+A" but got "" 41 FAIL "u+00000aa" is invalid assert_equals: expected "U+1357" but got "" 42 FAIL "u+00000a0" is invalid assert_equals: expected "U+1357" but got "" 43 FAIL "u+000000a" is invalid assert_equals: expected "U+1357" but got "" 44 FAIL "u+0a????" => "U+A0000-AFFFF" assert_equals: expected "U+A0000-AFFFF" but got "" 45 FAIL "u+0a?????" is invalid assert_equals: expected "U+1357" but got "" 46 FAIL "u+00a????" is invalid assert_equals: expected "U+1357" but got "" 47 FAIL "u+22222a" is invalid assert_equals: expected "U+1357" but got " "48 FAIL "u+1e9a" => "U+1E9A" assert_equals: expected "U+1E9A" but got "" 49 FAIL "u/**/+0/**/?" => "U+0-F" assert_equals: expected "U+0-F" but got " "50 FAIL "u/**/0" is invalid assert_equals: expected "U+1357" but got "" 51 FAIL "u+0" => "U+0" assert_equals: expected "U+0" but got "" 52 FAIL "u+00" => "U+0" assert_equals: expected "U+0" but got "" 53 FAIL "u+000" => "U+0" assert_equals: expected "U+0" but got "" 54 FAIL "u+0000" => "U+0" assert_equals: expected "U+0" but got "" 55 FAIL "u+00000" => "U+0" assert_equals: expected "U+0" but got "" 56 FAIL "u+000000" => "U+0" assert_equals: expected "U+0" but got "" 57 FAIL "u+0000000" is invalid assert_equals: expected "U+1357" but got "" 58 FAIL "u+00000?" => "U+0-F" assert_equals: expected "U+0-F" but got "" 59 FAIL "u+0?????" => "U+0-FFFFF" assert_equals: expected "U+0-FFFFF" but got "" 60 FAIL "u+0?a" is invalid assert_equals: expected "U+1357" but got "" 61 FAIL "u+000000?" is invalid assert_equals: expected "U+1357" but got "" 62 FAIL "u+00000??" is invalid assert_equals: expected "U+1357" but got "" 63 FAIL "u+0??????" is invalid assert_equals: expected "U+1357" but got "" 64 FAIL "u+1e3" => "U+1E3" assert_equals: expected "U+1E3" but got "" 65 FAIL "u+1e-20" => "U+1E-20" assert_equals: expected "U+1E-20" but got "" 66 FAIL "u+222222" is invalid assert_equals: expected "U+1357" but got " "67 FAIL "u+2?????" is invalid assert_equals: expected "U+1357" but got " "68 FAIL "u/**/+0/**/-0a" => "U+0-A" assert_equals: expected "U+0-A" but got " "69 FAIL "u+0-0a" => "U+0-A" assert_equals: expected "U+0-A" but got "" 70 FAIL "u+000000-0aaaaa" => "U+0-AAAAA" assert_equals: expected "U+0-AAAAA" but got "" 71 FAIL "u+0000000-0a" is invalid assert_equals: expected "U+1357" but got "" 72 FAIL "u+0-0aaaaaa" is invalid assert_equals: expected "U+1357" but got "" 73 FAIL "u+0-000000a" is invalid assert_equals: expected "U+1357" but got "" 74 FAIL "u+0+0a" is invalid assert_equals: expected "U+1357" but got "" 75 FAIL "u+0?-0a" is invalid assert_equals: expected "U+1357" but got "" 76 FAIL "u+0-0a?" is invalid assert_equals: expected "U+1357" but got "" 77 FAIL "u+222222-22222a" is invalid assert_equals: expected "U+1357" but got " "78 FAIL "u/**/+0/**/-1" => "U+0-1" assert_equals: expected "U+0-1" but got " "79 FAIL "u+0-1" => "U+0-1" assert_equals: expected "U+0-1" but got "" 80 FAIL "u-0-1" is invalid assert_equals: expected "U+1357" but got "" 81 FAIL "u-0+1" is invalid assert_equals: expected "U+1357" but got "" 82 FAIL "u+0+1" is invalid assert_equals: expected "U+1357" but got "" 83 FAIL "u+000000-000001" => "U+0-1" assert_equals: expected "U+0-1" but got "" 84 FAIL "u+0000000-1" is invalid assert_equals: expected "U+1357" but got "" 85 FAIL "u+0-0000001" is invalid assert_equals: expected "U+1357" but got "" 86 FAIL "u+0-222222" is invalid assert_equals: expected "U+1357" but got " "87 FAIL "u/**/+/**/?" => "U+0-F" assert_equals: expected "U+0-F" but got " "88 FAIL "u+?" => "U+0-F" assert_equals: expected "U+0-F" but got "" 89 FAIL "u+?????" => "u+0-FFFFF" assert_equals: expected "U+0-FFFFF" but got "" 90 FAIL "u+???????" is invalid assert_equals: expected "U+1357" but got "" 91 FAIL "u+?a" is invalid assert_equals: expected "U+1357" but got "" 92 FAIL "u+??????" is invalid assert_equals: expected "U+1357" but got " "2 FAIL "u/**/+/**/a/**/?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got "U+1357" 3 PASS "u+abc" => "U+ABC" 4 PASS "U+abc" => "U+ABC" 5 PASS "u+ABC" => "U+ABC" 6 PASS "U+ABC" => "U+ABC" 7 PASS "u+AbC" => "U+ABC" 8 PASS "u+efg" is invalid 9 PASS "u+ abc" is invalid 10 PASS "u +abc" is invalid 11 PASS "u + abc" is invalid 12 PASS "U + a b c" is invalid 13 PASS "u+a" => "U+A" 14 PASS "u+aa" => "U+AA" 15 PASS "u+aaa" => "U+AAA" 16 PASS "u+aaaa" => "U+AAAA" 17 PASS "u+aaaaa" => "U+AAAAA" 18 PASS "u+aaaaaaa" is invalid 19 PASS "u+a?" => "U+A0-AF" 20 PASS "u+a??" => "U+A00-AFF" 21 PASS "u+a???" => "U+A000-AFFF" 22 PASS "u+a????" => "U+A0000-AFFFF" 23 PASS "u+aaaaaa?" is invalid 24 PASS "u+aaaaa??" is invalid 25 PASS "u+aaaa???" is invalid 26 PASS "u+aaa????" is invalid 27 PASS "u+aa?????" is invalid 28 PASS "u+a??????" is invalid 29 PASS "u+a?a" is invalid 30 FAIL "u+aaaaaa" is invalid assert_equals: expected "U+1357" but got "U+AAAAAA" 31 FAIL "u+a?????" is invalid assert_equals: expected "U+1357" but got "U+A00000-AFFFFF" 32 FAIL "u/**/+0a/**/?" => "U+A0-AF" assert_equals: expected "U+A0-AF" but got "U+1357" 33 PASS "u+0a" => "U+A" 34 PASS "U+0a0" => "U+A0" 35 PASS "u+0aaaaa" => "U+AAAAA" 36 PASS "u+0aaaaaa" is invalid 37 PASS "u+0a0000" => "U+A0000" 38 PASS "u+0a00000" is invalid 39 PASS "u+0aaaaa0" is invalid 40 PASS "u+00000a" => "U+A" 41 PASS "u+00000aa" is invalid 42 PASS "u+00000a0" is invalid 43 PASS "u+000000a" is invalid 44 PASS "u+0a????" => "U+A0000-AFFFF" 45 PASS "u+0a?????" is invalid 46 PASS "u+00a????" is invalid 47 FAIL "u+22222a" is invalid assert_equals: expected "U+1357" but got "U+22222A" 48 PASS "u+1e9a" => "U+1E9A" 49 FAIL "u/**/+0/**/?" => "U+0-F" assert_equals: expected "U+0-F" but got "U+1357" 50 PASS "u/**/0" is invalid 51 PASS "u+0" => "U+0" 52 PASS "u+00" => "U+0" 53 PASS "u+000" => "U+0" 54 PASS "u+0000" => "U+0" 55 PASS "u+00000" => "U+0" 56 PASS "u+000000" => "U+0" 57 PASS "u+0000000" is invalid 58 PASS "u+00000?" => "U+0-F" 59 PASS "u+0?????" => "U+0-FFFFF" 60 PASS "u+0?a" is invalid 61 PASS "u+000000?" is invalid 62 PASS "u+00000??" is invalid 63 PASS "u+0??????" is invalid 64 PASS "u+1e3" => "U+1E3" 65 PASS "u+1e-20" => "U+1E-20" 66 FAIL "u+222222" is invalid assert_equals: expected "U+1357" but got "U+222222" 67 FAIL "u+2?????" is invalid assert_equals: expected "U+1357" but got "U+200000-2FFFFF" 68 FAIL "u/**/+0/**/-0a" => "U+0-A" assert_equals: expected "U+0-A" but got "U+1357" 69 PASS "u+0-0a" => "U+0-A" 70 PASS "u+000000-0aaaaa" => "U+0-AAAAA" 71 PASS "u+0000000-0a" is invalid 72 PASS "u+0-0aaaaaa" is invalid 73 PASS "u+0-000000a" is invalid 74 PASS "u+0+0a" is invalid 75 PASS "u+0?-0a" is invalid 76 PASS "u+0-0a?" is invalid 77 FAIL "u+222222-22222a" is invalid assert_equals: expected "U+1357" but got "U+222222-22222A" 78 FAIL "u/**/+0/**/-1" => "U+0-1" assert_equals: expected "U+0-1" but got "U+1357" 79 PASS "u+0-1" => "U+0-1" 80 PASS "u-0-1" is invalid 81 PASS "u-0+1" is invalid 82 PASS "u+0+1" is invalid 83 PASS "u+000000-000001" => "U+0-1" 84 PASS "u+0000000-1" is invalid 85 PASS "u+0-0000001" is invalid 86 FAIL "u+0-222222" is invalid assert_equals: expected "U+1357" but got "U+0-222222" 87 FAIL "u/**/+/**/?" => "U+0-F" assert_equals: expected "U+0-F" but got "U+1357" 88 PASS "u+?" => "U+0-F" 89 PASS "u+?????" => "u+0-FFFFF" 90 PASS "u+???????" is invalid 91 PASS "u+?a" is invalid 92 FAIL "u+??????" is invalid assert_equals: expected "U+1357" but got "U+0-FFFFFF" 93 93 FAIL u+a is a valid selector assert_equals: expected "u + a" but got ".error" 94 94 -
trunk/Source/WebCore/ChangeLog
r251654 r251655 1 2019-10-28 Simon Fraser <simon.fraser@apple.com> 2 3 Can't change @font-face descriptors from fontFaceRule.style.setProperty() 4 https://bugs.webkit.org/show_bug.cgi?id=177975 5 <rdar://problem/56648761> 6 7 Reviewed by Antti Koivisto. 8 9 When parsing properties via PropertySetCSSStyleDeclaration::setProperty() (called from 10 script as rule.style.setProperty()), CSSPropertyParser::parseValue() needs to know if 11 we're parsing properties in a @font-face or @viewport rule, since some properties are 12 only allowed in these contexts. 13 14 Achieve this by adding to CSSParserContext an Optional<enclosingRuleType>, which gets set 15 for font-face and viewport rules. This gets set by StyleRuleCSSStyleDeclaration::cssParserContext() 16 based on the type of the parent rule. 17 18 Moved StyleRule::Type to its own header so CSSParserContext can use it. Added compile-time asserts 19 that the values match CSSRule::Type (fixing one of them). 20 21 Also fix <urange> serialization when start and end values are the same. 22 23 Test: web-platform-tests/css/css-syntax/urange-parsing.html 24 25 * Headers.cmake: 26 * WebCore.xcodeproj/project.pbxproj: 27 * css/CSSKeyframeRule.cpp: 28 (WebCore::StyleRuleKeyframe::StyleRuleKeyframe): 29 * css/CSSKeyframesRule.cpp: 30 (WebCore::StyleRuleKeyframes::StyleRuleKeyframes): 31 * css/CSSPropertySourceData.h: 32 (WebCore::CSSRuleSourceData::create): 33 (WebCore::CSSRuleSourceData::createUnknown): 34 (WebCore::CSSRuleSourceData::CSSRuleSourceData): 35 * css/CSSRule.cpp: 36 * css/CSSUnicodeRangeValue.cpp: 37 (WebCore::CSSUnicodeRangeValue::customCSSText const): 38 * css/PropertySetCSSStyleDeclaration.cpp: 39 (WebCore::StyleRuleCSSStyleDeclaration::cssParserContext const): 40 * css/StyleRule.cpp: 41 (WebCore::StyleRuleBase::destroy): 42 (WebCore::StyleRuleBase::copy const): 43 (WebCore::StyleRuleBase::createCSSOMWrapper const): 44 (WebCore::StyleRule::StyleRule): 45 (WebCore::StyleRulePage::StyleRulePage): 46 (WebCore::StyleRuleFontFace::StyleRuleFontFace): 47 (WebCore::StyleRuleGroup::StyleRuleGroup): 48 (WebCore::StyleRuleMedia::StyleRuleMedia): 49 (WebCore::StyleRuleSupports::StyleRuleSupports): 50 (WebCore::StyleRuleViewport::StyleRuleViewport): 51 (WebCore::StyleRuleCharset::StyleRuleCharset): 52 (WebCore::StyleRuleNamespace::StyleRuleNamespace): 53 * css/StyleRule.h: 54 (WebCore::StyleRuleBase::type const): 55 (WebCore::StyleRuleBase::isCharsetRule const): 56 (WebCore::StyleRuleBase::isFontFaceRule const): 57 (WebCore::StyleRuleBase::isKeyframesRule const): 58 (WebCore::StyleRuleBase::isKeyframeRule const): 59 (WebCore::StyleRuleBase::isNamespaceRule const): 60 (WebCore::StyleRuleBase::isMediaRule const): 61 (WebCore::StyleRuleBase::isPageRule const): 62 (WebCore::StyleRuleBase::isStyleRule const): 63 (WebCore::StyleRuleBase::isSupportsRule const): 64 (WebCore::StyleRuleBase::isViewportRule const): 65 (WebCore::StyleRuleBase::isImportRule const): 66 (WebCore::StyleRuleBase::StyleRuleBase): 67 * css/StyleRuleImport.cpp: 68 (WebCore::StyleRuleImport::StyleRuleImport): 69 * css/StyleRuleImport.h: 70 * css/StyleRuleType.h: Copied from Source/WebCore/css/CSSUnicodeRangeValue.cpp. 71 * css/StyleSheetContents.cpp: 72 (WebCore::traverseRulesInVector): 73 (WebCore::StyleSheetContents::traverseSubresources const): 74 * css/parser/CSSParser.cpp: 75 (WebCore::CSSParser::parseValueWithVariableReferences): 76 * css/parser/CSSParserContext.h: 77 * css/parser/CSSParserImpl.cpp: 78 (WebCore::CSSParserImpl::parseValue): 79 (WebCore::CSSParserImpl::parseInlineStyleDeclaration): 80 (WebCore::CSSParserImpl::parseDeferredDeclaration): 81 (WebCore::CSSParserImpl::parseDeclarationList): 82 (WebCore::CSSParserImpl::supportsDeclaration): 83 (WebCore::CSSParserImpl::parseDeclarationListForInspector): 84 (WebCore::CSSParserImpl::consumeImportRule): 85 (WebCore::CSSParserImpl::consumeMediaRule): 86 (WebCore::CSSParserImpl::consumeSupportsRule): 87 (WebCore::CSSParserImpl::consumeViewportRule): 88 (WebCore::CSSParserImpl::consumeFontFaceRule): 89 (WebCore::CSSParserImpl::consumeKeyframesRule): 90 (WebCore::CSSParserImpl::consumePageRule): 91 (WebCore::CSSParserImpl::consumeKeyframeStyleRule): 92 (WebCore::observeSelectors): 93 (WebCore::CSSParserImpl::consumeStyleRule): 94 (WebCore::CSSParserImpl::consumeDeclarationList): 95 (WebCore::CSSParserImpl::consumeDeclaration): 96 (WebCore::CSSParserImpl::consumeDeclarationValue): 97 * css/parser/CSSParserImpl.h: 98 * css/parser/CSSParserObserver.h: 99 * css/parser/CSSPropertyParser.cpp: 100 (WebCore::CSSPropertyParser::parseValue): 101 * css/parser/CSSPropertyParser.h: 102 * css/parser/CSSTokenizer.cpp: 103 (WebCore::CSSTokenizer::letterU): 104 * inspector/InspectorStyleSheet.cpp: 105 (flattenSourceData): 106 (WebCore::StyleSheetHandler::startRuleHeader): 107 (WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData const): 108 1 109 2019-10-28 Commit Queue <commit-queue@webkit.org> 2 110 -
trunk/Source/WebCore/Headers.cmake
r251574 r251655 336 336 css/StyleColor.h 337 337 css/StyleProperties.h 338 css/StyleRuleType.h 338 339 css/StyleSheet.h 339 340 css/StyleSheetContents.h -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r251637 r251655 332 332 0F94B6522209150600157014 /* ScrollingStatePositionedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F94B651220914FF00157014 /* ScrollingStatePositionedNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 333 333 0F94B655220931E400157014 /* ScrollingTreePositionedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F94B6532209156C00157014 /* ScrollingTreePositionedNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 334 0F94F37E23661626003AA5C7 /* StyleRuleType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F94F37C23661131003AA5C7 /* StyleRuleType.h */; settings = {ATTRIBUTES = (Private, ); }; }; 334 335 0F9DAA0F1FD1C66A0079C5B2 /* DOMGCOutputConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F9DAA0E1FD1C6640079C5B2 /* DOMGCOutputConstraint.h */; }; 335 336 0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 5738 5739 0F94B6532209156C00157014 /* ScrollingTreePositionedNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollingTreePositionedNode.h; sourceTree = "<group>"; }; 5739 5740 0F94B6542209156C00157014 /* ScrollingTreePositionedNode.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollingTreePositionedNode.mm; sourceTree = "<group>"; }; 5741 0F94F37C23661131003AA5C7 /* StyleRuleType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StyleRuleType.h; sourceTree = "<group>"; }; 5740 5742 0F97A657155DA81E00FADD4C /* DisplayRefreshMonitorIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DisplayRefreshMonitorIOS.mm; sourceTree = "<group>"; }; 5741 5743 0F9B547522B4A772007B5E8A /* ScrollingStateOverflowScrollProxyNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScrollingStateOverflowScrollProxyNode.h; sourceTree = "<group>"; }; … … 9136 9138 697101071C6BE1550018C7F1 /* AccessibilitySVGElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilitySVGElement.cpp; sourceTree = "<group>"; }; 9137 9139 697101081C6BE1550018C7F1 /* AccessibilitySVGElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilitySVGElement.h; sourceTree = "<group>"; }; 9138 AAD9D0B121DFA80C001B11C7 /* LazyLoadImageObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LazyLoadImageObserver.cpp; sourceTree = "<group>"; };9139 AAD9D0B321DFA80E001B11C7 /* LazyLoadImageObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LazyLoadImageObserver.h; sourceTree = "<group>"; };9140 9140 6A22E86F1F10418600F546C3 /* InspectorCanvas.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InspectorCanvas.h; sourceTree = "<group>"; }; 9141 9141 6A22E8721F1042C400F546C3 /* InspectorCanvas.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCanvas.cpp; sourceTree = "<group>"; }; … … 12137 12137 AACC83D72316576A00EB6BF5 /* JSHTMLOrForeignElement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSHTMLOrForeignElement.h; sourceTree = "<group>"; }; 12138 12138 AACC83D82316576B00EB6BF5 /* JSHTMLOrForeignElement.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOrForeignElement.cpp; sourceTree = "<group>"; }; 12139 AAD9D0B121DFA80C001B11C7 /* LazyLoadImageObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LazyLoadImageObserver.cpp; sourceTree = "<group>"; }; 12140 AAD9D0B321DFA80E001B11C7 /* LazyLoadImageObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LazyLoadImageObserver.h; sourceTree = "<group>"; }; 12139 12141 AAE27B7416CBFC0D00623043 /* PlatformSpeechSynthesizerMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformSpeechSynthesizerMock.cpp; sourceTree = "<group>"; }; 12140 12142 AAE27B7516CBFC0D00623043 /* PlatformSpeechSynthesizerMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformSpeechSynthesizerMock.h; sourceTree = "<group>"; }; … … 27331 27333 E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */, 27332 27334 E4946EAD156E64DD00D3297F /* StyleRuleImport.h */, 27335 0F94F37C23661131003AA5C7 /* StyleRuleType.h */, 27333 27336 A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */, 27334 27337 A8EA80040A19516E00A8EF5F /* StyleSheet.h */, … … 32117 32120 E4BBED4D14FCDBA1003F0B98 /* StyleRule.h in Headers */, 32118 32121 E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */, 32122 0F94F37E23661626003AA5C7 /* StyleRuleType.h in Headers */, 32119 32123 E461D65F1BB0C80D00CB5645 /* StyleScope.h in Headers */, 32120 32124 F47A5E3E195B8C8A00483100 /* StyleScrollSnapPoints.h in Headers */, -
trunk/Source/WebCore/css/CSSKeyframeRule.cpp
r242713 r251655 36 36 37 37 StyleRuleKeyframe::StyleRuleKeyframe(Ref<StyleProperties>&& properties) 38 : StyleRuleBase( Keyframe)38 : StyleRuleBase(StyleRuleType::Keyframe) 39 39 , m_properties(WTFMove(properties)) 40 40 { … … 42 42 43 43 StyleRuleKeyframe::StyleRuleKeyframe(std::unique_ptr<Vector<double>> keys, Ref<StyleProperties>&& properties) 44 : StyleRuleBase( Keyframe)44 : StyleRuleBase(StyleRuleType::Keyframe) 45 45 , m_properties(WTFMove(properties)) 46 46 , m_keys(*keys) -
trunk/Source/WebCore/css/CSSKeyframesRule.cpp
r248846 r251655 38 38 39 39 StyleRuleKeyframes::StyleRuleKeyframes(const AtomString& name) 40 : StyleRuleBase( Keyframes)40 : StyleRuleBase(StyleRuleType::Keyframes) 41 41 , m_name(name) 42 42 { … … 44 44 45 45 StyleRuleKeyframes::StyleRuleKeyframes(const AtomString& name, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules) 46 : StyleRuleBase( Keyframes)46 : StyleRuleBase(StyleRuleType::Keyframes) 47 47 , m_name(name) 48 48 , m_deferredRules(WTFMove(deferredRules)) -
trunk/Source/WebCore/css/CSSPropertySourceData.h
r249013 r251655 81 81 82 82 struct CSSRuleSourceData : public RefCounted<CSSRuleSourceData> { 83 static Ref<CSSRuleSourceData> create(StyleRule ::Type type)83 static Ref<CSSRuleSourceData> create(StyleRuleType type) 84 84 { 85 85 return adoptRef(*new CSSRuleSourceData(type)); … … 88 88 static Ref<CSSRuleSourceData> createUnknown() 89 89 { 90 return adoptRef(*new CSSRuleSourceData(StyleRule ::Unknown));90 return adoptRef(*new CSSRuleSourceData(StyleRuleType::Unknown)); 91 91 } 92 92 93 CSSRuleSourceData(StyleRule ::Type type)93 CSSRuleSourceData(StyleRuleType type) 94 94 : type(type) 95 95 { 96 if (type == StyleRule ::Style || type == StyleRule::FontFace || type == StyleRule::Page)96 if (type == StyleRuleType::Style || type == StyleRuleType::FontFace || type == StyleRuleType::Page) 97 97 styleSourceData = CSSStyleSourceData::create(); 98 98 } 99 99 100 StyleRule ::Type type;100 StyleRuleType type; 101 101 102 102 // Range of the selector list in the enclosing source. -
trunk/Source/WebCore/css/CSSRule.cpp
r222259 r251655 37 37 COMPILE_ASSERT(sizeof(CSSRule) == sizeof(SameSizeAsCSSRule), CSSRule_should_stay_small); 38 38 39 COMPILE_ASSERT(StyleRuleType::Unknown == static_cast<StyleRuleType>(CSSRule::Type::UNKNOWN_RULE), enums_should_match); 40 COMPILE_ASSERT(StyleRuleType::Style == static_cast<StyleRuleType>(CSSRule::Type::STYLE_RULE), enums_should_match); 41 COMPILE_ASSERT(StyleRuleType::Charset == static_cast<StyleRuleType>(CSSRule::Type::CHARSET_RULE), enums_should_match); 42 COMPILE_ASSERT(StyleRuleType::Import == static_cast<StyleRuleType>(CSSRule::Type::IMPORT_RULE), enums_should_match); 43 COMPILE_ASSERT(StyleRuleType::Media == static_cast<StyleRuleType>(CSSRule::Type::MEDIA_RULE), enums_should_match); 44 COMPILE_ASSERT(StyleRuleType::FontFace == static_cast<StyleRuleType>(CSSRule::Type::FONT_FACE_RULE), enums_should_match); 45 COMPILE_ASSERT(StyleRuleType::Page == static_cast<StyleRuleType>(CSSRule::Type::PAGE_RULE), enums_should_match); 46 COMPILE_ASSERT(StyleRuleType::Keyframes == static_cast<StyleRuleType>(CSSRule::Type::KEYFRAMES_RULE), enums_should_match); 47 COMPILE_ASSERT(StyleRuleType::Keyframe == static_cast<StyleRuleType>(CSSRule::Type::KEYFRAME_RULE), enums_should_match); 48 COMPILE_ASSERT(StyleRuleType::Namespace == static_cast<StyleRuleType>(CSSRule::Type::NAMESPACE_RULE), enums_should_match); 49 COMPILE_ASSERT(StyleRuleType::Supports == static_cast<StyleRuleType>(CSSRule::Type::SUPPORTS_RULE), enums_should_match); 39 50 #if ENABLE(CSS_DEVICE_ADAPTATION) 40 COMPILE_ASSERT(StyleRuleBase::Viewport == static_cast<StyleRule Base::Type>(CSSRule::WEBKIT_VIEWPORT_RULE), enums_should_match);51 COMPILE_ASSERT(StyleRuleBase::Viewport == static_cast<StyleRuleType>(CSSRule::WEBKIT_VIEWPORT_RULE), enums_should_match); 41 52 #endif 42 53 -
trunk/Source/WebCore/css/CSSUnicodeRangeValue.cpp
r241751 r251655 33 33 String CSSUnicodeRangeValue::customCSSText() const 34 34 { 35 if (m_from == m_to) 36 return makeString("U+", hex(m_from, Lowercase)); 37 35 38 return makeString("U+", hex(m_from, Lowercase), '-', hex(m_to, Lowercase)); 36 39 } -
trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
r248846 r251655 413 413 return PropertySetCSSStyleDeclaration::cssParserContext(); 414 414 415 return styleSheet->parserContext(); 415 auto context = styleSheet->parserContext(); 416 if (m_parentRule) 417 context.enclosingRuleType = static_cast<StyleRuleType>(m_parentRule->type()); 418 419 return context; 416 420 } 417 421 -
trunk/Source/WebCore/css/StyleRule.cpp
r246490 r251655 59 59 { 60 60 switch (type()) { 61 case Style :61 case StyleRuleType::Style: 62 62 delete downcast<StyleRule>(this); 63 63 return; 64 case Page:64 case StyleRuleType::Page: 65 65 delete downcast<StyleRulePage>(this); 66 66 return; 67 case FontFace:67 case StyleRuleType::FontFace: 68 68 delete downcast<StyleRuleFontFace>(this); 69 69 return; 70 case Media:70 case StyleRuleType::Media: 71 71 delete downcast<StyleRuleMedia>(this); 72 72 return; 73 case S upports:73 case StyleRuleType::Supports: 74 74 delete downcast<StyleRuleSupports>(this); 75 75 return; 76 case Import:76 case StyleRuleType::Import: 77 77 delete downcast<StyleRuleImport>(this); 78 78 return; 79 case Keyframes:79 case StyleRuleType::Keyframes: 80 80 delete downcast<StyleRuleKeyframes>(this); 81 81 return; 82 82 #if ENABLE(CSS_DEVICE_ADAPTATION) 83 case Viewport:83 case StyleRuleType::Viewport: 84 84 delete downcast<StyleRuleViewport>(this); 85 85 return; 86 86 #endif 87 case Namespace:87 case StyleRuleType::Namespace: 88 88 delete downcast<StyleRuleNamespace>(this); 89 89 return; 90 case Keyframe:90 case StyleRuleType::Keyframe: 91 91 delete downcast<StyleRuleKeyframe>(this); 92 92 return; 93 case Charset:93 case StyleRuleType::Charset: 94 94 delete downcast<StyleRuleCharset>(this); 95 95 return; 96 case Unknown:96 case StyleRuleType::Unknown: 97 97 ASSERT_NOT_REACHED(); 98 98 return; … … 104 104 { 105 105 switch (type()) { 106 case Style :106 case StyleRuleType::Style: 107 107 return downcast<StyleRule>(*this).copy(); 108 case Page:108 case StyleRuleType::Page: 109 109 return downcast<StyleRulePage>(*this).copy(); 110 case FontFace:110 case StyleRuleType::FontFace: 111 111 return downcast<StyleRuleFontFace>(*this).copy(); 112 case Media:112 case StyleRuleType::Media: 113 113 return downcast<StyleRuleMedia>(*this).copy(); 114 case S upports:114 case StyleRuleType::Supports: 115 115 return downcast<StyleRuleSupports>(*this).copy(); 116 case Keyframes:116 case StyleRuleType::Keyframes: 117 117 return downcast<StyleRuleKeyframes>(*this).copy(); 118 118 #if ENABLE(CSS_DEVICE_ADAPTATION) 119 case Viewport:119 case StyleRuleType::Viewport: 120 120 return downcast<StyleRuleViewport>(*this).copy(); 121 121 #endif 122 case Import:123 case Namespace:122 case StyleRuleType::Import: 123 case StyleRuleType::Namespace: 124 124 // FIXME: Copy import and namespace rules. 125 125 break; 126 case Unknown:127 case Charset:128 case Keyframe:126 case StyleRuleType::Unknown: 127 case StyleRuleType::Charset: 128 case StyleRuleType::Keyframe: 129 129 break; 130 130 } … … 137 137 StyleRuleBase& self = const_cast<StyleRuleBase&>(*this); 138 138 switch (type()) { 139 case Style :139 case StyleRuleType::Style: 140 140 rule = CSSStyleRule::create(downcast<StyleRule>(self), parentSheet); 141 141 break; 142 case Page:142 case StyleRuleType::Page: 143 143 rule = CSSPageRule::create(downcast<StyleRulePage>(self), parentSheet); 144 144 break; 145 case FontFace:145 case StyleRuleType::FontFace: 146 146 rule = CSSFontFaceRule::create(downcast<StyleRuleFontFace>(self), parentSheet); 147 147 break; 148 case Media:148 case StyleRuleType::Media: 149 149 rule = CSSMediaRule::create(downcast<StyleRuleMedia>(self), parentSheet); 150 150 break; 151 case S upports:151 case StyleRuleType::Supports: 152 152 rule = CSSSupportsRule::create(downcast<StyleRuleSupports>(self), parentSheet); 153 153 break; 154 case Import:154 case StyleRuleType::Import: 155 155 rule = CSSImportRule::create(downcast<StyleRuleImport>(self), parentSheet); 156 156 break; 157 case Keyframes:157 case StyleRuleType::Keyframes: 158 158 rule = CSSKeyframesRule::create(downcast<StyleRuleKeyframes>(self), parentSheet); 159 159 break; 160 160 #if ENABLE(CSS_DEVICE_ADAPTATION) 161 case Viewport:161 case StyleRuleType::Viewport: 162 162 rule = WebKitCSSViewportRule::create(downcast<StyleRuleViewport>(self), parentSheet); 163 163 break; 164 164 #endif 165 case Namespace:165 case StyleRuleType::Namespace: 166 166 rule = CSSNamespaceRule::create(downcast<StyleRuleNamespace>(self), parentSheet); 167 167 break; 168 case Unknown:169 case Charset:170 case Keyframe:168 case StyleRuleType::Unknown: 169 case StyleRuleType::Charset: 170 case StyleRuleType::Keyframe: 171 171 ASSERT_NOT_REACHED(); 172 172 break; … … 185 185 186 186 StyleRule::StyleRule(Ref<StylePropertiesBase>&& properties, bool hasDocumentSecurityOrigin, CSSSelectorList&& selectors) 187 : StyleRuleBase(Style , hasDocumentSecurityOrigin)187 : StyleRuleBase(StyleRuleType::Style, hasDocumentSecurityOrigin) 188 188 , m_properties(WTFMove(properties)) 189 189 , m_selectorList(WTFMove(selectors)) … … 251 251 252 252 StyleRulePage::StyleRulePage(Ref<StyleProperties>&& properties, CSSSelectorList&& selectors) 253 : StyleRuleBase( Page)253 : StyleRuleBase(StyleRuleType::Page) 254 254 , m_properties(WTFMove(properties)) 255 255 , m_selectorList(WTFMove(selectors)) … … 274 274 275 275 StyleRuleFontFace::StyleRuleFontFace(Ref<StyleProperties>&& properties) 276 : StyleRuleBase( FontFace)276 : StyleRuleBase(StyleRuleType::FontFace) 277 277 , m_properties(WTFMove(properties)) 278 278 { … … 312 312 } 313 313 314 StyleRuleGroup::StyleRuleGroup( Type type, Vector<RefPtr<StyleRuleBase>>& adoptRule)314 StyleRuleGroup::StyleRuleGroup(StyleRuleType type, Vector<RefPtr<StyleRuleBase>>& adoptRule) 315 315 : StyleRuleBase(type) 316 316 { … … 318 318 } 319 319 320 StyleRuleGroup::StyleRuleGroup( Type type, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules)320 StyleRuleGroup::StyleRuleGroup(StyleRuleType type, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules) 321 321 : StyleRuleBase(type) 322 322 , m_deferredRules(WTFMove(deferredRules)) … … 360 360 361 361 StyleRuleMedia::StyleRuleMedia(Ref<MediaQuerySet>&& media, Vector<RefPtr<StyleRuleBase>>& adoptRules) 362 : StyleRuleGroup( Media, adoptRules)362 : StyleRuleGroup(StyleRuleType::Media, adoptRules) 363 363 , m_mediaQueries(WTFMove(media)) 364 364 { … … 366 366 367 367 StyleRuleMedia::StyleRuleMedia(Ref<MediaQuerySet>&& media, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules) 368 : StyleRuleGroup( Media, WTFMove(deferredRules))368 : StyleRuleGroup(StyleRuleType::Media, WTFMove(deferredRules)) 369 369 , m_mediaQueries(WTFMove(media)) 370 370 { … … 380 380 381 381 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, Vector<RefPtr<StyleRuleBase>>& adoptRules) 382 : StyleRuleGroup(S upports, adoptRules)382 : StyleRuleGroup(StyleRuleType::Supports, adoptRules) 383 383 , m_conditionText(conditionText) 384 384 , m_conditionIsSupported(conditionIsSupported) … … 387 387 388 388 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool conditionIsSupported, std::unique_ptr<DeferredStyleGroupRuleList>&& deferredRules) 389 : StyleRuleGroup(S upports, WTFMove(deferredRules))389 : StyleRuleGroup(StyleRuleType::Supports, WTFMove(deferredRules)) 390 390 , m_conditionText(conditionText) 391 391 , m_conditionIsSupported(conditionIsSupported) … … 402 402 #if ENABLE(CSS_DEVICE_ADAPTATION) 403 403 StyleRuleViewport::StyleRuleViewport(Ref<StyleProperties>&& properties) 404 : StyleRuleBase( Viewport)404 : StyleRuleBase(StyleRuleType::Viewport) 405 405 , m_properties(WTFMove(properties)) 406 406 { … … 424 424 425 425 StyleRuleCharset::StyleRuleCharset() 426 : StyleRuleBase( Charset)426 : StyleRuleBase(StyleRuleType::Charset) 427 427 { 428 428 } … … 436 436 437 437 StyleRuleNamespace::StyleRuleNamespace(AtomString prefix, AtomString uri) 438 : StyleRuleBase( Namespace)438 : StyleRuleBase(StyleRuleType::Namespace) 439 439 , m_prefix(prefix) 440 440 , m_uri(uri) -
trunk/Source/WebCore/css/StyleRule.h
r246490 r251655 25 25 #include "CompiledSelector.h" 26 26 #include "StyleProperties.h" 27 #include "StyleRuleType.h" 27 28 #include <wtf/RefPtr.h> 28 29 #include <wtf/TypeCasts.h> … … 43 44 WTF_MAKE_FAST_ALLOCATED; 44 45 public: 45 enum Type { 46 Unknown, // Not used. 47 Style, 48 Charset, // Not used. These are internally strings owned by the style sheet. 49 Import, 50 Media, 51 FontFace, 52 Page, 53 Keyframes, 54 Keyframe, // Not used. These are internally non-rule StyleRuleKeyframe objects. 55 Namespace, 56 Supports = 12, 46 StyleRuleType type() const { return static_cast<StyleRuleType>(m_type); } 47 48 bool isCharsetRule() const { return type() == StyleRuleType::Charset; } 49 bool isFontFaceRule() const { return type() == StyleRuleType::FontFace; } 50 bool isKeyframesRule() const { return type() == StyleRuleType::Keyframes; } 51 bool isKeyframeRule() const { return type() == StyleRuleType::Keyframe; } 52 bool isNamespaceRule() const { return type() == StyleRuleType::Namespace; } 53 bool isMediaRule() const { return type() == StyleRuleType::Media; } 54 bool isPageRule() const { return type() == StyleRuleType::Page; } 55 bool isStyleRule() const { return type() == StyleRuleType::Style; } 56 bool isSupportsRule() const { return type() == StyleRuleType::Supports; } 57 57 #if ENABLE(CSS_DEVICE_ADAPTATION) 58 Viewport = 15,58 bool isViewportRule() const { return type() == StyleRuleType::Viewport; } 59 59 #endif 60 }; 61 62 Type type() const { return static_cast<Type>(m_type); } 63 64 bool isCharsetRule() const { return type() == Charset; } 65 bool isFontFaceRule() const { return type() == FontFace; } 66 bool isKeyframesRule() const { return type() == Keyframes; } 67 bool isKeyframeRule() const { return type() == Keyframe; } 68 bool isNamespaceRule() const { return type() == Namespace; } 69 bool isMediaRule() const { return type() == Media; } 70 bool isPageRule() const { return type() == Page; } 71 bool isStyleRule() const { return type() == Style; } 72 bool isSupportsRule() const { return type() == Supports; } 73 #if ENABLE(CSS_DEVICE_ADAPTATION) 74 bool isViewportRule() const { return type() == Viewport; } 75 #endif 76 bool isImportRule() const { return type() == Import; } 60 bool isImportRule() const { return type() == StyleRuleType::Import; } 77 61 78 62 Ref<StyleRuleBase> copy() const; … … 89 73 90 74 protected: 91 StyleRuleBase( Type type, bool hasDocumentSecurityOrigin = false)92 : m_type( type)75 StyleRuleBase(StyleRuleType type, bool hasDocumentSecurityOrigin = false) 76 : m_type(static_cast<unsigned>(type)) 93 77 , m_hasDocumentSecurityOrigin(hasDocumentSecurityOrigin) 94 78 { … … 111 95 Ref<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const; 112 96 113 unsigned m_type : 5; 97 unsigned m_type : 5; // StyleRuleType 114 98 // This is only needed to support getMatchedCSSRules. 115 99 unsigned m_hasDocumentSecurityOrigin : 1; … … 242 226 243 227 protected: 244 StyleRuleGroup( Type, Vector<RefPtr<StyleRuleBase>>&);245 StyleRuleGroup( Type, std::unique_ptr<DeferredStyleGroupRuleList>&&);228 StyleRuleGroup(StyleRuleType, Vector<RefPtr<StyleRuleBase>>&); 229 StyleRuleGroup(StyleRuleType, std::unique_ptr<DeferredStyleGroupRuleList>&&); 246 230 StyleRuleGroup(const StyleRuleGroup&); 247 231 -
trunk/Source/WebCore/css/StyleRuleImport.cpp
r240014 r251655 43 43 44 44 StyleRuleImport::StyleRuleImport(const String& href, Ref<MediaQuerySet>&& media) 45 : StyleRuleBase(Import) 46 , m_parentStyleSheet(0) 45 : StyleRuleBase(StyleRuleType::Import) 47 46 , m_styleSheetClient(this) 48 47 , m_strHref(href) 49 48 , m_mediaQueries(WTFMove(media)) 50 , m_cachedSheet(0)51 , m_loading(false)52 49 { 53 50 if (!m_mediaQueries) -
trunk/Source/WebCore/css/StyleRuleImport.h
r223728 r251655 73 73 StyleRuleImport(const String& href, Ref<MediaQuerySet>&&); 74 74 75 StyleSheetContents* m_parentStyleSheet ;75 StyleSheetContents* m_parentStyleSheet { nullptr }; 76 76 77 77 ImportedStyleSheetClient m_styleSheetClient; … … 80 80 RefPtr<StyleSheetContents> m_styleSheet; 81 81 CachedResourceHandle<CachedCSSStyleSheet> m_cachedSheet; 82 bool m_loading ;82 bool m_loading { false }; 83 83 }; 84 84 -
trunk/Source/WebCore/css/StyleRuleType.h
r251654 r251655 1 1 /* 2 * Copyright (C) 20 08Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "CSSUnicodeRangeValue.h" 28 29 #include <wtf/HexNumber.h> 26 #pragma once 30 27 31 28 namespace WebCore { 32 29 33 String CSSUnicodeRangeValue::customCSSText() const 34 { 35 return makeString("U+", hex(m_from, Lowercase), '-', hex(m_to, Lowercase)); 36 } 30 enum class StyleRuleType : uint8_t { 31 Unknown, // Not used. 32 Style, 33 Charset, // Not used. These are internally strings owned by the style sheet. 34 Import, 35 Media, 36 FontFace, 37 Page, 38 Keyframes, 39 Keyframe, // Not used. These are internally non-rule StyleRuleKeyframe objects. 40 Namespace = 10, 41 Supports = 12, 42 #if ENABLE(CSS_DEVICE_ADAPTATION) 43 Viewport = 15, 44 #endif 45 }; 37 46 38 bool CSSUnicodeRangeValue::equals(const CSSUnicodeRangeValue& other) const 39 { 40 return m_from == other.m_from && m_to == other.m_to; 41 } 42 43 } 47 } // namespace WebCore -
trunk/Source/WebCore/css/StyleSheetContents.cpp
r246490 r251655 427 427 return true; 428 428 switch (rule->type()) { 429 case StyleRule Base::Media: {429 case StyleRuleType::Media: { 430 430 auto* childRules = downcast<StyleRuleMedia>(*rule).childRulesWithoutDeferredParsing(); 431 431 if (childRules && traverseRulesInVector(*childRules, handler)) … … 433 433 break; 434 434 } 435 case StyleRule Base::Import:435 case StyleRuleType::Import: 436 436 ASSERT_NOT_REACHED(); 437 437 break; 438 case StyleRule Base::Style:439 case StyleRule Base::FontFace:440 case StyleRule Base::Page:441 case StyleRule Base::Keyframes:442 case StyleRule Base::Namespace:443 case StyleRule Base::Unknown:444 case StyleRule Base::Charset:445 case StyleRule Base::Keyframe:446 case StyleRule Base::Supports:438 case StyleRuleType::Style: 439 case StyleRuleType::FontFace: 440 case StyleRuleType::Page: 441 case StyleRuleType::Keyframes: 442 case StyleRuleType::Namespace: 443 case StyleRuleType::Unknown: 444 case StyleRuleType::Charset: 445 case StyleRuleType::Keyframe: 446 case StyleRuleType::Supports: 447 447 #if ENABLE(CSS_DEVICE_ADAPTATION) 448 case StyleRule Base::Viewport:448 case StyleRuleType::Viewport: 449 449 #endif 450 450 break; … … 470 470 return traverseRules([&] (const StyleRuleBase& rule) { 471 471 switch (rule.type()) { 472 case StyleRule Base::Style: {472 case StyleRuleType::Style: { 473 473 auto* properties = downcast<StyleRule>(rule).propertiesWithoutDeferredParsing(); 474 474 return properties && properties->traverseSubresources(handler); 475 475 } 476 case StyleRule Base::FontFace:476 case StyleRuleType::FontFace: 477 477 return downcast<StyleRuleFontFace>(rule).properties().traverseSubresources(handler); 478 case StyleRule Base::Import:478 case StyleRuleType::Import: 479 479 if (auto* cachedResource = downcast<StyleRuleImport>(rule).cachedCSSStyleSheet()) 480 480 return handler(*cachedResource); 481 481 return false; 482 case StyleRule Base::Media:483 case StyleRule Base::Page:484 case StyleRule Base::Keyframes:485 case StyleRule Base::Namespace:486 case StyleRule Base::Unknown:487 case StyleRule Base::Charset:488 case StyleRule Base::Keyframe:489 case StyleRule Base::Supports:482 case StyleRuleType::Media: 483 case StyleRuleType::Page: 484 case StyleRuleType::Keyframes: 485 case StyleRuleType::Namespace: 486 case StyleRuleType::Unknown: 487 case StyleRuleType::Charset: 488 case StyleRuleType::Keyframe: 489 case StyleRuleType::Supports: 490 490 #if ENABLE(CSS_DEVICE_ADAPTATION) 491 case StyleRule Base::Viewport:491 case StyleRuleType::Viewport: 492 492 #endif 493 493 return false; -
trunk/Source/WebCore/css/parser/CSSParser.cpp
r251611 r251655 200 200 201 201 ParsedPropertyVector parsedProperties; 202 if (!CSSPropertyParser::parseValue(shorthandID, false, resolvedTokens, m_context, parsedProperties, StyleRule ::Style))202 if (!CSSPropertyParser::parseValue(shorthandID, false, resolvedTokens, m_context, parsedProperties, StyleRuleType::Style)) 203 203 return nullptr; 204 204 -
trunk/Source/WebCore/css/parser/CSSParserContext.h
r247050 r251655 27 27 28 28 #include "CSSParserMode.h" 29 #include "StyleRuleType.h" 29 30 #include "TextEncoding.h" 30 31 #include <wtf/HashFunctions.h> 32 #include <wtf/Optional.h> 31 33 #include <wtf/URL.h> 32 34 #include <wtf/URLHash.h> … … 40 42 WTF_MAKE_FAST_ALLOCATED; 41 43 public: 44 42 45 CSSParserContext(CSSParserMode, const URL& baseURL = URL()); 43 46 WEBCORE_EXPORT CSSParserContext(const Document&, const URL& baseURL = URL(), const String& charset = emptyString()); … … 46 49 String charset; 47 50 CSSParserMode mode { HTMLStandardMode }; 51 Optional<StyleRuleType> enclosingRuleType; 48 52 bool isHTMLDocument { false }; 49 53 #if ENABLE(TEXT_AUTOSIZING) -
trunk/Source/WebCore/css/parser/CSSParserImpl.cpp
r248846 r251655 86 86 { 87 87 CSSParserImpl parser(context, string); 88 StyleRule::Type ruleType = StyleRule::Style; 89 #if ENABLE(CSS_DEVICE_ADAPTATION) 90 if (declaration->cssParserMode() == CSSViewportRuleMode) 91 ruleType = StyleRule::Viewport; 92 #endif 88 auto ruleType = context.enclosingRuleType.valueOr(StyleRuleType::Style); 93 89 parser.consumeDeclarationValue(parser.tokenizer()->tokenRange(), propertyID, important, ruleType); 94 90 if (parser.m_parsedProperties.isEmpty()) … … 163 159 164 160 CSSParserImpl parser(context, string); 165 parser.consumeDeclarationList(parser.tokenizer()->tokenRange(), StyleRule ::Style);161 parser.consumeDeclarationList(parser.tokenizer()->tokenRange(), StyleRuleType::Style); 166 162 return createStyleProperties(parser.m_parsedProperties, context.mode); 167 163 } … … 174 170 } 175 171 CSSParserImpl parser(context, styleSheet); 176 parser.consumeDeclarationList(tokenRange, StyleRule ::Style);172 parser.consumeDeclarationList(tokenRange, StyleRuleType::Style); 177 173 return createStyleProperties(parser.m_parsedProperties, context.mode); 178 174 } … … 202 198 { 203 199 CSSParserImpl parser(context, string); 204 StyleRule::Type ruleType = StyleRule::Style; 205 #if ENABLE(CSS_DEVICE_ADAPTATION) 206 if (declaration->cssParserMode() == CSSViewportRuleMode) 207 ruleType = StyleRule::Viewport; 208 #endif 200 auto ruleType = context.enclosingRuleType.valueOr(StyleRuleType::Style); 209 201 parser.consumeDeclarationList(parser.tokenizer()->tokenRange(), ruleType); 210 202 if (parser.m_parsedProperties.isEmpty()) … … 307 299 { 308 300 ASSERT(m_parsedProperties.isEmpty()); 309 consumeDeclaration(range, StyleRule ::Style);301 consumeDeclaration(range, StyleRuleType::Style); 310 302 bool result = !m_parsedProperties.isEmpty(); 311 303 m_parsedProperties.clear(); … … 317 309 CSSParserObserverWrapper wrapper(observer); 318 310 CSSParserImpl parser(context, declaration, nullptr, &wrapper); 319 observer.startRuleHeader(StyleRule ::Style, 0);311 observer.startRuleHeader(StyleRuleType::Style, 0); 320 312 observer.endRuleHeader(1); 321 parser.consumeDeclarationList(parser.tokenizer()->tokenRange(), StyleRule ::Style);313 parser.consumeDeclarationList(parser.tokenizer()->tokenRange(), StyleRuleType::Style); 322 314 } 323 315 … … 511 503 if (m_observerWrapper) { 512 504 unsigned endOffset = m_observerWrapper->endOffset(prelude); 513 m_observerWrapper->observer().startRuleHeader(StyleRule ::Import, m_observerWrapper->startOffset(prelude));505 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Import, m_observerWrapper->startOffset(prelude)); 514 506 m_observerWrapper->observer().endRuleHeader(endOffset); 515 507 m_observerWrapper->observer().startRuleBody(endOffset); … … 541 533 542 534 if (m_observerWrapper) { 543 m_observerWrapper->observer().startRuleHeader(StyleRule ::Media, m_observerWrapper->startOffset(prelude));535 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Media, m_observerWrapper->startOffset(prelude)); 544 536 m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude)); 545 537 m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block)); … … 567 559 568 560 if (m_observerWrapper) { 569 m_observerWrapper->observer().startRuleHeader(StyleRule ::Supports, m_observerWrapper->startOffset(prelude));561 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Supports, m_observerWrapper->startOffset(prelude)); 570 562 m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude)); 571 563 m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block)); … … 592 584 if (m_observerWrapper) { 593 585 unsigned endOffset = m_observerWrapper->endOffset(prelude); 594 m_observerWrapper->observer().startRuleHeader(StyleRule ::Viewport, m_observerWrapper->startOffset(prelude));586 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Viewport, m_observerWrapper->startOffset(prelude)); 595 587 m_observerWrapper->observer().endRuleHeader(endOffset); 596 588 m_observerWrapper->observer().startRuleBody(endOffset); … … 610 602 if (m_observerWrapper) { 611 603 unsigned endOffset = m_observerWrapper->endOffset(prelude); 612 m_observerWrapper->observer().startRuleHeader(StyleRule ::FontFace, m_observerWrapper->startOffset(prelude));604 m_observerWrapper->observer().startRuleHeader(StyleRuleType::FontFace, m_observerWrapper->startOffset(prelude)); 613 605 m_observerWrapper->observer().endRuleHeader(endOffset); 614 606 m_observerWrapper->observer().startRuleBody(endOffset); … … 616 608 } 617 609 618 consumeDeclarationList(block, StyleRule ::FontFace);610 consumeDeclarationList(block, StyleRuleType::FontFace); 619 611 return StyleRuleFontFace::create(createStyleProperties(m_parsedProperties, m_context.mode)); 620 612 } … … 639 631 640 632 if (m_observerWrapper) { 641 m_observerWrapper->observer().startRuleHeader(StyleRule ::Keyframes, m_observerWrapper->startOffset(rangeCopy));633 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Keyframes, m_observerWrapper->startOffset(rangeCopy)); 642 634 m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude)); 643 635 m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(block)); … … 663 655 if (m_observerWrapper) { 664 656 unsigned endOffset = m_observerWrapper->endOffset(prelude); 665 m_observerWrapper->observer().startRuleHeader(StyleRule ::Page, m_observerWrapper->startOffset(prelude));657 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Page, m_observerWrapper->startOffset(prelude)); 666 658 m_observerWrapper->observer().endRuleHeader(endOffset); 667 659 } 668 660 669 consumeDeclarationList(block, StyleRule ::Style);661 consumeDeclarationList(block, StyleRuleType::Style); 670 662 671 663 return StyleRulePage::create(createStyleProperties(m_parsedProperties, m_context.mode), WTFMove(selectorList)); … … 691 683 692 684 if (m_observerWrapper) { 693 m_observerWrapper->observer().startRuleHeader(StyleRule ::Keyframe, m_observerWrapper->startOffset(prelude));685 m_observerWrapper->observer().startRuleHeader(StyleRuleType::Keyframe, m_observerWrapper->startOffset(prelude)); 694 686 m_observerWrapper->observer().endRuleHeader(m_observerWrapper->endOffset(prelude)); 695 687 } 696 688 697 consumeDeclarationList(block, StyleRule ::Keyframe);689 consumeDeclarationList(block, StyleRuleType::Keyframe); 698 690 return StyleRuleKeyframe::create(WTFMove(keyList), createStyleProperties(m_parsedProperties, m_context.mode)); 699 691 } … … 704 696 selectors.consumeWhitespace(); 705 697 CSSParserTokenRange originalRange = selectors; 706 wrapper.observer().startRuleHeader(StyleRule ::Style, wrapper.startOffset(originalRange));698 wrapper.observer().startRuleHeader(StyleRuleType::Style, wrapper.startOffset(originalRange)); 707 699 708 700 while (!selectors.atEnd()) { … … 740 732 } 741 733 742 consumeDeclarationList(block, StyleRule ::Style);734 consumeDeclarationList(block, StyleRuleType::Style); 743 735 return StyleRule::create(createStyleProperties(m_parsedProperties, m_context.mode), m_context.hasDocumentSecurityOrigin, WTFMove(selectorList)); 744 736 } 745 737 746 void CSSParserImpl::consumeDeclarationList(CSSParserTokenRange range, StyleRule ::Type ruleType)738 void CSSParserImpl::consumeDeclarationList(CSSParserTokenRange range, StyleRuleType ruleType) 747 739 { 748 740 ASSERT(m_parsedProperties.isEmpty()); 749 741 750 bool useObserver = m_observerWrapper && (ruleType == StyleRule ::Style || ruleType == StyleRule::Keyframe);742 bool useObserver = m_observerWrapper && (ruleType == StyleRuleType::Style || ruleType == StyleRuleType::Keyframe); 751 743 if (useObserver) { 752 744 m_observerWrapper->observer().startRuleBody(m_observerWrapper->previousTokenStartOffset(range)); … … 777 769 case AtKeywordToken: { 778 770 // FIXME-NEWPARSER: Support apply 779 AllowedRulesType allowedRules = /* ruleType == StyleRule ::Style && RuntimeEnabledFeatures::cssApplyAtRulesEnabled() ? ApplyRules :*/ NoRules;771 AllowedRulesType allowedRules = /* ruleType == StyleRuleType::Style && RuntimeEnabledFeatures::cssApplyAtRulesEnabled() ? ApplyRules :*/ NoRules; 780 772 RefPtr<StyleRuleBase> rule = consumeAtRule(range, allowedRules); 781 773 ASSERT_UNUSED(rule, !rule); … … 796 788 } 797 789 798 void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRule ::Type ruleType)790 void CSSParserImpl::consumeDeclaration(CSSParserTokenRange range, StyleRuleType ruleType) 799 791 { 800 792 CSSParserTokenRange rangeCopy = range; // For inspector callbacks … … 827 819 } 828 820 829 if (important && (ruleType == StyleRule ::FontFace || ruleType == StyleRule::Keyframe))821 if (important && (ruleType == StyleRuleType::FontFace || ruleType == StyleRuleType::Keyframe)) 830 822 return; 831 823 … … 833 825 consumeDeclarationValue(range.makeSubRange(&range.peek(), declarationValueEnd), propertyID, important, ruleType); 834 826 835 if (m_observerWrapper && (ruleType == StyleRule ::Style || ruleType == StyleRule::Keyframe)) {827 if (m_observerWrapper && (ruleType == StyleRuleType::Style || ruleType == StyleRuleType::Keyframe)) { 836 828 m_observerWrapper->observer().observeProperty( 837 829 m_observerWrapper->startOffset(rangeCopy), m_observerWrapper->endOffset(rangeCopy), … … 846 838 } 847 839 848 void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID propertyID, bool important, StyleRule ::Type ruleType)840 void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID propertyID, bool important, StyleRuleType ruleType) 849 841 { 850 842 CSSPropertyParser::parseValue(propertyID, important, range, m_context, m_parsedProperties, ruleType); -
trunk/Source/WebCore/css/parser/CSSParserImpl.h
r246490 r251655 139 139 RefPtr<StyleRule> consumeStyleRule(CSSParserTokenRange prelude, CSSParserTokenRange block); 140 140 141 void consumeDeclarationList(CSSParserTokenRange, StyleRule ::Type);142 void consumeDeclaration(CSSParserTokenRange, StyleRule ::Type);143 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool important, StyleRule ::Type);141 void consumeDeclarationList(CSSParserTokenRange, StyleRuleType); 142 void consumeDeclaration(CSSParserTokenRange, StyleRuleType); 143 void consumeDeclarationValue(CSSParserTokenRange, CSSPropertyID, bool important, StyleRuleType); 144 144 void consumeCustomPropertyValue(CSSParserTokenRange, const AtomString& propertyName, bool important); 145 145 -
trunk/Source/WebCore/css/parser/CSSParserObserver.h
r218588 r251655 34 34 public: 35 35 virtual ~CSSParserObserver() { }; 36 virtual void startRuleHeader(StyleRule ::Type, unsigned offset) = 0;36 virtual void startRuleHeader(StyleRuleType, unsigned offset) = 0; 37 37 virtual void endRuleHeader(unsigned offset) = 0; 38 38 virtual void observeSelector(unsigned startOffset, unsigned endOffset) = 0; -
trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp
r251252 r251655 260 260 } 261 261 262 bool CSSPropertyParser::parseValue(CSSPropertyID propertyID, bool important, const CSSParserTokenRange& range, const CSSParserContext& context, ParsedPropertyVector& parsedProperties, StyleRule ::Type ruleType)262 bool CSSPropertyParser::parseValue(CSSPropertyID propertyID, bool important, const CSSParserTokenRange& range, const CSSParserContext& context, ParsedPropertyVector& parsedProperties, StyleRuleType ruleType) 263 263 { 264 264 int parsedPropertiesSize = parsedProperties.size(); … … 268 268 269 269 #if ENABLE(CSS_DEVICE_ADAPTATION) 270 if (ruleType == StyleRule ::Viewport)270 if (ruleType == StyleRuleType::Viewport) 271 271 parseSuccess = parser.parseViewportDescriptor(propertyID, important); 272 272 else 273 273 #endif 274 if (ruleType == StyleRule ::FontFace)274 if (ruleType == StyleRuleType::FontFace) 275 275 parseSuccess = parser.parseFontFaceDescriptor(propertyID); 276 276 else -
trunk/Source/WebCore/css/parser/CSSPropertyParser.h
r250849 r251655 43 43 static bool parseValue(CSSPropertyID, bool important, 44 44 const CSSParserTokenRange&, const CSSParserContext&, 45 Vector<CSSProperty, 256>&, StyleRule ::Type);45 Vector<CSSProperty, 256>&, StyleRuleType); 46 46 47 47 // Parses a non-shorthand CSS property -
trunk/Source/WebCore/css/parser/CSSTokenizer.cpp
r248659 r251655 328 328 { 329 329 if (m_input.peekWithoutReplacement(0) == '+' 330 && (isASCIIHexDigit(m_input.peekWithoutReplacement(1)) 331 || m_input.peekWithoutReplacement(1) == '?')) { 330 && (isASCIIHexDigit(m_input.peekWithoutReplacement(1)) || m_input.peekWithoutReplacement(1) == '?')) { 332 331 m_input.advance(); 333 332 return consumeUnicodeRange(); -
trunk/Source/WebCore/inspector/InspectorStyleSheet.cpp
r251038 r251655 102 102 { 103 103 for (auto& data : dataList) { 104 if (data->type == WebCore::StyleRule ::Style)104 if (data->type == WebCore::StyleRuleType::Style) 105 105 target.append(data.copyRef()); 106 else if (data->type == WebCore::StyleRule ::Media)106 else if (data->type == WebCore::StyleRuleType::Media) 107 107 flattenSourceData(data->childRules, target); 108 else if (data->type == WebCore::StyleRule ::Supports)108 else if (data->type == WebCore::StyleRuleType::Supports) 109 109 flattenSourceData(data->childRules, target); 110 110 } … … 155 155 156 156 private: 157 void startRuleHeader(StyleRule ::Type, unsigned) override;157 void startRuleHeader(StyleRuleType, unsigned) override; 158 158 void endRuleHeader(unsigned) override; 159 159 void observeSelector(unsigned startOffset, unsigned endOffset) override; … … 175 175 }; 176 176 177 void StyleSheetHandler::startRuleHeader(StyleRule ::Type type, unsigned offset)177 void StyleSheetHandler::startRuleHeader(StyleRuleType type, unsigned offset) 178 178 { 179 179 // Pop off data for a previous invalid rule. … … 1569 1569 { 1570 1570 if (m_styleText.isEmpty()) { 1571 auto result = CSSRuleSourceData::create(StyleRule ::Style);1571 auto result = CSSRuleSourceData::create(StyleRuleType::Style); 1572 1572 result->ruleBodyRange.start = 0; 1573 1573 result->ruleBodyRange.end = 0;
Note:
See TracChangeset
for help on using the changeset viewer.