[Webkit-unassigned] [Bug 192980] [css-lists] Fix list marker issues related to line breaks and markers disappearance
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jan 15 10:38:18 PST 2019
https://bugs.webkit.org/show_bug.cgi?id=192980
--- Comment #68 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 359016
--> https://bugs.webkit.org/attachment.cgi?id=359016
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=359016&action=review
> Source/WebCore/ChangeLog:12
> + 1. Create a zero-height anonymous parent for marker (to eleminate the
eleminate -> eliminate
> Source/WebCore/ChangeLog:14
> + 2. Reposition the position of marker after all list item's children
"Reposition the position of marker after" -> "Reposition the marker to be after"
> Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp:80
> +static void forceLogicalHeight(RenderElement& element, Length&& height)
Don't call the argument 'element'. That makes it sound like an HTMLElement.
> Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp:125
> + // Prepare for block direction align.
This comment doesn't add anything.
> Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp:127
> + // Deal with the situation of render tree changed.
This comment doesn't add anything.
> Source/WebCore/rendering/updating/RenderTreeBuilderList.cpp:187
> + 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);
All these repeated "m_builder.attach(listItemRenderer, <something>, beforeChild);" makes me think this code could be refactored to be much cleaner. Generally, if you have code that has multiple calls to a function with different parameters, you should factor it to have a single call.
You could have a function or lambda that returns the appropriate marker (original or new), and just have one call to m_builder.attach().
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190115/cd4a3a17/attachment.html>
More information about the webkit-unassigned
mailing list