New issue
Advanced search Search tips

Issue 792242 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocking:
issue 714962


Participants' hotlists:
layoutng


Sign in to add a comment

[LayoutNG] Break dependencies on LayoutItem

Project Member Reported by e...@chromium.org, Dec 5 2017

Issue description

As part of painting directly from the LayoutNG fragment tree we need to break dependencies on InlineBoxes and LayoutItems (line layout API wrapper classes) as there won't be any InlineBoxes or LayoutObjects for inlines.

I can see three ways of doing this:
1) Change each call site to either access the LayoutObject/LayoutItem or the NGFragment.
2) Have NGFragments implement some of the LayoutItem API.
3) Introduce a new, more limited API, as a set of wrapper classes with separate implementations for legacy layout and LayoutNG.

The appropriate strategy will probably differ case by case but I suspect option 3 will be the easiest in the majority of cases.

The following files, outside of layout and paint, currently use the LayoutItem API:
Source/core/css/CSSCalculationValueTest.cpp
Source/core/css/CSSGradientValue.cpp
Source/core/css/CSSToLengthConversionData.cpp
Source/core/css/MediaValuesCached.cpp
Source/core/css/MediaValues.cpp
Source/core/css/MediaValuesDynamic.cpp
Source/core/css/MediaValuesInitialViewport.cpp
Source/core/css/resolver/StyleResolverState.cpp
Source/core/css/resolver/ViewportStyleResolver.cpp
Source/core/css/StyleEngine.cpp
Source/core/dom/Document.cpp
Source/core/dom/Element.cpp
Source/core/dom/FirstLetterPseudoElement.cpp
Source/core/dom/Text.cpp
Source/core/dom/TreeScope.cpp
Source/core/editing/CaretDisplayItemClient.cpp
Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
Source/core/editing/DragCaret.cpp
Source/core/editing/FrameCaret.cpp
Source/core/editing/FrameSelection.cpp
Source/core/editing/RenderedPosition.cpp
Source/core/editing/SelectionController.cpp
Source/core/editing/SelectionModifierCharacter.cpp
Source/core/editing/VisibleUnits.cpp
Source/core/editing/VisibleUnitsLine.cpp
Source/core/editing/VisibleUnitsParagraph.cpp
Source/core/events/MouseEvent.cpp
Source/core/events/WebInputEventConversion.cpp
Source/core/events/WebInputEventConversionTest.cpp
Source/core/exported/WebDevToolsAgentImpl.cpp
Source/core/exported/WebDocument.cpp
Source/core/exported/WebFrameContentDumper.cpp
Source/core/exported/WebFrameTest.cpp
Source/core/exported/WebPagePopupImpl.cpp
Source/core/exported/WebPluginContainerImpl.cpp
Source/core/exported/WebViewImpl.cpp
Source/core/exported/WebViewTest.cpp
Source/core/frame/DocumentLoadingRenderingTest.cpp
Source/core/frame/Frame.cpp
Source/core/frame/FrameViewAutoSizeInfo.cpp
Source/core/frame/LocalFrame.cpp
Source/core/frame/LocalFrameView.cpp
Source/core/frame/RemoteFrameClientImpl.cpp
Source/core/frame/RemoteFrame.cpp
Source/core/frame/RemoteFrameView.cpp
Source/core/frame/VisualViewportTest.cpp
Source/core/frame/WebFrameWidgetImpl.cpp
Source/core/frame/WebLocalFrameImpl.cpp
Source/core/fullscreen/Fullscreen.cpp
Source/core/geometry/DOMMatrixReadOnly.cpp
Source/core/html/forms/TextControlInnerElements.cpp
Source/core/html/HTMLCanvasElement.cpp
Source/core/html/HTMLEmbedElement.cpp
Source/core/html/HTMLFrameOwnerElement.cpp
Source/core/html/HTMLImageElement.cpp
Source/core/html/HTMLObjectElement.cpp
Source/core/html/HTMLPlugInElement.cpp
Source/core/html/HTMLProgressElement.cpp
Source/core/html/ListItemOrdinal.cpp
Source/core/html/media/HTMLMediaElement.cpp
Source/core/input/EventHandler.cpp
Source/core/input/EventHandlingUtil.cpp
Source/core/input/MouseEventManager.cpp
Source/core/input/MouseWheelEventManager.cpp
Source/core/input/ScrollManager.cpp
Source/core/input/TouchActionTest.cpp
Source/core/inspector/InspectorCSSAgent.cpp
Source/core/inspector/InspectorDOMAgent.cpp
Source/core/inspector/InspectorLayerTreeAgent.cpp
Source/core/inspector/InspectorOverlayAgent.cpp
Source/core/page/DragController.cpp
Source/core/page/PrintContext.cpp
Source/core/page/scrolling/RootScrollerController.cpp
Source/core/page/scrolling/RootScrollerTest.cpp
Source/core/page/scrolling/ScrollingCoordinator.cpp
Source/core/page/scrolling/ScrollingCoordinatorTest.cpp
Source/core/page/TouchAdjustment.cpp
Source/core/scheduler/FrameThrottlingTest.cpp
Source/core/svg/SVGLengthContext.cpp
Source/core/svg/SVGTextContentElement.cpp
Source/core/testing/Internals.cpp
Source/core/testing/sim/SimCompositor.cpp
Source/modules/accessibility/AXInlineTextBox.cpp
Source/modules/accessibility/AXLayoutObject.cpp
Source/modules/accessibility/AXObjectCacheImpl.cpp
Source/modules/exported/WebAXObject.cpp
Source/modules/media_controls/elements/MediaControlElementsHelper.cpp

...and these use RootInlineBox directly:
Source/core/editing/LayoutSelection.cpp
Source/core/editing/RenderedPosition.h
Source/core/editing/SelectionModifierWord.cpp
Source/core/editing/VisibleUnits.h
Source/core/editing/VisibleUnitsLine.cpp
Source/core/editing/VisibleUnitsTest.cpp
Source/core/html/forms/TextControlElement.cpp

 
Cc: -yoshi@chromium.org yosin@chromium.org
Wrong CC?

Comment 2 by e...@chromium.org, Dec 5 2017

Thanks!
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 20 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d

commit 71eb8c4fb5e49ac1619552f272dcfc91dd9a175d
Author: Koji Ishii <kojii@chromium.org>
Date: Tue Mar 20 05:19:34 2018

Share InlineBox list between LayoutInline and LayoutText

This patch changes LineBoxList, a class used to maintain a list
of InlineFlowBox in LayoutInline and LayoutBlockFlow, so that
LayoutText can use it to maintain a list of InlineTextBox.

LayoutNG uses fragments instead of InlineBox tree. By unifiying
this class, it becomes easier to make the change to LayoutText
and LayoutInline.

To share the logic, Next/PrevInlineBox and Next/PrevTextBox are
renamed to Next/PrevForSameLayoutObject. We have a few other kinds
of next/prev, such as NextOnLine. This clarifies next/prev of what
list better.

This CL also adds a few range operators to use range-based loop.

There is no behavior change in this CL.

Bug: 636993, 792242
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I9cca3bed636661058e9be6da4c1ad37de75d6bfc
Reviewed-on: https://chromium-review.googlesource.com/968101
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Aleks Totic <atotic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544288}
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/editing/InlineBoxPosition.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/inspector/InspectorDOMSnapshotAgent.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutInline.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutInline.h
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/AbstractInlineTextBox.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/InlineFlowBox.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/InlineFlowBox.h
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/InlineTextBox.h
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/LineBoxList.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/line/LineBoxList.h
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/svg/LayoutSVGInline.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/svg/LayoutSVGInlineText.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/svg/SVGLayoutTreeAsText.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/svg/SVGTextQuery.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/layout/svg/line/SVGInlineTextBox.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/paint/BoxModelObjectPainter.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
[modify] https://crrev.com/71eb8c4fb5e49ac1619552f272dcfc91dd9a175d/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp

Sign in to add a comment