The Page's muted setting should not affect the HTMLMediaElement's 'muted' IDL attribute.
https://bugs.webkit.org/show_bug.cgi?id=138215

Reviewed by Eric Carlson.

Source/WebCore:

Add m_muted in Page to keep track of the Page's muted state. Change AudioProducer::setMuted()
to pageMutedStateDidChange(). When that method is called, the AudioProducer is supposed to
update its muted state again taking the Page's muted state into account.

Add HTMLMediaElement::effectiveMuted(), which returns the effective muted state of the
HTMLMediaElement, taking the Page's muted state into account.

Test: media/video-muted-after-setting-page-muted-state.html

* dom/Document.cpp:
(WebCore::Document::pageMutedStateDidChange):
(WebCore::Document::setMuted): Deleted.
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted):
Set the MediaPlayer's muted state to the result of effectiveMuted() rather than m_muted.
(WebCore::HTMLMediaElement::updateVolume):
Ditto, and also make sure the MediaController's muted state does not override the Page's
muted state.
(WebCore::HTMLMediaElement::updatePlayState):
Set the MediaPlayer's muted state to the result of effectiveMuted() rather than muted().
(WebCore::HTMLMediaElement::pageMutedStateDidChange):
Call updateVolume(), which will update the MediaPlayer's muted state.
(WebCore::HTMLMediaElement::effectiveMuted):
Figure out the muted value taking Page's muted state into account.
* html/HTMLMediaElement.h:
* page/AudioProducer.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setMuted):
Update m_muted, and only iterate through the frames' documents to call pageMutedStateDidChange()
if m_muted changes.
* page/Page.h:
(WebCore::Page::isMuted):
* testing/Internals.cpp:
(WebCore::Internals::setPageMuted):
Expose a way to set the Page's muted state in Internals for testing.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* media/video-muted-after-setting-page-muted-state-expected.txt: Added.
* media/video-muted-after-setting-page-muted-state.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Generate ObjC inspector protocol types and alternate dispatcher interfaces
https://bugs.webkit.org/show_bug.cgi?id=138048

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-10-30
Reviewed by Brian Burg.

Generate Objective-C interfaces for inspector protocol types, command, and event dispatchers.
This is very much like the InspectorProtocolTypes, BackendDispatchers, and FrontendDispatchers,
but with an ObjC spin on things.

The private API that clients would use is all encapsulated in RWIProtocol.h. It includes the
types interfaces, command handler protocol, and event dispatcher interface. Where possible the
API uses real enums, which hides the raw protocol enum strings from clients.

Inspector protocol types are, like InspectorProtocolObjects, built on top of an InspectorObject.
This offers the flexibilty of adding arbitrary key/values using the RWIProtocolJSONObject
interface, which may be required for certain protocol objects like "Network.Headers" which
have no fields, but expect arbitrary properties to be added.

Command handler protocols always have two callbacks. An error callback and a success callback.
The signature is very much like BackendDispatchers. In parameters are passed directly to
the selectors, and out parameters are defined by the success callback. It will be the client's
responsibility to call either of these callbacks to complete handling of a request.

Event dispatcher interfaces are straight forward, just packaging up the arguments and sending
the message to the frontend.

ObjC <-> Protocol conversion happens in each of the generated files. In type getters / setters,
in commands parameters and event parameters. For this to work we generate conversion helpers
for all enums, ObjC enum <-> protocol strings. For NSArray <-> InspectorArray there are some
static helpers to do the conversions. We do lose some type safety in these conversions.

* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/scripts/codegen/__init__.py:
* inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py:
(AlternateBackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
* inspector/scripts/codegen/generate_backend_dispatcher_header.py:
(BackendDispatcherHeaderGenerator._generate_alternate_handler_forward_declarations_for_domains.AlternateInspector):
(BackendDispatcherHeaderGenerator._generate_handler_declarations_for_domain):
(BackendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
* inspector/scripts/codegen/generate_backend_dispatcher_implementation.py:
(BackendDispatcherImplementationGenerator._generate_handler_class_destructor_for_domain):
(BackendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
* inspector/scripts/codegen/generate_frontend_dispatcher_header.py:
(FrontendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
* inspector/scripts/codegen/generate_frontend_dispatcher_implementation.py:
(FrontendDispatcherImplementationGenerator._generate_dispatcher_implementations_for_domain):
* inspector/scripts/codegen/generate_objective_c.py: Added.
(join_type_and_name):
(strip_comment_markers):
(remove_duplicate_from_str):
(ObjCTypeCategory):
(ObjCTypeCategory.category_of_type):
(ObjCGenerator):
(ObjCGenerator.identifier_to_objc_identifier):
(ObjCGenerator.objc_identifier_to_identifier):
(ObjCGenerator.should_generate_domain_types_filter):
(ObjCGenerator.should_generate_domain_types_filter.should_generate_domain_types):
(ObjCGenerator.should_generate_domain_command_handler_filter):
(ObjCGenerator.should_generate_domain_command_handler_filter.should_generate_domain_command_handler):
(ObjCGenerator.should_generate_domain_event_dispatcher_filter):
(ObjCGenerator.should_generate_domain_event_dispatcher_filter.should_generate_domain_event_dispatcher):
(ObjCGenerator.objc_name_for_type):
(ObjCGenerator.objc_enum_name_for_anonymous_enum_declaration):
(ObjCGenerator.objc_enum_name_for_anonymous_enum_member):
(ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter):
(ObjCGenerator.objc_enum_name_for_non_anonymous_enum):
(ObjCGenerator.variable_name_prefix_for_domain):
(ObjCGenerator.objc_accessor_type_for_raw_name):
(ObjCGenerator.objc_type_for_raw_name):
(ObjCGenerator.objc_class_for_raw_name):
(ObjCGenerator.protocol_type_for_raw_name):
(ObjCGenerator.protocol_type_for_type):
(ObjCGenerator.objc_class_for_type):
(ObjCGenerator.objc_accessor_type_for_member):
(ObjCGenerator.objc_accessor_type_for_member_internal):
(ObjCGenerator.objc_type_for_member):
(ObjCGenerator.objc_type_for_member_internal):
(ObjCGenerator.objc_type_for_param):
(ObjCGenerator.objc_type_for_param_internal):
(ObjCGenerator.objc_protocol_export_expression_for_variable):
(ObjCGenerator.objc_protocol_import_expression_for_member):
(ObjCGenerator.objc_protocol_import_expression_for_parameter):
(ObjCGenerator.objc_protocol_import_expression_for_variable):
(ObjCGenerator.objc_to_protocol_expression_for_member):
(ObjCGenerator.protocol_to_objc_expression_for_member):
(ObjCGenerator.objc_setter_method_for_member):
(ObjCGenerator.objc_setter_method_for_member_internal):
(ObjCGenerator.objc_getter_method_for_member):
(ObjCGenerator.objc_getter_method_for_member_internal):
* inspector/scripts/codegen/generate_objective_c_backend_dispatcher_header.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py.
(ObjectiveCBackendDispatcherHeaderGenerator):
(ObjectiveCBackendDispatcherHeaderGenerator.output_filename):
(ObjectiveCBackendDispatcherHeaderGenerator.domains_to_generate):
(ObjectiveCBackendDispatcherHeaderGenerator.generate_output):
(ObjectiveCBackendDispatcherHeaderGenerator._generate_objc_forward_declarations):
(ObjectiveCBackendDispatcherHeaderGenerator._generate_objc_forward_declarations_for_domains):
(ObjectiveCBackendDispatcherHeaderGenerator._generate_objc_handler_declarations_for_domain):
(ObjectiveCBackendDispatcherHeaderGenerator._generate_objc_handler_declaration_for_command):
* inspector/scripts/codegen/generate_objective_c_backend_dispatcher_implementation.py: Added.
(ObjectiveCConfigurationImplementationGenerator):
(ObjectiveCConfigurationImplementationGenerator.__init__):
(ObjectiveCConfigurationImplementationGenerator.output_filename):
(ObjectiveCConfigurationImplementationGenerator.domains_to_generate):
(ObjectiveCConfigurationImplementationGenerator.generate_output):
(ObjectiveCConfigurationImplementationGenerator._generate_handler_implementation_for_domain):
(ObjectiveCConfigurationImplementationGenerator._generate_handler_implementation_for_command):
(ObjectiveCConfigurationImplementationGenerator._generate_success_block_for_command):
(ObjectiveCConfigurationImplementationGenerator._generate_conversions_for_command):
(ObjectiveCConfigurationImplementationGenerator._generate_invocation_for_command):
* inspector/scripts/codegen/generate_objective_c_configuration_header.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py.
(ObjectiveCConfigurationHeaderGenerator):
(ObjectiveCConfigurationHeaderGenerator.output_filename):
(ObjectiveCConfigurationHeaderGenerator.generate_output):
(ObjectiveCConfigurationHeaderGenerator._generate_configuration_interface_for_domains):
(ObjectiveCConfigurationHeaderGenerator._generate_properties_for_domain):
* inspector/scripts/codegen/generate_objective_c_configuration_implementation.py: Added.
(ObjectiveCBackendDispatcherImplementationGenerator):
(ObjectiveCBackendDispatcherImplementationGenerator.__init__):
(ObjectiveCBackendDispatcherImplementationGenerator.output_filename):
(ObjectiveCBackendDispatcherImplementationGenerator.generate_output):
(ObjectiveCBackendDispatcherImplementationGenerator._generate_configuration_implementation_for_domains):
(ObjectiveCBackendDispatcherImplementationGenerator._generate_ivars):
(ObjectiveCBackendDispatcherImplementationGenerator._generate_dealloc):
(ObjectiveCBackendDispatcherImplementationGenerator._generate_handler_setter_for_domain):
(ObjectiveCBackendDispatcherImplementationGenerator._generate_event_dispatcher_getter_for_domain):
* inspector/scripts/codegen/generate_objective_c_conversion_helpers.py: Added.
(add_whitespace_separator):
(ObjectiveCConversionHelpersGenerator):
(ObjectiveCConversionHelpersGenerator.__init__):
(ObjectiveCConversionHelpersGenerator.output_filename):
(ObjectiveCConversionHelpersGenerator.domains_to_generate):
(ObjectiveCConversionHelpersGenerator.generate_output):
(ObjectiveCConversionHelpersGenerator._generate_enum_conversion_functions):
(ObjectiveCConversionHelpersGenerator._generate_anonymous_enum_conversion_for_declaration):
(ObjectiveCConversionHelpersGenerator._generate_anonymous_enum_conversion_for_member):
(ObjectiveCConversionHelpersGenerator._generate_anonymous_enum_conversion_for_parameter):
(ObjectiveCConversionHelpersGenerator._generate_enum_objc_to_protocol_string):
(ObjectiveCConversionHelpersGenerator._generate_enum_from_protocol_string):
* inspector/scripts/codegen/generate_objective_c_frontend_dispatcher_implementation.py: Added.
(ObjectiveCFrontendDispatcherImplementationGenerator):
(ObjectiveCFrontendDispatcherImplementationGenerator.__init__):
(ObjectiveCFrontendDispatcherImplementationGenerator.output_filename):
(ObjectiveCFrontendDispatcherImplementationGenerator.domains_to_generate):
(ObjectiveCFrontendDispatcherImplementationGenerator.generate_output):
(ObjectiveCFrontendDispatcherImplementationGenerator._generate_event_dispatcher_implementations):
(ObjectiveCFrontendDispatcherImplementationGenerator._generate_event):
(ObjectiveCFrontendDispatcherImplementationGenerator._generate_event_signature):
(ObjectiveCFrontendDispatcherImplementationGenerator._generate_event_out_parameters):
* inspector/scripts/codegen/generate_objective_c_header.py: Added.
(add_whitespace_separator):
(ObjectiveCHeaderGenerator):
(ObjectiveCHeaderGenerator.__init__):
(ObjectiveCHeaderGenerator.output_filename):
(ObjectiveCHeaderGenerator.generate_output):
(ObjectiveCHeaderGenerator._generate_forward_declarations):
(ObjectiveCHeaderGenerator._generate_enums):
(ObjectiveCHeaderGenerator._generate_types):
(ObjectiveCHeaderGenerator._generate_anonymous_enum_for_declaration):
(ObjectiveCHeaderGenerator._generate_anonymous_enum_for_member):
(ObjectiveCHeaderGenerator._generate_anonymous_enum_for_parameter):
(ObjectiveCHeaderGenerator._generate_enum):
(ObjectiveCHeaderGenerator._generate_enum.NS_ENUM):
(ObjectiveCHeaderGenerator._generate_type_interface):
(ObjectiveCHeaderGenerator._generate_init_method_for_required_members):
(ObjectiveCHeaderGenerator._generate_member_property):
(ObjectiveCHeaderGenerator._generate_command_protocols):
(ObjectiveCHeaderGenerator._generate_single_command_protocol):
(ObjectiveCHeaderGenerator._callback_block_for_command):
(ObjectiveCHeaderGenerator._generate_event_interfaces):
(ObjectiveCHeaderGenerator._generate_single_event_interface):
* inspector/scripts/codegen/generate_objective_c_internal_header.py: Copied from Source/JavaScriptCore/inspector/scripts/codegen/generate_alternate_backend_dispatcher_header.py.
(ObjectiveCTypesInternalHeaderGenerator):
(ObjectiveCTypesInternalHeaderGenerator.output_filename):
(ObjectiveCTypesInternalHeaderGenerator.generate_output):
(ObjectiveCTypesInternalHeaderGenerator._generate_event_dispatcher_private_interfaces):
* inspector/scripts/codegen/generate_objective_c_types_implementation.py: Added.
(add_whitespace_separator):
(ObjectiveCTypesImplementationGenerator):
(ObjectiveCTypesImplementationGenerator.__init__):
(ObjectiveCTypesImplementationGenerator.output_filename):
(ObjectiveCTypesImplementationGenerator.domains_to_generate):
(ObjectiveCTypesImplementationGenerator.generate_output):
(ObjectiveCTypesImplementationGenerator.generate_type_implementations):
(ObjectiveCTypesImplementationGenerator.generate_type_implementation):
(ObjectiveCTypesImplementationGenerator._generate_init_method_for_required_members):
(ObjectiveCTypesImplementationGenerator._generate_setter_for_member):
(ObjectiveCTypesImplementationGenerator._generate_getter_for_member):
* inspector/scripts/codegen/generate_protocol_types_header.py:
(ProtocolTypesHeaderGenerator._generate_forward_declarations):
(_generate_typedefs_for_domain):
(_generate_builders_for_domain):
* inspector/scripts/codegen/generator.py:
(Generator.wrap_with_guard_for_domain):
(Generator):
(Generator.wrap_with_guard):
* inspector/scripts/codegen/generator_templates.py:
(AlternateInspector):
(ObjCInspector):
* inspector/scripts/codegen/models.py:
(Framework.fromString):
(Frameworks):
* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):
* 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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Long spins under rangeExpandedAroundPosition on Yahoo Mail
https://bugs.webkit.org/show_bug.cgi?id=138223
<rdar://problem/18819547>

Reviewed by Enrica Casucci.

* WebCore.exp.in:
Export some things.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::rangeExpandedAroundPositionByCharacters):
Reimplement rangeExpandedAroundPosition to operate on characters instead of lines,
and to use Position. Moving VisiblePositions by line can be very expensive in some cases,
and for generating lookup/Data Detectors context, we don't care about that kind of precision.
This makes this function ~1000x faster when it hits on a row in the Yahoo Mail message list.

(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::scanForDataDetectedItems):
Adopt the new rangeExpandedAroundPositionByCharacters, expanding 250 characters
before and after, which roughly matches what we were usually getting going by line,
and is a reasonable amount of context for these operations.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable bmalloc in 32bit builds
https://bugs.webkit.org/show_bug.cgi?id=138232

Reviewed by Andreas Kling.

Seems to work fine.

* wtf/FastMalloc.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the iOS build.

* WebProcess/WebPage/WebPage.messages.in:

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

Reviewed by Benjamin Poulain.

Clean up virtual functions in css/ 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

No new tests, no behavior change.

* WebCore.exp.in:
* css/CSSBasicShapes.h:
* css/CSSCharsetRule.h:
* css/CSSComputedStyleDeclaration.h:
* css/CSSCrossfadeValue.h:
* css/CSSFilterImageValue.h:
* css/CSSFontFaceLoadEvent.h:
* css/CSSFontFaceRule.h:
* css/CSSFontFaceSource.h:
* css/CSSImportRule.h:
* css/CSSMediaRule.h:
* css/CSSPageRule.h:
* css/CSSRuleList.h:
(WebCore::StaticCSSRuleList::ref): Deleted.
(WebCore::StaticCSSRuleList::styleSheet): Deleted.
(WebCore::StaticCSSRuleList::length): Deleted.
(WebCore::StaticCSSRuleList::item): Deleted.
(WebCore::LiveCSSRuleList::ref): Deleted.
(WebCore::LiveCSSRuleList::deref): Deleted.
(WebCore::LiveCSSRuleList::length): Deleted.
(WebCore::LiveCSSRuleList::item): Deleted.
(WebCore::LiveCSSRuleList::styleSheet): Deleted.
* css/CSSStyleRule.h:
* css/CSSSupportsRule.h:
* css/CSSUnknownRule.h:
* css/FontLoader.h:
* css/PropertySetCSSStyleDeclaration.h:
(WebCore::PropertySetCSSStyleDeclaration::parentElement):
* css/WebKitCSSKeyframeRule.h:
* css/WebKitCSSViewportRule.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Text rebaselining after r175384.
* platform/win/css1/box_properties/margin_right-expected.txt:
* platform/win/css1/box_properties/padding-expected.txt:
* platform/win/css1/box_properties/padding_left-expected.txt:
* platform/win/css1/box_properties/padding_right-expected.txt:
* platform/win/css1/box_properties/padding_top-expected.txt:
* platform/win/css1/font_properties/font-expected.txt:
* platform/win/css1/formatting_model/vertical_formatting-expected.txt:
* platform/win/css1/text_properties/text_transform-expected.txt:
* platform/win/fast/css/empty-pseudo-class-expected.txt:
* platform/win/fast/css/first-child-pseudo-class-expected.txt:
* platform/win/fast/css/only-child-pseudo-class-expected.txt:
* platform/win/fast/dom/HTMLProgressElement/progress-element-expected.txt: Added.
* platform/win/fast/forms/targeted-frame-submission-expected.txt:
* platform/win/fast/table/append-cells2-expected.txt:
* platform/win/tables/mozilla/bugs/45621-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to fix the Windows build after r175384.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] More text rebaselining.
* platform/win/TestExpectations:
* platform/win/fast/text/tatechuyoko-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Short-circuit repaints with empty rects
https://bugs.webkit.org/show_bug.cgi?id=138234

Reviewed by Zalan Bujtas.

Repaints with an empty rectangle are common enough that it's worth
short-circuiting them.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::repaintUsingContainer):


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