Implement the picture element.
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 20:13:50 +0000 (20:13 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Dec 2015 20:13:50 +0000 (20:13 +0000)
commit3da4a2d35513c66abd446a69a6815644994e736d
tree6428bb86a455fc04a9d009d7ababd1496fd6eb92
parent6aafa37635ea30abe0642046dd8e141c30e4d88f
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
28 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/picture/image-picture-1x-expected.txt [new file with mode: 0644]
LayoutTests/fast/picture/image-picture-1x.html [new file with mode: 0644]
LayoutTests/fast/picture/resources/blue_rect.jpg [new file with mode: 0644]
LayoutTests/fast/picture/resources/currentSrcHelper.js [new file with mode: 0644]
LayoutTests/fast/picture/resources/image-set-4x.png [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt
LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt
LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLImageElement.cpp
Source/WebCore/html/HTMLImageElement.h
Source/WebCore/html/HTMLImageElement.idl
Source/WebCore/html/HTMLPictureElement.cpp [new file with mode: 0644]
Source/WebCore/html/HTMLPictureElement.h [new file with mode: 0644]
Source/WebCore/html/HTMLPictureElement.idl [new file with mode: 0644]
Source/WebCore/html/HTMLSourceElement.cpp
Source/WebCore/html/HTMLSourceElement.h
Source/WebCore/html/HTMLTagNames.in
Source/WebCore/html/parser/HTMLSrcsetParser.h