Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: Source/core/dom/RenderTreeBuilder.cpp

Issue 134473008: Remove CSS regions support, keeping a bare minimum to support "region-based" multicol. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase master Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/RenderTreeBuilder.h ('k') | Source/core/dom/WebKitNamedFlow.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/RenderTreeBuilder.cpp
diff --git a/Source/core/dom/RenderTreeBuilder.cpp b/Source/core/dom/RenderTreeBuilder.cpp
index 58d5e1bcd625fc842d35b2a090f582c2ca071344..168fcce88be4aa17d155cf9627e9d97dbd9d100f 100644
--- a/Source/core/dom/RenderTreeBuilder.cpp
+++ b/Source/core/dom/RenderTreeBuilder.cpp
@@ -33,9 +33,7 @@
#include "core/dom/FullscreenElementStack.h"
#include "core/dom/Node.h"
#include "core/dom/Text.h"
-#include "core/rendering/FlowThreadController.h"
#include "core/rendering/RenderFullScreen.h"
-#include "core/rendering/RenderNamedFlowThread.h"
#include "core/rendering/RenderObject.h"
#include "core/rendering/RenderText.h"
#include "core/rendering/RenderView.h"
@@ -52,9 +50,6 @@ RenderObject* RenderTreeBuilder::nextRenderer() const
if (element && element->isInTopLayer())
return NodeRenderingTraversal::nextInTopLayer(element);
- if (m_parentFlowRenderer)
- return m_parentFlowRenderer->nextRendererForNode(m_node);
-
// Avoid an O(N^2) walk over the children when reattaching all children of a node.
if (m_renderingParent->needsAttach())
return 0;
@@ -76,13 +71,6 @@ RenderObject* RenderTreeBuilder::parentRenderer() const
return m_node->document().renderView();
}
- // Even if the normal parent has no renderer we still can be flowed into a named flow.
- // FIXME: This is bad, it breaks the assumption that if you have a renderer then
- // NodeRenderingTraversal::parent(this) also has one which likely means lots of bugs
- // with regions.
- if (m_parentFlowRenderer)
- return m_parentFlowRenderer;
-
return m_renderingParent->renderer();
}
@@ -105,72 +93,6 @@ bool RenderTreeBuilder::shouldCreateRenderer() const
return true;
}
-// Check the specific case of elements that are children of regions but are flowed into a flow thread themselves.
-bool RenderTreeBuilder::elementInsideRegionNeedsRenderer()
-{
- if (!RuntimeEnabledFeatures::cssRegionsEnabled())
- return false;
- Element& element = toElement(*m_node);
- RenderObject* parentRenderer = this->parentRenderer();
- if ((parentRenderer && !parentRenderer->canHaveChildren() && parentRenderer->isRenderNamedFlowFragmentContainer())
- || (!parentRenderer && element.parentElement() && element.parentElement()->isInsideRegion())) {
-
- // Children of this element will only be allowed to be flowed into other flow-threads if display is NOT none.
- if (element.rendererIsNeeded(style()))
- element.setIsInsideRegion(true);
-
- return shouldMoveToFlowThread();
- }
-
- return false;
-}
-
-bool RenderTreeBuilder::shouldMoveToFlowThread() const
-{
- Element& element = toElement(*m_node);
- RenderStyle& style = this->style();
-
- if (style.flowThread().isEmpty())
- return false;
-
- if (FullscreenElementStack::isActiveFullScreenElement(&element))
- return false;
-
- if (element.isInShadowTree())
- return false;
-
- // As per http://dev.w3.org/csswg/css3-regions/#flow-into, pseudo-elements such as
- // ::first-line, ::first-letter, ::before or ::after cannot be directly collected
- // into a named flow.
- if (element.isPseudoElement())
- return false;
-
- // Allow only svg root elements to be directly collected by a render flow thread.
- if (element.isSVGElement()) {
- if (!element.hasTagName(SVGNames::svgTag))
- return false;
- if (!element.parentNode())
- return false;
- if (element.parentNode()->isSVGElement())
- return false;
- }
-
- return !element.isRegisteredWithNamedFlow();
-}
-
-void RenderTreeBuilder::moveToFlowThreadIfNeeded()
-{
- if (!RuntimeEnabledFeatures::cssRegionsEnabled())
- return;
-
- if (!shouldMoveToFlowThread())
- return;
-
- FlowThreadController* flowThreadController = m_node->document().renderView()->flowThreadController();
- m_parentFlowRenderer = flowThreadController->ensureRenderFlowThreadWithName(style().flowThread());
- flowThreadController->registerNamedFlowContentNode(m_node, m_parentFlowRenderer);
-}
-
RenderStyle& RenderTreeBuilder::style() const
{
if (!m_style)
@@ -188,11 +110,9 @@ void RenderTreeBuilder::createRendererForElementIfNeeded()
Element* element = toElement(m_node);
- if (!shouldCreateRenderer() && !elementInsideRegionNeedsRenderer())
+ if (!shouldCreateRenderer())
return;
- moveToFlowThreadIfNeeded();
-
RenderStyle& style = this->style();
if (!element->rendererIsNeeded(style))
« no previous file with comments | « Source/core/dom/RenderTreeBuilder.h ('k') | Source/core/dom/WebKitNamedFlow.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698