Add some debug logging to an API test that's failing on Mountain Lion.

* TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
(-[DownloadDelegate _download:didReceiveResponse:]):
(-[DownloadDelegate _downloadDidFinish:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AST incorrectly conflates readable and writable locations
https://bugs.webkit.org/show_bug.cgi?id=130734

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

We need to distinguish between "locations" that are valid for reading
and writing, vs those that may only be written.

* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitBytecode):
(JSC::ForOfNode::emitBytecode):
* parser/Nodes.h:
(JSC::ExpressionNode::isAssignmentLocation):

LayoutTests:

More tests

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Begin stubbing out a WKWindowFeatures class
https://bugs.webkit.org/show_bug.cgi?id=130733

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWindowFeatures.h: Added.
* UIProcess/API/Cocoa/WKWindowFeatures.mm: Added.
(-[WKWindowFeatures _initWithWindowFeatures:WebCore::]):
(-[WKWindowFeatures x]):
(-[WKWindowFeatures y]):
(-[WKWindowFeatures width]):
(-[WKWindowFeatures height]):
* UIProcess/API/Cocoa/WKWindowFeaturesInternal.h: Added.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
InlineIterator position (unsigned int) variable can wrap around
https://bugs.webkit.org/show_bug.cgi?id=130540

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2014-03-25
Reviewed by Simon Fraser.

Source/WebCore:

We trigger an ASSERT that occurs when we are ignoring spaces (to collapse them
into a single whitespace mark) but then encounter a line break. Because we don't ignore
the first space (but do ignore subsequent spaces), when we hit a newline in an RTL context
we want to ignore that first space as well (so as not to push the text away from the right
edge). We do this by decrementing the InlineIterator pointing to this first space, so all
the spaces get ignored. However, if that space is the first character in a Text node, the
decrement will try to go past the beginning of the node, and trigger an ASSERT.

This design is not great. At some point we should rework it to more elegantly handle
collapsing whitespace in both RTL and LTR writing modes.

This patch adds an ASSERT earlier in this codepath to catch potential problems earlier.
It also pulls our sentinel value out into a separate boolean to make it more clear what is
going on.

Test: fast/text/whitespace-only-text-in-rtl.html

* rendering/InlineIterator.h:
(WebCore::InlineIterator::moveTo): Use the set***() calls
(WebCore::InlineIterator::setOffset): ASSERT early that our math hasn't wrapped
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::appendRunsForObject): Use new boolean value
* rendering/line/BreakingContextInlineHeaders.h:
(WebCore::BreakingContext::handleText): Guard against wraps
(WebCore::checkMidpoints): Use new boolean value
* rendering/line/TrailingObjects.cpp:
(WebCore::TrailingObjects::updateMidpointsForTrailingBoxes): Use new boolean value

LayoutTests:

This test triggers an ASSERT that occurs when we are ignoring spaces (to collapse them
into a single whitespace mark) but then encounter a line break. Because we don't ignore
the first space (but do ignore subsequent spaces), when we hit a newline in an RTL context
we want to ignore that first space as well (so as not to push the text away from the right
edge). We do this by decrementing the InlineIterator pointing to this first space, so all
the spaces get ignored. However, if that space is the first character in a Text node, the
decrement will try to go past the beginning of the node, and trigger an ASSERT.

This design is not great. At some point we should rework it to more elegantly handle
collapsing whitespace in both RTL and LTR writing modes.

* fast/text/whitespace-only-text-in-rtl-expected.txt: Added.
* fast/text/whitespace-only-text-in-rtl.html: Added.

Conflicts:
	LayoutTests/ChangeLog
	Source/WebCore/ChangeLog

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement ImageData constructors and WebWorkers exposure
https://bugs.webkit.org/show_bug.cgi?id=130668

Reviewed by Dean Jackson.

Source/WebCore:

Add new constructors for ImageData.

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#pixel-manipulation

Test: fast/canvas/canvas-imageData.html

* html/ImageData.cpp:
(WebCore::ImageData::create):
* html/ImageData.h:
* html/ImageData.idl:

LayoutTests:

Tests for ImageData constructors. Remove a false tests for constructors
from Philip's test suite.

* fast/canvas/canvas-imageData-expected.txt: Added.
* fast/canvas/canvas-imageData.html: Added.
* fast/canvas/script-tests/canvas-imageData.js: Added.
(testTransparentBlack):
* LayoutTests/canvas/philip/tests/2d.imageData.object.ctor.html: Removed.
* LayoutTests/canvas/philip/tests/2d.imageData.object.ctor-expected.txt: Removed.
* LayoutTests/js/dom/global-constructors-attributes-dedicated-worker-expected.txt
* LayoutTests/js/dom/global-constructors-attributes-shared-worker-expected.txt


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166246 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Playing video does not disable display sleep.
https://bugs.webkit.org/show_bug.cgi?id=130729

Reviewed by Eric Carlson.

DisplaySleepDisabler was broken by r161589, which replaced the iOS implementation with
an empty one. Make a platform independent version with a Cocoa-platform subclass. Update
the APIs to non-deprecated ones.

* platform/DisplaySleepDisabler.cpp: Added.
(WebCore::DisplaySleepDisabler::create):
* platform/DisplaySleepDisabler.h: Added.
(WebCore::DisplaySleepDisabler::~DisplaySleepDisabler):
(WebCore::DisplaySleepDisabler::DisplaySleepDisabler):
* platform/cocoa/DisplaySleepDisablerCocoa.cpp: Renamed from Source/WebCore/platform/mac/DisplaySleepDisabler.cpp.
(WebCore::DisplaySleepDisabler::create):
(WebCore::DisplaySleepDisablerCocoa::DisplaySleepDisablerCocoa):
(WebCore::DisplaySleepDisablerCocoa::~DisplaySleepDisablerCocoa):
* platform/cocoa/DisplaySleepDisablerCocoa.h: Renamed from Source/WebCore/platform/mac/DisplaySleepDisabler.h.

Update m_sleepDisabler to be a std::unique_ptr, and unprotect the definition of methods which use it.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateSleepDisabling):
(WebCore::HTMLMediaElement::shouldDisableSleep):
* html/HTMLMediaElement.h:

Add the new and renamed files to the project:
* CMakeLists.txt:
* GNUmakefile.list.am:
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r166126.

Rollout r166126 in prepartion to roll out prerequisite r166070

Reverted changeset:

"toThis() on a JSWorkerGlobalScope should return a JSProxy and
not undefined"
https://bugs.webkit.org/show_bug.cgi?id=130554
http://trac.webkit.org/changeset/166126


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r166070.

Rollout r166070 due to 2% performance loss in page load times

Reverted changeset:

"Change CodeGeneratorJS.pm special cases for "DOMWindow" to be
general purpose"
https://bugs.webkit.org/show_bug.cgi?id=130553
http://trac.webkit.org/changeset/166070


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166249 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Pass additional options to AVFoundation during playback.
https://bugs.webkit.org/show_bug.cgi?id=130624

Reviewed by Eric Carlson.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::doesHaveAttribute): Return attribute value if the user
passes a pointer to fill in.
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::doesHaveAttribute):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::doesHaveAttribute):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Pass additional
option if supplied by user.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166250 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix iOS build.

* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
Make WKIBActions OS X only for now.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r166247. Un-platform-protect the declaration of HTMLMediaElement::shouldDisableSleep()
and make WebVideoFullscreenController's _displaySleepDisabler a std::unique_ptr.

* html/HTMLMediaElement.h:
* platform/mac/WebVideoFullscreenController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more properties to WKWindowFeatures
https://bugs.webkit.org/show_bug.cgi?id=130738

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWindowFeatures.h:
* UIProcess/API/Cocoa/WKWindowFeatures.mm:
(-[WKWindowFeatures _initWithWindowFeatures:WebCore::]):
(-[WKWindowFeatures menuBarVisibility]):
(-[WKWindowFeatures statusBarVisibility]):
(-[WKWindowFeatures toolbarsVisibility]):
(-[WKWindowFeatures allowsResizing]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Further unreviewed build fix after r166247. Add DisplaySleepDisabler to the windows project file and
move the definition of DisplaySleepDisabler's constructor and destructor into the cpp file.

* WebCore.vcxproj/WebCore.vcxproj:
* platform/DisplaySleepDisabler.cpp:
(WebCore::DisplaySleepDisabler::DisplaySleepDisabler):
(WebCore::DisplaySleepDisabler::~DisplaySleepDisabler):
* platform/DisplaySleepDisabler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Even further unreviewed build fix after r166247. Unprotect the implementation of HTMLMediaElement::shouldDisableSleep().

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix. Typo on checkin.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Left an unmatched open bracket.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS] Inspector View Indication Support
https://bugs.webkit.org/show_bug.cgi?id=130709

Reviewed by Simon Fraser.

Source/WebCore:

* inspector/InspectorClient.h:
(WebCore::InspectorClient::showInspectorIndication):
(WebCore::InspectorClient::hideInspectorIndication):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::setIndicating):
Rename indicate/hideIndication to show/hide names.

Source/WebKit/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorClient::showInspectorIndication):
(WebInspectorClient::hideInspectorIndication):
Renamed methods.

Source/WebKit/mac:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::didSetSearchingForNode): Deleted.
(WebInspectorClient::releaseFrontend): Deleted.
* WebView/WebView.mm:
(-[WebView setShowingInspectorIndication:]):
* WebView/WebViewPrivate.h:
Renamed methods.

Source/WebKit2:

* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKInspectorIndicationView initWithFrame:]):
(-[WKContentView isShowingInspectorIndication]):
(-[WKContentView setShowingInspectorIndication:]):
(-[WKContentView _didCommitLayerTree:WebKit::]):
When indicating include a simple tinted UIView over the content.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _showInspectorIndication]):
(-[WKWebView _hideInspectorIndication]):
Have the content view show or hide an indication.

* UIProcess/PageClient.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showInspectorIndication):
(WebKit::PageClientImpl::hideInspectorIndication):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::showInspectorIndication):
(WebKit::WebPageProxy::hideInspectorIndication):
Pass WebProcess indication message up to the WKWebView.

* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
(WebKit::WebInspectorClient::indicate):
(WebKit::WebInspectorClient::hideIndication):
* WebProcess/WebCoreSupport/WebInspectorClient.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::indicate):
(WebKit::WebPage::hideIndication):
Pass WebCore / remote inspector indication message up to UIProcess.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Schemes registered as cache partitioned are not properly registered in new web processes
https://bugs.webkit.org/show_bug.cgi?id=130739

Reviewed by Anders Carlsson.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] The background of children of scrollable elements flowed into regions is not properly scrolled
https://bugs.webkit.org/show_bug.cgi?id=130574

Reviewed by David Hyatt.

Source/WebCore:

When computing the clip rect for painting the box decorations, the scrolled content offset
must be computed by going up the containing block tree, up to the region.

Tests: fast/regions/scrollable-region-scrollable-absolute-content-background.html
       fast/regions/scrollable-region-scrollable-content-background.html

* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):

LayoutTests:

Added tests for properly painting background of children of scrollable elements flowed into regions.

* fast/regions/scrollable-region-scrollable-absolute-content-background-expected.html: Added.
* fast/regions/scrollable-region-scrollable-absolute-content-background.html: Added.
* fast/regions/scrollable-region-scrollable-content-background-expected.html: Added.
* fast/regions/scrollable-region-scrollable-content-background.html: Added.


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