[BlackBerry] Only clear credentials when purgeCredentials is called
https://bugs.webkit.org/show_bug.cgi?id=107124

Patch by Joe Mason <jmason@rim.com> on 2013-01-18
Reviewed by Yong Li.

Stop clearing credentials when sending out a request just in case they're wrong. That's stupid and
has race conditions. Only clear them when we know they're wrong.

Internal PR: 231158
Internal Reviewer: George Staikos

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::sendRequestWithCredentials):
(WebCore::NetworkJob::purgeCredentials):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r132699): Crashes in WebCore::TextIterator::handleTextNodeFirstLetter
https://bugs.webkit.org/show_bug.cgi?id=100688

Reviewed by Martin Robinson.

Prevent crashes when accessibilityObjectIsIgnored calls textUnderElement
while a subtree is being destroyed.

Covered by existing tests.

* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r140158.
http://trac.webkit.org/changeset/140158
https://bugs.webkit.org/show_bug.cgi?id=107297

Broke android build (Requested by danakj on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-18

* chromium/public/WebVideoFrame.h:
(WebKit):
(WebKit::WebVideoFrame::format):
(WebKit::WebVideoFrame::width):
(WebKit::WebVideoFrame::height):
(WebKit::WebVideoFrame::planes):
(WebKit::WebVideoFrame::stride):
(WebKit::WebVideoFrame::data):
(WebKit::WebVideoFrame::textureId):
(WebKit::WebVideoFrame::textureTarget):
(WebKit::WebVideoFrame::visibleRect):
(WebKit::WebVideoFrame::textureSize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] fix compile warnings in NetworkJob
https://bugs.webkit.org/show_bug.cgi?id=107293

Patch by Joe Mason <jmason@rim.com> on 2013-01-18
Reviewed by Yong Li.

Internal PR: 283096

* platform/network/blackberry/NetworkJob.cpp:
(WebCore):
(WebCore::isAppendableHeader):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Fix CMake warnings
https://bugs.webkit.org/show_bug.cgi?id=107290

Patch by Sudarsana Nagineni <sudarsana.nagineni@intel.com> on 2013-01-18
Reviewed by Laszlo Gombos.

Add missing WebKit options to CMake features list.

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Set spellchecking calculations on a timer to free up the WebKit thread
https://bugs.webkit.org/show_bug.cgi?id=107284

Reviewed by Rob Buis.

PR282351
Firing off spellcheck requests is tieing up the WebKit thread for an
extended period of time. In testing with large blocks of text, this
can be in the matter of 5-10 seconds. Though we are using asynchronous
spellchecking, the process in which we break down blocks of text based
on input_service limitations is the issue.
Using a timer here which fires with an arbitrary timeout to allow for
focus and interaction to maintain at a reasonable level.
Further, pulling this code out of InputHandler and into its own class.

Internally reviewed by Mike Fenton and Gen Mak.

* WebKitSupport/InputHandler.cpp:
(BlackBerry::WebKit::InputHandler::InputHandler):
(BlackBerry::WebKit::InputHandler::~InputHandler):
(BlackBerry::WebKit::InputHandler::callRequestCheckingFor):
(WebKit):
(BlackBerry::WebKit::InputHandler::requestCheckingOfString):
(BlackBerry::WebKit::InputHandler::spellCheckingRequestProcessed):
(BlackBerry::WebKit::InputHandler::shouldRequestSpellCheckingOptionsForPoint):
(BlackBerry::WebKit::InputHandler::setElementUnfocused):
(BlackBerry::WebKit::InputHandler::setElementFocused):
* WebKitSupport/InputHandler.h:
(WebCore):
(WebKit):
(InputHandler):
* WebKitSupport/SpellingHandler.cpp: Added.
(WebKit):
(BlackBerry::WebKit::SpellingHandler::SpellingHandler):
(BlackBerry::WebKit::SpellingHandler::~SpellingHandler):
(BlackBerry::WebKit::SpellingHandler::spellCheckTextBlock):
(BlackBerry::WebKit::SpellingHandler::createSpellCheckRequest):
(BlackBerry::WebKit::SpellingHandler::parseBlockForSpellChecking):
(BlackBerry::WebKit::SpellingHandler::getRangeForSpellCheckWithFineGranularity):
* WebKitSupport/SpellingHandler.h: Added.
(WebCore):
(WebKit):
(SpellingHandler):
(BlackBerry::WebKit::SpellingHandler::isSpellCheckActive):
(BlackBerry::WebKit::SpellingHandler::setSpellCheckActive):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Incorrect scrollable height during simplified layout
https://bugs.webkit.org/show_bug.cgi?id=107193

Reviewed by Ojan Vafai.

Source/WebCore:

Test: fast/overflow/height-during-simplified-layout.html

When computing overflow, we use the height of the block before it was clamped
(i.e., before updateLogicalHeight() has been called).

During simplfied layout, we use the previous sizes rather than doing a full
layout. We still compute overflow, but we were using the clamped height rather
than the full height.

This caused us to incorrectly compute the overflow by the vertical padding.
Since we were passing in the already clamped clientHeight to RenderBlock::computeOverflow,
we would only include the overflow from our children sizes and not include the overflow
from ourselves caused by padding + content.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout): Use the scrollable height rather than the
already clamped height.

LayoutTests:

* fast/overflow/height-during-simplified-layout-expected.txt: Added.
* fast/overflow/height-during-simplified-layout.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement ::cue() pseudo element property whitelist
https://bugs.webkit.org/show_bug.cgi?id=105477

Patch by Dima Gorbik <dgorbik@apple.com> on 2013-01-18
Reviewed by Antti Koivisto.

Source/WebCore:

Only allowed by specs properties are applied to WebVTT nodes. We used whitelists before for the region
style rule so this refactors the code a little bit to pass bitfields that contain the information on which
whitelists should be used.

Test: media/track/track-css-property-whitelist.html

* css/RuleSet.cpp:
(WebCore::RuleData::RuleData): set a region bit when creating a RuleData.
(WebCore::RuleSet::addRule): set a cue bit when PseudoCue type is set for a selector.
* css/RuleSet.h: add the new bitfield as an ivar and setters/getters to access it.
(WebCore::RuleData::isInRegionRule):
(WebCore::RuleData::whitelistType):
(WebCore::RuleData::isInCueRule):
(WebCore::RuleData::setIsInCueRule):
* css/StyleResolver.cpp: refactor the code to pass a bitfield instead of single bits.
(WebCore::StyleResolver::addMatchedProperties):
(WebCore::StyleResolver::sortAndTransferMatchedRules):
(WebCore::StyleResolver::applyProperties):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::isValidCueStyleProperty):
* css/StyleResolver.h:

LayoutTests:

* media/track/captions-webvtt/whitelist.vtt: Added.
* media/track/track-css-property-whitelist-expected.txt: Added.
* media/track/track-css-property-whitelist.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cannot abort multiple XHR POSTs made to same url
https://bugs.webkit.org/show_bug.cgi?id=106937

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Test: http/tests/cache/cancel-multiple-post-xhrs.html

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::removeClient): Call allClientsRemoved() regardless
    of whether this resource is inCache(). Otherwise, CachedRawResources will
    not have the opportunity to cancel as expected. However, don't cancel
    if the last client was removed because we're in the middle of switching
    the clients over to a successfully revalidated resource.

LayoutTests:

* http/tests/cache/cancel-multiple-post-xhrs-expected.txt: Added.
* http/tests/cache/cancel-multiple-post-xhrs.html: Added.
* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Scroll gestures should not create wheel events
https://bugs.webkit.org/show_bug.cgi?id=103952

Reviewed by James Robinson.

Source/WebCore:

Tests: fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html
       fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html
       fast/events/touch/gesture/touch-gesture-scroll-iframe-editable.html
       fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html
       fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html

In EventHandler::handleGestureEvent(), scroll gestures should not be handled by synthesizing
and dispatching wheel events; we should instead scroll the relevant layer directly.

Note that this patch should be landed together with the patch for
https://bugs.webkit.org/show_bug.cgi?id=106589.

* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::passGestureEventToWidget):
(WebCore::EventHandler::passGestureEventToWidgetIfPossible):
(WebCore):
(WebCore::closestScrollableNodeInDocumentIfPossibleOrSelfIfNotScrollable):
(WebCore::EventHandler::handleGestureScrollBegin):
(WebCore::EventHandler::handleGestureScrollUpdate):
(WebCore::EventHandler::isScrollbarHandlingGestures):
* page/EventHandler.h:
(EventHandler):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollByRecursively):
* rendering/RenderLayer.h:

LayoutTests:

Added five new layout tests to check that scroll gestures will correctly scroll
nested divs and iframes. Also modified existing layout tests to no longer
expect mousewheel events.

* fast/events/touch/gesture/resources/scroll-inside-editable-iframe.html: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-div-scaled.html:
* fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-div.html:
* fast/events/touch/gesture/touch-gesture-scroll-iframe-editable-expected.txt: Copied from LayoutTests/platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-expected.txt.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-editable.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-iframe.html.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-iframe.html:
* fast/events/touch/gesture/touch-gesture-scroll-page-propagated-expected.txt: Added.
* fast/events/touch/gesture/touch-gesture-scroll-page-propagated.html: Copied from LayoutTests/fast/events/touch/gesture/touch-gesture-scroll-page.html.
* fast/events/touch/gesture/touch-gesture-scroll-page.html:
* fast/events/touch/gesture/touch-gesture-scroll-shy-target.html:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-scaled-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-div-twice-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-iframe-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-page-expected.txt:
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-page-propagated-expected.txt: Added.
* platform/chromium/fast/events/touch/gesture/touch-gesture-scroll-shy-target-expected.txt:
* platform/chromium/plugins/gesture-events-expected.txt:
* platform/chromium/plugins/gesture-events-scrolled-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: Improve table-guessing heuristics
https://bugs.webkit.org/show_bug.cgi?id=107042

Reviewed by Chris Fleizach.

Source/WebCore:

Adds some more rules so that tables with cell borders, empty-cells,
col, colgroup, or >= 20 rows are all considered data tables, not
layout tables.

Test: accessibility/table-detection.html (modified)

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::isDataTable):

Tools:

Implement parentElementCallback on Chromium to make testing easier.

* DumpRenderTree/chromium/TestRunner/src/AccessibilityUIElementChromium.cpp:
(WebTestRunner::AccessibilityUIElement::parentElementCallback):

LayoutTests:

Add tests for tables with cell borders, empty-cells,
col, colgroup, and >= 20 rows. Refactor the test to make it
easier to read the output and see whether it passed or not.

* accessibility/table-detection.html: Modified.
* platform/chromium/TestExpectations: Un-skip table-detection.html.
* platform/chromium/accessibility/table-detection-expected.txt: Added.
* platform/mac/accessibility/table-detection-expected.txt: Moved.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PropertyCollection test fails on JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=106997

Reviewed by Kentaro Hara.

Source/WebCore: 

Made changes in CodeGeneratorJS.pm so that it can use
toJS(JSC::ExecState*, JSDOMGlobalObject*, PropertyNodeList*)
to wrap the object and return PropertyNodeList instead of NodeList.

Test: fast/dom/MicroData/propertiescollection-crash.html
      fast/dom/MicroData/properties-collection-namedgetter-with-invalid-name.html

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

LayoutTests: 

Unskipping related testcases from TestExpectations.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Use new-style gesture scrolling events for fling and
for plugin scrolling: https://bugs.webkit.org/show_bug.cgi?id=106589

Reviewed by James Robinson.

https://bugs.webkit.org/show_bug.cgi?id=103952 modified touchscreen
scrolling to not use synthetic mouse wheel events. Update the fling facility
in WebViewImpl to use these events for touchscreen-initiated flings. Also
modify the WebPluginContainerImpl to scroll in response to touchscreen
scroll gestures if the plugin does not itself implement gesture events.

* src/WebPluginContainerImpl.cpp:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::scrollBy): Handle fling callback conditionally based
on initiating device. Touchpad flings generate wheels. Touchscreen flings
use gesture events.
(WebKit::WebViewImpl::handleGestureEvent):
(WebKit::WebViewImpl::transferActiveWheelFlingAnimation):
* src/WebViewImpl.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Convert WebTransformOperations into pure virtual
https://bugs.webkit.org/show_bug.cgi?id=105553

Patch by Ali Juma <ajuma@chromium.org> on 2013-01-18
Reviewed by James Robinson.

Source/Platform:

* chromium/public/WebCompositorSupport.h:
(WebKit):
(WebKit::WebCompositorSupport::createTransformOperations):
(WebCompositorSupport):
* chromium/public/WebTransformKeyframe.h:
(WebTransformKeyframe):
* chromium/public/WebTransformOperations.h:
(WebKit::WebTransformOperations::~WebTransformOperations):
(WebTransformOperations):

Source/WebCore:

This removes the implementation of WebTransformOperations and updates
users to construct instances using a factory function. This also adds
the implementation of WebTransformKeyFrame.

No new tests, no change in functionality.

* WebCore.gypi:
* platform/chromium/support/WebTransformKeyframe.cpp: Copied from Source/Platform/chromium/public/WebTransformKeyframe.h.
(WebKit):
(WebKit::WebTransformKeyframe::WebTransformKeyframe):
(WebKit::WebTransformKeyframe::~WebTransformKeyframe):
(WebKit::WebTransformKeyframe::time):
(WebKit::WebTransformKeyframe::value):
* platform/chromium/support/WebTransformOperations.cpp: Removed.
* platform/graphics/chromium/AnimationTranslationUtil.cpp:
(WebCore::toWebTransformOperations):
(WebCore::WebTransformAnimationCurve):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Remove custom V8ScriptProfileNodeCustom::toV8()
https://bugs.webkit.org/show_bug.cgi?id=107245

Reviewed by Adam Barth.

V8ScriptProfileNodeCustom::toV8() needs not to be custom.
Furthermore, the current custom toV8() is wrong in that
it doesn't use a creationContext and it doesn't set a wrapper
class id. This is one of steps to avoiding ASSERT()s
that will be added in https://bugs.webkit.org/show_bug.cgi?id=107137 .

No tests. No change in behavior.

* UseV8.cmake:
* WebCore.gypi:
* bindings/v8/custom/V8ScriptProfileNodeCustom.cpp: Removed.
* inspector/ScriptProfileNode.idl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor isPowerOf2() and add getLSBSet()
https://bugs.webkit.org/show_bug.cgi?id=107306

Reviewed by Filip Pizlo.

Source/JavaScriptCore: 

Moved implementation of isPowerOf2() to new hasOneBitSet() in wtf/MathExtras.h.

* runtime/PropertyMapHashTable.h:
(JSC::isPowerOf2):

Source/WTF: 

Moved runtime/PropertyMapHashTable.h:PowerOf2() to new hasOneBitSet() and added getLSBSet().

* wtf/MathExtras.h:
(hasOneBitSet):
(getLSBSet):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Enable indexed database for development builds
https://bugs.webkit.org/show_bug.cgi?id=107299

Patch by Martin Robinson <mrobinson@igalia.com> on 2013-01-18
Reviewed by Gustavo Noronha Silva.

Tools:

* Scripts/webkitperl/FeatureList.pm: Enable indexed database by default
for GTK+ development builds.

LayoutTests:

* platform/gtk/TestExpectations: Skip failing IDB tests and mark
flaky tests as flaky.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] DumpRenderTree/WebKitTestRunner should disable NSBeep
https://bugs.webkit.org/show_bug.cgi?id=107251

Reviewed by Simon Fraser.

Disable NSBeep in DumpRenderTree and WebKitTestRunner using NSSound SPI.

* DumpRenderTree/mac/DumpRenderTree.mm:
(dumpRenderTree):
* WebKitTestRunner/InjectedBundle/mac/InjectedBundleMac.mm:
(WTR::InjectedBundle::platformInitialize):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] DumpRenderTree/WebKitTestRunner should not participate in Exposé/Mission Control
https://bugs.webkit.org/show_bug.cgi?id=107234

Reviewed by Simon Fraser.

* DumpRenderTree/mac/DumpRenderTree.mm:
(createWebViewAndOffscreenWindow): Disable participation in Exposé via NSWindowCollectionBehaviorStationary.
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::PlatformWebView): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Roll Chromium DEPS to 177676

Unreviewed DEPS roll.

* DEPS:

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