Update DOMException name: NetworkError
https://bugs.webkit.org/show_bug.cgi?id=102503

Reviewed by Kentaro Hara.

Patch 19 of 25 to update DOMException name to match the spec and Firefox.

No code uses DOMException NetworkError. We do use NETWORK_ERR for XMLHttpRequestException. See bug 102506.

* dom/DOMCoreException.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Dim a component's subitems' color in NMI snapshot
https://bugs.webkit.org/show_bug.cgi?id=102224

Patch by Alexei Filippov <alph@chromium.org> on 2012-11-19
Reviewed by Yury Semikhatsky.

* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.NativeSnapshotNode.prototype._createSizeCell):
* inspector/front-end/nativeMemoryProfiler.css:
(.native-snapshot-view .data-grid .dimmed div.size-bar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add PROXIMITY_EVENTS feature
https://bugs.webkit.org/show_bug.cgi?id=102658

Reviewed by Kentaro Hara.

.:

Add PROXIMITY_EVENTS feature to cmake.

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

Source/JavaScriptCore:

Add PROXIMITY_EVENTS feature to xcode project for JavaScriptCore.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add PROXIMITY_EVENTS feature to xcode project for WebCorei and GNU make.

No new tests. Just add a new feature.

* Configurations/FeatureDefines.xcconfig:
* GNUmakefile.features.am:

Source/WebKit/chromium:

Add PROXIMITY_EVENTS feature to chromium port.

* features.gypi:

Source/WebKit/mac:

Add PROXIMITY_EVENTS feature to xcode project for WebKit.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Add PROXIMITY_EVENTS feature to xcode project for WebKit2.

* Configurations/FeatureDefines.xcconfig:

Tools:

Add PROXIMITY_EVENTS feature to FeatureList and qmake.

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

WebKitLibraries:

Add PROXIMITY_EVENTS feature to win and win-cairo prot.

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135159 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: URLMismatchError
https://bugs.webkit.org/show_bug.cgi?id=102511

Reviewed by Kentaro Hara.

Source/WebCore:

Patch 21 of 25 to update DOMException name to match the spec and Firefox.

Updated existing tests.

* dom/DOMCoreException.cpp:
(WebCore):

LayoutTests:

Updated tests and expectations.

* fast/workers/shared-worker-shared-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening after r133898.
Added expected results for animation tests that are now passing.

* platform/efl/TestExpectations:
* platform/efl/animations/3d: Added.
* platform/efl/animations/3d/change-transform-in-end-event-expected.png: Added.
* platform/efl/animations/3d/change-transform-in-end-event-expected.txt: Added.
* platform/efl/animations/3d/matrix-transform-type-animation-expected.png: Added.
* platform/efl/animations/3d/matrix-transform-type-animation-expected.txt: Added.
* platform/efl/animations/3d/state-at-end-event-transform-expected.png: Added.
* platform/efl/animations/3d/state-at-end-event-transform-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135161 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: SecurityError
https://bugs.webkit.org/show_bug.cgi?id=102437

Reviewed by Kentaro Hara.

Source/WebCore:

Patch 18 of 25 to update DOMException name to match the spec and Firefox.

Updated existing tests.

* dom/DOMCoreException.cpp:

LayoutTests:

Updated tests and expectations.

* fast/canvas/svg-taint-expected.txt:
* fast/dom/Document/invalid-domain-change-throws-exception-expected.txt:
* fast/dom/Document/script-tests/invalid-domain-change-throws-exception.js:
* fast/dom/register-protocol-handler.html:
* fast/frames/resources/sandboxed-iframe-storage-disallowed.html:
* fast/frames/sandboxed-iframe-storage-expected.txt:
* http/tests/loading/state-object-security-exception-expected.txt:
* http/tests/notifications/legacy/show-expected.txt:
* http/tests/security/canvas-remote-read-remote-image-blocked-no-crossorigin-expected.txt:
* http/tests/security/canvas-remote-read-remote-image-expected.txt:
* http/tests/security/canvas-remote-read-remote-image-redirect-expected.txt:
* http/tests/security/contentSecurityPolicy/worker-script-src-expected.txt:
* http/tests/security/cross-origin-local-storage-expected.txt:
* http/tests/security/cross-origin-session-storage-expected.txt:
* http/tests/security/cross-origin-websql-expected.txt:
* http/tests/security/cross-origin-worker-websql-expected.txt:
* http/tests/security/resources/sandboxed-iframe-document-cookie-read-denied.html:
* http/tests/security/same-origin-storage-blocked-expected.txt:
* http/tests/security/same-origin-websql-blocked-expected.txt:
* http/tests/security/setDomainRelaxationForbiddenForURLScheme-expected.txt:
* http/tests/security/storage-blocking-loosened-local-storage-expected.txt:
* http/tests/security/storage-blocking-loosened-websql-expected.txt:
* http/tests/security/storage-blocking-strengthened-local-storage-expected.txt:
* http/tests/security/storage-blocking-strengthened-websql-expected.txt:
* http/tests/security/webgl-remote-read-remote-image-blocked-no-crossorigin-expected.txt:
* http/tests/websocket/tests/hybi/url-parsing-expected.txt:
* http/tests/workers/shared-worker-redirect-expected.txt:
* http/tests/workers/worker-redirect-expected.txt:
* platform/chromium-win/websocket/tests/url-parsing-expected.txt:
* platform/chromium/fast/dom/register-protocol-handler-expected.txt:
* platform/chromium/http/tests/websocket/tests/hixie76/url-parsing-expected.txt:
* platform/chromium/http/tests/websocket/tests/hybi/url-parsing-expected.txt:
* platform/chromium/permissionclient/storage-permission-expected.txt:
* platform/win-wk2/http/tests/inspector-enabled/database-open-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Apply the resolved viewport rules
https://bugs.webkit.org/show_bug.cgi?id=95964

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-11-19
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

This patch implements the CSS Device Adaptation specification. The
WebKit implementation relies on the already implemented Viewport Meta
infrastructure to notify the browser of viewport changes.

The implementation was tests with success on the Qt and EFL ports, but
basically every port supporting Viewport Meta should be fine.

The usage of @-webkit-viewport inside media queries (more tests coming
to map all the corner cases) is currently limited when the media query
depends on the viewport dimensions itself. Defining the width and height
based on screen size will fail on ports reporting the screen
size as the size of the browser window instead of the device screen.

Tests: css3/device-adapt/opera/cascading-001.xhtml
       css3/device-adapt/opera/cascading-002.xhtml
       css3/device-adapt/opera/cascading-003.xhtml
       css3/device-adapt/opera/cascading-004.xhtml
       css3/device-adapt/opera/constrain-001.xhtml
       css3/device-adapt/opera/constrain-002.xhtml
       css3/device-adapt/opera/constrain-003.xhtml
       css3/device-adapt/opera/constrain-004.xhtml
       css3/device-adapt/opera/constrain-005.xhtml
       css3/device-adapt/opera/constrain-006.xhtml
       css3/device-adapt/opera/constrain-007.xhtml
       css3/device-adapt/opera/constrain-008.xhtml
       css3/device-adapt/opera/constrain-009.xhtml
       css3/device-adapt/opera/constrain-010.xhtml
       css3/device-adapt/opera/constrain-011.xhtml
       css3/device-adapt/opera/constrain-012.xhtml
       css3/device-adapt/opera/constrain-013.xhtml
       css3/device-adapt/opera/constrain-014.xhtml
       css3/device-adapt/opera/constrain-015.xhtml
       css3/device-adapt/opera/constrain-016.xhtml
       css3/device-adapt/opera/constrain-017.xhtml
       css3/device-adapt/opera/constrain-020.xhtml
       css3/device-adapt/opera/syntax-001.xhtml
       css3/device-adapt/opera/syntax-002.xhtml
       css3/device-adapt/opera/syntax-003.xhtml

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/RuleSet.cpp:
(WebCore::RuleSet::addRulesFromSheet):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::appendAuthorStyleSheets):
(WebCore::StyleResolver::~StyleResolver):
* css/StyleResolver.h:
(StyleResolver):
(WebCore::StyleResolver::viewportStyleResolver):
* css/ViewportStyleResolver.cpp: Added.
(WebCore):
(WebCore::ViewportStyleResolver::ViewportStyleResolver):
(WebCore::ViewportStyleResolver::addViewportRule):
(WebCore::ViewportStyleResolver::clearDocument):
(WebCore::ViewportStyleResolver::resolve):
(WebCore::ViewportStyleResolver::getViewportArgumentValue):
* css/ViewportStyleResolver.h: Added.
(WebCore):
(ViewportStyleResolver):
(WebCore::ViewportStyleResolver::create):
* dom/Document.h:
(WebCore::Document::setViewportArguments):
* dom/ViewportArguments.cpp:
(WebCore::compareIgnoringAuto):
(WebCore):
(WebCore::ViewportArguments::resolve):
* dom/ViewportArguments.h:
(ViewportAttributes):
(WebCore::ViewportArguments::ViewportArguments):
(ViewportArguments):
(WebCore::ViewportArguments::operator==):

LayoutTests:

Imported some of the CSS Device Adaptation tests submitted by
Opera to W3C CSS Test Suite. These tests are not yet approved but
they have a pretty good coverage of the specification.

Tests using Math.floor() where modified from the original version
using Math.round(), the reason being the round() version fails by
1px when the pixel ratio is different from 1.

Despite the fact they are all passing on the EFL MiniBrowser, I could
not enable them yet. WebKitTestRunner does not support fixed layout,
but that is the next goal.

* css3/device-adapt/opera/cascading-001-expected.txt: Added.
* css3/device-adapt/opera/cascading-001.xhtml: Added.
* css3/device-adapt/opera/cascading-002-expected.txt: Added.
* css3/device-adapt/opera/cascading-002.xhtml: Added.
* css3/device-adapt/opera/cascading-003-expected.txt: Added.
* css3/device-adapt/opera/cascading-003.xhtml: Added.
* css3/device-adapt/opera/cascading-004-expected.txt: Added.
* css3/device-adapt/opera/cascading-004.xhtml: Added.
* css3/device-adapt/opera/constrain-001-expected.txt: Added.
* css3/device-adapt/opera/constrain-001.xhtml: Added.
* css3/device-adapt/opera/constrain-002-expected.txt: Added.
* css3/device-adapt/opera/constrain-002.xhtml: Added.
* css3/device-adapt/opera/constrain-003-expected.txt: Added.
* css3/device-adapt/opera/constrain-003.xhtml: Added.
* css3/device-adapt/opera/constrain-004-expected.txt: Added.
* css3/device-adapt/opera/constrain-004.xhtml: Added.
* css3/device-adapt/opera/constrain-005-expected.txt: Added.
* css3/device-adapt/opera/constrain-005.xhtml: Added.
* css3/device-adapt/opera/constrain-006-expected.txt: Added.
* css3/device-adapt/opera/constrain-006.xhtml: Added.
* css3/device-adapt/opera/constrain-007-expected.txt: Added.
* css3/device-adapt/opera/constrain-007.xhtml: Added.
* css3/device-adapt/opera/constrain-008-expected.txt: Added.
* css3/device-adapt/opera/constrain-008.xhtml: Added.
* css3/device-adapt/opera/constrain-009-expected.txt: Added.
* css3/device-adapt/opera/constrain-009.xhtml: Added.
* css3/device-adapt/opera/constrain-010-expected.txt: Added.
* css3/device-adapt/opera/constrain-010.xhtml: Added.
* css3/device-adapt/opera/constrain-011-expected.txt: Added.
* css3/device-adapt/opera/constrain-011.xhtml: Added.
* css3/device-adapt/opera/constrain-012-expected.txt: Added.
* css3/device-adapt/opera/constrain-012.xhtml: Added.
* css3/device-adapt/opera/constrain-013-expected.txt: Added.
* css3/device-adapt/opera/constrain-013.xhtml: Added.
* css3/device-adapt/opera/constrain-014-expected.txt: Added.
* css3/device-adapt/opera/constrain-014.xhtml: Added.
* css3/device-adapt/opera/constrain-015-expected.txt: Added.
* css3/device-adapt/opera/constrain-015.xhtml: Added.
* css3/device-adapt/opera/constrain-016-expected.txt: Added.
* css3/device-adapt/opera/constrain-016.xhtml: Added.
* css3/device-adapt/opera/constrain-017-expected.txt: Added.
* css3/device-adapt/opera/constrain-017.xhtml: Added.
* css3/device-adapt/opera/constrain-020-expected.txt: Added.
* css3/device-adapt/opera/constrain-020.xhtml: Added.
* css3/device-adapt/opera/syntax-001-expected.txt: Added.
* css3/device-adapt/opera/syntax-001.xhtml: Added.
* css3/device-adapt/opera/syntax-002-expected.txt: Added.
* css3/device-adapt/opera/syntax-002.xhtml: Added.
* css3/device-adapt/opera/syntax-003-expected.txt: Added.
* css3/device-adapt/opera/syntax-003.xhtml: Added.
* platform/efl/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Computed grid items' positions shouldn't be using Length
https://bugs.webkit.org/show_bug.cgi?id=102537

Reviewed by Tony Chang.

This change refactors how we store the grid items' position to use
a new type GridPosition. Length was a temporary type as it supported
'auto' | <integer> but it was starting to get more and more confusing
as we were implementing the layout routines.

No change in behavior.

* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
Added the new file to the build systems.

* rendering/style/RenderStyle.h:
Updated after the type change. Also made some getters
return a const reference instead of forcing a copy.

* rendering/style/StyleGridItemData.h:
(StyleGridItemData):
Ditto, also removed a comment about adding a new type.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridPosition):
* css/StyleResolver.cpp:
(WebCore::createGridPosition):
(WebCore::StyleResolver::applyProperty):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::resolveGridPosition):
Updated these sites after switching to GridPosition.

* rendering/RenderGrid.h:
Changed resolveGridPosition signature: it now takes a GridPosition.

* rendering/style/GridPosition.h: Added.
(WebCore::GridPosition::GridPosition):
Default constructor, creates an 'auto' position.

(WebCore::GridPosition::isPositive):
(WebCore::GridPosition::type):
(WebCore::GridPosition::isAuto):
(WebCore::GridPosition::setIntegerPosition):
(WebCore::GridPosition::integerPosition):
Helper functions.

(WebCore::GridPosition::operator==):
Required comparison operator for StyleGridItemData.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135164 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use device scale factor instead of physical screen DPI for screen DPI
https://bugs.webkit.org/show_bug.cgi?id=101769

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-11-19
Reviewed by Adam Barth.

Media queries call WebCore::Screen::{horizontal,vertical}DPI() to determine
the dots per CSS inch[1] value for the "screen" media type. On Chromium these
functions currently return the physical screen DPI, which is wrong. To fix
this, we remove both of these functions entirely and make media queries use
the device scale factor multiplied by 96 on all ports.

[1] http://www.w3.org/TR/css3-mediaqueries/#resolution0

* page/Screen.cpp:
(WebCore::Screen::horizontalDPI):
(WebCore::Screen::verticalDPI):
* platform/PlatformScreen.h:
(WebCore):
* platform/blackberry/PlatformScreenBlackBerry.cpp:
* platform/chromium/PlatformScreenChromium.cpp:
* platform/efl/PlatformScreenEfl.cpp:
* platform/gtk/PlatformScreenGtk.cpp:
* platform/mac/PlatformScreenMac.mm:
* platform/qt/PlatformScreenQt.cpp:
* platform/win/PlatformScreenWin.cpp:
* platform/wx/ScreenWx.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Exclusions] remove null exclusion shape check from ExclusionShape::createExclusionShape
https://bugs.webkit.org/show_bug.cgi?id=100765

Patch by Hans Muller <hmuller@adobe.com> on 2012-11-19
Reviewed by Dirk Schulze.

ExclusionShape::createExclusionShape now ASSERTs that its basicShape argument
isn't null, since the caller is expected to ensure as much.  No new tests were
needed since this is a near-trivial cleanup.

* rendering/ExclusionShape.cpp:
(WebCore::ExclusionShape::createExclusionShape): This method no longer defends against a null basicShape argument by returning null.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve performance of RenderBoxModelObject::paintTranslucentBorderSides()
https://bugs.webkit.org/show_bug.cgi?id=98660

Patch by Tom Hudson <tomhudson@chromium.org> on 2012-11-19
Reviewed by Simon Fraser.

Accumulate edges[i].shouldRender() in a flag field and pass that to paintBorderSides()
and paintTranslucentBorderSides() so that we don't do unnecessary work.

If we can avoid setting up and tearing down an unnecessary transparent layer we save
30ms on some mobile platforms.

* rendering/RenderBoxModelObject.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintBorder):
(WebCore::RenderBoxModelObject::paintTranslucentBorderSides):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135167 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: DataCloneError
https://bugs.webkit.org/show_bug.cgi?id=102521

Reviewed by Kentaro Hara.

Source/WebCore:

Patch 25 of 25 to update DOMException name to match the spec and Firefox.

Updated existing tests.

* dom/DOMCoreException.cpp:

LayoutTests:

Updated tests and expectations.

* fast/dom/Window/anonymous-slot-with-changes-expected.txt:
* fast/dom/Window/window-postmessage-clone-expected.txt:
* fast/dom/shadow/shadowroot-clonenode-expected.txt:
* fast/dom/shadow/shadowroot-clonenode.html:
* fast/events/message-port-multi-expected.txt:
* fast/filesystem/filesystem-unserializable-expected.txt:
* platform/chromium/fast/dom/Window/window-postmessage-clone-expected.txt:
* platform/chromium/fast/dom/Window/window-postmessage-clone-really-deep-array-expected.txt:
* platform/gtk/fast/dom/Window/window-postmessage-clone-expected.txt:
* webintents/web-intents-obj-constructor-expected.txt:
* webintents/web-intents-obj-constructor.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: TimeoutError
https://bugs.webkit.org/show_bug.cgi?id=102513

Reviewed by Kentaro Hara.

Patch 23 of 25 to update DOMException name to match the spec and Firefox.

No code uses DOMException TimeoutError. We do use TIMEOUT_ERR for XMLHttpRequestException. See bug 102506.

* dom/DOMCoreException.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135169 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove WebKit::WebRuntimeFeatures::enablePointerLock.
https://bugs.webkit.org/show_bug.cgi?id=96946

Reviewed by Adam Barth.

The runtime flag functionality has already been removed.
Now that Chromium no longer has a compile dependency on this
API, it can be removed as well.

Source/WebKit/chromium:

* public/WebRuntimeFeatures.h:
(WebRuntimeFeatures):
* src/WebRuntimeFeatures.cpp:

Tools:

* DumpRenderTree/chromium/TestShell.cpp:
(TestShell::TestShell):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r132907): It made animations/negative-delay.html flaky https://bugs.webkit.org/show_bug.cgi?id=100769

Unreviewed gardening (Qt).

These tests are rather flaky, mark them as so.

* platform/qt-5.0-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135171 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move empty loading to DocumentLoader, simplify FrameLoader::init()
https://bugs.webkit.org/show_bug.cgi?id=101512

Reviewed by Adam Barth.

Source/WebCore:

No new tests, though several outputs changed because we no longer send resource
    load callbacks for empty loads.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader):
(WebCore::DocumentLoader::~DocumentLoader):
(WebCore::DocumentLoader::finishedLoading):
(WebCore::DocumentLoader::clearMainResourceLoader):
(WebCore::DocumentLoader::isLoadingInAPISense):
(WebCore::DocumentLoader::isLoadingMainResource):
(WebCore::DocumentLoader::maybeLoadEmpty):
(WebCore):
(WebCore::DocumentLoader::startLoadingMainResource): Handle empty main resource
     loads directly here.
* loader/DocumentLoader.h:
(DocumentLoader):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::FrameLoader): Initialize some variables whose values
    were previously being reset in init(). Given that the FrameLoader is in
    an inconsistent state before init() is called anyway, there doesn't seem
    to be a disadvantage to just initializing them to their post-init() values.
(WebCore::FrameLoader::init): Just call startLoadingMainResource(), instead of
    doing a bunch of direct calls to functions FrameLoader shouldn't know about.
* loader/FrameLoaderStateMachine.cpp:
(WebCore::FrameLoaderStateMachine::FrameLoaderStateMachine):
* loader/FrameLoaderStateMachine.h:
* loader/MainResourceLoader.cpp: Throughout, remove the concept of an empty load.
(WebCore::MainResourceLoader::loadNow): This only returned true when an empty
    load got deferred, which won't happen now. Return void and always treat
    as returning false.
* loader/MainResourceLoader.h:
(MainResourceLoader):

Tools:

Chromium DRT has some code that doesn't play nicely with empty urls and incorrectly
interprets them as a non-empty load. This ensures
http/tests/navigation/new-window-redirect-history.html continues to pass
in chromium.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::updateForCommittedLoad):

LayoutTests:

Don't expect resource load callbacks for empty loads.

* http/tests/inspector/network/network-iframe-load-and-delete.html:
* http/tests/loading/redirect-methods-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body-expected.txt:
* http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135172 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Changing id, className, or attribute should invalidate distribution
https://bugs.webkit.org/show_bug.cgi?id=100738

Reviewed by Dimitri Glazkov.

PerformanceTests:

Added test code to modify id/class/attribute.

* DOM/ModifyAttribute.html: Added.
* DOM/resources/dom-perf/modify-attribute.js: Added.
(ModifyAttribute.CreateElementToSetUp):
(ModifyAttribute.ModifyId):
(ModifyAttribute.ModifyClass):
(ModifyAttribute.ModifyTitle):

Source/WebCore:

When id, className, or attribute is changed, we might have to invalidate distribution.
However, we don't want to do useless invalidation. So we consult with the RuleFeatureSet of ElementShadow
to invalidate distribution only if necessary.

For the code that className is changed, we can share a lot of code between invalidating distribution and
invalidating style. So we made checkNeedsStyleInvalidationForClassChange a template method, and share it.

Since attributeChanged() is a hot method, we don't want to make it slow. So we made one function to determine
whether we have to invalidate distribution, and make it called only if necessary. Also, we've optimized
shadowOfParentForDistribution() by making isInsertionPoint() de-virtualed. We consuded NodeFlags (IsInsertionPointFlag)
for this purpose.

We've measured how this patch makes changing attribute slow. I've measured each code 3 times.
DOM/ModifyAttribute.html is a micro benchmark which changes attribute a lot of times. The result of this benchmark
will be the most affected by this patch. However, it's only 2% performance regression.

DOM/ModifyAttribute.html
Before this patch:
        median  stdev    min    max    [ms]
  1st    494.0   3.36  490.0  502.0
  2nd    503.5   3.44  497.0  512.0
  3rd    494.0   3.48  488.0  499.0

After this patch:
        median  stdev  min      max    [ms]
  1st    504.0   2.00  501.0  509.0
  2nd    505.5   3.08  500.0  513.0
  3rd    507.0   2.32  502.0  510.0

Tests: fast/dom/shadow/distribution-attribute-modified.html
       fast/dom/shadow/distribution-className-modified.html
       fast/dom/shadow/distribution-id-modified.html
       fast/dom/shadow/reprojection-attribute-modified.html
       fast/dom/shadow/reprojection-className-modified.html
       fast/dom/shadow/reprojection-id-modified.html

* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore::HasSelectorForClassStyleFunctor::HasSelectorForClassStyleFunctor):
(HasSelectorForClassStyleFunctor):
(WebCore::HasSelectorForClassStyleFunctor::operator()): Returns true if StyleResolver::hasSelectorForClass returns true.
(WebCore):
(WebCore::HasSelectorForClassDistributionFunctor::HasSelectorForClassDistributionFunctor):
(HasSelectorForClassDistributionFunctor):
(WebCore::HasSelectorForClassDistributionFunctor::operator()): Returns true if ElementShadow::hasSelectForClass returns true.
(WebCore::checkFunctorForClassChange):
(WebCore::checkNeedsStyleInvalidationForClassChange):
(WebCore::checkNeedsDistributionInvalidationForClassChange): Extracted the implementation to checkFunctorForClassChange.
(WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):
* dom/Element.h:
(Element):
* dom/Node.h:
(WebCore::Node::isInsertionPoint):
* html/HTMLElement.h:
(HTMLElement):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::InsertionPoint):
* html/shadow/InsertionPoint.h:
(InsertionPoint):
(WebCore::isInsertionPoint):
(WebCore::shadowOfParentForDistribution):
(WebCore::resolveReprojection):

LayoutTests:

We have test cases that id/class/attribute is changed, and thier reprojection cases.

* fast/dom/shadow/distribution-attribute-modified-expected.html: Added.
* fast/dom/shadow/distribution-attribute-modified.html: Added.
* fast/dom/shadow/distribution-className-modified-expected.html: Added.
* fast/dom/shadow/distribution-className-modified.html: Added.
* fast/dom/shadow/distribution-id-modified-expected.html: Added.
* fast/dom/shadow/distribution-id-modified.html: Added.
* fast/dom/shadow/reprojection-attribute-modified-expected.html: Added.
* fast/dom/shadow/reprojection-attribute-modified.html: Added.
* fast/dom/shadow/reprojection-className-modified-expected.html: Added.
* fast/dom/shadow/reprojection-className-modified.html: Added.
* fast/dom/shadow/reprojection-id-modified-expected.html: Added.
* fast/dom/shadow/reprojection-id-modified.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update DOMException name: InvalidNodeTypeError
https://bugs.webkit.org/show_bug.cgi?id=102519

Reviewed by Kentaro Hara.

Patch 24 of 25 to update DOMException name to match the spec and Firefox.

No code uses DOMException InvalidNodeTypeError. We do use INVALID_NODE_TYPE_ERR for RangeException. See bug 102515.

* dom/DOMCoreException.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135175 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve ContentTypeParser, so that it could be used to validate mime type according to RFC
https://bugs.webkit.org/show_bug.cgi?id=100927

Patch by Alexander Shalamov <alexander.shalamov@intel.com> on 2012-11-19
Reviewed by Alexey Proskuryakov.

This patch adds ParsedContentType class that represents contents of parsed
content type string. isValidContentType function could be used to check if
format of the content type string is acorrding to RFC 2616 section 4.2.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.xcodeproj/project.pbxproj:
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ParsedContentType.cpp: Renamed from Source/WebCore/platform/network/ContentTypeParser.cpp.
(WebCore):
(EmptyParsedContentType):
(WebCore::EmptyParsedContentType::setContentType):
(WebCore::EmptyParsedContentType::setContentTypeParameter):
(WebCore::skipSpaces):
(WebCore::isTokenCharacter):
(WebCore::parseToken):
(WebCore::parseQuotedString):
(WebCore::substringForRange):
(WebCore::parseContentType):
(WebCore::isValidContentType):
(WebCore::ParsedContentType::ParsedContentType):
(WebCore::ParsedContentType::charset):
(WebCore::ParsedContentType::parameterValueForName):
(WebCore::ParsedContentType::parameterCount):
(WebCore::ParsedContentType::setContentType):
(WebCore::ParsedContentType::setContentTypeParameter):
* platform/network/ParsedContentType.h: Renamed from Source/WebCore/platform/network/ContentTypeParser.h.
(WebCore):
(ParsedContentType):
(WebCore::ParsedContentType::mimeType):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: simplify RecordIdentifier
https://bugs.webkit.org/show_bug.cgi?id=102018

Reviewed by Tony Chang.

Source/WebCore:

Make IDBBackingStore's RecordIdentifier be a simple
class, existing only as an inline or stack-based instance.
This makes much of the copy semantics more explicit, and
removes refcounting from an object that only ever had a refcount
of 1 or 2.

No new tests, just a refactor.

* Modules/indexeddb/IDBBackingStore.cpp:
(WebCore::IDBBackingStore::putRecord):
(WebCore::IDBBackingStore::deleteRecord):
(WebCore::IDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber):
(WebCore::IDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBBackingStore::putIndexDataForRecord):
(WebCore::IDBBackingStore::deleteIndexDataForRecord):
(WebCore::ObjectStoreKeyCursorImpl::loadCurrentRow):
(ObjectStoreCursorImpl):
(WebCore::ObjectStoreCursorImpl::loadCurrentRow):
(WebCore::IndexKeyCursorImpl::recordIdentifier):
(WebCore::IndexCursorImpl::recordIdentifier):
* Modules/indexeddb/IDBBackingStore.h:
(WebCore::IDBBackingStore::RecordIdentifier::RecordIdentifier):
(WebCore::IDBBackingStore::RecordIdentifier::isValid):
(WebCore::IDBBackingStore::RecordIdentifier::reset):
(RecordIdentifier):
(IDBBackingStore):
(WebCore::IDBBackingStore::Cursor::recordIdentifier):
(WebCore::IDBBackingStore::Cursor::Cursor):
(Cursor):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore):
(WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
(WebCore::IDBObjectStoreBackendImpl::putInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):

Source/WebKit/chromium:

Update IDBFakeBackingStore to match its parent class.

* tests/IDBFakeBackingStore.h:


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