Refactor Media Control Elements to remove code duplication.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 04:01:13 +0000 (04:01 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Dec 2012 04:01:13 +0000 (04:01 +0000)
commit1042dceff80e9eb6c34da6f6e8dc9c1af022ed7c
treef3b613d4e4c83918c7c330e4e95837537b192872
parent7ef2246782fdf98bab4a466aec440a763b015e86
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: https://svn.webkit.org/repository/webkit/trunk@136613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/shadow/MediaControlElementTypes.cpp [new file with mode: 0644]
Source/WebCore/html/shadow/MediaControlElementTypes.h [new file with mode: 0644]
Source/WebCore/html/shadow/MediaControlElements.cpp
Source/WebCore/html/shadow/MediaControlElements.h
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/html/shadow/MediaControls.h
Source/WebCore/html/shadow/MediaControlsApple.cpp
Source/WebCore/html/shadow/MediaControlsApple.h
Source/WebCore/html/shadow/MediaControlsChromium.cpp
Source/WebCore/html/shadow/MediaControlsChromium.h
Source/WebCore/html/shadow/MediaControlsChromiumAndroid.cpp
Source/WebCore/html/shadow/MediaControlsChromiumAndroid.h
Source/WebCore/rendering/RenderMediaControlElements.cpp [new file with mode: 0644]
Source/WebCore/rendering/RenderMediaControlElements.h [new file with mode: 0644]
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebCore/rendering/RenderingAllInOne.cpp