[iOS WK2] Make sure any dynamic viewport update schedules a layer tree commit
https://bugs.webkit.org/show_bug.cgi?id=138021

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-10-23
Reviewed by Simon Fraser.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
Sometimes, the clients can do a dynamic viewport update but only change the minimum
layout size (see rdar://problem/18755250).

When that happens, it is possible to do the full state update without ever scheduling
a layer tree commit. For example, if the new minimum layout height is only a few pixels
smaller than the old value and the layout of the page is equal or larger than the old value,
the layout is done without any side effect to the content (assuming a viewport configuration
based on width).

The contract with the client is that the next layer tree commit after a dynamic viewport update
carries all the valid parameters for the new viewport size. Since the new layout never scheduled
a layer tree commit, the UIProcess is just waiting for one, discarding all input.

This patch solves the issue by explicitely scheduling a layer flush after updating all the layout
and view parameters to their final values. In most cases, this makes no difference since a layer
tree commit was already scheduled. In the rare cases where nothing was scheduled, scheduling
the layer tree commit ensure we unlock the UIProcess.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed gardening after removing SafariTheme.
https://bugs.webkit.org/show_bug.cgi?id=138025.
* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add some SPI headers for NSExtension and NSSharingService{Picker}
https://bugs.webkit.org/show_bug.cgi?id=138027

Reviewed by Anders Carlsson.

* WebCore.xcodeproj/project.pbxproj:
* platform/spi/cocoa/NSExtensionSPI.h: Added.
* platform/spi/mac/NSSharingServicePickerSPI.h: Added.
* platform/spi/mac/NSSharingServiceSPI.h: Added.
Add modern SPI headers for NSExtension, and NSSharingService{Picker}.

* rendering/RenderThemeMac.mm:
Replace redefinitions with an SPI header #import.

* UIProcess/API/mac/WKView.mm:
* UIProcess/mac/ServicesController.mm:
* UIProcess/mac/WebContextMenuProxyMac.mm:
Replace redefinitions with SPI header #imports.

* Misc/WebSharingServicePickerController.h:
* Misc/WebSharingServicePickerController.mm:
* WebCoreSupport/WebSelectionServiceController.mm:
* WebCoreSupport/WebContextMenuClient.mm:
Fix a sorting issue.
Replace redefinitions with SPI header #imports.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up virtual functions in dom/
https://bugs.webkit.org/show_bug.cgi?id=138019

Reviewed by Benjamin Poulain.

Clean up virtual functions in dom/ by:
- Making virtual functions final when possible
- Making classes final when possible
- Using 'override' when appropriate
- Explicitly marking functions / destructors as virtual when they are
  inherently virtual
- Making isXXX() virtual functions private on XXX classes to avoid
  unnecessary type checks
- Dropping final for virtual functions in classes already marked as
  final

No new tests, no behavior change.

* WebCore.exp.in:
* dom/AutocompleteErrorEvent.h:
* dom/BeforeLoadEvent.h:
(WebCore::BeforeLoadEventInit::BeforeLoadEventInit):
* dom/BeforeTextInsertedEvent.h:
* dom/ClipboardEvent.h:
* dom/CompositionEvent.h:
* dom/CustomEvent.h:
* dom/DeviceMotionController.h:
(WebCore::DeviceMotionController::~DeviceMotionController): Deleted.
* dom/DeviceMotionEvent.h:
* dom/DeviceOrientationController.h:
(WebCore::DeviceOrientationController::~DeviceOrientationController): Deleted.
* dom/DeviceOrientationEvent.h:
* dom/Document.h:
* dom/DocumentFragment.h:
* dom/ErrorEvent.h:
* dom/FocusEvent.h:
* dom/HashChangeEvent.h:
* dom/KeyboardEvent.h:
* dom/LiveNodeList.h:
* dom/MessageEvent.h:
* dom/MessagePort.h:
* dom/MouseEvent.h:
* dom/MouseRelatedEvent.h:
* dom/MutationEvent.h:
* dom/NamedFlowCollection.h:
* dom/OverflowEvent.h:
* dom/PageTransitionEvent.h:
* dom/PendingScript.h:
* dom/PopStateEvent.h:
* dom/RawDataDocumentParser.h:
(WebCore::RawDataDocumentParser::finish): Deleted.
(WebCore::RawDataDocumentParser::flush): Deleted.
(WebCore::RawDataDocumentParser::insert): Deleted.
(WebCore::RawDataDocumentParser::append): Deleted.
* dom/ScriptableDocumentParser.h:
* dom/SecurityPolicyViolationEvent.h:
* dom/TextEvent.h:
* dom/TouchEvent.h:
* dom/TransitionEvent.h:
* dom/UIEvent.h:
* dom/WebKitAnimationEvent.h:
* dom/WebKitTransitionEvent.h:
* dom/WheelEvent.h:
* page/DeviceController.h:
(WebCore::DeviceController::~DeviceController):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of unnecessary vtables in WebKit
https://bugs.webkit.org/show_bug.cgi?id=138024

Reviewed by Benjamin Poulain.

Get rid of unnecessary vtables in WebKit by de-virtualizing destructors
when possible and marking the class as final to make sure people don't
subclass it.

No new tests, no behavior change.

* WebCore.exp.in:
* css/WebKitCSSMatrix.h:
* css/WebKitCSSMatrix.idl:
* html/canvas/WebGLContextGroup.h:
* html/canvas/WebGLGetInfo.h:
* html/canvas/WebGLUniformLocation.h:
(WebCore::WebGLUniformLocation::~WebGLUniformLocation): Deleted.
* html/canvas/WebGLUniformLocation.idl:
* inspector/DOMPatchSupport.h:
* inspector/InspectorHistory.h:
* inspector/InspectorStyleSheet.h:
* page/WheelEventDeltaTracker.h:
* page/scrolling/ScrollLatchingState.h:
* platform/audio/Biquad.h:
* platform/graphics/Pattern.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't assume that style.overflowX() == style.overflowY()
https://bugs.webkit.org/show_bug.cgi?id=138028

Reviewed by Zalan Bujtas.

WebKit doesn't support independent overflow scroll/hidden on different axes,
but the RenderStyle does report the correct values. So check both overflowX()
and overflowY() in a couple of places where we need to.

* rendering/RenderLayerCompositor.cpp:
(WebCore::styleHasTouchScrolling):
(WebCore::styleChangeRequiresLayerRebuild):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Provide a way to have alternate inspector agents
https://bugs.webkit.org/show_bug.cgi?id=137901

Reviewed by Brian Burg.

Source/JavaScriptCore:

Provide a way to use alternate inspector agents debugging a JSContext.
Expose a very slim private API that a client could use to know when
an inspector has connected/disconnected, and a way to register its
augmentative agents.

* Configurations/FeatureDefines.xcconfig:
* JavaScriptCore.xcodeproj/project.pbxproj:
New feature guard. New files.

* API/JSContextRef.cpp:
(JSGlobalContextGetAugmentableInspectorController):
* API/JSContextRefInspectorSupport.h: Added.
Access to the private interface from a JSContext.

* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
(Inspector::JSGlobalObjectInspectorController::disconnectFrontend):
* inspector/JSGlobalObjectInspectorController.h:
* inspector/augmentable/AugmentableInspectorController.h: Added.
(Inspector::AugmentableInspectorController::~AugmentableInspectorController):
(Inspector::AugmentableInspectorController::connected):
* inspector/augmentable/AugmentableInspectorControllerClient.h: Added.
(Inspector::AugmentableInspectorControllerClient::~AugmentableInspectorControllerClient):
* inspector/augmentable/AlternateDispatchableAgent.h: Added.
(Inspector::AlternateDispatchableAgent::AlternateDispatchableAgent):
Provide the private APIs a client could use to add alternate agents using alternate backend dispatchers.

* inspector/scripts/codegen/__init__.py:
* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):
New includes, and use the new generator.

* inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py: Added.
(AlternateBackendDispatcherHeaderGenerator):
(AlternateBackendDispatcherHeaderGenerator.__init__):
(AlternateBackendDispatcherHeaderGenerator.output_filename):
(AlternateBackendDispatcherHeaderGenerator.generate_output):
(AlternateBackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
(AlternateBackendDispatcherHeaderGenerator._generate_handler_declaration_for_command):
Generate the abstract AlternateInspectorBackendDispatcher interfaces.

* inspector/scripts/codegen/generate_backend_dispatcher_header.py:
(BackendDispatcherHeaderGenerator.generate_output):
(BackendDispatcherHeaderGenerator._generate_alternate_handler_forward_declarations_for_domains):
(BackendDispatcherHeaderGenerator._generate_alternate_handler_forward_declarations_for_domains.AlternateInspector):
Forward declare alternate dispatchers, and allow setting an alternate dispatcher on a domain dispatcher.

* inspector/scripts/codegen/generate_backend_dispatcher_implementation.py:
(BackendDispatcherImplementationGenerator.generate_output):
(BackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command):
Check for and dispatch on an AlternateInspectorBackendDispatcher if there is one for this domain.

* inspector/scripts/codegen/generator_templates.py:
(AlternateInspectorBackendDispatcher):
(AlternateInspector):
Template boilerplate for prelude and postlude.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
Rebaseline tests.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Carets in GMail and iCloud compositions are the foreground text color
https://bugs.webkit.org/show_bug.cgi?id=138029

Reviewed by Simon Fraser.

Source/WebCore:

Previously, we were only checking whether the background colors of the foreground and background
elements were the same, rather than taking validity and opacity into consideration.

Test: editing/caret/color-span-inside-editable-background.html

* editing/FrameSelection.cpp:
(WebCore::disappearsIntoBackground):
(WebCore::CaretBase::paintCaret):

LayoutTests:

Test the case where the content editable root has a background color specified.

* editing/caret/color-span-inside-editable-background-expected.html: Added.
* editing/caret/color-span-inside-editable-background.html: Added.


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