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

Unified Diff: third_party/WebKit/Source/core/html/HTMLImageElement.cpp

Issue 2802813002: Adds SVGImageElement as a ImageBitmapSource (Closed)
Patch Set: tests Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLImageElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
index 65a62298cce0df18ec5385e44e6dabffda759bac..0fa51adf367739be52707a116f7b3c16b6e274d9 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -684,28 +684,6 @@ void HTMLImageElement::forceReload() const {
m_referrerPolicy);
}
-ScriptPromise HTMLImageElement::createImageBitmap(
- ScriptState* scriptState,
- EventTarget& eventTarget,
- Optional<IntRect> cropRect,
- const ImageBitmapOptions& options,
- ExceptionState& exceptionState) {
- DCHECK(eventTarget.toLocalDOMWindow());
- if ((cropRect &&
- !ImageBitmap::isSourceSizeValid(cropRect->width(), cropRect->height(),
- exceptionState)) ||
- !ImageBitmap::isSourceSizeValid(bitmapSourceSize().width(),
- bitmapSourceSize().height(),
- exceptionState))
- return ScriptPromise();
- if (!ImageBitmap::isResizeOptionValid(options, exceptionState))
- return ScriptPromise();
- return ImageBitmapSource::fulfillImageBitmap(
- scriptState,
- ImageBitmap::create(this, cropRect,
- eventTarget.toLocalDOMWindow()->document(), options));
-}
-
void HTMLImageElement::selectSourceURL(
ImageLoader::UpdateFromElementBehavior behavior) {
if (!document().isActive())
@@ -826,16 +804,6 @@ PassRefPtr<ComputedStyle> HTMLImageElement::customStyleForLayoutObject() {
}
}
-IntSize HTMLImageElement::bitmapSourceSize() const {
- ImageResourceContent* image = cachedImage();
- if (!image)
- return IntSize();
- LayoutSize lSize = image->imageSize(
- LayoutObject::shouldRespectImageOrientation(layoutObject()), 1.0f);
- DCHECK(lSize.fraction().isZero());
- return IntSize(lSize.width().toInt(), lSize.height().toInt());
-}
-
void HTMLImageElement::associateWith(HTMLFormElement* form) {
if (form && form->isConnected()) {
m_form = form;

Powered by Google App Engine
This is Rietveld 408576698