Clean up the inheritance tree under the MediaControls Class.
https://bugs.webkit.org/show_bug.cgi?id=88871

Patch by Silvia Pfeiffer <silviapf@chromium.org> on 2012-11-13
Reviewed by Eric Carlson.

Source/WebCore:

This patch removes code duplication between the Chromium and Safari
media controls shadow DOMs.
This is achieved by pulling common functions that are identical (or
almost identical) between the different platforms into the base class.
The derived classes are renamed based on their platform:
- MediaControlRootElement                to MediaControlsApple.
- MediaControlRootElementChromium        to MediaControlsChromium.
- MediaControlRootElementChromiumAndroid to MediaControlsChromiumAndroid.
MediaControls is now no longer an abstract base class, but its "create"
function is only implemented in the port-specific header file, so it's
on purpose incomplete in the MediaControls.cpp file.

No new tests because this is refactoring work only.

* CMakeLists.txt:
  Rename MediaControlRootElement.cpp to MediaControlsApple.cpp .
* GNUmakefile.list.am:
  Rename MediaControlRootElement.[cpp,h] to MediaControlsApple.[cpp,h] .
* Target.pri:
  Rename MediaControlRootElement.cpp to MediaControlsApple.cpp .
* WebCore.gypi:
  Rename MediaControlRootElement[Chromium[Android]].[cpp,h] to MediaControls[Apple,Chromium[Android]].[cpp,h] .
* WebCore.order:
  Rename MediaControlRootElement symbols to MediaControlsApple symbols.
* WebCore.vcproj/WebCore.vcproj:
  Rename MediaControlRootElement.[cpp,h] to MediaControlsApple.[cpp,h] .
* WebCore.xcodeproj/project.pbxproj:
  Rename MediaControlRootElement.[cpp,h] to MediaControlsApple.[cpp,h] .
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTimelineElement::defaultEventHandler):
  Remove dependency on MediaControlRootElement.h (base class MediaControls.h is still there).
  Rename updateTimeDisplay() to updateCurrentTimeDisplay().
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::MediaControls):
  Added initialization for media elements that all platform controls share.
(WebCore):
  Removed include files that are already included in header file.
(WebCore::MediaControls::setMediaController):
  Added controller assignment for media elements that all platform controls share.
(WebCore::MediaControls::reset):
  Added resets for media elements that all platform controls share.
(WebCore::MediaControls::reportedError):
  Added error handling for media elements that all platform controls share.
(WebCore::MediaControls::loadedMetadata):
  Added default action for loadedMetadata event.
(WebCore::MediaControls::show):
(WebCore::MediaControls::hide):
(WebCore::MediaControls::makeOpaque):
(WebCore::MediaControls::makeTransparent):
(WebCore::MediaControls::shouldHideControls):
(WebCore::MediaControls::bufferingProgressed):
(WebCore::MediaControls::playbackStarted):
(WebCore::MediaControls::playbackProgressed):
(WebCore::MediaControls::playbackStopped):
(WebCore::MediaControls::updateCurrentTimeDisplay):
(WebCore::MediaControls::showVolumeSlider):
(WebCore::MediaControls::changedMute):
(WebCore::MediaControls::changedVolume):
(WebCore::MediaControls::changedClosedCaptionsVisibility):
(WebCore::MediaControls::enteredFullscreen):
(WebCore::MediaControls::exitedFullscreen):
(WebCore::MediaControls::defaultEventHandler):
(WebCore::MediaControls::hideFullscreenControlsTimerFired):
(WebCore::MediaControls::startHideFullscreenControlsTimer):
(WebCore::MediaControls::stopHideFullscreenControlsTimer):
(WebCore::MediaControls::shadowPseudoId):
(WebCore::MediaControls::containsRelatedTarget):
(WebCore::MediaControls::createTextTrackDisplay):
(WebCore::MediaControls::showTextTrackDisplay):
(WebCore::MediaControls::hideTextTrackDisplay):
(WebCore::MediaControls::updateTextTrackDisplay):
  Added default actions for all these media controls member functions.
* html/shadow/MediaControls.h:
(WebCore):
  Added include files and forward class declarations that all media controls share.
(MediaControls):
  Make all pure virtual functions that have default implementations just virtual.
(WebCore::MediaControls::updateStatusDisplay):
  Add an empty virtual updateStatusDisplay function which is used by media elements.
* html/shadow/MediaControlsApple.cpp: Renamed from Source/WebCore/html/shadow/MediaControlRootElement.cpp.
  Reduced Apple-specific media control functions by relying on default implementations in the base class.
* html/shadow/MediaControlsApple.h: Renamed from Source/WebCore/html/shadow/MediaControlRootElement.h.
  Reduced Apple-specific media control elements by relying on some elements in the base class.
* html/shadow/MediaControlsChromium.cpp: Renamed from Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp.
  Reduced Chromium-specific media control functions by relying on default implementations in the base class.
* html/shadow/MediaControlsChromium.h: Renamed from Source/WebCore/html/shadow/MediaControlRootElementChromium.h.
  Reduced Chromium-specific media control functions by relying on default implementations in the base class.
* html/shadow/MediaControlsChromiumAndroid.cpp: Renamed from Source/WebCore/html/shadow/MediaControlRootElementChromiumAndroid.cpp.
  Renamed class name and base class name.
* html/shadow/MediaControlsChromiumAndroid.h: Renamed from Source/WebCore/html/shadow/MediaControlRootElementChromiumAndroid.h.
  Renamed class name and base class name.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::timeWithoutMouseMovementBeforeHidingControls):
  Moved timeWithoutMouseMovementBeforeHidingControls variable from all classes to a theme-specific function.

Source/WebKit/chromium:

This patch removes code duplication between the Chromium and Safari
media controls shadow DOMs.
The derived classes are renamed based on their platform:
- MediaControlRootElement                to MediaControlsApple.
- MediaControlRootElementChromium        to MediaControlsChromium.
- MediaControlRootElementChromiumAndroid to MediaControlsChromiumAndroid.

* public/WebContextMenuData.h:
  Move MediaControlRootElement to MediaControls.
* src/ContextMenuClientImpl.cpp:
(WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
  Move MediaControlRootElement to MediaControls.

LayoutTests:

* platform/chromium-mac-mountainlion/TestExpectations: Added.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] instantiateV8Object should encapulate the tricky creationContext logic
https://bugs.webkit.org/show_bug.cgi?id=102117

Reviewed by Eric Seidel.

The logic around creationContext is tricky. Rather than putting the
logic in the code generator, we can centralize the logic in
instantiateV8Object.

This patch shouldn't have any behavior change.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateToV8Converters):
* bindings/v8/V8DOMWrapper.cpp:
(V8WrapperInstantiationScope):
(WebCore::V8WrapperInstantiationScope::V8WrapperInstantiationScope):
(WebCore::V8WrapperInstantiationScope::~V8WrapperInstantiationScope):
(WebCore::V8WrapperInstantiationScope::context):
(WebCore):
(WebCore::V8DOMWrapper::instantiateV8Object):
* bindings/v8/V8DOMWrapper.h:
(V8DOMWrapper):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix FastMalloc.cpp compile error for MSVC in 64-bit.
https://bugs.webkit.org/show_bug.cgi?id=88344

Patch by Brent Fulgham  <bfulgham@webkit.org> and Alex Christensen <alex.christensen@flexsim.com> on 2012-11-13
Reviewed by Ryosuke Niwa.

MSVC will not compile array declarations of zero size. The existing
padding math for TCMalloc_Central_FreeListPadded would evaluate
to zero on 64-bit machines, preventing the compile from finishing.

* wtf/FastMalloc.cpp:
(TCMalloc_Central_FreeListPadded_Template): Add new template (and
zero-size specialization) to provide proper behavior under 64-bit
Windows build.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r134490.

* wtf/FastMalloc.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix media/video-empty-source.html lint error.

* platform/chromium/TestExpectations: Fixed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSEventListener should not access m_jsFunction when its wrapper is gone.
https://bugs.webkit.org/show_bug.cgi?id=101985.

Reviewed by Geoffrey Garen.

Added a few null checks for m_wrapper before we do anything with m_jsFunction.

No new tests.

* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::initializeJSFunction):
- Removed a now invalid assertion. m_wrapper is expected to have a
  valid non-zero value when jsFunction is valid. However, in the case
  of JSLazyEventListener (which extends JSEventListener), m_wrapper is
  initially 0 when m_jsFunction has not been realized yet. When
  JSLazyEventListener::initializeJSFunction() realizes m_jsFunction,
  it will set m_wrapper to an appropriate wrapper object.

  For this reason, JSEventListener::jsFunction() cannot do the null
  check on m_wrapper until after the call to initializeJSFunction.

  This, in turns, means that in the case of the non-lazy
  JSEventListener, initializeJSFunction() will also be called, and
  if the GC has collected the m_wrapper but the JSEventListener has
  not been removed yet, it is possible to see a null m_wrapper while
  m_jsFunction contains a non-zero stale value.

  Hence, this assertion of (m_wrapper || !m_jsFunction) in
  JSEventListener::initializeJSFunction() is not always true and
  should be removed.

(WebCore::JSEventListener::visitJSFunction):
(WebCore::JSEventListener::operator==):
* bindings/js/JSEventListener.h:
(WebCore::JSEventListener::jsFunction):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: MathML types need to be semantically identified in AX tree
https://bugs.webkit.org/show_bug.cgi?id=101263

Reviewed by Beth Dakin.

Source/WebCore: 

Semantically identify various MathML elements within the AX tree. This will allow
screen readers to identify math types so that equations can be output more accurately.

Test: platform/mac/accessibility/mathml-elements.html

* accessibility/AccessibilityObject.h:
(AccessibilityObject):
(WebCore::AccessibilityObject::isMathElement):
(WebCore::AccessibilityObject::isMathFraction):
(WebCore::AccessibilityObject::isMathFenced):
(WebCore::AccessibilityObject::isMathSubscriptSuperscript):
(WebCore::AccessibilityObject::isMathRow):
(WebCore::AccessibilityObject::isMathUnderOver):
(WebCore::AccessibilityObject::isMathRoot):
(WebCore::AccessibilityObject::isMathSquareRoot):
(WebCore::AccessibilityObject::isMathText):
(WebCore::AccessibilityObject::isMathNumber):
(WebCore::AccessibilityObject::isMathOperator):
(WebCore::AccessibilityObject::isMathFenceOperator):
(WebCore::AccessibilityObject::isMathSeparatorOperator):
(WebCore::AccessibilityObject::isMathIdentifier):
(WebCore::AccessibilityObject::isMathTable):
(WebCore::AccessibilityObject::isMathTableRow):
(WebCore::AccessibilityObject::isMathTableCell):
(WebCore::AccessibilityObject::mathRadicandObject):
(WebCore::AccessibilityObject::mathRootIndexObject):
(WebCore::AccessibilityObject::mathUnderObject):
(WebCore::AccessibilityObject::mathOverObject):
(WebCore::AccessibilityObject::mathNumeratorObject):
(WebCore::AccessibilityObject::mathDenominatorObject):
(WebCore::AccessibilityObject::mathBaseObject):
(WebCore::AccessibilityObject::mathSubscriptObject):
(WebCore::AccessibilityObject::mathSuperscriptObject):
(WebCore::AccessibilityObject::mathFencedOpenString):
(WebCore::AccessibilityObject::mathFencedCloseString):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::startOfContinuations):
    Handle a case where a MathML render element is created with the node of their parent (which could lead to an assert).
(WebCore::AccessibilityRenderObject::textUnderElement):
    Handle the cases for RenderMathMLOperators which use the node of their parent, which confuses the normal textUnderElement() routine.
(WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
    Handle ignored cases for math elements
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::isMathElement):
(WebCore::AccessibilityRenderObject::isMathFraction):
(WebCore::AccessibilityRenderObject::isMathFenced):
(WebCore::AccessibilityRenderObject::isMathSubscriptSuperscript):
(WebCore::AccessibilityRenderObject::isMathRow):
(WebCore::AccessibilityRenderObject::isMathUnderOver):
(WebCore::AccessibilityRenderObject::isMathSquareRoot):
(WebCore::AccessibilityRenderObject::isMathRoot):
(WebCore::AccessibilityRenderObject::isMathOperator):
(WebCore::AccessibilityRenderObject::isMathFenceOperator):
(WebCore::AccessibilityRenderObject::isMathSeparatorOperator):
(WebCore::AccessibilityRenderObject::isMathText):
(WebCore::AccessibilityRenderObject::isMathNumber):
(WebCore::AccessibilityRenderObject::isMathIdentifier):
(WebCore::AccessibilityRenderObject::isMathTable):
(WebCore::AccessibilityRenderObject::isMathTableRow):
(WebCore::AccessibilityRenderObject::isMathTableCell):
(WebCore::AccessibilityRenderObject::isIgnoredElementWithinMathTree):
    Make sure anonymouse blocks are ignored within math tree; make sure non-element type objects are ignored (like <mstyle>).
(WebCore::AccessibilityRenderObject::mathRadicandObject):
(WebCore::AccessibilityRenderObject::mathRootIndexObject):
(WebCore::AccessibilityRenderObject::mathNumeratorObject):
(WebCore::AccessibilityRenderObject::mathDenominatorObject):
(WebCore::AccessibilityRenderObject::mathUnderObject):
(WebCore::AccessibilityRenderObject::mathOverObject):
(WebCore::AccessibilityRenderObject::mathBaseObject):
(WebCore::AccessibilityRenderObject::mathSubscriptObject):
(WebCore::AccessibilityRenderObject::mathSuperscriptObject):
(WebCore::AccessibilityRenderObject::mathFencedOpenString):
(WebCore::AccessibilityRenderObject::mathFencedCloseString):
* accessibility/AccessibilityRenderObject.h:
(AccessibilityRenderObject):
* accessibility/mac/WebAccessibilityObjectWrapper.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::isRenderMathMLFenced):
(WebCore::RenderMathMLBlock::isRenderMathMLFraction):
(WebCore::RenderMathMLBlock::isRenderMathMLRoot):
(WebCore::RenderMathMLBlock::isRenderMathMLSquareRoot):
(WebCore::RenderMathMLBlock::isRenderMathMLSubSup):
(WebCore::RenderMathMLBlock::isRenderMathMLUnderOver):
(WebCore::RenderMathMLBlock::setIgnoreInAccessibilityTree):
(WebCore::RenderMathMLBlock::ignoreInAccessibilityTree):
    Add ability to identify anonymous render blocks as items that AX should ignore.
(RenderMathMLBlock):
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::createMathMLOperator):
    Identify which kind of math operator is being created on the fly (Fence or Separator)
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
* rendering/mathml/RenderMathMLFenced.h:
(WebCore::RenderMathMLFenced::isRenderMathMLFenced):
(RenderMathMLFenced):
* rendering/mathml/RenderMathMLFraction.h:
(WebCore::RenderMathMLFraction::isRenderMathMLFraction):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::RenderMathMLOperator):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::createGlyph):
     Mark anonymous render blocks as AX ignored.
* rendering/mathml/RenderMathMLOperator.h:
(WebCore::RenderMathMLOperator::setOperatorType):
(WebCore::RenderMathMLOperator::operatorType):
(RenderMathMLOperator):
* rendering/mathml/RenderMathMLRoot.h:
(WebCore::RenderMathMLRoot::isRenderMathMLRoot):
* rendering/mathml/RenderMathMLSquareRoot.h:
(WebCore::RenderMathMLSquareRoot::isRenderMathMLSquareRoot):
* rendering/mathml/RenderMathMLSubSup.h:
(WebCore::RenderMathMLSubSup::isRenderMathMLSubSup):
* rendering/mathml/RenderMathMLUnderOver.h:
(WebCore::RenderMathMLUnderOver::isRenderMathMLUnderOver):

Source/WebKit/chromium: 

* public/WebAccessibilityRole.h:
* src/AssertMatchingEnums.cpp:
    Add new accessibility role.

LayoutTests: 

* platform/mac/accessibility/mathml-elements-expected.txt: Added.
* platform/mac/accessibility/mathml-elements.html: Added.



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