| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 ImageQualityController::remove(this); | 106 ImageQualityController::remove(this); |
| 107 | 107 |
| 108 // A continuation of this RenderObject should be destroyed at subclasses. | 108 // A continuation of this RenderObject should be destroyed at subclasses. |
| 109 ASSERT(!continuation()); | 109 ASSERT(!continuation()); |
| 110 | 110 |
| 111 RenderLayerModelObject::willBeDestroyed(); | 111 RenderLayerModelObject::willBeDestroyed(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 bool RenderBoxModelObject::calculateHasBoxDecorations() const | 114 bool RenderBoxModelObject::calculateHasBoxDecorations() const |
| 115 { | 115 { |
| 116 RenderStyle* styleToUse = style(); | 116 const RenderStyle* styleToUse = style(); |
| 117 ASSERT(styleToUse); | 117 ASSERT(styleToUse); |
| 118 return hasBackground() || styleToUse->hasBorder() || styleToUse->hasAppearan
ce() || styleToUse->boxShadow(); | 118 return hasBackground() || styleToUse->hasBorder() || styleToUse->hasAppearan
ce() || styleToUse->boxShadow(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void RenderBoxModelObject::updateFromStyle() | 121 void RenderBoxModelObject::updateFromStyle() |
| 122 { | 122 { |
| 123 RenderLayerModelObject::updateFromStyle(); | 123 RenderLayerModelObject::updateFromStyle(); |
| 124 | 124 |
| 125 RenderStyle* styleToUse = style(); | 125 const RenderStyle* styleToUse = style(); |
| 126 setHasBoxDecorationBackground(calculateHasBoxDecorations()); | 126 setHasBoxDecorationBackground(calculateHasBoxDecorations()); |
| 127 setInline(styleToUse->isDisplayInlineType()); | 127 setInline(styleToUse->isDisplayInlineType()); |
| 128 setPositionState(styleToUse->position()); | 128 setPositionState(styleToUse->position()); |
| 129 setHorizontalWritingMode(styleToUse->isHorizontalWritingMode()); | 129 setHorizontalWritingMode(styleToUse->isHorizontalWritingMode()); |
| 130 } | 130 } |
| 131 | 131 |
| 132 static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child) | 132 static LayoutSize accumulateInFlowPositionOffsets(const RenderObject* child) |
| 133 { | 133 { |
| 134 if (!child->isAnonymousBlock() || !child->isRelPositioned()) | 134 if (!child->isAnonymousBlock() || !child->isRelPositioned()) |
| 135 return LayoutSize(); | 135 return LayoutSize(); |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 } | 493 } |
| 494 | 494 |
| 495 LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
LayoutUnit textIndentOffset) | 495 LayoutRect RenderBoxModelObject::localCaretRectForEmptyElement(LayoutUnit width,
LayoutUnit textIndentOffset) |
| 496 { | 496 { |
| 497 ASSERT(!slowFirstChild()); | 497 ASSERT(!slowFirstChild()); |
| 498 | 498 |
| 499 // FIXME: This does not take into account either :first-line or :first-lette
r | 499 // FIXME: This does not take into account either :first-line or :first-lette
r |
| 500 // However, as soon as some content is entered, the line boxes will be | 500 // However, as soon as some content is entered, the line boxes will be |
| 501 // constructed and this kludge is not called any more. So only the caret siz
e | 501 // constructed and this kludge is not called any more. So only the caret siz
e |
| 502 // of an empty :first-line'd block is wrong. I think we can live with that. | 502 // of an empty :first-line'd block is wrong. I think we can live with that. |
| 503 RenderStyle* currentStyle = firstLineStyle(); | 503 const RenderStyle* currentStyle = firstLineStyle(); |
| 504 | 504 |
| 505 enum CaretAlignment { alignLeft, alignRight, alignCenter }; | 505 enum CaretAlignment { alignLeft, alignRight, alignCenter }; |
| 506 | 506 |
| 507 CaretAlignment alignment = alignLeft; | 507 CaretAlignment alignment = alignLeft; |
| 508 | 508 |
| 509 switch (currentStyle->textAlign()) { | 509 switch (currentStyle->textAlign()) { |
| 510 case LEFT: | 510 case LEFT: |
| 511 case WEBKIT_LEFT: | 511 case WEBKIT_LEFT: |
| 512 break; | 512 break; |
| 513 case CENTER: | 513 case CENTER: |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 655 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 655 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 656 for (RenderObject* child = startChild; child && child != endChild; ) { | 656 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 657 // Save our next sibling as moveChildTo will clear it. | 657 // Save our next sibling as moveChildTo will clear it. |
| 658 RenderObject* nextSibling = child->nextSibling(); | 658 RenderObject* nextSibling = child->nextSibling(); |
| 659 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 659 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 660 child = nextSibling; | 660 child = nextSibling; |
| 661 } | 661 } |
| 662 } | 662 } |
| 663 | 663 |
| 664 } // namespace blink | 664 } // namespace blink |
| OLD | NEW |