Commit b06e5712 authored by dglazkov@chromium.org's avatar dglazkov@chromium.org

2011-01-21 Dimitri Glazkov <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        REGRESSION(r73618): Clicking on a search input causes a crash.
        https://bugs.webkit.org/show_bug.cgi?id=52905

        * fast/dom/search-shadow-host-crash-expected.txt: Added.
        * fast/dom/search-shadow-host-crash.html: Added.
2011-01-21  Dimitri Glazkov  <dglazkov@chromium.org>

        Reviewed by Darin Adler.

        REGRESSION(r73618): Clicking on a search input causes a crash.
        https://bugs.webkit.org/show_bug.cgi?id=52905

        The problem is caused by TextControlInnerElement being used both as
        shadow root and an element in a shadow subtree. The code assumed it is
        only used as a shadow root.

        Since this code is all just workaround for in-progress conversion to
        new shadow DOM, I am just adding a check. This code will disappear
        completely once bug 52788 is fixed.

        Test: fast/dom/search-shadow-host-crash.html

        * dom/Node.cpp:
        (WebCore::Node::setShadowHost): Added an ASSERT for early detection
            of attempting to stomp on the parentNode.
        * rendering/TextControlInnerElements.cpp:
        (WebCore::TextControlInnerElement::detach): Added a check to only
            clear shadow host if we have one.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4bfecc51
2011-01-21 Dimitri Glazkov <dglazkov@chromium.org>
Reviewed by Darin Adler.
REGRESSION(r73618): Clicking on a search input causes a crash.
https://bugs.webkit.org/show_bug.cgi?id=52905
* fast/dom/search-shadow-host-crash-expected.txt: Added.
* fast/dom/search-shadow-host-crash.html: Added.
2011-01-21 Dimitri Glazkov <dglazkov@chromium.org>
Updated slider expectations after r76147.
......
Click on the search box. This test passes if does not crash.
<html>
<head>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText();
function clickOn(element)
{
if (!window.eventSender)
return;
var x = element.offsetLeft + element.offsetWidth / 2;
var y = element.offsetTop + element.offsetHeight / 2;
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
}
function runTest()
{
clickOn(document.getElementsByTagName('input')[0]);
}
</script>
</head>
<body onload="runTest()">
<p>Click on the search box. This test passes if does not crash.</p>
<input type="search" onclick="this.style.display = 'none';">
</body>
</html>
2011-01-21 Dimitri Glazkov <dglazkov@chromium.org>
Reviewed by Darin Adler.
REGRESSION(r73618): Clicking on a search input causes a crash.
https://bugs.webkit.org/show_bug.cgi?id=52905
The problem is caused by TextControlInnerElement being used both as
shadow root and an element in a shadow subtree. The code assumed it is
only used as a shadow root.
Since this code is all just workaround for in-progress conversion to
new shadow DOM, I am just adding a check. This code will disappear
completely once bug 52788 is fixed.
Test: fast/dom/search-shadow-host-crash.html
* dom/Node.cpp:
(WebCore::Node::setShadowHost): Added an ASSERT for early detection
of attempting to stomp on the parentNode.
* rendering/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::detach): Added a check to only
clear shadow host if we have one.
2011-01-21 Adam Roben <aroben@apple.com>
Replace some "sync compositing state" terminology with "flush pending GraphicsLayer changes"
......@@ -492,6 +492,7 @@ Element* Node::shadowHost() const
void Node::setShadowHost(Element* host)
{
ASSERT(!parentNode());
if (host)
setFlag(IsShadowRootFlag);
else
......
......@@ -119,7 +119,8 @@ void TextControlInnerElement::detach()
{
HTMLDivElement::detach();
// FIXME: Remove once shadow DOM uses Element::setShadowRoot().
setShadowHost(0);
if (shadowHost())
setShadowHost(0);
}
// ----------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment