OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 */ | 18 */ |
19 | 19 |
20 #include "config.h" | 20 #include "config.h" |
21 #include "core/layout/line/InlineFlowBox.h" | 21 #include "core/layout/line/InlineFlowBox.h" |
22 | 22 |
23 #include "core/CSSPropertyNames.h" | 23 #include "core/CSSPropertyNames.h" |
24 #include "core/dom/Document.h" | 24 #include "core/dom/Document.h" |
25 #include "core/layout/HitTestResult.h" | 25 #include "core/layout/HitTestResult.h" |
26 #include "core/layout/Layer.h" | 26 #include "core/layout/Layer.h" |
| 27 #include "core/layout/LayoutListMarker.h" |
27 #include "core/layout/LayoutObjectInlines.h" | 28 #include "core/layout/LayoutObjectInlines.h" |
28 #include "core/layout/LayoutRubyBase.h" | 29 #include "core/layout/LayoutRubyBase.h" |
29 #include "core/layout/LayoutRubyRun.h" | 30 #include "core/layout/LayoutRubyRun.h" |
30 #include "core/layout/LayoutRubyText.h" | 31 #include "core/layout/LayoutRubyText.h" |
31 #include "core/layout/line/InlineTextBox.h" | 32 #include "core/layout/line/InlineTextBox.h" |
32 #include "core/layout/line/RootInlineBox.h" | 33 #include "core/layout/line/RootInlineBox.h" |
33 #include "core/layout/style/ShadowList.h" | 34 #include "core/layout/style/ShadowList.h" |
34 #include "core/paint/BoxPainter.h" | 35 #include "core/paint/BoxPainter.h" |
35 #include "core/paint/InlineFlowBoxPainter.h" | 36 #include "core/paint/InlineFlowBoxPainter.h" |
36 #include "core/rendering/RenderBlock.h" | 37 #include "core/rendering/RenderBlock.h" |
37 #include "core/rendering/RenderInline.h" | 38 #include "core/rendering/RenderInline.h" |
38 #include "core/rendering/RenderListMarker.h" | |
39 #include "core/rendering/RenderView.h" | 39 #include "core/rendering/RenderView.h" |
40 #include "platform/fonts/Font.h" | 40 #include "platform/fonts/Font.h" |
41 #include "platform/graphics/GraphicsContextStateSaver.h" | 41 #include "platform/graphics/GraphicsContextStateSaver.h" |
42 | 42 |
43 #include <math.h> | 43 #include <math.h> |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 | 46 |
47 struct SameSizeAsInlineFlowBox : public InlineBox { | 47 struct SameSizeAsInlineFlowBox : public InlineBox { |
48 void* pointers[5]; | 48 void* pointers[5]; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 if (!child->renderer().isOutOfFlowPositioned()) { | 159 if (!child->renderer().isOutOfFlowPositioned()) { |
160 if (child->isText()) { | 160 if (child->isText()) { |
161 const LayoutStyle& childStyle = child->renderer().styleRef(isFirstLi
neStyle()); | 161 const LayoutStyle& childStyle = child->renderer().styleRef(isFirstLi
neStyle()); |
162 if (childStyle.letterSpacing() < 0 || childStyle.textShadow() || chi
ldStyle.textEmphasisMark() != TextEmphasisMarkNone || childStyle.textStrokeWidth
()) | 162 if (childStyle.letterSpacing() < 0 || childStyle.textShadow() || chi
ldStyle.textEmphasisMark() != TextEmphasisMarkNone || childStyle.textStrokeWidth
()) |
163 child->clearKnownToHaveNoOverflow(); | 163 child->clearKnownToHaveNoOverflow(); |
164 } else if (child->renderer().isReplaced()) { | 164 } else if (child->renderer().isReplaced()) { |
165 RenderBox& box = toRenderBox(child->renderer()); | 165 RenderBox& box = toRenderBox(child->renderer()); |
166 if (box.hasRenderOverflow() || box.hasSelfPaintingLayer()) | 166 if (box.hasRenderOverflow() || box.hasSelfPaintingLayer()) |
167 child->clearKnownToHaveNoOverflow(); | 167 child->clearKnownToHaveNoOverflow(); |
168 } else if (!child->renderer().isBR() && (child->renderer().style(isFirst
LineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() | 168 } else if (!child->renderer().isBR() && (child->renderer().style(isFirst
LineStyle())->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() |
169 || (child->renderer().isListMarker() && !toRenderListMarker(child->r
enderer()).isInside()) | 169 || (child->renderer().isListMarker() && !toLayoutListMarker(child->r
enderer()).isInside()) |
170 || child->renderer().style(isFirstLineStyle())->hasBorderImageOutset
s() | 170 || child->renderer().style(isFirstLineStyle())->hasBorderImageOutset
s() |
171 || child->renderer().style(isFirstLineStyle())->hasOutline())) { | 171 || child->renderer().style(isFirstLineStyle())->hasOutline())) { |
172 child->clearKnownToHaveNoOverflow(); | 172 child->clearKnownToHaveNoOverflow(); |
173 } | 173 } |
174 | 174 |
175 if (knownToHaveNoOverflow() && child->isInlineFlowBox() && !toInlineFlow
Box(child)->knownToHaveNoOverflow()) | 175 if (knownToHaveNoOverflow() && child->isInlineFlowBox() && !toInlineFlow
Box(child)->knownToHaveNoOverflow()) |
176 clearKnownToHaveNoOverflow(); | 176 clearKnownToHaveNoOverflow(); |
177 } | 177 } |
178 | 178 |
179 checkConsistency(); | 179 checkConsistency(); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 } | 417 } |
418 if (curr->renderer().isRenderInline()) { | 418 if (curr->renderer().isRenderInline()) { |
419 InlineFlowBox* flow = toInlineFlowBox(curr); | 419 InlineFlowBox* flow = toInlineFlowBox(curr); |
420 logicalLeft += flow->marginLogicalLeft(); | 420 logicalLeft += flow->marginLogicalLeft(); |
421 if (knownToHaveNoOverflow()) | 421 if (knownToHaveNoOverflow()) |
422 minLogicalLeft = std::min(logicalLeft, minLogicalLeft); | 422 minLogicalLeft = std::min(logicalLeft, minLogicalLeft); |
423 logicalLeft = flow->placeBoxesInInlineDirection(logicalLeft, nee
dsWordSpacing); | 423 logicalLeft = flow->placeBoxesInInlineDirection(logicalLeft, nee
dsWordSpacing); |
424 if (knownToHaveNoOverflow()) | 424 if (knownToHaveNoOverflow()) |
425 maxLogicalRight = std::max(logicalLeft, maxLogicalRight); | 425 maxLogicalRight = std::max(logicalLeft, maxLogicalRight); |
426 logicalLeft += flow->marginLogicalRight(); | 426 logicalLeft += flow->marginLogicalRight(); |
427 } else if (!curr->renderer().isListMarker() || toRenderListMarker(cu
rr->renderer()).isInside()) { | 427 } else if (!curr->renderer().isListMarker() || toLayoutListMarker(cu
rr->renderer()).isInside()) { |
428 // The box can have a different writing-mode than the overall li
ne, so this is a bit complicated. | 428 // The box can have a different writing-mode than the overall li
ne, so this is a bit complicated. |
429 // Just get all the physical margin and overflow values by hand
based off |isVertical|. | 429 // Just get all the physical margin and overflow values by hand
based off |isVertical|. |
430 LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelOb
ject()->marginLeft() : curr->boxModelObject()->marginTop(); | 430 LayoutUnit logicalLeftMargin = isHorizontal() ? curr->boxModelOb
ject()->marginLeft() : curr->boxModelObject()->marginTop(); |
431 LayoutUnit logicalRightMargin = isHorizontal() ? curr->boxModelO
bject()->marginRight() : curr->boxModelObject()->marginBottom(); | 431 LayoutUnit logicalRightMargin = isHorizontal() ? curr->boxModelO
bject()->marginRight() : curr->boxModelObject()->marginBottom(); |
432 | 432 |
433 logicalLeft += logicalLeftMargin; | 433 logicalLeft += logicalLeftMargin; |
434 curr->setLogicalLeft(logicalLeft); | 434 curr->setLogicalLeft(logicalLeft); |
435 if (knownToHaveNoOverflow()) | 435 if (knownToHaveNoOverflow()) |
436 minLogicalLeft = std::min(logicalLeft, minLogicalLeft); | 436 minLogicalLeft = std::min(logicalLeft, minLogicalLeft); |
437 logicalLeft += curr->logicalWidth(); | 437 logicalLeft += curr->logicalWidth(); |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 ASSERT(child->prevOnLine() == prev); | 1333 ASSERT(child->prevOnLine() == prev); |
1334 prev = child; | 1334 prev = child; |
1335 } | 1335 } |
1336 ASSERT(prev == m_lastChild); | 1336 ASSERT(prev == m_lastChild); |
1337 #endif | 1337 #endif |
1338 } | 1338 } |
1339 | 1339 |
1340 #endif | 1340 #endif |
1341 | 1341 |
1342 } // namespace blink | 1342 } // namespace blink |
OLD | NEW |