because if there are imbricated flow threads, it might end using the wrong one.
[CSSRegions] Assert failure in RenderView::computeRectForRepaint
https://bugs.webkit.org/show_bug.cgi?id=77430
Patch by Raul Hudea <rhudea@adobe.com> on 2012-02-02
Reviewed by David Hyatt.
Source/WebCore:
Test: fast/regions/imbricated-flow-threads-crash.html
* rendering/RenderFlowThread.cpp:
(CurrentRenderFlowThreadDisabler):
(WebCore::CurrentRenderFlowThreadDisabler::CurrentRenderFlowThreadDisabler):
(WebCore::CurrentRenderFlowThreadDisabler::~CurrentRenderFlowThreadDisabler):
(WebCore):
(WebCore::RenderFlowThread::repaintRectangleInRegions):
LayoutTests:
* fast/regions/imbricated-flow-threads-crash-expected.txt: Added.
* fast/regions/imbricated-flow-threads-crash.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106544
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-02-02 Raul Hudea <rhudea@adobe.com>
+
+ Regions should ignore the saved currentRenderFlowThread during repainting
+ because if there are imbricated flow threads, it might end using the wrong one.
+
+ [CSSRegions] Assert failure in RenderView::computeRectForRepaint
+ https://bugs.webkit.org/show_bug.cgi?id=77430
+
+ Reviewed by David Hyatt.
+
+ * fast/regions/imbricated-flow-threads-crash-expected.txt: Added.
+ * fast/regions/imbricated-flow-threads-crash.html: Added.
+
2012-02-02 Kentaro Hara <haraken@chromium.org>
The third argument of addEventListener/removeEventListener of PeerConnection should be optional
--- /dev/null
+Text should be rendered in the green region. The test passes if there is no crash
+
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
--- /dev/null
+<html>
+<head>
+ <style type="text/css">
+ article{
+ -webkit-flow-into: article;
+ }
+ .region{
+ -webkit-flow-from: article;
+ }
+ #layout{
+ -webkit-flow-into: pages;
+ }
+ .page{
+ -webkit-flow-from: pages;
+ }
+ #layout .region{
+ width: 50%;
+ background-color: lightgreen;
+ height: 100%;
+ }
+ #layout,
+ #paginator{
+ width: 200px;
+ height: 500px;
+ }
+ #paginator .page{
+ width: 100%;
+ height: 100%;
+ background: #ddd;
+ }
+ .description{
+ color: blue;
+ }
+ </style>
+</head>
+<body>
+ <div><p class="description">Text should be rendered in the green region. The test passes if there is no crash</p></div>
+
+ <div id="layout">
+ <div id="r1" class="region"></div>
+ </div>
+ <div id="paginator">
+ <div class="page"></div>
+ </div>
+ <article>
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+ </article>
+ <script>
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+ function addNewRegion() {
+ var oldRegion = document.getElementById("r1");
+ var newRegion = oldRegion.cloneNode(true);
+ oldRegion.parentNode.appendChild(newRegion);
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+ function test() {
+ setTimeout(addNewRegion, 0);
+ }
+
+ window.addEventListener("load", test, false);
+ </script>
+</body>
+</html>
+2012-02-02 Raul Hudea <rhudea@adobe.com>
+
+ Regions should ignore the saved currentRenderFlowThread during repainting
+ because if there are imbricated flow threads, it might end using the wrong one.
+
+ [CSSRegions] Assert failure in RenderView::computeRectForRepaint
+ https://bugs.webkit.org/show_bug.cgi?id=77430
+
+ Reviewed by David Hyatt.
+
+ Test: fast/regions/imbricated-flow-threads-crash.html
+
+ * rendering/RenderFlowThread.cpp:
+ (CurrentRenderFlowThreadDisabler):
+ (WebCore::CurrentRenderFlowThreadDisabler::CurrentRenderFlowThreadDisabler):
+ (WebCore::CurrentRenderFlowThreadDisabler::~CurrentRenderFlowThreadDisabler):
+ (WebCore):
+ (WebCore::RenderFlowThread::repaintRectangleInRegions):
+
2012-02-02 Kinuko Yasuda <kinuko@chromium.org>
Cleanup: Move chrome-specific filesystem type handling code (for FileSystem API) under chromium directory (re-landing r105395)
RenderFlowThread* m_renderFlowThread;
};
+class CurrentRenderFlowThreadDisabler {
+ WTF_MAKE_NONCOPYABLE(CurrentRenderFlowThreadDisabler);
+public:
+ CurrentRenderFlowThreadDisabler(RenderView* view)
+ : m_view(view)
+ , m_renderFlowThread(0)
+ {
+ m_renderFlowThread = m_view->currentRenderFlowThread();
+ if (m_renderFlowThread)
+ view->setCurrentRenderFlowThread(0);
+ }
+ ~CurrentRenderFlowThreadDisabler()
+ {
+ if (m_renderFlowThread)
+ m_view->setCurrentRenderFlowThread(m_renderFlowThread);
+ }
+private:
+ RenderView* m_view;
+ RenderFlowThread* m_renderFlowThread;
+};
+
void RenderFlowThread::layout()
{
bool regionsChanged = m_regionsInvalidated && everHadLayout();
// Now switch to the region's writing mode coordinate space and let it repaint itself.
region->flipForWritingMode(clippedRect);
LayoutStateDisabler layoutStateDisabler(view()); // We can't use layout state to repaint, since the region is somewhere else.
+
+ // Can't use currentFlowThread as it possible to have imbricated flow threads and the wrong one could be used,
+ // so, we let each region figure out the proper enclosing flow thread
+ CurrentRenderFlowThreadDisabler disabler(view());
region->repaintRectangle(clippedRect, immediate);
}
}