2 clampTo unit tests are failing
https://bugs.webkit.org/show_bug.cgi?id=105253

Reviewed by Emil A Eklund.

Removed clampToUnsigned as it was actually testing exactly what
clampToUnsignedLong was doing. Also made clampToIntFloat more robust
to precision loss (fix suggested by Emil).

* TestWebKitAPI/Tests/WTF/MathExtras.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix regression from r137923 that caused all tiles to paint when scrolling
https://bugs.webkit.org/show_bug.cgi?id=105394

Reviewed by Dean Jackson.

r137923 removed a 'continue' from the loop that ensures we have tile coverage,
but this caused us to issue repaints for all existing tiles.

Fix to 'continue' when the tile size is unchanged. Also remove 'primaryLayerCount'
which was unused.

* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::revalidateTiles):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fixing incorrect include path and unskipping broken test.

* fast/events/touch/touch-input-element-change-documents.html:
* platform/efl/TestExpectations:
* platform/qt/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Updating expectations following r137847.

* platform/chromium-linux-x86/fast/dom/Window: Added.
* platform/chromium-linux-x86/fast/dom/Window/webkitConvertPoint-expected.txt: Added.
* platform/chromium-linux/fast/dom/Window/webkitConvertPoint-expected.txt: Added.
* platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt: Removed.
* platform/chromium-linux/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-linux/platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-linux/platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac-lion/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
* platform/chromium-mac-lion/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac-lion/platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac-lion/platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac-snowleopard/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
* platform/chromium-mac-snowleopard/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png
* platform/chromium-mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
* platform/chromium-mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt:
* platform/chromium-mac/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
* platform/chromium-win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png: Added.
* platform/chromium-win/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt: Added.
* platform/chromium-win/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-win/platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-win/platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. The previous rebaseline didn't quite get it right for Mac.

* platform/chromium-mac-lion/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac-lion/platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac-lion/platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/suggestion-picker/date-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/suggestion-picker/month-suggestion-picker-appearance-with-scroll-bar-expected.png:
* platform/chromium-mac/platform/chromium/fast/forms/suggestion-picker/week-suggestion-picker-appearance-with-scroll-bar-expected.png:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Correct missing touch event handler de-registration for nested Documents and DOMWindows
https://bugs.webkit.org/show_bug.cgi?id=105384

Reviewed by James Robinson.

Source/WebCore: 

Correcting case by which a nested DOMWindow wouldn't clean up its event handler references
on its Document when removeAllEventListeners was called. Also, correctly propagating this
from a nested Document to its owner Document.

Updating fast/events/touch/touch-handler-count.html to catch this bug.

* dom/Document.cpp:
(WebCore::Document::didRemoveEventTargetNode):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::removeAllEventListeners):

LayoutTests: 

* fast/events/touch/touch-handler-count-expected.txt:
* fast/events/touch/touch-handler-count.html: Adding case of nested DOMWindows with event handlers.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Popup menu on Windows should fade in instead of sliding in.
https://bugs.webkit.org/show_bug.cgi?id=105358
<rdar://problem/7611211>

Reviewed by Timothy Horton.

Changing popup menu display animation to match what most other Windows applications do.

* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::show):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make RenderLayerCompositor::requiresCompositingForScrollableFrame scrollbars agnostic
https://bugs.webkit.org/show_bug.cgi?id=97903

Reviewed by Simon Fraser.
Patch by Antonio Gomes <a1.gomes@sisa.samsung.com>

Some ports (including Qt-wk1 and BlackBerry) allow disabling
scrollbars at FrameView creation level. Regardless the scrollbars
presence though, their frame's content can still be scrolled as needed.
The said, checking for the scrollbars presence in order to determine
the scrollability of an inner frame is flaky, as done in RenderLayerCompositor::requiresCompositingForScrollableFrame.

Instead, the patch factors out part of the logic in
FrameView::updateScrollableAreaSet into a new ::isScrollable method.
The later can be used to check the scrollability of a given FrameView.

No new tests added, since there is no behavior change: ports like Chromium and others
who currently check for the scrollbars presence in order to determine
an inner frame scrollability should not be affected.

* page/FrameView.cpp:
(WebCore::FrameView::isScrollable):
(WebCore):
(WebCore::FrameView::updateScrollableAreaSet):
* page/FrameView.h:
(FrameView):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement CSS parsing for CSS transitions unprefixed.
https://bugs.webkit.org/show_bug.cgi?id=104804

Reviewed by Dean Jackson.

.:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:
* configure.ac:

Source/JavaScriptCore:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add support of an unprefixed version of CSS transitions modules by adding unprefixed versions
of each CSS properties. The work is protected behind the flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS properties are ready to be unprefixed.

Test: transitions/transitions-parsing.html

* Configurations/FeatureDefines.xcconfig:
* GNUmakefile.am:
* GNUmakefile.features.am.in:
* css/CSSPropertyNames.in: alias the unprefixed versions to the prefixed versions.

Source/WebKit/chromium:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* features.gypi:

Source/WebKit/mac:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* Configurations/FeatureDefines.xcconfig:

Tools:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* Scripts/webkitperl/FeatureList.pm:
* qmake/mkspecs/features/features.pri:

WebKitLibraries:

Add a new flag ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED
to cover the work of unprefixing Transforms, Animations and
Transitions. It will let the possibility of each ports to turn it off
in their release branches until we're confident that these CSS
properties are ready to be unprefixed.

* win/tools/vsprops/FeatureDefines.vsprops:
* win/tools/vsprops/FeatureDefinesCairo.vsprops:

LayoutTests:

Add new tests to cover the unprefixed version as well as the prefixed version of the properties.
It only covers the parsing and the computed style values.

* transitions/transitions-parsing.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Notify context client of change to table, and allow client to get a copy of it
https://bugs.webkit.org/show_bug.cgi?id=105364
<rdar://problem/12906267>

Reviewed by Brady Eidson.

Add a callback to notify the context client that the origin hashes have changed.
The client may choose to get a copy of that table and save it to disk.

* UIProcess/API/C/WKContext.cpp:
(WKContextCopyPlugInAutoStartOriginHashes): Added to the context client.
* UIProcess/API/C/WKContext.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::plugInAutoStartOriginHashes): Return a copy of the origin hash
table.
* UIProcess/WebContext.h:

* UIProcess/Plugins/PlugInAutoStartProvider.cpp:
(WebKit::PlugInAutoStartProvider::addAutoStartOrigin): When the origin is added to
the table, notify the context client.
(WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy): Create a copy of the
table.
* UIProcess/Plugins/PlugInAutoStartProvider.h:

* UIProcess/WebContextClient.cpp:
(WebKit::WebContextClient::plugInAutoStartOriginHashesChanged): Call the client.
* UIProcess/WebContextClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-skipping touch-input-element-chang-documents.html since it's still
failing on qt and efl.

* platform/efl/TestExpectations:
* platform/qt/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WTF String from ASCIILiteral fails to correctly handle empty strings.
https://bugs.webkit.org/show_bug.cgi?id=105453

Reviewed by Anders Carlsson.

When we have an zero length literal we should return the empty StringImpl.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::createFromLiteral):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        <rdar://problem/12896478> Cannot log into gmail/facebook with NetworkProcess and private browsing enabled
        https://bugs.webkit.org/show_bug.cgi?id=105454

        Reviewed by Brady Eidson.

        Request was using a wrong session after a redirect, because session cannot be
        preserved over IPC.

        Just set the storage session after calling the client, it is not really meaningful
        for a client to change session behind WebKit's back.

        * platform/network/cf/ResourceHandleCFNet.cpp:
        (WebCore::ResourceHandle::willSendRequest):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::willSendRequest):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerfTest.parse_output does too much
https://bugs.webkit.org/show_bug.cgi?id=105391

Reviewed by Tony Chang.

Moved the code to filter lines into PerfTest._filter_output, which has been renamed from _filter_stderr.
Also moved the code to output test results into PerfTest._run_with_driver.

* Scripts/webkitpy/performance_tests/perftest.py:
(PerfTest.__init__): Added _description.
(PerfTest.description): Added.
(PerfTest._run_with_driver): Moved the code to output test description and test results.
(PerfTest._filter_output): Moved and renamed from PerfTest._filter_stderr.
(PerfTest.parse_output): Removed the code to output test results. Return test results and description
respectively. Also removed the code that allowed some tests to omit values since all tests report each
iteration now since r136492.
(PerfTest.output_statistics): Removed the code to print test description, now done in _run_with_driver.
(ChromiumStylePerfTest._run_with_driver): Added. Chromium style tests are sufficiently different from
regular PerfTest that it doesn't make much sense to share _run_with_driver. But really, we should just
get rid of this type of test altogether in favor of regular performance tests that uses runner.js.
(ChromiumStylePerfTest.parse_and_log_output): Renamed from parse_output.
(PageLoadingPerfTest._run_with_driver): Removed the explicit '' for the test description.
* Scripts/webkitpy/performance_tests/perftest_unittest.py:
(MainTest.test_parse_output): Removed the expected logs since parse_output no longer prints out results.
Also added a call to _filter_output since parse_output doesn't filter the output text anymore.
(MainTest.test_parse_output_with_failing_line): Added a call to _filter_output. Also added ',' after 'Time:'
so that it's not string-concatenated with the next line.
(MainTest.test_parse_output_with_description): Added; a test for PerfTest.description().
(MainTest.test_parse_output_with_subtests): Removed the expected logs, and added a call to _filter_output.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    Calculate correct word offsets for form elements.
    https://bugs.webkit.org/show_bug.cgi?id=105354

    Reviewed by Rob Buis.

    PR266117
    We need to calculate correct offsets for form elements, such as
    textareas, relative to the start of the field. This allows for correct
    spell checking of words in a textarea element after line breaks.

    Internally reviewed by Mike Fenton.

    * WebKitSupport/InputHandler.cpp:
    (BlackBerry::WebKit::InputHandler::requestSpellingCheckingOptions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
StringImpl isolatedCopy unnecessarily copies text-segment character data
https://bugs.webkit.org/show_bug.cgi?id=105376

Reviewed by Anders Carlsson.

This patch adds a new (private) helper to StringImpl that tests whether the StringImpl
is backed by an ASCII literal.  This allows isolatedCopy() to safely use the createFromLiteral
constructor rather than making an unnecessary copy.

* wtf/text/StringImpl.h:
(StringImpl):
(WTF::StringImpl::isASCIILiteral):
(WTF::StringImpl::isolatedCopy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use ElementTraversal in LiveNodeListBase
https://bugs.webkit.org/show_bug.cgi?id=105324

Reviewed by Ryosuke Niwa.

Factor the code so that we get clean minimally branchy traversal functions for all the common cases.

This patch changes the more performance critical forward traversal only, backwards traversal is unaffected for now.

Instruments thinks it is a progression at least in DOM/DOMDivWalk.html. Bots should tell more.

* dom/ClassNodeList.cpp:
(WebCore::ClassNodeList::nodeMatches):
* dom/ClassNodeList.h:
(ClassNodeList):
(WebCore::ClassNodeList::create):
(WebCore):
(WebCore::ClassNodeList::nodeMatchesInlined):

    Add inlined version of the matching function for class lists.

* dom/LiveNodeList.cpp:
(WebCore::LiveNodeListBase::rootContainerNode):

    Root is always ContainerNode if the list has anything in it. Traversal functions are slightly more
    efficient if we know we are operating on ContainerNodes.

(WebCore):
* dom/LiveNodeList.h:
(LiveNodeListBase):
(WebCore::LiveNodeListBase::shouldOnlyIncludeDirectChildren):
* dom/Node.cpp:
(WebCore::Node::getElementsByTagName):
* dom/TagNodeList.cpp:
(WebCore::TagNodeList::TagNodeList):
(WebCore::TagNodeList::~TagNodeList):
(WebCore::HTMLTagNodeList::HTMLTagNodeList):
(WebCore::HTMLTagNodeList::nodeMatches):
* dom/TagNodeList.h:
(WebCore):
(TagNodeList):
(WebCore::TagNodeList::create):
(HTMLTagNodeList):
(WebCore::HTMLTagNodeList::create):

    Use separate ContainerType enum value for HTMLTagNodeList so we can tell it apart from TagNodeList.

(WebCore::HTMLTagNodeList::nodeMatchesInlined):

    Add inlined version of the matching function for tag lists.

* html/CollectionType.h:
* html/HTMLCollection.cpp:
(WebCore::shouldOnlyIncludeDirectChildren):
(WebCore::rootTypeFromCollectionType):
(WebCore::invalidationTypeExcludingIdAndNameAttributes):
(WebCore):
(WebCore::isMatchingElement):
        
    List type templated matching functions for common cases.

(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::create):
(WebCore::HTMLCollection::~HTMLCollection):
(WebCore::previousNode):
(WebCore::lastNode):
(WebCore::LiveNodeListBase::iterateForPreviousNode):
(WebCore::LiveNodeListBase::itemBefore):

    Leave the backwards traversal unchanged for now but remove the forward traversal code.

(WebCore::firstMatchingElement):
(WebCore::nextMatchingElement):
(WebCore::firstMatchingChildElement):
(WebCore::nextMatchingChildElement):
(WebCore::traverseMatchingElementsForwardToOffset):

    List type templated traversal functions with matching. Separate functions for first and subsequent elements

(WebCore::LiveNodeListBase::traverseChildNodeListForwardToOffset):
(WebCore::LiveNodeListBase::traverseLiveNodeListFirstElement):
(WebCore::LiveNodeListBase::traverseLiveNodeListForwardToOffset):

    LiveNodeList traversal, picking the right template.

(WebCore::LiveNodeListBase::item):
(WebCore::LiveNodeListBase::itemBeforeOrAfterCachedItem):

    Switch to new traversal functions.

(WebCore::HTMLCollection::traverseFirstElement):
(WebCore::HTMLCollection::traverseForwardToOffset):
(WebCore::HTMLCollection::traverseNextElement):

    HTMLCollection traversal, picking the right template.

(WebCore::HTMLCollection::namedItem):
(WebCore::HTMLCollection::updateNameCache):

    Switch to new traversal functions.

* html/HTMLCollection.h:
(HTMLCollection):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Regression] text-overflow ellipsis clips content when zoomed
https://bugs.webkit.org/show_bug.cgi?id=105456

Reviewed by Levi Weintraub.

Source/WebCore: 

At certain zoom levels text-overflow ellipsis incorrectly clips
content and displays the ellipsis even though the full content
would fit.

Test: fast/sub-pixel/ellipsis-zoom.html
        
* rendering/RenderBlock.h:
(WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine):
Add bug url to FIXME.
        
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlock::checkLinesForTextOverflow):
Pixel snap the content edge before comparing with the line box
edge as the line box edge is aligned to a pixel boundary.

LayoutTests: 

Add test for text-overflow: ellipsis.

* fast/sub-pixel/ellipsis-zoom-expected.html: Added.
* fast/sub-pixel/ellipsis-zoom.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] composited scrolling tests failing on Win
https://bugs.webkit.org/show_bug.cgi?id=105471

Unreviewed gardening.

Mark tests as failing on Win:

platform/chromium/virtual/gpu/compositedscrolling/overflow/scrolling-without-painting.html
platform/chromium/virtual/gpu/compositedscrolling/overflow/updating-scrolling-content.html

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] plugins/npp-set-window-called-during-destruction.html is flaky on Win
http://crbug.com/78835

Unreviewed gardening.

* platform/chromium/TestExpectations:

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