Refactor Media Control Elements to remove code duplication.
https://bugs.webkit.org/show_bug.cgi?id=101877

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

Instead of having two different types of inheritance trees for
MediaControlElement and MediaControlInputElement, this
creates a stand-alone virtual class MediaControlElement that
provides the common functions: show(), hide(), isShowing(),
setMediaController(), displayType(), isMediaControlElement(),
shadowPseudoId(), mediaController(), setDisplayType().

The individual elements inherit from MediaControlElement and
either HTMLInputElement or HTMLDivElement. They extend/override
the base functions as appropriate.

As part of this, the RenderXXX classes mixed in between the media
controls in MediaControlElements.cpp are also moved to
rendering/RenderMediaControls.h/cpp to follow common code separation.

No new tests since this is just a refactoring.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Build files extended with new files.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::textTracksIndexNotFound):
Replaced const with function, since it is used in multiple files.

* html/shadow/MediaControlElementTypes.cpp: new file
* html/shadow/MediaControlElementTypes.h: new file
Added new MediaControlElement class. Moved MediaControlDivElement and MediaControlInputElement
classes into these files from MediaControlElements.cpp/h. Moved MediaControlElementTypes enum
into these. Moved other media control element classes that are the basis for inheriting media
control elements into these (MediaControlTimeDisplayElement, MediaControlMuteButtonElement,
MediaControlSeekButtonElement, MediaControlVolumeSliderElement).

* html/shadow/MediaControlElements.cpp:
* html/shadow/MediaControlElements.h:
Removed common functions between media elements that are now in the common
base class MediaControlElement.
Also moved common base classes to MediaControlElementTypes.h/cpp

* html/shadow/MediaControls.cpp:
* html/shadow/MediaControls.h:
Renamed MediaControlVolumeSliderElement to MediaControlPanelVolumeSliderElement
to be consistent in inheritance tree. Updated copyright date.

* html/shadow/MediaControlsApple.cpp:
* html/shadow/MediaControlsApple.h:
Renamed MediaControlVolumeSliderElement to MediaControlPanelVolumeSliderElement
to be consistent in inheritance tree. Updated copyright dates.n

* html/shadow/MediaControlsChromium.cpp:
* html/shadow/MediaControlsChromium.h:
Renamed MediaControlVolumeSliderElement to MediaControlPanelVolumeSliderElement
to be consistent in inheritance tree.
Moved enclosure element definitions to common MediaControlElements.cpp/h
file through which different media elements are made available to different ports.

* html/shadow/MediaControlsChromiumAndroid.cpp:
* html/shadow/MediaControlsChromiumAndroid.h:
Moved enclosure for overlay button to MediaControlElements.cpp/h files
through which different media elements are made available to different ports.

* rendering/RenderMediaControlElements.cpp: new file
* rendering/RenderMediaControlElements.h: new file
Moved rendering classes for media control elements into these files from
MediaControlElements.cpp/h.

* rendering/RenderThemeMac.mm:
Added new RenderMediaControlElements.h file.

* rendering/RenderingAllInOne.cpp:
Added new RenderMediaControlEleemnt.cpp file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, WebKit gardening.

* platform/chromium/TestExpectations:
Updated css3/filters/effect-reference-hw.html's expectation.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Style sharing: Allow sharing between elements with classes not referenced by any selectors.
<http://webkit.org/b/103925>

Reviewed by Antti Koivisto.

When looking for elements that can share style, instead of blindly rejecting candidates with
a different "class" attribute, check if it's actually referenced by any of the tracked style rules.
It's surprisingly common for web pages to have elements with classes to which no rules apply,
mediawiki content is especially good at this.

~2100 new sharing "hits" on <https://en.wikipedia.org/wiki/Steve_Jobs>.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement):

    Don't bail early if the two elements have different return values for hasClass().

(WebCore::StyleResolver::classNamesAffectedByRules):

    Helper function that returns whether a SpaceSplitString contains a class name referenced
    by any style rules.

(WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):

    Make this a member function since we need access to m_features.classesInRules.

* css/StyleResolver.h:
(StyleResolver):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::locateSharedStyle):

    Cache whether the element we're resolving style for has a "class" attribute referenced by style rules.

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