Update several build-webkit options to match the #defines they toggle
https://bugs.webkit.org/show_bug.cgi?id=85744

Reviewed by Adam Barth.

Most notable here is fixing --3d-canvas to be --webgl these days --
the define was renamed 15 months ago!

* Scripts/webkitperl/FeatureList.pm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build after r116246.

* DumpRenderTree/LayoutTestController.cpp: Remove an unused function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
InlineBox::setHasBadParent should be debug only
https://bugs.webkit.org/show_bug.cgi?id=85748

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

Do not provide InlineBox::setHasBadParent in release builds.

* rendering/InlineBox.h:
(InlineBox):
(WebCore):
(WebCore::InlineBox::setHasBadParent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116253 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSP should let sites both enforce one policy and monitor another
https://bugs.webkit.org/show_bug.cgi?id=85561

Reviewed by Eric Seidel.

Source/WebCore:

This patch lets us enforce and/or monitor multiple CSP policies.
Rather than having a single directive list, we now have a vector of
directive lists.

Tests: http/tests/security/contentSecurityPolicy/combine-multiple-policies.html
       http/tests/security/contentSecurityPolicy/report-and-enforce.html

* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom):
(WebCore::ContentSecurityPolicy::didReceiveHeader):
(WebCore::ContentSecurityPolicy::deprecatedHeader):
(WebCore::ContentSecurityPolicy::deprecatedHeaderType):
    - Even after this patch, workers aren't smart enough to enforce
      multiple policies.  They just use the first header, like they did
      before.  We'll need to teach workers how to enforce multiple
      policies in a future patch.
(WebCore::ContentSecurityPolicy::allowJavaScriptURLs):
(WebCore::ContentSecurityPolicy::allowInlineEventHandlers):
(WebCore::ContentSecurityPolicy::allowInlineScript):
(WebCore::ContentSecurityPolicy::allowInlineStyle):
(WebCore::ContentSecurityPolicy::allowEval):
(WebCore::ContentSecurityPolicy::allowScriptFromSource):
(WebCore::ContentSecurityPolicy::allowObjectFromSource):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource):
(WebCore::ContentSecurityPolicy::allowImageFromSource):
(WebCore::ContentSecurityPolicy::allowStyleFromSource):
(WebCore::ContentSecurityPolicy::allowFontFromSource):
(WebCore::ContentSecurityPolicy::allowMediaFromSource):
(WebCore::ContentSecurityPolicy::allowConnectFromSource):
* page/ContentSecurityPolicy.h:
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerScriptLoader::notifyFinished):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::startWorkerContext):

Source/WebKit/chromium:

* src/SharedWorkerRepository.cpp:
(WebCore::SharedWorkerScriptLoader::notifyFinished):
* src/WebWorkerClientImpl.cpp:
(WebKit::WebWorkerClientImpl::startWorkerContext):

LayoutTests:

Test that we can enforce multiple policies and that we can enforce one
policy while monitoring another.

* http/tests/security/contentSecurityPolicy/combine-multiple-policies-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/combine-multiple-policies.html: Added.
* http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/report-and-enforce.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow DOM] Node distribution should be refreshed before style recalc.
https://bugs.webkit.org/show_bug.cgi?id=85259

Reviewed by Dimitri Glazkov.

Source/WebCore:

Element::recalcStyle() calls child element's recalcStyle()
recursively, following ShadowTree::recalcShadowTreeStyle(). But
recalcShadowTreeStyle() should be called before such recursion if
necessary.

This is because style calculation and following renderer attachment
of each child element depends on up-to-date node distribution result
which is computed during the recalcShadowTreeStyle().

Test: fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html

* dom/Element.cpp: Moved recalcShadowTreeStyle() before child traversals.
(WebCore::Element::recalcStyle):

LayoutTests:

* fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector-expected.txt: Added.
* fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Enable WebKit2 build by default (again)
https://bugs.webkit.org/show_bug.cgi?id=85750

* configure.ac: enable wk2 build by default.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116256 268f45cc-cd09-0410-ab3c-d52691b4dbfc
.: Part of: Building and debugging WebKit in the Xcode IDE requires a lot of setup
https://bugs.webkit.org/show_bug.cgi?id=85739

Reviewed by Daniel Bates.

* WebKit.xcworkspace: Added.
* WebKit.xcworkspace/contents.xcworkspacedata: Added.
* WebKit.xcworkspace/xcshareddata: Added.
* WebKit.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: Added.
* WebKit.xcworkspace/xcshareddata/xcschemes: Added.
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess).xcscheme: Added
this scheme, which builds all source projects and runs WebProcess with
Safari as the client executable.
* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme: Added
this scheme, which builds all source projects and runs Safari.
* WebKit.xcworkspace/xcshareddata/xcschemes/All Tools.xcscheme: Added
this scheme, which builds all tools projects and runs DumpRenderTree.

Tools: Tools part of: Building and debugging WebKit in the Xcode IDE requires a lot of setup
https://bugs.webkit.org/show_bug.cgi?id=85739

Reviewed by Daniel Bates.

* Scripts/build-webkit: Moved code that copies from WebKitLibraries to the product directory
from here...
* Scripts/copy-webkitlibraries-to-product-directory: ...to this new script.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Autofill backing store implementation upstream
https://bugs.webkit.org/show_bug.cgi?id=85575

Patch by Jonathan Dong <jonathan.dong@torchmobile.com.cn> on 2012-05-06
Reviewed by Rob Buis.

Source/WebCore:

Implemented class AutofillBackingStore which is responsible
for handling interaction with autofill database.

Replaced static function
CredentialBackingStore* CredentialBackingStore::instance()
with a helper function
CredentialBackingStore& credentialBackingStore(),
and used DEFINE_STATIC_LOCAL to construct the singleton
object.
Also removed unnecessary function close() and combined with
the destructor of class CredentialBackingStore.

Initial upstream, No new tests.

* PlatformBlackBerry.cmake:
* platform/network/blackberry/AutofillBackingStore.cpp: Added.
(WebCore):
(WebCore::autofillBackingStore):
(WebCore::AutofillBackingStore::AutofillBackingStore):
(WebCore::AutofillBackingStore::~AutofillBackingStore):
(WebCore::AutofillBackingStore::open):
(WebCore::AutofillBackingStore::add):
(WebCore::AutofillBackingStore::update):
(WebCore::AutofillBackingStore::contains):
(WebCore::AutofillBackingStore::get):
(WebCore::AutofillBackingStore::clear):
* platform/network/blackberry/AutofillBackingStore.h: Added.
(WebCore):
(AutofillBackingStore):
* platform/network/blackberry/CredentialBackingStore.cpp:
(WebCore::credentialBackingStore):
(WebCore::CredentialBackingStore::~CredentialBackingStore):
* platform/network/blackberry/CredentialBackingStore.h:
(CredentialBackingStore):
(WebCore):
* platform/network/blackberry/CredentialStorageBlackBerry.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage):

Source/WebKit/blackberry:

Replaced calling static function CredentialBackingStore::instance()
with calling the helper function credentialBackingStore().

* WebCoreSupport/CredentialManager.cpp:
(WebCore::CredentialManager::autofillAuthenticationChallenge):
(WebCore::CredentialManager::autofillPasswordForms):
(WebCore::CredentialManager::saveCredentialIfConfirmed):
(WebCore::CredentialManager::clearCredentials):
(WebCore::CredentialManager::clearNeverRememberSites):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add WebKit API to access multiple attribute of input element
https://bugs.webkit.org/show_bug.cgi?id=85355

Reviewed by Kent Tamura.

We need this to implement the datalist UI for <input type=email multiple>.

* public/WebInputElement.h:
(WebInputElement):
* src/WebInputElement.cpp:
(WebKit::WebInputElement::isMultiple):
(WebKit):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Shrink TextRun object size
https://bugs.webkit.org/show_bug.cgi?id=85751

Reviewed by Darin Adler.

Reorder the member variables in TextRun so it shrinks from 56 to 40 bytes on my 64-bit build. This is important
for SVG, since RenderSVGText shrinks because of this.

Also add a compile assert for the expected object size.

* platform/graphics/TextRun.cpp:
(ExpectedTextRunSize):
(WebCore):
* platform/graphics/TextRun.h:
(WebCore::TextRun::TextRun):
(WebCore::TextRun::direction):
(TextRun):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening. Skip more failing tests.

* platform/efl/Skipped:
* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116261 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for r116260.

COMPILE_ASSERT() does not expect a string in its second parameter.

* platform/graphics/TextRun.cpp:
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Disallow unquoted -webkit-font-feature-settings tags
https://bugs.webkit.org/show_bug.cgi?id=85362

Reviewed by Kent Tamura.

Source/WebCore:

Disallow unquoted tags to follow the current draft.
http://dev.w3.org/csswg/css3-fonts/#font-feature-settings-prop

No new tests. css3/font-feature-settings-parsing.html was updated.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontFeatureTag): Accepts only 4-characters string.

LayoutTests:

* css3/font-feature-settings-parsing-expected.txt: Updated to follow the current draft specification.
* css3/font-feature-settings-parsing.html: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Support html5 download attribute.
https://bugs.webkit.org/show_bug.cgi?id=85044

Reviewed by Antonio Gomes.

Source/WebCore:

Pass download attribute filename to networkJob and it could be
overridden by the Content-Disposition HTTP header's filename parameter.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::initialize):
* platform/network/blackberry/ResourceRequest.h:
(WebCore::ResourceRequest::setSuggestSaveName):
(WebCore::ResourceRequest::suggestSaveName):
(ResourceRequest):
* platform/network/blackberry/ResourceRequestBlackBerry.cpp:
(WebCore::ResourceRequest::initializePlatformRequest):

Source/WebKit/blackberry:

If a link has download attribute, we should pass that value and be able to
save file with the name according to HTML5:
http://updates.html5rocks.com/2011/08/Downloading-resources-in-HTML5-a-download

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::load):
(BlackBerry::WebKit::WebPage::download):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/FrameLoaderClientBlackBerry.cpp:
(WebCore::FrameLoaderClientBlackBerry::startDownload):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a contributor to committers.py
https://bugs.webkit.org/show_bug.cgi?id=85761

Reviewed by Unreviewed.

Add myself to committers.py contributor.

* Scripts/webkitpy/common/config/committers.py:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Call cryptographicallyRandomValues through Platform.h
https://bugs.webkit.org/show_bug.cgi?id=85763

Reviewed by Adam Barth.

Part of a refactoring series. See tracking bug 82948.

* src/ChromiumOSRandomSource.cpp:
(WTF::cryptographicallyRandomValuesFromOS):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Content Security Policy reports should be reported with content-type application/json, should contain all required fields
https://bugs.webkit.org/show_bug.cgi?id=61360

Reviewed by Eric Seidel.

Source/WebCore: 

This patch changes ContentSecurityPolicy to use JSON format for sending
violation reports rather than wwwform-encoding.  This patch aligns our
behavior with the specification and with Mozilla.  A follow up patch
will update the list of fields in the report to match the spec.

* loader/PingLoader.cpp:
(WebCore::PingLoader::reportContentSecurityPolicyViolation):
* page/ContentSecurityPolicy.cpp:
(WebCore::CSPDirectiveList::reportViolation):

LayoutTests: 

Update results to show JSON format.

* http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt:
* http/tests/security/contentSecurityPolicy/resources/save-report.php:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116268 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8][Performance] Remove Isolate lookup from the call path
to get a cached JS wrapper object by getDOMXXXXMap().
https://bugs.webkit.org/show_bug.cgi?id=85205

Reviewed by Adam Barth.

The patch improves the performance of getting a cached JS wrapper
by getDOMXXXXMap(). For example, it improves the performance
of toV8(NodeList*) in getElementsByTagName(), getElementsByName(),
getElementsByClassName() by 7 ~ 9%.

Performance tests: https://bugs.webkit.org/attachment.cgi?id=139468

The performance test results in my Linux desktop:

getElementsByTagName :   40.76 ms => 37.52ms (+8.6%)
getElementsByName :      41.02 ms => 37.42ms (+9.6%)
getElementsByClassName : 40.32 ms => 37.68ms (+7.0%)

Unfortunately we cannot observe performance improvement in
Dromaeo/dom-query.html, which are testing getElementsByTagName(),
getElementsByName(), getElementsByClassName(). This is because
the bottleneck of these Dromaeo tests is not toV8(NodeList*) but
.length and .nodeType accesses. The patch for optimizing them
will be coming soon.

No tests. No change in behavior.

* bindings/scripts/CodeGeneratorV8.pm: Modified as described above.
(GenerateHeader):
(GenerateNormalAttrGetter):
(GetDomMapFunction):
(NativeToJSValue):
* bindings/v8/DOMData.cpp:
(WebCore::DOMData::getCurrentStore):

* bindings/scripts/test/V8/V8Float64Array.h: Updated run-bindings-tests results.
(WebCore::V8Float64Array::wrap):
* bindings/scripts/test/V8/V8TestActiveDOMObject.h:
(WebCore::V8TestActiveDOMObject::wrap):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
(WebCore::V8TestCustomNamedGetter::wrap):
* bindings/scripts/test/V8/V8TestEventConstructor.h:
(WebCore::V8TestEventConstructor::wrap):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore::TestEventTargetV8Internal::itemCallback):
* bindings/scripts/test/V8/V8TestEventTarget.h:
(WebCore::V8TestEventTarget::wrap):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::TestInterfaceV8Internal::supplementalNodeAttrGetter):
* bindings/scripts/test/V8/V8TestInterface.h:
(WebCore::V8TestInterface::wrap):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
(WebCore::V8TestMediaQueryListListener::wrap):
* bindings/scripts/test/V8/V8TestNamedConstructor.h:
(WebCore::V8TestNamedConstructor::wrap):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjV8Internal::readOnlyTestObjAttrAttrGetter):
(WebCore::TestObjV8Internal::cachedAttribute1AttrGetter):
(WebCore::TestObjV8Internal::cachedAttribute2AttrGetter):
(WebCore::TestObjV8Internal::contentDocumentAttrGetter):
(WebCore::TestObjV8Internal::getSVGDocumentCallback):
* bindings/scripts/test/V8/V8TestObj.h:
(WebCore::V8TestObj::wrap):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
(WebCore::V8TestSerializedScriptValueInterface::wrap):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Call currentThread through Platform.h directly
https://bugs.webkit.org/show_bug.cgi?id=85769

Reviewed by Kentaro Hara.

Part of a refactoring series. See tracking bug 82948.

* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTest::onEndTest):
(WTF::CCLayerTreeHostTest::runTest):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed expectations update for overflow-positioning.html.

* platform/chromium/test_expectations.txt:

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