Inline ImageFrame width() and height()
https://bugs.webkit.org/show_bug.cgi?id=103401

Reviewed by Brent Fulgham.

Inline ImageFrame width() and height() to improve the performance of ImageFrame
function getAddr(x,y) per https://bugs.webkit.org/show_bug.cgi?id=88424#c38

No new tests. Covered by many existing tests.

* platform/image-decoders/ImageDecoder.cpp: Remove width() and height() routines
since they now inlined in the ImageFrame class definition in ImageDecoder.h.
* platform/image-decoders/ImageDecoder.h: Add inline definitions of width() and
height() for all ports.
* platform/image-decoders/skia/ImageDecoderSkia.cpp:
(WebCore::ImageFrame::width): Remove.
(WebCore::ImageFrame::height): Remove.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TextIterator unnecessarily converts 8 bit strings to 16 bits
https://bugs.webkit.org/show_bug.cgi?id=103295

Reviewed by Brent Fulgham.

Source/WebCore:

Changed TextIterator to use the contained string instead of calling characters() on that string.
Other sources of text, like emitCharacter() still use the contained UChar* buffer.
Added appendTextToStringBuilder() to append the text contents of the current iterator to a string builder
irrespective of the source of the text.

No new tests as functionality covered by existing tests.

* WebCore.exp.in: Updated plainText export and eliminated plainTextToMallocAllocatedBuffer export
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::stringForVisiblePositionRange): Updated to use TextIterator::appendTextToStringBuilder()
* editing/TextIterator.cpp:
(WebCore::TextIterator::characterAt): New function to return the indexed character of the current TextIterator
(WebCore::TextIterator::appendTextToStringBuilder): Added method to append whatever the current text to a StringBuilder
(WebCore::TextIterator::emitText): Eliminated accessing the character data via characters().
(WebCore::TextIterator::rangeFromLocationAndLength): Changed to use characterAt().
(WebCore::plainText): Combined with plainTextToMallocAllocatedBuffer().
* editing/TextIterator.h:
(WebCore::TextIterator::startOffset): New getter.
(WebCore::TextIterator::string): New getter.
(WebCore::TextIterator::characters): Updated to use correct test source.
* page/ContextMenuController.cpp:
(WebCore::selectionContainsPossibleWord): Changed to use characterAt().

Source/WebKit/mac:

Updated _stringForRange to use plainText() instead of removed plainTextToMallocAllocatedBuffer().

* WebView/WebFrame.mm:
(-[WebFrame _stringForRange:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Duplicated WebPageGroup initialization
https://bugs.webkit.org/show_bug.cgi?id=103229

Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2012-11-27
Reviewed by Gyuyoung Kim.

WebPageGroup does not need to be created in creating EwkView when the pageGroupRef is 0
because the default WebPageGroup(m_defaultPageGroup) is created in WebContext constructor.

As a side effect on the duplicated initialization, pageGroupID increases even when the EwkView
is created with default context.

* UIProcess/API/efl/ewk_view.cpp:
(createEwkView):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Test expectation update
https://bugs.webkit.org/show_bug.cgi?id=96720

* platform/chromium/TestExpectations:
datetimelocal-multiple-fields-preserve-value-after-history-back.html is flaky.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers list.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimization in image decoding
https://bugs.webkit.org/show_bug.cgi?id=88424

Patch by Viatcheslav Ostapenko <v.ostapenko@samsung.com> on 2012-11-27
Reviewed by Brent Fulgham.

Optimization in image decoding.
Reduce branching and multiplications in GIF image decoding loops and functions.
Rebase and update of original patch by Misha Tyutyunik <michael.tyuytunik@nokia.com>

Covered by existing tests.

* platform/image-decoders/gif/GIFImageDecoder.cpp:
(WebCore::GIFImageDecoder::haveDecodedRow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed, mark http/tests/canvas/canvas-slow-font-loading.html as failing on all of Mac.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Unreviewed, mark http/tests/inspector/indexeddb/database-data.html as flaky on Linux, too.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers.py.

* Scripts/webkitpy/common/config/committers.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed functionality fix, return the height in ImageFrame::height()
on non-Skia platforms.

* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageFrame::height):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135980 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve WebSocketChannel connection failure console messages.
https://bugs.webkit.org/show_bug.cgi?id=103448

Reviewed by Adam Barth.

Source/WebCore:

When a WebSocket connection fails, the current implementation of
WebSocketChannel::fail binds the generated console message to the
document's URL, but doesn't give much indication as to the connection
itself. This patch adjusts the console message to explicitly show the
URL of the failed connection to give developers a better chance of
debugging and resolving errors.

* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::fail):
    Drop the URL parameter from addConsoleMessage, in favour of adding
    the WebSocketHandshake's URL to the message text.

LayoutTests:

* http/tests/websocket/tests/hybi/bad-handshake-crash-expected.txt:
* http/tests/websocket/tests/hybi/broken-utf8-expected.txt:
* http/tests/websocket/tests/hybi/close-before-open-expected.txt:
* http/tests/websocket/tests/hybi/close-code-and-reason-expected.txt:
* http/tests/websocket/tests/hybi/close-expected.txt:
* http/tests/websocket/tests/hybi/compressed-control-frame-expected.txt:
* http/tests/websocket/tests/hybi/deflate-frame-invalid-parameter-expected.txt:
* http/tests/websocket/tests/hybi/fragmented-control-frame-expected.txt:
* http/tests/websocket/tests/hybi/handshake-error-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-extensions-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-maxlength-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-mismatch-protocol-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-more-accept-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-more-protocol-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-accept-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-connection-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-cr-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-no-upgrade-header-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null-expected.txt:
* http/tests/websocket/tests/hybi/handshake-fail-by-wrong-accept-header-expected.txt:
* http/tests/websocket/tests/hybi/interleaved-fragments-expected.txt:
* http/tests/websocket/tests/hybi/invalid-continuation-expected.txt:
* http/tests/websocket/tests/hybi/invalid-encode-length-expected.txt:
* http/tests/websocket/tests/hybi/invalid-masked-frames-from-server-expected.txt:
* http/tests/websocket/tests/hybi/long-control-frame-expected.txt:
* http/tests/websocket/tests/hybi/long-invalid-header-expected.txt:
* http/tests/websocket/tests/hybi/reserved-bits-expected.txt:
* http/tests/websocket/tests/hybi/reserved-opcodes-expected.txt:
* http/tests/websocket/tests/hybi/send-file-blob-fail-expected.txt:
* http/tests/websocket/tests/hybi/too-long-payload-expected.txt:
* http/tests/websocket/tests/hybi/websocket-event-target-expected.txt:
* http/tests/websocket/tests/hybi/workers/close-code-and-reason-expected.txt:
* http/tests/websocket/tests/hybi/workers/close-expected.txt:
    Update test expectations with the new error messages.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135981 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers list.

* Scripts/webkitpy/common/config/committers.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK1] Gardening AC testcases in efl-wk1
https://bugs.webkit.org/show_bug.cgi?id=103488

Unreviewed, EFL gardening.

efl-wk1 doesn't fully support AC.

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2012-11-28

* platform/efl-wk1/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers list.

* Scripts/webkitpy/common/config/committers.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add basic implementation for MediaStreamAudioDestinationNode
https://bugs.webkit.org/show_bug.cgi?id=101815

Reviewed by Chris Rogers.

Source/Platform:

Adds the consumer interface and related functionality to WebMediaStreamSource.

* chromium/public/WebAudioDestinationConsumer.h: Added.
(WebKit):
(WebAudioDestinationConsumer):
(WebKit::WebAudioDestinationConsumer::~WebAudioDestinationConsumer):
* chromium/public/WebMediaStreamSource.h:
(WebKit):
(WebMediaStreamSource):

Source/WebCore:

Implements an audio destination node which has a MediaStream.
This can be added to a PeerConnection with peerConnection.addStream().
Please see use case (3):
https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/webrtc-integration.html

Test: webaudio/mediastreamaudiodestinationnode.html

* Modules/webaudio/AudioContext.cpp:
(WebCore):
(WebCore::AudioContext::createMediaStreamDestination):
* Modules/webaudio/AudioContext.h:
(WebCore):
(AudioContext):
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Added.
(WebCore):
(WebCore::MediaStreamAudioDestinationNode::create):
(WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::mediaStreamSource):
(WebCore::MediaStreamAudioDestinationNode::~MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::process):
(WebCore::MediaStreamAudioDestinationNode::reset):
* Modules/webaudio/MediaStreamAudioDestinationNode.h: Added.
(WebCore):
(MediaStreamAudioDestinationNode):
(WebCore::MediaStreamAudioDestinationNode::stream):
* Modules/webaudio/MediaStreamAudioDestinationNode.idl: Added.
* WebCore.gypi:
* platform/audio/AudioDestinationConsumer.h: Copied from Source/WebCore/platform/mediastream/MediaStreamSource.cpp.
(WebCore):
(AudioDestinationConsumer):
(WebCore::AudioDestinationConsumer::~AudioDestinationConsumer):
* platform/chromium/support/WebMediaStreamSource.cpp:
(WebKit::WebMediaStreamSource::extraData):
(WebKit::WebMediaStreamSource::setExtraData):
(WebKit::WebMediaStreamSource::requiresAudioConsumer):
(WebKit):
(ConsumerWrapper):
(WebKit::ConsumerWrapper::create):
(WebKit::ConsumerWrapper::consumer):
(WebKit::ConsumerWrapper::ConsumerWrapper):
(WebKit::ConsumerWrapper::consumeAudio):
(WebKit::WebMediaStreamSource::addAudioConsumer):
(WebKit::WebMediaStreamSource::removeAudioConsumer):
* platform/mediastream/MediaStreamSource.cpp:
(WebCore::MediaStreamSource::create):
(WebCore::MediaStreamSource::MediaStreamSource):
(WebCore::MediaStreamSource::addAudioConsumer):
(WebCore):
(WebCore::MediaStreamSource::removeAudioConsumer):
(WebCore::MediaStreamSource::consumeAudio):
* platform/mediastream/MediaStreamSource.h:
(WebCore):
(MediaStreamSource):
(WebCore::MediaStreamSource::requiresAudioConsumer):
(WebCore::MediaStreamSource::audioConsumers):

Tools:

Adds a bit of code that exercises the WebKit API.

* DumpRenderTree/chromium/MockWebMediaStreamCenter.cpp:
(MockWebMediaStreamSourceConsumer):
(MockWebMediaStreamSourceConsumer::~MockWebMediaStreamSourceConsumer):
(MockWebMediaStreamCenter::didCreateMediaStream):

LayoutTests:

* webaudio/mediastreamaudiodestinationnode-expected.txt: Added.
* webaudio/mediastreamaudiodestinationnode.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Texmap] REGRESSION(r135620) QtTestBrowser crashes on Google-gravity.
https://bugs.webkit.org/show_bug.cgi?id=103410

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-28
Reviewed by Noam Rosenthal.

GraphicsLayerTextureMapper::updateBackingStore() should return early
before TextureMapper is set.

GraphicsLayer::FlushCompositingState() can be called by RenderLayerBacking. It
means this method can be called before creating TextureMapper. So
TextureMapperLayer::flushCompositingState() checks and returns early if
TextureMapper was not created.

However, GraphicsLayerTextureMapper::updateBackingStore() expects that TextureMapper
always exists. updateBackingStore should also return early when TextureMapper
was not created.

No new tests. Covered by existing tests.

* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setNeedsDisplay):
(WebCore::GraphicsLayerTextureMapper::setNeedsDisplayInRect):
(WebCore::GraphicsLayerTextureMapper::didFlushCompositingState):
(WebCore::GraphicsLayerTextureMapper::prepareBackingStore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Texmap] REGRESSION(r135620) QtTestBrowser crashes on Google-gravity.
https://bugs.webkit.org/show_bug.cgi?id=103410

Patch by Huang Dongsung <luxtella@company100.net> on 2012-11-28
Reviewed by Noam Rosenthal.

TextureMapperLayerClientQt::setTextureMapper() must call
flushCompositingStateForThisLayerOnly() of the root layer.

Currently, PageClientQGraphicsWidget::setRootGraphicsLayer does not flush layer
states of the root layer after setting TextureMapper while
PageClientQWidget::setRootGraphicsLayer() flushes them of the root layer.  If
not flushing states, descendant layers can not reach the root layer. It means
descendant layers can not reach the TextureMapper that the root layer has.

This is already the behavior for PageClientQWidget, which should be the case
for PageClientQGraphicsWidget as well.

* WebCoreSupport/PageClientQt.cpp:
(WebCore::TextureMapperLayerClientQt::setTextureMapper):
(WebCore::PageClientQWidget::setRootGraphicsLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers.py.

* Scripts/webkitpy/common/config/committers.py:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Merge tests for date pseudo classes into one
https://bugs.webkit.org/show_bug.cgi?id=103489

Reviewed by Kentaro Hara.

date-appearance-pseudo-classes.html doesn't need to be a pixel
test because "how css properties are applied" is tested in
date-appearance-basic.html. Checking querySelectorAll result is
enough to check pseudo classes support, and we can convert the
test to a dumpAsText test.

Also, we should remove type=date dependencies in
fast/css/pseudo-*.html because some platforms don't enable
INPUT_TYPE_DATE and we had better put such tests into one place,
fast/forms/date/.

* fast/css/pseudo-in-range-expected.txt:
* fast/css/pseudo-in-range-invalid-value-expected.txt:
* fast/css/pseudo-out-of-range-expected.txt:
* fast/css/script-tests/pseudo-in-range-invalid-value.js:
* fast/css/script-tests/pseudo-in-range.js:
* fast/css/script-tests/pseudo-out-of-range.js:
* fast/forms/date/date-appearance-pseudo-classes-expected.txt: Removed.
* fast/forms/date/date-appearance-pseudo-classes.html: Removed.
* fast/forms/date/date-pseudo-classes-expected.txt: Added.
* fast/forms/date/date-pseudo-classes.html: Added.
* fast/forms/resources/common-pseudo-classes.js: Added.
* platform/chromium-linux/fast/forms/date/date-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-lion/fast/forms/date/date-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac-snowleopard/fast/forms/date/date-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-mac/fast/forms/date/date-appearance-pseudo-classes-expected.png: Removed.
* platform/chromium-win/fast/forms/date/date-appearance-pseudo-classes-expected.png: Removed.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Adding myself to committers.py.

* Scripts/webkitpy/common/config/committers.py:

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