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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLAreaElement.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
OLDNEW
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 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2005, 2006, 2009, 2011 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 12 matching lines...) Expand all
23 23
24 #include "core/HTMLNames.h" 24 #include "core/HTMLNames.h"
25 #include "core/dom/ElementTraversal.h" 25 #include "core/dom/ElementTraversal.h"
26 #include "core/html/HTMLImageElement.h" 26 #include "core/html/HTMLImageElement.h"
27 #include "core/html/HTMLMapElement.h" 27 #include "core/html/HTMLMapElement.h"
28 #include "core/html/parser/HTMLParserIdioms.h" 28 #include "core/html/parser/HTMLParserIdioms.h"
29 #include "core/layout/HitTestResult.h" 29 #include "core/layout/HitTestResult.h"
30 #include "core/layout/LayoutImage.h" 30 #include "core/layout/LayoutImage.h"
31 #include "platform/graphics/Path.h" 31 #include "platform/graphics/Path.h"
32 #include "platform/transforms/AffineTransform.h" 32 #include "platform/transforms/AffineTransform.h"
33 #include "wtf/PtrUtil.h"
34 33
35 namespace blink { 34 namespace blink {
36 35
37 namespace { 36 namespace {
38 37
39 // Adapt a double to the allowed range of a LayoutUnit and narrow it to float pr ecision. 38 // Adapt a double to the allowed range of a LayoutUnit and narrow it to float pr ecision.
40 float clampCoordinate(double value) 39 float clampCoordinate(double value)
41 { 40 {
42 return LayoutUnit(value).toFloat(); 41 return LayoutUnit(value).toFloat();
43 } 42 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 float y1 = clampCoordinate(m_coords[3]); 158 float y1 = clampCoordinate(m_coords[3]);
160 path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0)); 159 path.addRect(FloatRect(x0, y0, x1 - x0, y1 - y0));
161 } 160 }
162 break; 161 break;
163 default: 162 default:
164 ASSERT_NOT_REACHED(); 163 ASSERT_NOT_REACHED();
165 break; 164 break;
166 } 165 }
167 166
168 // Cache the original path, not depending on containerObject. 167 // Cache the original path, not depending on containerObject.
169 m_path = wrapUnique(new Path(path)); 168 m_path = adoptPtr(new Path(path));
170 } 169 }
171 170
172 // Zoom the path into coordinates of the container object. 171 // Zoom the path into coordinates of the container object.
173 float zoomFactor = containerObject->styleRef().effectiveZoom(); 172 float zoomFactor = containerObject->styleRef().effectiveZoom();
174 if (zoomFactor != 1.0f) { 173 if (zoomFactor != 1.0f) {
175 AffineTransform zoomTransform; 174 AffineTransform zoomTransform;
176 zoomTransform.scale(zoomFactor); 175 zoomTransform.scale(zoomFactor);
177 path.transform(zoomTransform); 176 path.transform(zoomTransform);
178 } 177 }
179 return path; 178 return path;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 { 226 {
228 document().updateStyleAndLayoutTreeForNode(this); 227 document().updateStyleAndLayoutTreeForNode(this);
229 if (!isFocusable()) 228 if (!isFocusable())
230 return; 229 return;
231 230
232 if (HTMLImageElement* imageElement = this->imageElement()) 231 if (HTMLImageElement* imageElement = this->imageElement())
233 imageElement->updateFocusAppearance(selectionBehavior); 232 imageElement->updateFocusAppearance(selectionBehavior);
234 } 233 }
235 234
236 } // namespace blink 235 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLAreaElement.h ('k') | third_party/WebKit/Source/core/html/HTMLCanvasElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698