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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlock.cpp

Issue 2140733003: [Editing][CodeHealth] Make Node::rootEditableElement static (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 783
784 if (isBody() || isDocumentElement() || hasOverflowClip() 784 if (isBody() || isDocumentElement() || hasOverflowClip()
785 || isPositioned() || isFloating() 785 || isPositioned() || isFloating()
786 || isTableCell() || isInlineBlockOrInlineTable() 786 || isTableCell() || isInlineBlockOrInlineTable()
787 || hasTransformRelatedProperty() || hasReflection() || hasMask() || isWr itingModeRoot() 787 || hasTransformRelatedProperty() || hasReflection() || hasMask() || isWr itingModeRoot()
788 || isLayoutFlowThread() || isFlexItemIncludingDeprecated()) 788 || isLayoutFlowThread() || isFlexItemIncludingDeprecated())
789 return true; 789 return true;
790 790
791 if (view() && view()->selectionStart()) { 791 if (view() && view()->selectionStart()) {
792 Node* startElement = view()->selectionStart()->node(); 792 Node* startElement = view()->selectionStart()->node();
793 if (startElement && startElement->rootEditableElement() == node()) 793 if (startElement && rootEditableElement(*startElement) == node())
794 return true; 794 return true;
795 } 795 }
796 796
797 return false; 797 return false;
798 } 798 }
799 799
800 LayoutUnit LayoutBlock::blockDirectionOffset(const LayoutSize& offsetFromBlock) const 800 LayoutUnit LayoutBlock::blockDirectionOffset(const LayoutSize& offsetFromBlock) const
801 { 801 {
802 return isHorizontalWritingMode() ? offsetFromBlock.height() : offsetFromBloc k.width(); 802 return isHorizontalWritingMode() ? offsetFromBlock.height() : offsetFromBloc k.width();
803 } 803 }
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 else if (computedInlineSize.isMinContent()) 1402 else if (computedInlineSize.isMinContent())
1403 maxPreferredLogicalWidth = minPreferredLogicalWidth; 1403 maxPreferredLogicalWidth = minPreferredLogicalWidth;
1404 } 1404 }
1405 } 1405 }
1406 1406
1407 bool LayoutBlock::hasLineIfEmpty() const 1407 bool LayoutBlock::hasLineIfEmpty() const
1408 { 1408 {
1409 if (!node()) 1409 if (!node())
1410 return false; 1410 return false;
1411 1411
1412 if (node()->isRootEditableElement()) 1412 if (isRootEditableElement(*node()))
1413 return true; 1413 return true;
1414 1414
1415 if (node()->isShadowRoot() && isHTMLInputElement(toShadowRoot(node())->host( ))) 1415 if (node()->isShadowRoot() && isHTMLInputElement(toShadowRoot(node())->host( )))
1416 return true; 1416 return true;
1417 1417
1418 return false; 1418 return false;
1419 } 1419 }
1420 1420
1421 LayoutUnit LayoutBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const 1421 LayoutUnit LayoutBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
1422 { 1422 {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1866 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) { 1866 for (TrackedLayoutBoxListHashSet::const_iterator it = positionedDescenda ntSet->begin(); it != end; ++it) {
1867 LayoutBox* currBox = *it; 1867 LayoutBox* currBox = *it;
1868 ASSERT(!currBox->needsLayout()); 1868 ASSERT(!currBox->needsLayout());
1869 } 1869 }
1870 } 1870 }
1871 } 1871 }
1872 1872
1873 #endif 1873 #endif
1874 1874
1875 } // namespace blink 1875 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698