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

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

Issue 2802813002: Adds SVGImageElement as a ImageBitmapSource (Closed)
Patch Set: merge 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 b601f1c6e595f0cca3f622ebe7289cf3cb90b55c..b3d46d81677a7c7801dd1d6f3ce79e4198e687c8 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.cpp
@@ -688,28 +688,6 @@ void HTMLImageElement::ForceReload() const {
referrer_policy_);
}
-ScriptPromise HTMLImageElement::CreateImageBitmap(
- ScriptState* script_state,
- EventTarget& event_target,
- Optional<IntRect> crop_rect,
- const ImageBitmapOptions& options,
- ExceptionState& exception_state) {
- DCHECK(event_target.ToLocalDOMWindow());
- if ((crop_rect &&
- !ImageBitmap::IsSourceSizeValid(crop_rect->Width(), crop_rect->Height(),
- exception_state)) ||
- !ImageBitmap::IsSourceSizeValid(BitmapSourceSize().Width(),
- BitmapSourceSize().Height(),
- exception_state))
- return ScriptPromise();
- if (!ImageBitmap::IsResizeOptionValid(options, exception_state))
- return ScriptPromise();
- return ImageBitmapSource::FulfillImageBitmap(
- script_state, ImageBitmap::Create(
- this, crop_rect,
- event_target.ToLocalDOMWindow()->document(), options));
-}
-
void HTMLImageElement::SelectSourceURL(
ImageLoader::UpdateFromElementBehavior behavior) {
if (!GetDocument().IsActive())
@@ -833,16 +811,6 @@ PassRefPtr<ComputedStyle> HTMLImageElement::CustomStyleForLayoutObject() {
}
}
-IntSize HTMLImageElement::BitmapSourceSize() const {
- ImageResourceContent* image = CachedImage();
- if (!image)
- return IntSize();
- LayoutSize l_size = image->ImageSize(
- LayoutObject::ShouldRespectImageOrientation(GetLayoutObject()), 1.0f);
- DCHECK(l_size.Fraction().IsZero());
- return IntSize(l_size.Width().ToInt(), l_size.Height().ToInt());
-}
-
void HTMLImageElement::AssociateWith(HTMLFormElement* form) {
if (form && form->isConnected()) {
form_ = form;

Powered by Google App Engine
This is Rietveld 408576698