Add non-virtual firstChild/lastChild overrides to RenderBlock and RenderTableCol for a > 30% speedup on table from bug 100304
https://bugs.webkit.org/show_bug.cgi?id=100306

Reviewed by Abhishek Arya.

Presumably this is a speedup for other rendering tests as well.  We use firstChild() all over
the rendering code w/o considering that it makes a virtual function call.
Originally I just fixed the one callsite which was showing up on the sample to
use children()->firstChild() directly.  However after further thought, this
broader solution seemed the better way to go.  The first patch was a 15% win for
this large table, this broader solution was a 30%!? win.

The elephant in the room for this table is that we're walking the whole table
for many nextColumn calls.  But that I will solve in a later bug.

* rendering/RenderBlock.h:
(WebCore::RenderBlock::firstChild):
(WebCore::RenderBlock::lastChild):
(RenderBlock):
* rendering/RenderObject.h:
(RenderObject):
* rendering/RenderTableCol.h:
(WebCore::RenderTableCol::firstChild):
(WebCore::RenderTableCol::lastChild):
(RenderTableCol):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix header sorting in r132992.

* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm:
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, attempt to fix the build by exporting NoExceptionAssertionChecker symbols.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Memory instrumentation: do not report memory occupied by objects referenced using client interfaces
https://bugs.webkit.org/show_bug.cgi?id=100824

Reviewed by Alexander Pavlov.

In many classes we have pointer to a client object. These references should be
reported as weak pointers and the client's memory usage should be reported when
the client is reached from its instrumented owner where we know exact type of
the client. Otherwise we would need to add reportMemoryUsage to all client
interfaces which places additional burden on the client implementers and blurs
the instrumentation boundaries.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::reportMemoryUsage):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::reportMemoryUsage):
* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::reportMemoryUsage):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::reportMemoryUsage):
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::reportMemoryUsage):
* page/Page.cpp:
(WebCore::Page::reportMemoryUsage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132998 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, attempt to fix the release build by not exporting symbols that aren't defined there.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][DRT] EventSender requires contextClick implementation
https://bugs.webkit.org/show_bug.cgi?id=86091

Patch by Michał Pakuła vel Rutka <m.pakula@samsung.com> on 2012-10-31
Reviewed by Gyuyoung Kim.

Source/WebKit:

Add new unit test file, needed due to ewk API changes.

* PlatformEfl.cmake:

Source/WebKit/efl:

Add a pointer to parent menu in Ewk_Context_Menu_Item and a getter
function to allow selecting a context menu item without having
parent menu pointer in DumpRenderTree EventSender.
Three unit tests added due ewk API changes.

* ewk/ewk_contextmenu.cpp:
(_Ewk_Context_Menu_Item):
(ewk_context_menu_item_new):
(ewk_context_menu_item_parent_get):
(ewk_context_menu_item_append):
* ewk/ewk_contextmenu.h:
* ewk/ewk_view.cpp:
(ewk_view_context_menu_get):
* ewk/ewk_view.h:
* tests/test_ewk_contextmenu.cpp: Added.
(TEST_F):
* tests/test_ewk_view.cpp:
(TEST_F):

Tools:

Add contextClick for DumpRenderTreeEventSender basing on WebKit GTK
implementation.

* DumpRenderTree/efl/EventSender.cpp:
(getMenuItemTitleCallback):
(setMenuItemTitleCallback):
(menuItemClickCallback):
(contextClickCallback):

LayoutTests:

Move contextClick dependent tests to WebKit2 TestExpectations and
add new expected results.

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:
* platform/efl/editing/selection/5354455-2-expected.txt: Added.
* platform/efl/fast/events/context-no-deselect-expected.txt: Added.
* platform/efl/fast/events/context-onmousedown-event-expected.png: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Change the scope of locking in CoreIPC::Connection class.
https://bugs.webkit.org/show_bug.cgi?id=98998

Patch by Byungwoo Lee <bw80.lee@samsung.com> on 2012-10-31
Reviewed by Laszlo Gombos.

Release the m_incomingMessagesLock and m_outgoingMessagesLock mutexes
immediately after the protected resource is no longer modified to
prevent a possible source of a deadlock.

The change allows the EFL port to prevent an actual dead-lock
situation with some upcoming changes.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::sendMessage):
(CoreIPC::Connection::enqueueIncomingMessage):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-31  Pavel Podivilov  <podivilov@google.com>

        [chromium] Unreviewed, mark two touchadjustment tests as failing on mac.

        * platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add new baselines for fast/forms/basic-inputs.html and fast/forms/indeterminate.html on linux.

* platform/chromium-linux/fast/forms/indeterminate-expected.png:
* platform/efl-wk1/fast/forms/indeterminate-expected.png: Renamed from LayoutTests/platform/efl/fast/forms/indeterminate-expected.png.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Rebaseline 7 media/video-* tests on Linux and Mac.

* platform/chromium-linux/media/video-aspect-ratio-expected.png:
* platform/chromium-linux/media/video-colorspace-yuv420-expected.png:
* platform/chromium-linux/media/video-colorspace-yuv422-expected.png:
* platform/chromium-linux/media/video-layer-crash-expected.png:
* platform/chromium-linux/media/video-transformed-expected.png:
* platform/chromium-linux/media/video-zoom-controls-expected.png:
* platform/chromium-linux/platform/chromium/media/video-frame-size-change-expected.png:
* platform/chromium-mac-lion/media/video-aspect-ratio-expected.png: Added.
* platform/chromium-mac-lion/media/video-colorspace-yuv420-expected.png: Added.
* platform/chromium-mac-lion/media/video-colorspace-yuv422-expected.png: Added.
* platform/chromium-mac-lion/media/video-layer-crash-expected.png: Added.
* platform/chromium-mac-lion/media/video-transformed-expected.png: Added.
* platform/chromium-mac-lion/media/video-zoom-controls-expected.png: Added.
* platform/chromium-mac-lion/platform/chromium/media/video-frame-size-change-expected.png: Added.
* platform/chromium-mac-snowleopard/media/video-aspect-ratio-expected.png:
* platform/chromium-mac-snowleopard/media/video-colorspace-yuv420-expected.png:
* platform/chromium-mac-snowleopard/media/video-colorspace-yuv422-expected.png:
* platform/chromium-mac-snowleopard/media/video-layer-crash-expected.png:
* platform/chromium-mac-snowleopard/media/video-transformed-expected.png:
* platform/efl-wk1/media/video-aspect-ratio-expected.png: Renamed from LayoutTests/platform/efl/media/video-aspect-ratio-expected.png.
* platform/efl-wk1/media/video-colorspace-yuv420-expected.png: Renamed from LayoutTests/platform/efl/media/video-colorspace-yuv420-expected.png.
* platform/efl-wk1/media/video-colorspace-yuv422-expected.png: Renamed from LayoutTests/platform/efl/media/video-colorspace-yuv422-expected.png.
* platform/efl-wk1/media/video-layer-crash-expected.png: Renamed from LayoutTests/platform/efl/media/video-layer-crash-expected.png.
* platform/efl-wk1/media/video-transformed-expected.png: Renamed from LayoutTests/platform/efl/media/video-transformed-expected.png.
* platform/efl-wk1/media/video-zoom-controls-expected.png: Renamed from LayoutTests/platform/efl/media/video-zoom-controls-expected.png.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133004 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Rebaseline media/video-zoom.html.

* platform/chromium-linux/media/video-zoom-expected.png:
* platform/chromium-mac-lion/media/video-zoom-expected.png: Added.
* platform/chromium-mac-snowleopard/media/video-zoom-expected.png:
* platform/efl-wk1/media/video-zoom-expected.png: Renamed from LayoutTests/platform/efl/media/video-zoom-expected.png.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Script run from an isolated world should bypass a page's CSP.
https://bugs.webkit.org/show_bug.cgi?id=97398

Reviewed by Adam Barth.

Source/WebCore:

A page's Content Security Policy currently applies to all resources
loaded, regardless of their source. That generally makes sense, but
proves problematic when considering script run from an isolated
world (Chrome extensions, for instance). These scripts should be allowed
to inject resources into a page's DOM without eiher being restricted by
the page's active CSP, or generating violation reports that spam the
page owner.

Ideally, the isolated world could define its own Content Security Policy
which should be applied to resources it loads. For the moment, this
patch accepts a String that we can parse later on, but only uses it in
a binary way. If a non-empty policy String is provided, we bypass the
main world's CSP checks. If an empty String is provided, the main
world's CSP checks remain active.

Test: http/tests/security/isolatedWorld/bypass-main-world-csp.html

(WebCore::isolatedWorldContentSecurityPolicies):
(WebCore::DOMWrapperWorld::isolatedWorldHasContentSecurityPolicy):
(WebCore::DOMWrapperWorld::setIsolatedWorldContentSecurityPolicy):
(WebCore::DOMWrapperWorld::clearIsolatedWorldContentSecurityPolicy):
* bindings/v8/DOMWrapperWorld.h:
(DOMWrapperWorld):
    Mechanisms for setting and clearing Content Security Policies from
    isolated worlds; implemented in the same HashMappy way as
    SecurityOrigin.
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::shouldBypassMainWorldContentSecurityPolicy):
(WebCore):
* bindings/v8/ScriptController.h:
(ScriptController):
    Adding a method to ScriptController to query the state of the
    current world's Content Security Policy. We'll drop this once we can
    apply a policy more directly, but for the moment it's necessary for
    the next bit.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
    Check the new ScriptController method, and only perform CSP checks
    when loading resources if we're executing code from the main world,
    or an isolated world with no Content Security Policy set.

Source/WebKit/chromium:

* public/WebFrame.h:
(WebFrame):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::setIsolatedWorldSecurityOrigin):
(WebKit):
(WebKit::WebFrameImpl::setIsolatedWorldContentSecurityPolicy):
* src/WebFrameImpl.h:
(WebFrameImpl):
    Piping a Content Security Policy through WebFrame, in the same way
    we're currently doing for SecurityOrigin. As a drive-by, this also
    uses the static method on DOMWrapperWindow to set the security
    origin, rather than routing through the frame's ScriptController.

Tools:

* DumpRenderTree/chromium/DRTTestRunner.cpp:
(DRTTestRunner::DRTTestRunner):
(DRTTestRunner::setIsolatedWorldContentSecurityPolicy):
* DumpRenderTree/chromium/DRTTestRunner.h:
(DRTTestRunner):
    Adding a mechanism to set the Content Security Policy for an
    isolated world to Chromium's testRunner.

LayoutTests:

* http/tests/security/isolatedWorld/bypass-main-world-csp-expected.txt: Added.
* http/tests/security/isolatedWorld/bypass-main-world-csp.html: Added.
* platform/efl/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
    Skip the new tests on ports that don't support the new functionality


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reset binding test result after r132973
https://bugs.webkit.org/show_bug.cgi?id=99178

Unreviewed gardening.

* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::getJSFloat64ArrayConstructorTable):
(WebCore::JSFloat64ArrayConstructor::getOwnPropertySlot):
(WebCore::JSFloat64ArrayConstructor::getOwnPropertyDescriptor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove code to hide/reshow text caret for PagePopups
https://bugs.webkit.org/show_bug.cgi?id=100834

Reviewed by Hajime Morita.

All of form controls supporting PagePopups don't have a text
caret. We don't need to hide a text caret on opening a PagePopup,
and don't need to reshow it on closing the PagePopup.

We had this code because an old UI of input[type=date] had a text
caret.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::openPagePopup):
(WebKit::WebViewImpl::closePagePopup):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed, unskip fast/forms/select-multiple-elements-with-mouse-drag.html.
https://bugs.webkit.org/show_bug.cgi?id=100248

The test is consistently passing again, and "fixing" the EFL side
is not trivial.

* platform/efl-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Calendar picker can flicker when opened from the suggestion picker
https://bugs.webkit.org/show_bug.cgi?id=100816

Reviewed by Kent Tamura.

Source/WebCore:

Calendar picker was opening before the hiding completed.

No new tests. Added test to date-suggestion-picker-key-operations.html.

* Resources/pagepopups/pickerCommon.js: Added didHide event.
* Resources/pagepopups/suggestionPicker.js:
(SuggestionPicker.prototype.selectEntry): Use didHide event so we don't open the calendar picker prematurely.
(SuggestionPicker._handleWindowDidHide): When the window finished hiding, open the calendar picker.

LayoutTests:

* fast/forms/resources/picker-common.js:
(openPicker): Fix mistake.
* platform/chromium-win/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-key-operations.html: Test that didHide event fires after the entry was selected and before the calendar picker opened.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2/EFL] Make sure all our events are transformed correctly
https://bugs.webkit.org/show_bug.cgi?id=100836

Reviewed by Alexis Menard.

When moving to using the tiled backing store, we need to
transform our events before sending them to the web process.

We needed to do that before as well, as the webkit view
doesn't have to be positioned at (0,0), but it was done in
a hacking way in the WebEvent creating.

Now we generate two transforms, one for transforming points
to the web content, and one for transforming them into the
device screen coordinate system.

This fixes the global position which was wrong before.

* Shared/NativeWebMouseEvent.h:
(NativeWebMouseEvent):
* Shared/NativeWebTouchEvent.h:
(NativeWebTouchEvent):
* Shared/NativeWebWheelEvent.h:
(NativeWebWheelEvent):
* Shared/efl/NativeWebMouseEventEfl.cpp:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
* Shared/efl/NativeWebTouchEventEfl.cpp:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
* Shared/efl/NativeWebWheelEventEfl.cpp:
(WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
* Shared/efl/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* Shared/efl/WebEventFactory.h:
(WebEventFactory):
* UIProcess/API/efl/ewk_view.cpp:
(toDeviceScreenTransform):
(toWebContentTransform):
(_ewk_view_smart_mouse_wheel):
(_ewk_view_smart_mouse_down):
(_ewk_view_smart_mouse_up):
(_ewk_view_smart_mouse_move):
(ewk_view_feed_touch_event):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed, unskip media/video-seek-past-end-playing.html on WK2.

It has been passing on the WK2 bot for quite a while, so unskip
and hope for the best.

* platform/efl-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][EFL] Assert check need to be changed in InputMethodContextEfl::InputMethodContextEfl
https://bugs.webkit.org/show_bug.cgi?id=100840

Patch by KyungTae Kim <ktf.kim@samsung.com> on 2012-10-31
Reviewed by Kenneth Rohde Christiansen.

Because 'context' is already set to 'm_context', assert check need to be done for m_context.

* UIProcess/efl/InputMethodContextEfl.cpp:
(WebKit::InputMethodContextEfl::InputMethodContextEfl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: frame chooser does not work on subsequent inspector open.
https://bugs.webkit.org/show_bug.cgi?id=100771

Reviewed by Yury Semikhatsky.

- Make WorkerRuntimeAgent and PageRuntimeAgent register themselves in the instrumenting agents independently
- Move pause / run worker handling from InspectorRuntimeAgent into WorkerRuntimeAgent
- Remove remains of the front-end reused signal from InspectorAgent
- Send execution contexts post clear window object instead of post commit load.

* inspector/InspectorAgent.cpp:
(WebCore::InspectorAgent::InspectorAgent):
(WebCore::InspectorAgent::clearFrontend):
(WebCore::InspectorAgent::didCommitLoad):
* inspector/InspectorAgent.h:
(InspectorAgent):
* inspector/InspectorInstrumentation.cpp:
(WebCore):
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
(WebCore::InspectorInstrumentation::willEvaluateWorkerScript):
* inspector/InspectorInstrumentation.h:
(InspectorInstrumentation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::restore):
* inspector/InspectorRuntimeAgent.cpp:
(WebCore::InspectorRuntimeAgent::InspectorRuntimeAgent):
(WebCore::InspectorRuntimeAgent::~InspectorRuntimeAgent):
(WebCore::InspectorRuntimeAgent::run):
(WebCore::InspectorRuntimeAgent::setScriptDebugServer):
* inspector/InspectorRuntimeAgent.h:
(InspectorRuntimeAgent):
* inspector/InstrumentingAgents.h:
(WebCore):
(WebCore::InstrumentingAgents::InstrumentingAgents):
(WebCore::InstrumentingAgents::workerRuntimeAgent):
(WebCore::InstrumentingAgents::setWorkerRuntimeAgent):
(InstrumentingAgents):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::PageRuntimeAgent):
(WebCore::PageRuntimeAgent::~PageRuntimeAgent):
(WebCore::PageRuntimeAgent::setFrontend):
(WebCore::PageRuntimeAgent::clearFrontend):
(WebCore::PageRuntimeAgent::enable):
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
* inspector/PageRuntimeAgent.h:
(PageRuntimeAgent):
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
(WebCore::WorkerRuntimeAgent::~WorkerRuntimeAgent):
(WebCore::WorkerRuntimeAgent::run):
(WebCore):
(WebCore::WorkerRuntimeAgent::pauseWorkerContext):
* inspector/WorkerRuntimeAgent.h:
(WorkerRuntimeAgent):

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