Remove stray spaces found after :: in case statements
https://bugs.webkit.org/show_bug.cgi?id=96314

Reviewed by Ojan Vafai.

New contributors keep copy/pasting this style error and it makes me sad.
Also remove the extra spaces in MediaQueryEvaluator.cpp.

No new tests, this is just a style refactor.

* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::unitCategory):
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WTR] Generated source files should include config.h
https://bugs.webkit.org/show_bug.cgi?id=96254

Reviewed by Benjamin Poulain.

Current coding style has encouraged to include config.h at the first position,
But derived sources, generated by CodeGeneratorTestRunner.pm, don't follow
this rule.
Therefore, this patch added it.

* WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
(_generateImplementationFile):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ElementAttributeData: Use subclasses to manage varying object layouts.
<http://webkit.org/b/94465>

Reviewed by Antti Koivisto.

Add two ElementAttributeData subclasses:

    - MutableElementAttributeData
    - ImmutableElementAttributeData

The ElementAttributeData::m_isMutable bit determines which subclass to cast to when accessing
the attribute storage. Added mutableAttributeVector() and immutableAttributeArray() helpers
to ElementAttributeData (with appropriate assertions.)

This patch removes one step of indirection in the mutable case, since the Vector<Attribute> is no
longer heap-allocated, but part of MutableElementAttributeData.

Added a WTF::deleteOwnedPtr(ElementAttributeData*) specialization so that the appropriate subclass
destructor is called for these objects.

* WebCore.exp.in:
* dom/Element.cpp:
(WebCore::Element::createMutableAttributeData):
* dom/ElementAttributeData.cpp:
(WebCore::ElementAttributeData::createImmutable):
(WebCore::ElementAttributeData::create):
(WebCore::ElementAttributeData::ElementAttributeData):
(WebCore::MutableElementAttributeData::MutableElementAttributeData):
(WebCore::ImmutableElementAttributeData::ImmutableElementAttributeData):
(WebCore::ImmutableElementAttributeData::~ImmutableElementAttributeData):
(WebCore::ElementAttributeData::makeMutableCopy):
(WebCore::ElementAttributeData::addAttribute):
(WebCore::ElementAttributeData::removeAttribute):
(WebCore::ElementAttributeData::reportMemoryUsage):
(WebCore::ElementAttributeData::cloneDataFrom):
(WebCore::ElementAttributeData::clearAttributes):
* dom/ElementAttributeData.h:
(ElementAttributeData):
(WebCore::ElementAttributeData::isMutable):
(ImmutableElementAttributeData):
(MutableElementAttributeData):
(WebCore::MutableElementAttributeData::MutableElementAttributeData):
(WebCore::ElementAttributeData::immutableAttributeArray):
(WebCore::ElementAttributeData::mutableAttributeVector):
(WebCore::ElementAttributeData::length):
(WebCore::ElementAttributeData::attributeItem):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename computeLogicalWidth to updateLogicalWidth
https://bugs.webkit.org/show_bug.cgi?id=96288

Reviewed by Ojan Vafai.

Also rename recomputeLogicalWidth to updateLogicalWidthAndColumnWidth.
Also rename RenderTableCell::updateLogicalWidth to RenderTableCell::setCellLogicalWidth.

No new tests, this is just a refactor.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateLogicalWidthAndColumnWidth):
(WebCore::RenderBlock::layoutBlock):
(WebCore::RenderBlock::layoutPositionedObjects):
(WebCore::RenderBlock::insertFloatingObject):
(WebCore::RenderBlock::getClearDelta):
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateLogicalWidth):
* rendering/RenderBox.h:
(RenderBox):
(WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::layout):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout):
(WebCore::RenderFlowThread::updateLogicalWidth):
* rendering/RenderFlowThread.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::canvasSizeChanged):
* rendering/RenderIFrame.cpp:
(WebCore::RenderIFrame::updateLogicalWidth):
(WebCore::RenderIFrame::layoutSeamlessly):
(WebCore::RenderIFrame::layout):
* rendering/RenderIFrame.h:
(RenderIFrame):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageDimensionsChanged):
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::updateLogicalWidth):
* rendering/RenderMeter.h:
(RenderMeter):
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::updateLogicalWidthAndColumnWidth):
* rendering/RenderMultiColumnBlock.h:
(RenderMultiColumnBlock):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::updateLogicalWidth):
* rendering/RenderMultiColumnSet.h:
(RenderMultiColumnSet):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::layout):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateLogicalWidth):
(WebCore::RenderTable::layout):
* rendering/RenderTable.h:
(RenderTable):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::updateLogicalWidth):
(WebCore::RenderTableCell::setCellLogicalWidth):
* rendering/RenderTableCell.h:
(RenderTableCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::setCellLogicalWidths):
* rendering/RenderView.cpp:
(WebCore::RenderView::updateLogicalWidth):
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::updateLogicalWidth):
* rendering/svg/RenderSVGForeignObject.h:
(RenderSVGForeignObject):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128110 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG misses arguments tear-off for function.arguments if 'arguments' is used
https://bugs.webkit.org/show_bug.cgi?id=96227

Reviewed by Gavin Barraclough.

Source/JavaScriptCore: 

We've decided not to allow function.arguments to alias the local
'arguments' object, or a local var or function named 'arguments'.
Aliasing complicates the implementation (cf, this bug) and can produce
surprising behavior for web programmers.

Eliminating the aliasing has the side-effect of fixing this bug.

The compatibilty story: function.arguments is deprecated, was never
specified, and throws an exception in strict mode, so we expect it to
disappear over time. Firefox does not alias to 'arguments'; Chrome
does, but not if you use eval or with; IE does; Safari did.

* dfg/DFGByteCodeParser.cpp: Noticed a little cleanup while verifying
this code. Use the CodeBlock method for better encapsulation.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::retrieveArgumentsFromVMCode): Behavior change: don't
alias.

* tests/mozilla/js1_4/Functions/function-001.js:
(TestFunction_4): Updated test expectations for changed behavior.

LayoutTests: 

New test, and updated expectations.
 
* fast/js/script-tests/function-dot-arguments.js:
* fast/js/function-dot-arguments-expected.txt: Updated for new behavior.

* fast/js/dfg-tear-off-function-dot-arguments.html:
* fast/js/script-tests/dfg-tear-off-function-dot-arguments.js: Added. New test for bug cited here.

* fast/js/function-dot-arguments-identity-expected.txt:
* fast/js/function-dot-arguments-identity.html: Added. New test for new behavior.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
NSInvalidArgumentException in WebFrameLoaderClient::shouldSendDoNotTrackHTTPHeader()
https://bugs.webkit.org/show_bug.cgi?id=96320

Reviewed by Geoffrey Garen.

Client was being cached as the FrameLoaderClient, but requests were sent to the ResourceLoadClient.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::shouldSendDoNotTrackHTTPHeader): Send the request to the FrameLoadDelegate.
* WebView/WebDelegateImplementationCaching.h:
* WebView/WebDelegateImplementationCaching.mm:
(CallFrameLoadDelegateReturningBoolean): Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Update notifications to latest spec
https://bugs.webkit.org/show_bug.cgi?id=91726
<rdar://problem/11910451>

Reviewed by Alexey Proskuryakov.

Among the changes:

Addition of lang attribute
http://lists.w3.org/Archives/Public/public-web-notification/2012Jul/0025.html

Specification of icon URL is icon instead of iconURL
http://lists.w3.org/Archives/Public/public-web-notification/2012Jul/0012.html

Tests are not possible since at best they only verify exposure of the attributes, which isn't
terribly useful, and use of the attributes depend on the platform.

* Modules/notifications/Notification.cpp:
(WebCore::Notification::create): Add support for reading lang, dir, and icon from option dictionary.
* Modules/notifications/Notification.h:
(Notification): Make url() and setURL(), which are used for HTML notifications, only available with
ENABLE(LEGACY_NOTIFICATIONS).
(WebCore::Notification::setIconURL): Added so that it can be set from the option dictionary.
(WebCore::Notification::lang):
(WebCore::Notification::setLang):
* Modules/notifications/Notification.idl: According to specification, dir is not exposed.

Source/WebKit/mac: Update notifications to latest spec
https://bugs.webkit.org/show_bug.cgi?id=91726
<rdar://problem/11910451>

Reviewed by Alexey Proskuryakov.

Expose lang and dir.

* WebView/WebNotification.h:
* WebView/WebNotification.mm:
(-[WebNotification lang]):
(-[WebNotification dir]):

Source/WebKit2: Update notifications to latest spec
https://bugs.webkit.org/show_bug.cgi?id=91726
<rdar://problem/11910451>

Reviewed by Alexey Proskuryakov.

Expose lang and dir.

* UIProcess/API/C/WKNotification.cpp:
(WKNotificationCopyLang):
(WKNotificationCopyDir):
* UIProcess/API/C/WKNotification.h:
* UIProcess/Notifications/WebNotification.cpp:
(WebKit::WebNotification::WebNotification):
* UIProcess/Notifications/WebNotification.h:
(WebKit::WebNotification::create):
(WebKit::WebNotification::lang):
(WebKit::WebNotification::dir):
(WebNotification):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::show):
* UIProcess/Notifications/WebNotificationManagerProxy.h:
(WebNotificationManagerProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showNotification):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::show):

LayoutTests: The options dictionary in Notification constructor should not accept event listeners
https://bugs.webkit.org/show_bug.cgi?id=95538
<rdar://problem/12213901>

Reviewed by Alexey Proskuryakov.

Make sure the onshow handler added in the options dictionary does not get called.

* http/tests/notifications/events-in-dictionary-expected.txt: Added.
* http/tests/notifications/events-in-dictionary.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128113 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AccessibilityNodeObject* is not in Mac xcode file
https://bugs.webkit.org/show_bug.cgi?id=96327

Reviewed by Sam Weinig.

* WebCore.xcodeproj/project.pbxproj:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r128109.
http://trac.webkit.org/changeset/128109
https://bugs.webkit.org/show_bug.cgi?id=96326

broke win and lion builds (Requested by kling on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-10

* WebCore.exp.in:
* dom/Element.cpp:
(WebCore::Element::createMutableAttributeData):
* dom/ElementAttributeData.cpp:
(WebCore::immutableElementAttributeDataSize):
(WebCore::ElementAttributeData::createImmutable):
(WebCore::ElementAttributeData::ElementAttributeData):
(WebCore::ElementAttributeData::~ElementAttributeData):
(WebCore::ElementAttributeData::addAttribute):
(WebCore::ElementAttributeData::removeAttribute):
(WebCore::ElementAttributeData::reportMemoryUsage):
(WebCore::ElementAttributeData::cloneDataFrom):
(WebCore::ElementAttributeData::clearAttributes):
* dom/ElementAttributeData.h:
(WebCore):
(WebCore::ElementAttributeData::create):
(ElementAttributeData):
(WebCore::ElementAttributeData::isMutable):
(WebCore::ElementAttributeData::makeMutable):
(WebCore::ElementAttributeData::length):
(WebCore::ElementAttributeData::attributeItem):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement canvas v5 line dash feature
https://bugs.webkit.org/show_bug.cgi?id=82560

Patch by Justin Novosad <junov@chromium.org> on 2012-09-10
Reviewed by Darin Adler.

Source/WebCore:

Adding new canvas 2d context API methods getLineDash and setLineDash,
and new attribute lineDashOffset. Implementation mostly based on
the existing webkitLineDash feature, with changes that reflect the
canvas v5 specification. This change is visible to all JS ports,
unlike webkitLineDash which is not exposed to V8. The new lineDash
and the legacy webkitLineDash features access the same rendering
context state. The JavasScriptCore binding layer was augmented to
support the sequence<float> IDL type.

Tests: fast/canvas/canvas-lineDash-invalid.html
       fast/canvas/canvas-lineDash.html

* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::JSCanvasRenderingContext2D::webkitLineDash):
(WebCore::JSCanvasRenderingContext2D::setWebkitLineDash):
* bindings/js/JSDOMBinding.h:
Added template specialization on float to NativeValueTraits in order to
add support for the sequence<double> IDL type to JavaScriptCore.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::getLineDash):
New 2D canvas API method, returns the current line dash array
(WebCore::lineDashSequenceIsValid):
Returns true if the line dash array contains only non-negative finite
numbers.
(WebCore::CanvasRenderingContext2D::setLineDash):
New 2D canvas API method, set the line dash array.
(WebCore::CanvasRenderingContext2D::setWebkitLineDash):
Legacy implementation, does not double the new line dash array if
it contains an odd number of elements.  Just accepts it as is.
(WebCore::CanvasRenderingContext2D::lineDashOffset):
Attribute getter
(WebCore::CanvasRenderingContext2D::setLineDashOffset):
Attribute setter
(WebCore::CanvasRenderingContext2D::webkitLineDashOffset):
Alias for lineDashOffset
(WebCore::CanvasRenderingContext2D::setWebkitLineDashOffset):
Alias for setLineDashOffset
(WebCore::CanvasRenderingContext2D::applyLineDash):
Sends the line dash state to the GraphicsContext
* html/canvas/CanvasRenderingContext2D.h:
(CanvasRenderingContext2D):
(State):
* html/canvas/CanvasRenderingContext2D.idl:
* platform/graphics/DashArray.h:

LayoutTests:

New layout tests for the canvas lineDash feature.
-Validate normal behavior of lineDash state change operations.
-Validate behavior when attempting invalid state changes.
-Validate rendering behavior.

* fast/canvas/canvas-lineDash-expected.txt: Added.
* fast/canvas/canvas-lineDash-invalid-expected.txt: Added.
* fast/canvas/canvas-lineDash-invalid.html: Added.
* fast/canvas/canvas-lineDash.html: Added.
* fast/canvas/script-tests/canvas-lineDash-invalid.js: Added.
(resetLineDash):
(trySettingLineDash):
(trySettingLineDashWithNoArgs):
(trySettingLineDashOffset):
* fast/canvas/script-tests/canvas-lineDash.js: Added.
(dataToArray):
(getPixel):
(pixelShouldBe):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TestExpectationsChecker._determine_port_from_expectations_path() does not support cascaded TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=96205

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-09-10
Reviewed by Tony Chang.

_determine_port_from_expectations_path() was calling port.path_to_test_expectations_file()
internally, which means that it would support only 1 TestExpectations file per port. This
is an issue for ports such as EFL that support cascased TestExpectations (efl-wk2 -> efl
and efl-wk1 -> efl).

This patch makes _determine_port_from_expectations_path() call port.expectations_files()
instead so that all the ports TestExpectations are recognized. The ports are also
constructed twice, with "webkit_test_runner" option set to True and False so that we
retrieve the TestExpectations paths for both WebKit1 and WebKit2.

* Scripts/webkitpy/style/checkers/test_expectations.py:
(TestExpectationsChecker._determine_port_from_expectations_path):
* Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Add corresponding unit test.
(TestExpectationsTestCase.test_determine_port_from_expectations_path):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128117 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip video-donottrack.html on Chromium

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove stray Changelog message.

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