https://bugs.webkit.org/show_bug.cgi?id=121080
Reviewed by Andreas Kling.
Clean-up remained functions of HTML elements using auto-generated isFooElement(),
and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
Besides this patch clean-up unnecessary checks which are being supported by
auto-generated isFooElement().
Source/WebCore:
No new tests, no behavior change.
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::notifyChildrenSelectionChange):
* html/HTMLFrameElementBase.h:
(WebCore::toHTMLFrameElementBase):
* html/HTMLIFrameElement.h:
* html/HTMLImageLoader.cpp:
(WebCore::HTMLImageLoader::dispatchLoadEvent):
(WebCore::HTMLImageLoader::notifyFinished):
* html/HTMLObjectElemenaeh:
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
* html/HTMLSelectElement.h:
* html/HTMLTagNames.in:
* html/HTMLVideoElement.h:
* html/shadow/HTMLContentElement.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* page/PageSerializer.cpp:
(WebCore::frameOwnerURLAttributeName):
* page/SpatialNavigation.cpp:
(WebCore::canScrollInDirection):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::getURLForImageNode):
* plugins/IFrameShimSupport.cpp:
(WebCore::getPluginOcclusions):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::mediaSupportsFullscreen):
(WebCore::HitTestResult::mediaElement):
(WebCore::HitTestResult::enterFullscreenForVideo):
(WebCore::HitTestResult::mediaIsVideo):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForVideo):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::RenderListBox):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::RenderMenuList):
* testing/Internals.cpp:
(WebCore::Internals::isSelectPopupVisible):
Source/WebKit/blackberry:
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::adjustRectOffsetForFrameOffset):
(BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited):
(BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
(BlackBerry::WebKit::WebPagePrivate::exitFullscreenForNode):
(BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
(BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::supportsFullscreenForNode):
* WebCoreSupport/EditorClientBlackBerry.cpp:
(WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
* WebKitSupport/DOMSupport.cpp:
(BlackBerry::WebKit::DOMSupport::isElementTypePlugin):
* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
(BlackBerry::WebKit::InputHandler::didNodeOpenPopup):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
Source/WebKit/gtk:
No new tests, no behavior change.
* WebCoreSupport/ChromeClientGtk.cpp:
(WebKit::ChromeClient::supportsFullscreenForNode):
Source/WebKit/mac:
No new tests, no behavior change.
* Plugins/WebPluginController.mm:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsFullscreenForNode):
* WebView/WebView.mm:
(-[WebView _enterFullscreenForNode:WebCore::]):
Source/WebKit/qt:
* WebCoreSupport/ChromeClientQt.cpp:
Source/WebKit/win:
* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::supportsFullscreenForNode):
* WebView.cpp:
(WebView::enterFullscreenForNode):
Source/WebKit2:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::containsAnyFormControls):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155507
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ No new tests, no behavior change.
+
+ * accessibility/atk/AXObjectCacheAtk.cpp:
+ (WebCore::notifyChildrenSelectionChange):
+ * html/HTMLFrameElementBase.h:
+ (WebCore::toHTMLFrameElementBase):
+ * html/HTMLIFrameElement.h:
+ * html/HTMLImageLoader.cpp:
+ (WebCore::HTMLImageLoader::dispatchLoadEvent):
+ (WebCore::HTMLImageLoader::notifyFinished):
+ * html/HTMLObjectElemenaeh:
+ * html/HTMLOptionsCollection.cpp:
+ (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
+ * html/HTMLSelectElement.h:
+ * html/HTMLTagNames.in:
+ * html/HTMLVideoElement.h:
+ * html/shadow/HTMLContentElement.h:
+ * loader/ImageLoader.cpp:
+ (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
+ * loader/archive/cf/LegacyWebArchive.cpp:
+ (WebCore::LegacyWebArchive::create):
+ * page/PageSerializer.cpp:
+ (WebCore::frameOwnerURLAttributeName):
+ * page/SpatialNavigation.cpp:
+ (WebCore::canScrollInDirection):
+ * platform/gtk/PasteboardGtk.cpp:
+ (WebCore::getURLForImageNode):
+ * plugins/IFrameShimSupport.cpp:
+ (WebCore::getPluginOcclusions):
+ * rendering/HitTestResult.cpp:
+ (WebCore::HitTestResult::mediaSupportsFullscreen):
+ (WebCore::HitTestResult::mediaElement):
+ (WebCore::HitTestResult::enterFullscreenForVideo):
+ (WebCore::HitTestResult::mediaIsVideo):
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresCompositingForVideo):
+ * rendering/RenderListBox.cpp:
+ (WebCore::RenderListBox::RenderListBox):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::RenderMenuList):
+ * testing/Internals.cpp:
+ (WebCore::Internals::isSelectPopupVisible):
+
2013-09-11 Chris Fleizach <cfleizach@apple.com>
AX: Mac platform is not using accessibilityTitle from the Base implementation
// Only support HTML select elements so far (ARIA selectors not supported).
Node* node = object->node();
- if (!node || !node->hasTagName(HTMLNames::selectTag))
+ if (!node || !isHTMLSelectElement(node))
return;
// Emit signal from the listbox's point of view first.
inline HTMLFrameElementBase* toHTMLFrameElementBase(Node* node)
{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::frameTag) || node->hasTagName(HTMLNames::iframeTag));
+ ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLFrameElement(node) || isHTMLIFrameElement(node));
return static_cast<HTMLFrameElementBase*>(node);
}
virtual void didRecalcStyle(Style::Change) OVERRIDE;
};
-inline HTMLIFrameElement* toHTMLIFrameElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::iframeTag));
- return static_cast<HTMLIFrameElement*>(node);
-}
+ELEMENT_TYPE_CASTS(HTMLIFrameElement)
} // namespace WebCore
void HTMLImageLoader::dispatchLoadEvent()
{
// HTMLVideoElement uses this class to load the poster image, but it should not fire events for loading or failure.
- if (element()->hasTagName(HTMLNames::videoTag))
+ if (isHTMLVideoElement(element()))
return;
bool errorOccurred = image()->errorOccurred();
if (!errorOccurred && image()->response().httpStatusCode() >= 400)
- errorOccurred = element()->hasTagName(HTMLNames::objectTag); // An <object> considers a 404 to be an error and should fire onerror.
+ errorOccurred = isHTMLObjectElement(element()); // An <object> considers a 404 to be an error and should fire onerror.
element()->dispatchEvent(Event::create(errorOccurred ? eventNames().errorEvent : eventNames().loadEvent, false, false));
}
}
}
- if (loadError && element->hasTagName(HTMLNames::objectTag))
+ if (loadError && isHTMLObjectElement(element.get()))
static_cast<HTMLObjectElement*>(element.get())->renderFallbackContent();
}
bool m_useFallbackContent : 1;
};
-inline HTMLObjectElement* toHTMLObjectElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::objectTag));
- return static_cast<HTMLObjectElement*>(node);
-}
+ELEMENT_TYPE_CASTS(HTMLObjectElement)
}
HTMLOptionsCollection::HTMLOptionsCollection(Node* select)
: HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter)
{
- ASSERT(select->hasTagName(HTMLNames::selectTag));
+ ASSERT(isHTMLSelectElement(select));
}
PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(Node* select, CollectionType)
mutable bool m_shouldRecalcListItems;
};
-inline HTMLSelectElement* toHTMLSelectElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::selectTag));
- return static_cast<HTMLSelectElement*>(node);
-}
+ELEMENT_TYPE_CASTS(HTMLSelectElement)
} // namespace
col interfaceName=HTMLTableColElement
colgroup interfaceName=HTMLTableColElement
command interfaceName=HTMLElement
-content interfaceName=HTMLContentElement, conditional=SHADOW_DOM, runtimeConditional=shadowDOM
+content interfaceName=HTMLContentElement, conditional=SHADOW_DOM, runtimeConditional=shadowDOM, generateTypeHelpers
webkitShadowContent interfaceName=HTMLElement, noConstructor
datalist interfaceName=HTMLDataListElement, conditional=DATALIST_ELEMENT
dd interfaceName=HTMLElement
font
footer interfaceName=HTMLElement
form generateTypeHelpers
-frame
+frame generateTypeHelpers
frameset interfaceName=HTMLFrameSetElement, generateTypeHelpers
h1 interfaceName=HTMLHeadingElement
h2 interfaceName=HTMLHeadingElement
hr interfaceName=HTMLHRElement
html
i interfaceName=HTMLElement
-iframe interfaceName=HTMLIFrameElement
+iframe interfaceName=HTMLIFrameElement, generateTypeHelpers
image interfaceName=HTMLElement
img interfaceName=HTMLImageElement, constructorNeedsFormElement, generateTypeHelpers
input constructorNeedsFormElement, constructorNeedsCreatedByParser, generateTypeHelpers
noembed interfaceName=HTMLElement
noframes interfaceName=HTMLElement
nolayer interfaceName=HTMLElement
-object constructorNeedsFormElement, constructorNeedsCreatedByParser
+object constructorNeedsFormElement, constructorNeedsCreatedByParser, generateTypeHelpers
ol interfaceName=HTMLOListElement
optgroup interfaceName=HTMLOptGroupElement, generateTypeHelpers
option generateTypeHelpers
samp interfaceName=HTMLElement
script constructorNeedsCreatedByParser, generateTypeHelpers
section interfaceName=HTMLElement
-select constructorNeedsFormElement
+select constructorNeedsFormElement, generateTypeHelpers
small interfaceName=HTMLElement
source wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, generateTypeHelpers
span
u interfaceName=HTMLElement
ul interfaceName=HTMLUListElement
var interfaceName=HTMLElement
-video wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser
+video wrapperOnlyIfMediaIsAvailable, conditional=VIDEO, constructorNeedsCreatedByParser, generateTypeHelpers
wbr interfaceName=HTMLElement
xmp interfaceName=HTMLPreElement
noscript interfaceName=HTMLElement
AtomicString m_defaultPosterURL;
};
-inline HTMLVideoElement* toHTMLVideoElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(HTMLNames::videoTag));
- return static_cast<HTMLVideoElement*>(node);
-}
+ELEMENT_TYPE_CASTS(HTMLVideoElement)
} //namespace
return m_selectorList;
}
-inline bool isHTMLContentElement(const Node* node)
-{
- ASSERT(node);
- return node->isInsertionPoint() && toInsertionPoint(node)->insertionPointType() == InsertionPoint::HTMLContentElementType;
-}
-
-inline HTMLContentElement* toHTMLContentElement(Node* node)
-{
- ASSERT_WITH_SECURITY_IMPLICATION(!node || isHTMLContentElement(node));
- return static_cast<HTMLContentElement*>(node);
-}
-
#endif // if ENABLE(SHADOW_DOM)
}
loadEventSender().cancelEvent(this);
m_hasPendingLoadEvent = false;
- if (m_element->hasTagName(HTMLNames::objectTag))
+ if (isHTMLObjectElement(m_element))
static_cast<HTMLObjectElement*>(m_element)->renderFallbackContent();
// Only consider updating the protection ref-count of the Element immediately before returning
for (size_t i = 0; i < nodesSize; ++i) {
Node* node = nodes[i];
Frame* childFrame;
- if ((node->hasTagName(HTMLNames::frameTag) || node->hasTagName(HTMLNames::iframeTag) || node->hasTagName(HTMLNames::objectTag)) &&
- (childFrame = toFrameOwnerElement(node)->contentFrame())) {
+ if ((isHTMLFrameElement(node) || isHTMLIFrameElement(node) || isHTMLObjectElement(node))
+ && (childFrame = toFrameOwnerElement(node)->contentFrame())) {
if (frameFilter && !frameFilter->shouldIncludeSubframe(childFrame))
continue;
static const QualifiedName& frameOwnerURLAttributeName(const HTMLFrameOwnerElement& frameOwner)
{
// FIXME: We should support all frame owners including applets.
- return frameOwner.hasTagName(HTMLNames::objectTag) ? HTMLNames::dataAttr : HTMLNames::srcAttr;
+ return isHTMLObjectElement(frameOwner) ? HTMLNames::dataAttr : HTMLNames::srcAttr;
}
class SerializerMarkupAccumulator : public WebCore::MarkupAccumulator {
{
ASSERT(container);
- if (container->hasTagName(HTMLNames::selectTag))
+ if (isHTMLSelectElement(container))
return false;
if (container->isDocumentNode())
else if (node->hasTagName(SVGNames::imageTag))
urlString = toElement(node)->getAttribute(XLinkNames::hrefAttr);
#endif
- else if (node->hasTagName(HTMLNames::embedTag) || node->hasTagName(HTMLNames::objectTag)) {
+ else if (node->hasTagName(HTMLNames::embedTag) || isHTMLObjectElement(node)) {
Element* element = toElement(node);
urlString = element->imageSourceURL();
}
HTMLElement* element = frameView->frame().ownerElement();
RenderObject* iframeRenderer = element->renderer();
- if (element->hasTagName(HTMLNames::iframeTag)
+ if (isHTMLIFrameElement(element)
&& iframeRenderer->absoluteBoundingBoxRectIgnoringTransforms().intersects(frameRect)
&& (!iframeRenderer->style() || iframeRenderer->style()->visibility() == VISIBLE)) {
getObjectStack(iframeRenderer, &iframeZstack);
{
#if ENABLE(VIDEO)
HTMLMediaElement* mediaElt(mediaElement());
- return (mediaElt && mediaElt->hasTagName(HTMLNames::videoTag) && mediaElt->supportsFullscreen());
+ return (mediaElt && isHTMLVideoElement(mediaElt) && mediaElt->supportsFullscreen());
#else
return false;
#endif
if (!(m_innerNonSharedNode->renderer() && m_innerNonSharedNode->renderer()->isMedia()))
return 0;
- if (m_innerNonSharedNode->hasTagName(HTMLNames::videoTag) || isHTMLAudioElement(m_innerNonSharedNode.get()))
+ if (isHTMLVideoElement(m_innerNonSharedNode.get()) || isHTMLAudioElement(m_innerNonSharedNode.get()))
return toHTMLMediaElement(m_innerNonSharedNode.get());
return 0;
}
{
#if ENABLE(VIDEO)
HTMLMediaElement* mediaElt(mediaElement());
- if (mediaElt && mediaElt->hasTagName(HTMLNames::videoTag)) {
+ if (mediaElt && isHTMLVideoElement(mediaElt)) {
HTMLVideoElement* videoElt = toHTMLVideoElement(mediaElt);
if (!videoElt->isFullscreen() && mediaElt->supportsFullscreen()) {
UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
{
#if ENABLE(VIDEO)
if (HTMLMediaElement* mediaElt = mediaElement())
- return mediaElt->hasTagName(HTMLNames::videoTag);
+ return isHTMLVideoElement(mediaElt);
#endif
return false;
}
return false;
Node* node = renderer->node();
- if (!node || (!node->hasTagName(HTMLNames::videoTag) && !isHTMLAudioElement(node)))
+ if (!node || (!isHTMLVideoElement(node) && !isHTMLAudioElement(node)))
return false;
HTMLMediaElement* mediaElement = toHTMLMediaElement(node);
{
ASSERT(element);
ASSERT(element->isHTMLElement());
- ASSERT(element->hasTagName(HTMLNames::selectTag));
+ ASSERT(isHTMLSelectElement(element));
view().frameView().addScrollableArea(this);
}
{
ASSERT(element);
ASSERT(element->isHTMLElement());
- ASSERT(element->hasTagName(HTMLNames::selectTag));
+ ASSERT(isHTMLSelectElement(element));
}
RenderMenuList::~RenderMenuList()
bool Internals::isSelectPopupVisible(Node* node)
{
- if (!node->hasTagName(HTMLNames::selectTag))
+ if (!isHTMLSelectElement(node))
return false;
HTMLSelectElement* select = toHTMLSelectElement(node);
Node* ownerNode = static_cast<Node*>(frame->ownerElement());
tnode = ownerNode;
- if (ownerNode && (ownerNode->hasTagName(HTMLNames::iframeTag) || ownerNode->hasTagName(HTMLNames::frameTag))) {
+ if (ownerNode && (isHTMLIFrameElement(ownerNode) || isHTMLFrameNode(ownerNode))) {
IntRect iFrameRect;
do {
iFrameRect = rectForNode(ownerNode);
Element* element = toElement(d->m_fullscreenNode.get());
if (!element)
return;
- if (d->m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag))
+ if (d->m_webSettings->fullScreenVideoCapable() && isHTMLVideoElement(element))
toHTMLMediaElement(element)->exitFullscreen();
#if ENABLE(FULLSCREEN_API)
else
void WebPagePrivate::enterFullscreenForNode(Node* node)
{
#if ENABLE(VIDEO)
- if (!node || !node->hasTagName(HTMLNames::videoTag))
+ if (!node || !isHTMLVideoElement(node))
return;
MediaPlayer* player = toHTMLMediaElement(node)->player();
m_fullscreenNode = 0;
}
- if (!node || !node->hasTagName(HTMLNames::videoTag))
+ if (!node || !isHTMLVideoElement(node))
return;
MediaPlayer* player = toHTMLMediaElement(node)->player();
#if ENABLE(VIDEO)
if (!element)
return;
- if (m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag)) {
+ if (m_webSettings->fullScreenVideoCapable() && isHTMLVideoElement(element)) {
// The Browser chrome has its own fullscreen video widget it wants to
// use, and this is a video element. The only reason that
// webkitWillEnterFullScreenForElement() and
#if ENABLE(VIDEO)
if (!element)
return;
- if (m_webSettings->fullScreenVideoCapable() && element->hasTagName(HTMLNames::videoTag)) {
+ if (m_webSettings->fullScreenVideoCapable() && isHTMLVideoElement(element)) {
// The Browser chrome has its own fullscreen video widget.
exitFullscreenForNode(element);
} else {
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPagePrivate::adjustRectOffsetForFrameOffset):
+ (BlackBerry::WebKit::WebPage::notifyFullScreenVideoExited):
+ (BlackBerry::WebKit::WebPagePrivate::enterFullscreenForNode):
+ (BlackBerry::WebKit::WebPagePrivate::exitFullscreenForNode):
+ (BlackBerry::WebKit::WebPagePrivate::enterFullScreenForElement):
+ (BlackBerry::WebKit::WebPagePrivate::exitFullScreenForElement):
+ * WebCoreSupport/ChromeClientBlackBerry.cpp:
+ (WebCore::ChromeClientBlackBerry::supportsFullscreenForNode):
+ * WebCoreSupport/EditorClientBlackBerry.cpp:
+ (WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
+ * WebKitSupport/DOMSupport.cpp:
+ (BlackBerry::WebKit::DOMSupport::isElementTypePlugin):
+ * WebKitSupport/InputHandler.cpp:
+ (BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
+ (BlackBerry::WebKit::InputHandler::didNodeOpenPopup):
+ * WebKitSupport/SelectionHandler.cpp:
+ (BlackBerry::WebKit::SelectionHandler::selectionPositionChanged):
+
2013-09-08 Anders Carlsson <andersca@apple.com>
Move WTF::notFound to Vector.h and delete NotFound.h
bool ChromeClientBlackBerry::supportsFullscreenForNode(const Node* node)
{
- return node->hasTagName(HTMLNames::videoTag);
+ return isHTMLVideoElement(node);
}
void ChromeClientBlackBerry::enterFullscreenForNode(Node* node)
Frame* frame = m_webPagePrivate->focusedOrMainFrame();
if (frame && frame->document()) {
if (Element* focusedElement = frame->document()->focusedElement()) {
- if (focusedElement->hasTagName(HTMLNames::selectTag))
+ if (isHTMLSelectElement(focusedElement))
return false;
if (DOMSupport::isPopupInputField(focusedElement))
return false;
if (!element)
return false;
- if (element->hasTagName(HTMLNames::objectTag)
+ if (isHTMLObjectElement(element)
|| element->hasTagName(HTMLNames::embedTag)
|| element->hasTagName(HTMLNames::appletTag))
return true;
ASSERT(!node->isInShadowTree());
- if (node->hasTagName(HTMLNames::selectTag) || isHTMLOptionElement(node)) {
+ if (isHTMLSelectElement(node) || isHTMLOptionElement(node)) {
// We open list popups for options and selects.
return true;
}
ASSERT(!node->isInShadowTree());
- if (node->hasTagName(HTMLNames::selectTag))
+ if (isHTMLSelectElement(node))
return openSelectPopup(toHTMLSelectElement(node));
if (isHTMLOptionElement(node)) {
return;
if (Node* focusedNode = frame->document()->focusedElement()) {
- if (focusedNode->hasTagName(HTMLNames::selectTag) || (focusedNode->isElementNode() && DOMSupport::isPopupInputField(toElement(focusedNode)))) {
+ if (isHTMLSelectElement(focusedNode) || (focusedNode->isElementNode() && DOMSupport::isPopupInputField(toElement(focusedNode)))) {
SelectionLog(Platform::LogLevelInfo, "SelectionHandler::selectionPositionChanged selection is on a popup control, skipping rendering.");
return;
}
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ No new tests, no behavior change.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::supportsFullscreenForNode):
+
2013-09-04 Zan Dobersek <zdobersek@igalia.com>
[GTK] Add support for the Wayland build target
#if ENABLE(VIDEO) && USE(NATIVE_FULLSCREEN_VIDEO)
bool ChromeClient::supportsFullscreenForNode(const Node* node)
{
- return node->hasTagName(HTMLNames::videoTag);
+ return isHTMLVideoElement(node);
}
void ChromeClient::enterFullscreenForNode(Node* node)
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ No new tests, no behavior change.
+
+ * Plugins/WebPluginController.mm:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::supportsFullscreenForNode):
+ * WebView/WebView.mm:
+ (-[WebView _enterFullscreenForNode:WebCore::]):
+
2013-09-10 Daniel Bates <dabates@apple.com>
[iOS] Upstream text autosizing
}
Element* node = core(element);
- if (!node || (!node->hasTagName(HTMLNames::videoTag) && !isHTMLAudioElement(node))) {
+ if (!node || (!isHTMLVideoElement(node) && !isHTMLAudioElement(node))) {
LOG_ERROR("invalid media element passed");
return nil;
}
bool WebChromeClient::supportsFullscreenForNode(const Node* node)
{
- return node->hasTagName(WebCore::HTMLNames::videoTag);
+ return isHTMLVideoElement(node);
}
void WebChromeClient::enterFullscreenForNode(Node* node)
- (void)_enterFullscreenForNode:(WebCore::Node*)node
{
- ASSERT(node->hasTagName(WebCore::HTMLNames::videoTag));
+ ASSERT(isHTMLVideoElement(node));
HTMLMediaElement* videoElement = toHTMLMediaElement(node);
if (_private->fullscreenController) {
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+
2013-09-03 Allan Sandfeld Jensen <allan.jensen@digia.com>
[Qt] Images scaled poorly on composited canvas
bool ChromeClientQt::supportsFullscreenForNode(const Node* node)
{
ASSERT(node);
- return node->hasTagName(HTMLNames::videoTag) && fullScreenVideo()->isValid();
+ return isHTMLVideoElement(node) && fullScreenVideo()->isValid();
}
bool ChromeClientQt::requiresFullscreenForVideoPlayback()
void ChromeClientQt::enterFullscreenForNode(Node* node)
{
- ASSERT(node && node->hasTagName(HTMLNames::videoTag));
+ ASSERT(node && isHTMLVideoElement(node));
fullScreenVideo()->enterFullScreenForNode(node);
}
void ChromeClientQt::exitFullscreenForNode(Node* node)
{
- ASSERT(node && node->hasTagName(HTMLNames::videoTag));
+ ASSERT(node && isHTMLVideoElement(node));
fullScreenVideo()->exitFullScreenForNode(node);
}
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ * WebCoreSupport/WebChromeClient.cpp:
+ (WebChromeClient::supportsFullscreenForNode):
+ * WebView.cpp:
+ (WebView::enterFullscreenForNode):
+
2013-09-10 Brent Fulgham <bfulgham@apple.com>
[Windows] Create SharedGDIObject Class Template
bool WebChromeClient::supportsFullscreenForNode(const Node* node)
{
- return node->hasTagName(HTMLNames::videoTag);
+ return isHTMLVideoElement(node);
}
void WebChromeClient::enterFullscreenForNode(Node* node)
void WebView::enterFullscreenForNode(Node* node)
{
- if (!node->hasTagName(HTMLNames::videoTag) || !node->isElementNode())
+ if (!isHTMLVideoElement(node) || !node->isElementNode())
return;
#if ENABLE(VIDEO)
+2013-09-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Generate more HTML type checks and casting
+ https://bugs.webkit.org/show_bug.cgi?id=121080
+
+ Reviewed by Andreas Kling.
+
+ Clean-up remained functions of HTML elements using auto-generated isFooElement(),
+ and replace toFooElement() with ELEMENT_TYPE_CASTS() macro.
+
+ Besides this patch clean-up unnecessary checks which are being supported by
+ auto-generated isFooElement().
+
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::containsAnyFormControls):
+
2013-09-10 Marcelo Morais <m.morais@samsung.com>
[EFL] WebInspector: Move to new webinspector
for (Node* node = document->documentElement(); node; node = NodeTraversal::next(node)) {
if (!node->isElementNode())
continue;
- if (isHTMLInputElement(node) || toElement(node)->hasTagName(HTMLNames::selectTag) || isHTMLTextAreaElement(node))
+ if (isHTMLInputElement(node) || isHTMLSelectElement(node) || isHTMLTextAreaElement(node))
return true;
}
return false;