Diff
Modified: branches/chromium/963/LayoutTests/fast/regions/resources/region-style.css (105358 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/resources/region-style.css 2012-01-19 00:56:46 UTC (rev 105358)
+++ branches/chromium/963/LayoutTests/fast/regions/resources/region-style.css 2012-01-19 00:57:16 UTC (rev 105359)
@@ -1,3 +1,9 @@
+.redBox {
+ width: 50px;
+ height: 50px;
+ background-color: red;
+}
+
.greenBox {
width: 50px;
height: 50px;
Copied: branches/chromium/963/LayoutTests/fast/regions/svg-doc-fragment-not-collected-expected.html (from rev 104328, trunk/LayoutTests/fast/regions/svg-doc-fragment-not-collected-expected.html) (0 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/svg-doc-fragment-not-collected-expected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/regions/svg-doc-fragment-not-collected-expected.html 2012-01-19 00:57:16 UTC (rev 105359)
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+ <body>
+ <p>Bug <a href="" Collect SVG nodes in render flow thread</p>
+ <p>It should NOT be possible to collect a "svg" node that is not root into a render flow thread.</p>
+ <p>On success, you should see a green box below.</p>
+ <div style="width:50px; height:50px; background-color: green;"></div>
+ </body>
+</html>
Copied: branches/chromium/963/LayoutTests/fast/regions/svg-doc-fragment-not-collected.html (from rev 104328, trunk/LayoutTests/fast/regions/svg-doc-fragment-not-collected.html) (0 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/svg-doc-fragment-not-collected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/regions/svg-doc-fragment-not-collected.html 2012-01-19 00:57:16 UTC (rev 105359)
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+ <head>
+ <link rel="stylesheet" href=""
+ </head>
+ <body>
+ <p>Bug <a href="" Collect SVG nodes in render flow thread</p>
+ <p>It should NOT be possible to collect a "svg" node that is not root into a render flow thread.</p>
+ <p>On success, you should see a green box below.</p>
+ <div class="redBox"></div>
+ <svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -50px; height: 100px;">
+ <svg style="-webkit-flow-into:thread">
+ <rect width="50" height="50" fill="green"></rect>
+ </svg>
+ </svg>
+ </body>
+</html>
Copied: branches/chromium/963/LayoutTests/fast/regions/svg-element-not-collected-expected.html (from rev 104328, trunk/LayoutTests/fast/regions/svg-element-not-collected-expected.html) (0 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/svg-element-not-collected-expected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/regions/svg-element-not-collected-expected.html 2012-01-19 00:57:16 UTC (rev 105359)
@@ -0,0 +1,12 @@
+<!doctype html>
+<html>
+ <head>
+ <link rel="stylesheet" href=""
+ </head>
+ <body>
+ <p>Bug <a href="" Collect SVG nodes in render flow thread</p>
+ <p>It should NOT be possible to collect a svg element (other than svg root element) into a render flow thread.</p>
+ <p>On success, you should see a green box below.</p>
+ <div style="width:50px; height:50px; background-color: green;"></div>
+ </body>
+</html>
Copied: branches/chromium/963/LayoutTests/fast/regions/svg-element-not-collected.html (from rev 104328, trunk/LayoutTests/fast/regions/svg-element-not-collected.html) (0 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/svg-element-not-collected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/regions/svg-element-not-collected.html 2012-01-19 00:57:16 UTC (rev 105359)
@@ -0,0 +1,17 @@
+<!doctype html>
+<html>
+ <head>
+ <link rel="stylesheet" href=""
+ </head>
+ <body>
+ <p>Bug <a href="" Collect SVG nodes in render flow thread</p>
+ <p>It should NOT be possible to collect a svg element (other than svg root element) into a render flow thread.</p>
+ <p>On success, you should see a green box below.</p>
+ <div class="redBox"></div>
+ <svg xmlns="http://www.w3.org/2000/svg" style="position: relative; top: -50px; height:100px;">
+ <g style="-webkit-flow-into:thread">
+ <rect width="50" height="50" fill="green"></rect>
+ </g>
+ </svg>
+ </body>
+</html>
Copied: branches/chromium/963/LayoutTests/fast/regions/svg-root-element-collected-expected.txt (from rev 104328, trunk/LayoutTests/fast/regions/svg-root-element-collected-expected.txt) (0 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/svg-root-element-collected-expected.txt (rev 0)
+++ branches/chromium/963/LayoutTests/fast/regions/svg-root-element-collected-expected.txt 2012-01-19 00:57:16 UTC (rev 105359)
@@ -0,0 +1,8 @@
+Bug 73735: Collect SVG nodes in render flow thread
+
+It should be possible to collect a root "svg" node into a render flow thread.
+
+On success, you should see PASS below.
+
+SVG text
+PASS
Copied: branches/chromium/963/LayoutTests/fast/regions/svg-root-element-collected.html (from rev 104328, trunk/LayoutTests/fast/regions/svg-root-element-collected.html) (0 => 105359)
--- branches/chromium/963/LayoutTests/fast/regions/svg-root-element-collected.html (rev 0)
+++ branches/chromium/963/LayoutTests/fast/regions/svg-root-element-collected.html 2012-01-19 00:57:16 UTC (rev 105359)
@@ -0,0 +1,29 @@
+<!doctype html>
+<html>
+ <head>
+ <style>
+ #region {
+ -webkit-flow-from: thread;
+ width: 100px;
+ height: 100px;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Bug <a href="" Collect SVG nodes in render flow thread</p>
+ <p>It should be possible to collect a root "svg" node into a render flow thread.</p>
+ <p>On success, you should see PASS below.</p>
+ <svg xmlns="http://www.w3.org/2000/svg" style="-webkit-flow-into:thread">
+ <text x="0" y="15">SVG text</text>
+ </svg>
+ <div id="region"></div>
+ <script>
+ if (window.layoutTestController)
+ window.layoutTestController.dumpAsText();
+ var regionElement = document.getElementById("region");
+ var pass = regionElement.innerText.length != 0;
+ regionElement.style.display = "none";
+ document.write("<p>" + pass ? "PASS" : "FAIL" + "</p>");
+ </script>
+ </body>
+</html>
Modified: branches/chromium/963/Source/WebCore/dom/NodeRenderingContext.cpp (105358 => 105359)
--- branches/chromium/963/Source/WebCore/dom/NodeRenderingContext.cpp 2012-01-19 00:56:46 UTC (rev 105358)
+++ branches/chromium/963/Source/WebCore/dom/NodeRenderingContext.cpp 2012-01-19 00:57:16 UTC (rev 105359)
@@ -36,6 +36,10 @@
#include "ShadowInclusionSelector.h"
#include "ShadowRoot.h"
+#if ENABLE(SVG)
+#include "SVGNames.h"
+#endif
+
namespace WebCore {
NodeRenderingContext::NodeRenderingContext(Node* node)
@@ -277,6 +281,13 @@
if (!m_node->isElementNode() || !m_style || m_style->flowThread().isEmpty())
return;
+#if ENABLE(SVG)
+ // Allow only svg root elements to be directly collected by a render flow thread.
+ if (m_node->isSVGElement()
+ && (!(m_node->hasTagName(SVGNames::svgTag) && m_node->parentNode() && !m_node->parentNode()->isSVGElement())))
+ return;
+#endif
+
m_flowThread = m_style->flowThread();
ASSERT(m_node->document()->renderView());
m_parentFlowRenderer = m_node->document()->renderView()->renderFlowThreadWithName(m_flowThread);