Move Node::dispatchSimulatedClick() to Element.
<http://webkit.org/b/116784>

Reviewed by Antti Koivisto.

Only Elements use the dispatchSimulatedClick() functionality, so move it there.

* dom/Node.cpp:
* dom/Node.h:
* dom/Element.h:
* dom/Element.cpp:
(WebCore::Element::dispatchSimulatedClick):
* dom/EventDispatcher.h:
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchSimulatedClick):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move "active" state logic from Node to Element.
<http://webkit.org/b/116785>

Reviewed by Antti Koivisto.

Resolve another 7 year old FIXME by merging the "active" state logic from Node and ContainerNode
and moving it all to Element instead.

* dom/UserActionElementSet.h:
(WebCore::UserActionElementSet::isActive):
(WebCore::UserActionElementSet::setActive):
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
* dom/Node.cpp:
* dom/Node.h:
* dom/Element.h:
(WebCore::Element::active):
* dom/Element.cpp:
(WebCore::Element::isUserActionElementActive):
(WebCore::Element::setActive):

    Moved here from Node/ContainerNode.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isPressed):
* dom/Document.cpp:
(WebCore::Document::setFocusedNode):
(WebCore::Document::updateHoverActiveState):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::isPressed):
(WebCore::RenderTheme::isSpinUpButtonPartPressed):
* rendering/RenderThemeMac.mm:
(WebCore::getMediaUIPartStateFlags):
(WebCore::RenderThemeMac::updatePressedState):
* platform/qt/RenderThemeQt.cpp:
(WebCore::RenderThemeQt::getMediaControlForegroundColor):

    Check that the inspected Node is an Element before asking if it's active.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::setActive):

    Call the right superclass.

* html/HTMLAnchorElement.h:
* html/HTMLLabelElement.h:
* html/shadow/MediaControlElementTypes.h:

    Sprinkle OVERRIDE>

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use Vector instead of custom linked list for font families
https://bugs.webkit.org/show_bug.cgi?id=116783

Reviewed by Andreas Kling.

Get rid of FontFamily and SharedFontFamily.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::hasSameFont):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getAttributeSetForAccessibilityObject):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontFamilyFromStyle):
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyFontFamily::applyInheritValue):
(WebCore::ApplyPropertyFontFamily::applyInitialValue):
(WebCore::ApplyPropertyFontFamily::applyValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForDocument):
(WebCore::StyleResolver::initializeFontStyle):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::font):
(WebCore::CanvasRenderingContext2D::setFont):
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::systemFont):
* platform/graphics/Font.h:
(WebCore::Font::firstFamily):
(WebCore::Font::familyCount):
(WebCore::Font::familyAt):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::getFontData):
* platform/graphics/FontDescription.cpp:
(SameSizeAsFontDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription):
(WebCore::FontDescription::familyCount):
(WebCore::FontDescription::firstFamily):
(WebCore::FontDescription::familyAt):
(WebCore::FontDescription::families):
(WebCore::FontDescription::useFixedDefaultSize):
(WebCore::FontDescription::setOneFamily):
(WebCore::FontDescription::setFamilies):
(WebCore::FontDescription::adoptFamilies):
(WebCore::FontDescription::operator==):
* platform/graphics/FontFamily.cpp:
* platform/graphics/FontFamily.h:
* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::displayCallback):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::getSimilarFontPlatformData):
* platform/graphics/qt/FontCacheQt.cpp:
(WebCore::FontCache::getLastResortFallbackFont):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemFont):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::controlFont):
* platform/qt/RenderThemeQStyle.cpp:
(WebCore::RenderThemeQStyle::adjustButtonStyle):
* platform/text/transcoder/FontTranscoder.cpp:
(WebCore::FontTranscoder::converterType):
* platform/win/DragImageWin.cpp:
(WebCore::dragLabelFont):
* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemFont):
(WebCore::RenderThemeMac::setFontFromControlSize):
* rendering/RenderThemeSafari.cpp:
(WebCore::RenderThemeSafari::systemFont):
(WebCore::RenderThemeSafari::setFontFromControlSize):
* rendering/RenderThemeWin.cpp:
(WebCore::fillFontDescription):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix
        
Not reviewed.

* WebKitGraphics.cpp:
(makeFont):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another build fix.
        
Not reviewed.

* DOMCoreClasses.cpp:
(DOMElement::font):
* FullscreenVideoController.cpp:
(FullscreenVideoController::draw):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove FontFamily.h/.cpp
https://bugs.webkit.org/show_bug.cgi?id=116788

Reviewed by Anders Carlsson.

Empty files.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontDescription.h:
* platform/graphics/FontFamily.cpp: Removed.
* platform/graphics/FontFamily.h: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move :active chain participation state from Node to Element.
<http://webkit.org/b/116786>

Reviewed by Antti Koivisto.

Only Elements can be in the :active chain so move the logic there from Node.

* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):

    Add isElementNode() type checks when updating the :active chain.

* dom/Node.h:
* dom/Node.cpp:
(WebCore::Node::detach):
* dom/Element.cpp:
(WebCore::Element::detach):

    Move the remaining logic for detaching from the UserActionElementSet to Element.

(WebCore::Element::isUserActionElementInActiveChain):
* dom/Element.h:
(WebCore::Element::inActiveChain):

    Move all the :active chain stuff from Node to Element.

* dom/UserActionElementSet.cpp:
(WebCore::UserActionElementSet::didDetach):
* dom/UserActionElementSet.h:
(WebCore::UserActionElementSet::isInActiveChain):
(WebCore::UserActionElementSet::setInActiveChain):

    UserActionElementSet now only takes Element* in its API.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150722 268f45cc-cd09-0410-ab3c-d52691b4dbfc
roll-chromium-deps doesn't repeat the full name.

Rubber-stamped by Andreas Kling.

* Scripts/webkitpy/tool/bot/irc_command.py:
(RollChromiumDEPS.execute):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove ENABLE_CALENDAR_PICKER
https://bugs.webkit.org/show_bug.cgi?id=116795

Reviewed by Ryosuke Niwa.

Source/WebCore:

This feature was used only by Chromium port.

* Resources/pagepopups/calendarPicker.css: Removed.
* Resources/pagepopups/calendarPicker.js: Removed.
* css/html.css:
* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::LocaleICU):
(WebCore):
* platform/text/LocaleICU.h:
(LocaleICU):
* platform/text/PlatformLocale.h:
(Locale):
* platform/text/mac/LocaleMac.h:
(LocaleMac):
* platform/text/mac/LocaleMac.mm:
(WebCore::LocaleMac::monthLabels):
* platform/text/win/LocaleWin.cpp:
(WebCore::LocaleWin::LocaleWin):
(WebCore::LocaleWin::monthLabels):
* platform/text/win/LocaleWin.h:
(LocaleWin):

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataEnableFeatures.in:
The list was wrong. Blackberry port doesn't use CALENDAR_PICKER code.

Source/WTF:

* wtf/FeatureDefines.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150724 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WKR and webkitbot build fixes.

* Scripts/webkitpy/tool/bot/irc_command.py:
(RollChromiumDEPS.execute):
* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot.next_work_item):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150725 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Yet another WKR build fix. Sorry for the mess. It seems like I can't win today :(

* Scripts/webkitpy/tool/commands/newcommitbot.py:
(NewCommitBot.next_work_item):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150726 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename FontFallbackList to FontGlyphs
https://bugs.webkit.org/show_bug.cgi?id=116797

Reviewed by Andreas Kling.

Maybe it was a fallback list once. Nowadays its purpose is to cache realized glyphs and related data.
        
File renaming will be done separately.

* WebCore.exp.in:
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::Font::operator=):
(WebCore::Font::operator==):
        
    Refactored to early return style.

(WebCore::Font::update):
(WebCore::Font::width):
* platform/graphics/Font.h:
(Font):
(WebCore::Font::glyphs):
(WebCore::Font::loadingCustomFonts):
(WebCore::Font::primaryFont):
(WebCore::Font::fontDataAt):
(WebCore::Font::isFixedPitch):
(WebCore::Font::fontSelector):
* platform/graphics/FontCache.h:
(FontCache):
* platform/graphics/FontFallbackList.cpp:
(WebCore::FontGlyphs::FontGlyphs):
(WebCore::FontGlyphs::invalidate):
(WebCore::FontGlyphs::releaseFontData):
(WebCore::FontGlyphs::determinePitch):
(WebCore::FontGlyphs::realizeFontDataAt):
        
    Renamed for clarity along with m_fontList -> m_realizedFontData.

(WebCore::FontGlyphs::setPlatformFont):
* platform/graphics/FontFallbackList.h:
(FontGlyphs):
(WebCore::FontGlyphs::GlyphPagesStateSaver::GlyphPagesStateSaver):
(WebCore::FontGlyphs::GlyphPagesStateSaver::~GlyphPagesStateSaver):
(GlyphPagesStateSaver):
(WebCore::FontGlyphs::create):
(WebCore::FontGlyphs::~FontGlyphs):
(WebCore::FontGlyphs::primaryFontData):
* platform/graphics/FontFastPath.cpp:
(WebCore::Font::glyphDataAndPageForCharacter):
* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove a leftover CALENDAR_PICKER from LocaleNone.cpp
https://bugs.webkit.org/show_bug.cgi?id=116800

Patch by Seokju Kwon <seokju.kwon@gmail.com> on 2013-05-26
Reviewed by Kent Tamura.

No new tests, no behavior change.

* platform/text/LocaleNone.cpp:
(LocaleNone):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150728 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WINCE] Add wtf_bsearch()
https://bugs.webkit.org/show_bug.cgi?id=116528

Reviewed by Darin Adler.

r149833 introduced usage of ::bsearch(), which does not exist on Windwos CE.
Add our own implementation of this function as wtf_bsearch and define
bsearch as wtf_bsearch to fix compilation on Windwos CE.

* wtf/StdLibExtras.h:
(wtf_bsearch):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150729 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Encapsulate FontGlyphs
https://bugs.webkit.org/show_bug.cgi?id=116803

Reviewed by Andreas Kling.

FontGlyphs is unfriending Font. Give it a real class interface and some actual code.

* platform/graphics/Font.cpp:
(WebCore::Font::Font):
* platform/graphics/Font.h:
(WebCore::Font::glyphDataForCharacter):
(WebCore::Font::glyphDataAndPageForCharacter):
* platform/graphics/FontFallbackList.cpp:
(WebCore::FontGlyphs::FontGlyphs):
(WebCore::isInRange):
(WebCore::shouldIgnoreRotation):
(WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation):
        
    Helpers from FontFastPath.cpp.

(WebCore::FontGlyphs::glyphDataAndPageForCharacter):
        
    This is the primary interface. The code moves here from FontFastPath.cpp.

* platform/graphics/FontFallbackList.h:
(WebCore::FontGlyphs::createForPlatformData):
        
    Remove setPlatformData in favor of constructor.

(WebCore::FontGlyphs::primarySimpleFontData):
* platform/graphics/FontFastPath.cpp:
* platform/graphics/GraphicsContext.h:

    Remove a stray function definition also called setPlatformFont().

* rendering/svg/SVGTextRunRenderingContext.cpp:
(WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150730 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Plugins with no src but valid type should not snapshot
https://bugs.webkit.org/show_bug.cgi?id=116799
<rdar://problem/13695911>

Reviewed by Simon Fraser.

There are a few plug-ins around that don't take any source content
via the src attribute, but rather just load the binary based on the
mime-type. In those cases we shouldn't snapshot until we have a
mechanism to do so.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn):
    Add MIMEType logging, and detect the case of no src but valid type.
* html/HTMLPlugInImageElement.h: Add another SnapshotReason enum for
    this special case.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
The public WK header file should not include WKAPICast.h
https://bugs.webkit.org/show_bug.cgi?id=115230

Patch by Changhun Kang <temoochin@company100.net> on 2013-05-26
Reviewed by Darin Adler.

Otherwise, WebKit internal headers are exposed.
No new tests. No change in behavior.
* UIProcess/API/C/soup/WKSoupRequestManager.h:
* UIProcess/soup/WebSoupRequestManagerClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150732 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Turn TreeScope::focusedNode() into focusedElement().
<http://webkit.org/b/116802>

Reviewed by Darin Adler.

For the hundredth time, only Elements can be focused!

This change mostly reverts r121079 since that made things unnecessarily complicated
just to tweak the behavior of ShadowRoot.activeElement, an API that we don't expose.
Finding a TreeScope's focused element now does a simple walk up the parent chain instead
of running the full Shadow DOM re-targeting algorithm.

(WebCore::TreeScope::focusedElement):

    Simplify and return Element* instead of Node*.

* dom/TreeScope.h:
* dom/TreeScope.cpp:
(WebCore::focusedFrameOwnerElement):

    Make this return Element* as the name already suggested.

* dom/Document.cpp:
(WebCore::Document::removeFocusedNodeOfSubtree):
* dom/Element.cpp:
(WebCore::Element::blur):
* dom/ShadowRoot.h:
(WebCore::ShadowRoot::activeElement):
* html/HTMLDocument.cpp:
(WebCore::HTMLDocument::activeElement):

    Simplified call sites that were paranoid about getting a non-Element focused node.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSSParser::parseImageResolution doesn't need a parameter.
https://bugs.webkit.org/show_bug.cgi?id=116755

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-05-26
Reviewed by Darin Adler.

parseImageResolution() can get CSSPraserValueList from m_valueList directly.

No new tests, no behavior change.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseImageResolution):
* css/CSSParser.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Make screen updates dependent on the existence of a drawing buffer.
https://bugs.webkit.org/show_bug.cgi?id=116539
Internal PR 330917

Patch by Jakob Petsovits <jpetsovits@blackberry.com> on 2013-05-26
Reviewed by Carlos Garcia Campos.
Internally reviewed by Xiaobo Wang and Arvid Nilsson.

This reduces complexity by relying on the current state,
rather than the suspend counter, which in turn makes it
possible to simplify the code in setCompositor().

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::updateSuspendScreenUpdateState):
(BlackBerry::WebKit::BackingStorePrivate::createSurfaces):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::setCompositor):

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