Title: [289345] branches/safari-613-branch
- Revision
- 289345
- Author
- [email protected]
- Date
- 2022-02-07 18:57:55 -0800 (Mon, 07 Feb 2022)
Log Message
Cherry-pick r289060. rdar://problem/86337125
null ptr deref in RenderTreeBuilder::Block::attachIgnoringContinuation
https://bugs.webkit.org/show_bug.cgi?id=234170
Patch by Frédéric Wang <[email protected]> on 2022-02-03
Reviewed by Antti Koivisto.
Source/WebCore:
When an element with "display: contents" is put into the top layer, its computed style for
the display property becomes "block" [1]. However, RenderTreeUpdater::updateElementRenderer
does not manage well this transition. In particular, a null ptr deref happens for some
special configuration involving a <dialog style="display: contents">. To work around that
issue, always force tearing down renderers when updating an element in the top layer.
[1] https://fullscreen.spec.whatwg.org/#new-stacking-layer
Test: fast/layers/top-layer-display-contents-crash.html
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer): Always force tearing down renderers
for top layer element.
LayoutTests:
Add regression test.
* fast/css/top-layer-display-contents-crash-expected.txt: Added.
* fast/css/top-layer-display-contents-crash.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Added Paths
Diff
Modified: branches/safari-613-branch/LayoutTests/ChangeLog (289344 => 289345)
--- branches/safari-613-branch/LayoutTests/ChangeLog 2022-02-08 02:57:51 UTC (rev 289344)
+++ branches/safari-613-branch/LayoutTests/ChangeLog 2022-02-08 02:57:55 UTC (rev 289345)
@@ -1,5 +1,52 @@
2022-02-07 Russell Epstein <[email protected]>
+ Cherry-pick r289060. rdar://problem/86337125
+
+ null ptr deref in RenderTreeBuilder::Block::attachIgnoringContinuation
+ https://bugs.webkit.org/show_bug.cgi?id=234170
+
+ Patch by Frédéric Wang <[email protected]> on 2022-02-03
+ Reviewed by Antti Koivisto.
+
+ Source/WebCore:
+
+ When an element with "display: contents" is put into the top layer, its computed style for
+ the display property becomes "block" [1]. However, RenderTreeUpdater::updateElementRenderer
+ does not manage well this transition. In particular, a null ptr deref happens for some
+ special configuration involving a <dialog style="display: contents">. To work around that
+ issue, always force tearing down renderers when updating an element in the top layer.
+
+ [1] https://fullscreen.spec.whatwg.org/#new-stacking-layer
+
+ Test: fast/layers/top-layer-display-contents-crash.html
+
+ * rendering/updating/RenderTreeUpdater.cpp:
+ (WebCore::RenderTreeUpdater::updateElementRenderer): Always force tearing down renderers
+ for top layer element.
+
+ LayoutTests:
+
+ Add regression test.
+
+ * fast/css/top-layer-display-contents-crash-expected.txt: Added.
+ * fast/css/top-layer-display-contents-crash.html: Added.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-03 Frédéric Wang <[email protected]>
+
+ null ptr deref in RenderTreeBuilder::Block::attachIgnoringContinuation
+ https://bugs.webkit.org/show_bug.cgi?id=234170
+
+ Reviewed by Antti Koivisto.
+
+ Add regression test.
+
+ * fast/css/top-layer-display-contents-crash-expected.txt: Added.
+ * fast/css/top-layer-display-contents-crash.html: Added.
+
+2022-02-07 Russell Epstein <[email protected]>
+
Cherry-pick r289021. rdar://problem/88599774
CSP: Fix matching wildcard hosts
Added: branches/safari-613-branch/LayoutTests/fast/css/top-layer-display-contents-crash-expected.txt (0 => 289345)
--- branches/safari-613-branch/LayoutTests/fast/css/top-layer-display-contents-crash-expected.txt (rev 0)
+++ branches/safari-613-branch/LayoutTests/fast/css/top-layer-display-contents-crash-expected.txt 2022-02-08 02:57:55 UTC (rev 289345)
@@ -0,0 +1,3 @@
+This test PASS if it does not CRASH.
+
+TEXT_CHILD
Added: branches/safari-613-branch/LayoutTests/fast/css/top-layer-display-contents-crash.html (0 => 289345)
--- branches/safari-613-branch/LayoutTests/fast/css/top-layer-display-contents-crash.html (rev 0)
+++ branches/safari-613-branch/LayoutTests/fast/css/top-layer-display-contents-crash.html 2022-02-08 02:57:55 UTC (rev 289345)
@@ -0,0 +1,18 @@
+<script>
+ if (testRunner) {
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
+ }
+ _onload_ = () => {
+ var frame = document.createElement("frame");
+ document.body.appendChild(frame);
+ iframe.appendChild(frame);
+ requestAnimationFrame(() => {
+ dialog.showModal();
+ if (testRunner)
+ testRunner.notifyDone();
+ });
+ };
+</script>
+<p>This test PASS if it does not CRASH.</p>
+<dialog id="dialog" style="display: contents"><iframe id="iframe"><frame/></iframe>TEXT_CHILD</dialog>
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (289344 => 289345)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-02-08 02:57:51 UTC (rev 289344)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-02-08 02:57:55 UTC (rev 289345)
@@ -1,5 +1,61 @@
2022-02-07 Russell Epstein <[email protected]>
+ Cherry-pick r289060. rdar://problem/86337125
+
+ null ptr deref in RenderTreeBuilder::Block::attachIgnoringContinuation
+ https://bugs.webkit.org/show_bug.cgi?id=234170
+
+ Patch by Frédéric Wang <[email protected]> on 2022-02-03
+ Reviewed by Antti Koivisto.
+
+ Source/WebCore:
+
+ When an element with "display: contents" is put into the top layer, its computed style for
+ the display property becomes "block" [1]. However, RenderTreeUpdater::updateElementRenderer
+ does not manage well this transition. In particular, a null ptr deref happens for some
+ special configuration involving a <dialog style="display: contents">. To work around that
+ issue, always force tearing down renderers when updating an element in the top layer.
+
+ [1] https://fullscreen.spec.whatwg.org/#new-stacking-layer
+
+ Test: fast/layers/top-layer-display-contents-crash.html
+
+ * rendering/updating/RenderTreeUpdater.cpp:
+ (WebCore::RenderTreeUpdater::updateElementRenderer): Always force tearing down renderers
+ for top layer element.
+
+ LayoutTests:
+
+ Add regression test.
+
+ * fast/css/top-layer-display-contents-crash-expected.txt: Added.
+ * fast/css/top-layer-display-contents-crash.html: Added.
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2022-02-03 Frédéric Wang <[email protected]>
+
+ null ptr deref in RenderTreeBuilder::Block::attachIgnoringContinuation
+ https://bugs.webkit.org/show_bug.cgi?id=234170
+
+ Reviewed by Antti Koivisto.
+
+ When an element with "display: contents" is put into the top layer, its computed style for
+ the display property becomes "block" [1]. However, RenderTreeUpdater::updateElementRenderer
+ does not manage well this transition. In particular, a null ptr deref happens for some
+ special configuration involving a <dialog style="display: contents">. To work around that
+ issue, always force tearing down renderers when updating an element in the top layer.
+
+ [1] https://fullscreen.spec.whatwg.org/#new-stacking-layer
+
+ Test: fast/layers/top-layer-display-contents-crash.html
+
+ * rendering/updating/RenderTreeUpdater.cpp:
+ (WebCore::RenderTreeUpdater::updateElementRenderer): Always force tearing down renderers
+ for top layer element.
+
+2022-02-07 Russell Epstein <[email protected]>
+
Cherry-pick r289021. rdar://problem/88599774
CSP: Fix matching wildcard hosts
Modified: branches/safari-613-branch/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (289344 => 289345)
--- branches/safari-613-branch/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp 2022-02-08 02:57:51 UTC (rev 289344)
+++ branches/safari-613-branch/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp 2022-02-08 02:57:55 UTC (rev 289345)
@@ -317,7 +317,7 @@
elementUpdateStyle->addCachedPseudoStyle(RenderStyle::clonePtr(*it.value.style));
}
- bool shouldTearDownRenderers = elementUpdate.change == Style::Change::Renderer && (element.renderer() || element.hasDisplayContents());
+ bool shouldTearDownRenderers = elementUpdate.change == Style::Change::Renderer && (element.renderer() || element.hasDisplayContents() || element.isInTopLayer());
if (shouldTearDownRenderers) {
if (!element.renderer()) {
// We may be tearing down a descendant renderer cached in renderTreePosition.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes