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

Unified Diff: sky/engine/core/rendering/RenderObject.cpp

Issue 735193002: Remove lots of things from RenderObject (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
Index: sky/engine/core/rendering/RenderObject.cpp
diff --git a/sky/engine/core/rendering/RenderObject.cpp b/sky/engine/core/rendering/RenderObject.cpp
index 1d85606838161ef4eebb8f1bf4aa09113806bbfc..3745a2cf87fcab2746ce644f188170a2beae6da5 100644
--- a/sky/engine/core/rendering/RenderObject.cpp
+++ b/sky/engine/core/rendering/RenderObject.cpp
@@ -76,12 +76,6 @@
namespace blink {
-namespace {
-
-static bool gModifyRenderTreeStructureAnyState = false;
-
-} // namespace
-
#if ENABLE(ASSERT)
RenderObject::SetLayoutNeededForbiddenScope::SetLayoutNeededForbiddenScope(RenderObject& renderObject)
@@ -2482,7 +2476,7 @@ Element* RenderObject::offsetParent() const
PositionWithAffinity RenderObject::createPositionWithAffinity(int offset, EAffinity affinity)
{
// If this is a non-anonymous renderer in an editable area, then it's simple.
- if (Node* node = nonPseudoNode()) {
+ if (Node* node = this->node()) {
if (!node->hasEditableStyle()) {
// If it can be found, we prefer a visually equivalent position that is editable.
Position position = createLegacyEditingPosition(node, offset);
@@ -2507,7 +2501,7 @@ PositionWithAffinity RenderObject::createPositionWithAffinity(int offset, EAffin
while (RenderObject* parent = child->parent()) {
// Find non-anonymous content after.
for (RenderObject* renderer = child->nextInPreOrder(parent); renderer; renderer = renderer->nextInPreOrder(parent)) {
- if (Node* node = renderer->nonPseudoNode())
+ if (Node* node = renderer->node())
return PositionWithAffinity(firstPositionInOrBeforeNode(node), DOWNSTREAM);
}
@@ -2515,12 +2509,12 @@ PositionWithAffinity RenderObject::createPositionWithAffinity(int offset, EAffin
for (RenderObject* renderer = child->previousInPreOrder(); renderer; renderer = renderer->previousInPreOrder()) {
if (renderer == parent)
break;
- if (Node* node = renderer->nonPseudoNode())
+ if (Node* node = renderer->node())
return PositionWithAffinity(lastPositionInOrAfterNode(node), DOWNSTREAM);
}
// Use the parent itself unless it too is anonymous.
- if (Node* node = parent->nonPseudoNode())
+ if (Node* node = parent->node())
return PositionWithAffinity(firstPositionInOrBeforeNode(node), DOWNSTREAM);
// Repeat at the next level up.
@@ -2554,33 +2548,6 @@ bool RenderObject::canUpdateSelectionOnRootLineBoxes()
return containingBlock ? !containingBlock->needsLayout() : false;
}
-// We only create "generated" child renderers like one for first-letter if:
-// - the firstLetterBlock can have children in the DOM and
-// - the block doesn't have any special assumption on its text children.
-// This correctly prevents form controls from having such renderers.
-bool RenderObject::canHaveGeneratedChildren() const
-{
- return canHaveChildren();
-}
-
-void RenderObject::setNeedsBoundariesUpdate()
-{
- if (RenderObject* renderer = parent())
- renderer->setNeedsBoundariesUpdate();
-}
-
-FloatRect RenderObject::objectBoundingBox() const
-{
- ASSERT_NOT_REACHED();
- return FloatRect();
-}
-
-FloatRect RenderObject::strokeBoundingBox() const
-{
- ASSERT_NOT_REACHED();
- return FloatRect();
-}
-
// Returns the smallest rectangle enclosing all of the painted content
// respecting clipping, masking, filters, opacity, stroke-width and markers
FloatRect RenderObject::paintInvalidationRectInLocalCoordinates() const
@@ -2589,18 +2556,6 @@ FloatRect RenderObject::paintInvalidationRectInLocalCoordinates() const
return FloatRect();
}
-AffineTransform RenderObject::localTransform() const
-{
- static const AffineTransform identity;
- return identity;
-}
-
-const AffineTransform& RenderObject::localToParentTransform() const
-{
- static const AffineTransform identity;
- return identity;
-}
-
bool RenderObject::nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint&, HitTestAction)
{
ASSERT_NOT_REACHED();
@@ -2639,18 +2594,7 @@ void RenderObject::clearPaintInvalidationState(const PaintInvalidationState& pai
bool RenderObject::isAllowedToModifyRenderTreeStructure(Document& document)
{
- return DeprecatedDisableModifyRenderTreeStructureAsserts::canModifyRenderTreeStateInAnyState()
- || document.lifecycle().stateAllowsRenderTreeMutations();
-}
-
-DeprecatedDisableModifyRenderTreeStructureAsserts::DeprecatedDisableModifyRenderTreeStructureAsserts()
- : m_disabler(gModifyRenderTreeStructureAnyState, true)
-{
-}
-
-bool DeprecatedDisableModifyRenderTreeStructureAsserts::canModifyRenderTreeStateInAnyState()
-{
- return gModifyRenderTreeStructureAnyState;
+ return document.lifecycle().stateAllowsRenderTreeMutations();
}
} // namespace blink
« no previous file with comments | « sky/engine/core/rendering/RenderObject.h ('k') | sky/engine/core/rendering/compositing/CompositedLayerMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698