Title: [139999] trunk
Revision
139999
Author
shin...@chromium.org
Date
2013-01-17 10:52:57 -0800 (Thu, 17 Jan 2013)

Log Message

[Mac] svg/custom/text-use-click-crash.xhtml added by r139029 hits assertion in enclosingTextFormControl
https://bugs.webkit.org/show_bug.cgi?id=106361

Reviewed by Darin Adler.

Source/WebCore:

When ASSERT hit in enclosingTextFormControl(Position), position.anchorNode() was /use/shadow-root/text,
and position.anchorType() was PositionIsBeforeAnchor. In this case, position.containerNode() should be
ShadowRoot if SHADOW_DOM flag is enabled. However, SHADOW_DOM flag is not enabled in mac port,
position.containerNode() returns 0. This hits ASSERT.

We have two options to solve this problem. (1) is to allow Position to have ShadowRoot as a container node,
but this will affect a lot of code. (2) is to loosen ASSERT condition.

I've chosen (2) option in this patch.

Test: svg/custom/text-use-click-crash.xhtml should cover this.

* html/HTMLTextFormControlElement.cpp:
(WebCore::enclosingTextFormControl):

LayoutTests:

Removed crash test expectation.

* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139998 => 139999)


--- trunk/LayoutTests/ChangeLog	2013-01-17 18:50:59 UTC (rev 139998)
+++ trunk/LayoutTests/ChangeLog	2013-01-17 18:52:57 UTC (rev 139999)
@@ -1,3 +1,14 @@
+2013-01-17  Shinya Kawanaka  <shin...@chromium.org>
+
+        [Mac] svg/custom/text-use-click-crash.xhtml added by r139029 hits assertion in enclosingTextFormControl
+        https://bugs.webkit.org/show_bug.cgi?id=106361
+
+        Reviewed by Darin Adler.
+
+        Removed crash test expectation.
+
+        * platform/mac/TestExpectations:
+
 2013-01-17  Eugene Klyuchnikov  <eus...@chromium.org>
 
         Web Inspector: Profiler: split "getProfile" to "getCPUProfile" and "loadHeapSnapshot"

Modified: trunk/LayoutTests/platform/mac/TestExpectations (139998 => 139999)


--- trunk/LayoutTests/platform/mac/TestExpectations	2013-01-17 18:50:59 UTC (rev 139998)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2013-01-17 18:52:57 UTC (rev 139999)
@@ -1269,8 +1269,6 @@
 
 webkit.org/b/106185 fast/frames/flattening/iframe-flattening-fixed-height.html [ Pass Failure ]
 
-webkit.org/b/106361 [ Debug ] svg/custom/text-use-click-crash.xhtml [ Crash ]
-
 webkit.org/b/106318 fast/events/drag-and-drop-autoscroll.html [ Failure ]
 
 webkit.org/b/106412 [ Debug ] editing/style/justify-without-enclosing-block.xhtml [ Crash ]

Modified: trunk/Source/WebCore/ChangeLog (139998 => 139999)


--- trunk/Source/WebCore/ChangeLog	2013-01-17 18:50:59 UTC (rev 139998)
+++ trunk/Source/WebCore/ChangeLog	2013-01-17 18:52:57 UTC (rev 139999)
@@ -1,3 +1,25 @@
+2013-01-17  Shinya Kawanaka  <shin...@chromium.org>
+
+        [Mac] svg/custom/text-use-click-crash.xhtml added by r139029 hits assertion in enclosingTextFormControl
+        https://bugs.webkit.org/show_bug.cgi?id=106361
+
+        Reviewed by Darin Adler.
+
+        When ASSERT hit in enclosingTextFormControl(Position), position.anchorNode() was /use/shadow-root/text,
+        and position.anchorType() was PositionIsBeforeAnchor. In this case, position.containerNode() should be
+        ShadowRoot if SHADOW_DOM flag is enabled. However, SHADOW_DOM flag is not enabled in mac port,
+        position.containerNode() returns 0. This hits ASSERT.
+
+        We have two options to solve this problem. (1) is to allow Position to have ShadowRoot as a container node,
+        but this will affect a lot of code. (2) is to loosen ASSERT condition.
+
+        I've chosen (2) option in this patch.
+
+        Test: svg/custom/text-use-click-crash.xhtml should cover this.
+
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::enclosingTextFormControl):
+
 2013-01-17  Eugene Klyuchnikov  <eus...@chromium.org>
 
         Web Inspector: Profiler: split "getProfile" to "getCPUProfile" and "loadHeapSnapshot"

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (139998 => 139999)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2013-01-17 18:50:59 UTC (rev 139998)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2013-01-17 18:52:57 UTC (rev 139999)
@@ -639,7 +639,9 @@
 HTMLTextFormControlElement* enclosingTextFormControl(const Position& position)
 {
     ASSERT(position.isNull() || position.anchorType() == Position::PositionIsOffsetInAnchor
-        || position.containerNode() || !position.anchorNode()->shadowHost());
+        || position.containerNode() || !position.anchorNode()->shadowHost()
+        || (position.anchorNode()->parentNode() && position.anchorNode()->parentNode()->isShadowRoot()));
+        
     Node* container = position.containerNode();
     if (!container)
         return 0;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to