OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/paint/InlineFlowBoxPainter.h" | 6 #include "core/paint/InlineFlowBoxPainter.h" |
7 | 7 |
8 #include "core/layout/Layer.h" | 8 #include "core/layout/Layer.h" |
9 #include "core/layout/LayoutBlock.h" | 9 #include "core/layout/LayoutBlock.h" |
10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 BoxPainter::paintNinePieceImage(*m_inlineFlowBox.boxModelObject(), paint
Info.context, imageStripPaintRect, m_inlineFlowBox.renderer().styleRef(), maskNi
nePieceImage, compositeOp); | 308 BoxPainter::paintNinePieceImage(*m_inlineFlowBox.boxModelObject(), paint
Info.context, imageStripPaintRect, m_inlineFlowBox.renderer().styleRef(), maskNi
nePieceImage, compositeOp); |
309 } | 309 } |
310 | 310 |
311 if (pushTransparencyLayer) | 311 if (pushTransparencyLayer) |
312 paintInfo.context->endLayer(); | 312 paintInfo.context->endLayer(); |
313 } | 313 } |
314 | 314 |
315 LayoutRect InlineFlowBoxPainter::roundedFrameRectClampedToLineTopAndBottomIfNeed
ed() const | 315 LayoutRect InlineFlowBoxPainter::roundedFrameRectClampedToLineTopAndBottomIfNeed
ed() const |
316 { | 316 { |
317 // Pixel snap rect painting. | 317 // Pixel snap rect painting. |
318 LayoutRect rect = m_inlineFlowBox.roundedFrameRect(); | 318 LayoutRect rect(m_inlineFlowBox.roundedFrameRect()); |
319 | 319 |
320 bool noQuirksMode = m_inlineFlowBox.renderer().document().inNoQuirksMode(); | 320 bool noQuirksMode = m_inlineFlowBox.renderer().document().inNoQuirksMode(); |
321 if (!noQuirksMode && !m_inlineFlowBox.hasTextChildren() && !(m_inlineFlowBox
.descendantsHaveSameLineHeightAndBaseline() && m_inlineFlowBox.hasTextDescendant
s())) { | 321 if (!noQuirksMode && !m_inlineFlowBox.hasTextChildren() && !(m_inlineFlowBox
.descendantsHaveSameLineHeightAndBaseline() && m_inlineFlowBox.hasTextDescendant
s())) { |
322 const RootInlineBox& rootBox = m_inlineFlowBox.root(); | 322 const RootInlineBox& rootBox = m_inlineFlowBox.root(); |
323 LayoutUnit logicalTop = m_inlineFlowBox.isHorizontal() ? rect.y() : rect
.x(); | 323 LayoutUnit logicalTop = m_inlineFlowBox.isHorizontal() ? rect.y() : rect
.x(); |
324 LayoutUnit logicalHeight = m_inlineFlowBox.isHorizontal() ? rect.height(
) : rect.width(); | 324 LayoutUnit logicalHeight = m_inlineFlowBox.isHorizontal() ? rect.height(
) : rect.width(); |
325 LayoutUnit bottom = std::min(rootBox.lineBottom(), logicalTop + logicalH
eight); | 325 LayoutUnit bottom = std::min(rootBox.lineBottom(), logicalTop + logicalH
eight); |
326 logicalTop = std::max(rootBox.lineTop(), logicalTop); | 326 logicalTop = std::max(rootBox.lineTop(), logicalTop); |
327 logicalHeight = bottom - logicalTop; | 327 logicalHeight = bottom - logicalTop; |
328 if (m_inlineFlowBox.isHorizontal()) { | 328 if (m_inlineFlowBox.isHorizontal()) { |
329 rect.setY(logicalTop); | 329 rect.setY(logicalTop); |
330 rect.setHeight(logicalHeight); | 330 rect.setHeight(logicalHeight); |
331 } else { | 331 } else { |
332 rect.setX(logicalTop); | 332 rect.setX(logicalTop); |
333 rect.setWidth(logicalHeight); | 333 rect.setWidth(logicalHeight); |
334 } | 334 } |
335 } | 335 } |
336 return rect; | 336 return rect; |
337 } | 337 } |
338 | 338 |
339 } // namespace blink | 339 } // namespace blink |
OLD | NEW |