| OLD | NEW |
| 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 return view()->compositor()->hasAcceleratedCompositing(); | 108 return view()->compositor()->hasAcceleratedCompositing(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 LayoutBoxModelObject::LayoutBoxModelObject(ContainerNode* node) | 111 LayoutBoxModelObject::LayoutBoxModelObject(ContainerNode* node) |
| 112 : LayoutObject(node) | 112 : LayoutObject(node) |
| 113 { | 113 { |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool LayoutBoxModelObject::usesCompositedScrolling() const | 116 bool LayoutBoxModelObject::usesCompositedScrolling() const |
| 117 { | 117 { |
| 118 return hasOverflowClip() && hasLayer() && layer()->scrollableArea()->usesCom
positedScrolling(); | 118 return hasOverflowClip() && hasLayer() && layer()->getScrollableArea()->uses
CompositedScrolling(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 LayoutBoxModelObject::~LayoutBoxModelObject() | 121 LayoutBoxModelObject::~LayoutBoxModelObject() |
| 122 { | 122 { |
| 123 // Our layer should have been destroyed and cleared by now | 123 // Our layer should have been destroyed and cleared by now |
| 124 ASSERT(!hasLayer()); | 124 ASSERT(!hasLayer()); |
| 125 ASSERT(!m_layer); | 125 ASSERT(!m_layer); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void LayoutBoxModelObject::willBeDestroyed() | 128 void LayoutBoxModelObject::willBeDestroyed() |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 { | 315 { |
| 316 setHasLayer(false); | 316 setHasLayer(false); |
| 317 m_layer = nullptr; | 317 m_layer = nullptr; |
| 318 } | 318 } |
| 319 | 319 |
| 320 bool LayoutBoxModelObject::hasSelfPaintingLayer() const | 320 bool LayoutBoxModelObject::hasSelfPaintingLayer() const |
| 321 { | 321 { |
| 322 return m_layer && m_layer->isSelfPaintingLayer(); | 322 return m_layer && m_layer->isSelfPaintingLayer(); |
| 323 } | 323 } |
| 324 | 324 |
| 325 PaintLayerScrollableArea* LayoutBoxModelObject::scrollableArea() const | 325 PaintLayerScrollableArea* LayoutBoxModelObject::getScrollableArea() const |
| 326 { | 326 { |
| 327 return m_layer ? m_layer->scrollableArea() : 0; | 327 return m_layer ? m_layer->getScrollableArea() : 0; |
| 328 } | 328 } |
| 329 | 329 |
| 330 void LayoutBoxModelObject::addLayerHitTestRects(LayerHitTestRects& rects, const
PaintLayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& cont
ainerRect) const | 330 void LayoutBoxModelObject::addLayerHitTestRects(LayerHitTestRects& rects, const
PaintLayer* currentLayer, const LayoutPoint& layerOffset, const LayoutRect& cont
ainerRect) const |
| 331 { | 331 { |
| 332 if (hasLayer()) { | 332 if (hasLayer()) { |
| 333 if (isLayoutView()) { | 333 if (isLayoutView()) { |
| 334 // LayoutView is handled with a special fast-path, but it needs to k
now the current layer. | 334 // LayoutView is handled with a special fast-path, but it needs to k
now the current layer. |
| 335 LayoutObject::addLayerHitTestRects(rects, layer(), LayoutPoint(), La
youtRect()); | 335 LayoutObject::addLayerHitTestRects(rects, layer(), LayoutPoint(), La
youtRect()); |
| 336 } else { | 336 } else { |
| 337 // Since a LayoutObject never lives outside it's container Layer, we
can switch | 337 // Since a LayoutObject never lives outside it's container Layer, we
can switch |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 832 x -= textIndentOffset / 2; | 832 x -= textIndentOffset / 2; |
| 833 break; | 833 break; |
| 834 case AlignRight: | 834 case AlignRight: |
| 835 x = maxX - caretWidth(); | 835 x = maxX - caretWidth(); |
| 836 if (!currentStyle.isLeftToRightDirection()) | 836 if (!currentStyle.isLeftToRightDirection()) |
| 837 x -= textIndentOffset; | 837 x -= textIndentOffset; |
| 838 break; | 838 break; |
| 839 } | 839 } |
| 840 x = std::min(x, (maxX - caretWidth()).clampNegativeToZero()); | 840 x = std::min(x, (maxX - caretWidth()).clampNegativeToZero()); |
| 841 | 841 |
| 842 LayoutUnit height = LayoutUnit(style()->fontMetrics().height()); | 842 LayoutUnit height = LayoutUnit(style()->getFontMetrics().height()); |
| 843 LayoutUnit verticalSpace = lineHeight(true, currentStyle.isHorizontalWriting
Mode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes) - height; | 843 LayoutUnit verticalSpace = lineHeight(true, currentStyle.isHorizontalWriting
Mode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes) - height; |
| 844 LayoutUnit y = paddingTop() + borderTop() + (verticalSpace / 2); | 844 LayoutUnit y = paddingTop() + borderTop() + (verticalSpace / 2); |
| 845 return currentStyle.isHorizontalWritingMode() ? LayoutRect(x, y, caretWidth(
), height) : LayoutRect(y, x, height, caretWidth()); | 845 return currentStyle.isHorizontalWritingMode() ? LayoutRect(x, y, caretWidth(
), height) : LayoutRect(y, x, height, caretWidth()); |
| 846 } | 846 } |
| 847 | 847 |
| 848 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(const LayoutBox
ModelObject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const | 848 const LayoutObject* LayoutBoxModelObject::pushMappingToContainer(const LayoutBox
ModelObject* ancestorToStopAt, LayoutGeometryMap& geometryMap) const |
| 849 { | 849 { |
| 850 ASSERT(ancestorToStopAt != this); | 850 ASSERT(ancestorToStopAt != this); |
| 851 | 851 |
| 852 bool ancestorSkipped; | 852 bool ancestorSkipped; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 if (rootElementStyle->hasBackground()) | 960 if (rootElementStyle->hasBackground()) |
| 961 return false; | 961 return false; |
| 962 | 962 |
| 963 if (node() != document().firstBodyElement()) | 963 if (node() != document().firstBodyElement()) |
| 964 return false; | 964 return false; |
| 965 | 965 |
| 966 return true; | 966 return true; |
| 967 } | 967 } |
| 968 | 968 |
| 969 } // namespace blink | 969 } // namespace blink |
| OLD | NEW |