Title: [233916] trunk/Source/WebCore
- Revision
- 233916
- Author
- [email protected]
- Date
- 2018-07-18 11:10:08 -0700 (Wed, 18 Jul 2018)
Log Message
Rename WordBreak::Break to WordBreak::BreakWord
https://bugs.webkit.org/show_bug.cgi?id=187767
Reviewed by Simon Fraser.
These breaking properties are very confusing. There are:
1. word-break: break-all, a standard value that allows breaking after every
character.
2. word-break: break-word, a non-standard value which allows for breaking after
every character, but only if the word is too long for the available width (otherwise
it works the same as word-break: normal). This affects the min-content-size of the
text (and makes it equal to what it would be if word-break: break-all was
specified).
3. word-wrap: break-word, which is the same as word-break: break-word, but doesn't
affect the min-content-size of the text.
4. overflow-wrap: break-word, which is the same as word-wrap: break-word.
Because this is so confusing it's valuable for our internal enums to match the names
of the official CSS properties/values.
No new tests because there is no behavior change.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator WordBreak const):
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::breakWords const):
* rendering/style/RenderStyleConstants.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (233915 => 233916)
--- trunk/Source/WebCore/ChangeLog 2018-07-18 17:08:46 UTC (rev 233915)
+++ trunk/Source/WebCore/ChangeLog 2018-07-18 18:10:08 UTC (rev 233916)
@@ -1,3 +1,37 @@
+2018-07-18 Myles C. Maxfield <[email protected]>
+
+ Rename WordBreak::Break to WordBreak::BreakWord
+ https://bugs.webkit.org/show_bug.cgi?id=187767
+
+ Reviewed by Simon Fraser.
+
+ These breaking properties are very confusing. There are:
+
+ 1. word-break: break-all, a standard value that allows breaking after every
+ character.
+ 2. word-break: break-word, a non-standard value which allows for breaking after
+ every character, but only if the word is too long for the available width (otherwise
+ it works the same as word-break: normal). This affects the min-content-size of the
+ text (and makes it equal to what it would be if word-break: break-all was
+ specified).
+ 3. word-wrap: break-word, which is the same as word-break: break-word, but doesn't
+ affect the min-content-size of the text.
+ 4. overflow-wrap: break-word, which is the same as word-wrap: break-word.
+
+ Because this is so confusing it's valuable for our internal enums to match the names
+ of the official CSS properties/values.
+
+ No new tests because there is no behavior change.
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator WordBreak const):
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::computePreferredLogicalWidths):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyle::breakWords const):
+ * rendering/style/RenderStyleConstants.h:
+
2018-07-18 Wenson Hsieh <[email protected]>
Add SPI to defer running async script until after document load
Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (233915 => 233916)
--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h 2018-07-18 17:08:46 UTC (rev 233915)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h 2018-07-18 18:10:08 UTC (rev 233916)
@@ -3087,7 +3087,7 @@
case WordBreak::KeepAll:
m_value.valueID = CSSValueKeepAll;
break;
- case WordBreak::Break:
+ case WordBreak::BreakWord:
m_value.valueID = CSSValueBreakWord;
break;
}
@@ -3103,7 +3103,7 @@
case CSSValueKeepAll:
return WordBreak::KeepAll;
case CSSValueBreakWord:
- return WordBreak::Break;
+ return WordBreak::BreakWord;
case CSSValueNormal:
return WordBreak::Normal;
default:
Modified: trunk/Source/WebCore/rendering/RenderText.cpp (233915 => 233916)
--- trunk/Source/WebCore/rendering/RenderText.cpp 2018-07-18 17:08:46 UTC (rev 233915)
+++ trunk/Source/WebCore/rendering/RenderText.cpp 2018-07-18 18:10:08 UTC (rev 233916)
@@ -826,7 +826,7 @@
// Note the deliberate omission of word-wrap and overflow-wrap from this breakAll check. Those
// do not affect minimum preferred sizes. Note that break-word is a non-standard value for
// word-break, but we support it as though it means break-all.
- bool breakAll = (style.wordBreak() == WordBreak::BreakAll || style.wordBreak() == WordBreak::Break) && style.autoWrap();
+ bool breakAll = (style.wordBreak() == WordBreak::BreakAll || style.wordBreak() == WordBreak::BreakWord) && style.autoWrap();
bool keepAllWords = style.wordBreak() == WordBreak::KeepAll;
bool canUseLineBreakShortcut = iteratorMode == LineBreakIteratorMode::Default;
Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (233915 => 233916)
--- trunk/Source/WebCore/rendering/style/RenderStyle.h 2018-07-18 17:08:46 UTC (rev 233915)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h 2018-07-18 18:10:08 UTC (rev 233916)
@@ -2044,7 +2044,7 @@
inline bool RenderStyle::breakWords() const
{
- return wordBreak() == WordBreak::Break || overflowWrap() == OverflowWrap::Break;
+ return wordBreak() == WordBreak::BreakWord || overflowWrap() == OverflowWrap::Break;
}
inline bool RenderStyle::hasInlineColumnAxis() const
Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (233915 => 233916)
--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2018-07-18 17:08:46 UTC (rev 233915)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h 2018-07-18 18:10:08 UTC (rev 233916)
@@ -516,7 +516,7 @@
Normal,
BreakAll,
KeepAll,
- Break
+ BreakWord
};
enum class OverflowWrap : uint8_t {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes