New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 595137 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Not on Chrome anymore
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 659535
issue 662762
issue 695267
issue 699884



Sign in to add a comment

Style Resolution and Layout Tree Construction should be divorced

Project Member Reported by le...@chromium.org, Mar 15 2016

Issue description

Their most recent fight was the last straw and even their neighbors are complaining.

We want this for such things as async append and hosted LayoutNG.

Design document: https://docs.google.com/document/d/1RlEfhfUnhIEJSgV0nb8AKT4uyWbNsSY_k9uSGTUCQ2I/edit?ts=571f1080&actionButton=1&pref=2&pli=1#
 
Can I have a bit more deets? What does it entail in practice? Who gets the dog?

Comment 2 by le...@chromium.org, Mar 29 2016

Of course! Currently during recalc style, we both create our ComputedStyle objects and our LayoutObjects. One can imagine triggering a bunch of style recalcs without a layout, in which case the layout tree construction may be unnecessary work.

If we ended up building a hybrid Layout Tree whereby certain content uses a new system, and other parts the legacy one, we'd ideally be able to make decisions about what type of LayoutObject (new or old) to make using the entire DOM tree's ComputedStyles. We can currently only reason about our ancestors, not our descendants, during Layout Tree construction.

This would necessitate keeping track of what nodes are marked for Reattach during style resolution, an additional Lifecycle state where we do that reattach, and logic for when to run it.

My presumption is this would go to the Style team?

Comment 3 by le...@chromium.org, Mar 29 2016

Cc: dglazkov@chromium.org
+dglazkov in case he doesn't otherwise see my response
/me tears up. I can't believe this is finally happening.

Comment 5 by ojan@chromium.org, Mar 30 2016

Cc: meade@chromium.org ojan@chromium.org

Comment 6 by shans@chromium.org, Mar 30 2016

Style team plans to start talking about how to go about doing this on Monday next week.
Cc: cbiesin...@chromium.org
Cc: nainar@chromium.org bugsnash@chromium.org

Comment 9 by nainar@chromium.org, Apr 29 2016

Owner: nainar@chromium.org
Status: Started (was: Available)
Project Member

Comment 10 by bugdroid1@chromium.org, May 19 2016

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

commit 52328753422fc25a3815bd58f6eaf8e70f6e27ff
Author: nainar <nainar@chromium.org>
Date: Thu May 19 03:04:00 2016

Rename (updateLayout/updateStyle).*.() to updateStyleAndLayout.*.()

Currently functions in Document and other classes titled
(updateLayout/updateStyle).*.() are not just doing Layout Tree
Construction but also performing Style Resolution. This patch changes
the names of these functions to be more accurate. This rename change
was also mentioned in the Design Doc for splitting up Style Resolution
and  Layout Tree Construction here: bit.ly/24nQ9UQ

This change is not developer facing as the trace event for the part
of the code the Style resolution and Layout Tree Construction is still
called "UpdateLayoutTree" for backwards compatibility.

BUG= 595137 

Review-Url: https://codereview.chromium.org/1896793002
Cr-Commit-Position: refs/heads/master@{#394644}

[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/animation/EffectInput.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/css/DragUpdateTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/DocumentStatisticsCollector.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Fullscreen.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Range.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/DragCaretController.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/Editor.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/FrameSelection.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/InputMethodController.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/PlainTextRange.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/SelectionController.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/VisibleSelection.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/InsertIntoTextNodeCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/markers/DocumentMarkerControllerTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/serializers/Serialization.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/editing/spellcheck/TextCheckingHelper.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/events/MouseRelatedEvent.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/frame/FrameViewAutoSizeInfo.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/frame/LocalFrame.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/frame/VisualViewport.h
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLAreaElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLDialogElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLLabelElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLLegendElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLMeterElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/HTMLTextFormControlElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/ImageDocument.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/PluginDocument.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/forms/ImageInputType.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/html/shadow/DateTimeEditElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/input/EventHandler.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/inspector/LayoutEditor.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/layout/LayoutObject.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/page/FocusController.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/page/PrintContext.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/page/scrolling/SnapCoordinatorTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/svg/SVGGeometryElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/svg/SVGGraphicsElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/svg/SVGPathElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/svg/SVGSVGElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/svg/SVGTextContentElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/svg/SVGUseElement.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/testing/Internals.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/core/xml/parser/XMLErrors.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/modules/accessibility/AXObjectTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/ExternalPopupMenu.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/ExternalPopupMenuTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/PopupMenuImpl.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/WebAXObject.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/WebNode.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/WebViewImpl.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/mac/WebSubstringUtil.mm
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/tests/DocumentLoadingRenderingTest.cpp
[modify] https://crrev.com/52328753422fc25a3815bd58f6eaf8e70f6e27ff/third_party/WebKit/Source/web/tests/WebDocumentTest.cpp

Project Member

Comment 11 by bugdroid1@chromium.org, Jun 24 2016

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

commit 11af5b8769875ef50b16cb94d7eb758def0d9b08
Author: bugsnash <bugsnash@chromium.org>
Date: Fri Jun 24 05:36:14 2016

Storage of ComputedStyle separate from LayoutObject.

Part of stage 1 in separation of style resolution and
layout tree construction
Design doc: bit.ly/24nQ9UQ

Changes the Node::m_data DataUnion to now allow a ComputedStyle.

Updates Node flags with new flag HasLayoutObject to indicate whether
the DataUnion is a LayoutObject or a ComputedStyle. Adds new
hasLayoutObject method to check flag.

Updates ComputedStyle and Layoutobject getters and setters accordingly.

Written with nainar@

BUG= 595137 

Review-Url: https://codereview.chromium.org/1962953002
Cr-Commit-Position: refs/heads/master@{#401821}

[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/dom/NodeRareData.cpp
[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/dom/NodeRareData.h
[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/html/HTMLOptGroupElement.h
[modify] https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08/third_party/WebKit/Source/core/html/HTMLOptionElement.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jun 24 2016

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

commit cbe9a86098dfc52db1f5a910696a28473a1a54de
Author: rnephew <rnephew@chromium.org>
Date: Fri Jun 24 17:42:05 2016

Revert of Storage of ComputedStyle separate from LayoutObject. (patchset #11 id:260001 of https://codereview.chromium.org/1962953002/ )

Reason for revert:
Bisect is saying this is causing android per test failures.

https://build.chromium.org/p/tryserver.chromium.perf/builders/android_nexus5X_perf_bisect/builds/236

crbug.com/623087

Original issue's description:
> Storage of ComputedStyle separate from LayoutObject.
>
> Part of stage 1 in separation of style resolution and
> layout tree construction
> Design doc: bit.ly/24nQ9UQ
>
> Changes the Node::m_data DataUnion to now allow a ComputedStyle.
>
> Updates Node flags with new flag HasLayoutObject to indicate whether
> the DataUnion is a LayoutObject or a ComputedStyle. Adds new
> hasLayoutObject method to check flag.
>
> Updates ComputedStyle and Layoutobject getters and setters accordingly.
>
> Written with nainar@
>
> BUG= 595137 
>
> Committed: https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08
> Cr-Commit-Position: refs/heads/master@{#401821}

TBR=timloh@chromium.org,bugsnash@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 595137 ,623087

Review-Url: https://codereview.chromium.org/2093143002
Cr-Commit-Position: refs/heads/master@{#401898}

[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/dom/NodeRareData.cpp
[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/dom/NodeRareData.h
[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/html/HTMLOptGroupElement.h
[modify] https://crrev.com/cbe9a86098dfc52db1f5a910696a28473a1a54de/third_party/WebKit/Source/core/html/HTMLOptionElement.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 11 2016

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

commit 617ae6ff6a6664b776e2f8617ef3f51bef639a2b
Author: nainar <nainar@chromium.org>
Date: Mon Jul 11 01:11:40 2016

Reorganize Layout Tree Construction code to be its own function

This patch trivially encapsulates Layout Tree Construction
code in its own function -> Element::buildOwnLayout().

No behaviour change is expected from this patch since it is
merely moving code around.

With lots of help from @bugsnash

Design doc: http://bit.ly/29MBWvf

BUG= 595137 

Review-Url: https://codereview.chromium.org/2118393002
Cr-Commit-Position: refs/heads/master@{#404584}

[modify] https://crrev.com/617ae6ff6a6664b776e2f8617ef3f51bef639a2b/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/617ae6ff6a6664b776e2f8617ef3f51bef639a2b/third_party/WebKit/Source/core/dom/Element.h

Project Member

Comment 15 by bugdroid1@chromium.org, Aug 15 2016

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

commit 7f405ec2b6914d482d081d2cb5d80bdf5226bd57
Author: bugsnash <bugsnash@chromium.org>
Date: Mon Aug 15 01:56:15 2016

Storage of ComputedStyle separate from LayoutObject.

Part of stage 1 in separation of style resolution and
layout tree construction
Design doc: bit.ly/24nQ9UQ

Changes the Node::m_data DataUnion to now allow a ComputedStyle.

Updates Node flags with new flag HasLayoutObject to indicate whether
the DataUnion is a LayoutObject or a ComputedStyle. Adds new
hasLayoutObject method to check flag.

Updates ComputedStyle and Layoutobject getters and setters accordingly.

Written with nainar@

Originally landed as:
https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08
but was reverted.

BUG= 595137 

Review-Url: https://codereview.chromium.org/1962953002
Cr-Commit-Position: refs/heads/master@{#411933}

[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/dom/NodeRareData.cpp
[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/dom/NodeRareData.h
[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/html/HTMLOptGroupElement.h
[modify] https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57/third_party/WebKit/Source/core/html/HTMLOptionElement.h

Project Member

Comment 16 by bugdroid1@chromium.org, Sep 14 2016

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

commit c542d3744b905a2a00f5ac2dd2047a6a323ec181
Author: bugsnash <bugsnash@chromium.org>
Date: Wed Sep 14 01:58:26 2016

Made ElementRareData store ComputedStyle on LayoutObject if possible.

Made ElementRareData store ComputedStyle on LayoutObject of it's base
class NodeRareDataBase if it has a LayoutObject.
Otherwise it is stored on the ComputedStyle member of ElementRareData.

The reason for this is to make it consistent with storage of
ComputedStyle on Node, which stores a union that can be one of:
1) a ComputedStyle
2) a LayoutObject (ComputedStyle can be stored on this)
3) a NodeRareData (LayoutObject can be stored on this which stores
ComputedStyle or if no LayoutObject ComputedStyle can be stored
directly on ElementRareData)

This patch encapsulates the logic of where to store the ComputedStyle
on the ElementRareData so that it doesn't need to be done at the call
site (e.g. in new method Node::setComputedStyle from
https://codereview.chromium.org/2001453002)

The clearComputedStyle method is special and only clears the
ComputedStyle member as its current use is not intended to clear a
LayoutObject's ComputedStyle.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2293713002
Cr-Commit-Position: refs/heads/master@{#418453}

[modify] https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181/third_party/WebKit/Source/core/dom/ElementRareData.h
[add] https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181/third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp
[modify] https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181/third_party/WebKit/Source/core/dom/NodeRareData.h

Project Member

Comment 17 by bugdroid1@chromium.org, Sep 28 2016

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

commit a818ae856981327097e4d353ed604c9a1d822025
Author: bugsnash <bugsnash@chromium.org>
Date: Wed Sep 28 03:55:58 2016

Revert of Storage of ComputedStyle separate from LayoutObject. (patchset #14 id:320001 of https://codereview.chromium.org/1962953002/ )

Reason for revert:
Squad project needs redesign, no longer will use ComputedStyle on Node's data union

Original issue's description:
> Storage of ComputedStyle separate from LayoutObject.
>
> Part of stage 1 in separation of style resolution and
> layout tree construction
> Design doc: bit.ly/24nQ9UQ
>
> Changes the Node::m_data DataUnion to now allow a ComputedStyle.
>
> Updates Node flags with new flag HasLayoutObject to indicate whether
> the DataUnion is a LayoutObject or a ComputedStyle. Adds new
> hasLayoutObject method to check flag.
>
> Updates ComputedStyle and Layoutobject getters and setters accordingly.
>
> Written with nainar@
>
> Originally landed as:
> https://crrev.com/11af5b8769875ef50b16cb94d7eb758def0d9b08
> but was reverted.
>
> BUG= 595137 
>
> Committed: https://crrev.com/7f405ec2b6914d482d081d2cb5d80bdf5226bd57
> Cr-Commit-Position: refs/heads/master@{#411933}

TBR=esprehn@chromium.org,timloh@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 595137 

Review-Url: https://codereview.chromium.org/2380503002
Cr-Commit-Position: refs/heads/master@{#421441}

[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/dom/NodeRareData.cpp
[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/dom/NodeRareData.h
[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/html/HTMLOptGroupElement.h
[modify] https://crrev.com/a818ae856981327097e4d353ed604c9a1d822025/third_party/WebKit/Source/core/html/HTMLOptionElement.h

Project Member

Comment 18 by bugdroid1@chromium.org, Sep 28 2016

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

commit ced6b481f3ebe3886ec5f0dd25e9815a2f8b96c8
Author: bugsnash <bugsnash@chromium.org>
Date: Wed Sep 28 08:17:36 2016

Revert of Made ElementRareData store ComputedStyle on LayoutObject if possible. (patchset #5 id:100001 of https://codereview.chromium.org/2293713002/ )

Reason for revert:
Storage of ComputedStyle on LayoutObject causes invalid LayoutObject state. Also no longer required for consistency as Squad project requires redesign and will no longer store ComputedStyle on Node's data union.

Original issue's description:
> Made ElementRareData store ComputedStyle on LayoutObject if possible.
>
> Made ElementRareData store ComputedStyle on LayoutObject of it's base
> class NodeRareDataBase if it has a LayoutObject.
> Otherwise it is stored on the ComputedStyle member of ElementRareData.
>
> The reason for this is to make it consistent with storage of
> ComputedStyle on Node, which stores a union that can be one of:
> 1) a ComputedStyle
> 2) a LayoutObject (ComputedStyle can be stored on this)
> 3) a NodeRareData (LayoutObject can be stored on this which stores
> ComputedStyle or if no LayoutObject ComputedStyle can be stored
> directly on ElementRareData)
>
> This patch encapsulates the logic of where to store the ComputedStyle
> on the ElementRareData so that it doesn't need to be done at the call
> site (e.g. in new method Node::setComputedStyle from
> https://codereview.chromium.org/2001453002)
>
> The clearComputedStyle method is special and only clears the
> ComputedStyle member as its current use is not intended to clear a
> LayoutObject's ComputedStyle.
>
> BUG= 595137 
>
> Committed: https://crrev.com/c542d3744b905a2a00f5ac2dd2047a6a323ec181
> Cr-Commit-Position: refs/heads/master@{#418453}

TBR=meade@chromium.org,nainar@chromium.org,timloh@chromium.org,esprehn@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 595137 

Review-Url: https://codereview.chromium.org/2378573002
Cr-Commit-Position: refs/heads/master@{#421478}

[modify] https://crrev.com/ced6b481f3ebe3886ec5f0dd25e9815a2f8b96c8/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/ced6b481f3ebe3886ec5f0dd25e9815a2f8b96c8/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/ced6b481f3ebe3886ec5f0dd25e9815a2f8b96c8/third_party/WebKit/Source/core/dom/ElementRareData.h
[delete] https://crrev.com/7afe3476bd1f1f851515c6c420791890a6b7b352/third_party/WebKit/Source/core/dom/ElementRareDataTest.cpp
[modify] https://crrev.com/ced6b481f3ebe3886ec5f0dd25e9815a2f8b96c8/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/ced6b481f3ebe3886ec5f0dd25e9815a2f8b96c8/third_party/WebKit/Source/core/dom/NodeRareData.h

Project Member

Comment 19 by bugdroid1@chromium.org, Sep 28 2016

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

commit b56e87fdebf11e10d8a181200b9722b5deb2fcf3
Author: nainar <nainar@chromium.org>
Date: Wed Sep 28 23:35:59 2016

Add dirty bits on Node indicating need for reattachLayoutTree

Add dirty bits on Node indicating need for:
1. The node itself needs to be reattached (NeedsReattachLayoutTree)
2. One of the node's children needs to be reattached (ChildNeedsReattachLayoutTree)

BUG= 595137 

Review-Url: https://codereview.chromium.org/2378633002
Cr-Commit-Position: refs/heads/master@{#421682}

[modify] https://crrev.com/b56e87fdebf11e10d8a181200b9722b5deb2fcf3/third_party/WebKit/Source/core/dom/Node.h

Project Member

Comment 20 by bugdroid1@chromium.org, Oct 5 2016

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

commit 0e000934cd50d42e30d776ec50fb976f9f68b59c
Author: nainar <nainar@chromium.org>
Date: Wed Oct 05 06:27:46 2016

Stash ComputedStyles on new HeapHashMap on Document.

This patch stashes ComputedStyles on new HeapHashMap on Document and
adds relevant getters/setters.

When we enter Document::updateStyle, we first reserve capacity in the
map and then clear it after we are done with Style resolution and
Layout Tree Construcion phase.

The patch then adds an entry on this map in  Element::recalcOwnStyle and
reads this entry in Element::rebuildLayoutTree.

Pair programmed with bugsnash@

BUG= 595137 

Review-Url: https://codereview.chromium.org/2376453004
Cr-Commit-Position: refs/heads/master@{#423088}

[modify] https://crrev.com/0e000934cd50d42e30d776ec50fb976f9f68b59c/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/0e000934cd50d42e30d776ec50fb976f9f68b59c/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/0e000934cd50d42e30d776ec50fb976f9f68b59c/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/0e000934cd50d42e30d776ec50fb976f9f68b59c/third_party/WebKit/Source/core/dom/Element.h

Description: Show this description
Labels: Objective
Project Member

Comment 23 by bugdroid1@chromium.org, Oct 16 2016

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

commit 4b9833ae2deefd124a268633ff6054a69ef43bf4
Author: bugsnash <bugsnash@chromium.org>
Date: Sun Oct 16 23:06:06 2016

Removed ref churn from Document::getNonAttachedStyle.

Removed the creation of a new local RefPtr object which
creates ref churn.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2405753002
Cr-Commit-Position: refs/heads/master@{#425599}

[modify] https://crrev.com/4b9833ae2deefd124a268633ff6054a69ef43bf4/third_party/WebKit/Source/core/dom/Document.cpp

Project Member

Comment 24 by bugdroid1@chromium.org, Oct 20 2016

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

commit 09b7a8cf0647abca732b3718987a629d12a67fee
Author: nainar <nainar@chromium.org>
Date: Thu Oct 20 00:31:10 2016

Move Layout Tree Construction code into Element::rebuildLayoutTree()

This patch uses the two dirty bits (NeedsReattachLayoutTree and
ChildNeedsReattachLayoutTree) on Node and adds the relevant
getters/setters for them.

It makes rebuildLayoutTree() public to be accessed in Document.cpp.

It also moves reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and
uses dirtyBits to call either reattachLayoutTree() on node itself or call
rebuildLayoutTree() on children nodes.

Also added some comments explaining some design decisions. Will be removed
upon completion of separation.

BUG= 595137 

Review-Url: https://chromiumcodereview.appspot.com/2398293003
Cr-Commit-Position: refs/heads/master@{#426353}

[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp

Project Member

Comment 25 by bugdroid1@chromium.org, Oct 22 2016

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

commit 352b045421e6e2ceeba083eeebd27f64adf41194
Author: nainar <nainar@chromium.org>
Date: Sat Oct 22 13:06:49 2016

Revert of Move Layout Tree Construction code into Element::rebuildLayoutTree() (patchset #12 id:240001 of https://codereview.chromium.org/2398293003/ )

Reason for revert:
Suspected to cause crbug.com/658322.

Original issue's description:
> Move Layout Tree Construction code into Element::rebuildLayoutTree()
>
> This patch uses the two dirty bits (NeedsReattachLayoutTree and
> ChildNeedsReattachLayoutTree) on Node and adds the relevant
> getters/setters for them.
>
> It makes rebuildLayoutTree() public to be accessed in Document.cpp.
>
> It also moves reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and
> uses dirtyBits to call either reattachLayoutTree() on node itself or call
> rebuildLayoutTree() on children nodes.
>
> Also added some comments explaining some design decisions. Will be removed
> upon completion of separation.
>
> BUG= 595137 
>
> Committed: https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee
> Cr-Commit-Position: refs/heads/master@{#426353}

TBR=esprehn@chromium.org,bugsnash@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 595137 

Review-Url: https://chromiumcodereview.appspot.com/2439973005
Cr-Commit-Position: refs/heads/master@{#426991}

[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/352b045421e6e2ceeba083eeebd27f64adf41194/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp

Project Member

Comment 26 by bugdroid1@chromium.org, Oct 26 2016

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

commit 651c13992922ce5c2b0dd0072c5c3e4a59a03b87
Author: nainar <nainar@chromium.org>
Date: Wed Oct 26 06:35:03 2016

Move Layout Tree Construction code into Element::rebuildLayoutTree()

This patch uses the two dirty bits (NeedsReattachLayoutTree and
ChildNeedsReattachLayoutTree) on Node and adds the relevant
getters/setters for them.

It makes rebuildLayoutTree() public to be accessed in Document.cpp.

It also moves reattachWhitespaceSiblingsIfNeeded() to rebuildLayoutTree() and
uses dirtyBits to call either reattachLayoutTree() on node itself or call
rebuildLayoutTree() on children nodes.

Also added some comments explaining some design decisions. Will be removed
upon completion of separation.

BUG= 595137 

Committed: https://crrev.com/09b7a8cf0647abca732b3718987a629d12a67fee
Review-Url: https://codereview.chromium.org/2398293003
Cr-Original-Commit-Position: refs/heads/master@{#426353}
Cr-Commit-Position: refs/heads/master@{#427612}

[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/651c13992922ce5c2b0dd0072c5c3e4a59a03b87/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp

Blockedon: 659535
Project Member

Comment 28 by bugdroid1@chromium.org, Oct 27 2016

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

commit a4805a287ac79834a932f44c87791a7b9322ede8
Author: nainar <nainar@chromium.org>
Date: Thu Oct 27 08:49:02 2016

Move layout tree reconstruction code for Text nodes into new function

This code moves the Layout Tree construction code for Text
nodes into Text::rebuildTextLayoutTree()

BUG= 595137 

Review-Url: https://codereview.chromium.org/2421793002
Cr-Commit-Position: refs/heads/master@{#427967}

[modify] https://crrev.com/a4805a287ac79834a932f44c87791a7b9322ede8/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/a4805a287ac79834a932f44c87791a7b9322ede8/third_party/WebKit/Source/core/dom/Text.h

Cc: yosin@chromium.org
Blockedon: 662762
Project Member

Comment 31 by bugdroid1@chromium.org, Dec 7 2016

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

commit e67ef441d061fc7714cd589a90c98d33af77350b
Author: nainar <nainar@chromium.org>
Date: Wed Dec 07 02:43:29 2016

Change getStyleChangeType() == NeedsReattachStyleChange to call needsAttach() instead

needsAttach() checks that getStyleChangeType is NeedsReattachStyleChange
the functions changed here have been changed to call the function instead
of checking this directly.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2552383003
Cr-Commit-Position: refs/heads/master@{#436846}

[modify] https://crrev.com/e67ef441d061fc7714cd589a90c98d33af77350b/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/e67ef441d061fc7714cd589a90c98d33af77350b/third_party/WebKit/Source/core/dom/Node.h

Project Member

Comment 32 by bugdroid1@chromium.org, Dec 7 2016

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

commit ce6cb90916b41f6ef17ae157812ded93fdbd8812
Author: nainar <nainar@chromium.org>
Date: Wed Dec 07 05:36:19 2016

Change key of m_styleReattachDataMap to Node instead of Element

This patch changed the m_styleReattachDataMap key from Element to Node
which is needed so that we can store Text nodes and their
nextTextSibling in this map as well. Not possible if key is Element.

Need to store Text nodes as we need to pass information about
the nextTextSibling between Text::recalcTextStyle and
Text::rebuildTextLayoutTree.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2560673002
Cr-Commit-Position: refs/heads/master@{#436873}

[modify] https://crrev.com/ce6cb90916b41f6ef17ae157812ded93fdbd8812/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/ce6cb90916b41f6ef17ae157812ded93fdbd8812/third_party/WebKit/Source/core/dom/Document.h

Project Member

Comment 33 by bugdroid1@chromium.org, Jan 16 2017

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

commit 2b7d25ee19b21a8da3c3c97c6304bba3d3608df0
Author: bugsnash <bugsnash@chromium.org>
Date: Mon Jan 16 22:14:39 2017

Added constness to the hashmap on Document.

Made the Node key on the hashmap const and made the getStyleReattachData
method const.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2629603003
Cr-Commit-Position: refs/heads/master@{#443951}

[modify] https://crrev.com/2b7d25ee19b21a8da3c3c97c6304bba3d3608df0/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/2b7d25ee19b21a8da3c3c97c6304bba3d3608df0/third_party/WebKit/Source/core/dom/Document.h

Project Member

Comment 34 by bugdroid1@chromium.org, Jan 28 2017

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

commit 57e530fab3e3d9be05de503a6066bb89d5741bf1
Author: nainar <nainar@chromium.org>
Date: Sat Jan 28 01:11:14 2017

Remove redundant argument being passed to didRecalcStyle

This patch removs an unused argument (StyleRecalcChange) to Element and
other classes implementing didRecalcStyle.

CL that added the function to be used is:
https://chromium.googlesource.com/chromium/src/+/a08e0f58a0f6083552f619e9c88888b82d8de6b5%5E%21

It was used in SVGUseElement

(thanks bugsnash@ for the investigation)

BUG= 595137 

Review-Url: https://codereview.chromium.org/2658073003
Cr-Commit-Position: refs/heads/master@{#446864}

[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.h
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/dom/PseudoElement.cpp
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/dom/PseudoElement.h
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/html/HTMLFormControlElement.h
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/html/HTMLMediaElement.h
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/html/HTMLSelectElement.cpp
[modify] https://crrev.com/57e530fab3e3d9be05de503a6066bb89d5741bf1/third_party/WebKit/Source/core/html/HTMLSelectElement.h

Labels: Update-Monthly
Project Member

Comment 36 by bugdroid1@chromium.org, Feb 22 2017

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

commit 8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f
Author: nainar <nainar@chromium.org>
Date: Wed Feb 22 10:52:39 2017

Call Element::rebuildLayoutTree from Document::updateStyle directly

This patch changes the callstack in Document::updateStyle to call
Element::rebuildLayoutTree after Element::recalcStyle instead of
from it.

It also adds helper functions needed to perform Layout Tree Construction:
1. ContainerNode::rebuildDescendantLayoutTree()
2. Element::rebuildShadowRootLayoutTree()
3. Element::reattachPseudoElementLayoutTree(PseudoId pseudoId)
4. ShadowRoot::rebuildLayoutTree()

It also changes the setting/getting of the (Child)NeedsStyleRecalc
and (Child)NeedsReattachLayoutTree bits to match this pattern.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2473743003
Cr-Commit-Position: refs/heads/master@{#451987}

[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/ContainerNode.h
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/Text.h
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/dom/stylerecalc.md
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp
[modify] https://crrev.com/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f/third_party/WebKit/Source/core/style/ComputedStyleConstants.h

Update: This last patch that landed successfully pulls out all layout tree construction from style resolution. See the design document linked at the top (under Squad section 1) for more implementation details. 
Blockedon: 695267
Project Member

Comment 39 by bugdroid1@chromium.org, Mar 1 2017

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

commit 7ff96ffaec996e51a13ac4b9f026d96f81910348
Author: nainar <nainar@chromium.org>
Date: Wed Mar 01 05:22:16 2017

Revert of Call Element::rebuildLayoutTree from Document::updateStyle directly (patchset #33 id:640001 of https://codereview.chromium.org/2473743003/ )

Reason for revert:
Reason for revert is: https://bugs.chromium.org/p/chromium/issues/detail?id=695950

Original issue's description:
> Call Element::rebuildLayoutTree from Document::updateStyle directly
>
> This patch changes the callstack in Document::updateStyle to call
> Element::rebuildLayoutTree after Element::recalcStyle instead of
> from it.
>
> It also adds helper functions needed to perform Layout Tree Construction:
> 1. ContainerNode::rebuildDescendantLayoutTree()
> 2. Element::rebuildShadowRootLayoutTree()
> 3. Element::reattachPseudoElementLayoutTree(PseudoId pseudoId)
> 4. ShadowRoot::rebuildLayoutTree()
>
> It also changes the setting/getting of the (Child)NeedsStyleRecalc
> and (Child)NeedsReattachLayoutTree bits to match this pattern.
>
> BUG= 595137 
>
> Review-Url: https://codereview.chromium.org/2473743003
> Cr-Commit-Position: refs/heads/master@{#451987}
> Committed: https://chromium.googlesource.com/chromium/src/+/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f

TBR=esprehn@chromium.org,rune@opera.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG= 595137 

Review-Url: https://codereview.chromium.org/2729453002
Cr-Commit-Position: refs/heads/master@{#453853}

[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/ContainerNode.h
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/Text.h
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/dom/stylerecalc.md
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp
[modify] https://crrev.com/7ff96ffaec996e51a13ac4b9f026d96f81910348/third_party/WebKit/Source/core/style/ComputedStyleConstants.h

Project Member

Comment 40 by bugdroid1@chromium.org, Mar 6 2017

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

commit f4c976fc1f4578b0c75ba304553ef2ff6134f551
Author: nainar <nainar@chromium.org>
Date: Mon Mar 06 04:05:17 2017

Call Element::rebuildLayoutTree from Document::updateStyle directly

This patch changes the callstack in Document::updateStyle to call
Element::rebuildLayoutTree after Element::recalcStyle instead of
from it.

It also adds helper functions needed to perform Layout Tree Construction:
1. ContainerNode::rebuildChildrenLayoutTrees()
2. Element::rebuildShadowRootLayoutTree()
3. Element::reattachPseudoElementLayoutTree(PseudoId pseudoId)
4. ShadowRoot::rebuildLayoutTree()

It also changes the setting/getting of the (Child)NeedsStyleRecalc
and (Child)NeedsReattachLayoutTree bits to match this pattern.

The patch also adds a LayoutTest to test for the crash caught
in  crbug.com/695950 .

BUG= 595137 

Review-Url: https://codereview.chromium.org/2473743003
Cr-Original-Commit-Position: refs/heads/master@{#451987}
Committed: https://chromium.googlesource.com/chromium/src/+/8b6c7b7ce5a36d8eda49dd6e60c5e7c8f5c7277f
Review-Url: https://codereview.chromium.org/2473743003
Cr-Commit-Position: refs/heads/master@{#454824}

[add] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement-crash-style-recalc-after-dialog-close-expected.html
[add] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/LayoutTests/fast/dom/HTMLDialogElement-crash-style-recalc-after-dialog-close.html
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/ContainerNode.h
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/Text.h
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.h
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/dom/stylerecalc.md
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/html/HTMLFrameSetElement.cpp
[modify] https://crrev.com/f4c976fc1f4578b0c75ba304553ef2ff6134f551/third_party/WebKit/Source/core/style/ComputedStyleConstants.h

Project Member

Comment 41 by bugdroid1@chromium.org, Mar 6 2017

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

commit 615bbb898b2b62c1e1720d4278aba988662cc77b
Author: nainar <nainar@chromium.org>
Date: Mon Mar 06 05:27:48 2017

Make NeedsReattachLayoutTree and ChildNeedsReattachLayoutTree getters const

This patch makes the needsReattachLayoutTree() and
childNeedsReattachLayoutTree() const. This mimics the needsStyleRecalc()
and childNeedsStyleRecalc() functions.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2731243002
Cr-Commit-Position: refs/heads/master@{#454830}

[modify] https://crrev.com/615bbb898b2b62c1e1720d4278aba988662cc77b/third_party/WebKit/Source/core/dom/Node.h

Comment 42 by ojan@chromium.org, Mar 7 2017

Cc: -ojan@chromium.org
Blockedon: 699884
Project Member

Comment 44 by bugdroid1@chromium.org, Mar 10 2017

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

commit af8b67666d6c89aec9abebe7df21a2732d91ea2a
Author: rune <rune@opera.com>
Date: Fri Mar 10 12:36:47 2017

Track lastTextNode during rebuildLayoutTree.

We keep track of last seen text node for more efficient whitespace
re-attachment. When style recalc and layout tree building was split,
the text node is still tracked during recalc, stored in a hash map, and
retreived when needed during layout tree building.

However, the text nodes are also traversed during layout tree building
so that we can track the nodes during that phase instead.
StyleReattachData is removed and this CL reverts back to using the
m_nonAttachedStyle map for ComputedStyle.

The comment about reversed traversal of children for avoiding n^2
performance is moved to rebuildChildrenLayoutTrees() since that's where
the issue is. We should be able to do the child recalc first-to-last
now if we want to.

R=nainar@chromium.org,esprehn@chromium.org
BUG= 595137 

Review-Url: https://codereview.chromium.org/2740823005
Cr-Commit-Position: refs/heads/master@{#456047}

[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/BUILD.gn
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/Element.h
[delete] https://crrev.com/9b207c01a4d7df3381eb1fefc6d62be7847e1365/third_party/WebKit/Source/core/dom/StyleReattachData.h
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/Text.cpp
[modify] https://crrev.com/af8b67666d6c89aec9abebe7df21a2732d91ea2a/third_party/WebKit/Source/core/dom/Text.h

Project Member

Comment 45 by bugdroid1@chromium.org, Mar 22 2017

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

commit d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf
Author: rune <rune@opera.com>
Date: Wed Mar 22 08:20:51 2017

Make all setNeedsReattachLayoutTree happen from updateStyle.

The setNeedsReattachLayoutTree calls which were done outside of
updateStyle were all accompanied by a NeedsReattachStyleChange for the
node marking the ancestor chain for recalc. Therefore we can simply
mark for re-attachment inside the recalcStyle pass instead.

Enforce the invariant by introducing a DCHECK that the we are inside
updateStyleAndLayoutTree, and that the shadow DOM distribution is
up-to-date.

R=nainar@chromium.org,esprehn@chromium.org
BUG= 595137 

Review-Url: https://codereview.chromium.org/2760233004
Cr-Commit-Position: refs/heads/master@{#458683}

[modify] https://crrev.com/d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf/third_party/WebKit/Source/core/dom/shadow/ElementShadow.cpp
[modify] https://crrev.com/d6f8a937c0d8fbfcbdfe7edc93255e454c5de3cf/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp

Project Member

Comment 46 by bugdroid1@chromium.org, Mar 28 2017

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

commit 9c91326aed6eb90617cebd1180d26cd4c6a41d00
Author: rune <rune@opera.com>
Date: Tue Mar 28 06:19:23 2017

Add separate trace events for recalcStyle and rebuildLayoutTree.

When style recalc and layout tree building is fully separated, it will
be valuable to measure them separately as well.

R=nainar@chromium.org,esprehn@chromium.org
BUG= 595137 

Review-Url: https://codereview.chromium.org/2779573002
Cr-Commit-Position: refs/heads/master@{#460027}

[modify] https://crrev.com/9c91326aed6eb90617cebd1180d26cd4c6a41d00/third_party/WebKit/Source/core/dom/Document.cpp

Project Member

Comment 47 by bugdroid1@chromium.org, Apr 10 2017

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

commit 83fce45beecdbd02f1e66b56fd73224f3108c34d
Author: rune <rune@opera.com>
Date: Mon Apr 10 22:30:51 2017

kChildNeedsReattachLayoutTree should not be initially set.

This flag should have been dropped in [1] since we dropped setting
kNeedsReattachLayoutTree initially in that CL.

[1] https://codereview.chromium.org/2760233004

R=nainar@chromium.org
BUG= 595137 

Review-Url: https://codereview.chromium.org/2807063003
Cr-Commit-Position: refs/heads/master@{#463421}

[modify] https://crrev.com/83fce45beecdbd02f1e66b56fd73224f3108c34d/third_party/WebKit/Source/core/dom/Node.h

Project Member

Comment 48 by bugdroid1@chromium.org, Apr 14 2017

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

commit 2f631c11f8e8f80c2373a6da4e4c24f7337ea55e
Author: nainar <nainar@chromium.org>
Date: Fri Apr 14 00:23:19 2017

Move LayoutObject to satellite NodeLayoutData that hangs from a Node.

This patch moves the LayoutObject to be stored on LayoutData which hangs
off a Node instead of being stored on the DataUnion (either directly or
on a NodeRareData.)

This is the first step in adding more Rendering information on a satellite
object thereby not increasing the size of a Node but allowing us to store
more information nonetheless.

BUG= 595137 

Review-Url: https://codereview.chromium.org/2814603002
Cr-Commit-Position: refs/heads/master@{#464622}

[modify] https://crrev.com/2f631c11f8e8f80c2373a6da4e4c24f7337ea55e/third_party/WebKit/Source/core/dom/ElementRareData.h
[modify] https://crrev.com/2f631c11f8e8f80c2373a6da4e4c24f7337ea55e/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/2f631c11f8e8f80c2373a6da4e4c24f7337ea55e/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/2f631c11f8e8f80c2373a6da4e4c24f7337ea55e/third_party/WebKit/Source/core/dom/NodeRareData.cpp
[modify] https://crrev.com/2f631c11f8e8f80c2373a6da4e4c24f7337ea55e/third_party/WebKit/Source/core/dom/NodeRareData.h

Project Member

Comment 49 by bugdroid1@chromium.org, Apr 22 2017

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

commit e0a99ba807c98cb277234bb9ea557549bbf91aa8
Author: rune <rune@opera.com>
Date: Sat Apr 22 19:28:31 2017

Removed superfluous custom style DCHECK.

Custom style callbacks are called during style recalc. There is no need
to check that ShadowRoot does not have such callbacks during layout
tree rebuild. There is already a check in ShadowRoot::RecalcStyle().

R=nainar@chromium.org
BUG= 595137 

Review-Url: https://codereview.chromium.org/2833223002
Cr-Commit-Position: refs/heads/master@{#466551}

[modify] https://crrev.com/e0a99ba807c98cb277234bb9ea557549bbf91aa8/third_party/WebKit/Source/core/dom/shadow/ShadowRoot.cpp

Project Member

Comment 50 by bugdroid1@chromium.org, Apr 27 2017

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

commit 95862a52c7bc1a5846259619243289805d095b70
Author: nainar <nainar@chromium.org>
Date: Thu Apr 27 01:44:18 2017

Store nonAttachedStyle on NodeLayoutData instead of on HashMap in Document.

This patch stores the ComputedStyle to be passed between recalcStyle
and rebuildLayoutTree on NodeLayoutData instead of storing it on the
HashMap on Document.

This potentially fixes the perf regression in  crbug.com/700093  as it
removes the HashMap lookup in SharedStyleFinder and making it a free
operation again.

BUG= 595137 ,  700093 

Review-Url: https://codereview.chromium.org/2821193003
Cr-Commit-Position: refs/heads/master@{#467542}

[modify] https://crrev.com/95862a52c7bc1a5846259619243289805d095b70/third_party/WebKit/Source/core/css/resolver/SharedStyleFinder.cpp
[modify] https://crrev.com/95862a52c7bc1a5846259619243289805d095b70/third_party/WebKit/Source/core/dom/Document.cpp
[modify] https://crrev.com/95862a52c7bc1a5846259619243289805d095b70/third_party/WebKit/Source/core/dom/Document.h
[modify] https://crrev.com/95862a52c7bc1a5846259619243289805d095b70/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/95862a52c7bc1a5846259619243289805d095b70/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/95862a52c7bc1a5846259619243289805d095b70/third_party/WebKit/Source/core/dom/Node.h

Labels: -Update-Monthly Update-Quarterly
Dropping the Update-Label to Quarterly. 

Comment 53 by suzyh@chromium.org, May 15 2017

nainar: To help us when we review the quarterly bugs, can you briefly indicate under what conditions we should consider bringing this back up in priority? I guess linking to your retrospective with its list of future work is appropriate, but you might also have other points to add here.
The retrospective is here: https://groups.google.com/a/chromium.org/forum/?utm_medium=email&utm_source=footer#!topic/style-dev/YCw8pJToO_8. Take a look at the future works section for the way hereon.

This can be considered bringing back up in priority if style sharing gets removed. Or maybe after BlinkOn. 
Status: Fixed (was: Started)
Hi folks, Since there is no active work on this I am going to close this CL. It's huge anyway and any further progress should be tracked in a child CL. Will make sure to cc everyone mentioned here when I do open a new bug with further progress.
Project Member

Comment 56 by bugdroid1@chromium.org, Dec 4 2017

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

commit b71f5b7df345f1a8603b7cf7b59edf48288e7d96
Author: Naina Raisinghani <nainar@chromium.org>
Date: Mon Dec 04 01:01:29 2017

Remove calls to styleForLayoutObject() in LayoutTreeBuilder::style()

This patch stashes all ComputedStyle information about all
descendants when an element will need to undergo Reattach.
It does so by recursing over all ContainerNode, ShadowRoot
and PseudoElement descendants in the case where the node
itself needs to Reattach.

We then use the ComputedStyle stashed on the Node in
LayoutTreeBuilder::style() eliminating the need to call
Element::styleForLayoutObject() in Layout Tree Construction.

Bug:  595137 
Change-Id: I7e6ca2431e602dff80d7d3e84d1bffe1e25d8b2c
Reviewed-on: https://chromium-review.googlesource.com/765097
Commit-Queue: nainar <nainar@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521240}
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/ContainerNode.h
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/Element.h
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/Node.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/NodeComputedStyle.h
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/ShadowRoot.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/dom/ShadowRoot.h
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/html/HTMLObjectElement.h
[modify] https://crrev.com/b71f5b7df345f1a8603b7cf7b59edf48288e7d96/third_party/WebKit/Source/core/html/forms/HTMLOptionElement.cpp

Project Member

Comment 57 by bugdroid1@chromium.org, Dec 8 2017

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

commit be39eca66962913558c32b74c52da41ef91386b0
Author: Naina Raisinghani <nainar@chromium.org>
Date: Fri Dec 08 00:56:40 2017

Remove the resolved_style member from AttachContext struct

Since we are passing the NonAtttachedStyle between the recalcStyle and
rebuildlayoutTree phaase using NonAttachedstyle member on
NodeRenderingData struct,resolved_style member from the
AttachContext struct is now redundant.

This CL removes the redundant variable.

Bug:  595137 
Change-Id: I1c2ef1784b9220ee1e1cf4ddd51a71c6df4893c9
Reviewed-on: https://chromium-review.googlesource.com/809986
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: nainar <nainar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522658}
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/dom/ContainerNode.cpp
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/dom/Element.cpp
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/dom/ElementShadow.cpp
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/dom/Node.h
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/dom/V0InsertionPoint.cpp
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp
[modify] https://crrev.com/be39eca66962913558c32b74c52da41ef91386b0/third_party/WebKit/Source/core/html/forms/HTMLOptionElement.cpp

Sign in to add a comment