From f79b479bc4bfd87a4e84b35bf28f9dd00d0414b1 Mon Sep 17 00:00:00 2001 From: Elliott Sprehn Date: Thu, 6 Nov 2014 15:03:37 -0800 Subject: [PATCH] Remove and . R=ojan@chromium.org Review URL: https://codereview.chromium.org/706093002 --- engine/core/core.gni | 5 - engine/core/html/HTMLImageElement.cpp | 94 ++---------- engine/core/html/HTMLImageElement.h | 5 +- engine/core/html/HTMLPictureElement.cpp | 37 ----- engine/core/html/HTMLPictureElement.h | 28 ---- engine/core/html/HTMLPictureElement.idl | 10 -- engine/core/html/HTMLSourceElement.cpp | 184 ------------------------ engine/core/html/HTMLSourceElement.h | 75 ---------- engine/core/html/HTMLSourceElement.idl | 37 ----- engine/core/html/HTMLTagNames.in | 2 - engine/core/loader/ImageLoader.cpp | 2 +- 11 files changed, 17 insertions(+), 462 deletions(-) delete mode 100644 engine/core/html/HTMLPictureElement.cpp delete mode 100644 engine/core/html/HTMLPictureElement.h delete mode 100644 engine/core/html/HTMLPictureElement.idl delete mode 100644 engine/core/html/HTMLSourceElement.cpp delete mode 100644 engine/core/html/HTMLSourceElement.h delete mode 100644 engine/core/html/HTMLSourceElement.idl diff --git a/engine/core/core.gni b/engine/core/core.gni index 5c421605359..20f13e1e4e8 100644 --- a/engine/core/core.gni +++ b/engine/core/core.gni @@ -757,13 +757,10 @@ sky_core_files = [ "html/HTMLImageLoader.h", "html/HTMLImportElement.cpp", "html/HTMLImportElement.h", - "html/HTMLPictureElement.cpp", "html/HTMLScriptElement.cpp", "html/HTMLScriptElement.h", "html/HTMLShadowElement.cpp", "html/HTMLShadowElement.h", - "html/HTMLSourceElement.cpp", - "html/HTMLSourceElement.h", "html/HTMLStyleElement.cpp", "html/HTMLStyleElement.h", "html/HTMLTemplateElement.cpp", @@ -1229,10 +1226,8 @@ core_idl_files = get_path_info([ "html/HTMLElement.idl", "html/HTMLImageElement.idl", "html/HTMLImportElement.idl", - "html/HTMLPictureElement.idl", "html/HTMLScriptElement.idl", "html/HTMLShadowElement.idl", - "html/HTMLSourceElement.idl", "html/HTMLStyleElement.idl", "html/HTMLTemplateElement.idl", "html/HTMLTitleElement.idl", diff --git a/engine/core/html/HTMLImageElement.cpp b/engine/core/html/HTMLImageElement.cpp index 451e6850c07..7d3c8728f1d 100644 --- a/engine/core/html/HTMLImageElement.cpp +++ b/engine/core/html/HTMLImageElement.cpp @@ -26,6 +26,7 @@ #include "core/CSSPropertyNames.h" #include "core/HTMLNames.h" #include "core/MediaTypeNames.h" +#include "core/css/MediaQueryListListener.h" #include "core/css/MediaQueryMatcher.h" #include "core/css/MediaValuesDynamic.h" #include "core/css/parser/SizesAttributeParser.h" @@ -35,7 +36,6 @@ #include "core/frame/UseCounter.h" #include "core/html/HTMLAnchorElement.h" #include "core/html/HTMLCanvasElement.h" -#include "core/html/HTMLSourceElement.h" #include "core/html/canvas/CanvasRenderingContext.h" #include "core/html/parser/HTMLParserIdioms.h" #include "core/html/parser/HTMLSrcsetParser.h" @@ -183,52 +183,6 @@ const AtomicString& HTMLImageElement::altText() const return getAttribute(HTMLNames::titleAttr); } -static bool supportedImageType(const String& type) -{ - return MIMETypeRegistry::isSupportedImagePrefixedMIMEType(type); -} - -// http://picture.responsiveimages.org/#update-source-set -ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent() -{ - ASSERT(isMainThread()); - Node* parent = parentNode(); - if (!parent || !isHTMLPictureElement(*parent)) - return ImageCandidate(); - for (Node* child = parent->firstChild(); child; child = child->nextSibling()) { - if (child == this) - return ImageCandidate(); - - if (!isHTMLSourceElement(*child)) - continue; - - HTMLSourceElement* source = toHTMLSourceElement(child); - if (!source->getAttribute(HTMLNames::srcAttr).isNull()) - UseCounter::countDeprecation(document(), UseCounter::PictureSourceSrc); - String srcset = source->getAttribute(HTMLNames::srcsetAttr); - if (srcset.isEmpty()) - continue; - String type = source->getAttribute(HTMLNames::typeAttr); - if (!type.isEmpty() && !supportedImageType(type)) - continue; - - if (!source->mediaQueryMatches()) - continue; - - String sizes = source->getAttribute(HTMLNames::sizesAttr); - if (!sizes.isNull()) - UseCounter::count(document(), UseCounter::Sizes); - SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes); - unsigned effectiveSize = parser.length(); - m_effectiveSizeViewportDependant = parser.viewportDependant(); - ImageCandidate candidate = bestFitSourceForSrcsetAttribute(document().devicePixelRatio(), effectiveSize, source->getAttribute(HTMLNames::srcsetAttr)); - if (candidate.isEmpty()) - continue; - return candidate; - } - return ImageCandidate(); -} - RenderObject* HTMLImageElement::createRenderer(RenderStyle* style) { RenderImage* image = new RenderImage(this); @@ -270,18 +224,9 @@ Node::InsertionNotificationRequest HTMLImageElement::insertedInto(ContainerNode* if (m_listener) document().mediaQueryMatcher().addViewportListener(m_listener.get()); - bool imageWasModified = false; - if (RuntimeEnabledFeatures::pictureEnabled()) { - ImageCandidate candidate = findBestFitImageFromPictureParent(); - if (!candidate.isEmpty()) { - setBestFitURLAndDPRFromImageCandidate(candidate); - imageWasModified = true; - } - } - // If we have been inserted from a renderer-less document, // our loader may have not fetched the image, so do it now. - if ((insertionPoint->inDocument() && !imageLoader().image()) || imageWasModified) + if ((insertionPoint->inDocument() && !imageLoader().image())) imageLoader().updateFromElement(ImageLoader::UpdateNormal, m_elementCreatedByParser ? ImageLoader::ForceLoadImmediately : ImageLoader::LoadNormally); return HTMLElement::insertedInto(insertionPoint); @@ -501,30 +446,19 @@ FloatSize HTMLImageElement::defaultDestinationSize() const void HTMLImageElement::selectSourceURL(ImageLoader::UpdateFromElementBehavior behavior) { - bool foundURL = false; - if (RuntimeEnabledFeatures::pictureEnabled()) { - ImageCandidate candidate = findBestFitImageFromPictureParent(); - if (!candidate.isEmpty()) { - setBestFitURLAndDPRFromImageCandidate(candidate); - foundURL = true; - } - } - - if (!foundURL) { - unsigned effectiveSize = 0; - if (RuntimeEnabledFeatures::pictureSizesEnabled()) { - String sizes = getAttribute(HTMLNames::sizesAttr); - if (!sizes.isNull()) - UseCounter::count(document(), UseCounter::Sizes); - SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes); - effectiveSize = parser.length(); - m_effectiveSizeViewportDependant = parser.viewportDependant(); - } - ImageCandidate candidate = bestFitSourceForImageAttributes( - document().devicePixelRatio(), effectiveSize, - getAttribute(HTMLNames::srcAttr), getAttribute(HTMLNames::srcsetAttr)); - setBestFitURLAndDPRFromImageCandidate(candidate); + unsigned effectiveSize = 0; + if (RuntimeEnabledFeatures::pictureSizesEnabled()) { + String sizes = getAttribute(HTMLNames::sizesAttr); + if (!sizes.isNull()) + UseCounter::count(document(), UseCounter::Sizes); + SizesAttributeParser parser = SizesAttributeParser(MediaValuesDynamic::create(document()), sizes); + effectiveSize = parser.length(); + m_effectiveSizeViewportDependant = parser.viewportDependant(); } + ImageCandidate candidate = bestFitSourceForImageAttributes( + document().devicePixelRatio(), effectiveSize, + getAttribute(HTMLNames::srcAttr), getAttribute(HTMLNames::srcsetAttr)); + setBestFitURLAndDPRFromImageCandidate(candidate); if (m_intrinsicSizingViewportDependant && m_effectiveSizeViewportDependant && !m_listener.get()) { m_listener = ViewportChangeListener::create(this); document().mediaQueryMatcher().addViewportListener(m_listener.get()); diff --git a/engine/core/html/HTMLImageElement.h b/engine/core/html/HTMLImageElement.h index 5c22dc34156..f664042925c 100644 --- a/engine/core/html/HTMLImageElement.h +++ b/engine/core/html/HTMLImageElement.h @@ -90,8 +90,6 @@ public: virtual FloatSize defaultDestinationSize() const override; virtual const KURL& sourceURL() const override; - // public so that HTMLPictureElement can call this as well. - void selectSourceURL(ImageLoader::UpdateFromElementBehavior); protected: explicit HTMLImageElement(Document&, bool createdByParser = false); @@ -100,6 +98,8 @@ protected: private: virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; + void selectSourceURL(ImageLoader::UpdateFromElementBehavior); + virtual void attach(const AttachContext& = AttachContext()) override; virtual RenderObject* createRenderer(RenderStyle*) override; @@ -111,7 +111,6 @@ private: virtual void removedFrom(ContainerNode*) override; virtual Image* imageContents() override; - ImageCandidate findBestFitImageFromPictureParent(); void setBestFitURLAndDPRFromImageCandidate(const ImageCandidate&); HTMLImageLoader& imageLoader() const { return *m_imageLoader; } void notifyViewportChanged(); diff --git a/engine/core/html/HTMLPictureElement.cpp b/engine/core/html/HTMLPictureElement.cpp deleted file mode 100644 index f4f2e55d811..00000000000 --- a/engine/core/html/HTMLPictureElement.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "config.h" -#include "core/html/HTMLPictureElement.h" - -#include "core/HTMLNames.h" -#include "core/dom/ElementTraversal.h" -#include "core/frame/UseCounter.h" -#include "core/html/HTMLImageElement.h" -#include "core/loader/ImageLoader.h" - -namespace blink { - -inline HTMLPictureElement::HTMLPictureElement(Document& document) - : HTMLElement(HTMLNames::pictureTag, document) -{ - ScriptWrappable::init(this); -} - -DEFINE_NODE_FACTORY(HTMLPictureElement) - -void HTMLPictureElement::sourceOrMediaChanged() -{ - for (HTMLImageElement* imageElement = Traversal::firstChild(*this); imageElement; imageElement = Traversal::nextSibling(*imageElement)) { - imageElement->selectSourceURL(ImageLoader::UpdateNormal); - } -} - -Node::InsertionNotificationRequest HTMLPictureElement::insertedInto(ContainerNode* insertionPoint) -{ - UseCounter::count(document(), UseCounter::Picture); - return HTMLElement::insertedInto(insertionPoint); -} - -} // namespace diff --git a/engine/core/html/HTMLPictureElement.h b/engine/core/html/HTMLPictureElement.h deleted file mode 100644 index d9490eeb596..00000000000 --- a/engine/core/html/HTMLPictureElement.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef HTMLPictureElement_h -#define HTMLPictureElement_h - -#include "core/html/HTMLElement.h" - -namespace blink { - -class HTMLPictureElement final : public HTMLElement { - DEFINE_WRAPPERTYPEINFO(); -public: - DECLARE_NODE_FACTORY(HTMLPictureElement); - - void sourceOrMediaChanged(); - -protected: - explicit HTMLPictureElement(Document&); - -private: - virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; -}; - -} // namespace blink - -#endif // HTMLPictureElement_h diff --git a/engine/core/html/HTMLPictureElement.idl b/engine/core/html/HTMLPictureElement.idl deleted file mode 100644 index 649316cb8a1..00000000000 --- a/engine/core/html/HTMLPictureElement.idl +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// http://picture.responsiveimages.org -[ - RuntimeEnabled=Picture -] interface HTMLPictureElement : HTMLElement { -}; - diff --git a/engine/core/html/HTMLSourceElement.cpp b/engine/core/html/HTMLSourceElement.cpp deleted file mode 100644 index 35e1816dce4..00000000000 --- a/engine/core/html/HTMLSourceElement.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "config.h" -#include "core/html/HTMLSourceElement.h" - -#include "core/HTMLNames.h" -#include "core/css/MediaList.h" -#include "core/css/MediaQueryList.h" -#include "core/css/MediaQueryMatcher.h" -#include "core/dom/Document.h" -#include "core/events/Event.h" -#include "core/events/EventSender.h" -#include "core/html/HTMLPictureElement.h" -#include "platform/Logging.h" - -namespace blink { - -static SourceEventSender& sourceErrorEventSender() -{ - DEFINE_STATIC_LOCAL(SourceEventSender, sharedErrorEventSender, (EventTypeNames::error)); - return sharedErrorEventSender; -} - -class HTMLSourceElement::Listener final : public MediaQueryListListener { -public: - explicit Listener(HTMLSourceElement* element) : m_element(element) { } - virtual void notifyMediaQueryChanged() override - { - if (m_element) - m_element->notifyMediaQueryChanged(); - } - - void clearElement() { m_element = nullptr; } - virtual void trace(Visitor* visitor) override - { - visitor->trace(m_element); - MediaQueryListListener::trace(visitor); - } -private: - RawPtr m_element; -}; - -inline HTMLSourceElement::HTMLSourceElement(Document& document) - : HTMLElement(HTMLNames::sourceTag, document) - , m_listener(adoptRef(new Listener(this))) -{ - WTF_LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this); - ScriptWrappable::init(this); -} - -DEFINE_NODE_FACTORY(HTMLSourceElement) - -HTMLSourceElement::~HTMLSourceElement() -{ - sourceErrorEventSender().cancelEvent(this); -#if !ENABLE(OILPAN) - m_listener->clearElement(); -#endif -} - -Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode* insertionPoint) -{ - HTMLElement::insertedInto(insertionPoint); - Element* parent = parentElement(); - if (isHTMLPictureElement(parent)) - toHTMLPictureElement(parent)->sourceOrMediaChanged(); - return InsertionDone; -} - -void HTMLSourceElement::removedFrom(ContainerNode* removalRoot) -{ - Element* parent = parentElement(); - if (!parent && removalRoot->isElementNode()) - parent = toElement(removalRoot); - if (isHTMLPictureElement(parent)) - toHTMLPictureElement(parent)->sourceOrMediaChanged(); - HTMLElement::removedFrom(removalRoot); -} - -void HTMLSourceElement::setSrc(const String& url) -{ - setAttribute(HTMLNames::srcAttr, AtomicString(url)); -} - -const AtomicString& HTMLSourceElement::type() const -{ - return getAttribute(HTMLNames::typeAttr); -} - -void HTMLSourceElement::setType(const AtomicString& type) -{ - setAttribute(HTMLNames::typeAttr, type); -} - -void HTMLSourceElement::scheduleErrorEvent() -{ - WTF_LOG(Media, "HTMLSourceElement::scheduleErrorEvent - %p", this); - sourceErrorEventSender().dispatchEventSoon(this); -} - -void HTMLSourceElement::cancelPendingErrorEvent() -{ - WTF_LOG(Media, "HTMLSourceElement::cancelPendingErrorEvent - %p", this); - sourceErrorEventSender().cancelEvent(this); -} - -void HTMLSourceElement::dispatchPendingEvent(SourceEventSender* eventSender) -{ - ASSERT_UNUSED(eventSender, eventSender == &sourceErrorEventSender()); - WTF_LOG(Media, "HTMLSourceElement::dispatchPendingEvent - %p", this); - dispatchEvent(Event::createCancelable(EventTypeNames::error)); -} - -bool HTMLSourceElement::mediaQueryMatches() const -{ - if (!m_mediaQueryList) - return true; - - return m_mediaQueryList->matches(); -} - -bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const -{ - return attribute.name() == HTMLNames::srcAttr || HTMLElement::isURLAttribute(attribute); -} - -void HTMLSourceElement::parseAttribute(const QualifiedName& name, const AtomicString& value) -{ - HTMLElement::parseAttribute(name, value); - if (name == HTMLNames::mediaAttr) { - if (m_mediaQueryList) - m_mediaQueryList->removeListener(m_listener); - RefPtr set = MediaQuerySet::create(value); - m_mediaQueryList = MediaQueryList::create(&document(), &document().mediaQueryMatcher(), set.release()); - m_mediaQueryList->addListener(m_listener); - } - if (name == HTMLNames::srcsetAttr - || name == HTMLNames::sizesAttr - || name == HTMLNames::mediaAttr - || name == HTMLNames::typeAttr) { - Element* parent = parentElement(); - if (isHTMLPictureElement(parent)) - toHTMLPictureElement(parent)->sourceOrMediaChanged(); - } -} - -void HTMLSourceElement::notifyMediaQueryChanged() -{ - Element* parent = parentElement(); - if (isHTMLPictureElement(parent)) - toHTMLPictureElement(parent)->sourceOrMediaChanged(); -} - -void HTMLSourceElement::trace(Visitor* visitor) -{ - visitor->trace(m_mediaQueryList); - visitor->trace(m_listener); - HTMLElement::trace(visitor); -} - -} diff --git a/engine/core/html/HTMLSourceElement.h b/engine/core/html/HTMLSourceElement.h deleted file mode 100644 index dc5320ff088..00000000000 --- a/engine/core/html/HTMLSourceElement.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef HTMLSourceElement_h -#define HTMLSourceElement_h - -#include "core/css/MediaQueryListListener.h" -#include "core/html/HTMLElement.h" -#include "platform/Timer.h" - -namespace blink { - -template class EventSender; -typedef EventSender SourceEventSender; - -class HTMLSourceElement final : public HTMLElement { - DEFINE_WRAPPERTYPEINFO(); -public: - class Listener; - - DECLARE_NODE_FACTORY(HTMLSourceElement); - virtual ~HTMLSourceElement(); - - const AtomicString& type() const; - void setSrc(const String&); - void setType(const AtomicString&); - - void scheduleErrorEvent(); - void cancelPendingErrorEvent(); - - void dispatchPendingEvent(SourceEventSender*); - - bool mediaQueryMatches() const; - - virtual void trace(Visitor*) override; - -private: - explicit HTMLSourceElement(Document&); - - virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; - virtual void removedFrom(ContainerNode*) override; - virtual bool isURLAttribute(const Attribute&) const override; - virtual void parseAttribute(const QualifiedName&, const AtomicString&) override; - - void notifyMediaQueryChanged(); - - RefPtr m_mediaQueryList; - RefPtr m_listener; -}; - -} // namespace blink - -#endif // HTMLSourceElement_h diff --git a/engine/core/html/HTMLSourceElement.idl b/engine/core/html/HTMLSourceElement.idl deleted file mode 100644 index 75cebb1282f..00000000000 --- a/engine/core/html/HTMLSourceElement.idl +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -[ - RuntimeEnabled=Media -] interface HTMLSourceElement : HTMLElement { - [Reflect, URL] attribute DOMString src; - attribute DOMString type; - - [Reflect, RuntimeEnabled=Picture] attribute DOMString srcset; - [Reflect, RuntimeEnabled=Picture] attribute DOMString sizes; - [Reflect, RuntimeEnabled=Picture] attribute DOMString media; - - [Reflect, RuntimeEnabled=SubresourceIntegrity] attribute DOMString integrity; -}; diff --git a/engine/core/html/HTMLTagNames.in b/engine/core/html/HTMLTagNames.in index c89511db2a5..81f1e5a2902 100644 --- a/engine/core/html/HTMLTagNames.in +++ b/engine/core/html/HTMLTagNames.in @@ -6,10 +6,8 @@ canvas content interfaceName=HTMLContentElement img interfaceName=HTMLImageElement, constructorNeedsCreatedByParser import -picture interfaceName=HTMLPictureElement script shadow interfaceName=HTMLShadowElement -source style constructorNeedsCreatedByParser template title diff --git a/engine/core/loader/ImageLoader.cpp b/engine/core/loader/ImageLoader.cpp index 7484662efd5..e2e588e5831 100644 --- a/engine/core/loader/ImageLoader.cpp +++ b/engine/core/loader/ImageLoader.cpp @@ -214,7 +214,7 @@ void ImageLoader::doUpdateFromElement(UpdateFromElementBehavior updateBehavior) // Unlike raw , we block mixed content inside of or . ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultResourceOptions(); ResourceRequest resourceRequest(url); - if (isHTMLPictureElement(element()->parentNode()) || !element()->getAttribute(HTMLNames::srcsetAttr).isNull()) + if (!element()->getAttribute(HTMLNames::srcsetAttr).isNull()) resourceRequest.setRequestContext(WebURLRequest::RequestContextImageSet); FetchRequest request(ResourceRequest(url), element()->localName(), resourceLoaderOptions);