[EFL] Unskip passing ENCRYPTED_MEDIA_V2 tests
https://bugs.webkit.org/show_bug.cgi?id=138133

Reviewed by Csaba Osztrogonác.

* platform/efl/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add scope operand to op_resolve_scope
https://bugs.webkit.org/show_bug.cgi?id=138253

Reviewed by Mark Lam.

Added scope operand to op_resolve_scope.  Although the scope register is filled in with
the ScopeChain register, this operand is not used in the processing of the bytecode.
That will be addressed in a future patch.

* bytecode/BytecodeList.json: Lengthened the three bytecodes.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode): Added code to dump the scope operand.

(JSC::CodeBlock::CodeBlock): 
(JSC::CodeBlock::finalizeUnconditionally):
Updated the operand indecies for the processing of op_resolve_scope.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitResolveScope):
(JSC::BytecodeGenerator::emitGetOwnScope):
(JSC::BytecodeGenerator::emitReturn):
Added scope register to these emit functions and the bytecodes they emit.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitSlow_op_resolve_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emitSlow_op_resolve_scope):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
Updated the operand indecies for the processing of op_resolve_scope.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Fix the build if LOG_DISABLED=0 in release mode
https://bugs.webkit.org/show_bug.cgi?id=138309

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-11-03
Reviewed by Chris Dumez.

* platform/efl/LoggingEfl.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175472 268f45cc-cd09-0410-ab3c-d52691b4dbfc
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
Web Inspector: Show Selector's Specificity
https://bugs.webkit.org/show_bug.cgi?id=138189

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-11-03
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/CSS.json:
Create a new named type CSSSelector to include a selector's text and specificity.
The specificity tuple is optional as it may soon be made dynamic in some cases.

Source/WebCore:

Test: inspector/css/selector-specificity.html

* css/CSSSelector.h:
Remove very stale comment. '*' is a starAtom now instead of a special -1 tag.
Made the specificity masks public class constants.

* inspector/InspectorStyleSheet.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::buildArrayForComputedStyle):
(WebCore::InspectorStyle::styleWithProperties):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo):
Drive by use release() in some cases to reduce ref count churn.

(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
Build CSSSelector objects for SelectorLists.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Main.html:
* UserInterface/Test.html:
Add new files and strings.

* UserInterface/Models/CSSMedia.js:
Constructor functions are not needed, remove unnecessary code.

* UserInterface/Models/CSSRule.js:
(WebInspector.CSSRule.prototype.set selectors): Deleted.
This was unused and is no longer correct.

(WebInspector.CSSRule.prototype.get matchedSelectorText):
Update now that selectors are a list of objects, not just strings.

* UserInterface/Models/CSSSelector.js:
(WebInspector.CSSSelector):
(WebInspector.CSSSelector.prototype.get specificity):
New model object for protocol type CSS.CSSSelector.

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload.return):
(WebInspector.DOMNodeStyles.prototype._parseSelectorListPayload):
(WebInspector.DOMNodeStyles.prototype._parseRulePayload):
Handle parsing old and new SelectorLists.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelector):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh.appendSelectorText):
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
Update the code now that the list of selectors are model objects instead
of just selector text strings.

LayoutTests:

* inspector/css/matched-style-properties.html:
* inspector/css/selector-specificity-expected.txt: Added.
* inspector/css/selector-specificity.html: Copied from LayoutTests/inspector/css/matched-style-properties.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use FrameSnapshotting functions in FindController::getFindIndicatorBitmap
https://bugs.webkit.org/show_bug.cgi?id=138300
<rdar://problem/18855863>

Reviewed by Simon Fraser.

Share more code by using WebCore's FrameSnapshotting::snapshotSelection
in FindController instead of copying it into FindController wholesale.

* WebProcess/WebPage/FindController.cpp:
(WebKit::getFindIndicatorBitmap):
Make getFindIndicatorBitmap static, rename it from getFindIndicatorBitmapAndRect,
and drop the rect argument because only one caller wanted it, and we no longer need
to compute it (this happens in WebCore now).

Use snapshotSelection; all of the removed paint behaviors get added by
code in or underneath snapshotSelection now.

Draw the snapshot into our ShareableBitmap; we could avoid this in a future patch
by refactoring the FrameSnapshotting functions to take GraphicsContexts.

(WebKit::FindController::getImageForFindMatch):
(WebKit::FindController::updateFindIndicator):
Adopt the new getFindIndicatorBitmap.

* WebProcess/WebPage/FindController.h:
Remove getFindIndicatorBitmap(AndRect), which is now static.

* WebCore.exp.in:
* page/FrameSnapshotting.cpp:
(WebCore::snapshotSelection):
Move knowledge that selectionBounds can be empty down to WebCore.


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

Reviewed by Antti Koivisto.

RenderCounter will automatically register/unregister itself with
the RenderView when constructed/destroyed.

It was using a willBeDestroyed() hook because it used to be that you
couldn't get to the RenderView in the destructor. That's no longer
an issue as Document promises that RenderView is the last render tree
node to go away.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
_actionMenuItemsForHitTestResult is given kWKActionMenuLink but an empty array of defaultMenuItems
https://bugs.webkit.org/show_bug.cgi?id=138321
<rdar://problem/18855134>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForLink]):
(-[WKActionMenuController _defaultMenuItems:]):
Move the HTTP-family-URLs-only condition to the place where we decide what kind of menu to
show. We depend on _defaultMenuItemsForLink returning the link menu, and should never
set the link menu type if we aren't going to build a link menu.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175486 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support modern range loops over CSSValueList
https://bugs.webkit.org/show_bug.cgi?id=138285

Reviewed by Andreas Kling.

Add support for modern range loops over CSSValueList objects.
Port the code base to using range loops for CSSValueList objects and
drop the CSSValueListInspector / CSSValueListIterator classes as they
are no longer needed.

No new tests, no behavior change.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175487 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (Subpixel layout): Bubbles don't fit in Bugzilla review page
https://bugs.webkit.org/show_bug.cgi?id=138323

Reviewed by Zalan Bujtas.

* QueueStatusServer/templates/statusbubble.html: Round the sizes up, not down.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the !ENABLE(VIDEO) build after r175279
https://bugs.webkit.org/show_bug.cgi?id=138320

Reviewed by Jer Noble.

* page/ChromeClient.h:


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