Title: [120848] branches/chromium/1180
- Revision
- 120848
- Author
- [email protected]
- Date
- 2012-06-20 12:25:27 -0700 (Wed, 20 Jun 2012)
Log Message
Merge 120638 - REGRESSION(r118414): some pages on concursolutions.com doesn't show up
https://bugs.webkit.org/show_bug.cgi?id=89399
http://crbug.com/132097
Reviewed by Adam Barth.
Source/WebCore:
The bug was caused by insertAdjacentHTML's not passing context element to createFragmentForInnerOuterHTML.
Test: fast/html/adjacent-html-context-element.html
* html/HTMLElement.cpp:
(WebCore::HTMLElement::insertAdjacentHTML):
LayoutTests:
Add a regression test.
* fast/html/adjacent-html-context-element-expected.txt: Added.
* fast/html/adjacent-html-context-element.html: Added.
Review URL: https://chromiumcodereview.appspot.com/10577039
Modified Paths
Added Paths
Diff
Copied: branches/chromium/1180/LayoutTests/fast/html/adjacent-html-context-element-expected.txt (from rev 120638, trunk/LayoutTests/fast/html/adjacent-html-context-element-expected.txt) (0 => 120848)
--- branches/chromium/1180/LayoutTests/fast/html/adjacent-html-context-element-expected.txt (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/html/adjacent-html-context-element-expected.txt 2012-06-20 19:25:27 UTC (rev 120848)
@@ -0,0 +1,3 @@
+This tests inserting a td element "beforeBegin" of another td element using insertAdjacentHTML. If the context element was not properly adjusted, then td will be stripped by the parser.
+
+PASS
Copied: branches/chromium/1180/LayoutTests/fast/html/adjacent-html-context-element.html (from rev 120638, trunk/LayoutTests/fast/html/adjacent-html-context-element.html) (0 => 120848)
--- branches/chromium/1180/LayoutTests/fast/html/adjacent-html-context-element.html (rev 0)
+++ branches/chromium/1180/LayoutTests/fast/html/adjacent-html-context-element.html 2012-06-20 19:25:27 UTC (rev 120848)
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests inserting a td element "beforeBegin" of another td element using insertAdjacentHTML.
+If the context element was not properly adjusted, then td will be stripped by the parser.</p>
+<table><tr><td></td></tr></table>
+<script>
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+var td = document.querySelector('td');
+td.insertAdjacentHTML('beforeBegin', '<td></td>');
+
+document.write(document.getElementsByTagName('td').length == 2 ? 'PASS' : 'FAIL');
+
+</script>
+</body>
+</html>
Modified: branches/chromium/1180/Source/WebCore/html/HTMLElement.cpp (120847 => 120848)
--- branches/chromium/1180/Source/WebCore/html/HTMLElement.cpp 2012-06-20 19:17:43 UTC (rev 120847)
+++ branches/chromium/1180/Source/WebCore/html/HTMLElement.cpp 2012-06-20 19:25:27 UTC (rev 120848)
@@ -578,7 +578,7 @@
Element* contextElement = contextElementForInsertion(where, this, ec);
if (!contextElement)
return;
- RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, this, AllowScriptingContent, ec);
+ RefPtr<DocumentFragment> fragment = createFragmentForInnerOuterHTML(markup, contextElement, AllowScriptingContent, ec);
if (!fragment)
return;
insertAdjacent(where, fragment.get(), ec);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes