Source/WebCore: Current media controls look different from previous media controls. Adjusted CSS to make media elements more similar by adding padding, adjusting hues/svg, resizing elements, etc.

https://bugs.webkit.org/show_bug.cgi?id=133521

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-06-05
Reviewed by Eric Carlson.

The main issues:
- The widths between elements of both audio and video players are incorrect.
- The hues of audio player elements are incorrect.
- The hues of video player elements are content dependent (refer to full-screen mode), and this cannot be exactly replicated using just css. This patch only attempts to make them more similar.
- The height of the audio player is incorrect.

Test: platform/ios-sim/media/audio-width.html

* Modules/mediacontrols/mediaControlsiOS.css: Updated style elements for audio/video elements.
(::-webkit-media-controls): Enforce a minimum width on audio/video controls.
(audio): Enforce a minimum width on audio elements.
(audio::-webkit-media-controls): see below
(audio::-webkit-media-controls-wireless-playback-picker-button): modified SVG, hue and width/height.
(audio::-webkit-media-controls-panel): adjusted hue, added left/right padding.
(audio::-webkit-media-controls-fullscreen-button): removed. There's no fullscreen for audio anyways.
(audio::-webkit-media-controls-current-time-display): adjusted font size, added left padding.
(audio::-webkit-media-controls-time-remaining-display): adjusted font size, added right padding.

(video::-webkit-media-controls-panel): adjusted hue, added left/right padding.
(video::-webkit-media-controls-current-time-display): added left padding.
(video::-webkit-media-controls-time-remaining-display): added right padding.
(video::-webkit-media-controls-wireless-playback-picker-button): modified SVG, hue, opacity and width/height.
(video::-webkit-media-controls-fullscreen-button): modified SVG, hue, opacity, and width/height. In particular, made the svg seem sharper.
(video::-webkit-media-controls-play-button): modified SVG, hue, opacity, and width/height.

LayoutTests: REGRESSION (Pluginless): Media controls look different from iOS7 media controls.
https://bugs.webkit.org/show_bug.cgi?id=133521

Patch by Wenson Hsieh <wenson_hsieh@apple.com> on 2014-06-05
Reviewed by Eric Carlson.

Tests that audio elements are properly sized. Will add tests for video players in the (near) future.

* platform/ios-sim/media/audio-width-expected.txt: Checks that audio width tests were OK'd
* platform/ios-sim/media/audio-width.html: Checks that minimum audio width is properly enforced

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Align srcset parser with recent spec changes
https://bugs.webkit.org/show_bug.cgi?id=133504

Reviewed by Darin Adler.

Source/WebCore:
New tests were added to fast/hidpi/image-srcset-invalid-descriptor.html

The srcset parser changes align it with the spec:
http://picture.responsiveimages.org/#parse-srcset-attr.
The spec changes are meant to give the parser better future
compatibility, and enable it to work well with the 'w' descriptor, the
soon to be added 'h' descriptor and function descriptors (e.g.
future-descriptor(a, b, c) ).

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
(WebCore::HTMLImageElement::parseAttribute):
* html/HTMLImageElement.h:
* html/parser/HTMLParserIdioms.h:
(WebCore::isHTMLSpace):
(WebCore::isComma):
(WebCore::isHTMLSpaceOrComma):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
* html/parser/HTMLSrcsetParser.cpp:
(WebCore::compareByDensity):
(WebCore::appendDescriptorAndReset):
(WebCore::appendCharacter):
(WebCore::isEOF):
(WebCore::tokenizeDescriptors):
(WebCore::stringViewToFloat):
(WebCore::stringViewToInt):
(WebCore::parseDescriptors):
(WebCore::parseImageCandidatesFromSrcsetAttribute):
(WebCore::pickBestImageCandidate):
(WebCore::bestFitSourceForImageAttributes):
(WebCore::compareByScaleFactor): Deleted.
(WebCore::parseImagesWithScaleFromSrcsetAttribute): Deleted.
* html/parser/HTMLSrcsetParser.h:
(WebCore::DescriptorParsingResult::DescriptorParsingResult):
(WebCore::DescriptorParsingResult::hasDensity):
(WebCore::DescriptorParsingResult::hasWidth):
(WebCore::DescriptorParsingResult::hasHeight):
(WebCore::DescriptorParsingResult::density):
(WebCore::DescriptorParsingResult::resourceWidth):
(WebCore::DescriptorParsingResult::resourceHeight):
(WebCore::DescriptorParsingResult::setResourceWidth):
(WebCore::DescriptorParsingResult::setResourceHeight):
(WebCore::DescriptorParsingResult::setDensity):
(WebCore::ImageCandidate::ImageCandidate):
(WebCore::ImageCandidate::toString):
(WebCore::ImageCandidate::url):
(WebCore::ImageCandidate::setDensity):
(WebCore::ImageCandidate::density):
(WebCore::ImageCandidate::resourceWidth):
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
(WebCore::ImageWithScale::ImageWithScale): Deleted.
(WebCore::ImageWithScale::imageURL): Deleted.
(WebCore::ImageWithScale::scaleFactor): Deleted.
* html/parser/ParsingUtilities.h: Renamed from Source/WebCore/html/track/ParsingUtilities.h.
(skipExactly):
(skipUntil):
(skipWhile):
(reverseSkipWhile):

Source/WTF:
I've added toInt and toFloat methods to StringView, and exposed
charactersToInt so that they can be used by
HTMLSrcsetParser.cpp.

* wtf/text/WTFString.h:
* wtf/text/StringView.h:
(WTF::StringView::toInt):
(WTF::StringView::toFloat):

LayoutTests:
I have changed the "invalid-descriptor" test and removed the "invalid
inputs correct src" test to reflect the fact that invalid descriptors
are now treated identically to null descriptors. That is according to
the spec.
I've also added new tests that make sure that the spec's future
compatible changes are working.

* fast/hidpi/image-srcset-invalid-descriptor-expected.txt:
* fast/hidpi/image-srcset-invalid-descriptor.html:
* fast/hidpi/image-srcset-invalid-inputs-correct-src-expected.txt: Removed.
* fast/hidpi/image-srcset-invalid-inputs-correct-src.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169637 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Region box incorrectly overlaps floating box
https://bugs.webkit.org/show_bug.cgi?id=133545

Reviewed by David Hyatt.

Source/WebCore:
A region box creates a BFC and it should not overlap a floating box in the same formatting context: http://www.w3.org/TR/CSS21/visuren.html#bfc-next-to-float

Test: fast/regions/region-as-bfc-avoids-float.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::avoidsFloats):

LayoutTests:
Add test to check that a region does not incorrectly overlap a floating
element in the same formatting context.

* fast/regions/region-as-bfc-avoids-float-expected.html: Added.
* fast/regions/region-as-bfc-avoids-float.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169639 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StyleResolver doesn't compile without CSS_GRID_LAYOUT enabled
https://bugs.webkit.org/show_bug.cgi?id=133568

Reviewed by Tim Horton.

* css/StyleResolver.cpp:
(WebCore::isDisplayGridBox): Add UNUSED_PARAM.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169640 268f45cc-cd09-0410-ab3c-d52691b4dbfc