Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: Source/core/rendering/shapes/ShapeOutsideInfo.cpp

Issue 419203004: DevTools: wrapping arguments addConsoleMessage in ConsoleMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@wrap-not-all-console-args
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/page/PointerLockController.cpp ('k') | Source/core/svg/SVGDocumentExtensions.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 12 matching lines...) Expand all
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "config.h" 30 #include "config.h"
31 #include "core/rendering/shapes/ShapeOutsideInfo.h" 31 #include "core/rendering/shapes/ShapeOutsideInfo.h"
32 32
33 #include "core/inspector/ConsoleMessage.h"
33 #include "core/rendering/FloatingObjects.h" 34 #include "core/rendering/FloatingObjects.h"
34 #include "core/rendering/RenderBlockFlow.h" 35 #include "core/rendering/RenderBlockFlow.h"
35 #include "core/rendering/RenderBox.h" 36 #include "core/rendering/RenderBox.h"
36 #include "core/rendering/RenderImage.h" 37 #include "core/rendering/RenderImage.h"
37 #include "platform/LengthFunctions.h" 38 #include "platform/LengthFunctions.h"
38 #include "public/platform/Platform.h" 39 #include "public/platform/Platform.h"
39 40
40 namespace blink { 41 namespace blink {
41 42
42 CSSBoxType referenceBox(const ShapeValue& shapeValue) 43 CSSBoxType referenceBox(const ShapeValue& shapeValue)
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (styleImage.isGeneratedImage()) 87 if (styleImage.isGeneratedImage())
87 return true; 88 return true;
88 89
89 ASSERT(styleImage.cachedImage()); 90 ASSERT(styleImage.cachedImage());
90 ImageResource& imageResource = *(styleImage.cachedImage()); 91 ImageResource& imageResource = *(styleImage.cachedImage());
91 if (imageResource.isAccessAllowed(document.securityOrigin())) 92 if (imageResource.isAccessAllowed(document.securityOrigin()))
92 return true; 93 return true;
93 94
94 const KURL& url = imageResource.url(); 95 const KURL& url = imageResource.url();
95 String urlString = url.isNull() ? "''" : url.elidedString(); 96 String urlString = url.isNull() ? "''" : url.elidedString();
96 document.addConsoleMessage(SecurityMessageSource, ErrorMessageLevel, "Unsafe attempt to load URL " + urlString + "."); 97 document.addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, Err orMessageLevel, "Unsafe attempt to load URL " + urlString + "."));
97 98
98 return false; 99 return false;
99 } 100 }
100 101
101 static LayoutRect getShapeImageMarginRect(const RenderBox& renderBox, const Layo utSize& referenceBoxLogicalSize) 102 static LayoutRect getShapeImageMarginRect(const RenderBox& renderBox, const Layo utSize& referenceBoxLogicalSize)
102 { 103 {
103 LayoutPoint marginBoxOrigin(-renderBox.marginLogicalLeft() - renderBox.borde rAndPaddingLogicalLeft(), -renderBox.marginBefore() - renderBox.borderBefore() - renderBox.paddingBefore()); 104 LayoutPoint marginBoxOrigin(-renderBox.marginLogicalLeft() - renderBox.borde rAndPaddingLogicalLeft(), -renderBox.marginBefore() - renderBox.borderBefore() - renderBox.paddingBefore());
104 LayoutSize marginBoxSizeDelta(renderBox.marginLogicalWidth() + renderBox.bor derAndPaddingLogicalWidth(), renderBox.marginLogicalHeight() + renderBox.borderA ndPaddingLogicalHeight()); 105 LayoutSize marginBoxSizeDelta(renderBox.marginLogicalWidth() + renderBox.bor derAndPaddingLogicalWidth(), renderBox.marginLogicalHeight() + renderBox.borderA ndPaddingLogicalHeight());
105 return LayoutRect(marginBoxOrigin, referenceBoxLogicalSize + marginBoxSizeDe lta); 106 return LayoutRect(marginBoxOrigin, referenceBoxLogicalSize + marginBoxSizeDe lta);
106 } 107 }
(...skipping 12 matching lines...) Expand all
119 { 120 {
120 const IntSize& imageSize = m_renderer.calculateImageIntrinsicDimensions(styl eImage, roundedIntSize(m_referenceBoxLogicalSize), RenderImage::ScaleByEffective Zoom); 121 const IntSize& imageSize = m_renderer.calculateImageIntrinsicDimensions(styl eImage, roundedIntSize(m_referenceBoxLogicalSize), RenderImage::ScaleByEffective Zoom);
121 styleImage->setContainerSizeForRenderer(&m_renderer, imageSize, m_renderer.s tyle()->effectiveZoom()); 122 styleImage->setContainerSizeForRenderer(&m_renderer, imageSize, m_renderer.s tyle()->effectiveZoom());
122 123
123 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referen ceBoxLogicalSize); 124 const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referen ceBoxLogicalSize);
124 const LayoutRect& imageRect = (m_renderer.isRenderImage()) 125 const LayoutRect& imageRect = (m_renderer.isRenderImage())
125 ? toRenderImage(m_renderer).replacedContentRect() 126 ? toRenderImage(m_renderer).replacedContentRect()
126 : LayoutRect(LayoutPoint(), imageSize); 127 : LayoutRect(LayoutPoint(), imageSize);
127 128
128 if (!isValidRasterShapeRect(marginRect) || !isValidRasterShapeRect(imageRect )) { 129 if (!isValidRasterShapeRect(marginRect) || !isValidRasterShapeRect(imageRect )) {
129 m_renderer.document().addConsoleMessage(RenderingMessageSource, ErrorMes sageLevel, "The shape-outside image is too large."); 130 m_renderer.document().addConsoleMessage(ConsoleMessage::create(Rendering MessageSource, ErrorMessageLevel, "The shape-outside image is too large."));
130 return Shape::createEmptyRasterShape(writingMode, margin); 131 return Shape::createEmptyRasterShape(writingMode, margin);
131 } 132 }
132 133
133 ASSERT(!styleImage->isPendingImage()); 134 ASSERT(!styleImage->isPendingImage());
134 RefPtr<Image> image = styleImage->image(const_cast<RenderBox*>(&m_renderer), imageSize); 135 RefPtr<Image> image = styleImage->image(const_cast<RenderBox*>(&m_renderer), imageSize);
135 136
136 return Shape::createRasterShape(image.get(), shapeImageThreshold, imageRect, marginRect, writingMode, margin); 137 return Shape::createRasterShape(image.get(), shapeImageThreshold, imageRect, marginRect, writingMode, margin);
137 } 138 }
138 139
139 const Shape& ShapeOutsideInfo::computedShape() const 140 const Shape& ShapeOutsideInfo::computedShape() const
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 341 }
341 342
342 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const 343 FloatSize ShapeOutsideInfo::shapeToRendererSize(FloatSize size) const
343 { 344 {
344 if (!m_renderer.style()->isHorizontalWritingMode()) 345 if (!m_renderer.style()->isHorizontalWritingMode())
345 return size.transposedSize(); 346 return size.transposedSize();
346 return size; 347 return size;
347 } 348 }
348 349
349 } 350 }
OLDNEW
« no previous file with comments | « Source/core/page/PointerLockController.cpp ('k') | Source/core/svg/SVGDocumentExtensions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698