Use prefix form of increment / decrement operators in WTF String classes when possible
https://bugs.webkit.org/show_bug.cgi?id=101859

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-13
Reviewed by Benjamin Poulain.

Use prefix form of increment / decrement operators whenever possible in
WTF String classes as this seems to be the convention in WebKit.

* wtf/text/ASCIIFastPath.h:
(WTF::copyLCharsFromUCharSource):
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::add):
* wtf/text/Base64.cpp:
(WTF::base64Encode):
(WTF::base64DecodeInternal):
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::allocateBufferUpConvert):
* wtf/text/StringConcatenate.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::getData16SlowCase):
(WTF::StringImpl::upconvertCharacters):
(WTF::StringImpl::containsOnlyWhitespace):
(WTF::StringImpl::lower):
(WTF::StringImpl::upper):
(WTF::StringImpl::foldCase):
(WTF::StringImpl::stripMatchedCharacters):
(WTF::StringImpl::removeCharacters):
(WTF::StringImpl::simplifyMatchedCharactersToSpace):
(WTF::reverseFindInner):
(WTF::reverseFindIgnoringCaseInner):
(WTF::StringImpl::replace):
(WTF::StringImpl::createWithTerminatingNullCharacter):
* wtf/text/StringImpl.h:
(WTF::codePointCompare):
* wtf/text/WTFString.cpp:
(WTF::String::String):
(WTF::toIntegralType):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebSocket] send() and close() should not throw an exception for an unpaired surrogate but use the replacement character
https://bugs.webkit.org/show_bug.cgi?id=101569

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Replace unpaired surrogates with replacing character (U+FFFD) when
encoding text messages and close reasons. This change is aimed at
following the changes on the WebSocket API specification.

Test: http/tests/websocket/tests/hybi/close-reason-too-long.html

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::close):
Use String::StrictConversionReplacingUnpairedSurrogatesWithFFFD mode to encode
text message. Remove invalid utf-8 check.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::send):
Use String::StrictConversionReplacingUnpairedSurrogatesWithFFFD mode to encode
close reason. Remove invalid utf-8 check.

LayoutTests:

- Updated tests which try to send unpaired surrogates.
  These tests should not throw SYNTAX_ERR.
- Add a test that checks whether WebKit throws SYNTAX_ERR when a close
  reason is too long.

* http/tests/websocket/tests/hybi/close-reason-too-long-expected.txt: Added.
* http/tests/websocket/tests/hybi/close-reason-too-long.html: Ditto.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason-expected.txt: Updated.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason.html: Ditto.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-message-expected.txt: Ditto.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-message.html: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
More chromium-mac-mountainlion rebaselining and bug triaging.
https://bugs.webkit.org/show_bug.cgi?id=99749

Unreviewed.

* platform/chromium-mac-lion/compositing/color-matching/image-color-matching-expected.png: Added.
* platform/chromium-mac-lion/compositing/direct-image-compositing-expected.png: Copied from LayoutTests/platform/chromium-mac/compositing/direct-image-compositing-expected.png.
* platform/chromium-mac-lion/compositing/geometry/clipping-foreground-expected.png: Copied from LayoutTests/platform/chromium-mac/compositing/geometry/clipping-foreground-expected.png.
* platform/chromium-mac-lion/fast/dynamic/text-combine-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/dynamic/text-combine-expected.png.
* platform/chromium-mac-lion/fast/dynamic/text-combine-expected.txt: Added.
* platform/chromium-mac-lion/fast/ruby/base-shorter-than-text-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/ruby/base-shorter-than-text-expected.png.
* platform/chromium-mac-lion/fast/ruby/base-shorter-than-text-expected.txt: Copied from LayoutTests/platform/chromium-mac/fast/ruby/base-shorter-than-text-expected.txt.
* platform/chromium-mac-lion/fast/text/emphasis-combined-text-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/text/emphasis-combined-text-expected.png.
* platform/chromium-mac-lion/fast/text/emphasis-combined-text-expected.txt: Added.
* platform/chromium-mac-lion/fast/text/emphasis-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/text/emphasis-expected.png.
* platform/chromium-mac-lion/fast/text/international/text-combine-image-test-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/text/international/text-combine-image-test-expected.png.
* platform/chromium-mac-lion/fast/text/international/text-combine-image-test-expected.txt: Copied from LayoutTests/platform/chromium-mac/fast/text/international/text-combine-image-test-expected.txt.
* platform/chromium-mac-lion/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png.
* platform/chromium-mac-lion/fast/writing-mode/border-vertical-lr-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/border-vertical-lr-expected.png.
* platform/chromium-mac-lion/fast/writing-mode/border-vertical-lr-expected.txt: Added.
* platform/chromium-mac-lion/fast/writing-mode/box-shadow-horizontal-bt-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/box-shadow-horizontal-bt-expected.png.
* platform/chromium-mac-lion/fast/writing-mode/box-shadow-vertical-lr-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/box-shadow-vertical-lr-expected.png.
* platform/chromium-mac-lion/fast/writing-mode/box-shadow-vertical-rl-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/box-shadow-vertical-rl-expected.png.
* platform/chromium-mac-lion/fast/writing-mode/broken-ideographic-font-expected.png: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/broken-ideographic-font-expected.png.
* platform/chromium-mac-lion/fast/writing-mode/broken-ideographic-font-expected.txt: Copied from LayoutTests/platform/chromium-mac/fast/writing-mode/broken-ideographic-font-expected.txt.
* platform/chromium-mac-lion/platform/chromium/fast/forms/color/color-suggestion-picker-appearance-expected.png: Copied from LayoutTests/platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-appearance-expected.png.
* platform/chromium-mac-lion/platform/chromium/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png: Copied from LayoutTests/platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png.
* platform/chromium-mac-lion/platform/chromium/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png: Copied from LayoutTests/platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png.
* platform/chromium-mac-lion/platform/chromium/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png: Copied from LayoutTests/platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png.
* platform/chromium-mac-lion/platform/chromium/fast/text/text-stroke-with-border-expected.png: Copied from LayoutTests/platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.png.
* platform/chromium-mac-lion/svg/custom/foreign-object-skew-expected.png: Copied from LayoutTests/platform/chromium-mac/svg/custom/foreign-object-skew-expected.png.
* platform/chromium-mac-lion/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png: Copied from LayoutTests/platform/chromium-mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png.
* platform/chromium-mac-lion/svg/hixie/perf/007-expected.png: Copied from LayoutTests/platform/chromium-mac/svg/hixie/perf/007-expected.png.
* platform/chromium-mac-lion/tables/mozilla/bugs/bug11026-expected.png: Copied from LayoutTests/platform/chromium-mac/tables/mozilla/bugs/bug11026-expected.png.
* platform/chromium-mac/compositing/color-matching/image-color-matching-expected.png:
* platform/chromium-mac/compositing/direct-image-compositing-expected.png:
* platform/chromium-mac/compositing/geometry/clipping-foreground-expected.png:
* platform/chromium-mac/fast/dynamic/text-combine-expected.png:
* platform/chromium-mac/fast/dynamic/text-combine-expected.txt: Added.
* platform/chromium-mac/fast/ruby/base-shorter-than-text-expected.png:
* platform/chromium-mac/fast/ruby/base-shorter-than-text-expected.txt:
* platform/chromium-mac/fast/text/emphasis-combined-text-expected.png:
* platform/chromium-mac/fast/text/emphasis-combined-text-expected.txt: Added.
* platform/chromium-mac/fast/text/emphasis-expected.png:
* platform/chromium-mac/fast/text/international/text-combine-image-test-expected.png:
* platform/chromium-mac/fast/text/international/text-combine-image-test-expected.txt:
* platform/chromium-mac/fast/writing-mode/border-radius-clipping-vertical-lr-expected.png:
* platform/chromium-mac/fast/writing-mode/border-vertical-lr-expected.png:
* platform/chromium-mac/fast/writing-mode/border-vertical-lr-expected.txt: Added.
* platform/chromium-mac/fast/writing-mode/box-shadow-horizontal-bt-expected.png:
* platform/chromium-mac/fast/writing-mode/box-shadow-vertical-lr-expected.png:
* platform/chromium-mac/fast/writing-mode/box-shadow-vertical-rl-expected.png:
* platform/chromium-mac/fast/writing-mode/broken-ideographic-font-expected.png:
* platform/chromium-mac/fast/writing-mode/broken-ideographic-font-expected.txt:
* platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-appearance-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/color/color-suggestion-picker-with-scrollbar-appearance-expected.png:
* platform/chromium-mac/platform/chromium/fast/text/text-stroke-with-border-expected.png:
* platform/chromium-mac/svg/custom/foreign-object-skew-expected.png:
* platform/chromium-mac/svg/custom/getscreenctm-in-scrollable-div-area-nested-expected.png:
* platform/chromium-mac/svg/hixie/perf/007-expected.png:
* platform/chromium-mac/tables/mozilla/bugs/bug11026-expected.png:
* platform/chromium-mac/tables/mozilla/collapsing_borders/bug41262-3-expected.png:
* platform/chromium-mac/tables/mozilla/core/bloomberg-expected.png:
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Add new baselines after r134435
https://bugs.webkit.org/show_bug.cgi?id=102125

Unreviewed gardening.

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-11-13

* platform/efl-wk1/dom/xhtml/level3/core/documentnormalizedocument10-expected.txt: Added.
* platform/efl-wk1/fast/dom/DOMException/prototype-object-expected.txt: Added.
* platform/efl-wk1/fast/dom/DOMException/stack-trace-expected.txt: Added.
* platform/efl-wk2/dom/xhtml/level3/core/documentnormalizedocument10-expected.txt: Added.
* platform/efl-wk2/fast/dom/DOMException/prototype-object-expected.txt: Added.
* platform/efl-wk2/fast/dom/DOMException/stack-trace-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS @charset parsing is too loose, doesn't match other browsers
https://bugs.webkit.org/show_bug.cgi?id=101527

Patch by Tab Atkins <jackalmage@gmail.com> on 2012-11-13
Reviewed by Alexey Proskuryakov.

Source/WebCore:

Per <https://www.w3.org/Bugs/Public/show_bug.cgi?id=19882#attach_1244>,
IE and FF have changed to be strict about @charset parsing,
as the CSS 2.1 spec requires.
Since @charset use is very uncommon anyway,
we should match the new behavior and the spec for platform consistency.

Test: fast/encoding/css-charset-evil/css-charset-evil.html

* loader/TextResourceDecoder.cpp:
(WebCore::bytesEqual):
(WebCore::TextResourceDecoder::checkForCSSCharset):

LayoutTests:

Removed the old css-charset-evil.html test,
which tested for our loose parsing of @charset.
Now that we're tightening our parsing to match the spec and IE's and FF's new behavior,
I added a more comprehensive test of incorrect @charset rules,
to ensure that we correctly reject them.

* fast/encoding/css-charset-evil-expected.txt: Removed.
* fast/encoding/css-charset-evil.css: Removed.
* fast/encoding/css-charset-evil.html: Removed.
* fast/encoding/css-charset-evil/css-charset-evil-a1.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-a2.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-a3.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-a4.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b1.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b2.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b3.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b4.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b5.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b6.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b7.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-b8.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-c1.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-c2.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-c3.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-d1.css: Added.
* fast/encoding/css-charset-evil/css-charset-evil-expected.txt: Added.
* fast/encoding/css-charset-evil/css-charset-evil.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update chromium-mac-lion baselines after r134516. Unreviewed.

* platform/chromium-mac-lion/compositing/color-matching/image-color-matching-expected.png:
* platform/chromium-mac-lion/tables/mozilla/collapsing_borders/bug41262-3-expected.png: Added.
* platform/chromium-mac-lion/tables/mozilla/core/bloomberg-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sever Chromium's dependence on WebKitSystemInterface media control drawing functions in RenderThemeMac
https://bugs.webkit.org/show_bug.cgi?id=101634

Patch by Robert Sesek <rsesek@chromium.org> on 2012-11-13
Reviewed by Adam Barth.

This splits out the common methods between RenderThemeMac and RenderThemeChromiumMac
into RenderThemeMacShared.

No new tests, just refactoring.

* WebCore.gyp/WebCore.gyp: Remove RenderThemeMac.mm from platform/ sources list, since it's part of rendering/
* WebCore.gypi: Add RenderThemeMacShared.{h,mm}
* WebCore.xcodeproj/project.pbxproj: Add RenderThemeMacShared.{h,mm}
* rendering/RenderThemeChromiumMac.h:
* rendering/RenderThemeChromiumMac.mm:
(WebCore::RenderThemeChromiumMac::popupInternalPaddingLeft):
(WebCore::RenderThemeChromiumMac::popupInternalPaddingRight):
(WebCore::RenderThemeChromiumMac::extraDefaultStyleSheet):
* rendering/RenderThemeMac.h:
(RenderThemeMac):
* rendering/RenderThemeMac.mm:
(WebCore):
(WebCore::RenderTheme::themeForPage):
(WebCore::RenderThemeMac::create):
(WebCore::RenderThemeMac::RenderThemeMac):
(WebCore::RenderThemeMac::~RenderThemeMac):
(WebCore::RenderThemeMac::documentViewFor):
(WebCore::mediaControllerTheme):
(WebCore::RenderThemeMac::paintMediaSliderTrack):
(WebCore::RenderThemeMac::paintMediaRewindButton):
(WebCore::RenderThemeMac::paintMediaReturnToRealtimeButton):
(WebCore::RenderThemeMac::paintMediaFullScreenVolumeSliderTrack):
(WebCore::RenderThemeMac::paintMediaFullScreenVolumeSliderThumb):
(WebCore::RenderThemeMac::extraMediaControlsStyleSheet):
(WebCore::RenderThemeMac::extraFullScreenStyleSheet):
* rendering/RenderThemeMacShared.h: Copied from Source/WebCore/rendering/RenderThemeMac.h.
(WebCore):
(RenderThemeMacShared):
(WebCore::RenderThemeMacShared::supportsControlTints):
(WebCore::RenderThemeMacShared::scrollbarControlSizeForPart):
(WebCore::RenderThemeMacShared::supportsSelectionForegroundColors):
(WebCore::RenderThemeMacShared::supportsClosedCaptioning):
(WebCore::RenderThemeMacShared::updateActiveState):
* rendering/RenderThemeMacShared.mm: Copied from Source/WebCore/rendering/RenderThemeMac.mm.
(-[WebCoreRenderThemeNotificationObserver initWithTheme:WebCore::]):
(-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]):
(-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
(WebCore):
(WebCore::RenderThemeMacShared::RenderThemeMacShared):
(WebCore::RenderThemeMacShared::~RenderThemeMacShared):
(WebCore::RenderThemeMacShared::platformActiveSelectionBackgroundColor):
(WebCore::RenderThemeMacShared::platformInactiveSelectionBackgroundColor):
(WebCore::RenderThemeMacShared::platformActiveListBoxSelectionBackgroundColor):
(WebCore::RenderThemeMacShared::platformActiveListBoxSelectionForegroundColor):
(WebCore::RenderThemeMacShared::platformInactiveListBoxSelectionForegroundColor):
(WebCore::RenderThemeMacShared::platformFocusRingColor):
(WebCore::RenderThemeMacShared::platformInactiveListBoxSelectionBackgroundColor):
(WebCore::toFontWeight):
(WebCore::RenderThemeMacShared::systemFont):
(WebCore::convertNSColorToColor):
(WebCore::menuBackgroundColor):
(WebCore::RenderThemeMacShared::platformColorsDidChange):
(WebCore::RenderThemeMacShared::systemColor):
(WebCore::RenderThemeMacShared::usesTestModeFocusRingColor):
(WebCore::RenderThemeMacShared::isControlStyled):
(WebCore::RenderThemeMacShared::adjustRepaintRect):
(WebCore::RenderThemeMacShared::inflateRect):
(WebCore::RenderThemeMacShared::convertToPaintingRect):
(WebCore::RenderThemeMacShared::updateCheckedState):
(WebCore::RenderThemeMacShared::updateEnabledState):
(WebCore::RenderThemeMacShared::updateFocusedState):
(WebCore::RenderThemeMacShared::updatePressedState):
(WebCore::RenderThemeMacShared::controlSupportsTints):
(WebCore::RenderThemeMacShared::controlSizeForFont):
(WebCore::RenderThemeMacShared::setControlSize):
(WebCore::RenderThemeMacShared::sizeForFont):
(WebCore::RenderThemeMacShared::sizeForSystemFont):
(WebCore::RenderThemeMacShared::setSizeFromFont):
(WebCore::RenderThemeMacShared::setFontFromControlSize):
(WebCore::RenderThemeMacShared::controlSizeForSystemFont):
(WebCore::RenderThemeMacShared::paintTextField):
(WebCore::RenderThemeMacShared::adjustTextFieldStyle):
(WebCore::RenderThemeMacShared::paintCapsLockIndicator):
(WebCore::RenderThemeMacShared::paintTextArea):
(WebCore::RenderThemeMacShared::adjustTextAreaStyle):
(WebCore::RenderThemeMacShared::popupButtonMargins):
(WebCore::RenderThemeMacShared::popupButtonSizes):
(WebCore::RenderThemeMacShared::popupButtonPadding):
(WebCore::RenderThemeMacShared::paintMenuList):
(WebCore::RenderThemeMacShared::meterSizeForBounds):
(WebCore::RenderThemeMacShared::paintMeter):
(WebCore::RenderThemeMacShared::supportsMeter):
(WebCore::RenderThemeMacShared::levelIndicatorStyleFor):
(WebCore::RenderThemeMacShared::levelIndicatorFor):
(WebCore::RenderThemeMacShared::progressBarSizes):
(WebCore::RenderThemeMacShared::progressBarMargins):
(WebCore::RenderThemeMacShared::minimumProgressBarHeight):
(WebCore::RenderThemeMacShared::animationRepeatIntervalForProgressBar):
(WebCore::RenderThemeMacShared::animationDurationForProgressBar):
(WebCore::RenderThemeMacShared::adjustProgressBarStyle):
(WebCore::RenderThemeMacShared::paintProgressBar):
(WebCore::TopGradientInterpolate):
(WebCore::BottomGradientInterpolate):
(WebCore::MainGradientInterpolate):
(WebCore::TrackGradientInterpolate):
(WebCore::RenderThemeMacShared::paintMenuListButtonGradients):
(WebCore::RenderThemeMacShared::paintMenuListButton):
(WebCore::menuListButtonSizes):
(WebCore::RenderThemeMacShared::adjustMenuListStyle):
(WebCore::RenderThemeMacShared::popupInternalPaddingLeft):
(WebCore::RenderThemeMacShared::popupInternalPaddingRight):
(WebCore::RenderThemeMacShared::popupInternalPaddingTop):
(WebCore::RenderThemeMacShared::popupInternalPaddingBottom):
(WebCore::RenderThemeMacShared::adjustMenuListButtonStyle):
(WebCore::RenderThemeMacShared::setPopupButtonCellState):
(WebCore::RenderThemeMacShared::menuListSizes):
(WebCore::RenderThemeMacShared::minimumMenuListSize):
(WebCore::RenderThemeMacShared::adjustSliderTrackStyle):
(WebCore::RenderThemeMacShared::paintSliderTrack):
(WebCore::RenderThemeMacShared::adjustSliderThumbStyle):
(WebCore::RenderThemeMacShared::paintSliderThumb):
(WebCore::RenderThemeMacShared::paintSearchField):
(WebCore::RenderThemeMacShared::setSearchCellState):
(WebCore::RenderThemeMacShared::searchFieldSizes):
(WebCore::RenderThemeMacShared::setSearchFieldSize):
(WebCore::RenderThemeMacShared::adjustSearchFieldStyle):
(WebCore::RenderThemeMacShared::paintSearchFieldCancelButton):
(WebCore::RenderThemeMacShared::cancelButtonSizes):
(WebCore::RenderThemeMacShared::adjustSearchFieldCancelButtonStyle):
(WebCore::RenderThemeMacShared::resultsButtonSizes):
(WebCore::RenderThemeMacShared::adjustSearchFieldDecorationStyle):
(WebCore::RenderThemeMacShared::paintSearchFieldDecoration):
(WebCore::RenderThemeMacShared::adjustSearchFieldResultsDecorationStyle):
(WebCore::RenderThemeMacShared::paintSearchFieldResultsDecoration):
(WebCore::RenderThemeMacShared::adjustSearchFieldResultsButtonStyle):
(WebCore::RenderThemeMacShared::paintSearchFieldResultsButton):
(WebCore::RenderThemeMacShared::sliderTickSize):
(WebCore::RenderThemeMacShared::sliderTickOffsetFromTrackCenter):
(WebCore::RenderThemeMacShared::adjustSliderThumbSize):
(WebCore::RenderThemeMacShared::shouldShowPlaceholderWhenFocused):
(WebCore::RenderThemeMacShared::popupButton):
(WebCore::RenderThemeMacShared::search):
(WebCore::RenderThemeMacShared::searchMenuTemplate):
(WebCore::RenderThemeMacShared::sliderThumbHorizontal):
(WebCore::RenderThemeMacShared::sliderThumbVertical):
(WebCore::RenderThemeMacShared::textField):
(WebCore::RenderThemeMacShared::fileListNameForWidth):
(WebCore::RenderThemeMacShared::paintPlugInSnapshotOverlay):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Revert r134474; turns out these tests were failing.

I need to figure out what's going on here ...

* platform/chromium-linux/fast/text/zero-font-size-2-expected.png: Removed.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r134328) - ASSERT(isMainThread()) when subresources redirect in the NetworkProcessPass through
https://bugs.webkit.org/show_bug.cgi?id=102167

Reviewed by Simon Fraser.

willSendRequest comes in on a background thread but we need to do HostRecord accounting on the main thread.

So we'll just dispatch the receivedRedirect call to the main thread RunLoop.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::willSendRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add DOMRequestState to maintain world/ScriptExecutionContext state
https://bugs.webkit.org/show_bug.cgi?id=102102

Reviewed by Adam Barth.

Introduce DOMRequestState, and convert IndexedDB over.

No new tests, this is an abstraction layer for existing code.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::dispatchEvent):
* Modules/indexeddb/IDBRequest.h:
(IDBRequest):
* WebCore.gypi:
* bindings/v8/DOMRequestState.h: Added.
(WebCore):
(DOMRequestState):
(WebCore::DOMRequestState::DOMRequestState):
(Scope):
(WebCore::DOMRequestState::Scope::Scope):
(WebCore::DOMRequestState::scope):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Refactor theme font lookup into a factory
https://bugs.webkit.org/show_bug.cgi?id=101949

Patch by Scott Violet <sky@chromium.org> on 2012-11-13
Reviewed by Tony Chang.

This will ultimately allow us to use what is currently in RenderThemeChromiumLinux on windows.

No new tests. Refactoring only.

* WebCore.gyp/WebCore.gyp:
* WebCore.gypi:
* rendering/RenderThemeChromiumFontProvider.cpp: Added.
(WebCore):
(WebCore::RenderThemeChromiumFontProvider::defaultGUIFont): Moved into RenderThemeFontProvider.
* rendering/RenderThemeChromiumFontProvider.h: Added.
(WTF):
(WebCore):
(RenderThemeChromiumFontProvider): This is the font related methods.
* rendering/RenderThemeChromiumFontProviderLinux.cpp: Added.
(WebCore):
(WebCore::RenderThemeChromiumFontProvider::setDefaultFontSize): What was in RenderThemeChromiumSkia::setDefaultFontSize.
(WebCore::RenderThemeChromiumFontProvider::systemFont): What was in RenderThemeChromiumSkia::systemFont.
* rendering/RenderThemeChromiumFontProviderWin.cpp: Added.
(WebCore):
(WebCore::pointsToPixels): Moved from RenderThemeChromiumWin.
(WebCore::getNonClientMetrics): Moved from RenderThemeChromiumWin.
(WebCore::systemFontSize): Moved from RenderThemeChromiumWin.
(WebCore::RenderThemeChromiumFontProvider::systemFont): Moved from RenderThemeChromiumWin.
(WebCore::RenderThemeChromiumFontProvider::setDefaultFontSize): Moved from RenderThemeChromiumWin.
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::RenderThemeChromiumSkia): Moved into RenderThemeFontProvider.
(WebCore::RenderThemeChromiumSkia::systemFont): Calls to RenderThemeChromiumFontProvider.
(WebCore::RenderThemeChromiumSkia::setDefaultFontSize): Calls to RenderThemeChromiumFontProvider.
* rendering/RenderThemeChromiumSkia.h:
(RenderThemeChromiumSkia): Moves defaultFontSize into RenderThemeChromiumFontProvider.
* rendering/RenderThemeChromiumWin.cpp: Moves font code into RenderThemeFontProviderWin.
(WebCore):
* rendering/RenderThemeChromiumWin.h: Removed overriden methods now handled by RenderThemeChromiumSkia.
(RenderThemeChromiumWin):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Notify embedder of lost contexts and allow overriding of WebGL support
https://bugs.webkit.org/show_bug.cgi?id=101826

Reviewed by Adam Barth.

Source/WebCore:

Add hooks notifying the embedder when OpenGL contexts are lost and
allowing overriding of WebGL support on a per-frame basis.

No tests yet; don't know how to test this solely within WebKit.
Currently developing tests in the Chromium port exercising the
notifications end-to-end. Once those are in place, I'm prepared to
investigate adding tests for all ports.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore):
(WebCore::WebGLRenderingContext::create):
  Check whether embedder vetoes creation of new WebGL contexts.
(WebCore::WebGLRenderingContext::loseContextImpl):
  Notify embedder that context was lost.
(WebCore::WebGLRenderingContext::maybeRestoreContext):
  Check whether embedder vetoes restoration of existing WebGL contexts.
* loader/FrameLoaderClient.h:
(FrameLoaderClient):
(WebCore::FrameLoaderClient::allowWebGL):
(WebCore::FrameLoaderClient::didLoseWebGLContext):
  Hooks notifying embedder of lost contexts and asking permission to run WebGL.

Source/WebKit/chromium:

Expose new FrameLoaderClient hooks through Chromium's
WebPermissionClient and WebFrameClient. Downstream browser tests
will exercise this new functionality.

* public/WebFrameClient.h:
(WebFrameClient):
(WebKit::WebFrameClient::didLoseWebGLContext):
* public/WebPermissionClient.h:
(WebPermissionClient):
(WebKit::WebPermissionClient::allowWebGL):
* src/FrameLoaderClientImpl.cpp:
(WebKit):
(WebKit::FrameLoaderClientImpl::allowWebGL):
(WebKit::FrameLoaderClientImpl::didLoseWebGLContext):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Automatically run small plugins
https://bugs.webkit.org/show_bug.cgi?id=102148
<rdar://problem/12695560>

Reviewed by Darin Adler.

* rendering/RenderEmbeddedObject.h: Promote layout() to protected.
* rendering/RenderSnapshottedPlugIn.cpp: Add constants for threshold size for plugins that will auto-start.
(WebCore::RenderSnapshottedPlugIn::layout): After layout, obtain the width and height of the element.
If either dimension is 0, or the overall size of the plugin is smaller that the threshold size, move the
display state to Playing. Assuming we will always layout before first paint, changing the state here
should be safe.
* rendering/RenderSnapshottedPlugIn.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Add missing ENABLE(SVG) test in header
https://bugs.webkit.org/show_bug.cgi?id=102143

Reviewed by Kentaro Hara.

Need to wrap the #include of a header that's only conditionally generated.

Fixes build error if compiling e.g. w/ GYP_DEFINES="enable_svg=0"

* bindings/v8/custom/V8ElementCustom.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable frame loading instead of throwing exceptions on subtree modifications in ChildFrameDisconnector
https://bugs.webkit.org/show_bug.cgi?id=102012

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-11-13
Reviewed by Ojan Vafai.

Source/WebCore:

Previously if you modified the subtree that was being removed from a
removeChild from inside an unload handler on an <iframe> inside the
subtree you'd get an exception which is wrong. Instead we just need to
disable all frame loading there.

This works because either the subtree will be removed and the frame never
loading doesn't matter, or some section of the subtree that contains the
frame will be moved to another part of the document which will cause the
frame to load when it's inserted there.

I also added a check for <object> elements. It doesn't seem this is actually
reachable in the existing code, but I'm not entirely sure since the frame
loading and object/plugin handling is very confusing.

A better fix could be to repeatedly walk the subtree until all frames
were disconnected or some iteration limit was hit and then force all leftover
subframes to disconnect without firing unload handlers but this is such an
edge case I don't think the complexity is necessary.

Test: fast/frames/modifications-in-subtree-unload.html

* dom/ContainerNodeAlgorithms.h:
(WebCore::ChildFrameDisconnector::ChildFrameDisconnector):
(WebCore::ChildFrameDisconnector::~ChildFrameDisconnector):
(ChildFrameDisconnector):
(WebCore::ChildFrameDisconnector::disconnect):
* dom/Node.cpp:
(WebCore::checkAcceptChild): Removed exception.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Check canLoadFrame().
* html/HTMLFrameOwnerElement.h:
(SubframeLoadingDisabler):
(WebCore::SubframeLoadingDisabler::SubframeLoadingDisabler):
(WebCore::SubframeLoadingDisabler::~SubframeLoadingDisabler):
(WebCore::SubframeLoadingDisabler::canLoadFrame):
  Returns true if frames can be loaded in the subtree.
(WebCore::SubframeLoadingDisabler::disabledSubtreeRoots):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget):
  Check canLoadFrame(). I think this case is impossible, but it's better
  to be safe than sorry later.

LayoutTests:

Remove console log output from the exception we no longer throw. Since we no
longer throw an exception we don't need a platform specific output file either.

Also add a test that we don't throw an exception during modifications to subtrees
during unload.

* fast/frames/modifications-in-subtree-unload-expected.html: Added.
* fast/frames/modifications-in-subtree-unload.html: Added.
* fast/frames/out-of-document-iframe-has-child-frame-expected.txt:
* platform/chromium/fast/frames/out-of-document-iframe-has-child-frame-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Run multiple tasks per transaction tick
https://bugs.webkit.org/show_bug.cgi?id=97738

Reviewed by Tony Chang.

Process multiple tasks from the pending queue(s) when the timer fires. The
task may initiate new tasks that change which queue is active (e.g. indexing
operations) so the loop must re-check each tick which queue to use.

In DumpRenderTree, time to make 20k puts/20k gets dropped from 3.2s to 2.0s (-37%);
in Chromium's content_shell, the time dropped from 8.1s to 4.6s (-42%).

No new tests - just perf improvements, covered by (nearly) all existing IDB tests.

* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::abort): Use takeFirst() to clean up code.
(WebCore::IDBTransactionBackendImpl::taskTimerFired): Process as many tasks as are available.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134529 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: InvalidCharacterError
https://bugs.webkit.org/show_bug.cgi?id=102128

Reviewed by Darin Adler.

Source/WebCore:

Patch 5 of 25 to update DOMException name to match the spec and Firefox.

Updated existing tests.

* dom/DOMCoreException.cpp:

LayoutTests:

Updated tests and expectations.

* fast/dom/Document/createElement-invalid-names-expected.txt:
* fast/dom/Document/createElement-invalid-names.html:
* fast/dom/Element/prefix-setter-exception-expected.txt:
* fast/dom/Window/atob-btoa-expected.txt:
* fast/dom/dataset-expected.txt:
* fast/dom/dataset-xhtml-expected.txt:
* fast/dom/script-tests/dataset-xhtml.js:
* fast/dom/script-tests/dataset.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Coordinated Graphics: Rename m_CoordinatedGraphicsLayerClient to m_coordinator
https://bugs.webkit.org/show_bug.cgi?id=102133

Renamed m_CoordinatedGraphicsLayerClient to m_coordinator.
Also, there is no need for calling setCoordinator every time the tree changes,
since we can call it once when the layer is created, now that LayerTreeCoordinator
is the GraphicsLayerFactory.

Reviewed by Kenneth Rohde Christiansen.

No change in functionality.

* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::setChildren):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setContentsToImage):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingState):
(WebCore::CoordinatedGraphicsLayer::syncChildren):
(WebCore::CoordinatedGraphicsLayer::syncFilters):
(WebCore::CoordinatedGraphicsLayer::syncLayerState):
(WebCore::CoordinatedGraphicsLayer::syncAnimations):
(WebCore::CoordinatedGraphicsLayer::syncCanvas):
(WebCore::CoordinatedGraphicsLayer::ensureImageBackingStore):
(WebCore::CoordinatedGraphicsLayer::tiledBackingStoreUpdatesAllowed):
(WebCore::CoordinatedGraphicsLayer::tiledBackingStoreVisibleRect):
(WebCore::CoordinatedGraphicsLayer::beginContentUpdate):
(WebCore::CoordinatedGraphicsLayer::createTile):
(WebCore::CoordinatedGraphicsLayer::updateTile):
(WebCore::CoordinatedGraphicsLayer::removeTile):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
(WebCore::CoordinatedGraphicsLayer::setCoordinator):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
(CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::~LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::LayerTreeCoordinator):
(WebKit::LayerTreeCoordinator::paintContents):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134531 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Plumb WebCompositorSupport settings through WebLayerTreeSettings as well, in preparation for removing the settings from WebCompositorSupport
https://bugs.webkit.org/show_bug.cgi?id=102146

Reviewed by James Robinson.

Source/Platform:

Add accelerated animation and per-tile painting to the
WebLayerTreeView structure.

* chromium/public/WebCompositorSupport.h:
(WebCompositorSupport):
* chromium/public/WebLayerTreeView.h:
(WebKit::WebLayerTreeView::Settings::Settings):
(Settings):

Source/WebKit/chromium:

Add accelerated animation and per-tile painting to the WebSettings structure.

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::setAcceleratedAnimationEnabled):
(WebKit):
(WebKit::WebSettingsImpl::setPerTilePaintingEnabled):
* src/WebSettingsImpl.h:
(WebSettingsImpl):
(WebKit::WebSettingsImpl::gestureTapHighlightEnabled):
(WebKit::WebSettingsImpl::doubleTapToZoomEnabled):
(WebKit::WebSettingsImpl::perTilePaintingEnabled):
(WebKit::WebSettingsImpl::acceleratedAnimationEnabled):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit):

Tools:

Pass settings that go through WebCompositorSupport also through
WebLayerTreeSettings. When the compositor starts using those instead,
we can remove the callers to the WebCompositorSupport setters.

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):
(TestShell::resetWebSettings):
(TestShell::setPerTilePaintingEnabled):
(TestShell::setAcceleratedAnimationEnabled):
* DumpRenderTree/chromium/TestShell.h:
(TestShell):
* DumpRenderTree/chromium/WebPreferences.cpp:
(WebPreferences::applyTo):
* DumpRenderTree/chromium/WebPreferences.h:
(WebPreferences):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: non-trivial test conversion batch 2
https://bugs.webkit.org/show_bug.cgi?id=101998

Reviewed by Tony Chang.

* storage/indexeddb/cursor-overloads-expected.txt:
* storage/indexeddb/cursor-overloads.html:
  Trivial conversion that I missed last time around.

* storage/indexeddb/database-basics-expected.txt:
* storage/indexeddb/database-close-expected.txt:
* storage/indexeddb/database-closepending-flag-expected.txt:
* storage/indexeddb/delete-closed-database-object-expected.txt:
* storage/indexeddb/resources/database-basics.js:
  Removed test that shows calling setVersion inside a version change
  transaction is an error. Replaced with test showing same error for a
  generic transaction.

* storage/indexeddb/resources/database-close.js:
  Formerly used both unblocked setVersion and deleteDatabase to signal
  that a connection was closed, now just used deleteDatabase.

* storage/indexeddb/resources/database-closepending-flag.js:
  Straightforward, it just has multiple opens.


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