| 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 |
| (...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 998 return; | 998 return; |
| 999 | 999 |
| 1000 if (paintInfo.phase == PaintPhaseMask) { | 1000 if (paintInfo.phase == PaintPhaseMask) { |
| 1001 paintMask(paintInfo, paintOffset); | 1001 paintMask(paintInfo, paintOffset); |
| 1002 return; | 1002 return; |
| 1003 } | 1003 } |
| 1004 | 1004 |
| 1005 if (paintInfo.phase == PaintPhaseForeground) | 1005 if (paintInfo.phase == PaintPhaseForeground) |
| 1006 paintBoxDecorationBackground(paintInfo, paintOffset); | 1006 paintBoxDecorationBackground(paintInfo, paintOffset); |
| 1007 | 1007 |
| 1008 PaintInfo childInfo(paintInfo); | |
| 1009 | |
| 1010 if (childInfo.paintingRoot && childInfo.paintingRoot->isDescendantOf(&render
er())) | |
| 1011 childInfo.paintingRoot = 0; | |
| 1012 else | |
| 1013 childInfo.updatePaintingRootForChildren(&renderer()); | |
| 1014 | |
| 1015 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { | 1008 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { |
| 1016 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintin
gLayer()) | 1009 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintin
gLayer()) |
| 1017 curr->paint(childInfo, paintOffset, lineTop, lineBottom); | 1010 curr->paint(paintInfo, paintOffset, lineTop, lineBottom); |
| 1018 } | 1011 } |
| 1019 } | 1012 } |
| 1020 | 1013 |
| 1021 void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c,
const FillLayer& fillLayer, const LayoutRect& rect) | 1014 void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c,
const FillLayer& fillLayer, const LayoutRect& rect) |
| 1022 { | 1015 { |
| 1023 if (fillLayer.next()) | 1016 if (fillLayer.next()) |
| 1024 paintFillLayers(paintInfo, c, *fillLayer.next(), rect); | 1017 paintFillLayers(paintInfo, c, *fillLayer.next(), rect); |
| 1025 paintFillLayer(paintInfo, c, fillLayer, rect); | 1018 paintFillLayer(paintInfo, c, fillLayer, rect); |
| 1026 } | 1019 } |
| 1027 | 1020 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 clipRect.setWidth(paintRect.width() + outsets.left()); | 1093 clipRect.setWidth(paintRect.width() + outsets.left()); |
| 1101 } | 1094 } |
| 1102 if (box->includeLogicalRightEdge()) | 1095 if (box->includeLogicalRightEdge()) |
| 1103 clipRect.setWidth(clipRect.width() + outsets.right()); | 1096 clipRect.setWidth(clipRect.width() + outsets.right()); |
| 1104 return clipRect; | 1097 return clipRect; |
| 1105 } | 1098 } |
| 1106 | 1099 |
| 1107 void InlineFlowBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const Lay
outPoint& paintOffset) | 1100 void InlineFlowBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const Lay
outPoint& paintOffset) |
| 1108 { | 1101 { |
| 1109 ASSERT(paintInfo.phase == PaintPhaseForeground); | 1102 ASSERT(paintInfo.phase == PaintPhaseForeground); |
| 1110 if (!paintInfo.shouldPaintWithinRoot(&renderer())) | |
| 1111 return; | |
| 1112 | 1103 |
| 1113 // You can use p::first-line to specify a background. If so, the root line b
oxes for | 1104 // You can use p::first-line to specify a background. If so, the root line b
oxes for |
| 1114 // a line may actually have to paint a background. | 1105 // a line may actually have to paint a background. |
| 1115 RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); | 1106 RenderStyle* styleToUse = renderer().style(isFirstLineStyle()); |
| 1116 bool shouldPaintBoxDecorationBackground; | 1107 bool shouldPaintBoxDecorationBackground; |
| 1117 if (parent()) | 1108 if (parent()) |
| 1118 shouldPaintBoxDecorationBackground = renderer().hasBoxDecorationBackgrou
nd(); | 1109 shouldPaintBoxDecorationBackground = renderer().hasBoxDecorationBackgrou
nd(); |
| 1119 else | 1110 else |
| 1120 shouldPaintBoxDecorationBackground = isFirstLineStyle() && styleToUse !=
renderer().style(); | 1111 shouldPaintBoxDecorationBackground = isFirstLineStyle() && styleToUse !=
renderer().style(); |
| 1121 | 1112 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 LayoutRect clipRect = clipRectForNinePieceImageStrip(this, borderIma
ge, paintRect); | 1166 LayoutRect clipRect = clipRectForNinePieceImageStrip(this, borderIma
ge, paintRect); |
| 1176 GraphicsContextStateSaver stateSaver(*paintInfo.context); | 1167 GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| 1177 paintInfo.context->clip(clipRect); | 1168 paintInfo.context->clip(clipRect); |
| 1178 boxModelObject()->paintBorder(paintInfo, LayoutRect(stripX, stripY,
stripWidth, stripHeight), renderer().style(isFirstLineStyle())); | 1169 boxModelObject()->paintBorder(paintInfo, LayoutRect(stripX, stripY,
stripWidth, stripHeight), renderer().style(isFirstLineStyle())); |
| 1179 } | 1170 } |
| 1180 } | 1171 } |
| 1181 } | 1172 } |
| 1182 | 1173 |
| 1183 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) | 1174 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) |
| 1184 { | 1175 { |
| 1185 if (!paintInfo.shouldPaintWithinRoot(&renderer()) || paintInfo.phase != Pain
tPhaseMask) | 1176 if (paintInfo.phase != PaintPhaseMask) |
| 1186 return; | 1177 return; |
| 1187 | 1178 |
| 1188 // Pixel snap mask painting. | 1179 // Pixel snap mask painting. |
| 1189 LayoutRect frameRect = roundedFrameRect(); | 1180 LayoutRect frameRect = roundedFrameRect(); |
| 1190 | 1181 |
| 1191 // Move x/y to our coordinates. | 1182 // Move x/y to our coordinates. |
| 1192 LayoutRect localRect(frameRect); | 1183 LayoutRect localRect(frameRect); |
| 1193 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); | 1184 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); |
| 1194 | 1185 |
| 1195 const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage(
); | 1186 const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage(
); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1417 ASSERT(child->prevOnLine() == prev); | 1408 ASSERT(child->prevOnLine() == prev); |
| 1418 prev = child; | 1409 prev = child; |
| 1419 } | 1410 } |
| 1420 ASSERT(prev == m_lastChild); | 1411 ASSERT(prev == m_lastChild); |
| 1421 #endif | 1412 #endif |
| 1422 } | 1413 } |
| 1423 | 1414 |
| 1424 #endif | 1415 #endif |
| 1425 | 1416 |
| 1426 } // namespace blink | 1417 } // namespace blink |
| OLD | NEW |