WebKitTestRunner should disable automatic quote and dash substitution like DumpRenderTree does
https://bugs.webkit.org/show_bug.cgi?id=118201

Reviewed by Dean Jackson.

* WebKitTestRunner/mac/main.mm:
(main):
Modify NSUserDefaults directly since setAutomaticQuoteSubstitutionEnabled and
setAutomaticDashSubstitutionEnabled are not exposed on WKView.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] WKView shouldn't force scrolling off if shouldClipToVisibleRect is set
https://bugs.webkit.org/show_bug.cgi?id=118174
<rdar://problem/14301175>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView _updateViewExposedRect]):
Pass whether or not clips-to-visibleRect is enabled down to the WebPageProxy.

(-[WKView setMinimumSizeForAutoLayout:]):
Disable scrolling when using autolayout instead of when using clips-to-visibleRect.

(-[WKView setShouldClipToVisibleRect:]):
Clipping to the WKView's visibleRect does not strictly require scrolling to be disabled,
and in fact there are cases (RTL/TB pagination) where we *must* scroll, even when the view
is big enough to fit the content (the case clip-to-visibleRect was added for).

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::viewExposedRectChanged):
(WebKit::WebPageProxy::exposedRectChangedTimerFired):
Keep track of and forward to the drawing area whether or not clips-to-visibleRect is enabled.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::setClipsToExposedRect): Added.
(WebKit::DrawingArea::didChangeScrollOffsetForAnyFrame): Added a missing space.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::viewExposedRectChanged):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
Forward clips-to-visibleRect enabled state to the drawing area.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
Add storage for m_clipsToExposedRect.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::setClipsToExposedRect):
(WebKit::TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect):
(WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer):
(WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer):
Check m_clipsToExposedRect instead of the main-frame's isScrollable() to determine
whether we should tell our TiledBackings to clip to the exposed rect we provide.

We don't need to listen to mainFrameScrollabilityChanged anymore.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152190 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Tools] Add support for "webKitBranchBuild" git option when calculating jhbuildPath
https://bugs.webkit.org/show_bug.cgi?id=118195

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-06-28
Reviewed by Daniel Bates.

Currently, ports that use jhbuild fail to determine jhbuild directory
when "webKitBranchBuild" git configuration property is enabled. To reproduce
that issue in Efl port, enable that flag in .git/config, switch to a git branch
other than "master" and try to build webkit. The build will fail to
locate dependencies due to lack of pkg-config paths which should be set
by jhbuild.

For more details about "webKitBranchBuild" option, see:
https://trac.webkit.org/wiki/UsingGitWithWebKit

* Scripts/webkitdirs.pm:
(getJhbuildPath):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Added WebGL files to Windows build.
https://bugs.webkit.org/show_bug.cgi?id=118200

Reviewed by Brent Fulgham.

* WebCore.vcxproj/WebCore.vcxproj: Added WebGL files, removed unused GraphicsContext3DOpenGLES.cpp.
* WebCore.vcxproj/WebCore.vcxproj.filters: Added WebGL files, removed unused GraphicsContext3DOpenGLES.cpp.
* platform/graphics/cairo/GLContext.cpp: Only include GLContextEGL.h or GLContextGLX.h if they're needed.
* platform/graphics/cg/GraphicsContext3DCG.cpp: Only include GraphicsContext3DNEON.h if it's needed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Added template parameters to std::min to fix compile errors in Visual Studio x64.
https://bugs.webkit.org/show_bug.cgi?id=118204

Reviewed by Geoffrey Garen.

* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeURLToDataObject): Added <unsigned> to std::min.
(WebCore::createGlobalImageFileDescriptor): Added <int> to std::min.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cached pages don't update their backing scale factor when it changes
https://bugs.webkit.org/show_bug.cgi?id=118206
-and-
<rdar://problem/14261627>

Reviewed by Tim Horton.

It is not sufficient to mark pages in the PageCache as needing a full style 
recalc. We also need to ensure that the RenderLayerCompositors for the CachesPages 
get updated.

Keep track of whether device scale has been updated with 
m_needsDeviceScaleChanged. If that has been marked true, then restore() will call 
Frame::deviceOrPageScaleFactorChanged().
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::restore):
* history/CachedPage.h:
(WebCore::CachedPage::markForDeviceScaleChanged):

Propagate markForDeviceScaleChanged() to all of the CachedPages.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForDeviceScaleChanged):
* history/PageCache.h:

Call PageCache::markPagesForDeviceScaleChanged()
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Newer versions of clang use a default template instantiation depth that is too small for TestWebKitAPI
https://bugs.webkit.org/show_bug.cgi?id=118208

Reviewed by Mark Rowe.

Newer versions of clang use a default template depth of 128, but this
is too small for Tests/WTF/HashSet.cpp. Use 256 instead, which was the
previous default.

Clang lowered the default to keep recursive template instantiation
from overflowing the stack (see <rdar://problem/13935016>), but
TestWebKitAPI's C++ files don't trigger a stack overflow even with the
higher limit. If for some reason this starts happening then we can
lower the limit back down.

* TestWebKitAPI/Configurations/Base.xcconfig: Build TestWebKitAPI with -ftemplate-depth=256.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [Mac] Crash when loading is stopped from -didReceiveResponse
        https://bugs.webkit.org/show_bug.cgi?id=118209
        <rdar://problem/14259249>

        Reviewed by Brady Eidson.

        Test: TestWebKitAPI/Tests/mac/StopLoadingFromDidReceiveResponse.mm.

        * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didReceiveResponse):
        Added yet another check for reachedTerminalState().



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused attachChildrenLazily method and make attach/detachChildren private
https://bugs.webkit.org/show_bug.cgi?id=118016

Reviewed by Darin Adler.

Merge https://chromium.googlesource.com/chromium/blink/+/009520dc31c9458e0cf71cf212fa5688c4ca68b0

No one should be manually trying to attach or detach all their children so there's
no reason for these methods to be public.

In doing this I realized that attachChildrenLazily is not used and can be removed.

I also realized that we were detaching all our children before the ShadowRoots which
is sad since the InsertionPoints will call detach() on them as well, and then when we
call ContainerNode::detach at the end of Element::detach we'll go detach them again!
This patch makes it so we only go through and detach them twice instead of three times.
In the future we should figure out a way to only do this once.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
An element with -webkit-user-select: all should be selected on single click
https://bugs.webkit.org/show_bug.cgi?id=117864

Reviewed by Darin Adler.

Source/WebCore: 

Set m_mouseDownMayStartSelect true even when the node cannot start selection
if the node was inside an element with -webkit-user-select: all.

Test: editing/selection/user-select-all-with-single-click.html

* page/EventHandler.cpp:
(WebCore::canMouseDownStartSelect):

LayoutTests: 

Add tests for single clicking on an element with user-select: all.
We select the entire element regardless of whether the user had clicked on text or an image
to be consistent even though Firefox requires a double click on the latter case.

* editing/selection/user-select-all-with-image-single-click-expected.txt: Added.
* editing/selection/user-select-all-with-image-single-click.html: Added.
* editing/selection/user-select-all-with-single-click-expected.txt: Added.
* editing/selection/user-select-all-with-single-click.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: AX: VoiceOver speaks all inspector search fields as 'required'
https://bugs.webkit.org/show_bug.cgi?id=118122

Patch by James Craig <james@cookiecrook.com> on 2013-06-28
Reviewed by Timothy Hatcher.

Removed bogus "required" state, and switched :valid selector to use :not(:placeholder-shown)
so that screen readers will not indicate a bogus :required/:invalid state to the user.
Minor cosmetic difference blocked by http://webkit.org/b/118162

* UserInterface/FilterBar.css:
(.filter-bar > input[type="search"]:focus):
(.filter-bar > input[type="search"]:not(:placeholder-shown)):
* UserInterface/FilterBar.js:
(WebInspector.FilterBar):
* UserInterface/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
* UserInterface/SearchBar.css:
(.search-bar > input[type="search"]:focus):
(.search-bar > input[type="search"]:not(:placeholder-shown)):
* UserInterface/SearchBar.js:
(WebInspector.SearchBar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update Apple System fonts in auto-complete
https://bugs.webkit.org/show_bug.cgi?id=118205
<rdar://problem/14308488>

Reviewed by Joseph Pecoraro.

Update for the new Apple System font names, and remove some invalid entries.

* UserInterface/CSSKeywordCompletions.js: General cleanup. Note that
"apple-system-short-caption2" looks like it was accidentally omitted. It wasn't :)

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove String::deprecatedCharactersWithNullTermination() and related code
https://bugs.webkit.org/show_bug.cgi?id=118211

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* API/JSStringRef.cpp:
(JSStringCreateWithCharactersNoCopy):
Update call to StringImpl::createWithoutCopying.

Source/WTF:

Remove String::deprecatedCharactersWithNullTermination, StringImpl::createWithTerminatingNullCharacter
and the s_hashFlagHasTerminatingNullCharacter flag. We no longer care about whether strings have a
terminating null character.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createFromLiteral):
(WTF::StringImpl::createWithoutCopying):
(WTF::StringImpl::getData16SlowCase):
(WTF::StringImpl::sizeInBytes):
* wtf/text/StringImpl.h:
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::createFromLiteral):
(WTF::StringImpl::isolatedCopy):
* wtf/text/WTFString.cpp:
* wtf/text/WTFString.h:

Tools:

Remove all hasTerminatingNullCharacter() checks.

* TestWebKitAPI/Tests/WTF/AtomicString.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PageThrottler::shouldThrottleTimers is wrong.
https://bugs.webkit.org/show_bug.cgi?id=118210

Reviewed by Anders Carlson.

m_throttleState == PageNotThrottledState
    -> page NOT throttled, so should NOT throttle timers
m_throttleState != PageNotThrottledState
    -> page NOT NOT throttled, so should throttle timers

This needs cleaning up, but for now, 1 character fix.

* page/PageThrottler.h:
(WebCore::PageThrottler::shouldThrottleTimers):
    == -> !=



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adopt is/toHTMLImageElement for code cleanup
https://bugs.webkit.org/show_bug.cgi?id=118182

Reviewed by Andreas Kling.

To enhance readability, this patch adopts is/toHTMLImageElement.
This also helps out to reduce duplicated use of static_cast.

Source/WebCore:

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isNativeImage):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::url):
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* bridge/qt/qt_pixmapruntime.cpp:
(JSC::Bindings::assignToHTMLImageElement):
(JSC::Bindings::QtPixmapRuntime::toQt):
* dom/Clipboard.cpp:
(WebCore::Clipboard::setDragImage):
* dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf):
* editing/Editor.cpp:
(WebCore::imageElementFromImageDocument):
* html/HTMLAnchorElement.cpp:
(WebCore::appendServerMapMousePosition):
* html/HTMLImageElement.h:
(WebCore::isHTMLImageElement):
(WebCore::toHTMLImageElement):
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::imageElement):
* html/HTMLNameCollection.cpp:
(WebCore::WindowNameCollection::nodeMatchesIfNameAttributeMatch):
(WebCore::DocumentNameCollection::nodeMatchesIfIdAttributeMatch):
(WebCore::DocumentNameCollection::nodeMatchesIfNameAttributeMatch):
(WebCore::DocumentNameCollection::nodeMatches):
* page/DragController.cpp:
(WebCore::DragController::draggableElement):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::serializeFrame):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::getURLForImageNode):
* platform/mac/HTMLConverter.mm:
(+[WebHTMLConverter editingAttributedStringFromRange:]):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::altDisplayString):
(WebCore::HitTestResult::absoluteImageURL):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintIntoRect):
(WebCore::RenderImage::imageMap):
(WebCore::RenderImage::updateAltText):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldRespectImageOrientation):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::webContext):
(BlackBerry::WebKit::WebPagePrivate::blockZoomRectForNode):
(BlackBerry::WebKit::WebPage::blockZoom):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::isElementClickable):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] adopt new AVFoundation caption API
https://bugs.webkit.org/show_bug.cgi?id=118207

Reviewed by Dean Jackson.

No new tests, I was not able to come up with a reliable layout test.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): New, call currentTrack->resetCueValues().
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]): New delegate method.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix Windows builds after deprecatedCharactersWithNullTermination() removal.

Source/WebKit2:

* Platform/CoreIPC/win/ConnectionWin.cpp:
(CoreIPC::Connection::createServerAndClientIdentifiers):

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(addFontFallbackIfPresent):
(removeFontFallbackIfPresent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Un-crashify JSC tests on debug bots after Anders had his way with StringImpl.

* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(151586): multipart/x-mixed-replace images are broken
https://bugs.webkit.org/show_bug.cgi?id=118169

Reviewed by Alexey Proskuryakov.

When loading multipart content the resource data will change as
the next part is loaded, so we need to make a copy of the data
before sending it to the resource.

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Adopt is/toHTMLOptionElement for code cleanup
https://bugs.webkit.org/show_bug.cgi?id=118212

Reviewed by Andreas Kling.

To enhance readability, this patch adopts is/toHTMLOptionElement.
This also helps out to reduce duplicated use of static_cast.

Source/WebCore:

* accessibility/AccessibilityListBoxOption.cpp:
(WebCore::AccessibilityListBoxOption::isSelected):
(WebCore::AccessibilityListBoxOption::canSetSelectedAttribute):
(WebCore::AccessibilityListBoxOption::stringValue):
(WebCore::AccessibilityListBoxOption::listBoxOptionParentNode):
* accessibility/AccessibilityMenuListOption.cpp:
(WebCore::AccessibilityMenuListOption::setElement):
(WebCore::AccessibilityMenuListOption::isEnabled):
(WebCore::AccessibilityMenuListOption::isSelected):
(WebCore::AccessibilityMenuListOption::setSelected):
(WebCore::AccessibilityMenuListOption::stringValue):
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityHitTest):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement):
* html/HTMLCollection.cpp:
(WebCore::isMatchingElement):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::index):
* html/HTMLOptionElement.h:
(WebCore::isHTMLOptionElement):
(WebCore::toHTMLOptionElement):
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::hasPlaceholderLabelOption):
(WebCore::HTMLSelectElement::value):
(WebCore::HTMLSelectElement::setValue):
(WebCore::HTMLSelectElement::childShouldCreateRenderer):
(WebCore::HTMLSelectElement::nextValidIndex):
(WebCore::HTMLSelectElement::saveLastSelection):
(WebCore::HTMLSelectElement::setActiveSelectionAnchorIndex):
(WebCore::HTMLSelectElement::updateListBoxSelection):
(WebCore::HTMLSelectElement::listBoxOnChange):
(WebCore::HTMLSelectElement::recalcListItems):
(WebCore::HTMLSelectElement::selectedIndex):
(WebCore::HTMLSelectElement::selectOption):
(WebCore::HTMLSelectElement::optionToListIndex):
(WebCore::HTMLSelectElement::listToOptionIndex):
(WebCore::HTMLSelectElement::deselectItemsWithoutValidation):
(WebCore::HTMLSelectElement::saveFormControlState):
(WebCore::HTMLSelectElement::searchOptionsForValue):
(WebCore::HTMLSelectElement::restoreFormControlState):
(WebCore::HTMLSelectElement::appendFormData):
(WebCore::HTMLSelectElement::reset):
(WebCore::HTMLSelectElement::updateSelectedState):
(WebCore::HTMLSelectElement::lastSelectedListIndex):
(WebCore::HTMLSelectElement::optionAtIndex):
(WebCore::HTMLSelectElement::accessKeySetSelectedIndex):
(WebCore::HTMLSelectElement::length):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::hasImpliedEndTag):
* html/parser/HTMLElementStack.cpp:
(WebCore::HTMLNames::isSelectScopeMarker):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
(WebCore::HTMLTreeBuilder::processStartTag):
(WebCore::HTMLTreeBuilder::processEndTag):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::updateFromElement):
(WebCore::RenderListBox::addFocusRingRects):
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::updateOptionsWidth):
(WebCore::RenderMenuList::setTextFromOption):
(WebCore::RenderMenuList::itemText):
(WebCore::RenderMenuList::itemIsEnabled):
(WebCore::RenderMenuList::itemIsSelected):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks):

Source/WebKit/blackberry:

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
(BlackBerry::WebKit::InputHandler::didNodeOpenPopup):
(BlackBerry::WebKit::InputHandler::openSelectPopup):
(BlackBerry::WebKit::InputHandler::setPopupListIndexes):
* WebKitSupport/SelectPopupClient.cpp:
(BlackBerry::WebKit::SelectPopupClient::setValueAndClosePopup):

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMElement::createInstance):
* DOMHTMLClasses.cpp:
(DOMHTMLOptionElement::text):
(DOMHTMLOptionElement::label):


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