WebKit-https.git
4 years agoUnreviewed change to revert extraneous changes made part of change set 196955.
msaboff@apple.com [Tue, 23 Feb 2016 17:42:12 +0000 (17:42 +0000)]
Unreviewed change to revert extraneous changes made part of change set 196955.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::doMallocOp):
(Interpreter::Thread::switchTo):
(writeData): Deleted.

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

4 years agoConnect WebAutomationSession to its backend dispatcher as if it were an agent and...
bburg@apple.com [Tue, 23 Feb 2016 17:40:20 +0000 (17:40 +0000)]
Connect WebAutomationSession to its backend dispatcher as if it were an agent and add stub implementations
https://bugs.webkit.org/show_bug.cgi?id=154518
<rdar://problem/24761096>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InspectorBackendDispatcher.h:
Export all the classes since they are used by WebKit::WebAutomationSession.

Source/WebKit2:

Add a domain dispatcher for the 'Automation' domain, and register the
WebAutomationSession itself as the handler for Automation commands.
Stub out these command implementations so the code will compile.

* UIProcess/Automation/Automation.json:
Fix the createWindow command's parameters and description.
Add an ErrorMessage string enumeration and document how it can be used
to signal well-known errors to the frontend.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
Add the domain backend dispatcher. It further parses commands that were deemed
valid by the generic dispatcher and match the 'Automation' domain prefix.

(WebKit::WebAutomationSession::getWindows):
(WebKit::WebAutomationSession::openWindow):
(WebKit::WebAutomationSession::closeWindow):
Stub these out with our new ErrorMessage enumeration and a macro to
make this code pattern more readable.

* UIProcess/Automation/WebAutomationSession.h:
Add new declarations and members.

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

4 years ago[GTK] Allow to run the WebKitGTK+ MiniBrowser with the run-benchmark script.
clopez@igalia.com [Tue, 23 Feb 2016 17:38:38 +0000 (17:38 +0000)]
[GTK] Allow to run the WebKitGTK+ MiniBrowser with the run-benchmark script.
https://bugs.webkit.org/show_bug.cgi?id=153993

Reviewed by Carlos Garcia Campos.

* MiniBrowser/gtk/main.c:
(createBrowserWindow): Support --geometry argument for MiniBrowser.
We use this on the gtk_minibrowser_driver script to start the MiniBrowser maximized.
* Scripts/webkitpy/benchmark_runner/browser_driver/__init__.py: Fix loading of subclasses:
The base class has to be loaded first, otherwise any subclase referencing it will give import error.
In OSX the ordering of os.listdir() causes the base class (browser_driver.py) to be first on the list, but not on Linux.
By specifiying the name of the base class file, we ensure it is always loaded first on any system despite the ordering of listdir.
* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py:
(BrowserDriverFactory.create):
* Scripts/webkitpy/benchmark_runner/browser_driver/gtk_browser_driver.py: Added.
(GTKBrowserDriver):
(GTKBrowserDriver.prepare_env):
(GTKBrowserDriver.restore_env):
(GTKBrowserDriver.close_browsers):
(GTKBrowserDriver._launch_process):
(GTKBrowserDriver._terminate_processes):
(GTKBrowserDriver._screen_size):
* Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py: Added.
(GTKMiniBrowserDriver):
(GTKMiniBrowserDriver.prepare_env):
(GTKMiniBrowserDriver.launch_url):
(GTKMiniBrowserDriver.close_browsers):
* Scripts/webkitpy/benchmark_runner/http_server_driver/__init__.py: Fix loading of subclasses. See description above.
* Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:
(SimpleHTTPServerDriver):
(SimpleHTTPServerDriver.kill_server): Check if the server is still running before trying to terminate it.
Usually the server ends gracefully (no need to terminate it), so this was causing ugly errors on the log.
* Scripts/webkitpy/benchmark_runner/utils.py: Fix loading of subclasses. See description above.
(load_subclasses):

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

4 years ago[css-grid] Rows track sizes are optional in grid-template shorthand
rego@igalia.com [Tue, 23 Feb 2016 16:49:54 +0000 (16:49 +0000)]
[css-grid] Rows track sizes are optional in grid-template shorthand
https://bugs.webkit.org/show_bug.cgi?id=154586

Reviewed by Sergio Villar Senin.

You can omit the size of the rows in grid-template shorthand,
even if you specify a named grid line for the end of the row,
due to a change in the spec back in 2014:
https://github.com/w3c/csswg-drafts/commit/9f660c4183c73c1f5279c46904dc6cb314f76194

Before if you want to specify a named grid line,
you need to set the row size.

Update parsing, so it nows accepts things like:
    grid-template: 100px / "a" [bottom];
Source/WebCore:

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSParser::parseGridTemplateShorthand):

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

4 years ago[SVG] Update SVG source to return string literals as ASCIILiteral and add test cases...
commit-queue@webkit.org [Tue, 23 Feb 2016 16:30:50 +0000 (16:30 +0000)]
[SVG] Update SVG source to return string literals as ASCIILiteral and add test cases for case sensitivity
https://bugs.webkit.org/show_bug.cgi?id=154373

Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2016-02-23
Reviewed by Youenn Fablet.

Source/WebCore:

Update SVGAnimatedEnumeration toString method to return ASCIILiteral for string literals and add test cases for
case-sensitivity for these elements.

Test: svg/dom/SVGAnimatedEnumeration-case-sensitive.html

* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGPropertyTraits<ComponentTransferType>::toString):
* svg/SVGFEBlendElement.h:
(WebCore::SVGPropertyTraits<BlendMode>::toString):
* svg/SVGFEColorMatrixElement.h:
(WebCore::SVGPropertyTraits<ColorMatrixType>::toString):
* svg/SVGFECompositeElement.h:
(WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
* svg/SVGFEConvolveMatrixElement.h:
(WebCore::SVGPropertyTraits<EdgeModeType>::toString):
* svg/SVGFEDisplacementMapElement.h:
(WebCore::SVGPropertyTraits<ChannelSelectorType>::toString):
* svg/SVGFEMorphologyElement.h:
(WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString):
* svg/SVGFETurbulenceElement.h:
(WebCore::SVGPropertyTraits<SVGStitchOptions>::toString):
(WebCore::SVGPropertyTraits<TurbulenceType>::toString):
* svg/SVGGradientElement.h:
(WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString):
* svg/SVGMarkerElement.h:
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
* svg/SVGTextContentElement.h:
(WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString):
* svg/SVGTextPathElement.h:
(WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString):
(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
* svg/SVGUnitTypes.h:
(WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString):

LayoutTests:

Add test cases for case-sensitivity for SVGAnimatedEnumeration elements.

* svg/dom/SVGAnimatedEnumeration-case-sensitive-expected.txt: Added.
* svg/dom/SVGAnimatedEnumeration-case-sensitive.html: Added.
* svg/dom/script-tests/SVGAnimatedEnumeration-case-sensitive.js: Added.
(testCaseSensitivity):

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

4 years ago[Mac][cmake] Unreviewed speculative buildfix after r196779. Just for fun.
ossy@webkit.org [Tue, 23 Feb 2016 15:51:19 +0000 (15:51 +0000)]
[Mac][cmake] Unreviewed speculative buildfix after r196779. Just for fun.

* PlatformMac.cmake:

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

4 years agoRemove tab suspension code
antti@apple.com [Tue, 23 Feb 2016 14:36:32 +0000 (14:36 +0000)]
Remove tab suspension code
https://bugs.webkit.org/show_bug.cgi?id=154585

Reviewed by Andreas Kling.

Source/WebCore:

It causes too many problems.

* page/Page.cpp:
(WebCore::networkStateChanged):
(WebCore::Page::Page):
(WebCore::Page::setPageActivityState):
(WebCore::Page::setIsVisible):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::setIsPrerender):
(WebCore::Page::setResourceUsageOverlayVisible):
(WebCore::Page::canTabSuspend): Deleted.
(WebCore::Page::setIsTabSuspended): Deleted.
(WebCore::Page::setTabSuspensionEnabled): Deleted.
(WebCore::Page::updateTabSuspensionState): Deleted.
(WebCore::Page::tabSuspensionTimerFired): Deleted.
* page/Page.h:
(WebCore::Page::setEditable):
(WebCore::Page::isEditable):
(WebCore::Page::setShowAllPlugins):

Source/WebKit2:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

4 years ago[GTK] Missing configuration patch for openh264 compilation
commit-queue@webkit.org [Tue, 23 Feb 2016 12:22:39 +0000 (12:22 +0000)]
[GTK] Missing configuration patch for openh264 compilation
https://bugs.webkit.org/show_bug.cgi?id=154455

This patch is required for the openh264 compilation with the
jhbuild-webrtc.modules. The code was implemented by Alessandro
Decina.

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-02-23
Reviewed by Philippe Normand.

* gtk/patches/openh264-configure.patch: Added.

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

4 years agoRefactor DOM Iterator next signature
youenn.fablet@crf.canon.fr [Tue, 23 Feb 2016 09:39:30 +0000 (09:39 +0000)]
Refactor DOM Iterator next signature
https://bugs.webkit.org/show_bug.cgi?id=154531

Reviewed by Myles C. Maxfield.

Covered by existing tests.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
* Modules/fetch/FetchHeaders.h:
* bindings/js/JSKeyValueIterator.h: Using Optional<KeyValuePair> as returned iterator value.
(WebCore::keyValueIteratorForEach):
(WebCore::JSKeyValueIterator<JSWrapper>::next):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
* css/FontFaceSet.h:

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

4 years ago[EFL] Merge WebView and WebViewEfl
ryuan.choi@navercorp.com [Tue, 23 Feb 2016 07:59:02 +0000 (07:59 +0000)]
[EFL] Merge WebView and WebViewEfl
https://bugs.webkit.org/show_bug.cgi?id=154445

Reviewed by Gyuyoung Kim.

* PlatformEfl.cmake: Removed WebViewEfl.cpp from source list.
* UIProcess/API/C/efl/WKViewEfl.cpp: Removed type cast for WebViewEfl.
* UIProcess/API/efl/EwkView.cpp: Ditto.
* UIProcess/API/efl/EwkView.h:
* UIProcess/API/efl/GestureRecognizer.cpp: Removed type cast for WebViewEfl.
* UIProcess/API/efl/WebAccessibility.cpp: Removed unnecessary includes.
* UIProcess/API/efl/ewk_view.cpp: Ditto.
* UIProcess/efl/ViewClientEfl.cpp: Ditto.
* UIProcess/efl/WebColorPickerClient.cpp: Ditto.
* UIProcess/efl/WebColorPickerClient.h:
* UIProcess/efl/WebColorPickerEfl.cpp:
(WebKit::WebColorPickerEfl::WebColorPickerEfl):
* UIProcess/efl/WebColorPickerEfl.h:
(WebKit::WebColorPickerEfl::create):
* UIProcess/efl/WebView.cpp:
* UIProcess/efl/WebView.h:
* UIProcess/efl/WebViewEfl.cpp: Removed.
* UIProcess/efl/WebViewEfl.h: Ditto.

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

4 years agoSome timer alignment cleanup.
barraclough@apple.com [Tue, 23 Feb 2016 07:37:26 +0000 (07:37 +0000)]
Some timer alignment cleanup.
https://bugs.webkit.org/show_bug.cgi?id=154559

Reviewed by Chris Dumez.

Document shouldn't override Page's timer alignment policy with a lower alignment,
and m_domTimerAlignmentInterval isn't really a Settings, it's just the current state
for the page.

* dom/Document.cpp:
(WebCore::Document::timerAlignmentInterval):
    - take the max of the possible intervals.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setTimerThrottlingEnabled):
(WebCore::Page::setDOMTimerAlignmentInterval):
    - moved here from Settings.
* page/Page.h:
(WebCore::Page::domTimerAlignmentInterval):
    - moved here from Settings.
* page/Settings.cpp:
(WebCore::Settings::setDOMTimerAlignmentInterval): Deleted.
    - moved to Page.
* page/Settings.h:
(WebCore::Settings::domTimerAlignmentInterval): Deleted.
    - moved to Page.

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

4 years agoWeb Inspector: add 'Automation' protocol domain and generate its backend classes...
bburg@apple.com [Tue, 23 Feb 2016 07:18:41 +0000 (07:18 +0000)]
Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=154509
<rdar://problem/24759098>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Add a new 'WebKit' framework, which is used to generate protocol code
in WebKit2.

Add --backend and --frontend flags to the main generator script.
These allow a framework to trigger two different sets of generators
so they can be separately generated and compiled.

* inspector/scripts/codegen/models.py:
(Framework.fromString):
(Frameworks): Add new framework.

* inspector/scripts/generate-inspector-protocol-bindings.py:
If neither --backend or --frontend is specified, assume both are wanted.
This matches the behavior for JavaScriptCore and WebInspector frameworks.

(generate_from_specification):
Generate C++ files for the backend and Objective-C files for the frontend.

Source/WebKit2:

Add a new 'Automation' domain which presents an RPC interface
for sending automation commands to an active WebAutomationSession
in the UIProcess via RemoteInspector. This is similar to how the
Inspector backend communicates bidirectionally with a remote
Inspector frontend.

Add build system logic to generate JSON-RPC protocol bindings
for the 'Automation' domain using the inspector code generators.

Move automation-related files that are not API or SPI into their
own directory.

* Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
private headers are, since that's where the code generators live.

* CMakeLists.txt: Look in UIProcess/Automation directory.
* PlatformMac.cmake:
* DerivedSources.make: Generate protocol bindings for a single domain.
The names of the generated files will be improved in a follow-up patch
so that they do not clash with generated files in JavaScriptCore.

* UIProcess/Automation/Automation.json: Added.
* UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::~WebAutomationSession):
Set up a backend dispatcher and frontend router. They will be used later.

(WebKit::WebAutomationSession::dispatchMessageFromRemote):
Forward messages from the remote to the backend dispatcher. When
an agent / command handler is registered, it will receive the message.

(WebKit::WebAutomationSession::connect):
(WebKit::WebAutomationSession::disconnect):
Connenct and disconnect the frontend router to the remote channel.

* UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
* WebKit2.xcodeproj/project.pbxproj: Add and move files.

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

4 years agoFont features specified in @font-face blocks don't apply to local() families
mmaxfield@apple.com [Tue, 23 Feb 2016 07:17:29 +0000 (07:17 +0000)]
Font features specified in @font-face blocks don't apply to local() families
https://bugs.webkit.org/show_bug.cgi?id=154554

Reviewed by Dean Jackson.

Source/WebCore:

The correct variables just need to be wired up. In addition, our caches need to be sensitive
to the new data.

Test: css3/font-feature-font-face-local.html

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::FontPlatformDataCacheKeyHash::hash):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForFamily):
* platform/graphics/FontCache.h:
* platform/graphics/FontFeatureSettings.h:
(WebCore::FontFeature::operator!=):
(WebCore::FontFeatureSettings::operator!=):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFont):
* platform/text/TextFlags.h:
(WebCore::FontVariantSettings::operator==):
(WebCore::FontVariantSettings::operator!=):
(WebCore::FontVariantSettings::uniqueValue):

LayoutTests:

* css3/font-feature-font-face-local-expected.html: Added.
* css3/font-feature-font-face-local.html: Added.

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

4 years agoWeb Inspector: Timelines sidebar and overview attempt to access undefined properties...
mattbaker@apple.com [Tue, 23 Feb 2016 02:31:02 +0000 (02:31 +0000)]
Web Inspector: Timelines sidebar and overview attempt to access undefined properties when FPS instrument is absent
https://bugs.webkit.org/show_bug.cgi?id=154567
<rdar://problem/24781536>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
The viewMode property should be in a valid state before attempting
to access the current view mode settings.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.get minimumWidth):
(WebInspector.TimelineSidebarPanel.prototype._updateViewModeIfNeeded):
(WebInspector.TimelineSidebarPanel):
Added missing checks for FPSInstrument support.

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

4 years agoJSGlobalObject doesn't visit ProxyObjectStructure during GC
sbarati@apple.com [Tue, 23 Feb 2016 01:01:46 +0000 (01:01 +0000)]
JSGlobalObject doesn't visit ProxyObjectStructure during GC
https://bugs.webkit.org/show_bug.cgi?id=154564

Rubber stamped by Mark Lam.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::visitChildren):

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

4 years agoInternalFunction::createSubclassStructure doesn't take into account that get() might...
sbarati@apple.com [Tue, 23 Feb 2016 00:51:02 +0000 (00:51 +0000)]
InternalFunction::createSubclassStructure doesn't take into account that get() might throw
https://bugs.webkit.org/show_bug.cgi?id=154548

Reviewed by Mark Lam and Geoffrey Garen and Andreas Kling.

InternalFunction::createSubclassStructure calls newTarget.get(...) which can throw
an exception. Neither the function nor the call sites of the function took this into
account. This patch audits the call sites of the function to make it work in
the event that an exception is thrown.

* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayView):
* runtime/JSGlobalObject.h:
(JSC::constructEmptyArray):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
* runtime/JSPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::constructWithNumberConstructor):
* runtime/RegExpConstructor.cpp:
(JSC::getRegExpStructure):
(JSC::constructRegExp):
(JSC::constructWithRegExpConstructor):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringConstructor.cpp:
(JSC::constructWithStringConstructor):
(JSC::StringConstructor::getConstructData):
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* tests/stress/create-subclass-structure-might-throw.js: Added.
(assert):

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

4 years agoREGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
dbates@webkit.org [Tue, 23 Feb 2016 00:48:48 +0000 (00:48 +0000)]
REGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
https://bugs.webkit.org/show_bug.cgi?id=154563
<rdar://problem/24780678>

Reviewed by Alexey Proskuryakov.

Fixes an issue where the provisional loader may be deallocated when starting
a load. One example where this can occur is when cancelling the provisional load
as part of a form submission because the Content Security Policy of the page
blocks the submission (it violates the directive form-action).

This crash is covered by the test http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Take a ref before calling
DocumentLoader::willSendRequest().

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

4 years agoImplement basic functionality in WebVideoFullscreenInterfaceMac.
adachan@apple.com [Tue, 23 Feb 2016 00:40:16 +0000 (00:40 +0000)]
Implement basic functionality in WebVideoFullscreenInterfaceMac.
https://bugs.webkit.org/show_bug.cgi?id=153241

Reviewed by Beth Dakin.

Source/WebCore:

* platform/cocoa/WebVideoFullscreenInterface.h:
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::invalidate):
(WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::rootViewToWindow):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::rootViewToWindow):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):

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

4 years agoUnreviewed build fix.
msaboff@apple.com [Tue, 23 Feb 2016 00:03:54 +0000 (00:03 +0000)]
Unreviewed build fix.

Eliminated the include of simple.h as that benchmark wasn't meant to be checked in.

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

4 years agoFix build and implement functions to retrieve registers on FreeBSD
commit-queue@webkit.org [Mon, 22 Feb 2016 23:03:26 +0000 (23:03 +0000)]
Fix build and implement functions to retrieve registers on FreeBSD
https://bugs.webkit.org/show_bug.cgi?id=152258

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2016-02-22
Reviewed by Michael Catanzaro.

* heap/MachineStackMarker.cpp:
(pthreadSignalHandlerSuspendResume):
struct ucontext is not specified in POSIX and it is not available on
FreeBSD. Replacing it with ucontext_t fixes the build problem.
(JSC::MachineThreads::Thread::Registers::stackPointer):
(JSC::MachineThreads::Thread::Registers::framePointer):
(JSC::MachineThreads::Thread::Registers::instructionPointer):
(JSC::MachineThreads::Thread::Registers::llintPC):
* heap/MachineStackMarker.h:

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

4 years agoREGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-desig...
cdumez@apple.com [Mon, 22 Feb 2016 22:27:30 +0000 (22:27 +0000)]
REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
https://bugs.webkit.org/show_bug.cgi?id=154547
<rdar://problem/24772167>

Reviewed by Gavin Barraclough.

Source/WebCore:

The Website was doing the following:
$ var e = window.addEventListener;
$ e("eventname", handler)

In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings
implementation was caused with a thisValue which is a JSLexicalEnvironment
and the implementation did not know how to convert it into a global object.
The previous implementation on JSDOMWindow used to handle tis correctly
because it was always calling JSValue::toThis() on the thisValue before
trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis()
gets the globalThisValue. This patch updates the EventTarget bindings
code to call always call toThis() on the thisValue before trying to
cast it. This should correctly deal with JSLexicalEnvironment and be a
no-op in usual cases.

No new tests, extended existing test.

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

LayoutTests:

Add regression test for <rdar://problem/24772167>.

* fast/dom/Window/addEventListener-implicit-this-expected.txt:
* fast/dom/Window/addEventListener-implicit-this.html:

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

4 years agoRepeated background images have the wrong position when using bottom/right-relative...
simon.fraser@apple.com [Mon, 22 Feb 2016 22:26:23 +0000 (22:26 +0000)]
Repeated background images have the wrong position when using bottom/right-relative background-position
https://bugs.webkit.org/show_bug.cgi?id=154478

Reviewed by Dave Hyatt.
Source/WebCore:

Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
painting repeated background images when right/bottom edges are used.

Also rename BackgroundEdgeOrigin to Edge

Test: fast/images/background-position.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Edge):
(WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::resolveEdgeRelativeLength):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::backgroundXOrigin):
(WebCore::FillLayer::backgroundYOrigin):
(WebCore::FillLayer::setBackgroundXOrigin):
(WebCore::FillLayer::setBackgroundYOrigin):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Enhanced background-position-serialize.html to test values that use right/bottom edge specifiers.

Ref test for background-position.

* fast/css/background-position-serialize-expected.txt:
* fast/css/background-position-serialize.html:
* fast/images/background-position-expected.html: Added.
* fast/images/background-position.html: Added.
* fast/images/resources/checker.png: Added.

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

4 years agoJSValue::isConstructor and JSValue::isFunction should check getConstructData and...
sbarati@apple.com [Mon, 22 Feb 2016 22:24:51 +0000 (22:24 +0000)]
JSValue::isConstructor and JSValue::isFunction should check getConstructData and getCallData
https://bugs.webkit.org/show_bug.cgi?id=154552

Reviewed by Mark Lam.

ES6 Proxy breaks our isFunction() and isConstructor() JSValue methods.
They return false on a Proxy with internal [[Call]] and [[Construct]]
properties. It seems safest, most forward looking, and most adherent
to the specification to check getCallData() and getConstructData() to
implement these functions.

* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isFunction):
(JSC::JSValue::isConstructor):

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

4 years agoUnreviewed, rolling out r196935.
ryanhaddad@apple.com [Mon, 22 Feb 2016 22:23:39 +0000 (22:23 +0000)]
Unreviewed, rolling out r196935.
https://bugs.webkit.org/show_bug.cgi?id=154557

This change causes timeouts and crashes in LayoutTests
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"Enable AVFoundationNSURLSessionEnabled by default"
https://bugs.webkit.org/show_bug.cgi?id=154469
http://trac.webkit.org/changeset/196935

Patch by Commit Queue <commit-queue@webkit.org> on 2016-02-22

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

4 years ago[l10n] Updated Polish translation of WebKitGTK+ for 2.12
mcatanzaro@igalia.com [Mon, 22 Feb 2016 22:18:36 +0000 (22:18 +0000)]
[l10n] Updated Polish translation of WebKitGTK+ for 2.12
https://bugs.webkit.org/show_bug.cgi?id=154549

Patch by Piotr Drąg <piotrdrag@gmail.com> on 2016-02-22
Rubber-stamped by Michael Catanzaro.

* pl.po:

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

4 years agoBound functions should use the prototype of the function being bound
keith_miller@apple.com [Mon, 22 Feb 2016 22:07:16 +0000 (22:07 +0000)]
Bound functions should use the prototype of the function being bound
https://bugs.webkit.org/show_bug.cgi?id=154195

Reviewed by Geoffrey Garen.

Per ES6, the result of Function.prototype.bind should have the same
prototype as the the function being bound. In order to avoid creating
a new structure each time a function is bound we store the new
structure in our structure map. However, we cannot currently store
structures that have a different GlobalObject than their prototype.
In the rare case that the GlobalObject differs or the prototype of
the bindee is null we create a new structure each time. To further
minimize new structures, as well as making structure lookup faster,
we also store the structure in the RareData of the function we
are binding.

* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::visitChildren):
* runtime/FunctionRareData.h:
(JSC::FunctionRareData::getBoundFunctionStructure):
(JSC::FunctionRareData::setBoundFunctionStructure):
* runtime/JSBoundFunction.cpp:
(JSC::getBoundFunctionStructure):
(JSC::JSBoundFunction::create):
* tests/es6.yaml:
* tests/stress/bound-function-uses-prototype.js: Added.
(testChangeProto.foo):
(testChangeProto):
(testBuiltins):
* tests/stress/class-subclassing-function.js:

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

4 years agoMallocBench: Added recording for nimlang website, new recording details and added...
msaboff@apple.com [Mon, 22 Feb 2016 22:02:24 +0000 (22:02 +0000)]
MallocBench: Added recording for nimlang website, new recording details and added new options
https://bugs.webkit.org/show_bug.cgi?id=154485

Reviewed by Geoff Garen.

Added new capabilities to MallocBench.  These include:
    Added a recording of http://nim-lang.org/docs/lib.html.
    Added thread id to the recording and the ability to playback switching threads in MallocBench
    Added aligned allocations to recordings and the ability to playback
    Added --use-thread-id option to honor recorded thread ids
    Added --detailed-report to output remaining allocations by size after playback
    Added --no-warmup to not run the warm up iteration

Changed the way that options are passed down to the benchmarks.  Instead of passing individual
boolean or numeric option values, just pass a reference the CommandLine itself.  Each benchmark
can access the options that are appropriate.  The Benchmark class also uses the options for
is parallel, run counts and warm up.

Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed
for another 32 bits of data.  Breaking that unused 32 bits into a 16 bit thread id value and a
16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback
without any incompatibilities.

Threaded operation is simulated by creating threads as needed.  As long as the next Op's thread id
is the same as the last, operation continues as normal.  When the next Op has a different thread id,
we switch to that thread using the shared Op stream to continue playing back.  There is a mutex to
assure that only one thread is really running at a time and a condition variable used to wait
that the current thread id matches each block thread's thread id.  This doesn't simulate true
concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully.

* MallocBench/MallocBench.xcodeproj/project.pbxproj:
* MallocBench/MallocBench/Benchmark.cpp:
(deallocateHeap):
(Benchmark::Benchmark):
(Benchmark::runOnce):
(Benchmark::run):
* MallocBench/MallocBench/Benchmark.h:
(Benchmark::isValid):
* MallocBench/MallocBench/CommandLine.cpp:
(CommandLine::printUsage):
* MallocBench/MallocBench/CommandLine.h:
(CommandLine::isValid):
(CommandLine::benchmarkName):
(CommandLine::isParallel):
(CommandLine::useThreadID):
(CommandLine::detailedReport):
(CommandLine::warmUp):
(CommandLine::heapSize):
(CommandLine::runs):
* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter):
(Interpreter::run):
(Interpreter::readOps):
(Interpreter::doOnSameThread):
(Interpreter::switchToThread):
(Interpreter::detailedReport):
(compute2toPower):
(writeData):
(Interpreter::doMallocOp):
(Interpreter::Thread::Thread):
(Interpreter::Thread::stop):
(Interpreter::Thread::~Thread):
(Interpreter::Thread::runThread):
(Interpreter::Thread::waitToRun):
(Interpreter::Thread::switchTo):
* MallocBench/MallocBench/Interpreter.h:
(Interpreter::Thread::isMainThread):
* MallocBench/MallocBench/alloc_free.cpp: Added.
(benchmark_alloc_free):
* MallocBench/MallocBench/alloc_free.h: Added.
* MallocBench/MallocBench/balloon.cpp:
(benchmark_balloon):
* MallocBench/MallocBench/balloon.h:
* MallocBench/MallocBench/big.cpp:
(benchmark_big):
* MallocBench/MallocBench/big.h:
* MallocBench/MallocBench/churn.cpp:
(benchmark_churn):
* MallocBench/MallocBench/churn.h:
* MallocBench/MallocBench/facebook.cpp:
(benchmark_facebook):
* MallocBench/MallocBench/facebook.h:
* MallocBench/MallocBench/flickr.cpp:
(benchmark_flickr):
(benchmark_flickr_memory_warning):
* MallocBench/MallocBench/flickr.h:
* MallocBench/MallocBench/fragment.cpp:
(validate):
(benchmark_fragment):
(benchmark_fragment_iterate):
* MallocBench/MallocBench/fragment.h:
* MallocBench/MallocBench/list.cpp:
(benchmark_list_allocate):
(benchmark_list_traverse):
* MallocBench/MallocBench/list.h:
* MallocBench/MallocBench/main.cpp:
(main):
* MallocBench/MallocBench/medium.cpp:
(benchmark_medium):
* MallocBench/MallocBench/medium.h:
* MallocBench/MallocBench/memalign.cpp:
(test):
(benchmark_memalign):
* MallocBench/MallocBench/memalign.h:
* MallocBench/MallocBench/message.cpp:
(benchmark_message_one):
(benchmark_message_many):
* MallocBench/MallocBench/message.h:
* MallocBench/MallocBench/nimlang.cpp: Added.
(benchmark_nimlang):
* MallocBench/MallocBench/nimlang.h: Added.
* MallocBench/MallocBench/nimlang.ops: Added.
* MallocBench/MallocBench/realloc.cpp:
(benchmark_realloc):
* MallocBench/MallocBench/realloc.h:
* MallocBench/MallocBench/reddit.cpp:
(benchmark_reddit):
(benchmark_reddit_memory_warning):
* MallocBench/MallocBench/reddit.h:
* MallocBench/MallocBench/stress.cpp:
(deallocate):
(benchmark_stress):
* MallocBench/MallocBench/stress.h:
* MallocBench/MallocBench/stress_aligned.cpp:
(benchmark_stress_aligned):
* MallocBench/MallocBench/stress_aligned.h:
* MallocBench/MallocBench/theverge.cpp:
(benchmark_theverge):
(benchmark_theverge_memory_warning):
* MallocBench/MallocBench/theverge.h:
* MallocBench/MallocBench/tree.cpp:
(benchmark_tree_allocate):
(benchmark_tree_traverse):
(benchmark_tree_churn):
* MallocBench/MallocBench/tree.h:
* MallocBench/run-malloc-benchmarks:

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

4 years ago[Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest...
mmaxfield@apple.com [Mon, 22 Feb 2016 21:40:02 +0000 (21:40 +0000)]
[Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest of the class
https://bugs.webkit.org/show_bug.cgi?id=153347

Reviewed by Antti Koivisto.

Source/WebCore:

This patch implements the document.fonts Javascript object. It does so by briding the
already-existing FontFaceSet Javascript object with the CSSFontSelector WebCore object.
CSSFontSelector used to hold internal objects for each @font-face object in the
Document. These objects have been moved into CSSFontFaceSet, so CSSFontSelector simply
just owns an instance of a CSSFontFaceSet.

The lifetime of the FontFace and FontFaceSet objects is a little interesting: because
all the ownership references are inside the WebCore CSSFontFace{,Set} objects, the
higher-level Javascript FontFace{,Set} objects are held through a WeakPtr. This means
that if all the references to these higher-level objects go away, and you re-query the
document for its FontFace objects, you may get a new object (albeit with the same
state as a previous object). However, this won't occur if there are any references to
the old object, which means it is almost not observable.

This patch doesn't implement the relationship between the CSSOM and the FontFace
objects. Changing one should result in a change in the other, but that will be
implemented in a forthcoming patch.

This patch also doesn't alter the lifetime of the CSSFontSelector, which means that all
the Document's fonts may be destroyed and recreated from CSS. There are a few things
which can trigger this. A subsequent patch will make the CSSFontSelector outlive the
Document.

This patch does implement (and test) the ability to add a new FontFace to the Document
to cause a relayout, as well as changing properties of existing FontFace objects already
in the Document to cause a relayout.

Test: fast/text/font-face-set-document.html

* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next): Pass an extra argument.
* Modules/fetch/FetchHeaders.h:
* bindings/js/JSKeyValueIterator.h: The ExecState is necessary to build an external
wrapper from an existing CSSFontFace object.
(WebCore::JSKeyValueIterator<JSWrapper>::next):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources): Moved from CSSFontSelector.
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::notifyClientsOfFontPropertyChange):
(WebCore::CSSFontFace::setFamilies):
(WebCore::CSSFontFace::calculateStyle): Shared code between CSSFontFaceSet and
CSSFontFace.
(WebCore::CSSFontFace::setStyle): Update to use calculateStyle().
(WebCore::CSSFontFace::calculateWeight): Ditto.
(WebCore::CSSFontFace::setWeight): Update to use caculateWeight().
(WebCore::CSSFontFace::setUnicodeRange): Notify clients.
(WebCore::CSSFontFace::setVariantLigatures): Ditto.
(WebCore::CSSFontFace::setVariantPosition): Ditto.
(WebCore::CSSFontFace::setVariantCaps): Ditto.
(WebCore::CSSFontFace::setVariantNumeric): Ditto.
(WebCore::CSSFontFace::setVariantAlternates): Ditto.
(WebCore::CSSFontFace::setVariantEastAsian): Ditto.
(WebCore::CSSFontFace::setFeatureSettings): Ditto.
(WebCore::CSSFontFace::removeClient):
(WebCore::CSSFontFace::wrapper): Build a new wrapper if one doesn't already
exist. Note that this requires an ExecState to create a promise.
(WebCore::CSSFontFace::setStatus):
(WebCore::CSSFontFace::fontLoaded):
(WebCore::CSSFontFace::pump):
(WebCore::CSSFontFace::font):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::CSSFontFaceSet): Moved code from CSSFontSelector.
(WebCore::CSSFontFaceSet::~CSSFontFaceSet):
(WebCore::CSSFontFaceSet::addClient): This object can now have multiple
clients.
(WebCore::CSSFontFaceSet::removeClient):
(WebCore::CSSFontFaceSet::incrementActiveCount): Update for multiple clients.
(WebCore::CSSFontFaceSet::decrementActiveCount): Ditto.
(WebCore::CSSFontFaceSet::hasFace):
(WebCore::CSSFontFaceSet::registerLocalFontFacesForFamily): Moved from
CSSFontSelector.
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
(WebCore::CSSFontFaceSet::addToFacesLookupTable): This helper function can
be used when a property of a FontFace is changed.
(WebCore::CSSFontFaceSet::add): Update to use addToFacesLookupTable().
(WebCore::CSSFontFaceSet::removeFromFacesLookupTable): Same as
addToFacesLookupTable().
(WebCore::CSSFontFaceSet::remove): Update to use removeFromFacesLookupTable().
(WebCore::CSSFontFaceSet::clear):
(WebCore::CSSFontFaceSet::operator[]):
(WebCore::computeFontTraitsMask): Moved from CSSFontSelector.
(WebCore::CSSFontFaceSet::matchingFaces): Update to use new data structures.
(WebCore::FontFaceComparator::FontFaceComparator): Moved from
CSSFontSelector.
(WebCore::FontFaceComparator::operator()):
(WebCore::CSSFontFaceSet::getFontFace): Update to use new data structures.
(WebCore::CSSFontFaceSet::fontStateChanged): Update to use multiple clients.
(WebCore::CSSFontFaceSet::fontPropertyChanged): We must update our internal
data structure if the family name changed.
(WebCore::extractFamilies): Deleted.
(WebCore::familiesIntersect): Deleted.
(WebCore::CSSFontFaceSet::load): Deleted.
(WebCore::CSSFontFaceSet::stateChanged): Deleted.
* css/CSSFontFaceSet.h: Now needs to be RefCounted. New data structures are
taken from CSSFontSelector.
(WebCore::CSSFontFaceSetClient::faceFinished):
(WebCore::CSSFontFaceSetClient::fontModified):
(WebCore::CSSFontFaceSetClient::startedLoading):
(WebCore::CSSFontFaceSetClient::completedLoading):
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp: Move code into CSSFontFaceSet.
(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::~CSSFontSelector):
(WebCore::CSSFontSelector::fontFaceSet):
(WebCore::CSSFontSelector::isEmpty):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::CSSFontSelector::fontModified):
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::clearDocument):
(WebCore::CSSFontSelector::appendSources): Deleted.
(WebCore::CSSFontSelector::familyNameFromPrimitive): Deleted.
(WebCore::CSSFontSelector::registerLocalFontFacesForFamily): Deleted.
(WebCore::FontFaceComparator::FontFaceComparator): Deleted.
(WebCore::FontFaceComparator::operator()): Deleted.
(WebCore::CSSFontSelector::getFontFace): Deleted.
* css/CSSFontSelector.h:
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
* css/CSSSegmentedFontFace.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::FontFace):
(WebCore::FontFace::createWeakPtr):
(WebCore::FontFace::fontStateChanged):
(WebCore::FontFace::stateChanged): Deleted.
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::create):
(WebCore::FontFaceSet::FontFaceSet):
(WebCore::FontFaceSet::~FontFaceSet):
(WebCore::FontFaceSet::Iterator::next):
(WebCore::FontFaceSet::has):
(WebCore::FontFaceSet::size):
(WebCore::FontFaceSet::add):
(WebCore::FontFaceSet::remove):
(WebCore::FontFaceSet::clear):
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::check):
(WebCore::FontFaceSet::status):
(WebCore::FontFaceSet::canSuspendForDocumentSuspension):
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h:
* css/FontFaceSet.idl:
* dom/Document.cpp:
(WebCore::Document::fonts):
* dom/Document.h:
* dom/Document.idl:
* svg/SVGFontFaceElement.h:

LayoutTests:

* fast/text/font-face-javascript.html:
* fast/text/font-face-set-document-expected.txt: Added.
* fast/text/font-face-set-document.html: Added.

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

4 years agoUnreviewed, fix stress test to not print on success.
keith_miller@apple.com [Mon, 22 Feb 2016 21:36:24 +0000 (21:36 +0000)]
Unreviewed, fix stress test to not print on success.

* tests/stress/call-apply-builtin-functions-dont-use-iterators.js:
(catch): Deleted.

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

4 years agoRemove _mockCaptureDevicesEnabled getter and setter
andersca@apple.com [Mon, 22 Feb 2016 21:10:18 +0000 (21:10 +0000)]
Remove _mockCaptureDevicesEnabled getter and setter
https://bugs.webkit.org/show_bug.cgi?id=154550

Reviewed by Beth Dakin.

The _mockCaptureDevicesEnabled property isn't declared anywhere, and this
should be a WKWebViewConfiguration parameter if we ever want to expose it in the modern API.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mockCaptureDevicesEnabled]): Deleted.
(-[WKPreferences _setMockCaptureDevicesEnabled:]): Deleted.

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

4 years ago[WinCairo] Compile fix.
peavo@outlook.com [Mon, 22 Feb 2016 20:15:30 +0000 (20:15 +0000)]
[WinCairo] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=154545

Reviewed by Alex Christensen.

Add missing parameter to GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers().

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::flushPendingLayerChanges):

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

4 years agoUse Symbol.species in the builtin TypedArray.prototype functions
keith_miller@apple.com [Mon, 22 Feb 2016 20:07:50 +0000 (20:07 +0000)]
Use Symbol.species in the builtin TypedArray.prototype functions
https://bugs.webkit.org/show_bug.cgi?id=153384

Reviewed by Geoffrey Garen.

This patch adds the use of species constructors to the TypedArray.prototype map and filter
functions. It also adds a new private function typedArrayGetOriginalConstructor that
returns the TypedArray constructor used to originally create a TypedArray instance.

There are no ES6 tests to update for this patch as species creation for these functions is
not tested in the compatibility table.

* builtins/TypedArrayPrototype.js:
(map):
(filter):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::typedArrayConstructor):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncGetOriginalConstructor):
* runtime/JSTypedArrayViewPrototype.h:
* tests/stress/typedarray-filter.js:
(subclasses.typedArrays.map):
(prototype.accept):
(testSpecies):
(accept):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):
* tests/stress/typedarray-map.js:
(subclasses.typedArrays.map):
(prototype.id):
(testSpecies):
(id):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):

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

4 years agoBuiltins that should not rely on iteration do.
keith_miller@apple.com [Mon, 22 Feb 2016 19:43:01 +0000 (19:43 +0000)]
Builtins that should not rely on iteration do.
https://bugs.webkit.org/show_bug.cgi?id=154475

Reviewed by Geoffrey Garen.

When changing the behavior of varargs calls to use ES6 iterators the
call builtin function's use of a varargs call was overlooked. The use
of iterators is observable outside the scope of the the call function,
thus it must be reimplemented.

* builtins/FunctionPrototype.js:
(call):
* tests/stress/call-apply-builtin-functions-dont-use-iterators.js: Added.
(test):
(addAll):
(catch):

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

4 years ago[JSC shell] Don't put empty arguments array to VM.
commit-queue@webkit.org [Mon, 22 Feb 2016 19:41:00 +0000 (19:41 +0000)]
[JSC shell] Don't put empty arguments array to VM.
https://bugs.webkit.org/show_bug.cgi?id=154516

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Geoffrey Garen.

This allows arrowfunction-lexical-bind-arguments-top-level test to pass
in jsc as well as in browser.

Source/JavaScriptCore:

* jsc.cpp:
(GlobalObject::finishCreation):

LayoutTests:

* js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:
Removed @ skip annotation.

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

4 years ago[cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
commit-queue@webkit.org [Mon, 22 Feb 2016 19:32:47 +0000 (19:32 +0000)]
[cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
https://bugs.webkit.org/show_bug.cgi?id=154450

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

* CMakeLists.txt:

Source/WebCore:

No new tests needed.

* CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

Source/WebKit2:

* CMakeLists.txt: Used WebKit2_SOURCES variable instead of separate
WebKit2_DERIVED_SOURCES for compatibility with WEBKIT_FRAMEWORK macro.
There is no real need to separate derived sources from others.
* PlatformGTK.cmake: Ditto.

Source/WTF:

* wtf/CMakeLists.txt:

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

4 years agoWorkaround for ICE in GCC 4.8 appeared in r196846.
commit-queue@webkit.org [Mon, 22 Feb 2016 19:26:48 +0000 (19:26 +0000)]
Workaround for ICE in GCC 4.8 appeared in r196846.
https://bugs.webkit.org/show_bug.cgi?id=154535

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Chris Dumez.

No new tests needed.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::autocomplete):

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

4 years ago[CMake] Unreviewed build fix after r196942.
clopez@igalia.com [Mon, 22 Feb 2016 19:24:16 +0000 (19:24 +0000)]
[CMake] Unreviewed build fix after r196942.

* CMakeLists.txt: WKPluginSiteDataManager.cpp is gone.

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

4 years agoAdd mechanism to disable memory pressure handling
commit-queue@webkit.org [Mon, 22 Feb 2016 18:31:03 +0000 (18:31 +0000)]
Add mechanism to disable memory pressure handling
https://bugs.webkit.org/show_bug.cgi?id=154254
<rdar://problem/24662616>

Patch by Keith Rollin <krollin@apple.com> on 2016-02-22
Reviewed by Chris Dumez.

Add a mechanism to disable WebKit's response to memory pressure
triggers. This was asked for by another group for testing purposes.

In order to disable WebKit's memory pressure handling, execute the
following from the command line:

    defaults write com.apple.Safari WebKitSuppressMemoryPressureHandler -bool true

To revert to standard behavior, delete the key or set it to False.

This flag is used when a new sub-process is being spawned. The value
is read and stored in an initialization parameter block, which is then
sent to the new sub-process.

In actuality, only the UI, WebContent, and Network processes heed the
flag. The Plugin process isn't instrumented to heed this flag for
three reasons. First, the Plugin process installs its memory pressure
handler in initializeProcess, not initializePluginProcess. This is
contrary to when the other processes install their handlers, which is
in initialize<PluginType>Process, not initializeProcess. So in order
to accomodate the Plugin process, we'd need to modify
ChildProcessInitializationParameters. Doing this is awkward at best,
but also seems to be opposed to what's supposed to be done in
initializeProcess and conveyed in
ChildProcessInitializationParameters. And even if we did add a boolean
to this structure and added support for conveying it through the XPC
port, it would end up being a Plugin process-only boolean in a general
parameter block, which seems asymmetric with the other processes.
Second, there's no convenient Cocoa function called in the flow that
spawns the Plugin process, meaning that there's no convenient place to
call NSUserDefaults to get the flag's value. And third, the Plugin
process doesn't elegantly respond to the memory pressure trigger
anyway. It might terminate itself, but that's it. As for the Database
process, it doesn't seem to support responding to memory pressure at
all, so we don't send it a flag telling it to ignore it.

Internally, the memory pressure handler is suppressed by not calling
MemoryPressureHandler::install() if the flag is set. In the case of
the Network process, the flag is saved so that it can be checked later
in other places that manually kick off the memory pressure handling
procedure.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(WebInstallMemoryPressureHandler):

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

4 years agoGet rid of WKPluginSiteDataManager
andersca@apple.com [Mon, 22 Feb 2016 18:22:27 +0000 (18:22 +0000)]
Get rid of WKPluginSiteDataManager
https://bugs.webkit.org/show_bug.cgi?id=154470

Reviewed by Tim Horton.

* Shared/API/c/WKBase.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextGetPluginSiteDataManager): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKPluginSiteDataManager.cpp: Removed.
(WKPluginSiteDataManagerGetTypeID): Deleted.
(WKPluginSiteDataManagerGetSitesWithData): Deleted.
(WKPluginSiteDataManagerClearSiteData): Deleted.
(WKPluginSiteDataManagerClearAllSiteData): Deleted.
* UIProcess/API/C/WKPluginSiteDataManager.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoRebaseline tests for ios-simulator after W3C HTML/DOM re-sync in r196883
ryanhaddad@apple.com [Mon, 22 Feb 2016 18:03:22 +0000 (18:03 +0000)]
Rebaseline tests for ios-simulator after W3C HTML/DOM re-sync in r196883

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:

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

4 years agoRebaseline imported/w3c/web-platform-tests/html/dom/reflection-forms.html for ios...
ryanhaddad@apple.com [Mon, 22 Feb 2016 18:01:38 +0000 (18:01 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/reflection-forms.html for ios-simulator after r196893

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:

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

4 years ago[WK2][Mac] Allow processes to set "fast-dev-casheable" bit
bfulgham@apple.com [Mon, 22 Feb 2016 17:50:35 +0000 (17:50 +0000)]
[WK2][Mac] Allow processes to set "fast-dev-casheable" bit
https://bugs.webkit.org/show_bug.cgi?id=154503
<rdar://problem/22920815>

Reviewed by Alexey Proskuryakov.

Update the various sandbox profiles with a declaration that using the
system-fctl to touch the "hot file" flag (to support caching operations)
is allowed.

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Add sandbox permission.
* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Ditto.
* WebProcess/com.apple.WebProcess.sb.in: Ditto.

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

4 years agoFixed compilation of bmalloc with GCC 4.8 after r196873.
commit-queue@webkit.org [Mon, 22 Feb 2016 17:34:37 +0000 (17:34 +0000)]
Fixed compilation of bmalloc with GCC 4.8 after r196873.
https://bugs.webkit.org/show_bug.cgi?id=154534

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Mark Lam.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55382.

* bmalloc/LargeChunk.h:
* bmalloc/SmallChunk.h:

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

4 years agoUnreviewed, rolling out r196891.
commit-queue@webkit.org [Mon, 22 Feb 2016 17:03:59 +0000 (17:03 +0000)]
Unreviewed, rolling out r196891.
https://bugs.webkit.org/show_bug.cgi?id=154539

it broke Production builds (Requested by brrian on #webkit).

Reverted changeset:

"Web Inspector: add 'Automation' protocol domain and generate
its backend classes separately in WebKit2"
https://bugs.webkit.org/show_bug.cgi?id=154509
http://trac.webkit.org/changeset/196891

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

4 years agoREGRESSION (r196620): Web Inspector: Filter bar in the left sidebar is 1px shorter...
nvasilyev@apple.com [Mon, 22 Feb 2016 16:36:57 +0000 (16:36 +0000)]
REGRESSION (r196620): Web Inspector: Filter bar in the left sidebar is 1px shorter than the console prompt
https://bugs.webkit.org/show_bug.cgi?id=154529

Reviewed by Timothy Hatcher.

* UserInterface/Views/NavigationSidebarPanel.css:
(.sidebar > .panel.navigation > .overflow-shadow):

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

4 years agoEnable AVFoundationNSURLSessionEnabled by default
jer.noble@apple.com [Mon, 22 Feb 2016 15:59:36 +0000 (15:59 +0000)]
Enable AVFoundationNSURLSessionEnabled by default
https://bugs.webkit.org/show_bug.cgi?id=154469

Reviewed by Sam Weinig.

Source/WebCore:

* page/Settings.cpp:

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:

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

4 years ago[css-grid] Swap columns and rows in grid-template shorthand
rego@igalia.com [Mon, 22 Feb 2016 14:08:41 +0000 (14:08 +0000)]
[css-grid] Swap columns and rows in grid-template shorthand
https://bugs.webkit.org/show_bug.cgi?id=154472

Reviewed by Darin Adler.

The spec was modified past December to change the order of
columns and rows in the grid-template shorthand:
https://github.com/w3c/csswg-drafts/commit/f6c7691679a519017a80ebae44fd86c3eae5c5f9

Updated the parsing and modified the tests to follow the new syntax.

Source/WebCore:

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateColumns):
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSParser::parseGridTemplateShorthand):
(WebCore::CSSParser::parseGridTemplateRowsAndAreas): Renamed to
parseGridTemplateRowsAndAreasAndColumns().
* css/CSSParser.h:

LayoutTests:

* fast/css-grid-layout/absolute-positioning-definite-sizes.html:
* fast/css-grid-layout/flex-content-distribution.html:
* fast/css-grid-layout/grid-align-content-vertical-lr.html:
* fast/css-grid-layout/grid-align-content-vertical-rl.html:
* fast/css-grid-layout/grid-align-content.html:
* fast/css-grid-layout/grid-gutters-and-alignment.html:
* fast/css-grid-layout/grid-gutters-and-flex-content.html:
* fast/css-grid-layout/grid-gutters-and-tracks.html:
* fast/css-grid-layout/grid-justify-content-vertical-lr.html:
* fast/css-grid-layout/grid-justify-content-vertical-rl.html:
* fast/css-grid-layout/grid-justify-content.html:
* fast/css-grid-layout/grid-shorthand-get-set.html:
* fast/css-grid-layout/grid-template-shorthand-get-set.html:
* fast/css-grid-layout/relayout-align-items-changed.html:
* fast/css-grid-layout/relayout-align-self-changed.html:
* fast/css-grid-layout/relayout-indefinite-heights.html:
* fast/css-grid-layout/relayout-justify-items-changed.html:
* fast/css-grid-layout/relayout-justify-self-changed.html:
* fast/repaint/align-items-overflow-change.html:
* fast/repaint/align-self-change.html:
* fast/repaint/align-self-overflow-change.html:
* fast/repaint/justify-items-change.html:
* fast/repaint/justify-items-overflow-change.html:
* fast/repaint/justify-self-change.html:
* fast/repaint/justify-self-overflow-change.html:

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

4 years ago[css-grid] Swap columns and rows in grid shorthand
rego@igalia.com [Mon, 22 Feb 2016 09:01:45 +0000 (09:01 +0000)]
[css-grid] Swap columns and rows in grid shorthand
https://bugs.webkit.org/show_bug.cgi?id=154449

Reviewed by Darin Adler.

The spec was modified past December to change the order of
columns and rows in the grid shorthand:
https://github.com/w3c/csswg-drafts/commit/7454c7c8c5857b61bbbe2ee5f07803c264bf37e4

Updated the parsing and modified the tests to follow the new syntax.

Source/WebCore:

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridShorthand):

LayoutTests:

* fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-shorthand-get-set.html:

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

4 years agoBinding generator should support key value iterable
youenn.fablet@crf.canon.fr [Mon, 22 Feb 2016 08:31:14 +0000 (08:31 +0000)]
Binding generator should support key value iterable
https://bugs.webkit.org/show_bug.cgi?id=154413

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/headers/headers-basic-expected.txt:
* web-platform-tests/fetch/api/headers/headers-basic.html:

Source/WebCore:

Covered by added layout and binding tests.

iterable<key, value> in a IDL file will trigger the generation of entries, keys, values, [Symbol.iterator] and forEach methods to the prototype.
Updated FetchHeaders and FontFaceSet to use it.

IDLParser.pm parses the iterable<> and adds an iterable field in the interface containing the iterable information and objects for the five operations.
IDLParser.pm is cleaned up a bit to remove previous Iterator support, which does not seem to be supported.

CodeGeneratorJS.pm is updated to generate the code for the five operations, using JSKeyValueIterator. Set iterators are not yet supported.
Moved definition of Iterator Key and Value Type to binding generated JSXX class based on iterable<> declaration in the IDL.

Added binding test and Fetch Headers tests.

* CMakeLists.txt:
* Modules/fetch/FetchHeaders.idl:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSFetchHeadersCustom.cpp: Removed.
* bindings/js/JSFontFaceSetCustom.cpp:
(WebCore::JSFontFaceSet::ready): Removed iterable custom methods.
* bindings/js/JSKeyValueIterator.h:
(WebCore::createKeyValueIterator):
(WebCore::keyValueIteratorForEach):
* bindings/scripts/CodeGeneratorJS.pm:
(GetFunctionName):
(PrototypeFunctionCount):
(PrototypePropertyCount):
(GeneratePropertiesHashTable):
(GenerateImplementation):
(GenerateImplementationFunctionCall):
(GenerateImplementationIterableFunctions):
* bindings/scripts/IDLParser.pm:
(parseOperationOrIterator):
(parseOperationOrIteratorRest):
(parseIterableRest):
(parseOptionalIterableInterface):
(applyMemberList):
(parseSpecial): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionSymbolIterator):
(WebCore::jsTestObjPrototypeFunctionEntries):
(WebCore::jsTestObjPrototypeFunctionKeys):
(WebCore::jsTestObjPrototypeFunctionValues):
(WebCore::jsTestObjPrototypeFunctionForEach):
* bindings/scripts/test/TestObj.idl:
* css/FontFaceSet.idl:

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

4 years agoCodeBlock always visits its unlinked code twice
commit-queue@webkit.org [Mon, 22 Feb 2016 07:29:35 +0000 (07:29 +0000)]
CodeBlock always visits its unlinked code twice
https://bugs.webkit.org/show_bug.cgi?id=154494

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-21
Reviewed by Saam Barati.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitChildren):
The unlinked code is always visited in stronglyVisitStrongReferences.

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

4 years agoUnreviewed, rebaseline html/dom/interfaces.html.
cdumez@apple.com [Mon, 22 Feb 2016 06:30:35 +0000 (06:30 +0000)]
Unreviewed, rebaseline html/dom/interfaces.html.

* web-platform-tests/html/dom/interfaces-expected.txt:

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

4 years agoHTMLScriptElement.crossOrigin / HTMLImageElement.crossOrigin should only return known...
cdumez@apple.com [Mon, 22 Feb 2016 06:28:42 +0000 (06:28 +0000)]
HTMLScriptElement.crossOrigin / HTMLImageElement.crossOrigin should only return known values
https://bugs.webkit.org/show_bug.cgi?id=154502

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/reflection-embedded-expected.txt:
* web-platform-tests/html/dom/reflection-misc-expected.txt:

Source/WebCore:

HTMLScriptElement.crossOrigin / HTMLImageElement.crossOrigin should only
return known values and should be nullable as per the specification:
- https://html.spec.whatwg.org/multipage/scripting.html#attr-script-crossorigin
- https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-crossorigin
- https://html.spec.whatwg.org/multipage/infrastructure.html#cors-settings-attribute

This aligns our behavior with the HTML specification and Firefox.

No new tests, already covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
Add support for nullable DOMString attributes. If such attribute is
marked as nullable:
- A null string is passed to the implementation if the setter is called
  with null/undefined.
- null is returned to the Javascript if the getter implementation
  returns a null string.

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
* bindings/scripts/test/TestObj.idl:
Add test coverage for nullable DOMString attributes
and rebaseline bindings tests.

* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLImageElement.idl:
* html/HTMLScriptElement.cpp:
* html/HTMLScriptElement.h:
* html/HTMLScriptElement.idl:
* html/parser/HTMLParserIdioms.cpp:
* html/parser/HTMLParserIdioms.h:

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

4 years agoMake HTMLSelectElement.size behave as per the specification
cdumez@apple.com [Mon, 22 Feb 2016 05:52:07 +0000 (05:52 +0000)]
Make HTMLSelectElement.size behave as per the specification
https://bugs.webkit.org/show_bug.cgi?id=154504

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/reflection-forms-expected.txt:
* web-platform-tests/html/dom/reflection-tabular-expected.txt:

Source/WebCore:

Make HTMLSelectElement.size behave as per the specification:
- https://html.spec.whatwg.org/#htmlselectelement
- https://html.spec.whatwg.org/#dom-select-size
- https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes:idl-unsigned-long

In particular, it should be unsigned and be in the range [0; 2147483647].

Also update several unsigned long attributes in our HTML implementation to use
parseHTMLNonNegativeInteger() to parse unsigned integers as per the HTML
specification, instead of calling String::toUint().

No new tests, already covered by existing tests.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::size):
(WebCore::HTMLInputElement::setSize):
* html/HTMLInputElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute):
(WebCore::HTMLSelectElement::setSize):
(WebCore::HTMLSelectElement::namedItem): Deleted.
(WebCore::HTMLSelectElement::item): Deleted.
* html/HTMLSelectElement.h:
(WebCore::HTMLSelectElement::size):
* html/HTMLSelectElement.idl:
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::parseAttribute):
(WebCore::HTMLTableColElement::setSpan):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::parseAttribute):
(WebCore::HTMLTextAreaElement::setCols):
(WebCore::HTMLTextAreaElement::setRows):
* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
(WebCore::limitToOnlyHTMLNonNegative):

LayoutTests:

Update test that was covering the case of an HTMLSelectElement with an
invalid size attribute. The test was expecting the bad "size" attribute
value to get corrected so that the select element looks like a menu list.
This workaround was added back in 2007 to workaround a bug on
www.chainreaction.com (rdar://problem/4697438). This patch drops the
workaround in HTMLSelectElement::parseAttribute() because:
1. This is not standard behavior as per the HTML specification
2. This behavior does not match Firefox either
3. The workaround is no longer needed for www.chainreaction.com.

* fast/forms/select-size-expected.html: Added.
* fast/forms/select-size.html:
* platform/efl/fast/forms/select-size-expected.txt: Removed.
* platform/gtk/fast/forms/select-size-expected.txt: Removed.
* platform/ios-simulator/fast/forms/select-size-expected.txt: Removed.
* platform/mac/fast/forms/select-size-expected.png: Removed.
* platform/mac/fast/forms/select-size-expected.txt: Removed.
* platform/win/fast/forms/select-size-expected.txt: Removed.

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

4 years agoCSP: Enable form-action directive by default
dbates@webkit.org [Mon, 22 Feb 2016 05:26:17 +0000 (05:26 +0000)]
CSP: Enable form-action directive by default
https://bugs.webkit.org/show_bug.cgi?id=154520
<rdar://problem/24762029>

Reviewed by Sam Weinig.

Source/WebCore:

* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the form-action
directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.
(WebCore::isExperimentalDirectiveName): Remove form-action from the directives considered
experimental.

LayoutTests:

Mark form-action tests as Pass so that we run them.

* TestExpectations:

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

4 years agoWeb Inspector: add 'Automation' protocol domain and generate its backend classes...
bburg@apple.com [Mon, 22 Feb 2016 04:49:29 +0000 (04:49 +0000)]
Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=154509
<rdar://problem/24759098>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Add a new 'WebKit' framework, which is used to generate protocol code
in WebKit2.

Add --backend and --frontend flags to the main generator script.
These allow a framework to trigger two different sets of generators
so they can be separately generated and compiled.

* inspector/scripts/codegen/models.py:
(Framework.fromString):
(Frameworks): Add new framework.

* inspector/scripts/generate-inspector-protocol-bindings.py:
If neither --backend or --frontend is specified, assume both are wanted.
This matches the behavior for JavaScriptCore and WebInspector frameworks.

(generate_from_specification):
Generate C++ files for the backend and Objective-C files for the frontend.

Source/WebKit2:

Add a new 'Automation' domain which presents an RPC interface
for sending automation commands to an active WebAutomationSession
in the UIProcess via RemoteInspector. This is similar to how the
Inspector backend communicates bidirectionally with a remote
Inspector frontend.

Add build system logic to generate JSON-RPC protocol bindings
for the 'Automation' domain using the inspector code generators.

Move automation-related files that are not API or SPI into their
own directory.

* Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
private headers are, since that's where the code generators live.

* CMakeLists.txt: Look in UIProcess/Automation directory.
* PlatformMac.cmake:
* DerivedSources.make: Generate protocol bindings for a single domain.
The names of the generated files will be improved in a follow-up patch
so that they do not clash with generated files in JavaScriptCore.

* UIProcess/Automation/Automation.json: Added.
* UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::~WebAutomationSession):
Set up a backend dispatcher and frontend router. They will be used later.

(WebKit::WebAutomationSession::dispatchMessageFromRemote):
Forward messages from the remote to the backend dispatcher. When
an agent / command handler is registered, it will receive the message.

(WebKit::WebAutomationSession::connect):
(WebKit::WebAutomationSession::disconnect):
Connenct and disconnect the frontend router to the remote channel.

* UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
* WebKit2.xcodeproj/project.pbxproj: Add and move files.

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

4 years agoAdd username / password attributes to HTMLAnchorElement / HTMLAreaElement
cdumez@apple.com [Mon, 22 Feb 2016 03:28:55 +0000 (03:28 +0000)]
Add username / password attributes to HTMLAnchorElement / HTMLAreaElement
https://bugs.webkit.org/show_bug.cgi?id=154519

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Add username / password attributes to HTMLAnchorElement / HTMLAreaElement as per:
https://html.spec.whatwg.org/#htmlhyperlinkelementutils

Firefox and Chrome already implement these.

Also stop treating null as the empty string for the HTMLHyperlinkElementUtils
attributes. This behavior does not match the specification or other browsers
(tested Firefox and Chrome).

Test: fast/dom/HTMLAnchorElement/set-href-attribute-user-pass.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::username):
(WebCore::HTMLAnchorElement::setUsername):
(WebCore::HTMLAnchorElement::password):
(WebCore::HTMLAnchorElement::setPassword):
* html/HTMLAnchorElement.h:
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLHyperlinkElementUtils.idl: Added.

LayoutTests:

* fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hash.js:
* fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-host.js:
* fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-hostname.js:
* fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-pathname.js:
* fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-protocol.js:
* fast/dom/HTMLAnchorElement/script-tests/set-href-attribute-search.js:
* fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt:
* fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt:
* fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt:
* fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt:
* fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt:
* fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt:
Update / rebaseline tests now that we no longer treat null as the empty string.

* fast/dom/HTMLAnchorElement/set-href-attribute-user-pass-expected.txt: Added.
* fast/dom/HTMLAnchorElement/set-href-attribute-user-pass.html: Added.
Add test coverage for setting the username / password attributes.

* js/dom/dom-static-property-for-in-iteration-expected.txt:
Rebaseline now that HTMLAnchorElement / HTMLAreaElement have 2 additional
attributes: username and password.

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

4 years agoiframe/frame/object.contentDocument should be on the prototype
cdumez@apple.com [Mon, 22 Feb 2016 03:27:44 +0000 (03:27 +0000)]
iframe/frame/object.contentDocument should be on the prototype
https://bugs.webkit.org/show_bug.cgi?id=154409

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Move iframe/frame/object.contentDocument to the prototype. They used
to be on the instance due to the [CheckSecurityForNode] IDL extended
attribute. This patch updates the bindings generator so that such
attributes are now on the prototype. While they are now on the
prototype, the security checks are still generated in the
corresponding getters and setters so cross origin access is still
prevented.

Test: http/tests/security/cross-origin-iframe-contentDocument.html

* bindings/scripts/CodeGeneratorJS.pm:
(AttributeShouldBeOnInstance): Deleted.

LayoutTests:

Add test coverage for trying to access iframe.contentDocument cross origin
to make sure it still fails and logs a security error.

* http/tests/security/cross-origin-iframe-contentDocument-expected.txt: Added.
* http/tests/security/cross-origin-iframe-contentDocument.html: Added.

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

4 years agoRefactor LazyEventListener creation to separate Element and Document cases
darin@apple.com [Mon, 22 Feb 2016 02:33:29 +0000 (02:33 +0000)]
Refactor LazyEventListener creation to separate Element and Document cases
https://bugs.webkit.org/show_bug.cgi?id=154231

Reviewed by Andreas Kling.

Source/WebCore:

* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::create): Added. Newly factored to separate
Element, Document, and DOMWindow with overloading.
(WebCore::JSLazyEventListener::createForNode): Deleted.
(WebCore::JSLazyEventListener::createForDOMWindow): Deleted.

* bindings/js/JSLazyEventListener.h: Replaced the separate createForNode
and createForDOMWindow functions with a single overloaded function create,
which takes an Element, Document, or DOMWindow. Also changed indentation
to match the style guide.

* dom/Attr.h: Added newly needed forward class declaration.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::setAttributeEventListener): Deleted.
* dom/ContainerNode.h: Deleted setAttributeEventListener override; it's now
done separately by Element and Document.

* dom/Document.cpp:
(WebCore::Document::setAttributeEventListener): Added. Makes the lazy event
listener and calls through to the base class's setAttributeEventListener.
(WebCore::Document::setWindowAttributeEventListener): Updated to call just
create instead of createForDOMWindow.

* dom/Document.h: Removed some unneeded forward declarations. Added the
overload for setAttributeEventListener. Removed a no longer useful comment.

* dom/Element.cpp:
(WebCore::Element::setAttributeEventListener): Added. Makes the lazy event
listener and calls through to the base class's setAttributeEventListener.

* dom/Element.h: Removed some unneeded forward declarations. Added the
overload for setAttributeEventListener.

* dom/Node.h: Removed many unneeded forward declarations.

* dom/NodeRareData.h: Added one forward declaration.

* editing/Editor.h: Added one forward declaration.

Source/WebKit/win:

* WebView.h: Forward declare KeyboardEvent.

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

4 years agoImprovements to Intl code
sukolsak@gmail.com [Mon, 22 Feb 2016 01:55:41 +0000 (01:55 +0000)]
Improvements to Intl code
https://bugs.webkit.org/show_bug.cgi?id=154486

Reviewed by Darin Adler.

This patch does several things:
- Use std::unique_ptr to store ICU objects.
- Pass Vector::size() to ICU functions that take a buffer size instead
  of Vector::capacity().
- If U_SUCCESS(status) is true, it means there is no error, but there
  could be warnings. ICU functions ignore warnings. So, there is no need
  to reset status to U_ZERO_ERROR.
- Remove the initialization of the String instance variables of
  IntlDateTimeFormat. These values are never read and cause unnecessary
  memory allocation.
- Fix coding style.
- Some small optimization.

* runtime/IntlCollator.cpp:
(JSC::IntlCollator::UCollatorDeleter::operator()):
(JSC::IntlCollator::createCollator):
(JSC::IntlCollator::compareStrings):
(JSC::IntlCollator::~IntlCollator): Deleted.
* runtime/IntlCollator.h:
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::UDateFormatDeleter::operator()):
(JSC::defaultTimeZone):
(JSC::canonicalizeTimeZoneName):
(JSC::toDateTimeOptionsAnyDate):
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::weekdayString):
(JSC::IntlDateTimeFormat::format):
(JSC::IntlDateTimeFormat::~IntlDateTimeFormat): Deleted.
(JSC::localeData): Deleted.
* runtime/IntlDateTimeFormat.h:
* runtime/IntlDateTimeFormatConstructor.cpp:
* runtime/IntlNumberFormatConstructor.cpp:
* runtime/IntlObject.cpp:
(JSC::numberingSystemsForLocale):

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

4 years agoRemove arrowfunction test cases that rely on arguments variable in jsc
commit-queue@webkit.org [Mon, 22 Feb 2016 01:45:45 +0000 (01:45 +0000)]
Remove arrowfunction test cases that rely on arguments variable in jsc
https://bugs.webkit.org/show_bug.cgi?id=154517

Patch by Skachkov Oleksandr <gskachkov@gmail.com> on 2016-02-21
Reviewed by Yusuke Suzuki.

Allow to jsc has the same behavior in javascript as browser has

* tests/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js:
* tests/stress/arrowfunction-lexical-bind-arguments-strict.js:

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

4 years agoCSP: sandbox directive should be ignored when contained in a policy defined via a...
dbates@webkit.org [Mon, 22 Feb 2016 01:30:43 +0000 (01:30 +0000)]
CSP: sandbox directive should be ignored when contained in a policy defined via a meta element
https://bugs.webkit.org/show_bug.cgi?id=154299
<rdar://problem/24680433>

Add iOS Simulator-specific expected result for test http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe.html.

* platform/ios-simulator/http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe-expected.txt: Added.

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

4 years agoAdding ios-simulator baseline for js/number-toLocaleString.html
ryanhaddad@apple.com [Mon, 22 Feb 2016 01:29:43 +0000 (01:29 +0000)]
Adding ios-simulator baseline for js/number-toLocaleString.html
https://bugs.webkit.org/show_bug.cgi?id=154524

Unreviewed test gardening.

* platform/ios-simulator/js/number-toLocaleString-expected.txt: Added.

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

4 years agoRe-sync W3C HTML/DOM web-platform-tests
cdumez@apple.com [Mon, 22 Feb 2016 01:27:43 +0000 (01:27 +0000)]
Re-sync W3C HTML/DOM web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=154513

Reviewed by Darin Adler.

Re-sync W3C HTML/DOM web-platform-tests after:
- https://github.com/w3c/web-platform-tests/pull/2597
- https://github.com/w3c/web-platform-tests/pull/2598
- https://github.com/w3c/web-platform-tests/pull/2599

* web-platform-tests/html/dom/elements-embedded.js:
* web-platform-tests/html/dom/elements-misc.js:
* web-platform-tests/html/dom/interfaces.html:
* web-platform-tests/html/dom/reflection-embedded-expected.txt:
* web-platform-tests/html/dom/reflection-misc-expected.txt:
* web-platform-tests/html/dom/reflection.js:
(ReflectionTests.doReflects):

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

4 years agoRebaseline imported/w3c/web-platform-tests/html/dom/reflection-forms.html for ios...
ryanhaddad@apple.com [Mon, 22 Feb 2016 01:23:07 +0000 (01:23 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/reflection-forms.html for ios-simulator after r196846

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:

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

4 years agoWeb Inspector: it should be possible to omit generated code guarded by INSPECTOR_ALTE...
bburg@apple.com [Mon, 22 Feb 2016 00:08:37 +0000 (00:08 +0000)]
Web Inspector: it should be possible to omit generated code guarded by INSPECTOR_ALTERNATE_DISPATCHERS
https://bugs.webkit.org/show_bug.cgi?id=154508
<rdar://problem/24759077>

Reviewed by Timothy Hatcher.

In preparation for being able to generate protocol files for WebKit2,
make it possible to not emit generated code that's guarded by
ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS). This code is not needed by
backend dispatchers generated outside of JavaScriptCore. We can't just
define it to 0 for WebKit2, since it's defined to 1 in <wtf/Platform.h>
in the configurations where the code is actually used.

Add a new opt-in Framework configuration option that turns on generating
this code. Adjust how the code is generated so that it can be easily excluded.

* inspector/scripts/codegen/cpp_generator_templates.py:
Make a separate template for the declarations that are guarded.
Add an initializer expression so the order of initalizers doesn't matter.

* inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py:
(CppBackendDispatcherHeaderGenerator.generate_output): Add a setting check.
(CppBackendDispatcherHeaderGenerator._generate_dispatcher_declarations_for_domain):
If the declarations are needed, they will be appended to the end of the
declarations list.

* inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py:
(CppBackendDispatcherImplementationGenerator.generate_output): Add a setting check.
(CppBackendDispatcherImplementationGenerator._generate_dispatcher_implementation_for_command): Add a setting check.

* inspector/scripts/codegen/models.py: Set the 'alternate_dispatchers' setting
to True for Framework.JavaScriptCore only. It's not needed elsewhere.

Rebaseline affected tests.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:

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

4 years agoWeb Inspector: clean up generator selection in generate-inspector-protocol-bindings.py
bburg@apple.com [Mon, 22 Feb 2016 00:05:07 +0000 (00:05 +0000)]
Web Inspector: clean up generator selection in generate-inspector-protocol-bindings.py
https://bugs.webkit.org/show_bug.cgi?id=154505
<rdar://problem/24758042>

Reviewed by Timothy Hatcher.

It should be possible to generate code for a framework using some generators
that other frameworks also use. Right now the generator selection code assumes
that use of a generator is mutually exclusive among non-test frameworks.

Make this code explicitly switch on the framework. Reorder generators
alpabetically within each case.

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):

Rebaseline tests that are affected by generator reorderings.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

4 years agoAnother attempt to fix the Content Extension test failures following <https://trac...
dbates@webkit.org [Sun, 21 Feb 2016 23:02:37 +0000 (23:02 +0000)]
Another attempt to fix the Content Extension test failures following <https://trac.webkit.org/changeset/196875>
(https://bugs.webkit.org/show_bug.cgi?id=154307)

Rename Content Extension JSON files so that they are associated with tests http/tests/contentextensions/block-cookies-in-csp-report.php
http/tests/contentextensions/block-csp-report.php and http/tests/contentextensions/hide-on-csp-report.php. These
files were formerly named block-cookies-in-csp-report.html, block-csp-report.html, and hide-on-csp-report.html,
respectively, prior to <https://trac.webkit.org/changeset/196878>. Also, update expected result for test block-csp-report.html
following <https://trac.webkit.org/changeset/196878>.

* http/tests/contentextensions/block-cookies-in-csp-report.php.json: Renamed from LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.json.
* http/tests/contentextensions/block-csp-report-expected.txt:
* http/tests/contentextensions/block-csp-report.php.json: Renamed from LayoutTests/http/tests/contentextensions/block-csp-report.html.json.
* http/tests/contentextensions/hide-on-csp-report.php.json: Renamed from LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.json.

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

4 years agoAttempt to fix the Content Extension test failures following <https://trac.webkit...
dbates@webkit.org [Sun, 21 Feb 2016 21:37:42 +0000 (21:37 +0000)]
Attempt to fix the Content Extension test failures following <https://trac.webkit.org/changeset/196875>
(https://bugs.webkit.org/show_bug.cgi?id=154307)

Convert Content Extension tests that use the Content Security Policy directive report-uri from HTML files
to PHP scripts and modified them to define the content security policy for the page via the Content-Security-Policy
HTTP header instead of via a meta element so that the report-uri directive is honored. Following
<https://trac.webkit.org/changeset/196875> the directive report-uri is only honored when contained in a
policy that is delivered via an HTTP header. That is, it is no longer honored when delivered in a meta element.

* http/tests/contentextensions/block-cookies-in-csp-report.php: Renamed from LayoutTests/http/tests/contentextensions/block-cookies-in-csp-report.html.
* http/tests/contentextensions/block-csp-report.php: Renamed from LayoutTests/http/tests/contentextensions/block-csp-report.html.
* http/tests/contentextensions/hide-on-csp-report.php: Renamed from LayoutTests/http/tests/contentextensions/hide-on-csp-report.html.

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

4 years agoCSP: Violation report should include column number
dbates@webkit.org [Sun, 21 Feb 2016 19:51:43 +0000 (19:51 +0000)]
CSP: Violation report should include column number
https://bugs.webkit.org/show_bug.cgi?id=154418
<rdar://problem/24729525>

Reviewed by Brent Fulgham.

Source/WebCore:

Include column-number in the Content Security Policy violation report for the column number
in the source script where the violation occurred (for a script violation) as per section
Reporting of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

When a CSP report is created for a script violation the source file and line number of the
source code line where the violation occurred are included in the report. We now include
the column number in the source file where the violation occurred so as to help narrow
down the operation that triggered the violation in a complicated source code line.

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation):

LayoutTests:

Update expected results to include source file column information where the violation occurred.

* http/tests/security/contentSecurityPolicy/report-blocked-file-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-javascript-expected.txt:

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

4 years agoCSP: Violation report should include HTTP status code and effective-directive of...
dbates@webkit.org [Sun, 21 Feb 2016 19:45:47 +0000 (19:45 +0000)]
CSP: Violation report should include HTTP status code and effective-directive of protected resource
https://bugs.webkit.org/show_bug.cgi?id=154288
<rdar://problem/24674982>
And
https://bugs.webkit.org/show_bug.cgi?id=115707
<rdar://problem/24383128>

Reviewed by Brent Fulgham.

Source/WebCore:

Include status-code and effective-directive in the Content Security Policy violation report for
the HTTP status code of the protected resource and name of the policy directive that was violated,
respectively, as per section Reporting of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

Test: http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation): Add key status-code to the report with value
equal to the HTTP response code for the document or 0 depending on whether the document was
delivered over HTTP or not. Additionally, remove ENABLE(CSP_NEXT)-guard/experimentalFeaturesEnabled()-condition
around code to include the effective-directive property in the report.

LayoutTests:

Add new test http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html to ensure
that the CSP report property status-code is 0 when the protected document is delivered over HTTPS. Fix a
correctness issue in the result for test http/tests/security/contentSecurityPolicy/report-blocked-file-uri.html
and update the expected results for the following tests now that the CSP violation report includes properties
status-code and effective-directive:
    http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php
    http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php
    http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php
    http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php

The rest of the changes to the expected results are cosmetic and reflect the difference in wording for inline
script violations between WebKit and Blink. We will consider adopting wording similar to Blink in
<https://bugs.webkit.org/show_bug.cgi?id=153242>.

* TestExpectations: Remove entries for tests that now pass. Add test http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive.php.
* http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/report-uri-effective-directive.html. The report-uri
directive is only honored when defined in a policy delivered via an HTTP header. We convert this
HTML file to a PHP script to be able to deliver a Content-Security-Policy HTTP header.
* http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-data-uri-expected.txt: Cosmetic change.
* http/tests/security/contentSecurityPolicy/report-blocked-file-uri-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-blocked-uri-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt: Update expected result now
that the report includes properties status-code and effective-directive.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-only-expected.txt: Cosmetic change.
* http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled-expected.txt: Update expected result now
that the report includes properties status-code and effective-directive.
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-expected.txt: Cosmetic change.
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt: Update expected result now
that the report includes properties status-code and effective-directive.
* http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html: Added.
* http/tests/security/contentSecurityPolicy/report-uri-expected.txt: Cosmetic change.
* http/tests/security/contentSecurityPolicy/report-uri-from-child-frame-expected.txt: Cosmetic change.
* http/tests/security/contentSecurityPolicy/report-uri-from-child-frame.html: Fix ill-formed markup; substitute </iframe> for </script>.
* http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript-expected.txt: Cosmetic change.
* http/tests/security/contentSecurityPolicy/report-uri-from-javascript-expected.txt: Ditto.
* http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt: Ditto.

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

4 years agoCSP: report-url directive should be ignored when contained in a policy defined via...
dbates@webkit.org [Sun, 21 Feb 2016 19:04:15 +0000 (19:04 +0000)]
CSP: report-url directive should be ignored when contained in a policy defined via a meta element
https://bugs.webkit.org/show_bug.cgi?id=154307
<rdar://problem/24684817>

Reviewed by Brent Fulgham.

Source/WebCore:

The Content Security Policy report-uri directive should only be honored when defined via an HTTP header
as per section report-uri of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

Currently we honor the report-uri directive when enforcing or monitoring a policy defined either via
an HTML meta element or an HTTP header. Instead we should only honor this directive when defined
via an HTTP header and log a message to the Web Inspector console to explain that the directive
was ignored as suggested in <https://www.w3.org/TR/2015/CR-CSP2-20150721/#delivery-html-meta-element>.

Test: http/tests/security/contentSecurityPolicy/report-uri-in-meta-tag-ignored.html

* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::parse): Modified to ignore the directive report-uri when
the Content Security Policy came from an HTML meta element.

LayoutTests:

Add new test http/tests/security/contentSecurityPolicy/report-uri-in-meta-tag-ignored.html and rename and modify
existing tests to make them PHP scripts that emit a Content Security Policy HTTP header.

In addition, remove file http/tests/security/contentSecurityPolicy/resources/generate-csp-report.html that
is no longer meaningful now that we do not honor the report-uri directive defined in a policy via a meta
element. Moreover, we have not made use of this file since <http://trac.webkit.org/changeset/176413>.

* TestExpectations: Update entries for renames.
* http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt:
* http/tests/security/contentSecurityPolicy/report-and-enforce.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-and-enforce.html.
* http/tests/security/contentSecurityPolicy/report-blocked-data-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-data-uri.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-data-uri.html.
* http/tests/security/contentSecurityPolicy/report-blocked-file-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-file-uri.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-file-uri.html.
* http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin.html.
* http/tests/security/contentSecurityPolicy/report-blocked-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-uri.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-blocked-uri.html.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.html.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.html.
* http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.html.
* http/tests/security/contentSecurityPolicy/report-only-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-only.html.
* http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.html.
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled-expected.txt:
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.html.
* http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.html.
* http/tests/security/contentSecurityPolicy/report-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-inline-javascript.html.
* http/tests/security/contentSecurityPolicy/report-uri-from-javascript-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-from-javascript.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-uri-from-javascript.html.
* http/tests/security/contentSecurityPolicy/report-uri-in-meta-tag-ignored-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/report-uri-in-meta-tag-ignored.html: Added.
* http/tests/security/contentSecurityPolicy/report-uri-scheme-relative-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-scheme-relative.html: Removed.
* http/tests/security/contentSecurityPolicy/report-uri-scheme-relative.php: Added.
* http/tests/security/contentSecurityPolicy/report-uri.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/report-uri.html.
* http/tests/security/contentSecurityPolicy/resources/generate-csp-report.html: Removed. For completeness, we have
not made use of this file since <http://trac.webkit.org/changeset/176413>.
* http/tests/security/contentSecurityPolicy/resources/generate-csp-report.php:
* http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/user-style-sheet-font-crasher.html.
* platform/wk2/TestExpectations: Update entries for renames.

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

4 years agoCSP: sandbox directive should be ignored when contained in a policy defined via a...
dbates@webkit.org [Sun, 21 Feb 2016 18:52:51 +0000 (18:52 +0000)]
CSP: sandbox directive should be ignored when contained in a policy defined via a meta element
https://bugs.webkit.org/show_bug.cgi?id=154299
<rdar://problem/24680433>

Reviewed by Brent Fulgham.

Source/WebCore:

The Content Security Policy sandbox directive should only be honored when enforcing a policy
defined via an HTTP header as per section sandbox of the Content Security Policy 2.0 spec.,
<https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

Currently we honor the sandbox directive when enforcing a policy defined either via an HTML
meta element or an HTTP header. Instead we should only honor this directive when defined
via an HTTP header and log a message to the Web Inspector console to explain that the directive
was ignored as suggested in <https://www.w3.org/TR/2015/CR-CSP2-20150721/#delivery-html-meta-element>.

Tests: http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header2.php
       http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe.php
       http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header.php
       http/tests/security/contentSecurityPolicy/sandbox-in-meta-tag-ignored.html

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Substitute ContentSecurityPolicy::processHTTPEquiv() for
ContentSecurityPolicy::didReceiveHeader() as the latter was made private.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::copyStateFrom): Updated as needed based on ContentSecurityPolicy::didReceiveHeader() change below.
(WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
(WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take argument of type ContentSecurityPolicy::PolicyFrom
and pass it through to ContentSecurityPolicyDirectiveList::create().
(WebCore::ContentSecurityPolicy::reportInvalidDirectiveInHTTPEquivMeta): Logs a message to the Web Inspector console
that the specified directive was ignored because it was delivered via an HTML meta element.
* page/csp/ContentSecurityPolicy.h: Made member function ContentSecurityPolicy::didReceiveHeader() private. Defined
enum class PolicyFrom to represent the source of the Content Security Policy: HTTP equiv meta element, HTTP header, or
inherited from another ContentSecurityPolicy object (this value is only used by ContentSecurityPolicy::copyStateFrom()).
(WebCore::ContentSecurityPolicy::processHTTPEquiv): Added; turns around and calls ContentSecurityPolicy::didReceiveHeader().
The name of this function better describes its purpose - to handle the processing of a Content Security Policy
delivered via <meta http-equiv="Content-Security-Policy" content="...">.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::create): Modified to take argument of type ContentSecurityPolicy::PolicyFrom
as pass it through to ContentSecurityPolicyDirectiveList::parse().
(WebCore::ContentSecurityPolicyDirectiveList::parse): Modified to ignore the directive sandbox when the Content Security
Policy came from an HTML meta element.
* page/csp/ContentSecurityPolicyDirectiveList.h:

LayoutTests:

Add test http/tests/security/contentSecurityPolicy/sandbox-in-meta-tag-ignored.html to ensure that we ignore
the sandbox directive when delivered via an HTML meta element and log a message to the Web Inspector console.

Remove tests http/tests/security/contentSecurityPolicy/sandbox-{allow-scripts-subframe, empty, empty-subframe}.html
that are no longer meaningful now that we ignore the sandbox directive when delivered via an HTML meta element and
create analogous tests for when the sandbox directive is delivered via an HTTP header.

* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header2-expected.txt: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-expected.txt.
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header2.php: Renamed from LayoutTests/http/tests/security/contentSecurityPolicy/sandbox-allow-scripts.html.

* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-subframe-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-subframe.html: Removed.
This test is no longer meaningful now that we ignore the sandbox directive when delivered via an HTML meta element.
An analogous test for when the directive is delivered via an HTTP header is http/tests/security/contentSecurityPolicy//sandbox-allow-scripts-in-http-header.html.

* http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe.php: Added. Derived from test http/tests/security/contentSecurityPolicy/sandbox-empty-subframe.html.

* http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header.php: Added. Derived from test http/tests/security/contentSecurityPolicy/sandbox-empty.html.

* http/tests/security/contentSecurityPolicy/sandbox-empty-subframe-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/sandbox-empty-subframe.html: Removed.
This test is no longer meaningful now that we ignore the sandbox directive when delivered via an HTML meta element.
The analogous test for when the directive is delivered via an HTTP header is http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe.php.

* http/tests/security/contentSecurityPolicy/sandbox-empty-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/sandbox-empty.html: Removed.
This test is no longer meaningful now that we ignore the sandbox directive when delivered via an HTML meta element.
The analogous test for when the directive is delivered via an HTTP header is http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header.php.

* http/tests/security/contentSecurityPolicy/sandbox-in-meta-tag-ignored-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/sandbox-in-meta-tag-ignored.html: Added.

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

4 years agobmalloc: Don't use a whole page for metadata
ggaren@apple.com [Sun, 21 Feb 2016 18:43:22 +0000 (18:43 +0000)]
bmalloc: Don't use a whole page for metadata
https://bugs.webkit.org/show_bug.cgi?id=154510

Reviewed by Andreas Kling.

(1) Don't round up metadata to a page boundary. This saves 1.5% dirty
memory on iOS and 0.2% on Mac. It also enables a future patch to allocate
smaller chunks without wasting memory.

(2) Initialize metadata lazily. This saves dirty memory when the program
allocates primarily small or large objects (but not both), leaving some
metadata uninitialized.

* bmalloc.xcodeproj/project.pbxproj: Medium objects are gone now.

* bmalloc/BumpAllocator.h:
(bmalloc::BumpAllocator::refill): Added an ASSERT to help debug a bug
I cause while working on this patch.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallBumpRanges): Ditto.

(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::allocateLarge): Updated for interface change.

* bmalloc/LargeChunk.h: Changed the boundaryTagCount calculation to
a static_assert.

Don't round up to page boundary. (See above.)

(bmalloc::LargeChunk::LargeChunk): Moved code here from LargeChunk::init.
A constructor is a more natural / automatic way to do this initialization.

* bmalloc/LargeObject.h:
(bmalloc::LargeObject::init): Deleted. Moved to LargeChunk.

* bmalloc/Sizes.h: Chagned largeChunkMetadataSize to a simpler constant
because metadata size no longer varies by page size.

* bmalloc/SmallChunk.h:
(bmalloc::SmallChunk::begin):
(bmalloc::SmallChunk::end):
(bmalloc::SmallChunk::lines):
(bmalloc::SmallChunk::pages): Use std::array to make begin/end
calculations easier.

(bmalloc::SmallChunk::SmallChunk): Treat our metadata like a series
of allocated objects. We used to avoid trampling our metadata by
starting object memory at the next page. Now we share the first page
between metadata and objects, and we account for metadata explicitly.

* bmalloc/SuperChunk.h:
(bmalloc::SuperChunk::SuperChunk):
(bmalloc::SuperChunk::smallChunk):
(bmalloc::SuperChunk::largeChunk):
(bmalloc::SuperChunk::create): Deleted. Don't eagerly run the SmallChunk
and LargeChunk constructors. We'll run them lazily as needed.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::VMHeap):
(bmalloc::VMHeap::allocateSmallChunk):
(bmalloc::VMHeap::allocateLargeChunk):
(bmalloc::VMHeap::allocateSuperChunk):
(bmalloc::VMHeap::grow): Deleted. Track small and large chunks explicitly
so we can initialize them lazily.

* bmalloc/VMHeap.h:
(bmalloc::VMHeap::allocateSmallPage):
(bmalloc::VMHeap::allocateLargeObject): Specify whether we're allocating
a small or large chunk since we don't allocate both at once anymore.

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

4 years agoUnreviewed, rolling out r196866.
commit-queue@webkit.org [Sun, 21 Feb 2016 18:18:32 +0000 (18:18 +0000)]
Unreviewed, rolling out r196866.
https://bugs.webkit.org/show_bug.cgi?id=154515

still crashy on EFL/GTK (Requested by smfr on #webkit).

Reverted changeset:

"Wheel event callback removing the window causes crash in
WebCore."
https://bugs.webkit.org/show_bug.cgi?id=150871
http://trac.webkit.org/changeset/196866

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

4 years agoUse of inlined asm statements causes problems for -std=c99 builds.
mark.lam@apple.com [Sun, 21 Feb 2016 06:14:38 +0000 (06:14 +0000)]
Use of inlined asm statements causes problems for -std=c99 builds.
https://bugs.webkit.org/show_bug.cgi?id=154507

Reviewed by Dan Bernstein.

Source/bmalloc:

* bmalloc/BAssert.h:

Source/WTF:

WTF's Assertions.h may inadvertantly get included by other projects that are built
with -std=c99.  The use of the inlined asm statements with the keyword "asm" is
not recognized when the -std compiler flag is used.

https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html says "When writing code that
can be compiled with -ansi and the various -std options, use __asm__ instead of
asm (see Alternate Keywords)."

So, to be a good citizen, we can change the use of "asm" in CRASH() to "__asm__"
so that we don't break the build of such other projects.

* wtf/Assertions.h:

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

4 years agoAdd the support for universal slave password
rniwa@webkit.org [Sun, 21 Feb 2016 01:54:08 +0000 (01:54 +0000)]
Add the support for universal slave password
https://bugs.webkit.org/show_bug.cgi?id=154476

Reviewed by David Kilzer.

Added the support for universalSlavePassword.

* config.json:
* public/include/report-processor.php:
(ReportProcessor::process):
(ReportProcessor::authenticate_and_construct_build_data): Extracted from process().

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

4 years agoWeb Inspector: Opacity slider thumb sometimes goes past the bar in Visual Styles...
commit-queue@webkit.org [Sun, 21 Feb 2016 00:17:01 +0000 (00:17 +0000)]
Web Inspector: Opacity slider thumb sometimes goes past the bar in Visual Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=154497

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-20
Reviewed by Timothy Hatcher.

Since WebInspector.Slider uses CSS transforms to move the slider knob
along the track, if the width of the track changes then the position
of the knob would stay the same since it was translated instead of
adjusting its position relative to the new width.

* UserInterface/Views/Slider.js:
(WebInspector.Slider.prototype.recalculateKnobX):
Resets the maxX value to 0 to ensure that a new maxX is calculated with
the current width.

* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.set specifiedWidth): Deleted.
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype.recalculateWidth):

* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel.prototype.widthDidChange):
(WebInspector.VisualStyleDetailsPanel.prototype._updateProperties):
(WebInspector.VisualStyleDetailsPanel.prototype._populateDisplaySection):

* UserInterface/Views/VisualStyleUnitSlider.js:
(WebInspector.VisualStyleUnitSlider.prototype.recalculateWidth):

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

4 years ago[ES6] Implement Proxy.[[Construct]]
sbarati@apple.com [Sat, 20 Feb 2016 23:51:33 +0000 (23:51 +0000)]
[ES6] Implement Proxy.[[Construct]]
https://bugs.webkit.org/show_bug.cgi?id=154440

Reviewed by Oliver Hunt.

This patch is mostly an implementation of
Proxy.[[Construct]] with respect to section 9.5.13
of the ECMAScript spec.
https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget

This patch also changes op_create_this to accept new.target's
that aren't JSFunctions. This is necessary implementing Proxy.[[Construct]]
because we might construct a JSFunction with a new.target being
a Proxy. This will also be needed when we implement Reflect.construct.

* dfg/DFGOperations.cpp:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emitSlow_op_create_this):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_create_this):
(JSC::JIT::emitSlow_op_create_this):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::finishCreation):
(JSC::ProxyObject::visitChildren):
(JSC::performProxyConstruct):
(JSC::ProxyObject::getConstructData):
* runtime/ProxyObject.h:
* tests/es6.yaml:
* tests/stress/proxy-construct.js: Added.
(assert):
(throw.new.Error.let.target):
(throw.new.Error):
(assert.let.target):
(assert.let.handler.get construct):
(let.target):
(let.handler.construct):
(i.catch):
(assert.let.handler.construct):
(assert.let.construct):
(assert.else.assert.let.target):
(assert.else.assert.let.construct):
(assert.else.assert):
(new.proxy.let.target):
(new.proxy.let.construct):
(new.proxy):

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

4 years agoWeb Inspector: Visual Styles: Modifying background expands Font section
commit-queue@webkit.org [Sat, 20 Feb 2016 22:47:51 +0000 (22:47 +0000)]
Web Inspector: Visual Styles: Modifying background expands Font section
https://bugs.webkit.org/show_bug.cgi?id=154491
<rdar://problem/24755440>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-20
Reviewed by Timothy Hatcher.

When the user selects a new style, the Visual sidebar examines the property
editors in each subsection to see if any have a value and expands/collapses
the subsection accordingly. This issue was happening because that logic was
also being triggered when the user didn't select a new style, which is
controlled by DOMNodeStyles and the significantChange value in refresh().

* UserInterface/Base/Utilities.js:
(String.prototype.toCamelCase):
Added utility function to transform a string into a camel-cased version.

* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype.refresh.fetchedComputedStyle):
Dropped unused variable and added checks to make sure doubly-matching styles
don't count as a significant change and cause refreshes of the styles sidebar.

* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel.prototype._updateSections):
If this function has an event, meaning it was triggered by a newly selected
selector in the selector section, loop through each subsection and perform
the logic described above, but instead only to open sections.

(WebInspector.VisualStyleDetailsPanel.prototype._generateSection.replaceDashWithCapital): Deleted.
(WebInspector.VisualStyleDetailsPanel.prototype._updateProperties):
Removed logic that was already being called by _sectionModified().

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

4 years agoWheel event callback removing the window causes crash in WebCore.
simon.fraser@apple.com [Sat, 20 Feb 2016 21:21:41 +0000 (21:21 +0000)]
Wheel event callback removing the window causes crash in WebCore.
https://bugs.webkit.org/show_bug.cgi?id=150871

Reviewed by Brent Fulgham.

Source/WebCore:

Null check the FrameView before using it, since the iframe may have been removed
from its parent document inside the event handler.

The new test triggered a cross-load side-effect, where wheel event filtering wasn't
reset between page loads. Fix by calling clearLatchedState() in EventHandler::clear(),
which resets the filtering.

Test: fast/events/wheel-event-destroys-frame.html

* page/EventHandler.cpp:
(WebCore::EventHandler::clear):
(WebCore::EventHandler::clearLatchedState):
* page/Frame.cpp:
(WebCore::Frame::setView): If the view doesn't change (e.g. was and is null)
don't bother clearing the event handler; should avoid EventHandler::clearLatchedState()
from accessing a deleted MainFrame.
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredDelta):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):

LayoutTests:

* fast/events/wheel-event-destroys-frame-expected.txt: Added.
* fast/events/wheel-event-destroys-frame.html: Added.

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

4 years agoRebaseline inspector/model/remote-object.html for Mac after r196846
ryanhaddad@apple.com [Sat, 20 Feb 2016 19:51:05 +0000 (19:51 +0000)]
Rebaseline inspector/model/remote-object.html for Mac after r196846

Unreviewed test gardening.

* platform/mac/inspector/model/remote-object-expected.txt:

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

4 years agoResolve style iteratively
antti@apple.com [Sat, 20 Feb 2016 18:29:40 +0000 (18:29 +0000)]
Resolve style iteratively
https://bugs.webkit.org/show_bug.cgi?id=154355

Reviewed by Andreas Kling.

Instead of a set of recursive functions use ComposedTreeIterator for traversing the DOM
tree in composed tree order.

This, along with maintaining explicit parent stack makes style resolve code more tractable
for future work.

It also makes the ComposedTreeIterator the definite authority for the shape of the composed tree
instead of duplicating it as a set of recursive style resolve functions. This eliminates
a significant source of bugs and confusion.

The render tree building code path remains recursive for now.

* css/StyleInvalidationAnalysis.cpp:
(WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):

    Invalidate the host element instead of the shadow root. This reduces need for special handling for shadow roots.

* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::initializeContextStack):
(WebCore::ComposedTreeIterator::dropAssertions):

    Add support for dropping DOM mutation assertions.

(WebCore::ComposedTreeIterator::traverseShadowRoot):
* dom/ComposedTreeIterator.h:
(WebCore::ComposedTreeIterator::context):
(WebCore::ComposedTreeIterator::current):
* dom/PseudoElement.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::TreeResolver):
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::Parent::Parent):
(WebCore::Style::TreeResolver::pushScope):
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::pseudoStyleCacheIsInvalid):
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::resolveTextNode):
(WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement):
(WebCore::Style::TreeResolver::pushParent):
(WebCore::Style::TreeResolver::popParent):
(WebCore::Style::TreeResolver::popParentsToDepth):

    Maintain explicit parent stack.

(WebCore::Style::TreeResolver::resolveComposedTree):

    The main loop that iterates over the composed tree and computes style for dirty elements.

(WebCore::Style::TreeResolver::resolve):
(WebCore::Style::detachRenderTree):
(WebCore::Style::TreeResolver::resolveLocally): Deleted.
(WebCore::Style::TreeResolver::resolveChildAtShadowBoundary): Deleted.
(WebCore::Style::TreeResolver::resolveShadowTree): Deleted.
(WebCore::Style::TreeResolver::resolveChildren): Deleted.
(WebCore::Style::TreeResolver::resolveSlotAssignees): Deleted.
(WebCore::Style::TreeResolver::resolveRecursively): Deleted.

    Recursive functions go away.

* style/StyleTreeResolver.h:
(WebCore::Style::TreeResolver::scope):
(WebCore::Style::TreeResolver::parent):

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

4 years agoWeb Inspector: Text Align segmented control blinks while editing other properties...
commit-queue@webkit.org [Sat, 20 Feb 2016 18:16:37 +0000 (18:16 +0000)]
Web Inspector: Text Align segmented control blinks while editing other properties in Visual Styles sidebar
https://bugs.webkit.org/show_bug.cgi?id=154487
<rdar://problem/24754703>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-20
Reviewed by Timothy Hatcher.

The icon list property editor blinking issue was caused by the fact that
the selected value was toggled on/off each time the value was set on the
editor. In order to prevent this, the logic for the setter value() was
modified to just match a keyword icon to the given value and select it.

* UserInterface/Views/VisualStyleKeywordIconList.js:
(WebInspector.VisualStyleKeywordIconList.prototype.set value):
(WebInspector.VisualStyleKeywordIconList.prototype._handleKeywordChanged):

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

4 years agoREGRESSION(r196780): Fake memory handler takes too long to run now.
akling@apple.com [Sat, 20 Feb 2016 17:02:16 +0000 (17:02 +0000)]
REGRESSION(r196780): Fake memory handler takes too long to run now.

Unreviewed bot fix.

Put the footprint comparison code behind a compile-time flag for now.
It's taking too long to run on bots, and memory is getting measured
before all the pressure relief code has a chance to run.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):

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

4 years agoDo not require UDate in LocaleICU with !ENABLE_DATE_AND_TIME_INPUT_TYPES
commit-queue@webkit.org [Sat, 20 Feb 2016 16:42:24 +0000 (16:42 +0000)]
Do not require UDate in LocaleICU with !ENABLE_DATE_AND_TIME_INPUT_TYPES
https://bugs.webkit.org/show_bug.cgi?id=154483

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-02-20
Reviewed by Michael Catanzaro.

Put initializeShortDateFormat(), dateFormat(), m_shortDateFormat and
m_didCreateShortDateFormat under flag, since they are only used by
code under the ENABLE_DATE_AND_TIME_INPUT_TYPES flag.

This helps to build with a light ICU that does not provide UDate
features (with UCONFIG_NO_FORMATTING).

* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::LocaleICU):
(WebCore::LocaleICU::~LocaleICU):
(WebCore::createFallbackMonthLabels): Deleted.
(WebCore::createFallbackAMPMLabels): Deleted.
* platform/text/LocaleICU.h:

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

4 years agoRemove declaration of unimplemented methods in LocaleICU
commit-queue@webkit.org [Sat, 20 Feb 2016 16:31:28 +0000 (16:31 +0000)]
Remove declaration of unimplemented methods in LocaleICU
https://bugs.webkit.org/show_bug.cgi?id=154482

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-02-20
Reviewed by Michael Catanzaro.

detectSignAndGetDigitRange() and matchedDecimalSymbolIndex() are
implemented in PlatformLocale, not LocaleICU.

They were moved out from LocaleICU to NumberLocalizer in r124459
(2012), which has then been renamed as Localizer, then Locale, and
finally PlatformLocale.

* platform/text/LocaleICU.h:

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

4 years ago[cmake] Use ICU include dirs in WebKit2 and WebKitTestRunner
commit-queue@webkit.org [Sat, 20 Feb 2016 16:30:29 +0000 (16:30 +0000)]
[cmake] Use ICU include dirs in WebKit2 and WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=154479

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-02-20
Reviewed by Michael Catanzaro.

Source/WebKit2:

* CMakeLists.txt:

Tools:

* WebKitTestRunner/CMakeLists.txt:

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

4 years agoUnreviewed, rolling out r196837.
commit-queue@webkit.org [Sat, 20 Feb 2016 11:01:15 +0000 (11:01 +0000)]
Unreviewed, rolling out r196837.
https://bugs.webkit.org/show_bug.cgi?id=154495

It caused a lot of crashes in EFL and GTK bots (Requested by
KaL on #webkit).

Reverted changeset:

"Wheel event callback removing the window causes crash in
WebCore."
https://bugs.webkit.org/show_bug.cgi?id=150871
http://trac.webkit.org/changeset/196837

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

4 years agoWeb Inspector: Placeholder text in Visual Styles sidebar table row should be white
nvasilyev@apple.com [Sat, 20 Feb 2016 08:40:38 +0000 (08:40 +0000)]
Web Inspector: Placeholder text in Visual Styles sidebar table row should be white
https://bugs.webkit.org/show_bug.cgi?id=154488
<rdar://problem/24754715>

Reviewed by Timothy Hatcher.

* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.css:
(.visual-style-property-container.comma-separated-keyword-editor > .visual-style-property-value-container > .visual-style-comma-separated-keyword-list > .visual-style-comma-separated-keyword-item > .titles > .subtitle):

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

4 years agoUnreviewed. Fix debug build error since r196847
jh718.park@samsung.com [Sat, 20 Feb 2016 06:31:45 +0000 (06:31 +0000)]
Unreviewed. Fix debug build error since r196847

Fix gcc build warning appeared as below
by removing BASSERT(refCount <= maxRefCount).
error: comparison is always true due to limited range of data type
[-Werror=type-limits]

* bmalloc/SmallLine.h:
(bmalloc::SmallLine::ref): Deleted.

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

4 years agoWeb Inspector: Inherited selector rows have text too low
nvasilyev@apple.com [Sat, 20 Feb 2016 05:51:29 +0000 (05:51 +0000)]
Web Inspector: Inherited selector rows have text too low
https://bugs.webkit.org/show_bug.cgi?id=154489
<rdar://problem/24754774>

Reviewed by Timothy Hatcher.

* UserInterface/Views/VisualStyleSelectorSection.css:
(.details-section.visual-style-selector-section > .content > .selectors > .selector-list > .section-divider):

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

4 years agoLand release assertions to help track down a possible HTMLCollection lifetime bug
cdumez@apple.com [Sat, 20 Feb 2016 04:41:06 +0000 (04:41 +0000)]
Land release assertions to help track down a possible HTMLCollection lifetime bug
https://bugs.webkit.org/show_bug.cgi?id=154490

Reviewed by Ryosuke Niwa.

Land release assertions to help track down a possible HTMLCollection
lifetime bug: <rdar://problem/24457478>.

* bindings/js/JSHTMLCollectionCustom.cpp:
(WebCore::JSHTMLCollection::getOwnPropertyNames):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::HTMLCollection):
(WebCore::HTMLCollection::~HTMLCollection):
* html/HTMLCollection.h:
(WebCore::HTMLCollection::wasDeletionStarted):
* html/HTMLCollection.idl:

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

4 years agoSource/WebCore:
commit-queue@webkit.org [Sat, 20 Feb 2016 04:17:12 +0000 (04:17 +0000)]
Source/WebCore:
Bug 154366 - AX: AXObjectCache::visiblePositionForTextMarkerData() doesn't account for equivalent visibly equivalent positions
https://bugs.webkit.org/show_bug.cgi?id=154366

Patch by Doug Russell <d_russell@apple.com> on 2016-02-19
Reviewed by Chris Fleizach.

Test: accessibility/mac/text-marker-line-boundary.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::visiblePositionForTextMarkerData):

LayoutTests:
Bug 154366: AX: AXObjectCache::visiblePositionForTextMarkerData() doesn't account for visibly equivalent positions
https://bugs.webkit.org/show_bug.cgi?id=154366

Patch by Doug Russell <d_russell@apple.com> on 2016-02-19
Reviewed by Chris Fleizach.

* accessibility/mac/text-marker-line-boundary-expected.txt: Added.
* accessibility/mac/text-marker-line-boundary.html: Added.

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

4 years agoWeb Inspector: Color picker in Visual Styles sidebar should not default to zero alpha
commit-queue@webkit.org [Sat, 20 Feb 2016 03:24:22 +0000 (03:24 +0000)]
Web Inspector: Color picker in Visual Styles sidebar should not default to zero alpha
https://bugs.webkit.org/show_bug.cgi?id=154474
<rdar://problem/24750217>

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-19
Reviewed by Timothy Hatcher.

* UserInterface/Views/InlineSwatch.js:
(WebInspector.InlineSwatch.prototype._fallbackValue):
Changed the fallback value for color from transparent to white so that
the color picker starts out with an alpha value of 1.

(WebInspector.InlineSwatch.prototype._handleContextMenuEvent):
Prevents context menu events from having an effect if there is no value
for them to modify.

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

4 years agoUse more concrete types for parsing positions
simon.fraser@apple.com [Sat, 20 Feb 2016 02:47:08 +0000 (02:47 +0000)]
Use more concrete types for parsing positions
https://bugs.webkit.org/show_bug.cgi?id=154481

Reviewed by Dean Jackson.

Use CSSPrimitiveValues for position-parsing functions where possible, to avoid
the need to downcast<> the values returned by the parsing functions.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parsePositionX):
(WebCore::CSSParser::parsePositionY):
(WebCore::CSSParser::parse4ValuesFillPosition):
(WebCore::CSSParser::parse3ValuesFillPosition):
(WebCore::CSSParser::parseFillPosition):
(WebCore::CSSParser::parse2ValuesFillPosition):
(WebCore::CSSParser::parseFillProperty):
(WebCore::CSSParser::parseTransformOriginShorthand):
(WebCore::CSSParser::parseBasicShapeCircle):
(WebCore::CSSParser::parseBasicShapeEllipse):
(WebCore::CSSParser::parseDeprecatedRadialGradient):
(WebCore::CSSParser::parseRadialGradient):
(WebCore::CSSParser::parseTransformOrigin):
(WebCore::CSSParser::parsePerspectiveOrigin):
* css/CSSParser.h:

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

4 years ago[INTL] Implement Number Format Functions
sukolsak@gmail.com [Sat, 20 Feb 2016 01:58:06 +0000 (01:58 +0000)]
[INTL] Implement Number Format Functions
https://bugs.webkit.org/show_bug.cgi?id=147605

Reviewed by Darin Adler.

Source/JavaScriptCore:

This patch implements Intl.NumberFormat.prototype.format() according
to the ECMAScript 2015 Internationalization API spec (ECMA-402 2nd edition.)

* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::UNumberFormatDeleter::operator()):
(JSC::IntlNumberFormat::initializeNumberFormat):
(JSC::IntlNumberFormat::createNumberFormat):
(JSC::IntlNumberFormat::formatNumber):
(JSC::IntlNumberFormatFuncFormatNumber): Deleted.
* runtime/IntlNumberFormat.h:
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatFuncFormatNumber):

LayoutTests:

* js/intl-numberformat-expected.txt:
* js/intl-numberformat.html:
* js/number-toLocaleString-expected.txt:
* js/script-tests/intl-numberformat.js:
* js/script-tests/number-toLocaleString.js:

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

4 years agoJSObject::getPropertySlot - index-as-propertyname, override on prototype, & shadow
barraclough@apple.com [Sat, 20 Feb 2016 01:51:48 +0000 (01:51 +0000)]
JSObject::getPropertySlot - index-as-propertyname, override on prototype, & shadow
https://bugs.webkit.org/show_bug.cgi?id=154416

Reviewed by Geoff Garen.

Source/JavaScriptCore:

Here's the bug. Suppose you call JSObject::getOwnProperty and -
  - PropertyName contains an index,
  - An object on the prototype chain overrides getOwnPropertySlot, and has that index property,
  - The base of the access (or another object on the prototype chain) shadows that property.

JSObject::getPropertySlot is written assuming the common case is that propertyName is not an
index, and as such walks up the prototype chain looking for non-index properties before it
tries calling parseIndex.

At the point we reach an object on the prototype chain overriding getOwnPropertySlot (which
would potentially return the property) we may have already skipped over non-overriding
objects that contain the property in index storage.

* runtime/JSObject.h:
(JSC::JSObject::getOwnNonIndexPropertySlot):
    - renamed from inlineGetOwnPropertySlot to better describe behaviour;
      added ASSERT guarding that this method never returns index properties -
      if it ever does, this is unsafe for getPropertySlot.
(JSC::JSObject::getOwnPropertySlot):
    - inlineGetOwnPropertySlot -> getOwnNonIndexPropertySlot.
(JSC::JSObject::getPropertySlot):
    - In case of object overriding getOwnPropertySlot check if propertyName is an index.
(JSC::JSObject::getNonIndexPropertySlot):
    - called by getPropertySlot if we encounter an object that overrides getOwnPropertySlot,
      in order to avoid repeated calls to parseIndex.
(JSC::JSObject::inlineGetOwnPropertySlot): Deleted.
    - this was renamed to getOwnNonIndexPropertySlot.
(JSC::JSObject::fastGetOwnPropertySlot): Deleted.
    - this was folded back in to getPropertySlot.

Source/WebCore:

* testing/Internals.cpp:
(WebCore::Internals::isReadableStreamDisturbed):
    - fastGetOwnPropertySlot -> getOwnPropertySlot
      (internal method removed; test shouldn't really have been using this anyway)

LayoutTests:

* js/index-property-shadows-overriden-get-own-property-slot-expected.txt: Added.
* js/index-property-shadows-overriden-get-own-property-slot.html: Added.
* js/script-tests/index-property-shadows-overriden-get-own-property-slot.js: Added.
(test):
    - added test case.

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

4 years agoWebAutomationSession should tell its delegate when its remote end disconnects
bburg@apple.com [Sat, 20 Feb 2016 01:37:55 +0000 (01:37 +0000)]
WebAutomationSession should tell its delegate when its remote end disconnects
https://bugs.webkit.org/show_bug.cgi?id=154426
<rdar://problem/24732382>

Reviewed by Timothy Hatcher.

The client might want to free up resources or close spawned windows
if the remote end has disconnected from the automation session.

* UIProcess/API/APIAutomationSessionClient.h:
(API::AutomationSessionClient::didDisconnectFromRemote): Added.
(API::AutomationSessionClient::didRequestNewWindow):
Remove WebProcessPool* argument as it is never used.

* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKAutomationSession.mm:
(-[_WKAutomationSession isPaired]):
Expose whether the session is paired with a remote end.

* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Add method.
* UIProcess/Cocoa/AutomationSessionClient.h: Add method.
Remove WebProcessPool* argument as it is never used.

* UIProcess/Cocoa/AutomationSessionClient.mm:
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::AutomationSessionClient::didRequestNewWindow):
(WebKit::AutomationSessionClient::didDisconnectFromRemote):
Add necessary forwarding boilerplate.

* UIProcess/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::disconnect): Inform the client.

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

4 years agobmalloc: Chunk, Page, and Line don't need to be class templates
ggaren@apple.com [Sat, 20 Feb 2016 01:06:49 +0000 (01:06 +0000)]
bmalloc: Chunk, Page, and Line don't need to be class templates
https://bugs.webkit.org/show_bug.cgi?id=154480

Reviewed by Gavin Barraclough.

We needed class templates to distinguish between small and medium,
but medium is gone now.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/Chunk.h: Removed.
* bmalloc/Heap.cpp:
(bmalloc::Heap::initializeLineMetadata):
(bmalloc::Heap::allocateSmallBumpRanges):
* bmalloc/Heap.h:
* bmalloc/Line.h: Removed.
* bmalloc/Page.h: Removed.
* bmalloc/Sizes.h:
* bmalloc/SmallChunk.h: Replaced with Source/bmalloc/bmalloc/Chunk.h.
(bmalloc::SmallChunk::begin):
(bmalloc::SmallChunk::end):
(bmalloc::SmallChunk::lines):
(bmalloc::SmallChunk::pages):
(bmalloc::SmallChunk::get):
(bmalloc::SmallLine::get):
(bmalloc::SmallLine::begin):
(bmalloc::SmallLine::end):
(bmalloc::SmallPage::get):
(bmalloc::SmallPage::begin):
(bmalloc::SmallPage::end):
(bmalloc::Chunk::begin): Deleted.
(bmalloc::Chunk::end): Deleted.
(bmalloc::Chunk::lines): Deleted.
(bmalloc::Chunk::pages): Deleted.
* bmalloc/SmallLine.h: Replaced with Source/bmalloc/bmalloc/Line.h.
(bmalloc::SmallLine::ref):
(bmalloc::SmallLine::deref):
(bmalloc::Line<Traits>::begin): Deleted.
(bmalloc::Line<Traits>::end): Deleted.
(bmalloc::Line<Traits>::ref): Deleted.
(bmalloc::Line<Traits>::deref): Deleted.
* bmalloc/SmallPage.h: Replaced with Source/bmalloc/bmalloc/Page.h.
(bmalloc::SmallPage::hasFreeLines):
(bmalloc::SmallPage::setHasFreeLines):
(bmalloc::SmallPage::ref):
(bmalloc::SmallPage::deref):
(bmalloc::Page::hasFreeLines): Deleted.
(bmalloc::Page::setHasFreeLines): Deleted.
(bmalloc::Page<Traits>::ref): Deleted.
(bmalloc::Page<Traits>::deref): Deleted.
* bmalloc/SmallTraits.h: Removed.

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

4 years agoHTMLFormElement.autocomplete should only return known values
cdumez@apple.com [Sat, 20 Feb 2016 00:09:11 +0000 (00:09 +0000)]
HTMLFormElement.autocomplete should only return known values
https://bugs.webkit.org/show_bug.cgi?id=154247
<rdar://problem/24658195>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline a couple of W3C HTML tests now that more checks are passing.

* web-platform-tests/html/dom/reflection-forms-expected.txt:
* web-platform-tests/html/semantics/forms/the-form-element/form-autocomplete-expected.txt:

Source/WebCore:

Update HTMLFormElement.autocomplete to only return known values:
- https://html.spec.whatwg.org/multipage/forms.html#dom-form-autocomplete
- https://html.spec.whatwg.org/multipage/forms.html#attr-form-autocomplete

Also, update HTMLInputElement.autocomplete to fall back to using the form
owner's autocomplete attribute ("on" or "off") when it's autocomplete
attribute is omitted and the input element is wearing the "autofill
expectation mantle" (i.e. the input is not hidden). If there is no
form owner, the "on" value is used instead. This behavior is specified
in:
https://html.spec.whatwg.org/multipage/forms.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-7

No new tests, already covered by existing tests.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::autocomplete):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::setAutocomplete):
(WebCore::HTMLFormElement::autocomplete):
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:

LayoutTests:

Update test to expect Form.autocomplete to return "on" by
default instead of the empty string.

* fast/forms/autocomplete-expected.txt:
* fast/forms/autocomplete.html:

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