Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963
Reviewed by Dean Jackson.
LayoutTests/imported/w3c:
* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:
Source/WebCore:
Added fast/picture tests.
* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.
(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).
(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.
(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.
* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.
* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.
* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.
* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.
* html/HTMLTagNames.in:
Add the picture element.
* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.
LayoutTests:
* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192953
268f45cc-cd09-0410-ab3c-
d52691b4dbfc