Cancel the outstanding vibration pattern if the pattern is 0 or an empty list
https://bugs.webkit.org/show_bug.cgi?id=94085

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-08-20
Reviewed by Kentaro Hara.

vibrate() method to stop the device from vibrating is getting called before the
vibration is in effect. Hence, it is failing to cancel the pre-existing instance
of processing vibration patterns.

This patch cancel the pre-existing instance of the processing vibration patterns
always when the vibrate() method called with pattern 0 or an empty list.

No new tests since there is no return value in the Vibration API to test this
particular case. Existing test fast/dom/navigator-vibration.html covers testing of
the Vibration API.

* Modules/vibration/Vibration.cpp:
(WebCore::Vibration::vibrate):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fixed lint errors in TestExpectations after r126110.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix inspector with variables enabled and enable inspector variables tests by default.
https://bugs.webkit.org/show_bug.cgi?id=94296

Reviewed by Hajime Morita.

Source/WebCore:

Change from using getPropertyName static function to CSSProperty::cssName(), which can resolve variables if needed.

Covered by inspector/styles/variables.

* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::item):

LayoutTests:

Fix paths to included javascript and enable tests by default on Chromium port.

* inspector/styles/variables/css-variables.html:
* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed dead code from a very old iteration of CSS counters.
https://bugs.webkit.org/show_bug.cgi?id=94539

Patch by Elliott Sprehn <esprehn@chromium.org> on 2012-08-20
Reviewed by Eric Seidel.

Remove two unused shorts that were on StyleRareNonInheritedData that are no longer used.

No tests, this just removes dead code.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:
(StyleRareNonInheritedData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
XSSAuditor too tolerant of injected data: URLs from other "hostless" schemes.
https://bugs.webkit.org/show_bug.cgi?id=94547

Reviewed by Adam Barth.

Source/WebCore:

Check that there is a host before making same-host tests.

Test: fast/frames/xss-auditor-handles-file-urls.html

* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::eraseAttributeIfInjected):
(WebCore::XSSAuditor::isLikelySafeResource):
* html/parser/XSSAuditor.h:

LayoutTests:

* fast/frames/resources/static-xss-vector.html: Added.
* fast/frames/xss-auditor-handles-file-urls-expected.txt: Added.
* fast/frames/xss-auditor-handles-file-urls.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Make the popup positioning code testable
https://bugs.webkit.org/show_bug.cgi?id=94086

Reviewed by Hajime Morita.

Source/WebCore:

Introduce PopupContent interface in order to make a mock.

* platform/chromium/PopupContainer.cpp:
(WebCore::PopupContainer::layoutAndCalculateWidgetRectInternal):
 - Make it a member of PopupContainer to avoid namespace pollution.
 - Use PopupContent interface.
 - Make the code clearer.
* platform/chromium/PopupContainer.h:
(PopupContainer): Expose layoutAndCalculateWidgetRectInternal.

* platform/chromium/PopupListBox.cpp:
(WebCore::PopupListBox::popupContentHeight): Added.
* platform/chromium/PopupListBox.h:
(PopupContent): Added.
(PopupListBox): Inherit PopupContent.
(WebCore::PopupListBox::~PopupListBox):
Make this virtual because this class has some virtual functions.

Source/WebKit/chromium:

* WebKit.gypi: Add PopupContainerTest.cpp.
* tests/PopupContainerTest.cpp: Added.
(MockPopupContent):
(calculatePosition):
(TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Texture layer should not generate zero textureId quads
https://bugs.webkit.org/show_bug.cgi?id=94550

Patch by Alexandre Elias <aelias@google.com> on 2012-08-20
Reviewed by Adrienne Walker.

After a context loss, CCTextureLayerImpl would clear its textureId
but continued to produce external resources and quads with the zero
textureid.  Add early returns so that CCTextureLayerImpl becomes
inert after a context loss.

Added assertion in read lock so that dontUseOldResourcesAfterLostContext
test catches the problem.

* platform/graphics/chromium/cc/CCResourceProvider.h:
(WebCore::CCScopedLockResourceForRead::CCScopedLockResourceForRead):
* platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
(WebCore::CCTextureLayerImpl::willDraw):
(WebCore::CCTextureLayerImpl::appendQuads):
(WebCore::CCTextureLayerImpl::didDraw):
(WebCore::CCTextureLayerImpl::didLoseContext):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename collectGarbageIfNecessary() to hintForCollectGarbage()
https://bugs.webkit.org/show_bug.cgi?id=94455

Reviewed by Adam Barth.

This is a follow-up patch for r126098.

collectGarbage() always collects garbage. collectGarbageIfNecessary() just sends
an idle notification to V8, which is just a hint for V8 to trigger GC.
To clarify the difference, this patch renames collectGarbageIfNecessary()
to hintForCollectGarbage().

No tests. No change in behavior.

* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::clearForClose):
(WebCore::ScriptController::clearForNavigation):
* bindings/v8/V8GCController.cpp:
(WebCore::V8GCController::hintForCollectGarbage):
* bindings/v8/V8GCController.h:
(V8GCController):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Chromium gardening. Improved how a few test
expectations were merged together in r126117.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126124 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a watcher for WTF changes

Unreviewed.

Add myself as a watcher for changes in WTF.

* Scripts/webkitpy/common/config/watchlist:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126125 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium-win] Use native digits in parsing/formatting dates in the textfield part of input[type=date]
https://bugs.webkit.org/show_bug.cgi?id=94281

Reviewed by Hajime Morita.

Source/WebCore:

Tests: Add some cases to Source/WebKit/chromium/tests/LocaleWinTest.cpp

* platform/text/LocaleWin.cpp:
(WebCore::LocaleWin::isLocalizedDigit): A helper for parseNumber(). This
return true if the specified character is one of native digits.
(WebCore::LocaleWin::parseNumber):
Try to parse ASCII digits, then try to parse native digtis. This
becomes a member of LocaleWin because it uses
convertFromLocalizedNumber().
(WebCore::LocaleWin::appendNumber): Apply convertToLocalizedNumber().
(WebCore::LocaleWin::appendTwoDigitsNumber): ditto.
(WebCore::LocaleWin::appendFourDigitsNumber): ditto.
* platform/text/LocaleWin.h:
(LocaleWin):
- Make some static functions member functions of LocaleWin.
- Add isLocalizedDigit().

Source/WebKit/chromium:

* tests/LocaleWinTest.cpp:
(TEST_F): Added formatting and parsing tests for Persian locale to check
native digit behavior.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ShadowRoot.cloneNode() must always throw a DATA_CLONE_ERR exception.
https://bugs.webkit.org/show_bug.cgi?id=91704

Reviewed by Dimitri Glazkov.

Source/WebCore:

According to the spec, ShadowRoot.cloneNode() should throw a DATA_CLONE_ERR exception. The existing implementation
returned null object instead.

We change the cloneNode() interface so that we can throw an exception from cloneNode().

Test: fast/dom/shadow/shadowroot-clonenode.html

* dom/Attr.cpp:
(WebCore::Attr::cloneNode):
* dom/Attr.h:
* dom/CDATASection.cpp:
(WebCore::CDATASection::cloneNode):
* dom/CDATASection.h:
(CDATASection):
* dom/Comment.cpp:
(WebCore::Comment::cloneNode):
* dom/Comment.h:
(Comment):
* dom/Document.cpp:
(WebCore::Document::cloneNode):
* dom/Document.h:
(Document):
* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::cloneNode):
* dom/DocumentFragment.h:
(DocumentFragment):
* dom/DocumentType.cpp:
(WebCore::DocumentType::cloneNode):
* dom/DocumentType.h:
(DocumentType):
* dom/Element.cpp:
(WebCore::Element::cloneNode):
* dom/Element.h:
(Element):
* dom/EntityReference.cpp:
(WebCore::EntityReference::cloneNode):
* dom/EntityReference.h:
(EntityReference):
* dom/Node.h:
(Node):
(WebCore::Node::cloneNode):
* dom/Node.idl:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::cloneNode):
* dom/ProcessingInstruction.h:
(ProcessingInstruction):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::cloneNode):
* dom/ShadowRoot.h:
(ShadowRoot):
* dom/Text.cpp:
(WebCore::Text::cloneNode):
* dom/Text.h:
(Text):

LayoutTests:

* fast/dom/shadow/shadowroot-clonenode-expected.txt: Added.
* fast/dom/shadow/shadowroot-clonenode.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Select popup shows blank content when its option tags contain '\' characters
https://bugs.webkit.org/show_bug.cgi?id=94321

Patch by Sean Wang <Xuewen.Wang@torchmobile.com.cn> on 2012-08-20
Reviewed by George Staikos.

PR 194224

When the SelectPopupClient generates HTML, if there is a character '\' in the select options'
description, we should escape it to avoid the character being interpreted as an escape character.

* WebCoreSupport/SelectPopupClient.cpp:
(WebCore::SelectPopupClient::generateHTML):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126128 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix broken non-JIT build.
https://bugs.webkit.org/show_bug.cgi?id=94564.

Patch by Mark Lam <mark.lam@apple.com> on 2012-08-20
Reviewed by Filip Pizlo.

Added some UNUSED_PARAM() macros to make the compiler happy.

* runtime/Executable.cpp:
(JSC::EvalExecutable::compileInternal):
(JSC::ProgramExecutable::compileInternal):
(JSC::FunctionExecutable::compileForCallInternal):
(JSC::FunctionExecutable::compileForConstructInternal):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126129 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Regression(r126127): Build break on multiple platforms
https://bugs.webkit.org/show_bug.cgi?id=94568

Reviewed by Hajime Morita.

Notation::cloneNode should also have ExceptionCode. We add it in this patch.

No new tests, no change in behavior.

* dom/Notation.cpp:
(WebCore::Notation::cloneNode):
* dom/Notation.h:
(Notation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126130 268f45cc-cd09-0410-ab3c-d52691b4dbfc
load event shouldn't fired during node insertion traversals.
https://bugs.webkit.org/show_bug.cgi?id=94447

Reviewed by Ryosuke Niwa.

Source/WebCore:

HTMLFrameElementBase::didNotifyDescendantInsertions() with empty @src
can trigger a load event during ChildNodeInsertionNotifier
traversal, whose handler can make DOM tree state inconsistent.

This change introduces a post traversal hook,
didNotifySubtreeInsertions(), for the insertion traversal and
replaces the problematic didNotifyDescendantInsertions() with it.

Since didNotifySubtreeInsertions() is invoked after the traversal,
it is safe for event handlers to mutate the tree.

Test: fast/frames/iframe-onload-and-domnodeinserted.html

* dom/ContainerNodeAlgorithms.h:
(ChildNodeInsertionNotifier): Added a post subtree notification.
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument):
(WebCore::ChildNodeInsertionNotifier::notify):
* dom/Node.h:
(WebCore::Node::didNotifySubtreeInsertions): Newly added.
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::insertedInto): Now returns InsertionShouldCallDidNotifySubtreeInsertions
(WebCore::HTMLFrameElementBase::didNotifySubtreeInsertions): Replaced didNotifyDescendantInsertions()
* html/HTMLFrameElementBase.h:
(HTMLFrameElementBase):

LayoutTests:

* fast/frames/iframe-onload-and-domnodeinserted-expected.txt: Added.
* fast/frames/iframe-onload-and-domnodeinserted.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clicking input type=range with padding or border sets wrong value
https://bugs.webkit.org/show_bug.cgi?id=94473

Reviewed by Kent Tamura.

Source/WebCore:

We should take the padding and border width into account when calculating the value from the mouse location.

Test: fast/forms/range/range-hit-test-with-padding.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::sliderTrackElementOf):
(WebCore):
(WebCore::SliderThumbElement::setPositionFromPoint):
* html/shadow/SliderThumbElement.h:
(WebCore):

LayoutTests:

* fast/forms/range/range-hit-test-with-padding-expected.txt: Added.
* fast/forms/range/range-hit-test-with-padding.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[jhbuild] EFL now runs jhbuild update for every build
https://bugs.webkit.org/show_bug.cgi?id=94267

Patch by Gustavo Noronha Silva <gns@gnome.org> on 2012-08-20
Reviewed by Martin Robinson.

Try to fix WinCE build by returning the empty string instead of
env when no jhbuild infrastructure is found.

* Scripts/webkitdirs.pm:
(jhbuildWrapperPrefixIfNeeded):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126133 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reduce GradientAttributes object size
https://bugs.webkit.org/show_bug.cgi?id=86151

Patch by Rob Buis <rbuis@rim.com> on 2012-08-20
Reviewed by Eric Seidel.

This reduces GradientAttributes in memory size by 8 bytes on my 64-bit system. It also
reduces the size of RenderSVGResourceLinearGradient and RenderSVGResourceRadialGradient.

* svg/GradientAttributes.h:
(WebCore::GradientAttributes::spreadMethod):
(WebCore::GradientAttributes::gradientUnits):
(GradientAttributes):
(WebCore):
(SameSizeAsGradientAttributes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cleanup TestExpectationParser.parse
https://bugs.webkit.org/show_bug.cgi?id=94545

Reviewed by Dirk Pranke.

Refactor TestExpectations to simplify the code.

* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationParser.parse): Merged _tokenize_list.
(TestExpectationParser._parse_line): Removed the call to _check_modifiers_against_expectations
since the check is now done in _parser_modifiers.
(TestExpectationParser._parse_modifiers): Merged _check_modifiers_against_expectations.
(TestExpectationParser._tokenize_line): Renamed from _tokenize.
(TestExpectationParser._split_space_separated): No longer calls lower() on all modifiers.
This is done on a local variable in _parse_modifiers, preserving the original case.
(TestExpectations.remove_rebaselined_tests.without_rebaseline_modifier): Check the existence
of 'rebaseline' against parsed modifiers.
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
(TestExpectationParserTests._tokenize):
(TestExpectationParserTests.test_tokenize_valid_with_comment): Preserves case.
(TestExpectationParserTests.test_tokenize_valid_with_multiple_modifiers): Ditto.
(TestExpectationSerializerTests._tokenize):
(TestExpectationSerializerTests.assert_list_round_trip): Call parse since _tokenize_list has
been merged into parse.
* Scripts/webkitpy/tool/commands/queries_unittest.py:
(PrintExpectationsTest.test_csv): Preserves the case.


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