Unreviewed. Fix GTK+ clean build after r175930.

Partial rollout of r175930 to not build the new unit test that
broke clean builds in GTK+ port.

* TestWebKitAPI/PlatformGTK.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Move RedirectedXCompositeWindow from platform to WebKit2 layer
https://bugs.webkit.org/show_bug.cgi?id=138093

Reviewed by Martin Robinson.

Source/WebCore:

Remove RedirectedXCompositeWindow.

* PlatformGTK.cmake:

Source/WebKit2:

It's only used by WebKitWebViewBase. While moving the code the
following cleanups have been made:

  - Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
  - Use a helper class XDamageNotifier to handle the XDamage
    events filtering and notification.
  - Use std::function instead of pointer to function for the
    damage callback.
  - Pass the X display to the RedirectedXCompositeWindow constructor
    and keep it as a member to use it everywhere, instead of using
    the default display in some places and the widget display in others.
  - Pass the damage notify function as a contructor parameter of
    RedirectedXCompositeWindow instead of setting the callback
    right after creating the object.
  - Remove GLContextNeeded and all the dead code related to the
    CreateGLContext mode that is no longer used.
  - Rename cairoSurfaceForWidget() as surface().
  - windowId() has been renamed as windowID() and made const.
  - Use std::unique_ptr instead of PassOwnPtr.
  - Fix coding style issues.

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseConstructed):
(webkitWebViewRenderAcceleratedCompositingResults):
(webkitWebViewBaseCreateWebPage):
(redirectedWindowDamagedCallback): Deleted.
* UIProcess/gtk/RedirectedXCompositeWindow.cpp: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp.
(WebKit::XDamageNotifier::XDamageNotifier):
(WebKit::XDamageNotifier::add):
(WebKit::XDamageNotifier::remove):
(WebKit::XDamageNotifier::filterXDamageEvent):
(WebKit::XDamageNotifier::filterXEvent):
(WebKit::xDamageNotifier):
(WebKit::supportsXDamageAndXComposite):
(WebKit::RedirectedXCompositeWindow::create):
(WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
(WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
(WebKit::RedirectedXCompositeWindow::resize):
(WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface):
(WebKit::RedirectedXCompositeWindow::surface):
* UIProcess/gtk/RedirectedXCompositeWindow.h: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h.
(WebKit::RedirectedXCompositeWindow::windowID):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Fix how SerializedScriptValue is exposed to GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=138409

Reviewed by Philippe Normand.

It's currently exposed as a WebKitDOMSerializedScriptValue class
that doesn't really exist. It should be handled as a string, that
is used to create a SerializedScriptValue when coming from the
API, and converted to a string again when returned to the API.

* bindings/scripts/CodeGeneratorGObject.pm:
(GetGlibTypeName): Return gchar* as glib type of SerializedScriptValue.
(IsGDOMClassType): Don't consider SerializedScriptValue as a GDOM class.
(GenerateFunction): Handle SerializedScriptValue parameters and
return values specially.
* bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
(webkit_dom_test_callback_callback_with_serialized_script_value_param):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_serialized_value):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
(webkit_dom_test_serialized_script_value_interface_class_init):
(webkit_dom_test_serialized_script_value_interface_get_value):
(webkit_dom_test_serialized_script_value_interface_set_value):
(webkit_dom_test_serialized_script_value_interface_get_readonly_value):
(webkit_dom_test_serialized_script_value_interface_get_cached_value):
(webkit_dom_test_serialized_script_value_interface_set_cached_value):
(webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
(webkit_dom_test_typedefs_class_init):
(webkit_dom_test_typedefs_get_immutable_serialized_script_value):
(webkit_dom_test_typedefs_set_immutable_serialized_script_value):
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Expose user script messages to GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=138411

Reviewed by Philippe Normand.

Source/WebCore:

* PlatformGTK.cmake: Add WebKitDOMCustomUnstable.h to the list of
installed headers and make a symlink for it in the DerivedSources dir.
* bindings/gobject/WebKitDOMCustomUnstable.h: Added.
* bindings/gobject/WebKitDOMCustom.cpp:
(webkit_dom_dom_window_get_webkit_namespace):
(webkit_dom_user_message_handlers_namespace_get_handler):
* bindings/scripts/CodeGeneratorGObject.pm:
(HasUnstableCustomAPI): Helper function to check if the given
class has custom unstable API.
(WriteData): Include WebKitDOMCustomUnstable.h header if the class
has API defined there.

Tools:

Add a test case to check that user script messages sent using the
DOM bindings API are also received in the UI process.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
(UserScriptMessageTest::waitUntilMessageReceived):
(UserScriptMessageTest::postMessageAndWaitUntilReceived):
(testUserContentManagerScriptMessageFromDOMBindings):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(documentLoadedCallback):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening. Skip shared worker tests after r175776.

Shared workers are disabled with the Network Process.

* platform/gtk/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, GTK gardening.

* Scripts/run-gtk-tests:
(TestRunner): Skip the UserMediaBasic test because it depends on
constraints validation which is going to be fixed in bug #136449.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Incorrect names for test executables in debug mode.
https://bugs.webkit.org/show_bug.cgi?id=138659

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-11-12
Reviewed by Alex Christensen.

In debug mode, jsc.exe, and testapi.exe are not created, causing JSC test failures.

* JavaScriptCore.vcxproj/jsc/jscLauncher.vcxproj:
* JavaScriptCore.vcxproj/testapi/testapiLauncher.vcxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
compositing/video/video-border-radius.html frequently times out on Mountain Lion only
https://bugs.webkit.org/show_bug.cgi?id=138662

Make the test a reftest again, and skip it, as nothing helps.

Also, updated all compositing/video expectations to match what bots see now.

* compositing/video/video-border-radius-expected.html: Copied from LayoutTests/compositing/video/video-border-radius-expected.html-disabled.
* compositing/video/video-border-radius-expected.html-disabled: Removed.
* compositing/video/video-border-radius-expected.png: Removed.
* compositing/video/video-border-radius-expected.txt: Removed.
* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a typo in the previous commit - a test should be skipped, not its expectation.

* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] media/track/audio-track.html is flakey
https://bugs.webkit.org/show_bug.cgi?id=138394

Reviewed by Alexey Proskuryakov.

Source/WebCore:

The above test fails if the HTMLMediaElement's "canplaythrough" event fires before the AudioTrackList's
"addtrack" event fires. This can happen because each object keeps its own GenericEventQueue, which
empties when that individual queue's timer fires. So events can be enqueued in the following order:
1, A, 2, B, 3, C; but fired in a different order: 1, 2, 3, A, B, C.

Make events enqueued in GenericEventQueues globally ordered, so that events are fired in the order
which they are enqueued, regardless of which object owns the queue. Use a static queue of
GenericEventQueues to manage which GenericEventQueue fires and in what order.

GenericEventQueues will use a WeakPtrFactory to cancel pending events. Revoking a GenericEventQueue's
weak pointers means those queue's entries will be skipped the next time the meta-queue is processed.

* dom/GenericEventQueue.cpp:
(WebCore::GenericEventQueue::GenericEventQueue): Create a WeakPtrFactory instead of a Timer.
(WebCore::GenericEventQueue::enqueueEvent): Enqueue this queue with the MetaQueue.
(WebCore::GenericEventQueue::sharedTimer): Lazily-initializing accessor.
(WebCore::GenericEventQueue::sharedTimerFired):  Ask each queue to dispatch one event.
(WebCore::GenericEventQueue::pendingQueues): Lazily-initializing accessor.
(WebCore::GenericEventQueue::dispatchOneEvent): Renamed from timerFired.
(WebCore::GenericEventQueue::close): Revoke all WeakPtrs.
(WebCore::GenericEventQueue::cancelAllEvents): Ditto.
(WebCore::GenericEventQueue::hasPendingEvents): Use !isEmpty().
(WebCore::GenericEventQueue::timerFired): Deleted.
* dom/GenericEventQueue.h:

LayoutTests:

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Instead of blacklisting tests for OS X versions that use PPT for testing,
whitelist MountainLion that doesn't. That's more future compatible.

* platform/mac-wk2/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
A number of hidpi tests don't appear to fail on Yosemite now, let's try unmarking them.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make action menus much more reliable
https://bugs.webkit.org/show_bug.cgi?id=138654
<rdar://problem/18909111>

Reviewed by Anders Carlsson.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController prepareForMenu:withEvent:]):
Remove MenuUpdateStage; nothing actually uses this value, we just pass it around.

(-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
Update the menu as soon as we have a reply from the Web process.

(-[WKActionMenuController menuNeedsUpdate:]):
If our sync-wait for the Web process' reply times out, we should still update
the menu to remove the placeholder separator item.

(-[WKActionMenuController _updateActionMenuItems]):
(-[WKActionMenuController _updateActionMenuItemsForStage:]): Deleted.
If we have our final answer for this menu (_state == Ready), and the final answer
has no items in the menu, cancel tracking on the menu.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some WebKit1-only Yosemite-only failures don't appear to exist any more.

* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:
Unmark the tests.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove expectations for a couple tests that were marked as flaky on WK1 only,
as they don't appear to be flaky any more.

* platform/mac-wk1/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speed up HTMLTextFormControlElement::setInnerTextValue() a bit
https://bugs.webkit.org/show_bug.cgi?id=138619

Reviewed by Darin Adler.

Speed up HTMLTextFormControlElement::setInnerTextValue() a bit by:
- Not doing a virtual isTextFormControl() call. Relying on innerTextElement()
  not returning null is sufficient.
- Caching the result of innerTextElement() instead of repeatedly calling that
  virtual function.
- De-virtualizing setFormControlValueMatchesRenderer() /
  formControlValueMatchesRenderer() as these are never overridden.
- Moving the code constructing the innerTextValue from a
  TextControlInnerTextElement from innerTextValue() to a new
  innerTextValueFrom(TextControlInnerTextElement&) function and call this new
  function from setInnerTextValue() to avoid calling innerTextElement() again
  and making sure it is non-null
- Do the tree traversal from innerTextElement's firstChild instead of from
  innerTextElement. The innerTextElement is a TextControlInnerTextElement.
  Therefore, it cannot be an HTMLBRElement or a Text node.

No new tests, no behavior change.

* html/HTMLFormControlElement.h:
(WebCore::HTMLFormControlElement::formControlValueMatchesRenderer):
(WebCore::HTMLFormControlElement::setFormControlValueMatchesRenderer):
* html/HTMLTextFormControlElement.cpp:
(WebCore::stripTrailingNewline):
(WebCore::innerTextValueFrom):
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
(WebCore::HTMLTextFormControlElement::innerTextValue):
(WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
(WebCore::finishText): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename USE(MASM_PROBE) to ENABLE(MASM_PROBE).
<https://webkit.org/b/138661>

Reviewed by Michael Saboff.

Also move the switch for enabling the use of MASM_PROBE from JavaScriptCore's
config.h to WTF's Platform.h.  This ensures that the setting is consistently
applied even when building WebCore parts as well.

Source/JavaScriptCore:

* assembler/ARMAssembler.h:
* assembler/ARMv7Assembler.h:
* assembler/MacroAssemblerARM.cpp:
* assembler/MacroAssemblerARM.h:
* assembler/MacroAssemblerARMv7.cpp:
* assembler/MacroAssemblerARMv7.h:
* assembler/MacroAssemblerX86.h:
* assembler/MacroAssemblerX86Common.cpp:
* assembler/MacroAssemblerX86Common.h:
* assembler/MacroAssemblerX86_64.h:
* assembler/X86Assembler.h:
* config.h:
* jit/JITStubs.h:
* jit/JITStubsARM.h:
* jit/JITStubsARMv7.h:
* jit/JITStubsX86.h:
* jit/JITStubsX86Common.h:
* jit/JITStubsX86_64.h:

Source/WTF:

* wtf/Platform.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Minor improvements to RenderListItem
https://bugs.webkit.org/show_bug.cgi?id=138601

Reviewed by Darin Adler.

Make several minor improvements to RenderListItem and clean up the
code a bit.

No new tests, no behavior change.

* rendering/RenderListItem.cpp:
(WebCore::isHTMLListElement):
- Rename isList to isHTMLListElement() for clarity as it checks
  for HTMLOListElement and HTMLUListElement types
- Inline the function as it is short.
- Use is<HTML*Element>() for type checking
- Update the argument to take a Node& instead of an Element*. This
  is because the argument is expected to the non-null. Also using
  looser typing here allows us to use this utility function is one
  more place, without impacting performance as
  hasTagName(HTMLQualifiedName) is defined on Node.

(WebCore::enclosingList):
- Pass the argument as a reference instead of a pointer as it is
  expected to be non-null.
- Initialize firstNode before the loop to avoid the if (!firstNode)
  check for every iteration.

(WebCore::nextListItem):
- Take an Element as second argument instead of a RenderListItem*
  and provide convenience overloads so that we don't need to do
  null checks just because some calls sites call this function
  with 2 arguments and others with 1 argument. This way, we avoid
  unnecessary null checks as most call sites already do such
  checks (or have references).
- Transform the while loop into a for loop for clarity.
- Don't traverse an Element's subtree if the Element does not have
  a renderer as it is impossible of any of its descendant to have
  a renderer (and we are looking for a specific type of renderer).

(WebCore::previousListItem):
- Pass the item argument as a reference instead of a pointer as it
  is expected to be non-null.
- Reduce the scope of the |current| so that it is now declared
  inside the loop.

(WebCore::RenderListItem::updateItemValuesForOrderedList):
(WebCore::RenderListItem::itemCountForOrderedList):
- Pass argument as a reference instead of a pointer as it was expected
  to be non-null (There was an assertion in place to make sure of it).

(WebCore::RenderListItem::calcValue):
- Use is<HTMLOListElement>() instead of hasTagName().

(WebCore::getParentOfFirstLineBox):
- Rename variables to stop using abbreviations.
- Pass arguments as references instead of pointers as they are expected
  to be non-null.
- Remove the firstChild null check before the loop as it does not
  change behavior. The loop will abort early if firstChild is null
  and we will end up returning nullptr as well.
- Use is<>() more for type checking.
- Reuse the isHTMLListElement() utility function instead of duplicating
  its code inside this function.

(WebCore::firstNonMarkerChild):
- Pass argument as a reference as it is expected to be non-null.
- Rename variable from result to child for clarity, as we are traversing
  the children.

(WebCore::RenderListItem::markerTextWithSuffix):
- Use String appending instead of StringBuilder as it simplifies the
  code a lot and should not impact performance in this case.

(WebCore::RenderListItem::explicitValueChanged):
- Restructure the code a bit to do the |listNode| null check before the
  loop, now that nextListItem() takes a reference in argument. This is
  the only call site where we didn't already know that listNode is
  non-null.

(WebCore::previousOrNextItem):
- Mark this function as inline as it is short and called repeatedly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac-WK2 test expectations cleanup, part 1.

Put WK1 specific expectations into mac-wk1 (they used to be put in mac, and then
being overridden for wk2).
Remove expectations for tests that are no longer flaky.
Add more specific expectations to encient entries that were added in old format,
and just skipped indiscriminately.

* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/mac/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176033 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some platform/mac text expectation cleanup.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:



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