Move static StyleResolver functions to Style namespace
https://bugs.webkit.org/show_bug.cgi?id=119629

Reviewed by Sam Weinig and Andreas Kling.

- Move static font size computation functions to StyleFontSizeFunctions.h/.cpp
- Move StyleResolver::styleForDocument to Style::resolveForDocument

* WebCore.xcodeproj/project.pbxproj:
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyFontFamily::applyInitialValue):
(WebCore::ApplyPropertyFontFamily::applyValue):
(WebCore::ApplyPropertyFontSize::applyInitialValue):
(WebCore::ApplyPropertyFontSize::applyValue):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
(WebCore::checkForOrientationChange):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::checkForGenericFamilyChange):
(WebCore::StyleResolver::initializeFontStyle):
(WebCore::StyleResolver::setFontSize):
* css/StyleResolver.h:
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
* editing/EditingStyle.cpp:
(WebCore::legacyFontSizeFromCSSValue):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getFontAndGlyphOrientation):
        
    Moved from StyleResolver.cpp so it can be used by Style::resolveForDocument().
    This depends on RenderStyle only so it is a natural member function.

* rendering/style/RenderStyle.h:
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
* style/StyleFontSizeFunctions.cpp: Copied from Source/WebCore/css/StyleResolver.cpp.
(WebCore::Style::computedFontSizeFromSpecifiedSize):
(WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
(WebCore::Style::fontSizeForKeyword):
(WebCore::Style::legacyFontSizeForPixelSize):
* style/StyleFontSizeFunctions.h: Added.
* style/StyleResolveForDocument.cpp: Added.
(WebCore::Style::resolveForDocument):
* style/StyleResolveForDocument.h: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Not able to use arrow keys to read text in a WK2 app
https://bugs.webkit.org/show_bug.cgi?id=119605
-and corresponding-
<rdar://problem/14281275>

Reviewed by Darin Adler.

Source/WebCore: 

This code from defaultKeyboardEventHandler() is the magic that makes this AX 
functionality work. This patch moves that into a separate function so that we can 
call it from WK2.
* WebCore.exp.in:
* page/EventHandler.cpp:
(WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
(WebCore::EventHandler::defaultKeyboardEventHandler):
* page/EventHandler.h:

Source/WebKit2: 

Make all of these scrolling functions actually return the WebCore bools that 
indicate whether or not scrolling happened. 
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scroll):
(WebKit::WebPage::logicalScroll):
(WebKit::WebPage::scrollBy):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::executeKeypressCommandsInternal):

This function now gives accessibility a chance to handle the event too. And it 
also actually tracks whether or not the event was handled by scrolling instead of 
assuming that it was and universally returning true.
(WebKit::WebPage::performNonEditingBehaviorForSelector):

Tools: 

New test verifies that didNotHandleKeyEvent will be called when there is nothing 
to scroll. 
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::didNotHandleKeyEventCallback):
(TestWebKitAPI::TEST):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153907 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Misses mod_ssl and php in the list of packages required for tests for yum
https://bugs.webkit.org/show_bug.cgi?id=115751

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2013-08-09
Reviewed by Martin Robinson.

* gtk/install-dependencies: add mod_ssl and php to the packages installed for tests
with yum.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Captions menu needs to reset text-align
https://bugs.webkit.org/show_bug.cgi?id=119637

Reviewed by Eric Carlson.

Reset the text-align property on the menu so that it
doesn't get the inherited value. The full fix for all
controls is http://webkit.org/b/116100.

* css/mediaControlsQuickTime.css:
(video::-webkit-media-controls-closed-captions-container):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153909 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        http/tests/navigation/back-twice-without-commit.html times out
        https://bugs.webkit.org/show_bug.cgi?id=82980

        * platform/mac/TestExpectations: Marked as such again, reverting r153842.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] some track language tags are not recognized
https://bugs.webkit.org/show_bug.cgi?id=119643

Reviewed by Dean Jackson.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
    a track may have changed so we may have a new language.
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
    if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
    QuickTime language code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r142755): window.open creates an invisible window when width and height are 0
https://bugs.webkit.org/show_bug.cgi?id=119633

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/dom/Window/open-zero-size-as-default.html

Relying on each WebKit to refuse setting size to zero was fragile - because this
required each one to have the check, and because by the time the client was called,
the initially zero size was not necessarily zero.

* loader/FrameLoader.cpp: (WebCore::createWindow): When sizes are zero, keep the
size the window was created with, because that's the default one by definition.

* page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): It's too late to
check for zero size now, it's been mangled to adjust for the difference between
window and viewport size.

Source/WebKit/efl:

* WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::setWindowRect):
Once again, the passed rect cannot be empty.

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::setWindowRect):
Once again, the passed rect cannot be empty.

LayoutTests:

* fast/dom/Window/open-zero-size-as-default-expected.txt: Added.
* fast/dom/Window/open-zero-size-as-default.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERTION FAILED: stroke->opacity != other->stroke->opacity in WebCore::SVGRenderStyle::diff
https://bugs.webkit.org/show_bug.cgi?id=119623

Reviewed by Dirk Schulze.

Source/WebCore:

Include all the stroke attributes in the style diff comparison, the visited links ones were missing.

Test: svg/animations/animate-stroke-crasher.html

* rendering/style/SVGRenderStyle.cpp:
(WebCore::SVGRenderStyle::diff):

LayoutTests:

Add testcase from bug with small adjustments.

* svg/animations/animate-stroke-crasher-expected.txt: Added.
* svg/animations/animate-stroke-crasher.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tests that dump delegate calls are flaky because of cached redirects
https://bugs.webkit.org/show_bug.cgi?id=119641

Reviewed by Brady Eidson.

Made redirect.php emit Cache-Control: no store as a workaround for bug 77538.
Removed several reimplementations of it, and changed the test to use the
central copy.

* http/tests/permissionclient/resources/redir.php: Removed.
* http/tests/resources/redirect.php:
* http/tests/security/beforeload-iframe-server-redirect-expected.txt:
* http/tests/security/beforeload-iframe-server-redirect.html:
* http/tests/security/cannot-read-cssrules-redirect.html:
* http/tests/security/canvas-remote-read-redirect-to-remote-image.html:
* http/tests/security/canvas-remote-read-remote-image-redirect.html:
* http/tests/security/contentSecurityPolicy/frame-src-redirect-blocked.html:
* http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js:
* http/tests/security/contentSecurityPolicy/resources/redir.php: Removed.
* http/tests/security/contentSecurityPolicy/script-src-redirect-expected.txt:
* http/tests/security/contentSecurityPolicy/script-src-redirect.html:
* http/tests/security/cross-origin-css.html:
* http/tests/security/cross-origin-script-window-onerror-redirected.html:
* http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe-expected.txt:
* http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-frame.html:
* http/tests/security/mixedContent/resources/frame-with-redirect-http-to-https-script.html:
* http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-frame.html:
* http/tests/security/mixedContent/resources/frame-with-redirect-https-to-http-script.html:
* http/tests/security/redirect-BLOCKED-to-localURL.html:
* http/tests/security/resources/cross-origin-xsl-redirect.xml:
* http/tests/security/resources/redir.php: Removed.
* http/tests/security/resources/xsl-using-document-redirect.xsl:
* http/tests/security/resources/xsl-using-external-entity-redirect.xsl:
* http/tests/security/stylesheet-href-redirect-expected.txt:
* http/tests/security/stylesheet-href-redirect.html:
* http/tests/security/xssAuditor/block-does-not-leak-referrer.html:
* http/tests/security/xssAuditor/resources/redir.php: Removed.
* http/tests/security/xssAuditor/script-tag-open-redirect.html:
* http/tests/security/xssAuditor/script-tag-redirect.html:
* http/tests/xmlhttprequest/redirect-cross-origin-2.html:
* http/tests/xmlhttprequest/redirect-cross-origin-post-sync.html:
* http/tests/xmlhttprequest/redirect-cross-origin-post.html:
* http/tests/xmlhttprequest/redirect-cross-origin-sync-double.html:
* http/tests/xmlhttprequest/redirect-cross-origin-sync.html:
* http/tests/xmlhttprequest/redirect-cross-origin.html:
* http/tests/xmlhttprequest/resources/redirect.php: Removed.
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Merge an encoding test from Blink
        https://bugs.webkit.org/show_bug.cgi?id=116943

        Original patch by Adam Barth.

        * fast/encoding/meta-overrules-auto-expected.txt: Added.
        * fast/encoding/meta-overrules-auto.html: Added.
        * fast/encoding/resources/meta-input-encoding.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Artifacts seen sometimes with layer backed WebKit1 plug-in
https://bugs.webkit.org/show_bug.cgi?id=119647
<rdar://problem/14002715>

Reviewed by Beth Dakin.

Don't try to paint layer backed views - they will be painted by Core Animation.

* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in com.apple.WebKit.WebContent at com.apple.MediaToolbox.
https://bugs.webkit.org/show_bug.cgi?id=119645

Reviewed by Eric Carlson.

Work around crash caused by <rdar://problem/14688471> by releasing
m_request as soon as keys have been added to it.

* Modules/encryptedmedia/CDMPrivateAVFoundation.mm:
(WebCore::CDMSessionAVFoundation::update):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GObject] Wrap KeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=119651

Reviewed by Christophe Dumez.

This exposes KeyboardEvent to our GObject API. It is required for handling
keyboard events, such as keydown, keypress, and so on.

* bindings/gobject/GNUmakefile.am:
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap): make sure we create a WebKitDOMKeyboardEvent for a DOM event that
is a KeyboardEvent.
* bindings/scripts/CodeGeneratorGObject.pm:
(GetBaseClass): make WebKitDOMEvent be WebKitDOMKeyboardEvent's parent, like we do
for WebKitDOMMouseEvent.
* dom/KeyboardEvent.idl: generate a single initialization method.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix make distcheck.

Source/WebCore:

* GNUmakefile.list.am: Remove unexistent header file.

Source/WTF:

* GNUmakefile.list.am: Add missing header file.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Change my primary mail address.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Update NEWS and Versions.m4 for 2.1.4 release.

.:

* Source/autotools/Versions.m4: Update version numbers.

Source/WebKit/gtk:

* NEWS: Update release notes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup MediaQueryListListener
https://bugs.webkit.org/show_bug.cgi?id=119664

Reviewed by Andreas Kling.

Make MediaQueryListListener a proper WebIDL callback.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Update project files.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackHeader):
(GenerateCallbackImplementation):
(JSValueToNative):
* bindings/scripts/IDLAttributes.txt:
Add support for CallbackNeedsOperatorEqual, which adds an operator==.

* css/MediaAllInOne.cpp:
Remove MediaQueryListListener.cpp.

* css/MediaQueryListListener.cpp:
Removed.

* css/MediaQueryListListener.h:
(WebCore::MediaQueryListListener::~MediaQueryListListener):
(WebCore::MediaQueryListListener::MediaQueryListListener):
* css/MediaQueryListListener.idl:
Convert to a proper WebIDL callback.

* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::Listener::evaluate):
(WebCore::MediaQueryMatcher::styleResolverChanged):
* css/MediaQueryMatcher.h:
Remove all traces of the ScriptState.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make some things that return never-null pointers return references instead.
<http://webkit.org/b/119660>

Reviewed by Antti Koivisto.

Source/WebCore:

These functions never return null anyway, so remove any ambiguity by letting
them return references instead of pointers.

- Node::ensureRareData()
- Element::ensureUniqueElementData()
- Element::ensureShadow()
- Element::ensureUserAgentShadowRoot()
- StyledElement::ensureMutableInlineStyle()
- NodeRareData::ensureNodeLists()
- NodeRareData::ensureMutationObserverData()
- EventTarget::ensureEventTargetData()
- Document::ensureStyleResolver()
- Document::selectorQueryCache()
- Document::mediaQueryMatcher()
- FlowThreadController::ensureRenderFlowThreadWithName()
- HTMLTrackElement::ensureTrack()
- SVGElement::ensureSVGRareData()
- AnimationControllerPrivate::ensureCompositeAnimation()

Source/WebKit/qt:

* Api/qwebelement.cpp:
(QWebElement::styleProperty):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make Page::settings() return a reference.
<http://webkit.org/b/119662>

Reviewed by Anders Carlsson.

...and remove some pointless null checks that were exposed by doing this.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Bootstrap canvas profiler
https://bugs.webkit.org/show_bug.cgi?id=119652
<rdar://problem/14703665>

Reviewed by Joseph Pecoraro.

Add enough to get an empty Canvas profile recording
and displayed.

* Localizations/en.lproj/localizedStrings.js: Add canvas strings.
* UserInterface/CanvasProfileObject.js: Added. Mostly copied from CSS Selector Profiles.
* UserInterface/CanvasProfileType.js: Added. Ditto.
* UserInterface/CanvasDataGridNode.js: Added. Ditto.
* UserInterface/CanvasProfileView.js: Added. Ditto.
* UserInterface/ContentView.js:
(WebInspector.ContentView): Add support for the new View type.
(WebInspector.ContentView.isViewable):
* UserInterface/InstrumentSidebarPanel.js:
(WebInspector.InstrumentSidebarPanel): Add support for canvas profiles.
(WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedOver):
(WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphMousedDown):
(WebInspector.InstrumentSidebarPanel.prototype._recordProfileGlyphClicked):
(WebInspector.InstrumentSidebarPanel.prototype._profileTypeWasSelected):
(WebInspector.InstrumentSidebarPanel.prototype._profilesCleared):
* UserInterface/Main.html: Load the new files.
* UserInterface/ProfileManager.js: New methods and support for canvas profiles.
(WebInspector.ProfileManager):
(WebInspector.ProfileManager.prototype.initialize):
(WebInspector.ProfileManager.prototype.isProfilingCanvas):
(WebInspector.ProfileManager.prototype.startProfilingCanvas):
(WebInspector.ProfileManager.prototype.stopProfilingCanvas):
(WebInspector.ProfileManager.prototype._checkForInterruptions):
(WebInspector.ProfileManager.prototype._attemptToResumeProfiling):

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