| 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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 LayoutRect layoutOverflow(isHorizontal() ? logicalLayoutOverflow : logicalLa
youtOverflow.transposedRect()); | 971 LayoutRect layoutOverflow(isHorizontal() ? logicalLayoutOverflow : logicalLa
youtOverflow.transposedRect()); |
| 972 setLayoutOverflow(layoutOverflow, frameBox); | 972 setLayoutOverflow(layoutOverflow, frameBox); |
| 973 | 973 |
| 974 LayoutRect visualOverflow(isHorizontal() ? logicalVisualOverflow : logicalVi
sualOverflow.transposedRect()); | 974 LayoutRect visualOverflow(isHorizontal() ? logicalVisualOverflow : logicalVi
sualOverflow.transposedRect()); |
| 975 setVisualOverflow(visualOverflow, frameBox); | 975 setVisualOverflow(visualOverflow, frameBox); |
| 976 } | 976 } |
| 977 | 977 |
| 978 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated
Offset, LayoutUnit lineTop, LayoutUnit lineBottom) | 978 bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
sult, const HitTestLocation& locationInContainer, const LayoutPoint& accumulated
Offset, LayoutUnit lineTop, LayoutUnit lineBottom) |
| 979 { | 979 { |
| 980 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); | 980 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); |
| 981 flipForWritingMode(overflowRect); | |
| 982 overflowRect.moveBy(accumulatedOffset); | 981 overflowRect.moveBy(accumulatedOffset); |
| 983 if (!locationInContainer.intersects(overflowRect)) | 982 if (!locationInContainer.intersects(overflowRect)) |
| 984 return false; | 983 return false; |
| 985 | 984 |
| 986 // Check children first. | 985 // Check children first. |
| 987 // We need to account for culled inline parents of the hit-tested nodes, so
that they may also get included in area-based hit-tests. | 986 // We need to account for culled inline parents of the hit-tested nodes, so
that they may also get included in area-based hit-tests. |
| 988 RenderObject* culledParent = 0; | 987 RenderObject* culledParent = 0; |
| 989 for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { | 988 for (InlineBox* curr = lastChild(); curr; curr = curr->prevOnLine()) { |
| 990 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintin
gLayer()) { | 989 if (curr->renderer().isText() || !curr->boxModelObject()->hasSelfPaintin
gLayer()) { |
| 991 RenderObject* newParent = 0; | 990 RenderObject* newParent = 0; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1016 // Check any culled ancestor of the final children tested. | 1015 // Check any culled ancestor of the final children tested. |
| 1017 while (culledParent && culledParent != renderer()) { | 1016 while (culledParent && culledParent != renderer()) { |
| 1018 if (culledParent->isRenderInline() && toRenderInline(culledParent)->hitT
estCulledInline(request, result, locationInContainer, accumulatedOffset)) | 1017 if (culledParent->isRenderInline() && toRenderInline(culledParent)->hitT
estCulledInline(request, result, locationInContainer, accumulatedOffset)) |
| 1019 return true; | 1018 return true; |
| 1020 culledParent = culledParent->parent(); | 1019 culledParent = culledParent->parent(); |
| 1021 } | 1020 } |
| 1022 | 1021 |
| 1023 // Now check ourselves. Pixel snap hit testing. | 1022 // Now check ourselves. Pixel snap hit testing. |
| 1024 // Move x/y to our coordinates. | 1023 // Move x/y to our coordinates. |
| 1025 LayoutRect rect(roundedFrameRect()); | 1024 LayoutRect rect(roundedFrameRect()); |
| 1026 flipForWritingMode(rect); | |
| 1027 rect.moveBy(accumulatedOffset); | 1025 rect.moveBy(accumulatedOffset); |
| 1028 | 1026 |
| 1029 if (visibleToHitTestRequest(request) && locationInContainer.intersects(rect)
) { | 1027 if (visibleToHitTestRequest(request) && locationInContainer.intersects(rect)
) { |
| 1030 renderer().updateHitTestResult(result, flipForWritingMode(locationInCont
ainer.point() - toLayoutSize(accumulatedOffset))); // Don't add in m_x or m_y he
re, we want coords in the containing block's space. | 1028 renderer().updateHitTestResult(result, locationInContainer.point() - toL
ayoutSize(accumulatedOffset)); // Don't add in m_x or m_y here, we want coords i
n the containing block's space. |
| 1031 if (!result.addNodeToRectBasedTestResult(renderer().node(), request, loc
ationInContainer, rect)) | 1029 if (!result.addNodeToRectBasedTestResult(renderer().node(), request, loc
ationInContainer, rect)) |
| 1032 return true; | 1030 return true; |
| 1033 } | 1031 } |
| 1034 | 1032 |
| 1035 return false; | 1033 return false; |
| 1036 } | 1034 } |
| 1037 | 1035 |
| 1038 void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
LayoutUnit lineTop, LayoutUnit lineBottom) | 1036 void InlineFlowBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
LayoutUnit lineTop, LayoutUnit lineBottom) |
| 1039 { | 1037 { |
| 1040 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); | 1038 LayoutRect overflowRect(visualOverflowRect(lineTop, lineBottom)); |
| 1041 flipForWritingMode(overflowRect); | |
| 1042 overflowRect.moveBy(paintOffset); | 1039 overflowRect.moveBy(paintOffset); |
| 1043 | 1040 |
| 1044 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) | 1041 if (!paintInfo.rect.intersects(pixelSnappedIntRect(overflowRect))) |
| 1045 return; | 1042 return; |
| 1046 | 1043 |
| 1047 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline) { | 1044 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel
fOutline) { |
| 1048 // Add ourselves to the paint info struct's list of inlines that need to
paint their | 1045 // Add ourselves to the paint info struct's list of inlines that need to
paint their |
| 1049 // outlines. | 1046 // outlines. |
| 1050 if (renderer().style()->hasOutline() && !isRootInlineBox()) { | 1047 if (renderer().style()->hasOutline() && !isRootInlineBox()) { |
| 1051 RenderInline& inlineFlow = toRenderInline(renderer()); | 1048 RenderInline& inlineFlow = toRenderInline(renderer()); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 shouldPaintBoxDecorationBackground = isFirstLineStyle() && styleToUse !=
renderer().style(); | 1213 shouldPaintBoxDecorationBackground = isFirstLineStyle() && styleToUse !=
renderer().style(); |
| 1217 | 1214 |
| 1218 if (!shouldPaintBoxDecorationBackground) | 1215 if (!shouldPaintBoxDecorationBackground) |
| 1219 return; | 1216 return; |
| 1220 | 1217 |
| 1221 // Pixel snap background/border painting. | 1218 // Pixel snap background/border painting. |
| 1222 LayoutRect frameRect = roundedFrameRect(); | 1219 LayoutRect frameRect = roundedFrameRect(); |
| 1223 | 1220 |
| 1224 // Move x/y to our coordinates. | 1221 // Move x/y to our coordinates. |
| 1225 LayoutRect localRect(frameRect); | 1222 LayoutRect localRect(frameRect); |
| 1226 flipForWritingMode(localRect); | |
| 1227 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); | 1223 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); |
| 1228 | 1224 |
| 1229 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); | 1225 LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); |
| 1230 | 1226 |
| 1231 // Shadow comes first and is behind the background and border. | 1227 // Shadow comes first and is behind the background and border. |
| 1232 if (!boxModelObject()->boxShadowShouldBeAppliedToBackground(BackgroundBleedN
one, this)) | 1228 if (!boxModelObject()->boxShadowShouldBeAppliedToBackground(BackgroundBleedN
one, this)) |
| 1233 paintBoxShadow(paintInfo, styleToUse, Normal, paintRect); | 1229 paintBoxShadow(paintInfo, styleToUse, Normal, paintRect); |
| 1234 | 1230 |
| 1235 Color backgroundColor = renderer().resolveColor(styleToUse, CSSPropertyBackg
roundColor); | 1231 Color backgroundColor = renderer().resolveColor(styleToUse, CSSPropertyBackg
roundColor); |
| 1236 paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(),
paintRect); | 1232 paintFillLayers(paintInfo, backgroundColor, styleToUse->backgroundLayers(),
paintRect); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) | 1276 void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffs
et) |
| 1281 { | 1277 { |
| 1282 if (!paintInfo.shouldPaintWithinRoot(&renderer()) || paintInfo.phase != Pain
tPhaseMask) | 1278 if (!paintInfo.shouldPaintWithinRoot(&renderer()) || paintInfo.phase != Pain
tPhaseMask) |
| 1283 return; | 1279 return; |
| 1284 | 1280 |
| 1285 // Pixel snap mask painting. | 1281 // Pixel snap mask painting. |
| 1286 LayoutRect frameRect = roundedFrameRect(); | 1282 LayoutRect frameRect = roundedFrameRect(); |
| 1287 | 1283 |
| 1288 // Move x/y to our coordinates. | 1284 // Move x/y to our coordinates. |
| 1289 LayoutRect localRect(frameRect); | 1285 LayoutRect localRect(frameRect); |
| 1290 flipForWritingMode(localRect); | |
| 1291 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); | 1286 LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); |
| 1292 | 1287 |
| 1293 const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage(
); | 1288 const NinePieceImage& maskNinePieceImage = renderer().style()->maskBoxImage(
); |
| 1294 StyleImage* maskBoxImage = renderer().style()->maskBoxImage().image(); | 1289 StyleImage* maskBoxImage = renderer().style()->maskBoxImage().image(); |
| 1295 | 1290 |
| 1296 // Figure out if we need to push a transparency layer to render our mask. | 1291 // Figure out if we need to push a transparency layer to render our mask. |
| 1297 bool pushTransparencyLayer = false; | 1292 bool pushTransparencyLayer = false; |
| 1298 bool compositedMask = renderer().hasLayer() && boxModelObject()->layer()->ha
sCompositedMask(); | 1293 bool compositedMask = renderer().hasLayer() && boxModelObject()->layer()->ha
sCompositedMask(); |
| 1299 bool flattenCompositingLayers = renderer().view()->frameView() && renderer()
.view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; | 1294 bool flattenCompositingLayers = renderer().view()->frameView() && renderer()
.view()->frameView()->paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
| 1300 CompositeOperator compositeOp = CompositeSourceOver; | 1295 CompositeOperator compositeOp = CompositeSourceOver; |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 ASSERT(child->prevOnLine() == prev); | 1532 ASSERT(child->prevOnLine() == prev); |
| 1538 prev = child; | 1533 prev = child; |
| 1539 } | 1534 } |
| 1540 ASSERT(prev == m_lastChild); | 1535 ASSERT(prev == m_lastChild); |
| 1541 #endif | 1536 #endif |
| 1542 } | 1537 } |
| 1543 | 1538 |
| 1544 #endif | 1539 #endif |
| 1545 | 1540 |
| 1546 } // namespace blink | 1541 } // namespace blink |
| OLD | NEW |