[GTK L10N] Updated Brazilian Portuguese translation for WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=120193

Patch by Enrico Nicoletto <liverig@gmail.com> on 2013-08-26
Reviewed by Gustavo Noronha Silva.

* pt_BR.po: Updated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Allow to run tests without Xvfb in run-gtk-tests
https://bugs.webkit.org/show_bug.cgi?id=120298

Reviewed by Philippe Normand.

Add --no-xvfb command line option to run tests in the current
display.

* Scripts/run-gtk-tests:
(TestRunner._run_xvfb): Return early if option --no-xvfb has been
passed.
(TestRunner._setup_testing_environment): Use helper function
_run_xvfb to start Xvfb if needed.
(TestRunner._tear_down_testing_environment): Check Xvfb is
actually running before trying to terminate it.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Include most of the WebKit2 unit tests into the build and testing
https://bugs.webkit.org/show_bug.cgi?id=120307

Reviewed by Philippe Normand.

There are still various unit test source files that are not being included into
the build. This patch includes most of these, only leaving out tests that do not
compile or test features that are not supported by the GTK port.

* Scripts/run-gtk-tests: Skip four newly-added tests that are failing or timing out.
(TestRunner):
* TestWebKitAPI/GNUmakefile.am:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Offsets for WKBundlePageLoaderClient in APIClientTraits are wrong
https://bugs.webkit.org/show_bug.cgi?id=120268

Reviewed by Anders Carlsson.

* Shared/APIClientTraits.cpp: Use always the first member of every
version as the offset of the version.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154602 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add WebKit2 API for isolated worlds
https://bugs.webkit.org/show_bug.cgi?id=103377

Reviewed by Anders Carlsson.

* GNUmakefile.list.am: Add new files to compilation.
* UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
* UIProcess/API/gtk/tests/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
(scriptDialogCallback):
(runJavaScriptInIsolatedWorldFinishedCallback):
(testWebExtensionIsolatedWorld):
(beforeAll):
* UIProcess/API/gtk/tests/WebExtensionTest.cpp:
(echoCallback):
(windowObjectCleared):
(getWebPage):
(methodCallCallback):
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.cpp:
(webkit_frame_get_javascript_context_for_script_world): New public
method to tget the JavaScript execution context for a given script
world.
* WebProcess/InjectedBundle/API/gtk/WebKitFrame.h:
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.cpp: Added.
(scriptWorlds): Global WebKitScriptWorld map.
(_WebKitScriptWorldPrivate::~_WebKitScriptWorldPrivate):
(webkitScriptWorldGet): Get the WebKitScriptWorld wrapping the
given injected bundle script world.
(webkitScriptWorldGetInjectedBundleScriptWorld): Get the injected
bundle script world wrapped by the given WebKitScriptWorld.
(webkitScriptWorldWindowObjectCleared): Emit
WebKitScriptWorld::window-object-cleared signal.
(webkitScriptWorldCreate): Create a new WebKitScriptWorld wrapping
the given injected bundle script world.
(createDefaultScriptWorld): Create the default WebKitScriptWorld
wrapping the normal world.
(webkit_script_world_get_default): Return the default WebKitScriptWorld.
(webkit_script_world_new): Create a new isolated WebKitScriptWorld.
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitScriptWorldPrivate.h: Added.
* WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
(didClearWindowObjectForFrame): Call webkitScriptWorldWindowObjectCleared().
(webkitWebPageCreate): Add implementation for callback
didClearWindowObjectForFrame in injected bundle loader client.
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
Include WebKitScriptWorld.h.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154603 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Build fix after r154554.

* page/AutoscrollController.cpp: Correct various places where pointers are now
references.
(WebCore::AutoscrollController::stopAutoscrollTimer):
(WebCore::AutoscrollController::startPanScrolling):
(WebCore::AutoscrollController::autoscrollTimerFired):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154604 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Build fix after r154580.

* rendering/RenderThemeWin.cpp: Mirror changes made for other ports now that
Frame is known to always be valid when in a render tree. This allows us to
get rid of some unneeded null checks.
(WebCore::RenderThemeWin::getThemeData):
(WebCore::RenderThemeWin::paintMenuList):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Build fix after r154578.  Return Vector<String>() instead
of ListHashSet<String>().

* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::types):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Build fix after r154541.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Remove reference
to deleted Element::pseudoElement(PseudoID), and add exports for new
beforePseudoElement() and afterPseudoElement().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154607 268f45cc-cd09-0410-ab3c-d52691b4dbfc
BUILD FIX (r154580): RenderObject::document() returns a reference

See: <https://webkit.org/b/120272>

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityParentForSubview:]):
(AXAttributeStringSetHeadingLevel):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Updates to WKSI to get external builders working.

* win/include/WebKitSystemInterface/WebKitSystemInterface.h:
* win/lib32/WebKitSystemInterface.lib:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disable compression under MSVC for now

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Building is so overrated.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RegExpMatchesArray should not call [[put]]
https://bugs.webkit.org/show_bug.cgi?id=120317

Reviewed by Oliver Hunt.

This will call accessors on the JSObject/JSArray prototypes - so adding an accessor or read-only
property called index or input to either of these prototypes will result in broken behavior.

Source/JavaScriptCore: 

* runtime/RegExpMatchesArray.cpp:
(JSC::RegExpMatchesArray::reifyAllProperties):
    - put -> putDirect

LayoutTests: 

* fast/regex/lastIndex-expected.txt:
* fast/regex/script-tests/lastIndex.js:
    - Added test



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r154581): Some plugin tests failing in debug bots
https://bugs.webkit.org/show_bug.cgi?id=120315

Reviewed by Darin Adler.
        
We are hitting the new no-event-dispatch-while-iterating assertion.

Detaching deletes a plugin which modifies DOM while it dies.

* dom/Document.cpp:
(WebCore::Document::createRenderTree):
(WebCore::Document::detach):
        
    Don't iterate at all. Document never has more than one Element child anyway.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/106133> document.body.scrollTop & document.documentElement.scrollTop differ cross-browser

Patch by Gurpreet Kaur <gur.trio@gmail.com> on 2013-08-26
Reviewed by Darin Adler.

Source/WebCore:

Webkit always uses document.body.scrollTop whether quirks or
standard mode. Similiar behaviour is for document.body.scrollLeft.
As per the specification webkit should return document.body.scrollTop
for quirks mode and document.documentElement.scrollTop for standard mode.
Same for document.body.scrollLeft and document.documentElement.scrollLeft.

Tests: fast/dom/Element/scrollLeft-Quirks.html
       fast/dom/Element/scrollLeft.html
       fast/dom/Element/scrollTop-Quirks.html
       fast/dom/Element/scrollTop.html

* dom/Element.cpp:
(WebCore::Element::scrollLeft):
(WebCore::Element::scrollTop):
If the element does not have any associated CSS layout box or the element
is the root element and the Document is in quirks mode return zero.
Else If the element is the root element return the value of scrollY
for scrollTop and scrollX for scrollLeft.
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::scrollLeft):
(WebCore::HTMLBodyElement::scrollTop):
If the element is the HTML body element, the Document is in quirks mode,
return the value of scrollY for scrollTop and scrollX for scrollLeft.

LayoutTests:

* fast/dom/Element/scrollLeft-Quirks-expected.txt: Added.
* fast/dom/Element/scrollLeft-Quirks.html: Added.
* fast/dom/Element/scrollLeft-expected.txt: Added.
* fast/dom/Element/scrollLeft.html: Added.
* fast/dom/Element/scrollTop-Quirks-expected.txt: Added.
* fast/dom/Element/scrollTop-Quirks.html: Added.
* fast/dom/Element/scrollTop-expected.txt: Added.
* fast/dom/Element/scrollTop.html: Added.
Added new tests for verifying our behavior for document.body.scrollTop/scrollLeft and
document.documentElement.scrollTop/scrollLeft for both Quirks as well as Standard mode.

* fast/css/zoom-body-scroll-expected.txt:
* fast/css/zoom-body-scroll.html:
* fast/events/mouse-cursor.html:
* http/tests/navigation/anchor-frames-expected.txt:
* http/tests/navigation/anchor-frames-gbk-expected.txt:
* http/tests/navigation/resources/frame-with-anchor-gbk.html:
* http/tests/navigation/resources/frame-with-anchor-same-origin.html:
* http/tests/navigation/resources/frame-with-anchor.html:
* platform/mac-wk2/tiled-drawing/resources/scroll-and-load-page.html:
* platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration.html:
* platform/win/fast/css/zoom-body-scroll-expected.txt:
Rebaselining existing tests as per the new behavior. The test cases are changed to use
quirks mode because it uses document.body.scrollTop/scrollLeft and as per the new code
document.body.scrollTop/scrollLeft will return correct value if document is in quirk mode
Also test cases have been modified so that it tests what it used to.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed build fix.

* rendering/RenderMediaControls.cpp: Remove references to QuickTime controls
that are no longer part of WKSI.
(wkHitTestMediaUIPart): 
(wkMeasureMediaUIPart):
(wkDrawMediaUIPart):
(wkDrawMediaSliderTrack):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore: Let Page create the main Frame.
<https://webkit.org/b/119964>

Source/WebCore:

Reviewed by Anders Carlsson.

Previously, Frame::create() would call Page::setMainFrame() when constructing the
main Frame for a Page. Up until that point, Page had a null mainFrame().

To guarantee that Page::mainFrame() is never null, we re-order things so that
Page is responsible for creating its own main Frame. We do this at the earliest
possible point; in the Page constructor initializer list.

Constructing a Frame requires a FrameLoaderClient*, so I've added such a field to
the PageClients struct.

When creating a WebKit-layer frame, we now wrap the already-instantiated
Page::mainFrame() instead of creating a new Frame.

* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):

    Add an EmptyFrameLoaderClient to the PageClients constructed here.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

    Updated to wrap Page::mainFrame() in a FrameView instead of creating their
    own Frame manually.

* page/Frame.cpp:
(WebCore::Frame::create):
* page/Page.h:

    Remove Page::setMainFrame() and the only call site.

* page/Page.cpp:
(WebCore::Page::Page):

    Construct Page::m_mainFrame in the initializer list.

(WebCore::Page::PageClients::PageClients):

    Add "FrameLoaderClient* loaderClientForMainFrame" to PageClients.

(WebCore::Page::setNeedsRecalcStyleInAllFrames):

    Null-check the Frame::document() before calling through on it. This would
    otherwise crash when changing font-related Settings before calling init() on
    the Frame (like InspectorOverlay does.)

Source/WebKit/gtk:

Tweak WebKit1/GTK for changes in WebCore.

Patch by Zan Dobersek <zdobersek@igalia.com>
Reviewed by Gustavo Noronha Silva.

* WebCoreSupport/FrameLoaderClientGtk.h:
(WebKit::FrameLoaderClient::setWebFrame):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_new):
* webkit/webkitwebview.cpp:
(webkit_web_view_init):

Source/WebKit/mac:

Reviewed by Anders Carlsson.

* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient::setWebFrame):

    Make it possible to construct a WebFrameLoaderClient with a null WebFrame*.
    A WebFrame* is later hooked up with a call to setWebFrame().

* WebView/WebFrame.mm:
(+[WebFrame _createMainFrameWithPage:frameName:frameView:]):

    Customized this method to wrap the Page::mainFrame() instead of creating a
    new Frame.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

    Add a WebFrameLoaderClient to the PageClients passed to Page().

Source/WebKit2:

Reviewed by Anders Carlsson.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::WebFrameLoaderClient):

    This starts out with a null WebFrame* pointer now.

(WebKit::WebFrameLoaderClient::setWebFrame):

    WebFrame hooks itself up through this as soon as it's constructed.

(WebKit::WebFrameLoaderClient::frameLoaderDestroyed):

    Tweak an out-of-date comment. The ref() we're balancing out comes from
    WebFrame::create().

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):

    Rewrote createMainFrame() as createWithCoreMainFrame(). The new method wraps
    an existing WebCore::Frame instead of creating a new one.

(WebKit::WebFrame::createSubframe):

    Merged WebFrame::init() into here since the logic isn't shared with main
    Frame creation anymore.

(WebKit::WebFrame::create):
(WebKit::WebFrame::WebFrame):

    Call WebFrameLoaderClient::setWebFrame(this).

* WebProcess/WebPage/WebFrame.h:

    WebFrame::m_frameLoaderClient is now an OwnPtr rather than an inline member.
    This way it can be created before the WebFrame.

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

    Set up a WebFrameLoaderClient and pass it to the Page constructor along with
    the other PageClients.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PageGroup::groupSettings() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=120319

Reviewed by Andreas Kling.

PageGroup::m_groupSettings is never NULL so we can just return a reference from groupSettings().

Source/WebCore:

* Modules/indexeddb/IDBFactory.cpp:
* page/PageGroup.h:
(WebCore::PageGroup::groupSettings):
* storage/StorageNamespaceImpl.cpp:
(WebCore::StorageNamespaceImpl::localStorageNamespace):
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::groupSettings):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::didChangeSettings):

Source/WebKit/gtk:

* webkit/webkitwebdatabase.cpp:
(webkit_set_web_database_directory_path):

Source/WebKit2:

* WebProcess/Storage/StorageNamespaceImpl.cpp:
(WebKit::StorageNamespaceImpl::createLocalStorageNamespace):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed buid fix.

* page/Page.cpp: 
(WebCore::Page::setNeedsRecalcStyleInAllFrames): Remove extra '{' character.



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