Source/WebCore/ChangeLog

 12020-03-09 Frank Yang
 2
 3 Unprefix -webkit-text-orientation
 4 https://bugs.webkit.org/show_bug.cgi?id=196139
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 In order to unprefix -webkit-text-orientation to be text-orientation, a new property, "text-orientation"
 9 is added to CSSProperties.json. However only adding a new property is not enough because -webkit-text-orientation
 10 is a high-priority property, and without extra logic, the CSS property ordering rule cannot be enforced because
 11 high-priority properties are applied to elements in the order they appear in the generated CSSPropertyNames.cpp file.
 12 Therefore a codegen flag, "related-property" is added to both -webkit-text-orientation and text-orientation to point to
 13 each other, so that when applying high priorities, the algorithm treats both -webkit-text-orientation and text-orientation
 14 as the same property, and thus the CSS inline property ordering rule will take effect.
 15
 16 This code change also helps future developments when we want to unprefix other high-priority properties.
 17
 18 Changes made in:
 19 CSSComputedStyleDeclaration.cpp
 20 CSSParserFastPaths.cpp
 21 StyleBuilderCustom.h
 22 are for parsing the newly added "text-orientation" property
 23
 24 Changes made in:
 25 CSSProperties.json
 26 makeprop.pl
 27 CSSParserImpl.cpp
 28 are for implementing the logic to treat the prefixed and unprefixed CSS properties as the
 29 same property so that the CSS inline property order rule will hold
 30
 31
 32 Tests: fast/text/orientation-inheritance.html
 33 fast/text/orientation-mixed-unprefix.html
 34 fast/text/orientation-sideways-prefix-unprefix.html
 35 fast/text/orientation-sideways-unprefix.html
 36 fast/text/orientation-upright-unprefix.html
 37 fast/text/test-orientation-parsing-001.html
 38 fast/text/text-orientation-parse-competition.html
 39 fast/text/text-orientation-parse.html
 40
 41 * WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme:
 42 * css/CSSComputedStyleDeclaration.cpp:
 43 (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
 44 * css/CSSProperties.json:
 45 * css/makeprop.pl:
 46 (addProperty):
 47 * css/parser/CSSParserFastPaths.cpp:
 48 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
 49 (WebCore::CSSParserFastPaths::isKeywordPropertyID):
 50 * css/parser/CSSParserImpl.cpp:
 51 (WebCore::filterProperties):
 52 * style/StyleBuilderCustom.h:
 53 (WebCore::Style::BuilderCustom::applyValueTextOrientation):
 54
1552020-02-19 Zalan Bujtas
256
357 [LFC][Floats] FloatingContext::constraints should be able to handle empty candidate ranges (points)

Source/WebCore/WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme

4040 debugDocumentVersioning = "YES"
4141 debugServiceExtension = "internal"
4242 allowLocationSimulation = "YES">
 43
 44 runnableDebuggingMode = "0"
 45 BundleIdentifier = "org.webkit.MiniBrowser"
 46 FilePath = "/Users/framiere/projects/build/Debug/MiniBrowser.app">
 47
4348
4449
4550 buildConfiguration = "Release"

Source/WebCore/css/CSSComputedStyleDeclaration.cpp

@@RefPtr ComputedStyleExtractor::valueForPropertyInStyle(const RenderSty
35083508 return cssValuePool.createValue(style.textCombine());
35093509 case CSSPropertyWebkitTextOrientation:
35103510 return CSSPrimitiveValue::create(style.textOrientation());
 3511 case CSSPropertyTextOrientation:
 3512 return CSSPrimitiveValue::create(style.textOrientation());
35113513 case CSSPropertyWebkitLineBoxContain:
35123514 return createLineBoxContainValue(style.lineBoxContain());
35133515 case CSSPropertyAlt:

Source/WebCore/css/CSSProperties.json

116116 "Whether the property needs to be applied before non-high-priority properties",
117117 "in CSS cascading order.",
118118 "",
 119 "* related-property:",
 120 "Indicates the prefixed or unprefixed version of the same property",
 121 "e.g. -webkit-text-orientation has a related property text-orientation",
 122 "which is an unprefixed version, and vice versa.",
 123 "Using this instead of the alias flag makes it possible to have independent control",
 124 " of the behavior of the prefixed and unprefixed version of a property,",
 125 "but still follow the precedence rule since the two related properties target the same HTML element",
 126 "If using this flag, make sure both the prefixed and unprefixed property have specified a related-property",
 127 "and that they are pointing to each other",
 128 "",
119129 "* aliases:",
120130 "An array of the alternative names for this property.",
121131 "",

619629 },
620630 "status": "non-standard"
621631 },
 632 "text-orientation": {
 633 "inherited": true,
 634 "values": [
 635 "sideways",
 636 "mixed",
 637 "upright"
 638 ],
 639 "codegen-properties": {
 640 "custom": "Value",
 641 "related-property": "-webkit-text-orientation",
 642 "high-priority": true
 643 },
 644 "specification": {
 645 "category": "css-writing-modes",
 646 "url": "https://www.w3.org/TR/css-writing-modes-3/#text-orientation"
 647 }
 648 },
622649 "-webkit-text-orientation": {
623650 "inherited": true,
624651 "values": [

638665 "aliases": [
639666 "-epub-text-orientation"
640667 ],
 668 "related-property": "text-orientation",
641669 "custom": "Value",
642670 "high-priority": true
643671 },

Source/WebCore/css/makeprop.pl

@@my %styleBuilderOptions = (
8585);
8686my %nameToId;
8787my %nameToAliases;
 88my %relatedProperty;
8889
8990for my $name (@allNames) {
9091 my $value = $propertiesHashRef->{$name};

@@sub addProperty($$)
193194 next;
194195 } elsif ($codegenOptionName eq "high-priority") {
195196 $nameIsHighPriority{$name} = 1;
 197 } elsif ($codegenOptionName eq "related-property") {
 198 $relatedProperty{$name} = $codegenProperties->{"related-property"}
196199 } elsif ($codegenOptionName eq "aliases") {
197200 $nameToAliases{$name} = $codegenProperties->{"aliases"};
198201 } elsif ($styleBuilderOptions{$codegenOptionName}) {

@@bool CSSProperty::isInheritedProperty(CSSPropertyID id)
415418 ASSERT(id != CSSPropertyInvalid);
416419 return isInheritedPropertyTable[id];
417420}
 421
 422CSSPropertyID getRelatedPropertyId(CSSPropertyID id)
 423{
 424 switch(id) {
 425EOF
 426for my $name (@names) {
 427 if (!$relatedProperty{$name}) {
 428 next;
 429 }
 430 print GPERF " case CSSPropertyID::CSSProperty" . $nameToId{$name} . ":\n";
 431 print GPERF " return CSSPropertyID::CSSProperty" . $nameToId{$relatedProperty{$name}} . ";\n";
 432}
 433
 434print GPERF << "EOF";
 435 default:
 436 return CSSPropertyID::CSSPropertyInvalid;
 437 }
 438}
418439
419440Vector CSSProperty::aliasesForProperty(CSSPropertyID id)
420441{

@@const char* getPropertyName(CSSPropertyID);
531552const WTF::AtomString& getPropertyNameAtomString(CSSPropertyID id);
532553WTF::String getPropertyNameString(CSSPropertyID id);
533554WTF::String getJSPropertyName(CSSPropertyID);
 555CSSPropertyID getRelatedPropertyId(CSSPropertyID id);
534556
535557inline CSSPropertyID convertToCSSPropertyID(int value)
536558{

Source/WebCore/css/parser/CSSParserFastPaths.cpp

@@bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
668668#endif
669669 case CSSPropertyWebkitTextOrientation: // mixed | upright | sideways | sideways-right
670670 return valueID == CSSValueMixed || valueID == CSSValueUpright || valueID == CSSValueSideways || valueID == CSSValueSidewaysRight;
 671 case CSSPropertyTextOrientation:
 672 return valueID == CSSValueMixed || valueID == CSSValueUpright || valueID == CSSValueSideways;
671673 case CSSPropertyTextOverflow: // clip | ellipsis
672674 return valueID == CSSValueClip || valueID == CSSValueEllipsis;
673675 case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision

@@bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
869871 case CSSPropertyResize:
870872 case CSSPropertyTableLayout:
871873 case CSSPropertyTextAlign:
 874 case CSSPropertyTextOrientation:
872875 case CSSPropertyTextOverflow:
873876 case CSSPropertyTextRendering:
874877 case CSSPropertyTextTransform:

@@bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
943946 // case CSSPropertyTextCombineUpright:
944947 // case CSSPropertyTextDecorationStyle:
945948 // case CSSPropertyTextJustify:
946  // case CSSPropertyTextOrientation:
947949 // case CSSPropertyUserSelect:
948950#if ENABLE(CSS_TRAILING_WORD)
949951 case CSSPropertyAppleTrailingWord:

Source/WebCore/css/parser/CSSParserImpl.cpp

@@static inline void filterProperties(bool important, const ParsedPropertyVector&
123123 // FIXME: Do we need to do anything here?
124124 } */
125125
 126 const unsigned relatedPropertyId = getRelatedPropertyId(property.id());
 127
126128 if (seenProperties.test(propertyIDIndex))
127129 continue;
128  seenProperties.set(propertyIDIndex);
 130
 131 if (property.id() != CSSPropertyInvalid && relatedPropertyId != CSSPropertyInvalid) {
 132 const unsigned relatedPropertyIDIndex = relatedPropertyId - firstCSSProperty;
 133 seenProperties.set(relatedPropertyIDIndex);
 134 seenProperties.set(propertyIDIndex);
 135 } else
 136 seenProperties.set(propertyIDIndex);
129137
130138 output[--unusedEntries] = property;
131139 }

Source/WebCore/style/StyleBuilderCustom.h

@@public:
133133 static void applyValueTextAlign(BuilderState&, CSSValue&);
134134 static void applyValueWebkitLocale(BuilderState&, CSSValue&);
135135 static void applyValueWebkitTextOrientation(BuilderState&, CSSValue&);
 136 static void applyValueTextOrientation(BuilderState&, CSSValue&);
136137#if ENABLE(TEXT_AUTOSIZING)
137138 static void applyValueWebkitTextSizeAdjust(BuilderState&, CSSValue&);
138139#endif

@@inline void BuilderCustom::applyValueWebkitTextOrientation(BuilderState& builder
757758 builderState.setTextOrientation(downcast(value));
758759}
759760
 761inline void BuilderCustom::applyValueTextOrientation(BuilderState& builderState, CSSValue& value)
 762{
 763 builderState.setTextOrientation(downcast(value));
 764}
 765
760766#if ENABLE(TEXT_AUTOSIZING)
761767inline void BuilderCustom::applyValueWebkitTextSizeAdjust(BuilderState& builderState, CSSValue& value)
762768{

Tools/ChangeLog

 12020-03-09 Frank Yang
 2
 3 Unprefix -webkit-text-orientation
 4 https://bugs.webkit.org/show_bug.cgi?id=196139
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This change is made to add the extra flag "related-property" in CSSProperty.json
 9 in the jsonchecker so that the jsonchecker would not complain about unrecognized key
 10
 11 * Scripts/webkitpy/style/checkers/jsonchecker.py:
 12 (JSONCSSPropertiesChecker.check_codegen_properties):
 13
1142020-02-19 Jonathan Bedard
215
316 results.webkit.org: Correctly report JSC tests for windows

Tools/Scripts/webkitpy/style/checkers/jsonchecker.py

@@class JSONCSSPropertiesChecker(JSONChecker):
287287 'longhands': self.validate_array,
288288 'name-for-methods': self.validate_string,
289289 'no-default-color': self.validate_boolean,
 290 'related-property': self.validate_string,
290291 'runtime-flag': self.validate_string,
291292 'setter': self.validate_string,
292293 'skip-builder': self.validate_boolean,

LayoutTests/ChangeLog

 12020-03-09 Frank Yang
 2
 3 Unprefix -webkit-text-orientation
 4 https://bugs.webkit.org/show_bug.cgi?id=196139
 5
 6 Added test cases to check that Webkit can now parse text-orientation correctly,
 7 as well as that the precedence rule for CSS property still applies when both
 8 -webkit-text-orientation and text-orientation property are present, the second
 9 one takes precedence.
 10
 11 Reviewed by NOBODY (OOPS!).
 12
 13 * fast/text/orientation-inheritance-expected.html: Added.
 14 * fast/text/orientation-inheritance.html: Added.
 15 * fast/text/orientation-mixed-unprefix-expected.html: Added.
 16 * fast/text/orientation-mixed-unprefix.html: Added.
 17 * fast/text/orientation-sideways-prefix-unprefix-expected.html: Added.
 18 * fast/text/orientation-sideways-prefix-unprefix.html: Added.
 19 * fast/text/orientation-sideways-unprefix-expected.html: Added.
 20 * fast/text/orientation-sideways-unprefix.html: Added.
 21 * fast/text/orientation-upright-unprefix-expected.html: Added.
 22 * fast/text/orientation-upright-unprefix.html: Added.
 23 * fast/text/test-orientation-parsing-001-expected.txt: Added.
 24 * fast/text/test-orientation-parsing-001.html: Added.
 25 * fast/text/text-orientation-parse-competition-expected.txt: Added.
 26 * fast/text/text-orientation-parse-competition.html: Added.
 27 * fast/text/text-orientation-parse-expected.txt: Added.
 28 * fast/text/text-orientation-parse.html: Added.
 29
1302020-02-19 Jason Lawrence
231
332 [ Mac wk2 ] http/tests/inspector/network/har/har-page.html is flaky failing

LayoutTests/fast/text/orientation-inheritance-expected.html

 1
 2
 3
 4
 5
 6 This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司 abcd
 10
 11 你好 Hello World!
 12
 13
 14
苹果公司 abcd
 15
 16 你好 Hello World!
 17
 18
 19
苹果公司 abcd
 20
 21 你好 Hello World!
 22
 23
 24
 25
 26

LayoutTests/fast/text/orientation-inheritance.html

 1
 2
 3
 4
 5
 6 This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司 abcd
 10
 11 你好 Hello World!
 12
 13
 14
苹果公司 abcd
 15
 16 你好 Hello World!
 17
 18
 19
苹果公司 abcd
 20
 21 你好 Hello World!
 22
 23
 24
 25
 26

LayoutTests/fast/text/orientation-mixed-unprefix-expected.html

 1
 2
 3
 4
 5
 6This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司abcd
 10
 11
 16
 17

LayoutTests/fast/text/orientation-mixed-unprefix.html

 1
 2
 3
 4
 5
 6This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司abcd
 10
 11
 16
 17

LayoutTests/fast/text/orientation-sideways-prefix-unprefix-expected.html

 1
 2
 3
 4
 5
 6 This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司 abcd
 10
 11
 12

LayoutTests/fast/text/orientation-sideways-prefix-unprefix.html

 1
 2
 3
 4
 5
 6 This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司 abcd
 10
 11
 12

LayoutTests/fast/text/orientation-sideways-unprefix-expected.html

 1
 2
 3
 4
 5
 6This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司 abcd
 10
 11
 16
 17

LayoutTests/fast/text/orientation-sideways-unprefix.html

 1
 2
 3
 4
 5
 6This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
苹果公司 abcd
 10
 11
 16
 17

LayoutTests/fast/text/orientation-upright-unprefix-expected.html

 1
 2
 3
 4
 5
 6This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
abcd
 10
 11
 16
 17

LayoutTests/fast/text/orientation-upright-unprefix.html

 1
 2
 3
 4
 5
 6This test makes sure that text-orientation: sideways is treated the same as text-orientation: sideways-right.
 7
 8
 9
abcd
 10
 11
 16
 17

LayoutTests/fast/text/test-orientation-parsing-001-expected.txt

 1PASS window.getComputedStyle(document.getElementById('test1')).webkitTextOrientation is "upright"
 2PASS window.getComputedStyle(document.getElementById('test2')).webkitTextOrientation is "sideways"
 3PASS window.getComputedStyle(document.getElementById('test3')).webkitTextOrientation is "upright"
 4PASS window.getComputedStyle(document.getElementById('test4')).webkitTextOrientation is "mixed"
 5PASS window.getComputedStyle(document.getElementById('test5')).webkitTextOrientation is "mixed"
 6PASS window.getComputedStyle(document.getElementById('test6')).webkitTextOrientation is "upright"
 7PASS window.getComputedStyle(document.getElementById('test7')).webkitTextOrientation is "upright"
 8PASS successfullyParsed is true
 9
 10TEST COMPLETE
 11

LayoutTests/fast/text/test-orientation-parsing-001.html

 1
 2
 3
 4
 5
 6
 7
 8 data-expected="mixed" title="text-orientation initial value">
 9
 10
 11 data-expected="upright">
 12
 13 data-expected="sideways">
 14
 15
 16
 17 data-expected="upright" title="text-orientation should inherit">
 18
 19
 20 data-expected="mixed">
 21
 22
 23 data-expected="mixed">
 24
 25 data-expected="upright">
 26
 27
 28 data-expected="upright">
 29
 30
 31
 32
 33
 34
 43
 44
 45
 46

LayoutTests/fast/text/text-orientation-parse-competition-expected.txt

 1PASS window.getComputedStyle(document.getElementById('test1')).webkitTextOrientation is "upright"
 2PASS successfullyParsed is true
 3
 4TEST COMPLETE
 5你好ABC

LayoutTests/fast/text/text-orientation-parse-competition.html

 1
 2
 3
 4
 5
 6
 7
你好ABC
 8
 11
 12
 13

LayoutTests/fast/text/text-orientation-parse-expected.txt

 1PASS window.getComputedStyle(document.getElementById('test1')).webkitTextOrientation is "sideways"
 2PASS window.getComputedStyle(document.getElementById('test2')).webkitTextOrientation is "sideways"
 3PASS window.getComputedStyle(document.getElementById('test3')).webkitTextOrientation is "sideways"
 4PASS window.getComputedStyle(document.getElementById('test4')).webkitTextOrientation is "sideways"
 5PASS window.getComputedStyle(document.getElementById('test5')).webkitTextOrientation is "upright"
 6PASS window.getComputedStyle(document.getElementById('test6')).webkitTextOrientation is "upright"
 7PASS window.getComputedStyle(document.getElementById('test7')).webkitTextOrientation is "upright"
 8PASS window.getComputedStyle(document.getElementById('test8')).webkitTextOrientation is "upright"
 9PASS window.getComputedStyle(document.getElementById('test9')).webkitTextOrientation is "upright"
 10PASS window.getComputedStyle(document.getElementById('test10')).webkitTextOrientation is "mixed"
 11PASS window.getComputedStyle(document.getElementById('test11')).webkitTextOrientation is "sideways"
 12PASS window.getComputedStyle(document.getElementById('test12')).webkitTextOrientation is "mixed"
 13PASS window.getComputedStyle(document.getElementById('test13')).webkitTextOrientation is "mixed"
 14PASS window.getComputedStyle(document.getElementById('test14')).webkitTextOrientation is "sideways"
 15PASS window.getComputedStyle(document.getElementById('test15')).webkitTextOrientation is "sideways"
 16PASS window.getComputedStyle(document.getElementById('test16')).webkitTextOrientation is "upright"
 17PASS window.getComputedStyle(document.getElementById('test17')).webkitTextOrientation is "upright"
 18PASS window.getComputedStyle(document.getElementById('test18')).webkitTextOrientation is "upright"
 19PASS window.getComputedStyle(document.getElementById('test19')).webkitTextOrientation is "upright"
 20PASS window.getComputedStyle(document.getElementById('test20')).webkitTextOrientation is "upright"
 21PASS window.getComputedStyle(document.getElementById('test21')).webkitTextOrientation is "mixed"
 22PASS window.getComputedStyle(document.getElementById('test22')).webkitTextOrientation is "sideways"
 23PASS window.getComputedStyle(document.getElementById('test23')).webkitTextOrientation is "upright"
 24PASS window.getComputedStyle(document.getElementById('test24')).webkitTextOrientation is "upright"
 25PASS window.getComputedStyle(document.getElementById('test25')).webkitTextOrientation is "sideways"
 26PASS window.getComputedStyle(document.getElementById('test26')).webkitTextOrientation is "sideways"
 27PASS window.getComputedStyle(document.getElementById('test27')).webkitTextOrientation is "sideways"
 28PASS successfullyParsed is true
 29
 30TEST COMPLETE
 31

LayoutTests/fast/text/text-orientation-parse.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 98
 99
 100
 101