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 * (C) 2007 David Smith (catfish.man@gmail.com) | 4 * (C) 2007 David Smith (catfish.man@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "core/rendering/RenderBlock.h" | 25 #include "core/rendering/RenderBlock.h" |
26 | 26 |
27 #include "HTMLNames.h" | 27 #include "HTMLNames.h" |
28 #include "core/accessibility/AXObjectCache.h" | 28 #include "core/accessibility/AXObjectCache.h" |
29 #include "core/dom/Document.h" | 29 #include "core/dom/Document.h" |
30 #include "core/dom/Element.h" | 30 #include "core/dom/Element.h" |
31 #include "core/events/OverflowEvent.h" | 31 #include "core/events/OverflowEvent.h" |
32 #include "core/dom/shadow/ShadowRoot.h" | 32 #include "core/dom/shadow/ShadowRoot.h" |
33 #include "core/editing/Editor.h" | 33 #include "core/editing/Editor.h" |
34 #include "core/editing/FrameSelection.h" | 34 #include "core/editing/FrameSelection.h" |
| 35 #include "core/fetch/ResourceLoadPriorityOptimizer.h" |
35 #include "core/frame/Frame.h" | 36 #include "core/frame/Frame.h" |
36 #include "core/frame/FrameView.h" | 37 #include "core/frame/FrameView.h" |
37 #include "core/page/Page.h" | 38 #include "core/page/Page.h" |
38 #include "core/page/Settings.h" | 39 #include "core/page/Settings.h" |
39 #include "core/platform/graphics/GraphicsContextStateSaver.h" | 40 #include "core/platform/graphics/GraphicsContextStateSaver.h" |
40 #include "core/rendering/ColumnInfo.h" | 41 #include "core/rendering/ColumnInfo.h" |
41 #include "core/rendering/GraphicsContextAnnotator.h" | 42 #include "core/rendering/GraphicsContextAnnotator.h" |
42 #include "core/rendering/HitTestLocation.h" | 43 #include "core/rendering/HitTestLocation.h" |
43 #include "core/rendering/HitTestResult.h" | 44 #include "core/rendering/HitTestResult.h" |
44 #include "core/rendering/InlineIterator.h" | 45 #include "core/rendering/InlineIterator.h" |
45 #include "core/rendering/InlineTextBox.h" | 46 #include "core/rendering/InlineTextBox.h" |
46 #include "core/rendering/LayoutRectRecorder.h" | 47 #include "core/rendering/LayoutRectRecorder.h" |
47 #include "core/rendering/LayoutRepainter.h" | 48 #include "core/rendering/LayoutRepainter.h" |
48 #include "core/rendering/PaintInfo.h" | 49 #include "core/rendering/PaintInfo.h" |
49 #include "core/rendering/RenderCombineText.h" | 50 #include "core/rendering/RenderCombineText.h" |
50 #include "core/rendering/RenderDeprecatedFlexibleBox.h" | 51 #include "core/rendering/RenderDeprecatedFlexibleBox.h" |
51 #include "core/rendering/RenderFlexibleBox.h" | 52 #include "core/rendering/RenderFlexibleBox.h" |
52 #include "core/rendering/RenderInline.h" | 53 #include "core/rendering/RenderInline.h" |
53 #include "core/rendering/RenderLayer.h" | 54 #include "core/rendering/RenderLayer.h" |
54 #include "core/rendering/RenderMarquee.h" | 55 #include "core/rendering/RenderMarquee.h" |
55 #include "core/rendering/RenderNamedFlowThread.h" | 56 #include "core/rendering/RenderNamedFlowThread.h" |
56 #include "core/rendering/RenderRegion.h" | 57 #include "core/rendering/RenderRegion.h" |
57 #include "core/rendering/RenderTableCell.h" | 58 #include "core/rendering/RenderTableCell.h" |
58 #include "core/rendering/RenderTextFragment.h" | 59 #include "core/rendering/RenderTextFragment.h" |
59 #include "core/rendering/RenderTheme.h" | 60 #include "core/rendering/RenderTheme.h" |
60 #include "core/rendering/RenderView.h" | 61 #include "core/rendering/RenderView.h" |
61 #include "core/rendering/shapes/ShapeInsideInfo.h" | 62 #include "core/rendering/shapes/ShapeInsideInfo.h" |
62 #include "core/rendering/shapes/ShapeOutsideInfo.h" | 63 #include "core/rendering/shapes/ShapeOutsideInfo.h" |
| 64 #include "core/rendering/style/ContentData.h" |
| 65 #include "core/rendering/style/RenderStyle.h" |
63 #include "platform/geometry/FloatQuad.h" | 66 #include "platform/geometry/FloatQuad.h" |
64 #include "platform/geometry/TransformState.h" | 67 #include "platform/geometry/TransformState.h" |
65 #include "wtf/StdLibExtras.h" | 68 #include "wtf/StdLibExtras.h" |
66 #include "wtf/TemporaryChange.h" | 69 #include "wtf/TemporaryChange.h" |
67 | 70 |
68 using namespace std; | 71 using namespace std; |
69 using namespace WTF; | 72 using namespace WTF; |
70 using namespace Unicode; | 73 using namespace Unicode; |
71 | 74 |
72 namespace WebCore { | 75 namespace WebCore { |
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 return; | 1250 return; |
1248 | 1251 |
1249 // It's safe to check for control clip here, since controls can never be tab
le cells. | 1252 // It's safe to check for control clip here, since controls can never be tab
le cells. |
1250 // If we have a lightweight clip, there can never be any overflow from child
ren. | 1253 // If we have a lightweight clip, there can never be any overflow from child
ren. |
1251 if (hasControlClip() && m_overflow) | 1254 if (hasControlClip() && m_overflow) |
1252 clearLayoutOverflow(); | 1255 clearLayoutOverflow(); |
1253 | 1256 |
1254 invalidateBackgroundObscurationStatus(); | 1257 invalidateBackgroundObscurationStatus(); |
1255 } | 1258 } |
1256 | 1259 |
| 1260 void RenderBlock::didLayout(ResourceLoadPriorityOptimizer& optimizer) |
| 1261 { |
| 1262 RenderBox::didLayout(optimizer); |
| 1263 updateStyleImageLoadingPriorities(optimizer); |
| 1264 } |
| 1265 |
| 1266 void RenderBlock::didScroll(ResourceLoadPriorityOptimizer& optimizer) |
| 1267 { |
| 1268 RenderBox::didScroll(optimizer); |
| 1269 updateStyleImageLoadingPriorities(optimizer); |
| 1270 } |
| 1271 |
| 1272 void RenderBlock::updateStyleImageLoadingPriorities(ResourceLoadPriorityOptimize
r& optimizer) |
| 1273 { |
| 1274 RenderStyle* blockStyle = style(); |
| 1275 |
| 1276 if (blockStyle) { |
| 1277 LayoutRect objectBounds = absoluteContentBox(); |
| 1278 LayoutRect viewBounds = viewRect(); |
| 1279 |
| 1280 ResourceLoadPriorityOptimizer::VisibilityStatus status = viewBounds.inte
rsects(objectBounds) ? |
| 1281 ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimiz
er::NotVisible; |
| 1282 |
| 1283 for (FillLayer* layer = blockStyle->accessBackgroundLayers(); layer; lay
er = layer->next()) { |
| 1284 if (layer->image()) { |
| 1285 ImageResource* img = layer->image()->cachedImage(); |
| 1286 if (img) { |
| 1287 optimizer.notifyImageResourceVisibility(img, status); |
| 1288 } |
| 1289 } |
| 1290 } |
| 1291 for (FillLayer* layer = blockStyle->accessMaskLayers(); layer; layer = l
ayer->next()) { |
| 1292 if (layer->image()) { |
| 1293 ImageResource* img = layer->image()->cachedImage(); |
| 1294 if (img) { |
| 1295 optimizer.notifyImageResourceVisibility(img, status); |
| 1296 } |
| 1297 } |
| 1298 } |
| 1299 ContentData* contentData = const_cast<ContentData*>(blockStyle->contentD
ata()); |
| 1300 if (contentData && contentData->isImage()) { |
| 1301 ImageContentData* imageContentData = static_cast<ImageContentData*>(
contentData); |
| 1302 if (imageContentData->image() && imageContentData->image()->cachedIm
age()) |
| 1303 optimizer.notifyImageResourceVisibility(imageContentData->image(
)->cachedImage(), status); |
| 1304 } |
| 1305 if (blockStyle->boxReflect()) { |
| 1306 if (blockStyle->boxReflect()->mask().image()) { |
| 1307 if (blockStyle->boxReflect()->mask().image()->cachedImage()) { |
| 1308 optimizer.notifyImageResourceVisibility(blockStyle->boxRefle
ct()->mask().image()->cachedImage(), status); |
| 1309 } |
| 1310 } |
| 1311 } |
| 1312 if (blockStyle->listStyleImage() && blockStyle->listStyleImage()->cached
Image()) |
| 1313 optimizer.notifyImageResourceVisibility(blockStyle->listStyleImage()
->cachedImage(), status); |
| 1314 if (blockStyle->borderImageSource() && blockStyle->borderImageSource()->
cachedImage()) |
| 1315 optimizer.notifyImageResourceVisibility(blockStyle->borderImageSourc
e()->cachedImage(), status); |
| 1316 if (blockStyle->maskBoxImageSource() && blockStyle->maskBoxImageSource()
->cachedImage()) |
| 1317 optimizer.notifyImageResourceVisibility(blockStyle->maskBoxImageSour
ce()->cachedImage(), status); |
| 1318 } |
| 1319 } |
| 1320 |
1257 void RenderBlock::relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize
offset) | 1321 void RenderBlock::relayoutShapeDescendantIfMoved(RenderBlock* child, LayoutSize
offset) |
1258 { | 1322 { |
1259 LayoutUnit left = isHorizontalWritingMode() ? offset.width() : offset.height
(); | 1323 LayoutUnit left = isHorizontalWritingMode() ? offset.width() : offset.height
(); |
1260 if (!left || !child || child->shapeInsideInfo() || !layoutShapeInsideInfo()) | 1324 if (!left || !child || child->shapeInsideInfo() || !layoutShapeInsideInfo()) |
1261 return; | 1325 return; |
1262 // Propagate layout markers only up to the child, as we are still in the mid
dle | 1326 // Propagate layout markers only up to the child, as we are still in the mid
dle |
1263 // of a layout pass | 1327 // of a layout pass |
1264 child->setNormalChildNeedsLayout(true); | 1328 child->setNormalChildNeedsLayout(true); |
1265 child->markShapeInsideDescendantsForLayout(); | 1329 child->markShapeInsideDescendantsForLayout(); |
1266 child->layoutIfNeeded(); | 1330 child->layoutIfNeeded(); |
(...skipping 4507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5774 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 5838 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
5775 { | 5839 { |
5776 showRenderObject(); | 5840 showRenderObject(); |
5777 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 5841 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
5778 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 5842 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
5779 } | 5843 } |
5780 | 5844 |
5781 #endif | 5845 #endif |
5782 | 5846 |
5783 } // namespace WebCore | 5847 } // namespace WebCore |
OLD | NEW |