Title: [287451] trunk
Revision
287451
Author
[email protected]
Date
2021-12-26 16:03:41 -0800 (Sun, 26 Dec 2021)

Log Message

Make -webkit-text-combine an inherited property
https://bugs.webkit.org/show_bug.cgi?id=234694

Reviewed by Simon Fraser.

Source/WebCore:

-webkit-text-combine is said to be inherited in CSSProperties.json, but it is not actually the case.
It should be inherited per-spec (for text-combine-upright).

https://drafts.csswg.org/css-writing-modes/#text-combine-upright

Test: fast/text/text-combine-inherited.html

* rendering/style/RenderStyle.cpp:
(WebCore::rareNonInheritedDataChangeRequiresLayout):
(WebCore::rareInheritedDataChangeRequiresLayout):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::textCombine const):
(WebCore::RenderStyle::setTextCombine):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

There are also WPT that already exist for the standard version (text-combine-upright):
- css/css-writing-modes/text-combine-upright-inherit-all-001.html
- css/css-writing-modes/text-combine-upright-inherit-all-002.html

* fast/text/text-combine-inherited-expected.html: Added.
* fast/text/text-combine-inherited.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (287450 => 287451)


--- trunk/LayoutTests/ChangeLog	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/LayoutTests/ChangeLog	2021-12-27 00:03:41 UTC (rev 287451)
@@ -1,3 +1,17 @@
+2021-12-26  Tim Nguyen  <[email protected]>
+
+        Make -webkit-text-combine an inherited property
+        https://bugs.webkit.org/show_bug.cgi?id=234694
+
+        Reviewed by Simon Fraser.
+
+        There are also WPT that already exist for the standard version (text-combine-upright):
+        - css/css-writing-modes/text-combine-upright-inherit-all-001.html
+        - css/css-writing-modes/text-combine-upright-inherit-all-002.html
+
+        * fast/text/text-combine-inherited-expected.html: Added.
+        * fast/text/text-combine-inherited.html: Added.
+
 2021-12-25  Alan Bujtas  <[email protected]>
 
         [iOS] Rebaselining after r287440.

Added: trunk/LayoutTests/fast/text/text-combine-inherited-expected.html (0 => 287451)


--- trunk/LayoutTests/fast/text/text-combine-inherited-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/text-combine-inherited-expected.html	2021-12-27 00:03:41 UTC (rev 287451)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>Test inheritance of -webkit-text-combine</title>
+<style>
+    html { writing-mode: vertical-rl; font: 24px serif }
+    span { -webkit-text-combine: horizontal; }
+</style>
+<p lang="zh-Hant"><span>民</span><span>105</span><span>年</span><span>4</span><span>月</span><span>29</span><span>日</span></p>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/text-combine-inherited.html (0 => 287451)


--- trunk/LayoutTests/fast/text/text-combine-inherited.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/text-combine-inherited.html	2021-12-27 00:03:41 UTC (rev 287451)
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>Test inheritance of -webkit-text-combine</title>
+<style>
+    html { writing-mode: vertical-rl; font: 24px serif }
+    p { -webkit-text-combine: horizontal; }
+</style>
+<p lang="zh-Hant"><span>民</span><span>105</span><span>年</span><span>4</span><span>月</span><span>29</span><span>日</span></p>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (287450 => 287451)


--- trunk/Source/WebCore/ChangeLog	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/ChangeLog	2021-12-27 00:03:41 UTC (rev 287451)
@@ -1,3 +1,32 @@
+2021-12-26  Tim Nguyen  <[email protected]>
+
+        Make -webkit-text-combine an inherited property
+        https://bugs.webkit.org/show_bug.cgi?id=234694
+
+        Reviewed by Simon Fraser.
+
+        -webkit-text-combine is said to be inherited in CSSProperties.json, but it is not actually the case.
+        It should be inherited per-spec (for text-combine-upright).
+
+        https://drafts.csswg.org/css-writing-modes/#text-combine-upright
+
+        Test: fast/text/text-combine-inherited.html
+
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::rareNonInheritedDataChangeRequiresLayout):
+        (WebCore::rareInheritedDataChangeRequiresLayout):
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::textCombine const):
+        (WebCore::RenderStyle::setTextCombine):
+        * rendering/style/StyleRareInheritedData.cpp:
+        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
+        (WebCore::StyleRareInheritedData::operator== const):
+        * rendering/style/StyleRareInheritedData.h:
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator== const):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2021-12-26  Frédéric Wang  <[email protected]>
 
         null ptr deref in WebCore::indexForVisiblePosition()

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (287450 => 287451)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2021-12-27 00:03:41 UTC (rev 287451)
@@ -709,9 +709,6 @@
         // Don't return; keep looking for another change
     }
 
-    if (first.textCombine != second.textCombine)
-        return true;
-
     if (first.breakBefore != second.breakBefore
         || first.breakAfter != second.breakAfter
         || first.breakInside != second.breakInside)
@@ -778,6 +775,7 @@
         || first.hyphenationLimitAfter != second.hyphenationLimitAfter
         || first.hyphenationString != second.hyphenationString
         || first.rubyPosition != second.rubyPosition
+        || first.textCombine != second.textCombine
         || first.textEmphasisMark != second.textEmphasisMark
         || first.textEmphasisPosition != second.textEmphasisPosition
         || first.textEmphasisCustomMark != second.textEmphasisCustomMark

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (287450 => 287451)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2021-12-27 00:03:41 UTC (rev 287451)
@@ -694,7 +694,7 @@
     bool hasPositionedMask() const { return m_rareNonInheritedData->mask->hasImage(); }
     bool hasMask() const { return m_rareNonInheritedData->mask->hasImage() || m_rareNonInheritedData->maskBoxImage.hasImage(); }
 
-    TextCombine textCombine() const { return static_cast<TextCombine>(m_rareNonInheritedData->textCombine); }
+    TextCombine textCombine() const { return static_cast<TextCombine>(m_rareInheritedData->textCombine); }
     bool hasTextCombine() const { return textCombine() != TextCombine::None; }
 
     const TabSize& tabSize() const { return m_rareInheritedData->tabSize; }
@@ -1248,7 +1248,7 @@
     void setTranslate(RefPtr<TranslateTransformOperation>&&);
 
     void setSpeakAs(OptionSet<SpeakAs> s) { SET_VAR(m_rareInheritedData, speakAs, s.toRaw()); }
-    void setTextCombine(TextCombine v) { SET_VAR(m_rareNonInheritedData, textCombine, static_cast<unsigned>(v)); }
+    void setTextCombine(TextCombine v) { SET_VAR(m_rareInheritedData, textCombine, static_cast<unsigned>(v)); }
     void setTextDecorationColor(const Color& c) { SET_VAR(m_rareNonInheritedData, textDecorationColor, c); }
     void setTextEmphasisColor(const Color& c) { SET_VAR(m_rareInheritedData, textEmphasisColor, c); }
     void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(m_rareInheritedData, textEmphasisFill, static_cast<unsigned>(fill)); }

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp (287450 => 287451)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp	2021-12-27 00:03:41 UTC (rev 287451)
@@ -97,6 +97,7 @@
     , userSelect(static_cast<unsigned>(RenderStyle::initialUserSelect()))
     , speakAs(RenderStyle::initialSpeakAs().toRaw())
     , hyphens(static_cast<unsigned>(Hyphens::Manual))
+    , textCombine(static_cast<unsigned>(RenderStyle::initialTextCombine()))
     , textEmphasisFill(static_cast<unsigned>(TextEmphasisFill::Filled))
     , textEmphasisMark(static_cast<unsigned>(TextEmphasisMark::None))
     , textEmphasisPosition(static_cast<unsigned>(RenderStyle::initialTextEmphasisPosition().toRaw()))
@@ -197,6 +198,7 @@
     , userSelect(o.userSelect)
     , speakAs(o.speakAs)
     , hyphens(o.hyphens)
+    , textCombine(o.textCombine)
     , textEmphasisFill(o.textEmphasisFill)
     , textEmphasisMark(o.textEmphasisMark)
     , textEmphasisPosition(o.textEmphasisPosition)
@@ -320,6 +322,7 @@
         && hyphenationLimitBefore == o.hyphenationLimitBefore
         && hyphenationLimitAfter == o.hyphenationLimitAfter
         && hyphenationLimitLines == o.hyphenationLimitLines
+        && textCombine == o.textCombine
         && textEmphasisFill == o.textEmphasisFill
         && textEmphasisMark == o.textEmphasisMark
         && textEmphasisPosition == o.textEmphasisPosition

Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (287450 => 287451)


--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h	2021-12-27 00:03:41 UTC (rev 287451)
@@ -118,6 +118,7 @@
     unsigned colorSpace : 1; // ColorSpace
     unsigned speakAs : 4; // ESpeakAs
     unsigned hyphens : 2; // Hyphens
+    unsigned textCombine : 1; // text-combine-upright
     unsigned textEmphasisFill : 1; // TextEmphasisFill
     unsigned textEmphasisMark : 3; // TextEmphasisMark
     unsigned textEmphasisPosition : 4; // TextEmphasisPosition

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (287450 => 287451)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2021-12-27 00:03:41 UTC (rev 287451)
@@ -92,7 +92,6 @@
     , useSmoothScrolling(static_cast<unsigned>(RenderStyle::initialUseSmoothScrolling()))
     , appearance(static_cast<unsigned>(RenderStyle::initialAppearance()))
     , effectiveAppearance(static_cast<unsigned>(RenderStyle::initialAppearance()))
-    , textCombine(static_cast<unsigned>(RenderStyle::initialTextCombine()))
     , textDecorationStyle(static_cast<unsigned>(RenderStyle::initialTextDecorationStyle()))
     , aspectRatioType(static_cast<unsigned>(RenderStyle::initialAspectRatioType()))
 #if ENABLE(CSS_COMPOSITING)
@@ -195,7 +194,6 @@
     , useSmoothScrolling(o.useSmoothScrolling)
     , appearance(o.appearance)
     , effectiveAppearance(o.effectiveAppearance)
-    , textCombine(o.textCombine)
     , textDecorationStyle(o.textDecorationStyle)
     , aspectRatioType(o.aspectRatioType)
 #if ENABLE(CSS_COMPOSITING)
@@ -301,7 +299,6 @@
         && useSmoothScrolling == o.useSmoothScrolling
         && appearance == o.appearance
         && effectiveAppearance == o.effectiveAppearance
-        && textCombine == o.textCombine
         && textDecorationStyle == o.textDecorationStyle
         && arePointingToEqualData(rotate, o.rotate)
         && arePointingToEqualData(scale, o.scale)

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (287450 => 287451)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2021-12-26 23:11:37 UTC (rev 287450)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2021-12-27 00:03:41 UTC (rev 287451)
@@ -202,7 +202,6 @@
     unsigned useSmoothScrolling : 1; // ScrollBehavior
     unsigned appearance : 6; // EAppearance
     unsigned effectiveAppearance : 6; // EAppearance
-    unsigned textCombine : 1; // CSS3 text-combine properties
 
     unsigned textDecorationStyle : 3; // TextDecorationStyle
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to