OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "core/html/HTMLImageElement.h" | 44 #include "core/html/HTMLImageElement.h" |
45 #include "core/html/HTMLInputElement.h" | 45 #include "core/html/HTMLInputElement.h" |
46 #include "core/html/HTMLSelectElement.h" | 46 #include "core/html/HTMLSelectElement.h" |
47 #include "core/html/ImageData.h" | 47 #include "core/html/ImageData.h" |
48 #include "core/html/canvas/CanvasAsyncBlobCreator.h" | 48 #include "core/html/canvas/CanvasAsyncBlobCreator.h" |
49 #include "core/html/canvas/CanvasContextCreationAttributes.h" | 49 #include "core/html/canvas/CanvasContextCreationAttributes.h" |
50 #include "core/html/canvas/CanvasFontCache.h" | 50 #include "core/html/canvas/CanvasFontCache.h" |
51 #include "core/html/canvas/CanvasRenderingContext.h" | 51 #include "core/html/canvas/CanvasRenderingContext.h" |
52 #include "core/html/canvas/CanvasRenderingContextFactory.h" | 52 #include "core/html/canvas/CanvasRenderingContextFactory.h" |
53 #include "core/imagebitmap/ImageBitmapOptions.h" | 53 #include "core/imagebitmap/ImageBitmapOptions.h" |
| 54 #include "core/layout/HitTestCanvasResult.h" |
54 #include "core/layout/LayoutHTMLCanvas.h" | 55 #include "core/layout/LayoutHTMLCanvas.h" |
55 #include "core/paint/PaintLayer.h" | 56 #include "core/paint/PaintLayer.h" |
56 #include "core/paint/PaintTiming.h" | 57 #include "core/paint/PaintTiming.h" |
57 #include "platform/Histogram.h" | 58 #include "platform/Histogram.h" |
58 #include "platform/MIMETypeRegistry.h" | 59 #include "platform/MIMETypeRegistry.h" |
59 #include "platform/RuntimeEnabledFeatures.h" | 60 #include "platform/RuntimeEnabledFeatures.h" |
60 #include "platform/graphics/Canvas2DImageBufferSurface.h" | 61 #include "platform/graphics/Canvas2DImageBufferSurface.h" |
61 #include "platform/graphics/CanvasMetrics.h" | 62 #include "platform/graphics/CanvasMetrics.h" |
62 #include "platform/graphics/CanvasSurfaceLayerBridgeClientImpl.h" | 63 #include "platform/graphics/CanvasSurfaceLayerBridgeClientImpl.h" |
63 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" | 64 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 || element.hasTagName(HTMLNames::tbodyTag) | 1206 || element.hasTagName(HTMLNames::tbodyTag) |
1206 || element.hasTagName(HTMLNames::tfootTag) | 1207 || element.hasTagName(HTMLNames::tfootTag) |
1207 || element.hasTagName(HTMLNames::trTag) | 1208 || element.hasTagName(HTMLNames::trTag) |
1208 || element.hasTagName(HTMLNames::tdTag) | 1209 || element.hasTagName(HTMLNames::tdTag) |
1209 || element.hasTagName(HTMLNames::thTag)) | 1210 || element.hasTagName(HTMLNames::thTag)) |
1210 return true; | 1211 return true; |
1211 | 1212 |
1212 return false; | 1213 return false; |
1213 } | 1214 } |
1214 | 1215 |
1215 std::pair<Element*, String> HTMLCanvasElement::getControlAndIdIfHitRegionExists(
const LayoutPoint& location) | 1216 HitTestCanvasResult* HTMLCanvasElement::getControlAndIdIfHitRegionExists(const L
ayoutPoint& location) |
1216 { | 1217 { |
1217 if (m_context && m_context->is2d()) | 1218 if (m_context && m_context->is2d()) |
1218 return m_context->getControlAndIdIfHitRegionExists(location); | 1219 return m_context->getControlAndIdIfHitRegionExists(location); |
1219 return std::make_pair(nullptr, String()); | 1220 return HitTestCanvasResult::create(String(), nullptr); |
1220 } | 1221 } |
1221 | 1222 |
1222 String HTMLCanvasElement::getIdFromControl(const Element* element) | 1223 String HTMLCanvasElement::getIdFromControl(const Element* element) |
1223 { | 1224 { |
1224 if (m_context) | 1225 if (m_context) |
1225 return m_context->getIdFromControl(element); | 1226 return m_context->getIdFromControl(element); |
1226 return String(); | 1227 return String(); |
1227 } | 1228 } |
1228 | 1229 |
1229 bool HTMLCanvasElement::createSurfaceLayer() | 1230 bool HTMLCanvasElement::createSurfaceLayer() |
1230 { | 1231 { |
1231 DCHECK(!m_surfaceLayerBridge); | 1232 DCHECK(!m_surfaceLayerBridge); |
1232 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); | 1233 std::unique_ptr<CanvasSurfaceLayerBridgeClient> bridgeClient = wrapUnique(ne
w CanvasSurfaceLayerBridgeClientImpl()); |
1233 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); | 1234 m_surfaceLayerBridge = wrapUnique(new CanvasSurfaceLayerBridge(std::move(bri
dgeClient))); |
1234 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); | 1235 return m_surfaceLayerBridge->createSurfaceLayer(this->width(), this->height(
)); |
1235 } | 1236 } |
1236 | 1237 |
1237 } // namespace blink | 1238 } // namespace blink |
OLD | NEW |