WebKit-https.git
4 years agoAX: table cells that use display:block render the table inaccessible to VoiceOver
cfleizach@apple.com [Thu, 26 Mar 2015 00:53:52 +0000 (00:53 +0000)]
AX: table cells that use display:block render the table inaccessible to VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=143007

Reviewed by Mario Sanchez Prada.

Source/WebCore:

When display:block is used on a table cell, it was being ignored because it was anonymous.
This is still a valid scenario however if it's still inside of a valid table.

Test: accessibility/table-cell-display-block.html

* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored):

LayoutTests:

* accessibility/table-cell-display-block-expected.txt: Added.
* accessibility/table-cell-display-block.html: Added.

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

4 years agoWeb Inspector: Add ESLint "Disallow Undeclared Variables" rule and enable ES6 env
commit-queue@webkit.org [Thu, 26 Mar 2015 00:46:57 +0000 (00:46 +0000)]
Web Inspector: Add ESLint "Disallow Undeclared Variables" rule and enable ES6 env
https://bugs.webkit.org/show_bug.cgi?id=143062

Patch by Tobias Reiss <tobi+webkit@basecode.de> on 2015-03-25
Reviewed by Joseph Pecoraro.

ESLint: Add support for es6 environment and "no-undef" rule which disallows
use of undeclared variables unless mentioned in a /*global */ block.

* .eslintrc:

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

4 years agoAdd a preference to prevent "user-scalable=no" from having any effect
timothy_horton@apple.com [Thu, 26 Mar 2015 00:03:44 +0000 (00:03 +0000)]
Add a preference to prevent "user-scalable=no" from having any effect
https://bugs.webkit.org/show_bug.cgi?id=143032

Reviewed by Sam Weinig.

* Shared/WebPreferencesDefinitions.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Add a preference and push it to the ViewportConfiguration.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::ViewportConfiguration):
(WebCore::ViewportConfiguration::allowsUserScaling):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::setForceAlwaysUserScalable):
If forceAlwaysUserScalable is set to true, force "user-scalable=yes".

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

4 years agoREGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail
bdakin@apple.com [Wed, 25 Mar 2015 23:37:41 +0000 (23:37 +0000)]
REGRESSION (r181660): Force click url preview doesn't have a TextIndicator in Mail
https://bugs.webkit.org/show_bug.cgi?id=143064
-and corresponding-
rdar://problem/20251440

Reviewed by Tim Horton.

The TextIndicator was getting set to nil by the call to
_dismissContentRelativeChildWindows in mouseDown. That line of code was added by
http://trac.webkit.org/changeset/177242 to work around a bug in another component
that has now been resolved, so it no longer appears to be necessary.

* UIProcess/API/mac/WKView.mm:
(-[WKView mouseDown:]):

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

4 years agoAdd network and application cache directories to WebsiteDataStore
andersca@apple.com [Wed, 25 Mar 2015 23:37:04 +0000 (23:37 +0000)]
Add network and application cache directories to WebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=143063

Reviewed by Sam Weinig.

Create a WebKit directory under ~/Library/Caches/<Bundle ID> for non-sandboxed applications,
and ~/Library/Caches for sandboxed applications. Create NetworkCache and OfflineWebApplicationCache
subdirectories. These directories will be used with the modern WebKit API.

* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
(API::WebsiteDataStore::defaultDataStoreConfiguration):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore):
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

4 years agoAnother attempt to get the iOS EWS building again.
mitz@apple.com [Wed, 25 Mar 2015 23:33:53 +0000 (23:33 +0000)]
Another attempt to get the iOS EWS building again.

* WebCore.xcodeproj/project.pbxproj:

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

4 years agoFix Windows build from r181977.
mmaxfield@apple.com [Wed, 25 Mar 2015 23:25:31 +0000 (23:25 +0000)]
Fix Windows build from r181977.

Unreviewed.

* Scripts/update-webkit-dependency:

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

4 years agoREGRESSION(169139): LLINT intermittently fails JSC testapi tests.
mark.lam@apple.com [Wed, 25 Mar 2015 23:15:15 +0000 (23:15 +0000)]
REGRESSION(169139): LLINT intermittently fails JSC testapi tests.
<https://webkit.org/b/135719>

Reviewed by Geoffrey Garen.

This is a regression introduced in http://trac.webkit.org/changeset/169139 which
changed VM::watchdog from an embedded field into a std::unique_ptr, but did not
update the LLINT to access it as such.

The issue has only manifested so far on the CLoop tests because those are LLINT
only.  In the non-CLoop cases, the JIT kicks in and does the right thing, thereby
hiding the bug in the LLINT.

* API/JSContextRef.cpp:
(createWatchdogIfNeeded):
(JSContextGroupSetExecutionTimeLimit):
(JSContextGroupClearExecutionTimeLimit):
* llint/LowLevelInterpreter.asm:

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

4 years agoAdd case-insensitive checks to DFA bytecode.
achristensen@apple.com [Wed, 25 Mar 2015 23:05:36 +0000 (23:05 +0000)]
Add case-insensitive checks to DFA bytecode.
https://bugs.webkit.org/show_bug.cgi?id=142977

Reviewed by Benjamin Poulain.

* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValue):
(WebCore::ContentExtensions::DFABytecodeCompiler::emitCheckValueRange):
Add case-insensitive bytecode.
(WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
Check to see if case-insensitive bytecodes can be used.
(WebCore::ContentExtensions::DFABytecodeCompiler::compileCheckForRange):
* contentextensions/DFABytecodeCompiler.h:
(WebCore::ContentExtensions::DFABytecodeCompiler::Range::Range):
Added Range structure to be able to count the ranges in a future patch deciding if we want to use jump tables.
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
Interpret case-insensitive bytecodes.

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

4 years agoChange Atomic methods from using the_wrong_naming_conventions to using theRightNaming...
fpizlo@apple.com [Wed, 25 Mar 2015 22:56:50 +0000 (22:56 +0000)]
Change Atomic methods from using the_wrong_naming_conventions to using theRightNamingConventions. Also make seq_cst the default.

Rubber stamped by Geoffrey Garen.

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitAggregate):

Source/WTF:

* wtf/Atomics.h:
(WTF::Atomic::load):
(WTF::Atomic::store):
(WTF::Atomic::compareExchangeWeak):
(WTF::Atomic::compareExchangeStrong):
(WTF::Atomic::compare_exchange_weak): Deleted.
(WTF::Atomic::compare_exchange_strong): Deleted.
* wtf/ByteSpinLock.h:
(WTF::ByteSpinLock::lock):
* wtf/SpinLock.h:
(WTF::SpinLockBase::lock):

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

4 years agoAddress additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.
weinig@apple.com [Wed, 25 Mar 2015 22:56:19 +0000 (22:56 +0000)]
Address additional review feedback from https://bugs.webkit.org/show_bug.cgi?id=143059.

Source/WebCore:

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionCompiler.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getTypeFlags):

Source/WebKit2:

* Shared/WebCompiledContentExtension.cpp:
(WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
* UIProcess/API/C/WKUserContentFilterRef.cpp:
(WKUserContentFilterCreate):
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter initWithName:serializedRules:]):

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::InMemoryCompiledContentExtension::createFromFilter):

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

4 years agoMigrate update-webkit for Windows to not require Cygwin
mmaxfield@apple.com [Wed, 25 Mar 2015 22:46:41 +0000 (22:46 +0000)]
Migrate update-webkit for Windows to not require Cygwin
https://bugs.webkit.org/show_bug.cgi?id=143040

Reviewed by Brent Fulgham.

* Scripts/update-webkit-dependency:
(wanted):
(toUnixPath): Deleted.
* Scripts/webkitdirs.pm:
(fontExists):
(checkInstalledTools):
(setupAppleWinEnv):

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

4 years agoFix formatting in BuiltinExecutables
commit-queue@webkit.org [Wed, 25 Mar 2015 22:42:39 +0000 (22:42 +0000)]
Fix formatting in BuiltinExecutables
https://bugs.webkit.org/show_bug.cgi?id=143061

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-25
Reviewed by Ryosuke Niwa.

* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutableInternal):

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

4 years agoAdd a few more tests for Class names
commit-queue@webkit.org [Wed, 25 Mar 2015 22:41:04 +0000 (22:41 +0000)]
Add a few more tests for Class names
https://bugs.webkit.org/show_bug.cgi?id=143060

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-25
Reviewed by Ryosuke Niwa.

Add a few more class name tests:
- const class name binding inside class expression
- mutable class name binding from class statement

* js/script-tests/class-syntax-name.js:

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

4 years ago[Content Extensions] Convert content extension compiling to return error codes and...
weinig@apple.com [Wed, 25 Mar 2015 22:38:58 +0000 (22:38 +0000)]
[Content Extensions] Convert content extension compiling to return error codes and write its output using a client
https://bugs.webkit.org/show_bug.cgi?id=143059

Reviewed by Alex Christensen.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
Add ContentExtensionError.h/cpp.

* contentextensions/ContentExtensionError.cpp: Added.
(WebCore::ContentExtensions::contentExtensionErrorCategory):
* contentextensions/ContentExtensionError.h: Added.
(WebCore::ContentExtensions::make_error_code):
Add ContentExtensionError enum and std::error_code adaptor.

* contentextensions/ContentExtensionCompiler.h:
Instead of returning CompiledContentExtensionData, use a client interface
to pass data. Eventually, this should be turned into a direct streaming
interface so we can write directly to a file.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getTypeFlags):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadAction):
(WebCore::ContentExtensions::loadRule):
(WebCore::ContentExtensions::loadEncodedRules):
(WebCore::ContentExtensions::parseRuleList):
* contentextensions/ContentExtensionParser.h:
Convert to return an error.

Source/WebKit2:

* Shared/WebCompiledContentExtension.cpp:
* Shared/WebCompiledContentExtension.h:
(WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient):
(WebKit::LegacyContentExtensionCompilationClient::writeBytecode):
(WebKit::LegacyContentExtensionCompilationClient::writeActions):
Add subclass of ContentExtensionCompilationClient for use with the non-file backed content
extensions.

* UIProcess/API/C/WKUserContentFilterRef.cpp:
(WKUserContentFilterCreate):
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter initWithName:serializedRules:]):
Update to use the new interface of compileRuleList().

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::InMemoryCompiledContentExtension::createFromFilter):
Update for new interface of compileRuleList().

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

4 years agoES6: Classes: Program level class statement throws exception in strict mode
joepeck@webkit.org [Wed, 25 Mar 2015 21:33:59 +0000 (21:33 +0000)]
ES6: Classes: Program level class statement throws exception in strict mode
https://bugs.webkit.org/show_bug.cgi?id=143038

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

Classes expose a name to the current lexical environment. This treats
"class X {}" like "var X = class X {}". Ideally it would be "let X = class X {}".
Also, improve error messages for class statements where the class is missing a name.

* parser/Parser.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseClass):
Fill name in info parameter if needed. Better error message if name is needed and missing.

(JSC::Parser<LexerType>::parseClassDeclaration):
Pass info parameter to get name, and expose the name as a variable name.

(JSC::Parser<LexerType>::parsePrimaryExpression):
Pass info parameter that is ignored.

* parser/ParserFunctionInfo.h:
Add a parser info for class, to extract the name.

LayoutTests:

This updates a number of existing tests that were relying on
poor behavior. `shouldBe` and friends use eval within a function
not at the global scope. This means `shouldBe('class X { ... }')`
behaves like `shouldBe('var x = ...')` not `shouldBe('x = ...')`.
This means `x` will not be available in the next `shouldBe` call.

Add a test specifically to cover the scoping of the class name
in regular and strict mode code. Currently we treat it like var
with one failing test that would pass when we treat it like let.

* js/class-syntax-name.html: Added.
* js/script-tests/class-syntax-name.js: Added.
(runTestShouldBe):
(runTestShouldBeTrue):
(runTestShouldThrow):
(runTestShouldNotThrow):
Test class name scoping.

* js/class-syntax-call-expected.txt:
* js/class-syntax-declaration-expected.txt:
* js/class-syntax-default-constructor-expected.txt:
* js/class-syntax-name-expected.txt: Added.
* js/script-tests/class-syntax-call.js:
* js/script-tests/class-syntax-declaration.js:
* js/script-tests/class-syntax-default-constructor.js:

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

4 years agoWeb Inspector: Switching tabs to window with inspector open prohibits typing into...
rniwa@webkit.org [Wed, 25 Mar 2015 21:19:05 +0000 (21:19 +0000)]
Web Inspector: Switching tabs to window with inspector open prohibits typing into console
https://bugs.webkit.org/show_bug.cgi?id=126800

Reviewed by Anders Carlsson.

This is a regression from r85356 and r83814. These two patches made WKWebView clear its selection
when WKView resigns the first responder without ever restoring it even if WKView later becomes
the first responder again. This is problematic when a text field or a editing host element had been
focused and selected prior to the resignation since the editing code uses the selection to determine
the editability of the element.

Fixed the bug by restoring selection in [WKView becomeFirstResponder] if the selection is empty.

* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::restoreSelectionInFocusedEditableElement):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::restoreSelectionInFocusedEditableElement):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

4 years agoREGRESSION (r181660): Safari navigates to link after a starting and canceling a
bdakin@apple.com [Wed, 25 Mar 2015 21:09:18 +0000 (21:09 +0000)]
REGRESSION (r181660): Safari navigates to link after a starting and canceling a
force preview
https://bugs.webkit.org/show_bug.cgi?id=143057
-and corresponding-
rdar://problem/20251436

Reviewed by Tim Horton.

Source/WebCore:

This patch adds a value for ActionUpdated to the ImmediateActionStage enum. Now if
m_immediateActionStage indicates that an immediate action has either begun or
completed then we can have the same behavior.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent):
* page/EventHandler.h:

Source/WebKit2:

Always call _page->immediateActionDidUpdate() so that the EventHandler’s
ImmediateActionStage is appropriately updated.
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):

Update the EventHandler’s ImmediateActionStage.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::immediateActionDidUpdate):

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

4 years agoSeparate entry decoding from validation
antti@apple.com [Wed, 25 Mar 2015 20:59:18 +0000 (20:59 +0000)]
Separate entry decoding from validation
https://bugs.webkit.org/show_bug.cgi?id=143052

Reviewed by Chris Dumez.

Make NetworkCache::Cache a class and move it to a file of its own.
Move the encoding/decoding code there.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::fetchDiskCacheEntries):
(WebKit::clearDiskCacheEntries):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::sendReplyToSynchronousRequest):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
(WebKit::NetworkResourceLoader::validateCacheEntry):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::collectVaryingRequestHeaders):
(WebKit::NetworkCache::canUse):

    Focused function for deciding if we can use a cache entry and if it needs validation.

(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::update):
(WebKit::NetworkCache::Cache::traverse):
(WebKit::NetworkCache::encodeStorageEntry): Deleted.
(WebKit::NetworkCache::decodeStorageEntry): Deleted.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheEntry.cpp: Added.
(WebKit::NetworkCache::Entry::Entry):
(WebKit::NetworkCache::Entry::encode):
(WebKit::NetworkCache::Entry::decode):
(WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry):
(WebKit::NetworkCache::Entry::buffer):
(WebKit::NetworkCache::Entry::shareableResourceHandle):
(WebKit::NetworkCache::Entry::needsValidation):
(WebKit::NetworkCache::Entry::setNeedsValidation):
* NetworkProcess/cache/NetworkCacheEntry.h: Added.
(WebKit::NetworkCache::Entry::key):
(WebKit::NetworkCache::Entry::timeStamp):
(WebKit::NetworkCache::Entry::response):
(WebKit::NetworkCache::Entry::varyingRequestHeaders):
(WebKit::NetworkCache::Entry::sourceStorageEntry):
* NetworkProcess/cache/NetworkCacheStatistics.h:
* NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
(WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoGardening: rebaseline after r181907.
mark.lam@apple.com [Wed, 25 Mar 2015 19:35:49 +0000 (19:35 +0000)]
Gardening: rebaseline after r181907.

Not reviewed.

* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoNew map and set modification tests in r181922 fails
ggaren@apple.com [Wed, 25 Mar 2015 18:37:17 +0000 (18:37 +0000)]
New map and set modification tests in r181922 fails
https://bugs.webkit.org/show_bug.cgi?id=143031

Reviewed and tweaked by Geoffrey Garen.

When packing Map/Set backing store, we need to decrement Map/Set iterator's m_index
to adjust for the packed backing store.

Consider the following map data.

x: deleted, o: exists
0 1 2 3 4
x x x x o

And iterator with m_index 3.

When packing the map data, map data will become,

0
o

At that time, we perfom didRemoveEntry 4 times on iterators.
times => m_index/index/result
1 => 3/0/dec
2 => 2/1/dec
3 => 1/2/nothing
4 => 1/3/nothing

After iteration, iterator's m_index becomes 1. But we expected that becomes 0.
This is because if we use decremented m_index for comparison,
while provided deletedIndex is the index in old storage, m_index is the index in partially packed storage.

In this patch, we compare against the packed index instead.
times => m_index/packedIndex/result
1 => 3/0/dec
2 => 2/0/dec
3 => 1/0/dec
4 => 0/0/nothing

So m_index becomes 0 as expected.

And according to the spec, once the iterator is closed (becomes done: true),
its internal [[Map]]/[[Set]] is set to undefined.
So after the iterator is finished, we don't revive the iterator (e.g. by clearing m_index = 0).

In this patch, we change 2 things.
1.
Compare an iterator's index against the packed index when removing an entry.

2.
If the iterator is closed (isFinished()), we don't apply adjustment to the iterator.

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2015-03-25

* runtime/MapData.h:
(JSC::MapDataImpl::IteratorData::finish):
(JSC::MapDataImpl::IteratorData::isFinished):
(JSC::MapDataImpl::IteratorData::didRemoveEntry):
(JSC::MapDataImpl::IteratorData::didRemoveAllEntries):
(JSC::MapDataImpl::IteratorData::startPackBackingStore):
* runtime/MapDataInlines.h:
(JSC::JSIterator>::replaceAndPackBackingStore):
* tests/stress/modify-map-during-iteration.js:
* tests/stress/modify-set-during-iteration.js:

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

4 years ago[WinCairo] Crash when plugin window is destroyed.
peavo@outlook.com [Wed, 25 Mar 2015 17:55:28 +0000 (17:55 +0000)]
[WinCairo] Crash when plugin window is destroyed.
https://bugs.webkit.org/show_bug.cgi?id=142905

Reviewed by Alex Christensen.

When a plugin window is destroyed with the Win32 api function DestroyWindow,
the system will send a synchronous WM_PARENTNOTIFY message to the WebView.
The WebView window procedure will, when processing the WM_PARENTNOTIFY message,
call UpdateWindow to paint synchronously. This will cause reentrancy problems,
since we're already called from WebCore code, and then reenter WebCore painting code.
We should avoid calling UpdateWindow when handling the WM_PARENTNOTIFY message.

* WebView.cpp:
(WebView::WebViewWndProc):
(WebView::updateWindowIfNeeded):
* WebView.h:

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

4 years agoMediaControls: Use font with fixed number width
dino@apple.com [Wed, 25 Mar 2015 17:43:56 +0000 (17:43 +0000)]
MediaControls: Use font with fixed number width
https://bugs.webkit.org/show_bug.cgi?id=143018
<rdar://problem/20245415>

Reviewed by Eric Carlson.

Source/WebCore:

Add a new font-family, specific to Apple platforms,
called -apple-system-font-monospaced-numbers. This is
a special variant of the system font which uses monospaced
forms for the number glyphs - allowing a time reading that
doesn't bounce around as the time changes.

* Modules/mediacontrols/mediaControlsApple.css: Media controls should
use the new font.
(audio::-webkit-media-controls-time-remaining-display):
* Modules/mediacontrols/mediaControlsiOS.css:
(audio::-webkit-media-controls-time-remaining-display):

* platform/graphics/ios/FontCacheIOS.mm: Request a new CTFontRef with
the appropriate attributes.
(WebCore::createCTFontWithFamilyNameAndWeight):
* platform/graphics/mac/FontCacheMac.mm: Ditto, but NSFont.
(WebCore::fontWithFamily):
* platform/spi/cocoa/CoreTextSPI.h: Expose the constants for
the new form so that the public SDK can build.

LayoutTests:

Add some results for the new font family "-apple-system-font-monospaced-numbers".

* platform/mac/fast/text/systemFont.html:
* platform/mac/fast/text/systemFont-expected.txt:

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

4 years ago[Content Extensions] Add multi-DFA compiling and interpreting.
achristensen@apple.com [Wed, 25 Mar 2015 17:31:52 +0000 (17:31 +0000)]
[Content Extensions] Add multi-DFA compiling and interpreting.
https://bugs.webkit.org/show_bug.cgi?id=143010

Reviewed by Benjamin Poulain.

Source/WebCore:

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
Compile multiple NFAs to DFAs.
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
Fixed a bug when there are no non-universal actions.
We still need to report that no ignore-previous-rules was hit to apply the
universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
and skipped in DFABytecodeInterpreter::interpret.
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::compile):
Add a header for each DFA.
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
Interpret as many DFAs as there are in the bytecode.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::testRequest):
(TestWebKitAPI::TEST_F):
Add some tests for ignore-previous-rules and large rulesets.

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

4 years ago[Win] Illegal character in project file.
peavo@outlook.com [Wed, 25 Mar 2015 17:18:29 +0000 (17:18 +0000)]
[Win] Illegal character in project file.
https://bugs.webkit.org/show_bug.cgi?id=143051

Reviewed by Brent Fulgham.

There is an illegal character in the WebCore project filter.
WebCore files are shown unfiltered.

* WebCore.vcxproj/WebCore.vcxproj.filters:

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

4 years agoMavericks WK1 still runs JSC tests
ap@apple.com [Wed, 25 Mar 2015 17:00:14 +0000 (17:00 +0000)]
Mavericks WK1 still runs JSC tests
https://bugs.webkit.org/show_bug.cgi?id=143035

Reviewed by Csaba Osztrogonác.

* BuildSlaveSupport/build.webkit.org-config/config.json: Bring Mavericks WK1 in line
with other bots.

* BuildSlaveSupport/build.webkit.org-config/mastercfg_unittest.py: Updated the tests
accordingly.

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

4 years agoWeb Inspector: console.table with source code location look poor
nvasilyev@apple.com [Wed, 25 Mar 2015 16:49:57 +0000 (16:49 +0000)]
Web Inspector: console.table with source code location look poor
https://bugs.webkit.org/show_bug.cgi?id=142068

Reviewed by Timothy Hatcher.

* UserInterface/Views/LegacyConsoleMessageImpl.js:
(WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsTable):
Remove dataGridContainer as it is an unnecessary span element.
* UserInterface/Views/LogContentView.css:
(.console-messages .data-grid):

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

4 years agoAdd a pref to enable the new block-inside-inline model
hyatt@apple.com [Wed, 25 Mar 2015 16:28:28 +0000 (16:28 +0000)]
Add a pref to enable the new block-inside-inline model
https://bugs.webkit.org/show_bug.cgi?id=143050

Reviewed by Sam Weinig.

Source/WebCore:

* page/Settings.in:

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetNewBlockInsideInlineModelEnabled):
(WKPreferencesGetNewBlockInsideInlineModelEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

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

4 years agoiOS Simulator build fix.
mitz@apple.com [Wed, 25 Mar 2015 13:51:29 +0000 (13:51 +0000)]
iOS Simulator build fix.

* platform/spi/cocoa/IOSurfaceSPI.h:

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

4 years agoGTK+ Gardening 24th March
commit-queue@webkit.org [Wed, 25 Mar 2015 11:53:21 +0000 (11:53 +0000)]
GTK+ Gardening 24th March
https://bugs.webkit.org/show_bug.cgi?id=143003

Unreviewed.

Patch by Marcos Chavarría Teijeiro <chavarria1991@gmail.com> on 2015-03-25

* platform/gtk/TestExpectations:
* platform/gtk/css3/selectors3/xhtml/css3-modsel-15c-expected.txt: Rebaselined after r181889.
* platform/gtk/css3/selectors3/xml/css3-modsel-15c-expected.txt: Rebaselined after r181889.
* platform/gtk/plugins/npruntime/object-from-destroyed-plugin-expected.txt: Rebaselined after r181889.
* platform/gtk/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt: Rebaselined after r181889.

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

4 years ago[WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override
zandobersek@gmail.com [Wed, 25 Mar 2015 10:09:07 +0000 (10:09 +0000)]
[WK2] WebUserMediaClient::pageDestroyed() virtual method should be marked as override
https://bugs.webkit.org/show_bug.cgi?id=143046

Reviewed by Carlos Garcia Campos.

* WebProcess/WebCoreSupport/WebUserMediaClient.h: Mark the WebUserMediaClient::pageDestroyed()
method, inherited from the WebCore::UserMediaClient, as an override.

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

4 years ago[GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked...
zandobersek@gmail.com [Wed, 25 Mar 2015 09:38:11 +0000 (09:38 +0000)]
[GTK][WK2] WebPageProxy::failedToShowPopupMenu() virtual method should be marked as override
https://bugs.webkit.org/show_bug.cgi?id=143045

Reviewed by Carlos Garcia Campos.

* UIProcess/WebPageProxy.h: Mark the failedToShowPopupMenu(), inherited from
the WebPopupMenuProxy::Client class, as overridden.

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

4 years ago[WK2] Clean up DrawingAreaImpl vtable overrides
zandobersek@gmail.com [Wed, 25 Mar 2015 09:32:33 +0000 (09:32 +0000)]
[WK2] Clean up DrawingAreaImpl vtable overrides
https://bugs.webkit.org/show_bug.cgi?id=143044

Reviewed by Carlos Garcia Campos.

Declare virtual methods of the DrawingAreaImpl class as overridden where necessary.

* WebProcess/WebPage/DrawingAreaImpl.h:
(WebKit::DrawingAreaImpl::layerTreeStateIsFrozen): Deleted.
(WebKit::DrawingAreaImpl::layerTreeHost): Deleted.

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

4 years agoVersioning.
bshafiei@apple.com [Wed, 25 Mar 2015 07:45:21 +0000 (07:45 +0000)]
Versioning.

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

4 years agoUnreviewed, rolling out r181932.
commit-queue@webkit.org [Wed, 25 Mar 2015 07:40:01 +0000 (07:40 +0000)]
Unreviewed, rolling out r181932.
https://bugs.webkit.org/show_bug.cgi?id=143041

The test fails most of the time on bots (Requested by ap on
#webkit).

Reverted changeset:

"[Content Extensions] Add multi-DFA compiling and
interpreting."
https://bugs.webkit.org/show_bug.cgi?id=143010
http://trac.webkit.org/changeset/181932

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

4 years agoSource/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee...
dino@apple.com [Wed, 25 Mar 2015 06:06:15 +0000 (06:06 +0000)]
Source/WebCore/rendering/RenderThemeMac.mm:2181:118: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull]
https://bugs.webkit.org/show_bug.cgi?id=143039

Unreviewed build fix for newer versions of OS X.

* rendering/RenderThemeMac.mm: Define a null language parameter. This
seemed better than turning the clang warning off for just that
function.
(WebCore::AttachmentLayout::layOutTitle):
(WebCore::AttachmentLayout::layOutSubtitle):

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

4 years agoAnother attempt to fix the build.
mitz@apple.com [Wed, 25 Mar 2015 05:29:08 +0000 (05:29 +0000)]
Another attempt to fix the build.

* WebCore.xcodeproj/project.pbxproj:
* platform/spi/cocoa/QuartzCoreSPI.h:

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

4 years ago[Content Extensions] Add multi-DFA compiling and interpreting.
achristensen@apple.com [Wed, 25 Mar 2015 05:19:42 +0000 (05:19 +0000)]
[Content Extensions] Add multi-DFA compiling and interpreting.
https://bugs.webkit.org/show_bug.cgi?id=143010

Reviewed by Benjamin Poulain.

Source/WebCore:

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
Compile multiple NFAs to DFAs.
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
Fixed a bug when there are no non-universal actions.
We still need to report that no ignore-previous-rules was hit to apply the
universal actions which are now accessed through DFABytecodeInterpreter::actionsFromDFARoot
and skipped in DFABytecodeInterpreter::interpret.
* contentextensions/DFABytecodeCompiler.cpp:
(WebCore::ContentExtensions::DFABytecodeCompiler::compile):
Add a header for each DFA.
* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
Interpret as many DFAs as there are in the bytecode.

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::testRequest):
(TestWebKitAPI::TEST_F):
Add some tests for ignore-previous-rules and large rulesets.

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

4 years agoTried to fix the EWS build.
mitz@apple.com [Wed, 25 Mar 2015 05:12:49 +0000 (05:12 +0000)]
Tried to fix the EWS build.

* platform/spi/cocoa/QuartzCoreSPI.h:

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

4 years agoWeb Inspector: IndexedDB / Databases ContentViews should have refresh button
joepeck@webkit.org [Wed, 25 Mar 2015 04:27:33 +0000 (04:27 +0000)]
Web Inspector: IndexedDB / Databases ContentViews should have refresh button
https://bugs.webkit.org/show_bug.cgi?id=142996

Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
Remove unused strings.

* UserInterface/Images/ReloadFull.svg: Added.
This is the same as Reload.svg but adjusted to fill the viewbox edge to edge.
The only change is to the viewbox.

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.release):
Some clients would call release not knowing if this was an object or not.
Act gracefully in the case that this was not an object that needs a
remote release.

* UserInterface/Views/DatabaseTableContentView.js:
(WebInspector.DatabaseTableContentView):
(WebInspector.DatabaseTableContentView.prototype.get navigationItems):
(WebInspector.DatabaseTableContentView.prototype._queryError):
(WebInspector.DatabaseTableContentView.prototype._refreshButtonClicked):
* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WebInspector.IndexedDatabaseObjectStoreContentView):
(WebInspector.IndexedDatabaseObjectStoreContentView.prototype.get navigationItems):
(WebInspector.IndexedDatabaseObjectStoreContentView.prototype._fetchMoreData):
(WebInspector.IndexedDatabaseObjectStoreContentView.prototype._refreshButtonClicked):
Give the storage content views a refresh button to reload the content.

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

4 years agoSetter should have a single formal parameter, Getter no parameters
joepeck@webkit.org [Wed, 25 Mar 2015 04:20:30 +0000 (04:20 +0000)]
Setter should have a single formal parameter, Getter no parameters
https://bugs.webkit.org/show_bug.cgi?id=142903

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
Enforce no parameters for getters and a single parameter
for setters, with informational error messages.

Source/WebInspectorUI:

* UserInterface/Views/GradientSlider.js:
(WebInspector.GradientSliderKnob.prototype.get wellColor):
Fix a getter that was incorrectly taking a parameter.

LayoutTests:

Correct a bunch of setters in existing tests and add
tests for good/bad getter and setter syntax.

* js/class-syntax-declaration-expected.txt:
* js/dom/exception-sequencing.html:
* js/dom/reserved-words-as-property-expected.txt:
* js/dom/script-tests/implicit-call-with-global-reentry.js:
(testObject.set setterTest):
* js/dom/script-tests/reserved-words-as-property.js:
(testWord):
* js/for-in-cached-expected.txt:
* js/object-literal-direct-put-expected.txt:
* js/object-literal-syntax-expected.txt:
* js/parser-syntax-check-expected.txt:
* js/script-tests/class-syntax-declaration.js:
* js/script-tests/class-syntax-super.js:
(class.Derived.extends.Base.set callBaseMethodInSetter):
(class.Derived.extends.Base.set baseMethodInGetterSetter):
* js/script-tests/for-in-cached.js:
* js/script-tests/object-literal-direct-put.js:
* js/script-tests/object-literal-syntax.js:
* js/script-tests/parser-syntax-check.js:

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

4 years agoUnreviewed, rolling out r181898 and r181909.
commit-queue@webkit.org [Wed, 25 Mar 2015 03:52:10 +0000 (03:52 +0000)]
Unreviewed, rolling out r181898 and r181909.
https://bugs.webkit.org/show_bug.cgi?id=143034

Broke fast/regions/auto-size/autoheight-two-pass-layout-
complex-002.html (Requested by ap on #webkit).

Reverted changesets:

"Improve the offsetWidth/Height layout optimization"
https://bugs.webkit.org/show_bug.cgi?id=143008
http://trac.webkit.org/changeset/181898

"Disable layout dimensions optimization for RenderRegions"
https://bugs.webkit.org/show_bug.cgi?id=143017
http://trac.webkit.org/changeset/181909

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

4 years agoInspector doesn't get focused when opened in dock mode
rniwa@webkit.org [Wed, 25 Mar 2015 02:37:00 +0000 (02:37 +0000)]
Inspector doesn't get focused when opened in dock mode
https://bugs.webkit.org/show_bug.cgi?id=143030

Reviewed by Anders Carlsson.

The bug was caused by platformBringToFront and platformAttach calling makeFirstResponder on WKWebView,
which aren't intended to become the first responder. Fixed the bug by calling makeFirstResponder on the WKView
subview of the WKWebView, which is intended to be used as the first responder on behalf of the web view.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformBringToFront):
(WebKit::WebInspectorProxy::platformAttach):

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

4 years ago[WK2] Responses with 302 HTTP Status Code should not be cached
cdumez@apple.com [Wed, 25 Mar 2015 02:18:10 +0000 (02:18 +0000)]
[WK2] Responses with 302 HTTP Status Code should not be cached
https://bugs.webkit.org/show_bug.cgi?id=143028
<rdar://problem/19714040>

Reviewed by Antti Koivisto.

Source/WebKit2:

Responses with 302 HTTP Status Code should not be cached as per
RFC 7231:
http://tools.ietf.org/html/rfc7231#section-6.1

This patch updates our disk cache policy accordingly.

Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add layout test to check that responses with 302 HTTP Status Code
are not cached.

* http/tests/cache/disk-cache/disk-cache-302-status-code-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-302-status-code.html: Added.

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

4 years agoScripts running in isolated world should not subject to a page's CSP about 'eval'.
commit-queue@webkit.org [Wed, 25 Mar 2015 01:28:28 +0000 (01:28 +0000)]
Scripts running in isolated world should not subject to a page's CSP about 'eval'.
https://bugs.webkit.org/show_bug.cgi?id=141316.

Patch by Zhuo Li <zachli@apple.com> on 2015-03-24
Reviewed by Geoffrey Garen.

Source/WebCore:

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initScript):
We should not impose the main world Content Security Policy onto the isolated world.

LayoutTests:

I added a new Content Security Policy directive, "script-src", so that we do not
allow 'unsafe-eval' in the main world.

Also I have to copy the whole function instead of using eval because
eval is subject to the main world Content Security Policy now.

* http/tests/security/isolatedWorld/bypass-main-world-csp-expected.txt:
* http/tests/security/isolatedWorld/bypass-main-world-csp.html:

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

4 years agoES6: Classes: Early return in sub-class constructor results in returning undefined...
joepeck@webkit.org [Wed, 25 Mar 2015 01:18:18 +0000 (01:18 +0000)]
ES6: Classes: Early return in sub-class constructor results in returning undefined instead of instance
https://bugs.webkit.org/show_bug.cgi?id=143012

Reviewed by Ryosuke Niwa.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitReturn):
Fix handling of "undefined" when returned from a Derived class. It was
returning "undefined" when it should have returned "this".

LayoutTests:

* js/class-constructor-return-expected.txt: Added.
* js/class-constructor-return.html: Added.
* js/script-tests/class-constructor-return.js: Added.
New test covering different return values from constructors.

* js/class-syntax-super-expected.txt:
* js/script-tests/class-syntax-super.js:
Fix test. Returning undefined is the same as an implicit return
and should return `this`.

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

4 years ago[Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
cdumez@apple.com [Wed, 25 Mar 2015 00:55:11 +0000 (00:55 +0000)]
[Mac] Use .cpp file extension instead of .mm for SharedTimerCF and PowerObserverMac
https://bugs.webkit.org/show_bug.cgi?id=143026

Reviewed by Andy Estes.

Use .cpp file extension instead of .mm for SharedTimerCF and
PowerObserverMac.

* WebCore.xcodeproj/project.pbxproj:
* platform/cf/SharedTimerCF.cpp: Renamed from Source/WebCore/platform/cf/SharedTimerCF.mm.
(WebCore::timerFired):
Use WTF::AutodrainedPool instead of @autoreleasepool {}.

* platform/mac/PowerObserverMac.cpp: Renamed from Source/WebCore/platform/mac/PowerObserverMac.mm.

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

4 years agoREGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
ggaren@apple.com [Wed, 25 Mar 2015 00:19:05 +0000 (00:19 +0000)]
REGRESSION (r181458): Heap use-after-free in JSSetIterator destructor
https://bugs.webkit.org/show_bug.cgi?id=142696

Reviewed and tweaked by Geoffrey Garen.

Source/JavaScriptCore:

Before r142556, JSSetIterator::destroy was not defined.
So accidentally MapData::const_iterator in JSSet was never destroyed.
But it had non trivial destructor, decrementing MapData->m_iteratorCount.

After r142556, JSSetIterator::destroy works.
It correctly destruct MapData::const_iterator and m_iteratorCount partially works.
But JSSetIterator::~JSSetIterator requires owned JSSet since it mutates MapData->m_iteratorCount.

It is guaranteed that JSSet is live since JSSetIterator has a reference to JSSet
and marks it in visitChildren (WriteBarrier<Unknown>).
However, the order of destructions is not guaranteed in GC-ed system.

Consider the following case,
allocate JSSet and subsequently allocate JSSetIterator.
And they resides in the separated MarkedBlock, <1> and <2>.

JSSet<1> <- JSSetIterator<2>

And after that, when performing GC, Marker decides that the above 2 objects are not marked.
And Marker also decides MarkedBlocks <1> and <2> can be sweeped.

First Sweeper sweep <1>, destruct JSSet<1> and free MarkedBlock<1>.
Second Sweeper sweep <2>, attempt to destruct JSSetIterator<2>.
However, JSSetIterator<2>'s destructor,
JSSetIterator::~JSSetIterator requires live JSSet<1>, it causes use-after-free.

In this patch, we introduce WeakGCMap into JSMap/JSSet to track live iterators.
When packing the removed elements in JSSet/JSMap, we apply the change to all live
iterators tracked by WeakGCMap.

WeakGCMap can only track JSCell since they are managed by GC.
So we drop JSSet/JSMap C++ style iterators. Instead of C++ style iterator, this patch
introduces JS style iterator signatures into C++ class IteratorData.
If we need to iterate over JSMap/JSSet, use JSSetIterator/JSMapIterator instead of using
IteratorData directly.

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2015-03-24

* runtime/JSMap.cpp:
(JSC::JSMap::destroy):
* runtime/JSMap.h:
(JSC::JSMap::JSMap):
(JSC::JSMap::begin): Deleted.
(JSC::JSMap::end): Deleted.
* runtime/JSMapIterator.cpp:
(JSC::JSMapIterator::destroy):
* runtime/JSMapIterator.h:
(JSC::JSMapIterator::next):
(JSC::JSMapIterator::nextKeyValue):
(JSC::JSMapIterator::iteratorData):
(JSC::JSMapIterator::JSMapIterator):
* runtime/JSSet.cpp:
(JSC::JSSet::destroy):
* runtime/JSSet.h:
(JSC::JSSet::JSSet):
(JSC::JSSet::begin): Deleted.
(JSC::JSSet::end): Deleted.
* runtime/JSSetIterator.cpp:
(JSC::JSSetIterator::destroy):
* runtime/JSSetIterator.h:
(JSC::JSSetIterator::next):
(JSC::JSSetIterator::iteratorData):
(JSC::JSSetIterator::JSSetIterator):
* runtime/MapData.h:
(JSC::MapDataImpl::IteratorData::finish):
(JSC::MapDataImpl::IteratorData::isFinished):
(JSC::MapDataImpl::shouldPack):
(JSC::JSIterator>::MapDataImpl):
(JSC::JSIterator>::KeyType::KeyType):
(JSC::JSIterator>::IteratorData::IteratorData):
(JSC::JSIterator>::IteratorData::next):
(JSC::JSIterator>::IteratorData::ensureSlot):
(JSC::JSIterator>::IteratorData::applyMapDataPatch):
(JSC::JSIterator>::IteratorData::refreshCursor):
(JSC::MapDataImpl::const_iterator::key): Deleted.
(JSC::MapDataImpl::const_iterator::value): Deleted.
(JSC::MapDataImpl::const_iterator::operator++): Deleted.
(JSC::MapDataImpl::const_iterator::finish): Deleted.
(JSC::MapDataImpl::const_iterator::atEnd): Deleted.
(JSC::MapDataImpl::begin): Deleted.
(JSC::MapDataImpl::end): Deleted.
(JSC::MapDataImpl<Entry>::MapDataImpl): Deleted.
(JSC::MapDataImpl<Entry>::clear): Deleted.
(JSC::MapDataImpl<Entry>::KeyType::KeyType): Deleted.
(JSC::MapDataImpl<Entry>::const_iterator::internalIncrement): Deleted.
(JSC::MapDataImpl<Entry>::const_iterator::ensureSlot): Deleted.
(JSC::MapDataImpl<Entry>::const_iterator::const_iterator): Deleted.
(JSC::MapDataImpl<Entry>::const_iterator::~const_iterator): Deleted.
(JSC::MapDataImpl<Entry>::const_iterator::operator): Deleted.
(JSC::=): Deleted.
* runtime/MapDataInlines.h:
(JSC::JSIterator>::clear):
(JSC::JSIterator>::find):
(JSC::JSIterator>::contains):
(JSC::JSIterator>::add):
(JSC::JSIterator>::set):
(JSC::JSIterator>::get):
(JSC::JSIterator>::remove):
(JSC::JSIterator>::replaceAndPackBackingStore):
(JSC::JSIterator>::replaceBackingStore):
(JSC::JSIterator>::ensureSpaceForAppend):
(JSC::JSIterator>::visitChildren):
(JSC::JSIterator>::copyBackingStore):
(JSC::JSIterator>::applyMapDataPatch):
(JSC::MapDataImpl<Entry>::find): Deleted.
(JSC::MapDataImpl<Entry>::contains): Deleted.
(JSC::MapDataImpl<Entry>::add): Deleted.
(JSC::MapDataImpl<Entry>::set): Deleted.
(JSC::MapDataImpl<Entry>::get): Deleted.
(JSC::MapDataImpl<Entry>::remove): Deleted.
(JSC::MapDataImpl<Entry>::replaceAndPackBackingStore): Deleted.
(JSC::MapDataImpl<Entry>::replaceBackingStore): Deleted.
(JSC::MapDataImpl<Entry>::ensureSpaceForAppend): Deleted.
(JSC::MapDataImpl<Entry>::visitChildren): Deleted.
(JSC::MapDataImpl<Entry>::copyBackingStore): Deleted.
* runtime/MapPrototype.cpp:
(JSC::mapProtoFuncForEach):
* runtime/SetPrototype.cpp:
(JSC::setProtoFuncForEach):
* runtime/WeakGCMap.h:
(JSC::WeakGCMap::forEach):
* tests/stress/modify-map-during-iteration.js: Added.
(testValue):
(identityPairs):
(.set if):
(var):
(set map):
* tests/stress/modify-set-during-iteration.js: Added.
(testValue):
(set forEach):
(set delete):

Source/WebCore:

Use JSSetIterator/JSMapIterator to iterate over JSSet and JSMap.

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2015-03-24

* ForwardingHeaders/runtime/JSMapIterator.h: Added.
* ForwardingHeaders/runtime/JSSetIterator.h: Added.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):

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

4 years agoFix crash in WebKit::RemoteObjectRegistry::sendInvocation
andersca@apple.com [Tue, 24 Mar 2015 23:54:04 +0000 (23:54 +0000)]
Fix crash in WebKit::RemoteObjectRegistry::sendInvocation
https://bugs.webkit.org/show_bug.cgi?id=143027
rdar://problem/20208674

Reviewed by Sam Weinig.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController dealloc]):
Make sure to invalidate the _WKRemoteObjectRegistry like we do in the UI process.

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

4 years ago[WK2] Responses with 204 HTTP Status Code should be cacheable by default
cdumez@apple.com [Tue, 24 Mar 2015 23:46:03 +0000 (23:46 +0000)]
[WK2] Responses with 204 HTTP Status Code should be cacheable by default
https://bugs.webkit.org/show_bug.cgi?id=143020
<rdar://problem/20281529>

Reviewed by Antti Koivisto.

Source/WebKit2:

Make responses with 204 HTTP Status Code cacheable by default, as
per RFC 7231:
http://tools.ietf.org/html/rfc7231#section-6.3.5

Test: http/tests/cache/disk-cache/disk-cache-204-status-code.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add test to make sure that responses with 204 HTTP Status Code are
cacheable by default.

* http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-204-status-code.html: Added.
* http/tests/cache/disk-cache/resources/cache-test.js:
Re-introduce support for generating responses with only headers (no body).
This was mistakenly dropped when I rebased my patch for r181895.

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

4 years ago[iOS] Remove unused keyboard code in WKSelectPopover class.
enrica@apple.com [Tue, 24 Mar 2015 23:37:34 +0000 (23:37 +0000)]
[iOS] Remove unused keyboard code in WKSelectPopover class.
https://bugs.webkit.org/show_bug.cgi?id=143021

Reviewed by Joseph Pecoraro.

WKSelectPopover created an instance of UIKeyboard that was
initialized in initWithView but never used. Removing the
obsolete code.

* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):

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

4 years agoTried to fix the iOS Simulator build.
mitz@apple.com [Tue, 24 Mar 2015 23:25:47 +0000 (23:25 +0000)]
Tried to fix the iOS Simulator build.

* platform/spi/cocoa/QuartzCoreSPI.h:

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

4 years agoMake URL filter patterns matching consistent and add a simple canonicalization step
benjamin@webkit.org [Tue, 24 Mar 2015 23:24:36 +0000 (23:24 +0000)]
Make URL filter patterns matching consistent and add a simple canonicalization step
https://bugs.webkit.org/show_bug.cgi?id=142998

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-24
Reviewed by Alex Christensen.

Source/WebCore:

This patch makes two changes to the url filter input:
-Make the matching "Search" by default, the pattern can now appear anywhere
 in the URL by default.
-Make the input a little less fragile: do not explode on valid input
 that is not formatted in a certain way.

To implement the search behavior, I simply add an implict ".*" in front of the patterns
when that make sense.

To make the input more solid, we do some little modification on the input:
-Remove duplicated ".*".
-Remove matching suffixes that do not bring new information.
-Unify all the ".*" in the same format.

Why do that here? That should be done through a graph analysis on the machine.

The reason is this is incredibly cheap compared to the graph analysis. Any state
removed upfront will save the handling of several hundred nodes in the deterministic
graph.

* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
(WebCore::ContentExtensions::Term::isUniversalTransition):
(WebCore::ContentExtensions::GraphBuilder::finalize):
(WebCore::ContentExtensions::GraphBuilder::assertionBOL):
(WebCore::ContentExtensions::GraphBuilder::fail):
(WebCore::ContentExtensions::GraphBuilder::simplifySunkTerms):

Tools:

* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:

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

4 years agoWeb Inspector: REGRESSION (r179286): ReferenceError: Can't find variable: selector
commit-queue@webkit.org [Tue, 24 Mar 2015 23:10:30 +0000 (23:10 +0000)]
Web Inspector: REGRESSION (r179286): ReferenceError: Can't find variable: selector
https://bugs.webkit.org/show_bug.cgi?id=143022

Patch by Tobias Reiss <tobi+webkit@basecode.de> on 2015-03-24
Reviewed by Timothy Hatcher.

Fix a regression where a missing variable statement causes a ReferenceError.

* UserInterface/Models/DOMNodeStyles.js:

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

4 years agoRegression(r181671): Caused Timer-related crashes on iOS / WK1
cdumez@apple.com [Tue, 24 Mar 2015 23:10:03 +0000 (23:10 +0000)]
Regression(r181671): Caused Timer-related crashes on iOS / WK1
https://bugs.webkit.org/show_bug.cgi?id=143025

Reviewed by Andy Estes.

Call CFRunLoopAddTimer() on WebThreadRunLoop() instead of
CFRunLoopGetCurrent() for iOS, as we did before r181671.

I inadvertently changed this in r181671 when merging the Mac
and iOS implementations.

No new tests, already covered by existing tests.

* platform/cf/SharedTimerCF.mm:
(WebCore::setSharedTimerFireInterval):

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

4 years agoThe ExecutionTimeLimit test should use its own JSGlobalContextRef.
mark.lam@apple.com [Tue, 24 Mar 2015 22:56:03 +0000 (22:56 +0000)]
The ExecutionTimeLimit test should use its own JSGlobalContextRef.
<https://webkit.org/b/143024>

Reviewed by Geoffrey Garen.

Currently, the ExecutionTimeLimit test is using a JSGlobalContextRef
passed in from testapi.c.  It should create its own for better
encapsulation of the test.

* API/tests/ExecutionTimeLimitTest.cpp:
(currentCPUTimeAsJSFunctionCallback):
(testExecutionTimeLimit):
* API/tests/ExecutionTimeLimitTest.h:
* API/tests/testapi.c:
(main):

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

4 years agoAnother attempted test fix after http://trac.webkit.org/changeset/181907
bdakin@apple.com [Tue, 24 Mar 2015 22:55:23 +0000 (22:55 +0000)]
Another attempted test fix after trac.webkit.org/changeset/181907

* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoWeb Inspector: Adopt ES6 Class Syntax for CSSStyleDeclarationTextEditor
commit-queue@webkit.org [Tue, 24 Mar 2015 22:54:07 +0000 (22:54 +0000)]
Web Inspector: Adopt ES6 Class Syntax for CSSStyleDeclarationTextEditor
https://bugs.webkit.org/show_bug.cgi?id=143019

Patch by Tobias Reiss <tobi+webkit@basecode.de> on 2015-03-24
Reviewed by Timothy Hatcher.

- Convert CSSStyleDeclarationTextEditor to use class syntax
- Convert constructor functions to constructor methods
- Convert "constructor.method" to class static methods where possible
- Convert all methods to method syntax, eliminate commas between methods
- Convert all superclass calls in classes to use "super"
- Removed FIXME from WebInspector.Object subclasses, added calls to super.
- Fixed strict mode issues now that classes enforce strict mode (see below).

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
Many function declarations modified.

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

4 years agoAttempted test fix after http://trac.webkit.org/changeset/181907
bdakin@apple.com [Tue, 24 Mar 2015 22:47:55 +0000 (22:47 +0000)]
Attempted test fix after trac.webkit.org/changeset/181907

* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoSource/WebCore:
mitz@apple.com [Tue, 24 Mar 2015 22:47:53 +0000 (22:47 +0000)]
Source/WebCore:
WebCore part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=143023

Reviewed by Tim Horton.

* platform/spi/cocoa/QuartzCoreSPI.h: Added the declaration of
CARenderServerRenderLayerWithTransform.

Source/WebKit2:
WebKit2 part of <rdar://problem/20282863> Transforms are flattened in snapshots of on-screen WKWebViews
https://bugs.webkit.org/show_bug.cgi?id=143023

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): If the view is in a
window, use CARenderServerRenderLayerWithTransform to synchronously capture a snapshot of
its layer tree into an IOSurfcae, then call the completion handler with an image created
from the IOSurface.

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

4 years agoDisable layout dimensions optimization for RenderRegions
hyatt@apple.com [Tue, 24 Mar 2015 21:50:32 +0000 (21:50 +0000)]
Disable layout dimensions optimization for RenderRegions
https://bugs.webkit.org/show_bug.cgi?id=143017

Reviewed by Dean Jackson.

* dom/Document.cpp:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
Turn off the optimization for regions, since auto height regions can change size
without needing a layout.

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

4 years agoUnreviewed gardening after r181901.
joepeck@webkit.org [Tue, 24 Mar 2015 21:39:05 +0000 (21:39 +0000)]
Unreviewed gardening after r181901.

* platform/mac/http/tests/media/media-source/mediasource-sourcebuffer-mode-expected.txt:
Update the expected results for platform specific results that include
a stringified function.

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

4 years agoAdd events related to force click gesture
bdakin@apple.com [Tue, 24 Mar 2015 21:31:28 +0000 (21:31 +0000)]
Add events related to force click gesture
https://bugs.webkit.org/show_bug.cgi?id=142836
-and corresponding-
rdar://problem/20210239

Reviewed by Dean Jackson.

Source/WebCore:

This patch adds six new events for the force click gesture:

webkitmouseforcewillbegin -> Event is sent just before mousedown to indicate that
force can be perceived if the user presses any harder. The author should prevent
default on this event to both prevent the user agent’s default force click
features and to receive the other 5 events.

webkitmouseforcechanged -> This event fires whenever force changes between the
mousedown and mouseup. It is a new type of mouse event that includes a force
variable which is a normalized number between 0 (corresponds to click) and 1
(corresponds to force click). In this patch, I have only added code to send this
event between mousedown and mouseforcedown, but as a followup patch, we plan to
send it through mouseup.

webkitmouseforcecancelled -> If the user releases their finger from the trackpad
after pressing hard enough to send webkitmouseforcewillbegin events but not hard
enough to force click, this event will be sent to indicate that the user bailed
out on the gesture.

webkitmouseforcedown -> The down part of the force click.

webkitmouseforceup -> The up part of the force click. This event is added in this
patch, but does not yet fire. That is work for a follow-up patch.

webkitmouseforceclick -> The equivalent of the click event for the force click.
Should fire just after webkitmouseforceup. This event is added in this patch, but
does not yet fire. That is work for a follow-up patch.

Add new files for WebKitMouseForceEvent to build systems.
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* WebCore.xcodeproj/project.pbxproj:

Plumbing for new events.
* dom/Document.idl:

Code to dispatch the new events. Currently the code that calls these functions is
in WebKit2.
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin):
(WebCore::Element::dispatchMouseForceChanged):
(WebCore::Element::dispatchMouseForceDown):
(WebCore::Element::dispatchMouseForceUp):
(WebCore::Element::dispatchMouseForceClick):
(WebCore::Element::dispatchMouseForceCancelled):
* dom/Element.h:

More plumbing.
* dom/Element.idl:
* dom/EventNames.h:
* dom/EventNames.in:

Our new type of mouse event that includes force.
* dom/WebKitMouseForceEvent.cpp: Added.
(WebCore::WebKitMouseForceEventInit::WebKitMouseForceEventInit):
(WebCore::WebKitMouseForceEvent::WebKitMouseForceEvent):
(WebCore::WebKitMouseForceEvent::~WebKitMouseForceEvent):
(WebCore::WebKitMouseForceEvent::eventInterface):
* dom/WebKitMouseForceEvent.h: Added.
* dom/WebKitMouseForceEvent.idl: Added.

More plumbing.
* html/HTMLAttributeNames.in:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* html/HTMLBodyElement.idl:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
* page/DOMWindow.idl:
* page/EventHandler.h:
(WebCore::EventHandler::lastMouseDownEvent):

Source/WebKit2:

ActionMenuHitTestResult has a new bool indicating whether to not the HitTestResult
will prevent default.
* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):

Send immediateActionDidUpdate and the normalized force over the the WebProcess.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::immediateActionDidUpdate):
* UIProcess/WebPageProxy.h:

We need a dummy animation controller when web content is overriding the default
behavior.
* UIProcess/mac/WKImmediateActionController.mm:

Send along the update information.
(-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):

Use the dummy animation controller if default has been prevented.
(-[WKImmediateActionController _defaultAnimationController]):
(-[WKImmediateActionController _updateImmediateActionItem]):

Keep track of whether m_lastActionMenuHitTes prevented the default immediate
action behavior.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Call dispatchMouseForceMayBegin() at hit test time.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):

Call dispatchMouseForceChanged() if appropriate.
(WebKit::WebPage::immediateActionDidUpdate):

Call dispatchMouseForceCancelled() if appropriate.
(WebKit::WebPage::immediateActionDidCancel):

Call dispatchMouseForceDown() if appropriate.
(WebKit::WebPage::immediateActionDidComplete):

Source/WTF:

New enable flag for the events.
* wtf/FeatureDefines.h:

LayoutTests:

* fast/dom/event-handler-attributes-expected.txt:
* fast/dom/event-handler-attributes.html:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

4 years agoFix designated initializer violations
andersca@apple.com [Tue, 24 Mar 2015 21:17:26 +0000 (21:17 +0000)]
Fix designated initializer violations
https://bugs.webkit.org/show_bug.cgi?id=143016
rdar://problem/20268858

Reviewed by Dan Bernstein.

Source/WebCore:

Mark -[DOMObject init] as unavailable.

* bindings/objc/DOMObject.h:
* bindings/objc/DOMObject.mm:
(-[DOMObject init]):

Source/WebKit/mac:

Move -[WebBackForwardList initWithBackForwardList:] to the implementation instead of a category since
nobody calls it outside of WebBackForwardList.mm.

* History/WebBackForwardList.mm:
* History/WebBackForwardListInternal.h:

Source/WebKit2:

Move -[WKProcessPool _initWithConfiguration:] to a class extension so we can make it the designated initializer.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _initWithConfiguration:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

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

4 years agoWeb Inspector: Workaround issue causing uncaught exception in Inspector
commit-queue@webkit.org [Tue, 24 Mar 2015 21:16:52 +0000 (21:16 +0000)]
Web Inspector: Workaround issue causing uncaught exception in Inspector
https://bugs.webkit.org/show_bug.cgi?id=143015

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-24
Reviewed by Timothy Hatcher.

Workaround <https://webkit.org/b/143012> and avoid early returning in constructors.

* UserInterface/Controllers/ReplayManager.js:
(WebInspector.ReplayManager.class.ReplayManager):

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

4 years ago[WK2] Responses with 404 HTTP Status Code should be cacheable by default
cdumez@apple.com [Tue, 24 Mar 2015 20:42:20 +0000 (20:42 +0000)]
[WK2] Responses with 404 HTTP Status Code should be cacheable by default
https://bugs.webkit.org/show_bug.cgi?id=143014
<rdar://problem/20280310>

Reviewed by Antti Koivisto.

Source/WebKit2:

Make responses with 404 HTTP Status Code cacheable by default, as
per RFC 7231:
http://tools.ietf.org/html/rfc7231#section-6.5.4

Test: http/tests/cache/disk-cache/disk-cache-404-status-code.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add test to make sure that responses with 404 HTTP Status Code are
cacheable by default.

* http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-404-status-code.html: Added.
* http/tests/cache/disk-cache/resources/generate-response.cgi:

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

4 years agoWeb Inspector: unify resizer implementations used by DataGrid and Sidebar
burg@cs.washington.edu [Tue, 24 Mar 2015 20:41:47 +0000 (20:41 +0000)]
Web Inspector: unify resizer implementations used by DataGrid and Sidebar
https://bugs.webkit.org/show_bug.cgi?id=142407

Reviewed by Timothy Hatcher.

Both of these implementations do the same thing slightly differently. Unify the code
and use the "glass pane" technique to preserve cursor while dragging over links or text.

This patch implements vertical and horizontal rule orientations. Further refactorings
to use this class may need to add "Indeterminate" orientation to support moving the inspector
window by its fake toolbar element.

* UserInterface/Main.html:
* UserInterface/Views/DataGrid.css:
(.data-grid .resizer):
(.data-grid-resizer): Deleted.
* UserInterface/Views/DataGrid.js: Store Resizer instances rather than resizer elements.
Use symbols to secretly store neighbor column ids on the resizer objects. Stop using
WebInspector.elementDragStart, as I would like to deprecate it in favor of Resizer instances.

(WebInspector.DataGrid):
(WebInspector.DataGrid.prototype._positionResizerElements):
(WebInspector.DataGrid.prototype.resizerDragStarted):
(WebInspector.DataGrid.prototype.resizerDragging):
(WebInspector.DataGrid.prototype.resizerDragEnded):
(WebInspector.DataGrid.prototype._startResizerDragging): Deleted.
(WebInspector.DataGrid.prototype._resizerDragging): Deleted.
(WebInspector.DataGrid.prototype._endResizerDragging): Deleted.
* UserInterface/Views/Resizer.css:
(.resizer):
(.resizer.vertical-rule):
(.resizer.horizontal-rule):
(.glass-pane-for-drag):
* UserInterface/Views/Resizer.js: Added.
(WebInspector.Resizer):
(WebInspector.Resizer.prototype.get element):
(WebInspector.Resizer.prototype.get orientation):
(WebInspector.Resizer.prototype.get initialPosition):
(WebInspector.Resizer.prototype._currentPosition):
(WebInspector.Resizer.prototype._resizerMouseDown):
(WebInspector.Resizer.prototype._resizerMouseMoved):
(WebInspector.Resizer.prototype._resizerMouseUp):
* UserInterface/Views/Sidebar.css:
(.sidebar > .resizer): Deleted.
* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar):
(WebInspector.Sidebar.prototype.resizerDragStarted):
(WebInspector.Sidebar.prototype.resizerDragging):
(WebInspector.Sidebar.prototype.resizerDragEnded):
(WebInspector.Sidebar.prototype._navigationItemSelected):
(WebInspector.Sidebar.prototype._resizerMouseDown): Deleted.
(WebInspector.Sidebar.prototype._resizerMouseMoved): Deleted.
(WebInspector.Sidebar.prototype._resizerMouseUp): Deleted.

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

4 years ago[WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
cdumez@apple.com [Tue, 24 Mar 2015 20:11:38 +0000 (20:11 +0000)]
[WK2] Remove NetworkCache FIXME comment about caching responses to OPTIONS requests
https://bugs.webkit.org/show_bug.cgi?id=143009

Reviewed by Andreas Kling.

Remove NetworkCache FIXME comment about caching responses to OPTIONS
method as RFC 7234 says "Responses to the OPTIONS method are not
cacheable" [1].

[1] http://tools.ietf.org/html/rfc7231#page-31

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canRetrieve):

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

4 years agoES6: Object Literal Methods toString is missing method name
commit-queue@webkit.org [Tue, 24 Mar 2015 20:07:26 +0000 (20:07 +0000)]
ES6: Object Literal Methods toString is missing method name
https://bugs.webkit.org/show_bug.cgi?id=142992

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-24
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Always stringify functions in the pattern:

  "function " + <function name> + <text from opening parenthesis to closing brace>.

* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
Update the path that was not stringifying in this pattern.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedFunctionExecutable::parametersStartOffset):
* parser/Nodes.h:
* runtime/Executable.cpp:
(JSC::FunctionExecutable::FunctionExecutable):
* runtime/Executable.h:
(JSC::FunctionExecutable::parametersStartOffset):
Pass the already known function parameter opening parenthesis
start offset through to the FunctionExecutable.

* tests/mozilla/js1_5/Scope/regress-185485.js:
(with.g):
Add back original space in this test that was removed by r181810
now that we have the space again in stringification.

LayoutTests:

* js/class-syntax-default-constructor-expected.txt:
This test was already failing, it now fails in a different way.

* js/object-literal-computed-methods-expected.txt:
* js/object-literal-methods-expected.txt:
These tests now pass.

* fast/dom/TreeWalker/acceptNode-filter-expected.txt:
* js/destructuring-assignment-expected.txt:
* js/dfg-redundant-load-of-captured-variable-proven-constant-expected.txt:
* js/dfg-resolve-global-specific-dictionary-expected.txt:
* js/dom/JSON-parse-expected.txt:
* js/dom/JSON-stringify-expected.txt:
* js/dom/dfg-strcat-over-objects-then-exit-on-it-expected.txt:
* js/dom/function-prototype-expected.txt:
* js/dom/toString-and-valueOf-override-expected.txt:
* js/kde/lval-exceptions-expected.txt:
* storage/domstorage/localstorage/string-conversion-expected.txt:
* storage/domstorage/sessionstorage/string-conversion-expected.txt:
* js/dom/script-tests/dfg-strcat-over-objects-then-exit-on-it.js:
* js/script-tests/dfg-redundant-load-of-captured-variable-proven-constant.js:
* js/script-tests/dfg-resolve-global-specific-dictionary.js:
* js/dom/function-prototype.html:
Update tests to add expected whitespace for stringifying a function
with no name.

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

4 years agoCSS Selectors Level 4: enable case-insensitive attribute matching by default
benjamin@webkit.org [Tue, 24 Mar 2015 19:56:34 +0000 (19:56 +0000)]
CSS Selectors Level 4: enable case-insensitive attribute matching by default
https://bugs.webkit.org/show_bug.cgi?id=142960

Reviewed by Andreas Kling.

Source/WebCore:

All open issues have been resolved, enable the feature by default.

Test: fast/css/attribute-selector-case-insensitive.html

* css/CSSGrammar.y.in:

LayoutTests:

This test is imported from blink. That's the only test
they have for this feature.

* fast/css/attribute-selector-case-insensitive-expected.txt: Added.
* fast/css/attribute-selector-case-insensitive.html: Added.

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

4 years agoMediaControls: Scrubber and Time displays have the incorrect blending
dino@apple.com [Tue, 24 Mar 2015 19:53:17 +0000 (19:53 +0000)]
MediaControls: Scrubber and Time displays have the incorrect blending
https://bugs.webkit.org/show_bug.cgi?id=143011
<rdar://problem/20245251>

Reviewed by Eric Carlson.

The scrubber in media controls should use plus-darker blending. Then
the scrubber itself should use a slightly transparent black (55% opacity)
when drawing.

* Modules/mediacontrols/mediaControlsiOS.css:
(audio::-webkit-media-controls-timeline): Add the blend mode.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.drawTimelineBackground): Start drawing with
transparency. I changed the order of rendering to make it
more clear we draw the three parts in left to right order.

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

4 years agoImprove the offsetWidth/Height layout optimization
hyatt@apple.com [Tue, 24 Mar 2015 19:13:06 +0000 (19:13 +0000)]
Improve the offsetWidth/Height layout optimization
https://bugs.webkit.org/show_bug.cgi?id=143008

Reviewed by Dean Jackson.

* dom/Document.cpp:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
* dom/Document.h:
Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
the positioning restrictions on the optimization check.

* dom/Element.cpp:
(WebCore::Element::offsetWidth):
(WebCore::Element::offsetHeight):
Change to use Element& instead of Element*.

(WebCore::Element::clientWidth):
(WebCore::Element::clientHeight):
(WebCore::Element::scrollWidth):
(WebCore::Element::scrollHeight):
Turn on the optimization for clientWidth/Height and scrollWidth/Height.

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

4 years agoStop image from displaying when src attribute is removed or emptied
yoav@yoav.ws [Tue, 24 Mar 2015 17:25:31 +0000 (17:25 +0000)]
Stop image from displaying when src attribute is removed or emptied
https://bugs.webkit.org/show_bug.cgi?id=142677

Reviewed by Chris Dumez.

Source/WebCore:

Previously, we ignored empty attribute as failed URL, and didn't update the
renderer when an image was removed. This patch fixes that.

Tests: fast/dom/HTMLImageElement/image-empty-src.html
       fast/dom/HTMLImageElement/image-remove-src.html

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):

LayoutTests:

* fast/dom/HTMLImageElement/image-empty-src-expected.html: Added.
* fast/dom/HTMLImageElement/image-empty-src.html: Added.
* fast/dom/HTMLImageElement/image-remove-src-expected.html: Added.
* fast/dom/HTMLImageElement/image-remove-src.html: Added.
* fast/dom/HTMLImageElement/image-empty-srcset-expected.html: Added.
* fast/dom/HTMLImageElement/image-empty-srcset.html: Added.
* fast/dom/HTMLImageElement/image-remove-srcset-expected.html: Added.
* fast/dom/HTMLImageElement/image-remove-srcset.html: Added.

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

4 years ago[Win] Update baselines after r181889.
bfulgham@apple.com [Tue, 24 Mar 2015 17:06:38 +0000 (17:06 +0000)]
[Win] Update baselines after r181889.
https://bugs.webkit.org/show_bug.cgi?id=141869

* platform/win/css3/selectors3/xhtml/css3-modsel-15c-expected.txt:
* platform/win/css3/selectors3/xml/css3-modsel-15c-expected.txt:
* platform/win/fast/dom/NavigatorContentUtils/is-protocol-handler-registered-expected.txt:

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

4 years ago[WK2] NetworkCache retrievals fail for entries with no body
cdumez@apple.com [Tue, 24 Mar 2015 16:50:55 +0000 (16:50 +0000)]
[WK2] NetworkCache retrievals fail for entries with no body
https://bugs.webkit.org/show_bug.cgi?id=142979
<rdar://problem/20264100>

Reviewed by Antti Koivisto.

Source/WebKit2:

NetworkCache retrievals were failing for entries with no body because
decodeEntry() doesn't correctly handle this case. In particular, the
following check fails:
"metaData.bodyOffset + metaData.bodySize == fileData.size()".
This is because bodyOffset is pageSize-aligned.

As a result, the following resource on apple.com is stored in the cache
but we fail to reuse it and reload it from the network every time:
http://images.apple.com/home/styles/promos.css

This patch updates decodeEntry() to create a null Data object for the
body if bodySize is 0.

* NetworkProcess/cache/NetworkCacheDataCocoa.mm:
(WebKit::NetworkCache::Data::data):
Do not attempt to initialize m_data if m_dispatchData is null as the
call to dispatch_data_create_map() would then crash. We now return
null in this case. This is needed as decodeStorageEntry() in
NetworkCache.cpp constructs a SharedBuffer from
storageEntry.body.data() and the body may be null.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::decodeEntry):

LayoutTests:

Add network disk cache validation test for resources that have no body
(only headers).

* http/tests/cache/disk-cache/disk-cache-validation-no-body-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-validation-no-body.html: Added.
* http/tests/cache/disk-cache/resources/generate-response-no-body.cgi: Added.

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

4 years ago[WK2] The WebKit network cache does not cache responses with "Content-Disposition...
cdumez@apple.com [Tue, 24 Mar 2015 16:44:19 +0000 (16:44 +0000)]
[WK2] The WebKit network cache does not cache responses with "Content-Disposition: attachment" header
https://bugs.webkit.org/show_bug.cgi?id=142989
<rdar://problem/20265992>

Reviewed by Antti Koivisto.

Source/WebKit2:

Update our WebKit network cache policy to cache responses with
"Content-Disposition: attachment" header. There is no reason we cannot
cache these and our memory cache already does.

This was causing a decent amount of cache misses in the wild. I have
noticed for example that when loading disney.com, we fail to cache the
following resources because of this policy:
http://pagead2.googlesyndication.com/pagead/osd.js
http://pagead2.googlesyndication.com/pagead/show_companion_ad.js

Those resources have Cache-Control headers that indicate they are meant
to be cacheable.

Test: http/tests/cache/disk-cache-validation-attachment.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add layout test to check that resources whose response has the
"Content-Disposition: attachment" header are cacheable.

Also move all disk cache layout tests to a disk-cache sub-folder to
facilitate skipping on platforms that don't have the WebKit network
disk cache.

* http/tests/cache/disk-cache/disk-cache-disable-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-disable-expected.txt.
* http/tests/cache/disk-cache/disk-cache-disable.html: Renamed from LayoutTests/http/tests/cache/disk-cache-disable.html.
* http/tests/cache/disk-cache/disk-cache-redirect-to-data-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-redirect-to-data-expected.txt.
* http/tests/cache/disk-cache/disk-cache-redirect-to-data.html: Renamed from LayoutTests/http/tests/cache/disk-cache-redirect-to-data.html.
* http/tests/cache/disk-cache/disk-cache-validation-attachment-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-validation-attachment.html: Added.
* http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-validation-back-navigation-policy-expected.txt.
* http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html: Renamed from LayoutTests/http/tests/cache/disk-cache-validation-back-navigation-policy.html.
* http/tests/cache/disk-cache/disk-cache-validation-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-validation-expected.txt.
* http/tests/cache/disk-cache/disk-cache-validation.html: Renamed from LayoutTests/http/tests/cache/disk-cache-validation.html.
* http/tests/cache/disk-cache/disk-cache-vary-cookie-expected.txt: Renamed from LayoutTests/http/tests/cache/disk-cache-vary-cookie-expected.txt.
* http/tests/cache/disk-cache/disk-cache-vary-cookie.html: Renamed from LayoutTests/http/tests/cache/disk-cache-vary-cookie.html.
* http/tests/cache/disk-cache/resources/cache-test.js: Renamed from LayoutTests/http/tests/cache/resources/cache-test.js.
* http/tests/cache/disk-cache/resources/generate-response.cgi: Renamed from LayoutTests/http/tests/cache/resources/generate-response.cgi.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

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

4 years ago[OpenWebRTC] RealtimeMediaSourceCenter implementation
philn@webkit.org [Tue, 24 Mar 2015 15:18:21 +0000 (15:18 +0000)]
[OpenWebRTC] RealtimeMediaSourceCenter implementation
https://bugs.webkit.org/show_bug.cgi?id=142476

Reviewed by Eric Carlson.

The old GStreamer MediaStreamCenter is replaced by the OpenWebRTC
RealtimeMediaSourceCenter. It is not yet able to correctly assess
MediaConstraints so it selects the first audio/video sources
available through OpenWebRTC.

* PlatformEfl.cmake: Add new files to the build.
* PlatformGTK.cmake: Ditto.
* platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp: Removed.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.cpp: Added.
(WebCore::initializeOpenWebRTC): Simple function to initialize the
framework, it is going to be used by the PeerConnection backend as well.
* platform/mediastream/openwebrtc/OpenWebRTCUtilities.h: Added.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp: Added.
(WebCore::mediaSourcesAvailableCallback): Function invoked once
the media sources discovery succeeded within OpenWebRTC.
(WebCore::RealtimeMediaSourceCenter::platformCenter): Instantiate
the OpenWebRTC RealtimeMediaSourceCenter.
(WebCore::RealtimeMediaSourceCenterOwr::RealtimeMediaSourceCenterOwr):
(WebCore::RealtimeMediaSourceCenterOwr::~RealtimeMediaSourceCenterOwr):
(WebCore::RealtimeMediaSourceCenterOwr::validateRequestConstraints):
Schedule a discovery process for the capture sources.
(WebCore::RealtimeMediaSourceCenterOwr::createMediaStream): Pick
the first audio/video sources and create a MediaStream accordingly.
(WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources):
Not yet implemented.
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
Method invoked once the capture sources process succeeded. Parse
them and create an internal cache of RealtimeMediaSources accordingly.
(WebCore::RealtimeMediaSourceCenterOwr::firstSource): Utility
function to fetch the first source of the given type from the
RealtimeMediaSources cache.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h: Renamed from Source/WebCore/platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h: Added.

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

4 years ago[EFL] Add OpenWebRTC in jhbuild
ossy@webkit.org [Tue, 24 Mar 2015 15:11:39 +0000 (15:11 +0000)]
[EFL] Add OpenWebRTC in jhbuild
https://bugs.webkit.org/show_bug.cgi?id=142778

Reviewed by Gyuyoung Kim.

Original patch by Philippe Normand <pnormand@igalia.com>

.:

* Source/cmake/OptionsEfl.cmake: Look for OpenWebRTC library if
mediastream build is enabled.

Source/WebCore:

* PlatformEfl.cmake: Add OpenWebRTC CFLAGS and LDFLAGS.

Tools:

* efl/install-dependencies: Dependencies for OpenWebRTC.
* efl/jhbuild.modules: build OpenWebRTC, libusrsctp, libnice and
the openwebrtc gst plugins.

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

4 years agoREGRESSION (172175-172177): Change in for...in processing causes properties added...
msaboff@apple.com [Tue, 24 Mar 2015 10:05:21 +0000 (10:05 +0000)]
REGRESSION (172175-172177): Change in for...in processing causes properties added in loop to be enumerated
https://bugs.webkit.org/show_bug.cgi?id=142856

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Refactored the way the for .. in enumeration over objects is done.  We used to make three C++ calls to
get info for three loops to iterate over indexed properties, structure properties and other properties,
respectively.  We still have the three loops, but now we make one C++ call to get all the info needed
for all loops before we exectue any enumeration.

The JSPropertyEnumerator has a count of the indexed properties and a list of named properties.
The named properties are one list, with structured properties in the range [0,m_endStructurePropertyIndex)
and the generic properties in the range [m_endStructurePropertyIndex, m_endGenericPropertyIndex);

Eliminated the bytecodes op_get_structure_property_enumerator, op_get_generic_property_enumerator and
op_next_enumerator_pname.
Added the bytecodes op_get_property_enumerator, op_enumerator_structure_pname and op_enumerator_generic_pname.
The bytecodes op_enumerator_structure_pname and op_enumerator_generic_pname are similar except for what
end value we stop iterating on.

Made corresponding node changes to the DFG and FTL for the bytecode changes.

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitGetPropertyEnumerator):
(JSC::BytecodeGenerator::emitEnumeratorStructurePropertyName):
(JSC::BytecodeGenerator::emitEnumeratorGenericPropertyName):
(JSC::BytecodeGenerator::emitGetStructurePropertyEnumerator): Deleted.
(JSC::BytecodeGenerator::emitGetGenericPropertyEnumerator): Deleted.
(JSC::BytecodeGenerator::emitNextEnumeratorPropertyName): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitMultiLoopBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileGetEnumerableLength):
(JSC::FTL::LowerDFGToLLVM::compileGetPropertyEnumerator):
(JSC::FTL::LowerDFGToLLVM::compileGetEnumeratorStructurePname):
(JSC::FTL::LowerDFGToLLVM::compileGetEnumeratorGenericPname):
(JSC::FTL::LowerDFGToLLVM::compileGetStructurePropertyEnumerator): Deleted.
(JSC::FTL::LowerDFGToLLVM::compileGetGenericPropertyEnumerator): Deleted.
(JSC::FTL::LowerDFGToLLVM::compileGetEnumeratorPname): Deleted.
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_enumerator_structure_pname):
(JSC::JIT::emit_op_enumerator_generic_pname):
(JSC::JIT::emit_op_get_property_enumerator):
(JSC::JIT::emit_op_next_enumerator_pname): Deleted.
(JSC::JIT::emit_op_get_structure_property_enumerator): Deleted.
(JSC::JIT::emit_op_get_generic_property_enumerator): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_enumerator_structure_pname):
(JSC::JIT::emit_op_enumerator_generic_pname):
(JSC::JIT::emit_op_next_enumerator_pname): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LowLevelInterpreter.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::create):
(JSC::JSPropertyNameEnumerator::finishCreation):
* runtime/JSPropertyNameEnumerator.h:
(JSC::JSPropertyNameEnumerator::indexedLength):
(JSC::JSPropertyNameEnumerator::endStructurePropertyIndex):
(JSC::JSPropertyNameEnumerator::endGenericPropertyIndex):
(JSC::JSPropertyNameEnumerator::indexedLengthOffset):
(JSC::JSPropertyNameEnumerator::endStructurePropertyIndexOffset):
(JSC::JSPropertyNameEnumerator::endGenericPropertyIndexOffset):
(JSC::JSPropertyNameEnumerator::cachedInlineCapacityOffset):
(JSC::propertyNameEnumerator):
(JSC::JSPropertyNameEnumerator::cachedPropertyNamesLengthOffset): Deleted.
(JSC::structurePropertyNameEnumerator): Deleted.
(JSC::genericPropertyNameEnumerator): Deleted.
* runtime/Structure.cpp:
(JSC::Structure::setCachedPropertyNameEnumerator):
(JSC::Structure::cachedPropertyNameEnumerator):
(JSC::Structure::canCachePropertyNameEnumerator):
(JSC::Structure::setCachedStructurePropertyNameEnumerator): Deleted.
(JSC::Structure::cachedStructurePropertyNameEnumerator): Deleted.
(JSC::Structure::setCachedGenericPropertyNameEnumerator): Deleted.
(JSC::Structure::cachedGenericPropertyNameEnumerator): Deleted.
(JSC::Structure::canCacheStructurePropertyNameEnumerator): Deleted.
(JSC::Structure::canCacheGenericPropertyNameEnumerator): Deleted.
* runtime/Structure.h:
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::visitChildren):
(JSC::StructureRareData::cachedPropertyNameEnumerator):
(JSC::StructureRareData::setCachedPropertyNameEnumerator):
(JSC::StructureRareData::cachedStructurePropertyNameEnumerator): Deleted.
(JSC::StructureRareData::setCachedStructurePropertyNameEnumerator): Deleted.
(JSC::StructureRareData::cachedGenericPropertyNameEnumerator): Deleted.
(JSC::StructureRareData::setCachedGenericPropertyNameEnumerator): Deleted.
* runtime/StructureRareData.h:
* tests/stress/for-in-delete-during-iteration.js:

LayoutTests:

New tests and rebased one test.

* js/for-in-modify-in-loop-expected.txt: Added.
* js/for-in-modify-in-loop.html: Added.
* js/script-tests/for-in-modify-in-loop.js: Added.
(haveSameProperties):
(each):
(testAdd):
(testAddDelete):
* http/tests/security/cross-frame-access-enumeration-expected.txt: Rebased.

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

4 years agoUnreviewed build fix for debug builds.
msaboff@apple.com [Tue, 24 Mar 2015 09:22:34 +0000 (09:22 +0000)]
Unreviewed build fix for debug builds.

* runtime/ExceptionHelpers.cpp:
(JSC::invalidParameterInSourceAppender):

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

4 years agoImprove error messages in JSC
saambarati1@gmail.com [Tue, 24 Mar 2015 07:30:05 +0000 (07:30 +0000)]
Improve error messages in JSC
https://bugs.webkit.org/show_bug.cgi?id=141869

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

JavaScriptCore has some unintuitive error messages associated
with certain common errors. This patch changes some specific
error messages to be more understandable and also creates a
mechanism that will allow for easy modification of error messages
in the future. The specific errors we change are not a function
errors and invalid parameter errors.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
* jit/JITOperations.cpp:
op_throw_static_error always has a JSString as its argument.
There is no need to dance around this, and we should assert
that this always holds. This JSString represents the error
message we want to display to the user, so there is no need
to pass it into errorDescriptionForValue which will now place
quotes around the string.

* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::ErrorInstance):
* runtime/ErrorInstance.h:
(JSC::ErrorInstance::hasSourceAppender):
(JSC::ErrorInstance::sourceAppender):
(JSC::ErrorInstance::setSourceAppender):
(JSC::ErrorInstance::clearSourceAppender):
(JSC::ErrorInstance::setRuntimeTypeForCause):
(JSC::ErrorInstance::runtimeTypeForCause):
(JSC::ErrorInstance::clearRuntimeTypeForCause):
(JSC::ErrorInstance::appendSourceToMessage): Deleted.
(JSC::ErrorInstance::setAppendSourceToMessage): Deleted.
(JSC::ErrorInstance::clearAppendSourceToMessage): Deleted.
* runtime/ExceptionHelpers.cpp:
(JSC::errorDescriptionForValue):
(JSC::defaultApproximateSourceError):
(JSC::defaultSourceAppender):
(JSC::functionCallBase):
(JSC::notAFunctionSourceAppender):
(JSC::invalidParameterInSourceAppender):
(JSC::invalidParameterInstanceofSourceAppender):
(JSC::createError):
(JSC::createInvalidFunctionApplyParameterError):
(JSC::createInvalidInParameterError):
(JSC::createInvalidInstanceofParameterError):
(JSC::createNotAConstructorError):
(JSC::createNotAFunctionError):
(JSC::createNotAnObjectError):
(JSC::createInvalidParameterError): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/JSObject.cpp:
(JSC::JSObject::hasInstance):
* runtime/RuntimeType.cpp: Added.
(JSC::runtimeTypeForValue):
(JSC::runtimeTypeAsString):
* runtime/RuntimeType.h: Added.
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::processLogEntries):
* runtime/TypeSet.cpp:
(JSC::TypeSet::getRuntimeTypeForValue): Deleted.
* runtime/TypeSet.h:
* runtime/VM.cpp:
(JSC::appendSourceToError):
(JSC::VM::throwException):

LayoutTests:

* fast/dom/NodeList/nodelist-item-call-as-function-expected.txt:
* fast/dom/call-a-constructor-as-a-function-expected.txt:
* fast/regex/dom/cross-frame-callable-expected.txt:
* fast/selectors/closest-general-expected.txt:
* http/tests/security/xss-DENIED-window-index-assign-expected.txt:
* js/dom/exception-thrown-from-new-expected.txt:
* js/exception-for-nonobject-expected.txt:
* js/exception-function-apply-expected.txt: Added.
* js/exception-function-apply.html: Added.
* js/exception-in-expected.txt: Added.
* js/exception-in.html: Added.
* js/exception-instanceof-expected.txt: Added.
* js/exception-instanceof.html: Added.
* js/instance-of-immediates-expected.txt:
* js/script-tests/exception-function-apply.js: Added.
* js/script-tests/exception-in.js: Added.
* js/script-tests/exception-instanceof.js: Added.
* js/typedarray-constructors-expected.txt:
* platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-expected.txt:
* platform/mac-wk2/plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt:
* platform/mac/css3/selectors3/xhtml/css3-modsel-15c-expected.txt:
* platform/mac/css3/selectors3/xml/css3-modsel-15c-expected.txt:
* plugins/npruntime/object-from-destroyed-plugin-expected.txt:
* plugins/npruntime/object-from-destroyed-plugin-in-subframe-expected.txt:
* plugins/npruntime/plugin-scriptable-object-invoke-default-expected.txt:
* sputnik/Conformance/12_Statement/12.1_Block/S12.1_A4_T1-expected.txt:
* sputnik/Conformance/13_Function_Definition/S13_A17_T2-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.1_The_Global_Object/S15.1_A2_T1-expected.txt:
* sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3-expected.txt:
* svg/dom/svgpath-out-of-bounds-getPathSeg-expected.txt:

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

4 years agoUpdate empty image canvas tests and fix a related bug
yoav@yoav.ws [Tue, 24 Mar 2015 06:47:40 +0000 (06:47 +0000)]
Update empty image canvas tests and fix a related bug
https://bugs.webkit.org/show_bug.cgi?id=142694

Reviewed by Chris Dumez.

Source/WebCore:

During the work on https://bugs.webkit.org/show_bug.cgi?id=142677
we encountered an issue with canvas tests related to empty image handling
when drawn or used as a pattern. After updating these tests, an issue with
pattern handling was encountered.

The spec, as well as Chrome's implementation, say that when an empty image
is used as a pattern, createPattern should return null. See
https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument
Instead, createPattern returned an exception in this case.
This patch fixes that and makes sure that it returns a null when image loading hasn't started.

Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html
       canvas/philip/tests/2d.drawImage.incomplete.nosrc.html
       canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html
       canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html
       canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html

* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable.

LayoutTests:

Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/drawing-images-to-the-canvas
* canvas/philip/tests/2d.drawImage.incomplete-expected.txt: Removed.
* canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt: Added.
* canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html: Added.
* canvas/philip/tests/2d.drawImage.incomplete.html: Removed.
* canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt: Added.
* canvas/philip/tests/2d.drawImage.incomplete.nosrc.html: Added.
* canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt: Added.
* canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html: Added.

Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/fill-and-stroke-styles
* canvas/philip/tests/2d.pattern.image.incomplete-expected.txt: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.empty.html: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt: Added.
* canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html: Added.
* canvas/philip/tests/2d.pattern.image.incomplete.html: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.omitted.html: Removed.
* canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt: Added.
This test currently fails and will be fixed in https://bugs.webkit.org/show_bug.cgi?id=142677
* canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html: Added.

Test below imported from https://chromium.googlesource.com/chromium/blink/+/master/LayoutTests/fast/canvas/
* fast/canvas/canvas-empty-image-pattern.html: Aligned with spec/Chrome.
* fast/canvas/canvas-empty-image-pattern-expected.txt: Aligned with spec/Chrome.
* TestExpectations: Added 2d.pattern.image.incomplete.removedsrc.html as an expected failure.

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

4 years agoJSC should have a low-cost asynchronous disassembler
fpizlo@apple.com [Tue, 24 Mar 2015 05:37:19 +0000 (05:37 +0000)]
JSC should have a low-cost asynchronous disassembler
https://bugs.webkit.org/show_bug.cgi?id=142997

Reviewed by Mark Lam.
Source/JavaScriptCore:

This adds a JSC_asyncDisassembly option that disassembles on a thread. Disassembly
doesn't block execution. Some code will live a little longer because of this, since the
work tasks hold a ref to the code, but other than that there is basically no overhead.

At present, this isn't really a replacement for JSC_showDisassembly, since it doesn't
provide contextual IR information for Baseline and DFG disassemblies, and it doesn't do
the separate IR dumps for FTL. Using JSC_showDisassembly and friends along with
JSC_asyncDisassembly has bizarre behavior - so just choose one.

A simple way of understanding how great this is, is to run a small benchmark like
V8Spider/earley-boyer.

Performance without any disassembly flags: 60ms
Performance with JSC_showDisassembly=true: 477ms
Performance with JSC_asyncDisassembly=true: 65ms

So, the overhead of disassembly goes from 8x to 8%.

Note that JSC_asyncDisassembly=true does make it incorrect to run "time" as a way of
measuring benchmark performance. This is because at VM exit, we wait for all async
disassembly requests to finish. For example, for earley-boyer, we spend an extra ~130ms
after the benchmark completely finishes to finish the disassemblies. This small weirdness
should be OK for the intended use-cases, since all you have to do to get around it is to
measure the execution time of the benchmark payload rather than the end-to-end time of
launching the VM.

* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::finalizeCodeWithDisassembly):
* assembler/LinkBuffer.h:
(JSC::LinkBuffer::wasAlreadyDisassembled):
(JSC::LinkBuffer::didAlreadyDisassemble):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::disassemble):
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* disassembler/Disassembler.cpp:
(JSC::disassembleAsynchronously):
(JSC::waitForAsynchronousDisassembly):
* disassembler/Disassembler.h:
* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jsc.cpp:
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::~VM):

Source/WTF:

* wtf/StringPrintStream.h:

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

4 years agoMove the bulk of the js/dom/const test into js/const, so that run-jsc-stress-tests...
fpizlo@apple.com [Tue, 24 Mar 2015 01:48:54 +0000 (01:48 +0000)]
Move the bulk of the js/dom/const test into js/const, so that run-jsc-stress-tests runs it.

Rubber stamped by Andreas Kling and Michael Saboff.

* js/const-expected.txt: Copied from LayoutTests/js/dom/const-expected.txt.
* js/const.html: Copied from LayoutTests/js/dom/const.html.
* js/dom/const-expected.txt: Replaced.
* js/dom/const.html: Replaced.
* js/resources/const.js: Removed.
* js/script-tests/const.js: Copied from LayoutTests/js/resources/const.js.

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

4 years agoUnreviewed, another attempt to fix 32-bit build after r181881.
joepeck@webkit.org [Tue, 24 Mar 2015 01:28:06 +0000 (01:28 +0000)]
Unreviewed, another attempt to fix 32-bit build after r181881.

* UIProcess/WebInspectorProxy.h:

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

4 years agoUnreviewed, attempt to fix 32-bit build after r181881.
joepeck@webkit.org [Tue, 24 Mar 2015 01:12:26 +0000 (01:12 +0000)]
Unreviewed, attempt to fix 32-bit build after r181881.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/mac/WKView.mm:

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

4 years agoFix api tests after r181876.
achristensen@apple.com [Tue, 24 Mar 2015 01:01:55 +0000 (01:01 +0000)]
Fix api tests after r181876.

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
Always append a CSSDisplayNoneStyleSheet action if no ignore-previous-rules is seen.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
Changed an assertion to a null check.

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

4 years agoTimelines are sharing the same canvas background
dino@apple.com [Tue, 24 Mar 2015 00:44:22 +0000 (00:44 +0000)]
Timelines are sharing the same canvas background
https://bugs.webkit.org/show_bug.cgi?id=142994
<rdar://problem/20209466>

Reviewed by Brent Fulgham.

Since each MediaControl lives in an isolated world, we
can't rely on a global variable to provide a unique
identifier for a named canvas. The fix is to expose
WebCore's UUID generator, and have each canvas use
that for a name.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::generateUUID): New method on the
MediaControlsHost that generates a UUID.
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:

* Modules/mediacontrols/mediaControlsApple.js: Remove the global
variable unique ID that wasn't working, and instead get
an ID from the MediaControlsHost.
(Controller.prototype.createControls):
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS):

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

4 years agoWeb Inspector: Support attaching to another view other than the WKView
timothy@apple.com [Mon, 23 Mar 2015 23:42:40 +0000 (23:42 +0000)]
Web Inspector: Support attaching to another view other than the WKView
https://bugs.webkit.org/show_bug.cgi?id=142892

Reviewed by Tim Horton.

* UIProcess/API/C/WKInspector.cpp:
(WKInspectorAttach): Drive by fix so it used the last attachment side.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView _inspectorAttachmentView]): Added.
(-[WKView _setInspectorAttachmentView:]): Added.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::createInspectorPage):
(WebKit::WebInspectorProxy::attachAvailabilityChanged):
Use platformCanAttach as a final check incase there is a different
attachment view that the platform knows about.

* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::attachmentSide): Added.
(WebKit::WebInspectorProxy::platformCanAttach): Added.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::attachmentViewDidChange): Added.
(WebKit::WebInspectorProxy::closeTimerFired):
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
(WebKit::WebInspectorProxy::platformCanAttach):
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
(WebKit::WebInspectorProxy::platformInspectedWindowHeight):
(WebKit::WebInspectorProxy::platformInspectedWindowWidth):
(WebKit::WebInspectorProxy::platformAttach):
(WebKit::WebInspectorProxy::platformDetach):
Use the _inspectorAttachmentView and change how the frame change notification
is observed and follow the attachment view as it changes.

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

4 years agoRegression(r181257): WTF_WorkQueue.Simple is flaky
bfulgham@apple.com [Mon, 23 Mar 2015 22:56:58 +0000 (22:56 +0000)]
Regression(r181257): WTF_WorkQueue.Simple is flaky
https://bugs.webkit.org/show_bug.cgi?id=142560

Remove the check that the refCount has returned to one after the
individual tasks have completed. It's too nondeterministic when
the reference count will be reduced.

Reviewed by Alexey Proskuryakov

* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
(TestWebKitAPI::TEST): Remove test that refCount is back to 1.

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

4 years agoScroll latching logic can get stuck in 'scrollable="no"' iframes
bfulgham@apple.com [Mon, 23 Mar 2015 22:52:27 +0000 (22:52 +0000)]
Scroll latching logic can get stuck in 'scrollable="no"' iframes
https://bugs.webkit.org/show_bug.cgi?id=142789
<rdar://problem/20129494>

Reviewed by Dean Jackson.

Clean up the EventHandler and latching code as follows:
(1) Do not handle iframe elements as part of the normal latching logic. Instead, iframes should
    be evaluated during the 'platformCompleteWheelEvent' phase of processing as top-level scrolling
    frames.
(2) Get rid of the ill-conceived notation that we should process non-mainframe and main-frame frames
    different.
(3) Modify code to reflect that the scroll latching code really deals with overflow scrolling. Consequently,
    the 'findEnclosingScrollableContainer' was renamed to 'findEnclosingOverflowScroll' and does not
    treat iframe as a suitable target.
(4) Do not create a latching state object when the container being evaluated is already scrolled to the
    extreme position in the direction of the mouse gesture. In this case, we want the enclosing frame
    to be the latching target.
(5) Do not treat the state where the mouse wheel gesture has ended manual scrolling, but has not ended
    momentum scrolling, as an appropriate time to select a latching target.

* page/EventHandler.cpp:
(WebCore::EventHandler::platformCompleteWheelEvent): Modify signature to remove unneeded argument.
(WebCore::EventHandler::handleWheelEvent): Modify call to 'platformCompleteWheelEvent' to remove unused argument.
* page/EventHandler.h:
* page/mac/EventHandlerMac.mm:
(WebCore::findEnclosingOverflowScroll): Renamed from 'findEnclosingScrollableContainer' and revised per the
notes above.
(WebCore::EventHandler::platformPrepareForWheelEvents): Remove mainFrame vs. non-mainFrame code paths and
consolidate logic.
(WebCore::EventHandler::platformCompleteWheelEvent): Remove unused argument. The wheel event target is no
longer needed here, now that iframes are not processed by this code.
(WebCore::findEnclosingScrollableContainer): Deleted.
* page/scrolling/ScrollLatchingState.cpp:
(WebCore::ScrollLatchingState::setPreviousWheelScrolledElement:) Switch to move operator for passing
a temporary RefPtr to the the function.
* page/scrolling/ScrollLatchingState.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::useLatchedEventElement): Recognize 'phase=ended, momentum=none' as a state
that should not cause latching state to be revised.

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

4 years agoTry to fix the iOS build.
andersca@apple.com [Mon, 23 Mar 2015 22:50:39 +0000 (22:50 +0000)]
Try to fix the iOS build.

* platform/network/mac/CookieJarMac.mm:

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

4 years ago[Content Filtering] Fix up a few mistakes in LayoutTests/contentfiltering/
aestes@apple.com [Mon, 23 Mar 2015 22:49:57 +0000 (22:49 +0000)]
[Content Filtering] Fix up a few mistakes in LayoutTests/contentfiltering/
https://bugs.webkit.org/show_bug.cgi?id=142991

Reviewed by Andreas Kling.

* contentfiltering/allow-after-add-data-expected.html: Added HTML5 doctype.
* contentfiltering/allow-after-finished-adding-data-expected.html: Ditto.
* contentfiltering/allow-after-response-expected.html: Ditto.
* contentfiltering/allow-after-unblock-request-expected.html: Ditto.
* contentfiltering/block-after-add-data-expected.html: Ditto.
* contentfiltering/block-after-finished-adding-data-expected.html: Ditto.
* contentfiltering/block-after-response-expected.html: Ditto.
* contentfiltering/block-after-unblock-request-expected.html: Ditto.
* contentfiltering/resources/contentfiltering.js: Added a newline at the end of the file.

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

4 years agoContent extensions should apply css selectors
beidson@apple.com [Mon, 23 Mar 2015 22:34:53 +0000 (22:34 +0000)]
Content extensions should apply css selectors
https://bugs.webkit.org/show_bug.cgi?id=142604

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/contentextensions/css-display-none.html

* WebCore.xcodeproj/project.pbxproj:

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::create):
(WebCore::ContentExtensions::ContentExtension::ContentExtension):
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
* contentextensions/ContentExtension.h:
(WebCore::ContentExtensions::ContentExtension::identifier):
(WebCore::ContentExtensions::ContentExtension::compiledExtension):

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::addContentExtension):
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::globalDisplayNoneStyleSheet):
* contentextensions/ContentExtensionsBackend.h:

* contentextensions/DFABytecodeInterpreter.cpp:
(WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):

* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet):
* dom/DocumentStyleSheetCollection.h:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::startLoadingMainResource):
(WebCore::DocumentLoader::addPendingContentExtensionSheet):
* loader/DocumentLoader.h:

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setInitiator):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::initiatingDocumentLoader):

* page/UserContentController.cpp:
(WebCore::UserContentController::globalDisplayNoneStyleSheet):
(WebCore::UserContentController::displayNoneCSSRule):
* page/UserContentController.h:

LayoutTests:

* http/tests/contentextensions/css-display-none-expected.txt:
* http/tests/contentextensions/css-display-none.html:
* http/tests/contentextensions/css-display-none.html.json:

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

4 years ago-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't...
andersca@apple.com [Mon, 23 Mar 2015 22:31:07 +0000 (22:31 +0000)]
-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:] doesn't remove cookies
https://bugs.webkit.org/show_bug.cgi?id=142990
rdar://problem/20241645

Reviewed by Andreas Kling.

Use the Mac version of deleteAllCookiesModifiedSince on iOS as well.

* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/mac/CookieJarMac.mm:

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

4 years agoImages shared to photos via action menu are padded with zeroes at the end
timothy_horton@apple.com [Mon, 23 Mar 2015 22:05:59 +0000 (22:05 +0000)]
Images shared to photos via action menu are padded with zeroes at the end
https://bugs.webkit.org/show_bug.cgi?id=142985

Reviewed by Anders Carlsson.

* Shared/mac/ActionMenuHitTestResult.h:
* Shared/mac/ActionMenuHitTestResult.mm:
(WebKit::ActionMenuHitTestResult::encode):
(WebKit::ActionMenuHitTestResult::decode):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
Send the size of the image separately from the SharedMemory.
The SharedMemory's size can be rounded up, so we need to keep the original
size around in order to write the data to disk.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _hitTestResultImage]):
(-[WKActionMenuController _addImageToPhotos:]):
Use the image size instead of the SharedMemory size.

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

4 years agoReplace uses of kCTFontSystemFontType
conrad_shultz@apple.com [Mon, 23 Mar 2015 22:04:34 +0000 (22:04 +0000)]
Replace uses of kCTFontSystemFontType
https://bugs.webkit.org/show_bug.cgi?id=142984

Reviewed by Tim Horton.

* rendering/RenderThemeMac.mm:
(WebCore::AttachmentLayout::layOutTitle):
(WebCore::AttachmentLayout::layOutSubtitle):

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

4 years agoWeb Inspector: Debugger sidebar should have a filter button for breakpoints
jonowells@apple.com [Mon, 23 Mar 2015 22:00:19 +0000 (22:00 +0000)]
Web Inspector: Debugger sidebar should have a filter button for breakpoints
https://bugs.webkit.org/show_bug.cgi?id=142779

Reviewed by Timothy Hatcher.

Add the infrastructure for activation filter buttons that can appear next to the text filters at the bottom
of any navigation sidebar panel. These filter bar buttons have defined within them a function that returns
a boolean value that indicates whether the input, typically a tree element, should be filtered or not.

This infrastructure is then used to create a filter for the debugger sidebar that, when applied, only shows
scripts that have breakpoints set on them.

* Localizations/en.lproj/localizedStrings.js: Updated.
* UserInterface/Main.html: Files added.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.showResourcesWithChildrenOnlyFilterFunction):
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._addBreakpoint): Drive-by fix.
Add filter button to filter bar.

* UserInterface/Views/FilterBar.css:
(.filter-bar > .navigation-bar > .item):
Style filter button.

* UserInterface/Views/FilterBar.js:
(WebInspector.FilterBar):
(WebInspector.FilterBar.prototype.get filters):
(WebInspector.FilterBar.prototype.set filters):
(WebInspector.FilterBar.prototype.hasActiveFilters):
(WebInspector.FilterBar.prototype._handleFilterChanged):
(WebInspector.FilterBar.prototype._inputFieldChanged): Deleted.
Create space for filter bar buttons and set up event handlers to deal with them.

* UserInterface/Views/FilterBarButton.js: Copied from Source/WebInspectorUI/UserInterface/Views/FilterBar.css.
(WebInspector.FilterBarButton):
(WebInspector.FilterBarButton.prototype.get filterFunction):
(WebInspector.FilterBarButton.prototype.toggle):
Create class for a filter bar button that stores a filter function.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.matchTreeElementAgainstFilterFunctions):
(WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
(WebInspector.NavigationSidebarPanel.prototype._filterDidChange):
(WebInspector.NavigationSidebarPanel.prototype._updateFilter):
(WebInspector.NavigationSidebarPanel.prototype._textFilterDidChange): Deleted.
Add functionality to support button filters and process their corresponding functions correctly when filtering.

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

4 years agoES7: Implement Array.prototype.includes
dino@apple.com [Mon, 23 Mar 2015 21:37:53 +0000 (21:37 +0000)]
ES7: Implement Array.prototype.includes
https://bugs.webkit.org/show_bug.cgi?id=142707

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add support for the ES7 includes method on Arrays.
https://github.com/tc39/Array.prototype.includes

* builtins/Array.prototype.js:
(includes): Implementation in JS.
* runtime/ArrayPrototype.cpp: Add 'includes' to the lookup table.

LayoutTests:

* js/array-includes-expected.txt: Added.
* js/array-includes.html: Added.
* js/script-tests/array-includes.js: Added.
* js/script-tests/Object-getOwnPropertyNames.js: Add 'includes'.
* js/Object-getOwnPropertyNames-expected.txt: Add 'includes'.

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

4 years agokCTFontSystemFontType is deprecated in CoreText
dino@apple.com [Mon, 23 Mar 2015 21:32:38 +0000 (21:32 +0000)]
kCTFontSystemFontType is deprecated in CoreText
https://bugs.webkit.org/show_bug.cgi?id=142981
<rdar://problem/20261171>

Reviewed by Beth Dakin.

Update to the non-deprecated version.

* rendering/RenderThemeIOS.mm: kCTFontSystemFontType -> kCTFontUIFontSystem
(WebCore::RenderThemeIOS::updateCachedSystemFontDescription):

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