Persist the page's muted state across web process crashes.
https://bugs.webkit.org/show_bug.cgi?id=138195

Reviewed by Anders Carlsson.

Store the Page's muted state in WebPageCreationParameters so that state can be properly
restored after recovering from a crash in the web process.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
Initialize m_muted.
(WebKit::WebPageProxy::setMuted):
Update m_muted.
(WebKit::WebPageProxy::creationParameters):
Set the muted data member in WebPageCreationParameters.
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Initialize the page's muted state with the muted value from WebPageCreationParameters.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175473 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement action menus for editable text
https://bugs.webkit.org/show_bug.cgi?id=138284
-and corresponding-
rdar://problem/18742323

Reviewed by Tim Horton.

New item type for paste.
* Shared/API/c/WKActionMenuItemTypes.h:

New menu type for editable text.
* Shared/API/c/WKActionMenuTypes.h:
* UIProcess/mac/WKActionMenuController.mm:

willOpenMenu should select text for both regular text menus and editable text 
menus. 
(-[WKActionMenuController willOpenMenu:withEvent:]):

Default items for editable text.
(-[WKActionMenuController _defaultMenuItemsForEditableText]):
(-[WKActionMenuController _paste:]):
(-[WKActionMenuController _createActionMenuItemForTag:]):

New method _hitTestResultForStage:(MenuUpdateStage)stage will figure out whether 
we can use the WebHitTestResult from the ActionMenuHitTestResult or if we have to 
use the potentially out-of-date WebHitTestResult that is cached on WebPageProxy. 
An important difference between these results is that the ActionMenuHitTest 
result, in addition to being more recent and accurate, also now includes shadow 
content, which affects some editable regions on important sites such as 
bugs.webkit.org and nytimes.com.
(-[WKActionMenuController _defaultMenuItems:]):
(-[WKActionMenuController _updateActionMenuItemsForStage:]):
(imageForResource:name::if): Deleted.

Allow shadow content in action menu hit testing.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
(WebKit::WebPage::selectLookupTextAtLocation):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayerModelObject shouldn't need a pre-destructor hook.
<https://webkit.org/b/138314>

Reviewed by Antti Koivisto.

Move code from the willBeDestroyed() pre-destructor hook to the regular
~RenderLayerModelObject() destructor.

We just need to unregister the renderer from the FrameView's set of
viewport-constrained objects. That doesn't require being able to walk
the render tree or call virtuals, which is the main reason you'd use
willBeDestroyed().

* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::~RenderLayerModelObject):
(WebCore::RenderLayerModelObject::willBeDestroyed): Deleted.
* rendering/RenderLayerModelObject.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename FindIndicator{Window} to TextIndicator{Window}
https://bugs.webkit.org/show_bug.cgi?id=138302
<rdar://problem/18855190>

Reviewed by Anders Carlsson.

Rename FindIndicator{Window} to TextIndicator{Window} (and related),
because it will soon be used to indicate ranges of text that are not
necessarily find-in-page results.

FindController still has things named 'findIndicator' internally,
and I left the API alone (because all the API bits are actually find-specific),
but the actual FindIndicator/Window and the message to set it up, etc. are all
now called Text*.

* CMakeLists.txt:
* UIProcess/API/mac/WKView.mm:
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp.
* UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h.
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/ios/WKContentView.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
* UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h.
* UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/FindController.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175476 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: Using a media element changes window.name
https://bugs.webkit.org/show_bug.cgi?id=138278
rdar://problem/18704134

Apply the same fix to mediaControlsBase.js. I do not know who uses this file, but
there is no reason to have the bug there.

* Modules/mediacontrols/mediaControlsBase.js:
(Controller.prototype.addVideoListeners):
(Controller.prototype.removeVideoListeners):
(Controller.prototype.disconnectControls):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175477 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: ALTERNATE_DISPATCHERS Let the frontend know about extra agents
https://bugs.webkit.org/show_bug.cgi?id=138236

Reviewed by Brian Burg.

Source/JavaScriptCore:

Inform the frontend about any extra domains the backend may have
above and beyond the default list of domains for the debuggable type.
This approach means there is almost no cost to normal debugging.
When a JSContext is debugged with extra agents, a message is sent
to the frontend letting it know which domains to then activate,
and perform any initialization work that may be required.

* inspector/InspectorAgentBase.h:
(Inspector::InspectorAgentBase::domainName):
* inspector/InspectorAgentRegistry.cpp:
(Inspector::InspectorAgentRegistry::appendExtraAgent):
* inspector/InspectorAgentRegistry.h:
* inspector/scripts/codegen/generator_templates.py:
Provide a way to get a list of just the extra domains.
To aggregate this list provide a different "append"
specifically for extra agents.

* inspector/JSGlobalObjectInspectorController.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::connectFrontend):
When a frontend connects, inform it of the extra domains.

* inspector/protocol/Inspector.json:
* inspector/agents/InspectorAgent.h:
* inspector/agents/InspectorAgent.cpp:
(Inspector::InspectorAgent::enable):
(Inspector::InspectorAgent::activateExtraDomains):
Send an event with the extra domains to activate.

Source/WebInspectorUI:

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackendClass.prototype.activateDomain):
* UserInterface/Protocol/InspectorObserver.js:
(WebInspector.InspectorObserver.prototype.activateExtraDomains):
* UserInterface/Base/Object.js:
* UserInterface/Base/Test.js:
* UserInterface/Base/Main.js:
(WebInspector.activateExtraDomains):
Default state is that there are no extra domains. When extra domains
are activated, some agents need to be re-initialized. Dispatch a
model event so views also know to re-initialize.

* UserInterface/Controllers/ApplicationCacheManager.js:
(WebInspector.ApplicationCacheManager.prototype._mainResourceDidChange):
* UserInterface/Controllers/DOMTreeManager.js:
Be more careful about direct agent use during main resource changes.
That can happen with a JSContext extended with a Page agent.

* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager):
(WebInspector.FrameResourceManager.prototype._mainFrameDidChange):
(WebInspector.FrameResourceManager.prototype._extraDomainsActivated):
* UserInterface/Controllers/StorageManager.js:
(WebInspector.StorageManager):
(WebInspector.StorageManager.prototype._databaseForIdentifier):
(WebInspector.StorageManager.prototype._extraDomainsActivated):
It is possible new window.FooAgent's are available. Perform expected
initialization re-checking if the agents are now available.

* UserInterface/Models/CSSCompletions.js:
Avoid re-initialization if we already did it. This should never
happen but this is just to be safe.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype._extraDomainsActivated):
Don't disallow expandable tree elements if this is a JSContext with
extra domains. If that JSContext has resources, we would have been
unable to see child resources.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: ObjC Protocol Interfaces should throw exceptions for nil arguments
https://bugs.webkit.org/show_bug.cgi?id=138221

Reviewed by Timothy Hatcher.

The RWIProtocol APIs will now raise exceptions when:

  - any properties are set on a type with a nil value or key (handled by RWIProtocolJSONObject)
  - required parameters in type constructors have nil value
  - required or optional command return parameters have nil values
  - required or optional event parameters have nil values

The exceptions include the name of the field when possible.

* inspector/scripts/codegen/generate_objective_c.py:
(ObjCGenerator.is_type_objc_pointer_type):
Provide a quick check to see if type would be a pointer or not
in the ObjC API. Enums for example are not pointers in the API
because we manage converting them to/from strings.

* inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py:
(ObjectiveCConfigurationImplementationGenerator._generate_success_block_for_command):
* inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py:
(ObjectiveCFrontendDispatcherImplementationGenerator._generate_event):
* inspector/scripts/codegen/generate_objective_c_types_implementation.py:
(ObjectiveCTypesImplementationGenerator._generate_init_method_for_required_members):
(ObjectiveCTypesImplementationGenerator._generate_setter_for_member):
Throw exceptions when nil values are disallowed.

* 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/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
Rebaseline tests which include the exception raise calls.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175479 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Unreviewed gardening. Rebaseline after r175259.
https://bugs.webkit.org/show_bug.cgi?id=138317

Rebaseline pending test expectations affected by r175259.

Patch by Lorenzo Tilve <ltilve@igalia.com> on 2014-11-03

* platform/gtk/css1/box_properties/border_bottom-expected.txt:
* platform/gtk/css1/box_properties/border_top-expected.txt:
* platform/gtk/css1/formatting_model/inline_elements-expected.txt:
* platform/gtk/css1/pseudo/pseudo_elements_in_selectors-expected.txt:
* platform/gtk/fast/table/border-collapsing/004-vertical-expected.txt:
* platform/gtk/svg/custom/bug45331-expected.txt:
* platform/gtk/svg/custom/path-bad-data-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move -webkit-shape-outside to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=138296

Reviewed by Zoltan Horvath.

Move -webkit-shape-outside to the new StyleBuilder, using custom
code as it does not always call setShapeOutside().

No new tests, no behavior change.

* css/CSSPropertyNames.in:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
(WebCore::ApplyPropertyShape::setValue): Deleted.
(WebCore::ApplyPropertyShape::applyValue): Deleted.
(WebCore::ApplyPropertyShape::createHandler): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderFunctions::applyValueWebkitShapeOutside):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
URTBF after r175476 to make GTK and EFL build happy.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::setFindIndicator): Deleted.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::setTextIndicator):
(WebKit::WebView::setFindIndicator): Deleted.
* UIProcess/CoordinatedGraphics/WebView.h:

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