WebKit Bugzilla
Attachment 358063 Details for
Bug 192980
: [css-lists] Fix list marker issues related to line breaks and markers disappearance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192980-20181225234246.patch (text/plain), 31.53 KB, created by
cathiechen
on 2018-12-25 07:42:48 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cathiechen
Created:
2018-12-25 07:42:48 PST
Size:
31.53 KB
patch
obsolete
>Subversion Revision: 239501 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 1675be7bfc8d1cb0d3cd0de663f6da41129ba0d8..50a7aa58b0b0498565cb12bb39606bf355bdbf87 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,46 @@ >+2018-12-21 cathie chen <cathiechen@igalia.com> >+ >+ Eliminate line-breaks and disappear of list marker >+ https://bugs.webkit.org/show_bug.cgi?id=192980 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The reason of list marker disappear in li + overflow block child page >+ is that marker has been added as the child of this overflow block. And the >+ reason of line-break in li + flex, grid, etc. is that marker is the >+ sibilng of a block child. To fix these two kinds of issue: >+ 1. Create a zero-height anonymous parent for marker (to eleminate the >+ line-break) and add it as the first child of list item. >+ 2. Reposition the position of marker after all list item's children >+ has been layout (marker have to adjust itself to the content of li) >+ >+ This was implemented in chromium first. >+ Also see: https://bugs.chromium.org/p/chromium/issues/detail?id=344941 >+ >+ Tests: fast/lists/add-inline-child-after-marker.html >+ fast/lists/li-with-overflow-hidden-change-list-style-position.html >+ fast/lists/list-and-block-textarea.html >+ fast/lists/list-and-flex.html >+ fast/lists/list-and-grid.html >+ fast/lists/list-and-margin-collapse.html >+ fast/lists/list-and-writing-mode.html >+ fast/lists/list-marker-before-overflow-hidden.html >+ fast/lists/list-marker-inside-overflow-hidden.html >+ fast/lists/list-marker-with-lineheight-and-overflow-hidden.html >+ >+ * rendering/RenderListItem.cpp: >+ (WebCore::RenderListItem::positionListMarker): >+ (WebCore::RenderListItem::alignMarkerInBlockDirection): Adjust marker >+ to li's first line box in block direction. >+ * rendering/RenderListItem.h: >+ * rendering/RenderListMarker.h: >+ * rendering/updating/RenderTreeBuilderList.cpp: >+ (WebCore::getParentOfFirstLineBox): >+ (WebCore::forceLogicalHeight): >+ (WebCore::RenderTreeBuilder::List::updateItemMarker): For list item >+ whose m_needBlockDirectionAlign is true, insert marker to a zero height >+ container, then add this container as the first child. >+ > 2018-12-20 Justin Fan <justin_fan@apple.com> > > [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders >diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp >index 3909c5a3697eacf289b289800b679f9c07d78f7e..2a3bd0424c7781e49b1c40d9cf1dec755ee66875 100644 >--- a/Source/WebCore/rendering/RenderBlock.cpp >+++ b/Source/WebCore/rendering/RenderBlock.cpp >@@ -514,8 +514,16 @@ bool RenderBlock::isSelfCollapsingBlock() const > > // If the height is 0 or auto, then whether or not we are a self-collapsing block depends > // on whether we have content that is all self-collapsing or not. >- if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercentOrCalculated()) && logicalHeightLength.isZero())) >+ if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercentOrCalculated()) && logicalHeightLength.isZero())) { >+ // MarkerContainer should be a self-collapsing block. MarkerContainer is a zero height anonymous block and marker is its only child. >+ if (logicalHeightLength.isFixed() && isAnonymous() && parent() && is<RenderListItem>(parent())) { >+ RenderObject* child = firstChild(); >+ if (child && is<RenderListMarker>(child) && !child->nextSibling()) >+ return true; >+ } >+ > return !childrenPreventSelfCollapsing(); >+ } > > return false; > } >diff --git a/Source/WebCore/rendering/RenderListItem.cpp b/Source/WebCore/rendering/RenderListItem.cpp >index d923eea3d053720d081071ff5334b5605605b427..b5b085e4cd94005a50cd8f32faf4a144dade9b66 100644 >--- a/Source/WebCore/rendering/RenderListItem.cpp >+++ b/Source/WebCore/rendering/RenderListItem.cpp >@@ -269,6 +269,9 @@ void RenderListItem::positionListMarker() > if (m_marker->isInside() || !m_marker->inlineBoxWrapper()) > return; > >+ if (m_needsBlockDirectionAlign) >+ alignMarkerInBlockDirection(); >+ > LayoutUnit markerOldLogicalLeft = m_marker->logicalLeft(); > LayoutUnit blockOffset; > LayoutUnit lineOffset; >@@ -439,4 +442,62 @@ bool RenderListItem::isInReversedOrderedList() const > return is<HTMLOListElement>(list) && downcast<HTMLOListElement>(*list).isReversed(); > } > >+// Align markerInlineBox in block direction according to m_baselineProvider's baseline. >+void RenderListItem::alignMarkerInBlockDirection() >+{ >+ auto* baselineProvider = m_baselineProvider.get(); >+ >+ // Specify wether need to restore to the original baseline which is the baseline of marker parent. >+ // Because we might adjust the position at the last layout pass. >+ // So if there's no line box in baselineProvider make sure it back to its original position. >+ // And don't align marker if baselineProvider has a different writing-mode. >+ // Just let marker positioned at the left-top of baselineProvider. >+ bool backToOriginalBaseline = !baselineProvider || baselineProvider->isWritingModeRoot(); >+ >+ InlineBox* markerInlineBox = m_marker->inlineBoxWrapper(); >+ ASSERT(markerInlineBox); >+ RootInlineBox& markerRoot = markerInlineBox->root(); >+ // If m_marker and baselineProvider share a same RootInlineBox, no need to align marker. >+ if (baselineProvider && is<RenderBlockFlow>(baselineProvider) && downcast<RenderBlockFlow>(baselineProvider)->firstRootBox() == &markerRoot) >+ return; >+ >+ Optional<int> offset; >+ if (!backToOriginalBaseline) { >+ RenderBox* box = baselineProvider; >+ offset = box->firstLineBaseline(); >+ } >+ >+ if (backToOriginalBaseline || !offset) { >+ baselineProvider = m_marker->containingBlock(); >+ assert(baselineProvider); >+ RenderBox* box = baselineProvider; >+ offset = box->firstLineBaseline(); >+ } >+ >+ if (offset) { >+ LayoutUnit offsetValue = offset.value(); >+ for (RenderBox* o = baselineProvider; o != this; o = o->parentBox()) >+ offsetValue += o->logicalTop(); >+ >+ // Compute markerInlineBox's baseline. >+ // We shouldn't use firstLineBaseline here. firstLineBaseline is the baseline of markerRoot. >+ // We should compute markerInlineBox's baseline instead. >+ // When marker is an image, BaselinePosition return its own baseline position which is correct in this case. >+ // However, when marker is text, BaselinePosition return the baseline position of list item. >+ // So we use markerFontMetrics.ascent here. >+ if (m_marker->isImage()) >+ offsetValue -= markerInlineBox->baselinePosition(markerRoot.baselineType()); >+ else >+ offsetValue -= m_marker->style().fontMetrics().ascent(markerRoot.baselineType()); >+ >+ offsetValue -= markerInlineBox->logicalTop(); >+ >+ for (RenderBox* o = m_marker->parentBox(); o != this; o = o->parentBox()) >+ offsetValue -= o->logicalTop(); >+ >+ if (offsetValue) >+ markerInlineBox->adjustBlockDirectionPosition(offsetValue); >+ } >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/rendering/RenderListItem.h b/Source/WebCore/rendering/RenderListItem.h >index 406d80800fe9d6b97b605c93b25c3639cbd59862..63f99594733c08fc2c138b3e08f47c9387b7d29d 100644 >--- a/Source/WebCore/rendering/RenderListItem.h >+++ b/Source/WebCore/rendering/RenderListItem.h >@@ -61,6 +61,10 @@ public: > > bool isInReversedOrderedList() const; > >+ void setNeedsBlockDirectionAlign(bool need) { m_needsBlockDirectionAlign = need; } >+ bool needsBlockDirectionAlign() const { return m_needsBlockDirectionAlign; } >+ void setBaselineProvider(RenderBlock* provider) { m_baselineProvider = makeWeakPtr(provider); } >+ > private: > > const char* renderName() const final { return "RenderListItem"; } >@@ -82,10 +86,14 @@ private: > void updateValueNow() const; > void explicitValueChanged(); > >+ void alignMarkerInBlockDirection(); >+ > WeakPtr<RenderListMarker> m_marker; >+ WeakPtr<RenderBlock> m_baselineProvider; > mutable Optional<int> m_value; > bool m_valueWasSetExplicitly { false }; > bool m_notInList { false }; >+ bool m_needsBlockDirectionAlign { false }; > }; > > bool isHTMLListElement(const Node&); >diff --git a/Source/WebCore/rendering/RenderListMarker.h b/Source/WebCore/rendering/RenderListMarker.h >index d9498fbe92bc5906149ea01ca917350309b1013d..627d7346c44425cf03772a48a6eeb97b97fd3b2f 100644 >--- a/Source/WebCore/rendering/RenderListMarker.h >+++ b/Source/WebCore/rendering/RenderListMarker.h >@@ -47,6 +47,8 @@ public: > > void updateMarginsAndContent(); > >+ bool isImage() const override; >+ > #if !ASSERT_DISABLED > RenderListItem& listItem() const { return m_listItem; } > #endif >@@ -73,7 +75,6 @@ private: > LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override; > int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override; > >- bool isImage() const override; > bool isText() const { return !isImage(); } > > void setSelectionState(SelectionState) override; >diff --git a/Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp b/Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp >index be436e096629e57652d53335326ad3f6f06763fb..5c3537d112523a62f0a848961c9d0a504f636583 100644 >--- a/Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp >+++ b/Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp >@@ -34,6 +34,7 @@ namespace WebCore { > > static RenderBlock* getParentOfFirstLineBox(RenderBlock& current, RenderObject& marker) > { >+ bool inside = is<RenderListMarker>(marker) ? downcast<RenderListMarker>(marker).isInside() : false; > bool inQuirksMode = current.document().inQuirksMode(); > for (auto& child : childrenOfType<RenderObject>(current)) { > if (&child == &marker) >@@ -45,10 +46,15 @@ static RenderBlock* getParentOfFirstLineBox(RenderBlock& current, RenderObject& > if (child.isFloating() || child.isOutOfFlowPositioned()) > continue; > >- if (!is<RenderBlock>(child) || is<RenderTable>(child) || is<RenderRubyAsBlock>(child)) >+ if (!inside) { >+ if (current.hasOverflowClip()) >+ return ¤t; >+ if (is<RenderBlock>(child) && (!is<RenderBlockFlow>(child) || (is<RenderBox>(child) && downcast<RenderBox>(child).isWritingModeRoot()))) >+ return &downcast<RenderBlock>(child); >+ } else if (is<RenderBox>(child) && downcast<RenderBox>(child).isWritingModeRoot()) > break; > >- if (is<RenderBox>(child) && downcast<RenderBox>(child).isWritingModeRoot()) >+ if (!is<RenderBlock>(child) || is<RenderTable>(child) || is<RenderRubyAsBlock>(child)) > break; > > if (is<RenderListItem>(current) && inQuirksMode && child.node() && isHTMLListElement(*child.node())) >@@ -69,6 +75,15 @@ static RenderObject* firstNonMarkerChild(RenderBlock& parent) > return child; > } > >+static void forceLogicalHeight(RenderElement& element, Length&& height) >+{ >+ if (element.style().logicalHeight() == height) >+ return; >+ auto style = RenderStyle::clone(element.style()); >+ style.setLogicalHeight(WTFMove(height)); >+ element.setStyle(WTFMove(style)); >+} >+ > RenderTreeBuilder::List::List(RenderTreeBuilder& builder) > : m_builder(builder) > { >@@ -98,27 +113,93 @@ void RenderTreeBuilder::List::updateItemMarker(RenderListItem& listItemRenderer) > > RenderElement* currentParent = markerRenderer->parent(); > RenderBlock* newParent = getParentOfFirstLineBox(listItemRenderer, *markerRenderer); >- if (!newParent) { >- // If the marker is currently contained inside an anonymous box, >- // then we are the only item in that anonymous box (since no line box >- // parent was found). It's ok to just leave the marker where it is >- // in this case. >- if (currentParent && currentParent->isAnonymousBlock()) >+ // Create a zero height parent for marker, so that marker could be displayed or no line break between marker and content. >+ // 1. Place marker as a child of <li>. Make sure it doesn't share parent with empty inline elements which don't generate InlineBox. >+ // 2. Manage the logicalHeight of markerContainer(marker's anonymous parent): >+ // If marker is the only child of markerContainer, set LogicalHeight of markerContainer to 0px; else restore it to LogicalHeight of <li>. >+ if (!markerRenderer->isInside() && newParent && (newParent->hasOverflowClip() || !is<RenderBlockFlow>(newParent) || newParent->isWritingModeRoot())) >+ listItemRenderer.setNeedsBlockDirectionAlign(true); >+ >+ // Prepare for block direction align. >+ if (listItemRenderer.needsBlockDirectionAlign()) { >+ // Deal with the situation of render tree changed. >+ RenderPtr<RenderObject> originalMarker; >+ if (currentParent && currentParent->isAnonymous()) { >+ // When list-position-style change from outside to inside, we need to restore LogicalHeight. >+ // So add isInside() here. >+ if (markerRenderer->isInside() || markerRenderer->nextSibling()) { >+ // Restore LogicalHeight. >+ if (currentParent->style().logicalHeight().isZero()) >+ forceLogicalHeight(*currentParent, Length(style.logicalHeight())); >+ >+ // If currentParent isn't the ancestor of newParent, marker might generate a new empty line. >+ // We need to remove marker here. So it could be inserted to the proper position, and no extra line generated. >+ // E.g: <li><span><div>text<div><span></li> >+ if (markerRenderer->isInside() || (newParent && !newParent->isDescendantOf(currentParent))) { >+ originalMarker = m_builder.detach(*currentParent, *markerRenderer); >+ currentParent = nullptr; >+ } >+ } else if (newParent) >+ forceLogicalHeight(*currentParent, Length(0, Fixed)); >+ } else if (currentParent && currentParent != &listItemRenderer) { >+ originalMarker = m_builder.detach(*currentParent, *markerRenderer); >+ currentParent = nullptr; >+ } >+ >+ // Create markerContainer, set its height to 0px, and add it to li. >+ if (!currentParent) { >+ auto* beforeChild = firstNonMarkerChild(listItemRenderer); >+ if (!markerRenderer->isInside() && beforeChild && !beforeChild->isInline()) { >+ // Create markerContainer and set its LogicalHeight to 0px. >+ auto markerContainer = listItemRenderer.createAnonymousBlock(); >+ if (newParent) >+ forceLogicalHeight(*markerContainer, Length(0, Fixed)); >+ if (originalMarker.get()) >+ m_builder.attach(*markerContainer, WTFMove(originalMarker), firstNonMarkerChild(*markerContainer)); >+ else >+ m_builder.attach(*markerContainer, WTFMove(newMarkerRenderer), firstNonMarkerChild(*markerContainer)); >+ m_builder.attach(listItemRenderer, WTFMove(markerContainer), beforeChild); >+ } else { >+ if (markerRenderer->isInside()) { >+ listItemRenderer.setNeedsBlockDirectionAlign(false); >+ if (!newParent) >+ newParent = &listItemRenderer; >+ if (originalMarker.get()) >+ m_builder.attach(*newParent, WTFMove(originalMarker), firstNonMarkerChild(*newParent)); >+ else >+ m_builder.attach(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent)); >+ >+ } else if (originalMarker.get()) >+ m_builder.attach(listItemRenderer, WTFMove(originalMarker), beforeChild); >+ else >+ m_builder.attach(listItemRenderer, WTFMove(newMarkerRenderer), beforeChild); >+ } >+ } >+ >+ listItemRenderer.setBaselineProvider(newParent); >+ } else { >+ if (!newParent) { >+ // If the marker is currently contained inside an anonymous box, >+ // then we are the only item in that anonymous box (since no line box >+ // parent was found). It's ok to just leave the marker where it is >+ // in this case. >+ if (currentParent && currentParent->isAnonymousBlock()) >+ return; >+ if (auto* multiColumnFlow = listItemRenderer.multiColumnFlow()) >+ newParent = multiColumnFlow; >+ else >+ newParent = &listItemRenderer; >+ } >+ >+ if (newParent == currentParent) > return; >- if (auto* multiColumnFlow = listItemRenderer.multiColumnFlow()) >- newParent = multiColumnFlow; >+ >+ if (currentParent) >+ m_builder.attach(*newParent, m_builder.detach(*currentParent, *markerRenderer, RenderTreeBuilder::CanCollapseAnonymousBlock::No), firstNonMarkerChild(*newParent)); > else >- newParent = &listItemRenderer; >+ m_builder.attach(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent)); > } > >- if (newParent == currentParent) >- return; >- >- if (currentParent) >- m_builder.attach(*newParent, m_builder.detach(*currentParent, *markerRenderer, RenderTreeBuilder::CanCollapseAnonymousBlock::No), firstNonMarkerChild(*newParent)); >- else >- m_builder.attach(*newParent, WTFMove(newMarkerRenderer), firstNonMarkerChild(*newParent)); >- > // If current parent is an anonymous block that has lost all its children, destroy it. > if (currentParent && currentParent->isAnonymousBlock() && !currentParent->firstChild() && !downcast<RenderBlock>(*currentParent).continuation()) > m_builder.destroy(*currentParent); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 8e7576c8febda82fe3f18b8e4383fbeaffe79249..528288a833def7372988f61157facd84572eecca 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,35 @@ >+2018-12-21 cathie chen <cathiechen@igalia.com> >+ >+ Eliminate line-breaks and disappear of list marker >+ https://bugs.webkit.org/show_bug.cgi?id=192980 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This test cases are testing the line-break issues in li + table / flex >+ / grid / root writing-mode / block textarea, and the disappear of list >+ marker in li + block overflow:hiddlen child, and testing if the behavior >+ is correct after render tree changed. >+ >+ * fast/lists/add-inline-child-after-marker-expected.html: Added. >+ * fast/lists/add-inline-child-after-marker.html: Added. >+ * fast/lists/li-with-overflow-hidden-change-list-style-position-expected.html: Added. >+ * fast/lists/li-with-overflow-hidden-change-list-style-position.html: Added. >+ * fast/lists/list-and-block-textarea-expected.html: Added. >+ * fast/lists/list-and-block-textarea.html: Added. >+ * fast/lists/list-and-flex-expected.html: Added. >+ * fast/lists/list-and-flex.html: Added. >+ * fast/lists/list-and-grid-expected.html: Added. >+ * fast/lists/list-and-grid.html: Added. >+ * fast/lists/list-and-margin-collapse.html: Added. >+ * fast/lists/list-and-writing-mode-expected.html: Added. >+ * fast/lists/list-and-writing-mode.html: Added. >+ * fast/lists/list-marker-before-overflow-hidden-expected.html: Added. >+ * fast/lists/list-marker-before-overflow-hidden.html: Added. >+ * fast/lists/list-marker-inside-overflow-hidden-expected.html: Added. >+ * fast/lists/list-marker-inside-overflow-hidden.html: Added. >+ * fast/lists/list-marker-with-lineheight-and-overflow-hidden-expected.html: Added. >+ * fast/lists/list-marker-with-lineheight-and-overflow-hidden.html: Added. >+ > 2018-12-21 Carlos Garcia Campos <cgarcia@igalia.com> > > Unreviewed GTK+ gardening. Remove platform specific files that are exactly the same as the generic expectation. >diff --git a/LayoutTests/fast/lists/add-inline-child-after-marker-expected.html b/LayoutTests/fast/lists/add-inline-child-after-marker-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..008ed74a4345841f00e1251e334e88659cb20c64 >--- /dev/null >+++ b/LayoutTests/fast/lists/add-inline-child-after-marker-expected.html >@@ -0,0 +1,9 @@ >+<!DOCTYPE html> >+<head></head><body><ul> >+ <li id="liTarget"> >+ <span>inline</span> >+ <div id="divTarget" style="overflow:hidden;"> >+ <span>a</span>xxx >+ </div> >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/add-inline-child-after-marker.html b/LayoutTests/fast/lists/add-inline-child-after-marker.html >new file mode 100644 >index 0000000000000000000000000000000000000000..1055c9f9cda69002f913730eddb3c20b0a046d65 >--- /dev/null >+++ b/LayoutTests/fast/lists/add-inline-child-after-marker.html >@@ -0,0 +1,18 @@ >+<!DOCTYPE html> >+<ul> >+ <li id="liTarget"> >+ <div id="divTarget" style="overflow:hidden;"> >+ <span>a</span>xxx >+ </div> >+ </li> >+</ul> >+<script> >+ var new_span=document.createElement("span"); >+ var text_node=document.createTextNode("inline"); >+ new_span.appendChild(text_node); >+ >+ var div_target=document.getElementById("divTarget"); >+ var li_target=document.getElementById("liTarget"); >+ li_target.insertBefore(new_span,div_target); >+ document.body.offsetHeight; >+</script> >diff --git a/LayoutTests/fast/lists/li-with-overflow-hidden-change-list-style-position-expected.html b/LayoutTests/fast/lists/li-with-overflow-hidden-change-list-style-position-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..85578279ab8f5daa29fbafe63a1513dfa25f1a38 >--- /dev/null >+++ b/LayoutTests/fast/lists/li-with-overflow-hidden-change-list-style-position-expected.html >@@ -0,0 +1,16 @@ >+<!DOCTYPE html> >+<ul> >+ <li style="list-style-position: inside;"> >+ <div style="overflow:hidden;"> >+ outside to inside >+ </div> >+ </li> >+</ul> >+ >+<ul> >+ <li style="list-style-position: outside;"> >+ <div style="overflow:hidden;"> >+ inside to outside >+ </div> >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/li-with-overflow-hidden-change-list-style-position.html b/LayoutTests/fast/lists/li-with-overflow-hidden-change-list-style-position.html >new file mode 100644 >index 0000000000000000000000000000000000000000..647f0ae73617fbe444ad237a7ec40f749a3eff8e >--- /dev/null >+++ b/LayoutTests/fast/lists/li-with-overflow-hidden-change-list-style-position.html >@@ -0,0 +1,28 @@ >+<!DOCTYPE html> >+<ul> >+ <li id="outSide" style="list-style-position: outside;"> >+ <div style="overflow:hidden;"> >+ outside to inside >+ </div> >+ </li> >+</ul> >+ >+<ul> >+ <li id="inSide" style="list-style-position: inside;"> >+ <div style="overflow:hidden;"> >+ inside to outside >+ </div> >+ </li> >+</ul> >+<script> >+ document.body.offsetHeight; >+ >+ var outside_li=document.getElementById("outSide"); >+ outside_li.style.listStylePosition = "inside"; >+ document.body.offsetHeight; >+ >+ var inside_li=document.getElementById("inSide"); >+ inside_li.style.listStylePosition = "outside"; >+ document.body.offsetHeight; >+ >+</script> >diff --git a/LayoutTests/fast/lists/list-and-block-textarea-expected.html b/LayoutTests/fast/lists/list-and-block-textarea-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2ae28399f5fda2dfb1b04405f4a3b4895f5fac1e >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-block-textarea-expected.html >@@ -0,0 +1 @@ >+pass >diff --git a/LayoutTests/fast/lists/list-and-block-textarea.html b/LayoutTests/fast/lists/list-and-block-textarea.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5e555fca5b7d17b467a914939881b6871ca7d56f >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-block-textarea.html >@@ -0,0 +1,22 @@ >+<!DOCTYPE html> >+<style> >+textarea { >+ border: 0px; >+ padding: 0px; >+} >+</style> >+<ul> >+ <li id="target"> >+ <textarea rows="3" cols="20" style="display:block; height:45px"> >+ hello >+ </textarea> >+ </li> >+</ul> >+ >+<script> >+ document.body.offsetHeight; >+ if (document.getElementById("target").offsetHeight == 45) >+ document.body.innerHTML="pass"; >+ else >+ document.body.innerHTML="fail"; >+</script> >diff --git a/LayoutTests/fast/lists/list-and-flex-expected.html b/LayoutTests/fast/lists/list-and-flex-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6ac06ad7a64f75076e79dc1cdc08f0bfd2b6ddc0 >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-flex-expected.html >@@ -0,0 +1,10 @@ >+<!DOCTYPE html> >+<ul> >+ <li> >+ <div style="border: 1px black solid;"> >+ <div style="display: inline-flex; align-items: flex-end; height: 200px;"> >+ <span style="line-height: 50px">text</span> >+ </div> >+ </div> >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/list-and-flex.html b/LayoutTests/fast/lists/list-and-flex.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c02052ed5ee01c5534d8fc113943897bc9995a7a >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-flex.html >@@ -0,0 +1,10 @@ >+<!DOCTYPE html> >+<ul> >+ <li> >+ <div style="border: 1px black solid;"> >+ <div style="display: flex; align-items: flex-end; height: 200px;"> >+ <span style="line-height: 50px">text</span> >+ </div> >+ </div> >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/list-and-grid-expected.html b/LayoutTests/fast/lists/list-and-grid-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..b75a8b5efab5c5badeb9e4fed7193d7134918683 >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-grid-expected.html >@@ -0,0 +1,9 @@ >+<!DOCTYPE html> >+<ul> >+ <li> >+ <div style="display: inline-grid; grid-template-rows: 100px; align-items: center;"> >+ <div>grid</div> >+ </div> >+ </li> >+</ul> >+ >diff --git a/LayoutTests/fast/lists/list-and-grid.html b/LayoutTests/fast/lists/list-and-grid.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8b5795038cac13c9d6809a5cdff6955cebf7ae4a >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-grid.html >@@ -0,0 +1,8 @@ >+<!DOCTYPE html> >+<ul> >+ <li> >+ <div style="display: grid; grid-template-rows: 100px; align-items: center;"> >+ <div>grid</div> >+ </div> >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/list-and-margin-collapse.html b/LayoutTests/fast/lists/list-and-margin-collapse.html >new file mode 100644 >index 0000000000000000000000000000000000000000..809855609e6f27cb5d85f16a099dcbbed093106a >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-margin-collapse.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<script src="../../resources/testharness.js"></script> >+<script src="../../resources/testharnessreport.js"></script> >+<ul id="target" style="margin-top:100px;"> >+ <li> >+ <div style="overflow:hidden; margin-top:100px; height:25px;"><a href="#">xxx</a></div> >+ </li> >+</ul> >+<div id="log"></div> >+<script> >+test(function() { >+ var height = document.getElementById("target").clientHeight; >+ assert_equals(height, 25, "the height of ul should be 25px") >+}, "list and margin collapse"); >+</script> >diff --git a/LayoutTests/fast/lists/list-and-writing-mode-expected.html b/LayoutTests/fast/lists/list-and-writing-mode-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2ae28399f5fda2dfb1b04405f4a3b4895f5fac1e >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-writing-mode-expected.html >@@ -0,0 +1 @@ >+pass >diff --git a/LayoutTests/fast/lists/list-and-writing-mode.html b/LayoutTests/fast/lists/list-and-writing-mode.html >new file mode 100644 >index 0000000000000000000000000000000000000000..82ce23c8e0bdb13cbd28b1acf40cd0a3421af45d >--- /dev/null >+++ b/LayoutTests/fast/lists/list-and-writing-mode.html >@@ -0,0 +1,15 @@ >+<!DOCTYPE html> >+<ul> >+ <li id="target"> >+ <div style="writing-mode: vertical-lr; height: 45px;">a b c</div> >+ </li> >+</ul> >+ >+<script> >+ document.body.offsetHeight; >+ if (document.getElementById("target").offsetHeight == 45) >+ document.body.innerHTML="pass"; >+ else >+ document.body.innerHTML="fail"; >+</script> >+ >diff --git a/LayoutTests/fast/lists/list-marker-before-overflow-hidden-expected.html b/LayoutTests/fast/lists/list-marker-before-overflow-hidden-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c27854fff9ae85eaf57cf8dc96a32568f7e8e284 >--- /dev/null >+++ b/LayoutTests/fast/lists/list-marker-before-overflow-hidden-expected.html >@@ -0,0 +1,10 @@ >+<!DOCTYPE html> >+<p>crbug.com/747695: ListMarker and "a" should be in a same line</p> >+<ul> >+ <li> >+ <div> >+ <span style="vertical-align:top; height:32px; display:inline-block;">a</span> >+ </div> >+ </li> >+</ul> >+ >diff --git a/LayoutTests/fast/lists/list-marker-before-overflow-hidden.html b/LayoutTests/fast/lists/list-marker-before-overflow-hidden.html >new file mode 100644 >index 0000000000000000000000000000000000000000..cb495a5542fab2d7662b74776e67150bcff7d484 >--- /dev/null >+++ b/LayoutTests/fast/lists/list-marker-before-overflow-hidden.html >@@ -0,0 +1,10 @@ >+<!DOCTYPE html> >+<p>crbug.com/747695: ListMarker and "a" should be in a same line</p> >+<ul> >+ <li> >+ <div> >+ <span style="vertical-align:top; overflow:hidden; height:32px; display:inline-block;">a</span> >+ </div> >+ </li> >+</ul> >+ >diff --git a/LayoutTests/fast/lists/list-marker-inside-overflow-hidden-expected.html b/LayoutTests/fast/lists/list-marker-inside-overflow-hidden-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..20ddf82625bc0c101ff56777bdb7bbe339fefb9a >--- /dev/null >+++ b/LayoutTests/fast/lists/list-marker-inside-overflow-hidden-expected.html >@@ -0,0 +1,8 @@ >+<!DOCTYPE html> >+<p>crbug.com/626293: There should be a list item marker below.</p> >+ >+<ul> >+ <li> >+ xxx >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/list-marker-inside-overflow-hidden.html b/LayoutTests/fast/lists/list-marker-inside-overflow-hidden.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c86cec141f878b8165a190b10497f086648aadc1 >--- /dev/null >+++ b/LayoutTests/fast/lists/list-marker-inside-overflow-hidden.html >@@ -0,0 +1,8 @@ >+<!DOCTYPE html> >+<p>crbug.com/626293: There should be a list item marker below.</p> >+ >+<ul> >+ <li> >+ <div style='overflow:hidden'>xxx</div> >+ </li> >+</ul> >diff --git a/LayoutTests/fast/lists/list-marker-with-lineheight-and-overflow-hidden-expected.html b/LayoutTests/fast/lists/list-marker-with-lineheight-and-overflow-hidden-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..81ccf4df8c2250657150446404b9cb297575ee7f >--- /dev/null >+++ b/LayoutTests/fast/lists/list-marker-with-lineheight-and-overflow-hidden-expected.html >@@ -0,0 +1,14 @@ >+<!DOCTYPE html> >+<ul> >+ <li> >+ <div style="line-height:100px;"> >+ <span>aaa</span> >+ </div> >+ </li> >+</ul> >+<ul> >+ <li style="list-style-image: url(resources/white.gif);"> >+ <div style="line-height:100px;">One</div> >+ </li> >+</ul> >+ >diff --git a/LayoutTests/fast/lists/list-marker-with-lineheight-and-overflow-hidden.html b/LayoutTests/fast/lists/list-marker-with-lineheight-and-overflow-hidden.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d8d390f68908ca2d8eb539c1582677e7ed0fa507 >--- /dev/null >+++ b/LayoutTests/fast/lists/list-marker-with-lineheight-and-overflow-hidden.html >@@ -0,0 +1,14 @@ >+<!DOCTYPE html> >+<ul> >+ <li> >+ <div style="overflow:hidden; line-height:100px;"> >+ <span>aaa</span> >+ </div> >+ </li> >+</ul> >+ >+<ul> >+ <li style="list-style-image: url(resources/white.gif);"> >+ <div style="overflow:hidden; line-height:100px;">One</div> >+ </li> >+</ul>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192980
:
357937
|
357938
|
357939
|
357940
|
357942
|
357943
|
357944
|
357945
|
357946
|
358035
|
358036
|
358037
|
358038
|
358039
|
358041
|
358063
|
358065
|
358066
|
358067
|
358068
|
358069
|
358105
|
358106
|
358109
|
358114
|
358171
|
358673
|
358674
|
358789
|
358793
|
358794
|
358797
|
358881
|
359016
|
359606
|
366487