svn-{apply, unapply} fails to apply/unapply SVN 1.7 patch that adds new file with property change
https://bugs.webkit.org/show_bug.cgi?id=136379

Patch by Daniel Bates <dbates@webkit.org> on 2014-09-09
Reviewed by David Kilzer.

Fixes an issue where svn-{apply, unapply} fail to apply or unapply, respectively,
a patch generated using Subversion 1.7.4 (r1295709) that both adds a new file F
and sets a property on F (say, the executable bit).

* Scripts/svn-apply:
(patch): Only add file if the diff has text chunks.
* Scripts/svn-unapply:
(patch): Only delete added file if the diff has text chunks.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MSE] media/media-source tests broken after r173318
https://bugs.webkit.org/show_bug.cgi?id=136675

Reviewed by Eric Carlson.

Fixes the following tests:
    http/tests/media/media-source/mediasource-play.html
    http/tests/media/media-source/mediasource-remove.html
    media/media-source/media-source-monitor-source-buffers.html
    media/media-source/media-source-overlapping-append-buffered.html

In r173318, a for loop was converted to a C++11 loop, but in so doing, left
pre-initialized, empty values in the beginning of returned Vector, which caused
the calling algorithm to miscalculate the amount of data buffered by the media
source.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::activeRanges):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173439 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Unreviewed gardening. Mark two media-source tests as failing.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173440 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for :read-write/:read-only matching editable content
https://bugs.webkit.org/show_bug.cgi?id=136668

Reviewed by Antti Koivisto.

Source/WebCore:

This is the second part of the update of :read-write/:read-only to the latest spec
(http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting.html#selectors).

The selectors :read-write/:read-only should match elements that are editable. The exact definition is:
"elements that are editing hosts or editable and are neither input elements nor textarea elements".

Matching that definition is really easy. It was done by updating HTMLElement's matchesReadWritePseudoClass()
to consider both contentEditable and designMode.

The tricky part is making that efficient in all cases. Matching contentEditable is horribly inefficient
compared to the other primitives. We don't want to execute that for every element.

Since matchesReadWritePseudoClass() was used by the theming code, that code was adjusted to
-Avoid calling that on regular HTMLElement, limiting the query to <input> and <textarea> where it is fast.
-Avoid the call entirely when possible.

Tests: fast/css/read-only-read-write-contenteditable-basics.html
       fast/css/read-only-read-write-designmode-basics.html
       fast/css/read-only-read-write-webkit-user-modify.html
       fast/selectors/read-only-read-write-contenteditable-basics.html
       fast/selectors/read-only-read-write-contenteditable-svg-foreignObject.html
       fast/selectors/read-only-read-write-designmode-basics.html
       fast/selectors/read-only-read-write-style-update.html

* html/HTMLElement.cpp:
(WebCore::contentEditableType):
This code is a generalization of the code that was in HTMLElement::contentEditable().
It is used by both matchesReadWritePseudoClass() and contentEditable() to determine
a valid state from the value of contentEditable.

(WebCore::HTMLElement::matchesReadWritePseudoClass):
Per the definition of editable content, we first check if the current element is an editing host,
if not we look for an editing host. If there are none, test for designMode.

(WebCore::HTMLElement::contentEditable):

(WebCore::RenderTheme::isReadOnlyControl):
The old definition would only match <input> and <textarea>. The code was updated to keep the same
behavior after matchesReadWritePseudoClass() is udpated. This avoids the performance problem of calling
matchesReadWritePseudoClass() on regular HTMLElement.

* platform/ControlStates.h:
ReadOnlyState was only used by ThemeMac for convertControlStatesToThemeDrawState().
In turn, convertControlStatesToThemeDrawState() was only used for painting
"-webkit-inner-spin-button". Buttons are not read-write to begin with.
The whole code looks like legacy from styling of input elements and was removed.

Removing ReadOnlyState removes the expensive part of extractControlStatesForRenderer().

* html/HTMLElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
* platform/mac/ThemeMac.mm:
(WebCore::convertControlStatesToThemeDrawState):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::extractControlStatesForRenderer):

LayoutTests:

* fast/css/read-only-read-write-contenteditable-basics-expected.html: Added.
* fast/css/read-only-read-write-contenteditable-basics.html: Added.
* fast/css/read-only-read-write-designmode-basics-expected.html: Added.
* fast/css/read-only-read-write-designmode-basics.html: Added.
* fast/css/read-only-read-write-webkit-user-modify-expected.txt: Added.
* fast/css/read-only-read-write-webkit-user-modify.html: Added.
* fast/selectors/read-only-read-write-contenteditable-basics-expected.txt: Added.
* fast/selectors/read-only-read-write-contenteditable-basics.html: Added.
* fast/selectors/read-only-read-write-contenteditable-svg-foreignObject-expected.txt: Added.
* fast/selectors/read-only-read-write-contenteditable-svg-foreignObject.html: Added.
* fast/selectors/read-only-read-write-designmode-basics-expected.txt: Added.
* fast/selectors/read-only-read-write-designmode-basics.html: Added.
* fast/selectors/read-only-read-write-style-update-expected.txt: Added.
* fast/selectors/read-only-read-write-style-update.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173441 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] -[WKBackForwardList backList] contains an unnecessary nil check
https://bugs.webkit.org/show_bug.cgi?id=136680

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKBackForwardList.mm:
(-[WKBackForwardList backList]): Removed nil check.
(-[WKBackForwardList forwardList]): Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable the "unreachable-code" warning
https://bugs.webkit.org/show_bug.cgi?id=136677

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-09-09
Reviewed by Darin Adler.

Source/JavaScriptCore:

* Configurations/Base.xcconfig:

Source/ThirdParty:

* gtest/xcode/Config/General.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:

Source/WebKit/mac:

* Configurations/Base.xcconfig:

Source/WebKit2:

* Configurations/Base.xcconfig:

Source/WTF:

The warning causes various build errors depending on which Clang you are using.

For example, with recent clangs, it breaks all the ARCHS dependent code like this:
    if (sizeof(uintptr_t) == 4)
        // Something for 32 bits.
    else
        // Somethign for 64 bits.

* Configurations/Base.xcconfig:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Ignore ::first-letter pseudo-element
https://bugs.webkit.org/show_bug.cgi?id=136625

Reviewed by Darin Adler.

Source/WebCore:

According to the spec the ::first-letter pseudo-element do not apply to
grid containers (neither to flexboxes).

Fixed issue in RenderBlock::getFirstLetter() that applies to both grids
and flexboxes. Basically if the grid's or flexbox's container was
defining the ::first-line pseudo-element and the grid or flexbox itself
too, the value from the grid or flexbox was being applied to the items.
Added the proper check to avoid this.

Added two new tests for grid and modified one flexbox test to cover the
issue explained above.

Tests: css3/flexbox/flexbox-ignore-container-firstLetter.html
       fast/css-grid-layout/grid-container-ignore-first-letter.html
       fast/css-grid-layout/grid-item-first-letter-valid.html

* rendering/RenderBlock.cpp:
(WebCore::isRenderBlockFlowOrRenderButton): New method refactoring
similar calls through the source code.
(WebCore::RenderBlock::firstLineBlock): Use
isRenderBlockFlowOrRenderButton().
(WebCore::findFirstLetterBlock): Modify it to use
isRenderBlockFlowOrRenderButton() in order to include grids and not only
check flexboxes.
(WebCore::RenderBlock::getFirstLetter): Use
isRenderBlockFlowOrRenderButton().
(WebCore::RenderBlock::updateFirstLetter): Early return if
firstLetterContainer is null (in the case of flexboxes or grids).

LayoutTests:

* css3/flexbox/flexbox-ignore-container-firstLetter.html: Modify test,
in order to actually check that the ::first-letter in a regular
container is ignored in the flexbox.
* fast/css-grid-layout/grid-container-ignore-first-letter-expected.txt: Added.
* fast/css-grid-layout/grid-container-ignore-first-letter.html: Added.
* fast/css-grid-layout/grid-item-first-letter-valid-expected.txt: Added.
* fast/css-grid-layout/grid-item-first-letter-valid.html: Added.


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