Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intruduce concept of render tree rebuild root #20846

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

anttijk
Copy link
Contributor

@anttijk anttijk commented Nov 23, 2023

c7578c8

Intruduce concept of render tree rebuild root
https://bugs.webkit.org/show_bug.cgi?id=265284
rdar://118744369

Reviewed by Alan Baradlay.

Add mechanism to rebuild render subtree starting from an ancestor of the changed element.

We can simplify render tree mutations if some complex cases are handled by tearing
down a larger structure with all the associated anonymous boxes and rebuilding them.

Use the mechanism for <ruby> subtrees when style-based ruby is enabled. This gets tested by

fast/ruby/rubyDOM-insert-rt-block-1.html
fast/ruby/rubyDOM-insert-rt-block-2.html
fast/ruby/rubyDOM-insert-rt-block-3.html
fast/ruby/rubyDOM-remove-rt-block-1.html
fast/ruby/rubyDOM-remove-rt-block-2.html
fast/ruby/rubyDOM-remove-rt-block-3.html

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateRenderTree):
* Source/WebCore/dom/Document.h:
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::isRebuildRootForChildren):

Test if a given renderer is rebuild root for its children. For now this only tests for ruby.

* Source/WebCore/rendering/updating/RenderTreeBuilder.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::findRenderingAncestor):
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::commit):
(WebCore::RenderTreeUpdater::updateRebuildRoots):

In the beginning of a commit check if any of the rebuild roots need a wider rebuild.
Add all the new elements that will get rebuild to the style update.

* Source/WebCore/rendering/updating/RenderTreeUpdater.h:
* Source/WebCore/style/StyleUpdate.cpp:
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::addPossibleRebuildRoot):

Keep track of the rebuild roots.

* Source/WebCore/style/StyleUpdate.h:
(WebCore::Style::Update::rebuildRoots const):

Canonical link: https://commits.webkit.org/271082@main

870d8a9

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ§ͺ bindings βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ§ͺ api-wpe
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ›  gtk
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@anttijk anttijk self-assigned this Nov 23, 2023
@anttijk anttijk added the Layout and Rendering For bugs with layout and rendering of Web pages. label Nov 23, 2023
@anttijk anttijk added the merge-queue Applied to send a pull request to merge-queue label Nov 23, 2023
https://bugs.webkit.org/show_bug.cgi?id=265284
rdar://118744369

Reviewed by Alan Baradlay.

Add mechanism to rebuild render subtree starting from an ancestor of the changed element.

We can simplify render tree mutations if some complex cases are handled by tearing
down a larger structure with all the associated anonymous boxes and rebuilding them.

Use the mechanism for <ruby> subtrees when style-based ruby is enabled. This gets tested by

fast/ruby/rubyDOM-insert-rt-block-1.html
fast/ruby/rubyDOM-insert-rt-block-2.html
fast/ruby/rubyDOM-insert-rt-block-3.html
fast/ruby/rubyDOM-remove-rt-block-1.html
fast/ruby/rubyDOM-remove-rt-block-2.html
fast/ruby/rubyDOM-remove-rt-block-3.html

* Source/WebCore/dom/Document.cpp:
(WebCore::Document::updateRenderTree):
* Source/WebCore/dom/Document.h:
* Source/WebCore/rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::isRebuildRootForChildren):

Test if a given renderer is rebuild root for its children. For now this only tests for ruby.

* Source/WebCore/rendering/updating/RenderTreeBuilder.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::findRenderingAncestor):
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::commit):
(WebCore::RenderTreeUpdater::updateRebuildRoots):

In the beginning of a commit check if any of the rebuild roots need a wider rebuild.
Add all the new elements that will get rebuild to the style update.

* Source/WebCore/rendering/updating/RenderTreeUpdater.h:
* Source/WebCore/style/StyleUpdate.cpp:
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::addPossibleRebuildRoot):

Keep track of the rebuild roots.

* Source/WebCore/style/StyleUpdate.h:
(WebCore::Style::Update::rebuildRoots const):

Canonical link: https://commits.webkit.org/271082@main
@webkit-commit-queue
Copy link
Collaborator

Committed 271082@main (c7578c8): https://commits.webkit.org/271082@main

Reviewed commits have been landed. Closing PR #20846 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit c7578c8 into WebKit:main Nov 23, 2023
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Nov 23, 2023
@anttijk anttijk deleted the rebuild-root branch November 23, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layout and Rendering For bugs with layout and rendering of Web pages.
Projects
None yet
4 participants