haikuwebkit/LayoutTests/fast/lists
Darin Adler 20df2033c2 Improve more of the CSS list style implementations
https://bugs.webkit.org/show_bug.cgi?id=227206

Reviewed by Antti Koivisto.

Source/WebCore:

Added support for 12 new values for list-style-type: disclosure-closed,
disclosure-open, ethiopic-numeric, japanese-formal, japanese-informal,
korean-hangul-formal, korean-hanja-formal, korean-hanja-informal,
simp-chinese-formal, simp-chinese-informal, trad-chinese-informal,
and trad-chinese-formal.

Improved implementation to match specification more closely for a few
existing values for list-style-type: armenian, cjk-ideographic, hebrew,
lower-armenian, lower-roman, upper-armenian, and upper-roman.

Fixed a rendering issue where we would position list items incorrectly
in list-style-position:inside cases because of measuring the list marker
widths and the list marker suffix widths separately and adding them
instead of measuring them together. This was causing some of the
Web Platform Tests, done using ref tests, to fail.

* accessibility/AccessibilityObject.cpp:
(WebCore::listMarkerTextForNode): Updated since
RenderListItem::markerTextWithSuffix now returns a StringView.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const): Updated
to call RenderListMarker::textWithoutSuffix.
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(rangeLengthForObject): Ditto.
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(accessibilityObjectLength): Ditto.
(webkitAccessibleTextGetText): Updated since
RenderListItem::markerTextWithSuffix now returns a StringView.

* css/CSSPrimitiveValueMappings.h:
(WebCore::toCSSValueID): Factored this out into a separate helper.
Also made it take advantage of the relationship between the enumeration
and the CSS value keywords that the code in the other direction already
was relying on so we don't have to list all the keywords.
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Refactored to call the
toCSSValueID function.

* css/CSSValueKeywords.in: Added 12 new list-type-style constants:
disclosure-open, disclosure-closed, japanese-informal, japanese-formal,
korean-hangul-formal, korean-hanja-informal, korean-hanja-formal,
simp-chinese-informal, simp-chinese-formal, trad-chinese-informal,
trad-chinese-formal, and ethiopic-numeric.

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::isPredefinedCounterStyle): Updated
since the last predefined counter style is EthiopicNumeric.

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::markerTextWithoutSuffix const): Renamed from
markerText, and changed to return a StringView.
(WebCore::RenderListItem::markerTextWithSuffix const): Return a StringView.
* rendering/RenderListItem.h: Updated for the above.

* rendering/RenderListMarker.cpp:
(WebCore::toRoman): Deleted.
(WebCore::toAlphabeticOrNumeric): Tweaked to use compile time instead of
runtime checks for alphabetic vs. numeric.
(WebCore::toSymbolic): Updated for above.
(WebCore::toAlphabetic): Ditto.
(WebCore::toNumeric): Ditto.
(WebCore::toHebrewUnder1000): Deleted.
(WebCore::toHebrew): Deleted.
(WebCore::toArmenianUnder10000): Deleted.
(WebCore::toArmenian): Deleted.
(WebCore::toGeorgian): Deleted.
(WebCore::toCJKIdeographic): Added handling for negative numbers and also
tweaked coding style a bit.
(WebCore::toPredefinedAdditiveSystem): Added. Implements the additive
system concept, which we use below to re-implement Hebrew, Armenian,
Georgian, Japanese, and Korean styles.
(WebCore::toEthiopicNumeric): Added.
(WebCore::effectiveListMarkerType): Added the new styles. Also updated the
allowable values for CJKIdeographic to allow negative numbers, and for Hebrew
to no longer allow 0 or numbers over 10999. Also sorted the sections by the
name of the first list style type in each section.
(WebCore::listMarkerSuffix): Changed to return a StringView instead of a
UChar, and include the trailing space. Choose the suffix based on the
specified type and not the effective type, so fallback does not cause the
suffix to fall back. Added the new types.
(WebCore::suffixRequiresSpace): Deleted.
(WebCore::listMarkerText): Added implementations for all the new types.
Also updated the implementation of CJKIdeographic, LowerRoman, UpperRoman,
Armenian, UpperArmenian, LowerArmenian, Georgian, and Hebrew to match a
newer CSS specification draft, and in most cases was able to use
toPredefinedAdditiveSystem instead of language-specific functions.
(WebCore::RenderListMarker::createInlineBox): Stop using the isText function,
which was only used here.
(WebCore::RenderListMarker::paint): Updated for the name change of
relativeMarkerRect. Removed unneeded special case for ListStyleType::None.
Use the new RenderListMarker::textRun function, moving all the code that
deals with direction and suffix in there.
(WebCore::reversed): Added. Helper used by textRun.
(WebCore::RenderListMarker::textRun const): Added. Composes a TextRun for
drawing or measuring text. By using the same function in all those places,
we guarantee we measure the text together instead of in pieces, which fixes
some layout errors leading to test failures that measuring separately and
adding the results together was causing.
(WebCore::RenderListMarker::addOverflowFromListMarker): Use the data
member m_lineOffsetForListItem instead of the lineOffsetForListItem
function, which was only used here.
(WebCore::RenderListMarker::updateMarginsAndContent): Moved the check of
preferredLogicalWidthsDirty and the comment about it here.
(WebCore::RenderListMarker::updateContent): Moved check of
preferredLogicalWidthsDirty out of this function since one caller asserts
it, and so the other caller can do the check itself. Added code to set
m_textWithSuffix, m_textWithoutSuffixLength, and m_textIsLeftToRightDirection.
Removed unneeded special cases for ListStyleType::None, Circle, Disc, and
Square, which are all handled correctly by the main algorithm. Added a FIXME
about the inadequacy of our bidi algorithm implementation for the general case.
(WebCore::RenderListMarker::computePreferredLogicalWidths): Use the new
textRun function, allowing us to remove some special case code, including
the special cases for ListStyleType::None, Asterisks, Footnotes, and String.
(WebCore::RenderListMarker::updateMargins): Removed unneeded special case for
ListStyleType::None, and updated string empty checks for the new name of the
m_textWithSuffix data member.
(WebCore::RenderListMarker::suffix const): Deleted.
(WebCore::RenderListMarker::relativeMarkerRect): Renamed from
getRelativeMarkerRect. Use the new textRun function, allowing us to remove
some special case code, including the special cases for ListTyleType::None,
Asterisks, Footnotes, and String.
(WebCore::RenderListMarker::textWithoutSuffix const): Added.

* rendering/RenderListMarker.h: Marked functions as final instead of just
override. Got rid of unneeded suffix and lineOffsetForListItem functions.
Renamed text ot textWithoutSuffix and added textWithSuffix. Added textRun
private member function. Replaced m_text with m_textWithSuffix,
m_textWithoutSuffixLength, and m_textIsLeftToRightDirection.

* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject): Use textWithoutSuffix.
(WebCore::markerTextForListItem): Use markerTextWithoutSuffix.

* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<): Use getValueName from CSSValueKeywords.h and
toCSSValueID to avoid repeating the names of all the list style types here.

* rendering/style/RenderStyleConstants.h: Added the 12 new list style types.

Source/WTF:

* wtf/unicode/CharacterNames.h: Added blackDown/Left/RightPointingSmallTriangle.

LayoutTests:

* TestExpectations: Expect about 50 more css-counter-styles tests to pass.

* fast/lists/li-values-expected.txt: Updated to expect newly specified behavior. When
this test was written, the specification was different.
* fast/lists/li-values.html: Ditto.
* fast/lists/w3-css3-list-styles-fallback-style-expected.txt: Ditto. Also many of these
were expecting failures.
* fast/lists/w3-css3-list-styles-fallback-style.html: Ditto.
* fast/lists/w3-css3-list-styles-numeric-expected.txt: Ditto. Also added tests for
ethiopic-numeric.
* fast/lists/w3-css3-list-styles-numeric.html: Ditto.

* fast/lists/w3-list-styles-expected.txt: Updated expected result for 0 in Hebrew.

* platform/mac/TestExpectations: Moved some image failure expectations from here to the
main TestExpectations because they do not seem to be platform-specific.

Canonical link: https://commits.webkit.org/239062@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-06-23 01:33:57 +00:00
..
resources
001-vertical.html
001.html
002-vertical.html
002.html
003-vertical.html LayoutTests/imported/w3c: 2020-03-25 17:03:50 +00:00
003.html
004.html
005-vertical.html
005.html
006-vertical.html
006.html
007-vertical.html
007.html
008-vertical.html
008.html
009-vertical.html LayoutTests/imported/w3c: 2020-03-25 17:03:50 +00:00
009.html
alpha-boundary-values-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
alpha-boundary-values.html
alpha-list-wrap-expected.txt Remove trailing spaces from expected.txt files (excluding WPT for now since that contains too many) 2020-09-27 02:15:19 +00:00
alpha-list-wrap.html
anonymous-items.html
assert-on-empty-list-marker-expected.txt
assert-on-empty-list-marker.html
big-list-marker.html
calc-width-with-space-expected.txt
calc-width-with-space.html
crash-when-list-marker-is-moved-during-selection-expected.txt
crash-when-list-marker-is-moved-during-selection.html
decimal-leading-zero-expected.txt
decimal-leading-zero.html
drag-into-marker.html
dynamic-marker-crash.html
inline-before-content-after-list-marker-expected.png
inline-before-content-after-list-marker-expected.txt
inline-before-content-after-list-marker.html
inlineBoxWrapperNullCheck.html
insert-list-uneditable-element-with-non-li-child-expected.txt Nullptr crash in WebCore::canHaveChildrenForEditing via CompositeEditCommand::insertNode 2020-02-27 01:01:37 +00:00
insert-list-uneditable-element-with-non-li-child.html Nullptr crash in WebCore::canHaveChildrenForEditing via CompositeEditCommand::insertNode 2020-02-27 01:01:37 +00:00
insert-list-user-modify-read-only-enclosed-li-expected.txt ASSERTION FAILURE in AppendNodeCommand::AppendNodeCommand when inserting list with read-only user-modify 2020-02-26 05:26:02 +00:00
insert-list-user-modify-read-only-enclosed-li.html
insert-list-user-modify-read-only-orphaned-li-expected.txt Nullptr crash in CompositeEditCommand::splitTreeToNode 2020-02-26 05:18:06 +00:00
insert-list-user-modify-read-only-orphaned-li.html
item-not-in-list-line-wrapping-expected.txt
item-not-in-list-line-wrapping.html
li-br.html
li-style-alpha-huge-value-crash.html
li-values-expected.txt Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
li-values.html Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
list-item-compute-marker-style-crash-expected.txt Remove ASSERT in RenderListItem::computeMarkerStyle 2021-03-26 10:16:48 +00:00
list-item-compute-marker-style-crash.xhtml Remove ASSERT in RenderListItem::computeMarkerStyle 2021-03-26 10:16:48 +00:00
list-item-line-height.html
list-marker-before-content-table-expected.png
list-marker-before-content-table-expected.txt
list-marker-before-content-table.html
list-marker-before-float-expected.html
list-marker-before-float-nested-expected.html A floating element within <li> overlaps with the marker 2017-01-03 15:02:26 +00:00
list-marker-before-float-nested-rtl-expected.html
list-marker-before-float-nested-rtl.html
list-marker-before-float-nested.html
list-marker-before-float-rtl-expected.html
list-marker-before-float-rtl.html
list-marker-before-float.html
list-marker-remove-crash-expected.txt
list-marker-remove-crash.html
list-marker-with-display-expected.html
list-marker-with-display.html
list-marker-with-line-height.html
list-style-none-crash.html
list-style-position-inside-expected.txt
list-style-position-inside.html
list-style-type-dynamic-change-expected.txt
list-style-type-dynamic-change.html
marker-before-empty-inline.html
marker-image-error.html
marker-preferred-margins-expected.txt
marker-preferred-margins.html
marker-style-subselector-whitelist-expected.txt
marker-style-subselector-whitelist.html
markers-in-selection.html
numeric-markers-outside-list.html
ol-display-types.html
ol-nested-items-dynamic-insert-expected.txt
ol-nested-items-dynamic-insert.html
ol-nested-items-dynamic-remove-expected.txt
ol-nested-items-dynamic-remove.html
ol-nested-items-expected.txt
ol-nested-items.html
ol-nested-list-dynamic-insert-expected.txt
ol-nested-list-dynamic-insert.html
ol-nested-list-dynamic-remove-expected.txt List item markers are not always updated after changes in the DOM. 2010-04-21 15:41:14 +00:00
ol-nested-list-dynamic-remove.html
ol-nested-list-expected.txt
ol-nested-list.html
ol-reversed-dynamic-expected.txt
ol-reversed-dynamic-simple-expected.txt
ol-reversed-dynamic-simple.html
ol-reversed-dynamic.html
ol-reversed-nested-items-expected.txt
ol-reversed-nested-items.html
ol-reversed-nested-list-expected.txt
ol-reversed-nested-list.html
ol-reversed-simple-expected.txt
ol-reversed-simple.html
ol-reversed-simple.xhtml
ol-start-dynamic.html
ol-start-parsing.html
ol-start-roman-expected.txt
ol-start-roman.html
olstart.html
ordered-list-with-no-ol-tag.html
positioned-count-crash-expected.txt
positioned-count-crash.html
remove-listmarker-from-anonblock-with-continuation-crash-expected.txt Crash when changing list marker locations 2012-02-29 20:40:10 +00:00
remove-listmarker-from-anonblock-with-continuation-crash.html
rtl-marker-expected.html
rtl-marker.html
scrolled-marker-paint.html
w3-css3-list-styles-alphabetic-expected.txt
w3-css3-list-styles-alphabetic.html
w3-css3-list-styles-fallback-style-expected.txt Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
w3-css3-list-styles-fallback-style.html Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
w3-css3-list-styles-numeric-expected.txt Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
w3-css3-list-styles-numeric.html Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
w3-css3-list-styles-symbolic-expected.txt
w3-css3-list-styles-symbolic.html
w3-css3-lower-armenian-expected.txt
w3-css3-lower-armenian.html
w3-css3-upper-armenian-expected.txt
w3-css3-upper-armenian.html
w3-list-styles-expected.txt Improve more of the CSS list style implementations 2021-06-23 01:33:57 +00:00
w3-list-styles.html