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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 m_alwaysCreateLineBoxes = alwaysCreateLineBoxes; | 155 m_alwaysCreateLineBoxes = alwaysCreateLineBoxes; |
156 } | 156 } |
157 | 157 |
158 // Update pseudos for :before and :after now. | 158 // Update pseudos for :before and :after now. |
159 if (!isAnonymous() && document()->usesBeforeAfterRules()) { | 159 if (!isAnonymous() && document()->usesBeforeAfterRules()) { |
160 children()->updateBeforeAfterContent(this, BEFORE); | 160 children()->updateBeforeAfterContent(this, BEFORE); |
161 children()->updateBeforeAfterContent(this, AFTER); | 161 children()->updateBeforeAfterContent(this, AFTER); |
162 } | 162 } |
163 } | 163 } |
164 | 164 |
165 void RenderInline::updateAlwaysCreateLineBoxes() | 165 void RenderInline::updateAlwaysCreateLineBoxes(bool fullLayout) |
166 { | 166 { |
167 // Once we have been tainted once, just assume it will happen again. This wa
y effects like hover highlighting that change the | 167 // Once we have been tainted once, just assume it will happen again. This wa
y effects like hover highlighting that change the |
168 // background color will only cause a layout on the first rollover. | 168 // background color will only cause a layout on the first rollover. |
169 if (m_alwaysCreateLineBoxes) | 169 if (m_alwaysCreateLineBoxes) |
170 return; | 170 return; |
171 | 171 |
172 RenderStyle* parentStyle = parent()->style(); | 172 RenderStyle* parentStyle = parent()->style(); |
173 RenderInline* parentRenderInline = parent()->isRenderInline() ? toRenderInli
ne(parent()) : 0; | 173 RenderInline* parentRenderInline = parent()->isRenderInline() ? toRenderInli
ne(parent()) : 0; |
174 bool checkFonts = document()->inNoQuirksMode(); | 174 bool checkFonts = document()->inNoQuirksMode(); |
175 bool alwaysCreateLineBoxes = (parentRenderInline && parentRenderInline->alwa
ysCreateLineBoxes()) | 175 bool alwaysCreateLineBoxes = (parentRenderInline && parentRenderInline->alwa
ysCreateLineBoxes()) |
176 || (parentRenderInline && parentStyle->verticalAlign() != BASELINE) | 176 || (parentRenderInline && parentStyle->verticalAlign() != BASELINE) |
177 || style()->verticalAlign() != BASELINE | 177 || style()->verticalAlign() != BASELINE |
178 || style()->textEmphasisMark() != TextEmphasisMarkNone | 178 || style()->textEmphasisMark() != TextEmphasisMarkNone |
179 || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscent
DescentAndLineGap(style()->font().fontMetrics()) | 179 || (checkFonts && (!parentStyle->font().fontMetrics().hasIdenticalAscent
DescentAndLineGap(style()->font().fontMetrics()) |
180 || parentStyle->lineHeight() != style()->lineHeight())); | 180 || parentStyle->lineHeight() != style()->lineHeight())); |
181 | 181 |
182 if (!alwaysCreateLineBoxes && checkFonts && document()->usesFirstLineRules()
) { | 182 if (!alwaysCreateLineBoxes && checkFonts && document()->usesFirstLineRules()
) { |
183 // Have to check the first line style as well. | 183 // Have to check the first line style as well. |
184 parentStyle = parent()->style(true); | 184 parentStyle = parent()->style(true); |
185 RenderStyle* childStyle = style(true); | 185 RenderStyle* childStyle = style(true); |
186 alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalA
scentDescentAndLineGap(childStyle->font().fontMetrics()) | 186 alwaysCreateLineBoxes = !parentStyle->font().fontMetrics().hasIdenticalA
scentDescentAndLineGap(childStyle->font().fontMetrics()) |
187 || childStyle->verticalAlign() != BASELINE | 187 || childStyle->verticalAlign() != BASELINE |
188 || parentStyle->lineHeight() != childStyle->lineHeight(); | 188 || parentStyle->lineHeight() != childStyle->lineHeight(); |
189 } | 189 } |
190 | 190 |
191 if (alwaysCreateLineBoxes) { | 191 if (alwaysCreateLineBoxes) { |
192 dirtyLineBoxes(false); | 192 if (!fullLayout) |
| 193 dirtyLineBoxes(false); |
193 m_alwaysCreateLineBoxes = true; | 194 m_alwaysCreateLineBoxes = true; |
194 } | 195 } |
195 } | 196 } |
196 | 197 |
197 void RenderInline::addChild(RenderObject* newChild, RenderObject* beforeChild) | 198 void RenderInline::addChild(RenderObject* newChild, RenderObject* beforeChild) |
198 { | 199 { |
199 if (continuation()) | 200 if (continuation()) |
200 return addChildToContinuation(newChild, beforeChild); | 201 return addChildToContinuation(newChild, beforeChild); |
201 return addChildIgnoringContinuation(newChild, beforeChild); | 202 return addChildIgnoringContinuation(newChild, beforeChild); |
202 } | 203 } |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1547 region.clip.scale(pageScaleFactor); | 1548 region.clip.scale(pageScaleFactor); |
1548 } | 1549 } |
1549 } | 1550 } |
1550 | 1551 |
1551 regions.append(region); | 1552 regions.append(region); |
1552 } | 1553 } |
1553 } | 1554 } |
1554 #endif | 1555 #endif |
1555 | 1556 |
1556 } // namespace WebCore | 1557 } // namespace WebCore |
OLD | NEW |