WebKit-https.git
5 years agoUnreviewed build-fix; fix !HAVE(AVKIT) build after r193340.
jer.noble@apple.com [Thu, 3 Dec 2015 20:57:55 +0000 (20:57 +0000)]
Unreviewed build-fix; fix !HAVE(AVKIT) build after r193340.

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::applicationDidBecomeActive):

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

5 years agoAdd WebCrypto to status page
jond@apple.com [Thu, 3 Dec 2015 20:56:40 +0000 (20:56 +0000)]
Add WebCrypto to status page
https://bugs.webkit.org/show_bug.cgi?id=151760

Reviewed by Timothy Hatcher.

* features.json:

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

5 years ago[Win] fast/forms/HTMLOptionElement_label03.html failing on win7
commit-queue@webkit.org [Thu, 3 Dec 2015 20:46:13 +0000 (20:46 +0000)]
[Win] fast/forms/HTMLOptionElement_label03.html failing on win7
https://bugs.webkit.org/show_bug.cgi?id=150909
rdar://problem/23539673

Patch by Keith Rollin <krollin@apple.com> on 2015-12-03
Reviewed by Darin Adler.

Source/WebCore:

When returning text to be displayed, an <option> element will return
the value of a label attribute if it exists, or the text content as a
fallback. The failing test concerned the display of a <select>
element when it contained a sole <option> element that had a label
attribute set to a single space. When displayed, various
platform-specific bits of code will strip off the leading and trailing
whitespace. However, when WebKit would use this text to measure how
wide the <select> popup menu button should be, it would not strip off
spaces, leading to the calculated width being wider than necessary.
The approach taken to fix this is to strip whitespace in the label
attribute before it is returned from the <option> element.

No new tests. fast/forms/HTMLOptionElement_label03.html had been
marked as being expected to fail in TestExpectations; that test now
succeeds.

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::label):

LayoutTests:

Mark fast/forms/HTMLOptionElement_label03.html as being expected to
pass. Also update some text in HTMLOptionElement_label02.html and
HTMLOptionElement_label03.html so that it no longer refers to our
trying to match IE (which we are no longer doing).

* fast/forms/HTMLOptionElement_label02.html:
* fast/forms/HTMLOptionElement_label03.html:
* platform/win/TestExpectations:

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

5 years agoNeed completionHandler-based WebKit C SPI for alert, confirm, and prompt
weinig@apple.com [Thu, 3 Dec 2015 20:44:12 +0000 (20:44 +0000)]
Need completionHandler-based WebKit C SPI for alert, confirm, and prompt
<rdar://problem/23320863>
https://bugs.webkit.org/show_bug.cgi?id=151708

(Add missing function definitions)

* UIProcess/API/C/WKPage.cpp:
(WKPageRunJavaScriptAlertResultListenerGetTypeID):
(WKPageRunJavaScriptAlertResultListenerCall):
(WKPageRunJavaScriptConfirmResultListenerGetTypeID):
(WKPageRunJavaScriptConfirmResultListenerCall):
(WKPageRunJavaScriptPromptResultListenerGetTypeID):
(WKPageRunJavaScriptPromptResultListenerCall):

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

5 years agoTry to fix the Windows build.
weinig@apple.com [Thu, 3 Dec 2015 20:39:26 +0000 (20:39 +0000)]
Try to fix the Windows build.

* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::javaScriptRuntimeFlags):
(WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):

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

5 years agoFix 64-bit Windows build after r193125.
achristensen@apple.com [Thu, 3 Dec 2015 20:12:38 +0000 (20:12 +0000)]
Fix 64-bit Windows build after r193125.
https://bugs.webkit.org/show_bug.cgi?id=151799

Reviewed by Michael Saboff.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::supportsLZCNT):
Use __cpuid intrinsic instead of inline assembly.

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

5 years agoModern IDB: storage/indexeddb/cursor-advance.html fails.
beidson@apple.com [Thu, 3 Dec 2015 20:07:00 +0000 (20:07 +0000)]
Modern IDB: storage/indexeddb/cursor-advance.html fails.
https://bugs.webkit.org/show_bug.cgi?id=151731

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least one failing test now passes).

* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursor.idl:

* Modules/indexeddb/client/IDBCursorImpl.cpp:
(WebCore::IDBClient::IDBCursor::advance): Return a custom exception message for TypeError.
* Modules/indexeddb/client/IDBCursorImpl.h:

* Modules/indexeddb/legacy/LegacyCursor.cpp:
(WebCore::LegacyCursor::advance):
* Modules/indexeddb/legacy/LegacyCursor.h:

* bindings/js/JSDOMBinding.cpp:
(WebCore::createDOMException):
(WebCore::setDOMException):
* bindings/js/JSDOMBinding.h:

* bindings/scripts/IDLAttributes.txt:

* inspector/InspectorIndexedDBAgent.cpp:

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/cursor-advance-expected.txt:

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

5 years agoAllow JavaScript to iterate over plugins for local files
bfulgham@apple.com [Thu, 3 Dec 2015 20:06:17 +0000 (20:06 +0000)]
Allow JavaScript to iterate over plugins for local files
https://bugs.webkit.org/show_bug.cgi?id=151783
<rdar://problem/23692113>

Source/WebCore:

Reviewed by Alexey Proskuryakov.

Test: http/tests/plugins/plugin-javascript-access.html
      plugins/plugin-javascript-access.html

* page/Page.cpp:
(WebCore::Page::showAllPlugins): True if we set the debugging flag to show
all plugins, or if the document's origin is from a local file.
* page/Page.h:

LayoutTests:

Modify the existing 'local file' plugin tests so that they don't turn on the debugging
flag to allow iterating over all plugins. Then create a new HTTP test (based on the
existing plugin-javascript-access test) to make sure that plugin iteration is blocked
for non-local-file access.

Reviewed by Alexey Proskuryakov.

* http/tests/plugins/plugin-javascript-access-expected.txt: Added.
* http/tests/plugins/plugin-javascript-access.html: Added.
* plugins/plugin-javascript-access.html: Remove unneeded 'internals.setShowAllPlugins' call.
* plugins/script-tests/navigator-mimeTypes-length.js: Ditto.

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

5 years agoFTL B3 should support OSR exit
fpizlo@apple.com [Thu, 3 Dec 2015 20:01:57 +0000 (20:01 +0000)]
FTL B3 should support OSR exit
https://bugs.webkit.org/show_bug.cgi?id=151710

Reviewed by Saam Barati.

Source/JavaScriptCore:

This adds OSR exit support using the same style that I established with lazy slow paths. All of
the work is driven by FTL::LowerDFGToLLVM, and from there any work that needs to be deferred
until after B3 finishes is attached to the stackmap generator. In order to make it easy to port
all of the different forms of OSR exit - invalidation points, exceptions, etc. - the logic for
registering an OSR exit is abstracted behind OSRExitDescriptor and OSRExitHandle.

An issue that I encountered repeatedly in this patch is OSRExitDescriptor being passed as a
reference (&) rather than pointer (*). The new code uses a lot of lambdas that run after the
current frame pops, so the capture list cannot be [&]. I believe that always listing all of the
captured variables is not scalable considering how sophisticated our use of lambdas is. So, it
makes sense to use [=]. But anytime we captured a variable whose type was OSRExitDescriptor&, it
would be captured by value, because that's how references work. One has to be mindful of these
things whenever using [=]. Note that it's not enough to say that we should have listed the
captured variables explicitly - in that case, we still could have made the mistake by forgetting
to put & in front of the variant. The pattern that worked for me to reason about whether I'm
capturing an object or a pointer to an object is to always use pointer types for pointers: either
RefPtr<> when we also want the lambda to prolong the object's life, or * if we are confident that
the object will stay alive. For this reason, this patch changes all code that references
OSRExitDescriptor to use * instead of &. Consistency makes the code easier to grok, and it made
it easier to introduce the required uses of * in places where there were lambdas.

I tested this by running imaging-gaussian-blur, and running some tests that reqiure OSR exit. I'm
not promising that all kinds of exits work, but we have to begin somewhere.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Compilation.cpp:
(JSC::B3::Compilation::Compilation):
(JSC::B3::Compilation::~Compilation):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::addDataSection):
(JSC::B3::Procedure::frameSize):
(JSC::B3::Procedure::calleeSaveRegisters):
* b3/B3Procedure.h:
(JSC::B3::Procedure::releaseByproducts):
(JSC::B3::Procedure::code):
(JSC::B3::Procedure::takeByproducts): Deleted.
* b3/air/AirCode.h:
(JSC::B3::Air::Code::setFrameSize):
(JSC::B3::Air::Code::calleeSaveRegisters):
* b3/air/AirGenerationContext.h:
* ftl/FTLB3Compile.cpp:
(JSC::FTL::compile):
* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
* ftl/FTLExceptionHandlerManager.cpp:
(JSC::FTL::ExceptionHandlerManager::lazySlowPathExceptionTarget):
(JSC::FTL::ExceptionHandlerManager::getCallOSRExitCommon):
* ftl/FTLExitThunkGenerator.cpp:
* ftl/FTLExitThunkGenerator.h:
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::JITCode):
(JSC::FTL::JITCode::initializeB3Code):
(JSC::FTL::JITCode::initializeB3Byproducts):
(JSC::FTL::JITCode::initializeExitThunks):
(JSC::FTL::JITCode::validateReferences):
(JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
* ftl/FTLJITCode.h:
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalizeFunction):
* ftl/FTLJITFinalizer.h:
* ftl/FTLJSCall.cpp:
(JSC::FTL::JSCall::emit):
* ftl/FTLJSCallBase.cpp:
(JSC::FTL::JSCallBase::emit):
* ftl/FTLJSTailCall.cpp:
(JSC::FTL::JSTailCall::JSTailCall):
(JSC::FTL::JSTailCall::emit):
(JSC::FTL::DFG::getRegisterWithAddend): Deleted.
(JSC::FTL::m_instructionOffset): Deleted.
* ftl/FTLJSTailCall.h:
(JSC::FTL::JSTailCall::patchpoint):
(JSC::FTL::JSTailCall::stackmapID):
(JSC::FTL::JSTailCall::estimatedSize):
(JSC::FTL::JSTailCall::operator<):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitArgumentsForPatchpointIfWillCatchException):
(JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitDescriptor):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::DFG::LowerDFGToLLVM::blessSpeculation):
(JSC::FTL::DFG::LowerDFGToLLVM::emitOSRExitCall):
(JSC::FTL::DFG::LowerDFGToLLVM::buildExitArguments):
(JSC::FTL::DFG::LowerDFGToLLVM::callStackmap):
(JSC::FTL::lowerDFGToLLVM):
* ftl/FTLOSRExit.cpp:
(JSC::FTL::OSRExitDescriptor::OSRExitDescriptor):
(JSC::FTL::OSRExitDescriptor::validateReferences):
(JSC::FTL::OSRExitDescriptor::appendOSRExit):
(JSC::FTL::OSRExitDescriptor::appendOSRExitLater):
(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
(JSC::FTL::OSRExit::OSRExit):
(JSC::FTL::OSRExit::codeLocationForRepatch):
(JSC::FTL::OSRExit::gatherRegistersToSpillForCallIfException):
(JSC::FTL::OSRExit::spillRegistersToSpillSlot):
(JSC::FTL::OSRExit::recoverRegistersFromSpillSlot):
(JSC::FTL::OSRExit::willArriveAtExitFromIndirectExceptionCheck):
* ftl/FTLOSRExit.h:
(JSC::FTL::OSRExit::considerAddingAsFrequentExitSite):
* ftl/FTLOSRExitCompilationInfo.h:
(JSC::FTL::OSRExitCompilationInfo::OSRExitCompilationInfo):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::reboxAccordingToFormat):
(JSC::FTL::compileRecovery):
(JSC::FTL::compileStub):
(JSC::FTL::compileFTLOSRExit):
* ftl/FTLOSRExitHandle.cpp: Added.
(JSC::FTL::OSRExitHandle::emitExitThunk):
* ftl/FTLOSRExitHandle.h: Added.
(JSC::FTL::OSRExitHandle::OSRExitHandle):
* ftl/FTLState.cpp:
(JSC::FTL::State::State):
(JSC::FTL::State::~State):

Source/WTF:

Make sure that this has perfect forwarding.

* wtf/SegmentedVector.h:
(WTF::SegmentedVector::append):
(WTF::SegmentedVector::alloc):

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

5 years agoUnreviewed build-fix; missing include.
jer.noble@apple.com [Thu, 3 Dec 2015 19:56:44 +0000 (19:56 +0000)]
Unreviewed build-fix; missing include.

* html/HTMLVideoElement.cpp:

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

5 years agoSource/WebCore:
beidson@apple.com [Thu, 3 Dec 2015 19:52:52 +0000 (19:52 +0000)]
Source/WebCore:
Modern IDB: storage/indexeddb/cursor-skip-deleted.html crashes.
https://bugs.webkit.org/show_bug.cgi?id=151794

Reviewed by Alex Christensen.

STL reverse_iterators are a tricky beast.

They are implemented in terms of a normal forward iterator (called the "base" iterator),
and they decrement a copy of that iterator when dereferenced.

So when monitoring deletes from  a std::set to check if we should invalidate our current
reverse_iterator, we were incorrectly comparing the deleted key to the value pointed by the
reverse_iterator instead of its base iterator.

Since the iterators in question are bidirectional, anyways, we can just use a single iterator
and either increment or decrement it as needed.

No new tests (At least one failing (crashing) test now passes).

* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
(WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
(WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
(WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::iterate):
(WebCore::IDBServer::MemoryObjectStoreCursor::firstForwardIteratorInRemainingRange): Deleted.
(WebCore::IDBServer::MemoryObjectStoreCursor::firstReverseIteratorInRemainingRange): Deleted.
(WebCore::IDBServer::MemoryObjectStoreCursor::hasIterators): Deleted.
(WebCore::IDBServer::MemoryObjectStoreCursor::hasValidPosition): Deleted.
(WebCore::IDBServer::MemoryObjectStoreCursor::clearIterators): Deleted.
* Modules/indexeddb/server/MemoryObjectStoreCursor.h:

LayoutTests:
Modern IDB: storage/indexeddb/cursor-skip-deleted.html fails.
https://bugs.webkit.org/show_bug.cgi?id=151794

Reviewed by Alex Christensen.

* platform/mac-wk1/TestExpectations:

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

5 years agoAdd a basic compositing Animometer test
simon.fraser@apple.com [Thu, 3 Dec 2015 19:34:21 +0000 (19:34 +0000)]
Add a basic compositing Animometer test
https://bugs.webkit.org/show_bug.cgi?id=151724

Reviewed by Dean Jackson.

Add a "bouncing particles" test that moves composited layers around, optionally with a filter.

This is added under a new "Miscellaneous" category.

Remove the test templates category from the UI.

* Animometer/runner/resources/tests.js:
* Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
(BouncingCssShape.prototype.animate):
* Animometer/tests/misc/compositing-transforms.html: Added.
* Animometer/tests/misc/resources/compositing-transforms.js: Added.
(BouncingCompositedImage):
(BouncingCompositedImage.prototype._move):
(BouncingCompositedImage.prototype.animate):
(CompositingTransformsStage):
(CompositingTransformsStage.prototype.createParticle):
(CompositingTransformsStage.prototype.particleWillBeRemoved):
(CompositedTransformsBenchmark):
(CompositedTransformsBenchmark.prototype.createStage):
(window.benchmarkClient.create):

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

5 years agoREGRESSION:(r192753): Remote Web Inspector: RemoteInspector::sendMessageToRemote...
commit-queue@webkit.org [Thu, 3 Dec 2015 19:33:15 +0000 (19:33 +0000)]
REGRESSION:(r192753): Remote Web Inspector: RemoteInspector::sendMessageToRemote with null connection
https://bugs.webkit.org/show_bug.cgi?id=151789

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

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::sendMessageToRemote):
Bail if the connection is no longer available. It may have
been closed remotely.

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

5 years agoREGRESSION:(r192753): Remote Web Inspector: Window immediately closes after opening
commit-queue@webkit.org [Thu, 3 Dec 2015 19:28:40 +0000 (19:28 +0000)]
REGRESSION:(r192753): Remote Web Inspector: Window immediately closes after opening
https://bugs.webkit.org/show_bug.cgi?id=151788

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

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::pushListingsNow):
The key at the outer level was not a string. Ensure it is a
string for backwards compatibility. One day we may use
non-numeric page identifiers as listing keys.

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

5 years ago[WinCairo][MediaFoundation] Main thread can block when session is destroyed.
peavo@outlook.com [Thu, 3 Dec 2015 19:27:49 +0000 (19:27 +0000)]
[WinCairo][MediaFoundation] Main thread can block when session is destroyed.
https://bugs.webkit.org/show_bug.cgi?id=151803

Reviewed by Alex Christensen.

Set flag to make sure that the scheduler thread stops when the session ends.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopScheduler):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::processSamplesInQueue):
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::schedulerThreadProcPrivate):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
(WebCore::MediaPlayerPrivateMediaFoundation::VideoScheduler::stopThread):

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

5 years ago[iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
jer.noble@apple.com [Thu, 3 Dec 2015 19:12:26 +0000 (19:12 +0000)]
[iOS] Fullscreen -> PiP should resume to Fullscreen, not inline
https://bugs.webkit.org/show_bug.cgi?id=150906

Reviewed by Simon Fraser.

Source/WebCore:

When restoring the user interface when exiting PiP, we should return to Fullscreen if that
is where fullscreen was initiated from. Additionally, when we "auto-PiP" by backgrounding the
app in Fullscreen mode, we should "auto-un-PiP" when restoring the application to foreground.

Rather than have a separate method to request exiting fullscreen, entering standard fullscreen,
and switching to & from PiP, add a new method setFullscreenMode() which does all three.

* html/HTMLVideoElement.cpp:
(WebCore::presentationModeToFullscreenMode):
(WebCore::HTMLVideoElement::webkitSetPresentationMode):
(WebCore::HTMLVideoElement::setFullscreenMode):
* html/HTMLVideoElement.h:

Add methods to for clients to request a specific fullscreen mode, and to query whether
the page is currently visible.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::requestFullscreenMode):
(WebVideoFullscreenControllerContext::isVisible):
(WebVideoFullscreenControllerContext::requestExitFullscreen): Deleted.
* platform/ios/WebVideoFullscreenModel.h:
* platform/ios/WebVideoFullscreenModelVideoElement.h:
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::requestFullscreenMode):
(WebVideoFullscreenModelVideoElement::isVisible):
(WebVideoFullscreenModelVideoElement::requestExitFullscreen): Deleted.

Track whether returning from PiP should enter fullscreen, or whether foregrounding the app
should cause PiP to return to fullscreen.

* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]): Renamed from -setBounds:. -layoutSublayers is called
    more consistently than -setBounds:, including when a sublayer is added to the layer.
(WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): The PiP WebAVPlayerLayer's
    modelVideoLayerFrame property may have been modified, so pass it back up to the fullscreen
    layer when exiting PiP.
(WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Request fullscreen if we auto-PiPed.
(WebVideoFullscreenInterfaceAVKit::setupFullscreen): Only recreate owned objects if they did not already exist.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): If we are in PiP mode, enter fullscreen by stopping PiP.
(WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): requestExitFullscreen() -> requestFullscreenMode().
(WebVideoFullscreenInterfaceAVKit::willStartPictureInPicture): Animate out the fullscreen window, if exiting Fullscreen -> PiP.
(WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Set m_shouldReturnToFullscreenAfterEnteringForeground if we auto-PiPed.
(WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): requestExitFullscreen() -> requestFullscreenMode().
(WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): If we are returning from PiP -> Fullscreen, do not hide the fullscreen window.
(WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): If we are returning from PiP -> Fullscreen, show the controls and notify clients.
(WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Animate in the fullscreen window, if returning from PiP -> Fullscreen.
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Set m_shouldReturnToFullscreenWhenStoppingPiP if we are entering PiP from Fullscreen.
* platform/spi/cocoa/AVKitSPI.h:

Source/WebKit2:

Add methods to pass isVisible(), applicationDidBecomeActive(), and requestFullscreenMode()
to and from models and interfaces.

* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidBecomeActive): Notify the fullscreen manager, if preset.

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::requestFullscreenMode): Renamed from requestExitFullscreen(); takes a mode enum.
(WebKit::WebVideoFullscreenModelContext::isVisible): Added.
(WebKit::WebVideoFullscreenManagerProxy::applicationDidBecomeActive): Pass to all existing interfaces.
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Do not re-create the view if it already exists.
(WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Renamed from requestExitFullscreen(); takes a mode enum.
(WebKit::WebVideoFullscreenManagerProxy::isVisible): Added. Query Page::isVisible() and Page::isInWindow(), the latter because
        PiP will cause Page::isVisible() to be TRUE even when the containing tab is backgrounded.
(WebKit::WebVideoFullscreenModelContext::requestExitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen): Deleted.
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Only resize the view if we are not already in one of
        the fullscreen modes.
(WebKit::WebVideoFullscreenManager::requestFullscreenMode): Renamed from requestExitFullscreen().
(WebKit::WebVideoFullscreenManager::requestExitFullscreen): Deleted.

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

5 years agoPromise callbacks should be called at microtask checkpoints
weinig@apple.com [Thu, 3 Dec 2015 19:06:45 +0000 (19:06 +0000)]
Promise callbacks should be called at microtask checkpoints
https://bugs.webkit.org/show_bug.cgi?id=147933

Reviewed by Chris Dumez.

Source/WebCore:

- Re-names MicroTaskQueue and MicroTask to MicrotaskQueue and Microtask to match the spec language.
- Re-implements MicrotaskQueue and Microtask support suspended Microtasks (via the new KeepInQueue
  result value a Microtask can have when running) and correct behavior when Microtasks are added to
  the queue during a Microtask checkpoint.
- MicrotaskQueue now has a mainThreadQueue() static function, replacing the old singleton() function,
  which can be used for the Document (non-Worker) Microtasks. For Workers, the a MicrotaskQueue
  can be separately allocated for each WorkerGlobalScope (though this was not done in this change).
- Adds a helper subclass of Microtask, ActiveDOMCallbackMicrotask, for Microtasks that are
  per-ScriptExecutationContext, and need to act as ActiveDOMCallbacks.
- Re-implement Document (non-Worker) Promises on top of ActiveDOMCallbackMicrotask.
- Re-implement MutationObserver delivery on top of Microtask.

Layout Test:
    fast/dom/microtask-promise-mutation-observer-order.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
Add new files.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::queueTaskToEventLoop):
Switch to using ActiveDOMCallbackMicrotask/MicrotaskQueue rather than ScriptExecutionContext's Task mechanism
for JavaScriptCore tasks.

* bindings/js/JSMainThreadExecState.cpp:
(WebCore::JSMainThreadExecState::didLeaveScriptContext):
Perform a microtask checkpoint rather than calling MutationObserver code explicitly now that mutation observers
use microtasks.

* dom/ActiveDOMCallbackMicrotask.cpp: Added.
(WebCore::ActiveDOMCallbackMicrotask::ActiveDOMCallbackMicrotask):
(WebCore::ActiveDOMCallbackMicrotask::~ActiveDOMCallbackMicrotask):
(WebCore::ActiveDOMCallbackMicrotask::run):
(WebCore::ActiveDOMCallbackMicrotask::contextDestroyed):
* dom/ActiveDOMCallbackMicrotask.h: Added.
Add a helper subclass of Microtask which behaves like a ActiveDOMCallback (e.g. supports suspension
and context destruction).

* dom/MicroTask.cpp: Renamed to Microtasks.cpp.
* dom/MicroTask.h: Renamed to Microtasks.h.
* dom/Microtasks.cpp: Renamed from Source/WebCore/dom/MicroTask.cpp.
(WebCore::Microtask::removeSelfFromQueue):
(WebCore::MicrotaskQueue::mainThreadQueue):
(WebCore::MicrotaskQueue::append):
(WebCore::MicrotaskQueue::remove):
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
(WebCore::MicroTaskQueue::singleton): Deleted.
(WebCore::MicroTaskQueue::queueMicroTask): Deleted.
(WebCore::MicroTaskQueue::runMicroTasks): Deleted.
* dom/Microtasks.h: Renamed from Source/WebCore/dom/MicroTask.h.
(WebCore::Microtask::~Microtask):
(WebCore::MicrotaskQueue::MicrotaskQueue):
(WebCore::MicrotaskQueue::~MicrotaskQueue):
(WebCore::MicroTask::~MicroTask): Deleted.
(WebCore::MicroTaskQueue::~MicroTaskQueue): Deleted.
(WebCore::MicroTaskQueue::MicroTaskQueue): Deleted.
Re-implement MicrotaskQueue and Microtask to support Microtask suspension (via the KeepInQueue result
value) and correct behavior when Microtasks are queued during checkpoints.

* dom/MutationObserver.cpp:
(WebCore::suspendedMutationObservers):
(WebCore::MutationObserverMicrotask::MutationObserverMicrotask):
(WebCore::MutationObserverMicrotask::~MutationObserverMicrotask):
(WebCore::MutationObserverMicrotask::run):
(WebCore::queueMutationObserverCompoundMicrotask):
(WebCore::MutationObserver::enqueueMutationRecord):
(WebCore::MutationObserver::setHasTransientRegistration):
* dom/MutationObserver.h:
Re-implement MutationObserver delivery on top of Microtasks.

* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):
Remove unnecessary call to runMicroTasks().

* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
(WebCore::HTMLScriptRunner::runScript):
Remove calls to MutationObserver::deliverAllMutations() now that the MicrotaskQueue will take care of it.

(WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
Remove unnecessary call to runMicroTasks().

* testing/Internals.cpp:
(WebCore::Internals::queueMicroTask):
Use ActiveDOMCallbackMicrotask rather than a custom test subclass.

* testing/MicroTaskTest.cpp: Removed.
* testing/MicroTaskTest.h: Removed.
Remove custom test subclass of Microtask, just use ActiveDOMCallbackMicrotask directly.

LayoutTests:

* fast/dom/microtask-promise-mutation-observer-order-expected.txt: Added.
* fast/dom/microtask-promise-mutation-observer-order.html: Added.

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

5 years agoREGRESSION(r192753): Remote Web Inspector: Enabling Remote Inspection on Auto Inspect...
commit-queue@webkit.org [Thu, 3 Dec 2015 18:55:54 +0000 (18:55 +0000)]
REGRESSION(r192753): Remote Web Inspector: Enabling Remote Inspection on Auto Inspect candidate Debuggable doesn't show up in debuggers
https://bugs.webkit.org/show_bug.cgi?id=151792

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-12-03
Reviewed by Brian Burg.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
When m_debuggablesMap was split into both m_targetMap and m_listingMap
this particular case was missed in updating both the target and listing
when the target is updated. We should match RemoteInspector::updateTarget
and update the listing map as the debuggable may have changed to be
allowed to debug.

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

5 years agoASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::add()
dbates@webkit.org [Thu, 3 Dec 2015 18:49:50 +0000 (18:49 +0000)]
ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::add()
https://bugs.webkit.org/show_bug.cgi?id=126662
<rdar://problem/15775508>

Reviewed by Brent Fulgham.

Add test to ensure that we do not assert when inserting a subtree that has an element with
a duplicate id before removing the original subtree.

* svg/custom/insert-subtree-with-duplicate-id-before-removing-subtree-expected.txt: Added.
* svg/custom/insert-subtree-with-duplicate-id-before-removing-subtree.svg: Added.

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

5 years ago[JSC] Add CLZ support to B3
commit-queue@webkit.org [Thu, 3 Dec 2015 18:49:04 +0000 (18:49 +0000)]
[JSC] Add CLZ support to B3
https://bugs.webkit.org/show_bug.cgi?id=151799

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-12-03
Reviewed by Michael Saboff.

Previously we were counting on LLVM to select LZCNT
when its available.
Since we have to do that ourself now, I added feature
detection based on the CPUID. The MacroAssembler just
pick the best available lowering based on the platform.

* assembler/MacroAssemblerX86Common.cpp:
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::countLeadingZeros32):
(JSC::MacroAssemblerX86Common::supportsLZCNT):
(JSC::MacroAssemblerX86Common::clz32AfterBsr):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::countLeadingZeros64):
(JSC::MacroAssemblerX86_64::clz64AfterBsr):
* assembler/X86Assembler.h:
(JSC::X86Assembler::lzcnt_rr):
(JSC::X86Assembler::lzcnt_mr):
(JSC::X86Assembler::lzcntq_rr):
(JSC::X86Assembler::lzcntq_mr):
(JSC::X86Assembler::bsr_mr):
(JSC::X86Assembler::bsrq_rr):
(JSC::X86Assembler::bsrq_mr):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::typeFor):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::countLeadingZero):
(JSC::B3::testClzArg64):
(JSC::B3::testClzMem64):
(JSC::B3::testClzArg32):
(JSC::B3::testClzMem32):
(JSC::B3::doubleOperands):
(JSC::B3::run):
* ftl/FTLB3Output.h:
(JSC::FTL::Output::ctlz32):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithClz32):
* ftl/FTLOutput.h:
(JSC::FTL::Output::ctlz32):

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

5 years agoAdd GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the...
beidson@apple.com [Thu, 3 Dec 2015 18:46:51 +0000 (18:46 +0000)]
Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
https://bugs.webkit.org/show_bug.cgi?id=151807

Reviewed by Alex Christensen.

No new tests (Covered by changes to existing bindings tests).

While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
two separate variables to reduce complexity.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):
(GenerateParametersCheck): Deleted.
(GenerateReturnParameters): Deleted.

* bindings/scripts/IDLAttributes.txt:

* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_set_property):
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
(webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
(webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
(webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
(webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
(WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
(WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
* bindings/scripts/test/ObjC/DOMTestObj.h:

* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj attrWithGetterExceptionWithMessage]):
(-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
(-[DOMTestObj attrWithSetterExceptionWithMessage]):
(-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):

* bindings/scripts/test/TestObj.idl:

* dom/ExceptionCode.h:

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

5 years ago[css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
jfernandez@igalia.com [Thu, 3 Dec 2015 17:57:13 +0000 (17:57 +0000)]
[css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
https://bugs.webkit.org/show_bug.cgi?id=151802

Reviewed by Sergio Villar Senin.

Source/WebCore:

When resolving auto margins so that they use the available space, in the
corresponding axis, we must consider that there might be other specified
margins. Such margins must account to determine the actual available space.

Test: fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::updateAutoMarginsInRowAxisIfNeeded):
(WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):

LayoutTests:

Tests to verify the specified margins account for determining the available space for
auto-margins alignment.

* fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins-expected.txt: Added.
* fast/css-grid-layout/grid-item-auto-margins-must-respect-specified-margins.html: Added.

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

5 years agoRebaselining svg/custom/bug78807.svg since actual results now match Mac expectations
ryanhaddad@apple.com [Thu, 3 Dec 2015 17:08:37 +0000 (17:08 +0000)]
Rebaselining svg/custom/bug78807.svg since actual results now match Mac expectations
https://bugs.webkit.org/show_bug.cgi?id=151804

Unreviewed test gardening.

* platform/win/svg/custom/bug78807-expected.txt:

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

5 years agoSkipping failing sputnik/Unicode/Unicode_510 tests pending further investigation
ryanhaddad@apple.com [Thu, 3 Dec 2015 16:43:46 +0000 (16:43 +0000)]
Skipping failing sputnik/Unicode/Unicode_510 tests pending further investigation
https://bugs.webkit.org/show_bug.cgi?id=151505

Unreviewed test gardening.

* platform/win/TestExpectations:

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

5 years agoMarking fast/css/pseudo-visited-background-color-on-input.html as failing on win
ryanhaddad@apple.com [Thu, 3 Dec 2015 16:18:48 +0000 (16:18 +0000)]
Marking fast/css/pseudo-visited-background-color-on-input.html as failing on win
https://bugs.webkit.org/show_bug.cgi?id=151756

Unreviewed test gardening.

* platform/win/TestExpectations:

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

5 years agofast/borders/hidpi-border-clipping-right-after-move.html
ryanhaddad@apple.com [Thu, 3 Dec 2015 16:14:25 +0000 (16:14 +0000)]
fast/borders/hidpi-border-clipping-right-after-move.html
https://bugs.webkit.org/show_bug.cgi?id=151754

Unreviewed test gardening.

* platform/win/TestExpectations:

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

5 years agoMove ResourceLoadScheduler to WebKit1
antti@apple.com [Thu, 3 Dec 2015 12:51:17 +0000 (12:51 +0000)]
Move ResourceLoadScheduler to WebKit1
https://bugs.webkit.org/show_bug.cgi?id=151743

Reviewed by Alex Christensen.

Source/WebCore:

It is no longer used by WebKit2. Simplify the WebKit/WebCore interface.

* WebCore.xcodeproj/project.pbxproj:
* dom/ContainerNode.cpp:
* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* dom/Document.h:
* loader/DocumentLoader.h:
* loader/LoaderStrategy.cpp:
(WebCore::LoaderStrategy::~LoaderStrategy):
(WebCore::ResourceLoadSuspender::ResourceLoadSuspender):
(WebCore::ResourceLoadSuspender::~ResourceLoadSuspender):
(WebCore::LoaderStrategy::resourceLoadScheduler): Deleted.
(WebCore::LoaderStrategy::loadResourceSynchronously): Deleted.
(WebCore::LoaderStrategy::createBlobRegistry): Deleted.
(WebCore::LoaderStrategy::createPingHandle): Deleted.
* loader/LoaderStrategy.h:

    Loading functions implemented on WebKit side move to pure virtual LoaderStrategy.

* loader/ResourceLoadScheduler.cpp: Removed.
* loader/ResourceLoadScheduler.h: Removed.

    ResourceLoadScheduler moves to WebKit1 as WebResourceLoadScheduler.

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::finishNetworkLoad):
(WebCore::ResourceLoader::setDefersLoading):
(WebCore::ResourceLoader::frameLoader):
(WebCore::ResourceLoader::willSwitchToSubstituteResource):
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/archive/ArchiveResourceCollection.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::performPostLoadActions):
(WebCore::CachedResourceLoader::incrementRequestCount):
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::pluginStrategy):
(WebCore::PlatformStrategies::blobRegistry):

    Move BlobRegistry factory function here from LoaderStrategy as this allows network process to have null loaderStrategy.
    (it could be renamed BlobStrategy for consistency later).

(WebCore::PlatformStrategies::PlatformStrategies):
* platform/network/BlobRegistry.cpp:
(WebCore::blobRegistry):
(WebCore::BlobRegistry::~BlobRegistry):
* platform/network/ResourceRequestBase.h:
* style/StyleResolveTree.cpp:
(WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
(WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.cpp: Copied from Source/WebCore/loader/ResourceLoadScheduler.cpp.
(webResourceLoadScheduler):
(WebResourceLoadScheduler::hostForURL):
(WebResourceLoadScheduler::WebResourceLoadScheduler):
(WebResourceLoadScheduler::~WebResourceLoadScheduler):
(WebResourceLoadScheduler::scheduleSubresourceLoad):
(WebResourceLoadScheduler::loadResourceSynchronously):
(WebResourceLoadScheduler::schedulePluginStreamLoad):
(WebResourceLoadScheduler::scheduleLoad):
(WebResourceLoadScheduler::remove):
(WebResourceLoadScheduler::setDefersLoading):
(WebResourceLoadScheduler::crossOriginRedirectReceived):
(WebResourceLoadScheduler::servePendingRequests):
(WebResourceLoadScheduler::suspendPendingRequests):
(WebResourceLoadScheduler::resumePendingRequests):
(WebResourceLoadScheduler::scheduleServePendingRequests):
(WebResourceLoadScheduler::requestTimerFired):
(WebResourceLoadScheduler::HostInformation::HostInformation):
(WebResourceLoadScheduler::HostInformation::~HostInformation):
(WebResourceLoadScheduler::HostInformation::priorityToIndex):
(WebResourceLoadScheduler::HostInformation::schedule):
(WebResourceLoadScheduler::HostInformation::addLoadInProgress):
(WebResourceLoadScheduler::HostInformation::remove):
(WebResourceLoadScheduler::HostInformation::hasRequests):
(WebResourceLoadScheduler::HostInformation::limitRequests):
(WebResourceLoadScheduler::createPingHandle):
(WebCore::ResourceLoadScheduler::hostForURL): Deleted.
(WebCore::resourceLoadScheduler): Deleted.
(WebCore::ResourceLoadScheduler::ResourceLoadScheduler): Deleted.
(WebCore::ResourceLoadScheduler::~ResourceLoadScheduler): Deleted.
(WebCore::ResourceLoadScheduler::scheduleSubresourceLoad): Deleted.
(WebCore::ResourceLoadScheduler::schedulePluginStreamLoad): Deleted.
(WebCore::ResourceLoadScheduler::scheduleLoad): Deleted.
(WebCore::ResourceLoadScheduler::remove): Deleted.
(WebCore::ResourceLoadScheduler::setDefersLoading): Deleted.
(WebCore::ResourceLoadScheduler::crossOriginRedirectReceived): Deleted.
(WebCore::ResourceLoadScheduler::servePendingRequests): Deleted.
(WebCore::ResourceLoadScheduler::suspendPendingRequests): Deleted.
(WebCore::ResourceLoadScheduler::resumePendingRequests): Deleted.
(WebCore::ResourceLoadScheduler::scheduleServePendingRequests): Deleted.
(WebCore::ResourceLoadScheduler::requestTimerFired): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::HostInformation): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::~HostInformation): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::priorityToIndex): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::schedule): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::addLoadInProgress): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::remove): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::hasRequests): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::limitRequests): Deleted.
* WebCoreSupport/WebResourceLoadScheduler.h: Copied from Source/WebCore/loader/ResourceLoadScheduler.h.
(WebResourceLoadScheduler::isSerialLoadingEnabled):
(WebResourceLoadScheduler::setSerialLoadingEnabled):
(WebResourceLoadScheduler::HostInformation::name):
(WebResourceLoadScheduler::HostInformation::requestsPending):
(WebCore::ResourceLoadScheduler::isSerialLoadingEnabled): Deleted.
(WebCore::ResourceLoadScheduler::setSerialLoadingEnabled): Deleted.
(WebCore::ResourceLoadScheduler::Suspender::Suspender): Deleted.
(WebCore::ResourceLoadScheduler::Suspender::~Suspender): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::name): Deleted.
(WebCore::ResourceLoadScheduler::HostInformation::requestsPending): Deleted.
* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/mac:

* Plugins/Hosted/HostedNetscapePluginStream.mm:
(WebKit::HostedNetscapePluginStream::start):
(WebKit::HostedNetscapePluginStream::stop):
* Plugins/WebNetscapePluginStream.mm:
(WebNetscapePluginStream::start):
(WebNetscapePluginStream::stop):
* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createLoaderStrategy):
(WebPlatformStrategies::createPasteboardStrategy):
(WebPlatformStrategies::createPluginStrategy):
(WebPlatformStrategies::createBlobRegistry):
(WebPlatformStrategies::cookiesForDOM):
* WebView/WebView.mm:
(-[WebView _dispatchPendingLoadRequests]):
(+[WebView _setLoadResourcesSerially:]):
(+[WebView _HTTPPipeliningEnabled]):

Source/WebKit2:

* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createCookiesStrategy):
(WebKit::NetworkProcessPlatformStrategies::createLoaderStrategy):
(WebKit::NetworkProcessPlatformStrategies::createPasteboardStrategy):
(WebKit::NetworkProcessPlatformStrategies::createPluginStrategy):
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
(WebKit::NetworkProcessPlatformStrategies::resourceLoadScheduler): Deleted.
(WebKit::NetworkProcessPlatformStrategies::loadResourceSynchronously): Deleted.
* NetworkProcess/NetworkProcessPlatformStrategies.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::~WebResourceLoadScheduler):
(WebKit::WebResourceLoadScheduler::loadResource):
(WebKit::WebResourceLoadScheduler::resumePendingRequests):
(WebKit::WebResourceLoadScheduler::networkProcessCrashed):
(WebKit::WebResourceLoadScheduler::loadResourceSynchronously):
(WebKit::WebResourceLoadScheduler::createPingHandle):
(WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad): Deleted.
(WebKit::WebResourceLoadScheduler::setSerialLoadingEnabled): Deleted.
* WebProcess/Network/WebResourceLoadScheduler.h:
(WebKit::WebResourceLoadScheduler::webResourceLoaderForIdentifier):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::Stream::start):
(WebKit::PluginView::Stream::cancel):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::createLoaderStrategy):
(WebKit::WebPlatformStrategies::createPasteboardStrategy):
(WebKit::WebPlatformStrategies::createPluginStrategy):
(WebKit::WebPlatformStrategies::createBlobRegistry):
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::deleteCookie):
(WebKit::WebPlatformStrategies::refreshPlugins):
(WebKit::WebPlatformStrategies::resourceLoadScheduler): Deleted.
(WebKit::WebPlatformStrategies::loadResourceSynchronously): Deleted.
(WebKit::WebPlatformStrategies::createPingHandle): Deleted.
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

5 years agoUnreviewed EFL urgent gardening. Skip web-platform-tests
gyuyoung.kim@webkit.org [Thu, 3 Dec 2015 08:07:34 +0000 (08:07 +0000)]
Unreviewed EFL urgent gardening. Skip web-platform-tests
because it has been timeout since r192796.

* platform/efl/TestExpectations:

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

5 years agoPolymorphic operand types for DFG and FTL mul.
mark.lam@apple.com [Thu, 3 Dec 2015 05:42:56 +0000 (05:42 +0000)]
Polymorphic operand types for DFG and FTL mul.
https://bugs.webkit.org/show_bug.cgi?id=151746

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Perf on benchmarks is neutral except for the newly added JSRegress ftl-object-mul
test which shows a 2.16x speed up on x86_64 FTL, 1.27x speed up on x86_64 DFG,
and 1.56x on x86 DFG.

The speed up comes not from the mul operator itself, but from the fact that the
polymorphic operand types support now allow the test function to run without OSR
exiting, thereby realizing the DFG and FTL's speed up on other work that the test
function does.

This patch has passed the layout tests on x86_64 with a debug build.
It passed the JSC tests with x86 and x86_64 debug builds.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithMul):
* ftl/FTLCompile.cpp:
- Changed to call generateBinaryOpFastPath() instead now, and let it dispatch to
  the appropriate snippet generator.

* ftl/FTLCompileBinaryOp.cpp:
(JSC::FTL::generateBinaryArithOpFastPath):
(JSC::FTL::generateBinaryOpFastPath):
(JSC::FTL::generateArithSubFastPath): Deleted.
(JSC::FTL::generateValueAddFastPath): Deleted.
- Refactored these functions to eliminate the need for copy-pasting every time
  we add support for another binary arithmetic snippet.

* ftl/FTLCompileBinaryOp.h:
* ftl/FTLInlineCacheDescriptor.h:
* ftl/FTLInlineCacheDescriptorInlines.h:
(JSC::FTL::ArithMulDescriptor::ArithMulDescriptor):
(JSC::FTL::ArithMulDescriptor::icSize):
* ftl/FTLInlineCacheSize.cpp:
(JSC::FTL::sizeOfArithMul):
* ftl/FTLInlineCacheSize.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::lower):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithMul):
* jit/JITMulGenerator.h:
(JSC::JITMulGenerator::JITMulGenerator):

* tests/stress/op_mul.js:
- Updated a test value: the interesting value for imminent overflow from an
  int32 is 0x7fffffff, not 0x7ffffff.

LayoutTests:

* js/regress/ftl-object-mul-expected.txt: Added.
* js/regress/ftl-object-mul.html: Added.
* js/regress/script-tests/ftl-object-mul.js: Added.
(o1.valueOf):
(foo):

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

5 years agoUnify font-variant-* with font-variant shorthand
mmaxfield@apple.com [Thu, 3 Dec 2015 04:08:41 +0000 (04:08 +0000)]
Unify font-variant-* with font-variant shorthand
https://bugs.webkit.org/show_bug.cgi?id=149773

Reviewed by Darin Adler.

Source/WebCore:

This patch makes font-variant a shorthand for the following properties:
font-variant-ligatures
font-variant-position
font-variant-caps
font-variant-numeric
font-variant-alternates
font-variant-east-asian

This is consistent with the CSS Fonts Level 3 spec.

This patch also migrates the "font" longhand to use the font-variant-caps
property.

Test: fast/text/font-variant-shorthand.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontVariantEastAsianPropertyValue): Rename FontVariantEastAsian values.
(WebCore::fontVariantFromStyle): We must consult with the longhand properties to determine
font-variant computed style.
(WebCore::ComputedStyleExtractor::propertyValue): Don't put any-old font-variant-caps inside
the font shorthand.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Guard against incorrect downcasts (due to inherit
of the new shorthand property).
* css/CSSParser.cpp: Parse font-variant as a shorthand. Also implement its "normal" and "none" values.
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFont):
(WebCore::CSSParser::parseSystemFont):
(WebCore::CSSParser::parseFontVariantLigatures):
(WebCore::CSSParser::parseFontVariantNumeric):
(WebCore::CSSParser::parseFontVariantEastAsian):
(WebCore::CSSParser::parseFontVariant):
(WebCore::isValidKeywordPropertyAndValue): Deleted.
(WebCore::isKeywordPropertyID): Deleted.
* css/CSSParser.h:
* css/CSSPropertyNames.in: Turn font-variant into a shorthand property.
* css/FontVariantBuilder.h: Guard against incorrect downcasts. Also update for renamed
FontVariantEastAsian type.
(WebCore::applyValueFontVariantLigatures):
(WebCore::applyValueFontVariantNumeric):
(WebCore::applyValueFontVariantEastAsian):
* css/StyleProperties.cpp: Update to use the more specific property.
(WebCore::StyleProperties::appendFontLonghandValueIfExplicit):
(WebCore::StyleProperties::fontValue):
(WebCore::StyleProperties::asText):
* css/StyleResolver.cpp: Ditto.
(WebCore::StyleResolver::isValidCueStyleProperty):
* editing/EditingStyle.cpp: Ditto.
* editing/cocoa/HTMLConverter.mm: Ditto.
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverter::computedAttributesForElement):
* editing/ios/EditorIOS.mm: Ditto.
(WebCore::Editor::removeUnchangeableStyles):
* html/canvas/CanvasRenderingContext2D.cpp: Ditto.
(WebCore::CanvasRenderingContext2D::font):
(WebCore::CanvasRenderingContext2D::setFont):
* platform/graphics/FontCache.h: Removing duplicate cache key value.
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontCascade.cpp: Migrate to the new font-variant-caps from the old member variable.
(WebCore::FontCascade::glyphDataForCharacter):
* platform/graphics/FontCascade.h: Ditto.
(WebCore::FontCascade::isSmallCaps):
* platform/graphics/FontDescription.cpp: Ditto.
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h: Ditto.
(WebCore::FontCascadeDescription::equalForTextAutoSizing):
(WebCore::FontDescription::smallCaps): Deleted.
(WebCore::FontDescription::setSmallCaps): Deleted.
(WebCore::FontDescription::setIsSmallCaps): Deleted.
(WebCore::FontDescription::operator==): Deleted.
* platform/graphics/cocoa/FontCacheCoreText.cpp: Rename FontVariantEastAsianWidth.
(WebCore::computeFeatureSettingsFromVariants):
* platform/text/TextFlags.h: Ditto.
(WebCore::FontVariantSettings::operator==):
* rendering/RenderText.cpp: Migrage to the new font-variant-caps from the old member variable.
(WebCore::RenderText::widthFromCache):

LayoutTests:

Update tests. Also temporarily skip existing font-features tests until
https://bugs.webkit.org/show_bug.cgi?id=149774 is fixed.

* css3/font-variant-parsing-expected.txt:
* css3/font-variant-parsing.html:
* fast/css/font-property-priority-expected.txt:
* fast/css/font-shorthand-expected.txt:
* fast/css/parsing-font-variant-ligatures-expected.txt:
* fast/css/parsing-font-variant-ligatures.html:
* fast/inspector-support/style-expected.txt:
* fast/text/font-variant-shorthand-expected.txt: Added.
* fast/text/font-variant-shorthand.html: Added.
* platform/mac/TestExpectations:
* platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.txt:

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

5 years agoREGRESSION(r192753): Remote Web Inspector: Applications and Debuggables not showing...
commit-queue@webkit.org [Thu, 3 Dec 2015 04:05:09 +0000 (04:05 +0000)]
REGRESSION(r192753): Remote Web Inspector: Applications and Debuggables not showing up in debuggers
https://bugs.webkit.org/show_bug.cgi?id=151787

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-12-02
Reviewed by Brian Burg.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::receivedIndicateMessage):
Removed lock that was unnecessarily added in r192753. It was
protecting nothing.

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

5 years agoAllow nil for unspecified benchmark pathes
utatane.tea@gmail.com [Thu, 3 Dec 2015 03:44:12 +0000 (03:44 +0000)]
Allow nil for unspecified benchmark pathes
https://bugs.webkit.org/show_bug.cgi?id=151784

Reviewed by Filip Pizlo.

`Pathname.new(nil)` will raise an error.
Only generate Pathname if the benchmark path is specified.

* Scripts/run-jsc-benchmarks:

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

5 years agoReduce size of ScriptElement
commit-queue@webkit.org [Thu, 3 Dec 2015 03:29:24 +0000 (03:29 +0000)]
Reduce size of ScriptElement
https://bugs.webkit.org/show_bug.cgi?id=151786

Patch by Alex Christensen <achristensen@webkit.org> on 2015-12-02
Reviewed by Andreas Kling.

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::requestScript):
* dom/ScriptElement.h:
Use callOnMainThread instead of a Timer to save memory on a timer that is rarely used.
Use bit fields for the boolean values to save another 8 bytes per ScriptElement.
This reduces sizeof(ScriptElement) from 168 to 48 bytes.

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

5 years agoInsert a FIXME comment FTLLazySlowPath.h to remind us to remove/refactor the ScratchR...
sbarati@apple.com [Thu, 3 Dec 2015 03:17:25 +0000 (03:17 +0000)]
Insert a FIXME comment FTLLazySlowPath.h to remind us to remove/refactor the ScratchRegisterAllocator field.

Rubber-stamped by Filip Pizlo.

* ftl/FTLLazySlowPath.h:

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

5 years ago[JSC] Remove insertElement() from FTLB3Output
benjamin@webkit.org [Thu, 3 Dec 2015 02:00:00 +0000 (02:00 +0000)]
[JSC] Remove insertElement() from FTLB3Output
https://bugs.webkit.org/show_bug.cgi?id=151781

Reviewed by Sam Weinig.

* ftl/FTLB3Output.h:
(JSC::FTL::Output::insertElement): Deleted.
That's a LLVM concept.

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

5 years agoRebaselining fast/dom/adopt-attribute-crash-expected for win
ryanhaddad@apple.com [Thu, 3 Dec 2015 01:46:21 +0000 (01:46 +0000)]
Rebaselining fast/dom/adopt-attribute-crash-expected for win
https://bugs.webkit.org/show_bug.cgi?id=151762

Reviewed by Darin Adler.

* platform/win/fast/dom/adopt-attribute-crash-expected.txt:

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

5 years ago[JSC] Remove stuffs related to alloca from FTLB3Output
commit-queue@webkit.org [Thu, 3 Dec 2015 00:32:13 +0000 (00:32 +0000)]
[JSC] Remove stuffs related to alloca from FTLB3Output
https://bugs.webkit.org/show_bug.cgi?id=151780

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-12-02
Reviewed by Mark Lam.

We can use the Phis directly with B3 :)

* ftl/FTLB3Output.h:
(JSC::FTL::Output::alloca): Deleted.
(JSC::FTL::Output::get): Deleted.
(JSC::FTL::Output::set): Deleted.

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

5 years ago[JSC] Add sin(), cos(), pow() and log() to B3
benjamin@webkit.org [Thu, 3 Dec 2015 00:21:20 +0000 (00:21 +0000)]
[JSC] Add sin(), cos(), pow() and log() to B3
https://bugs.webkit.org/show_bug.cgi?id=151778

Reviewed by Geoffrey Garen.

* ftl/FTLB3Output.h:
(JSC::FTL::Output::doubleSin):
(JSC::FTL::Output::doubleCos):
(JSC::FTL::Output::doublePow):
(JSC::FTL::Output::doubleLog):
(JSC::FTL::Output::callWithoutSideEffects):

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

5 years agoAsynchronously call onerror when a content blocker blocks ascript element's load
commit-queue@webkit.org [Wed, 2 Dec 2015 23:55:50 +0000 (23:55 +0000)]
Asynchronously call onerror when a content blocker blocks ascript element's load
https://bugs.webkit.org/show_bug.cgi?id=151649

Patch by Alex Christensen <achristensen@webkit.org> on 2015-12-02
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/contentextensions/script-onerror.html

* dom/ScriptElement.cpp:
(WebCore::ScriptElement::ScriptElement):
(WebCore::ScriptElement::requestScript):
* dom/ScriptElement.h:

LayoutTests:

* http/tests/contentextensions/script-onerror-expected.txt: Added.
* http/tests/contentextensions/script-onerror.html: Added.
* http/tests/contentextensions/script-onerror.html.json: Added.
* http/tests/misc/unloadable-script-expected.txt:
* http/tests/misc/unloadable-script.html:
* http/tests/security/local-JavaScript-from-remote-expected.txt:
* http/tests/security/local-JavaScript-from-remote.html:
Added testRunner.waitUntilDone and testRunner.notifyDone to reflect the fact that onerror is no longer called synchronously.

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

5 years agoFix authentication requests with NetworkSession and canHandleHTTPSServerTrustEvaluati...
achristensen@apple.com [Wed, 2 Dec 2015 23:51:02 +0000 (23:51 +0000)]
Fix authentication requests with NetworkSession and canHandleHTTPSServerTrustEvaluation true
https://bugs.webkit.org/show_bug.cgi?id=151775
rdar://problem/23586265

Reviewed by Chris Dumez.

In https://bugs.webkit.org/show_bug.cgi?id=150968 I copied functionality from
NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync into NetworkLoad::didReceiveChallenge
but I overlooked the call to m_client.canAuthenticateAgainstProtectionSpaceAsync which is needed
if canHandleHTTPSServerTrustEvaluation is true.  This adds that call and moves what should happen
after that to NetworkLoad::continueCanAuthenticateAgainstProtectionSpace.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveChallenge):
(WebKit::NetworkLoad::didReceiveResponse):
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkSession.h:
* Shared/Authentication/AuthenticationManager.h:

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

5 years agoAdd a few obvious strength-reductions to Air
fpizlo@apple.com [Wed, 2 Dec 2015 23:41:41 +0000 (23:41 +0000)]
Add a few obvious strength-reductions to Air
https://bugs.webkit.org/show_bug.cgi?id=151777

Reviewed by Mark Lam.

The absence of these optimizations was obnoxious.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::add32): lea 1(reg), reg -> add 1, reg.
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::generate): Emit simpler prologue/epilogue if !frameSize.
* b3/air/AirOpcode.opcodes: We have matching for BranchMul32 with immediate, but we forgot to add the instruction form.
* jit/AssemblyHelpers.h: Support for the prologue/epilogue optimizations.
(JSC::AssemblyHelpers::emitFunctionPrologue):
(JSC::AssemblyHelpers::emitFunctionEpilogueWithEmptyFrame):
(JSC::AssemblyHelpers::emitFunctionEpilogue):

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

5 years agoFix flaky test added with r192954.
eric.carlson@apple.com [Wed, 2 Dec 2015 23:04:47 +0000 (23:04 +0000)]
Fix flaky test added with r192954.

Unreviewed.

* fast/mediastream/MediaStreamTrack-getSettings.html:

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

5 years ago[iOS] Abrupt transition between Fullscreen -> PiP
jer.noble@apple.com [Wed, 2 Dec 2015 23:01:23 +0000 (23:01 +0000)]
[iOS] Abrupt transition between Fullscreen -> PiP
https://bugs.webkit.org/show_bug.cgi?id=151719

Reviewed by Eric Carlson.

Follow-up to r192922: When moving from inline -> PiP, don't forget to hide the fullscreen
window once the PiP transition completes.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):

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

5 years agoUnreviewed, rolling out r192955.
commit-queue@webkit.org [Wed, 2 Dec 2015 22:52:54 +0000 (22:52 +0000)]
Unreviewed, rolling out r192955.
https://bugs.webkit.org/show_bug.cgi?id=151776

A large number of the tests added with this change are failing
on Windows (Requested by ryanhaddad on #webkit).

Reverted changeset:

"[css border] border-image doesn't honor border-style"
https://bugs.webkit.org/show_bug.cgi?id=99922
http://trac.webkit.org/changeset/192955

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

5 years agoFix preloader issue with srcdoc documents.
yoav@yoav.ws [Wed, 2 Dec 2015 22:41:21 +0000 (22:41 +0000)]
Fix preloader issue with srcdoc documents.
https://bugs.webkit.org/show_bug.cgi?id=151744

Reviewed by Ryosuke Niwa.

Source/WebCore:

Make sure that PreloadRequest is resolving URLs based on the document's
baseURL() rather than using url() as the base URL, which is not how URLs
are resolved by the parser, and fails when document->url() diverges from
the document's base URL (e.g. in the case of srcdoc based documents).

Test: fast/preloader/iframe-srcdoc.html

* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::completeURL):

LayoutTests:

Added a test that makes sure that srcdoc based subresources are properly preloaded.

* fast/preloader/iframe-srcdoc-expected.txt: Added.
* fast/preloader/iframe-srcdoc.html: Added.

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

5 years agoUpdate the interface added in r192967
benjamin@webkit.org [Wed, 2 Dec 2015 22:35:38 +0000 (22:35 +0000)]
Update the interface added in r192967

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-12-02

* b3/B3CCallValue.h:
Filip prefers explicit effects.
* b3/testb3.cpp:
(JSC::B3::testCallSimplePure):

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

5 years ago[JSC] Add a function attribute for Pure functions in B3
benjamin@webkit.org [Wed, 2 Dec 2015 22:12:35 +0000 (22:12 +0000)]
[JSC] Add a function attribute for Pure functions in B3
https://bugs.webkit.org/show_bug.cgi?id=151741

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-12-02
Reviewed by Geoffrey Garen.

We have plenty of functions without side effects
when lowering DFG.
This patch adds the "PureCall" flag to B3's CCall
to make sure those functions do not prevent optimizations.

* b3/B3CCallValue.h:
* b3/testb3.cpp:
(JSC::B3::testCallSimplePure):
(JSC::B3::run):

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

5 years agoAdd a setting and restriction which will pause invisible autoplaying video
jer.noble@apple.com [Wed, 2 Dec 2015 22:09:58 +0000 (22:09 +0000)]
Add a setting and restriction which will pause invisible autoplaying video
https://bugs.webkit.org/show_bug.cgi?id=151412

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/video-restricted-invisible-autoplay-not-allowed.html

Drive-by fix: m_autoplaying is reset in many places by calling pause() or play(), where those
calls did not originate from an explicit request to pause or play, e.g., during an interruption.
This causes m_autoplaying to be set to false, thus breaking resumption of autoplaying when the
interruption ends. Update PlatformMediaSession to remember its client's "autoplaying" state and
restore it when an interruption ends.

Add a means to register for viewport visibility notifications to FrameView, RenderView,
and RenderElement. Elements who wish to recieve these notifications must do so through their
renderer, and thus will have to re-register whenever a new renderer is attached.

Add a restriction to HTMLMediaElement which will pause autoplaying video when that video scrolls
out of the viewport, or is hidden with CSS.

Add a setting which controls whether that new restriction is set.

* dom/Element.h:
(WebCore::Element::isVisibleInViewportChanged): Add default empty virtual method.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::didMoveToNewDocument):
(WebCore::HTMLMediaElement::documentDidResumeFromPageCache):
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
(WebCore::HTMLMediaElement::resumeAutoplaying):
(WebCore::mediaElementIsAllowedToAutoplay):
(WebCore::HTMLMediaElement::isVisibleInViewportChanged):
(WebCore::HTMLMediaElement::updateShouldAutoplay):
(WebCore::HTMLMediaElement::HTMLMediaElement): Set the new restriction based on the current Settings.
(WebCore::HTMLMediaElement::resumeAutoplaying): Continue autoplay, or begin playback.
(WebCore::HTMLMediaElement::didMoveToNewDocument): Update our autoplay state.
(WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
(WebCore::HTMLMediaElement::removedFrom): Ditto.
(WebCore::HTMLMediaElement::didAttachRenderers): Ditto.
(WebCore::HTMLMediaElement::didDetachRenderers): Ditto.
(WebCore::HTMLMediaElement::visibilityDidChange): Ditto.
(WebCore::HTMLMediaElement::willDetachRenderers): Unregister for visibility callbacks.
(WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Clear new restriction.
(WebCore::mediaElementIsAllowedToAutoplay): Check for autoplay requirements.
(WebCore::HTMLMediaElement::isVisibleInViewportChanged): Added, update our autoplay state.
(WebCore::HTMLMediaElement::updateShouldAutoplay): Set interruption if necessary, clear otherwise.
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::restrictionName): Added support for new restriction.
* html/MediaElementSession.h:
* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged): Update clients of viewport visibility.
* page/Settings.in:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::stateName): Add new "Autoplay" state.
(WebCore::interruptionName): Added new interruption type.
(WebCore::PlatformMediaSession::beginInterruption): Set the m_interruptionType.
(WebCore::PlatformMediaSession::clientWillBeginAutoplaying): Set the m_state to Autoplaying.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::interruptionType): Added getter.
(WebCore::PlatformMediaSessionClient::resumeAutoplaying): Added default.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback): Only pause session if its state is playing.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement): Set new ivars.
(WebCore::RenderElement::~RenderElement): Unregister for callbacks if necessary.
(WebCore::RenderElement::registerForVisibleInViewportCallback): Register for callbacks from RenderView.
(WebCore::RenderElement::unregisterForVisibleInViewportCallback): Unregister from same.
(WebCore::RenderElement::visibleInViewportStateChanged): Notify Element if value has changed.
* rendering/RenderElement.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::registerForVisibleInViewportCallback): Add renderer to list of callbacks.
(WebCore::RenderView::unregisterForVisibleInViewportCallback): Remove renderer from same.
(WebCore::RenderView::updateVisibleViewportRect): Walk renderers setting their visiblility based on the viewport visible rect.
* rendering/RenderView.h:
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions): Support new restriction.

LayoutTests:

* media/video-restricted-invisible-autoplay-not-allowed-expected.txt: Added.
* media/video-restricted-invisible-autoplay-not-allowed.html: Added.

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

5 years agoPerf dashboard should avoid overflow during geometric mean computation
rniwa@webkit.org [Wed, 2 Dec 2015 22:09:16 +0000 (22:09 +0000)]
Perf dashboard should avoid overflow during geometric mean computation
https://bugs.webkit.org/show_bug.cgi?id=151773

Reviewed by Chris Dumez.

* public/include/report-processor.php:

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

5 years agoRebaseline fast/parser/xml-declaration-missing-ending-mark.html, fast/parser/xml...
ryanhaddad@apple.com [Wed, 2 Dec 2015 22:04:30 +0000 (22:04 +0000)]
Rebaseline fast/parser/xml-declaration-missing-ending-mark.html, fast/parser/xml-colon-entity.html for Win
https://bugs.webkit.org/show_bug.cgi?id=151763

Reviewed by Brent Fulgham.

* platform/win/fast/parser/xml-colon-entity-expected.txt:
* platform/win/fast/parser/xml-declaration-missing-ending-mark-expected.txt:

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

5 years agoRebaseline fast/dynamic/text-combine.html on win
ryanhaddad@apple.com [Wed, 2 Dec 2015 21:47:54 +0000 (21:47 +0000)]
Rebaseline fast/dynamic/text-combine.html on win
https://bugs.webkit.org/show_bug.cgi?id=151761

Unreviewed test gardening.

* platform/win/fast/dynamic/text-combine-expected.png:
* platform/win/fast/dynamic/text-combine-expected.txt:

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

5 years agoRebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html after r192953
ryanhaddad@apple.com [Wed, 2 Dec 2015 21:41:51 +0000 (21:41 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html after r192953
https://bugs.webkit.org/show_bug.cgi?id=116963

Unreviewed test gardening.

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

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

5 years agoModern IDB: Remove all traces of IDBObjectStore::openKeyCursor from tests.
beidson@apple.com [Wed, 2 Dec 2015 21:33:32 +0000 (21:33 +0000)]
Modern IDB: Remove all traces of IDBObjectStore::openKeyCursor from tests.
https://bugs.webkit.org/show_bug.cgi?id=151772

Reviewed by Alex Christensen.

IDBObjectStore::openKeyCursor no longer exists, so testing it is inherently bogus.

* platform/mac-wk1/TestExpectations: Two tests now pass with small expectations changes.
* storage/indexeddb/cursor-basics-expected.txt:
* storage/indexeddb/cursor-overloads-expected.txt:

* storage/indexeddb/cursor-overloads.html:
* storage/indexeddb/optional-arguments.html:
* storage/indexeddb/resources/cursor-basics.js:
* storage/indexeddb/resources/deleted-objects.js:
* storage/indexeddb/resources/exceptions.js:
* storage/indexeddb/resources/objectstore-basics.js:

* storage/indexeddb/objectstore-keycursor-expected.txt: Removed.
* storage/indexeddb/objectstore-keycursor.html: Removed.
* storage/indexeddb/resources/objectstore-keycursor.js: Removed.

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

5 years agoAdd some more picture element layout tests
hyatt@apple.com [Wed, 2 Dec 2015 20:57:34 +0000 (20:57 +0000)]
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.
Add some more picture element layout tests
https://bugs.webkit.org/show_bug.cgi?id=151769

Reviewed by Dean Jackson.

* fast/picture/image-picture-invalid-expected.txt: Added.
* fast/picture/image-picture-invalid.html: Added.
* fast/picture/image-picture-nested-expected.txt: Added.
* fast/picture/image-picture-nested.html: Added.

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

5 years agoModern IDB: Enable a couple more passing tests.
beidson@apple.com [Wed, 2 Dec 2015 20:53:22 +0000 (20:53 +0000)]
Modern IDB: Enable a couple more passing tests.
https://bugs.webkit.org/show_bug.cgi?id=151766

Reviewed by Beth Dakin.

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/create-object-store-options-expected.txt:

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

5 years agoSkipping tests on Win that fail due to unimplemented showModalDialog function.
ryanhaddad@apple.com [Wed, 2 Dec 2015 20:50:38 +0000 (20:50 +0000)]
Skipping tests on Win that fail due to unimplemented showModalDialog function.
https://bugs.webkit.org/show_bug.cgi?id=151506

Unreviewed test gardening.

* platform/win/TestExpectations:

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

5 years agoModern IDB: IDBTransaction::error is not exposed.
beidson@apple.com [Wed, 2 Dec 2015 20:32:38 +0000 (20:32 +0000)]
Modern IDB: IDBTransaction::error is not exposed.
https://bugs.webkit.org/show_bug.cgi?id=151752

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (At least 3 failing tests now pass, plus changes to other faulty tests).

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::dispatchEvent):
(WebCore::IDBClient::IDBRequest::uncaughtExceptionInEventHandler):
* Modules/indexeddb/client/IDBRequestImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::error):
(WebCore::IDBClient::IDBTransaction::abortDueToFailedRequest):
(WebCore::IDBClient::IDBTransaction::abort):
(WebCore::IDBClient::IDBTransaction::didCreateIndexOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:
* storage/indexeddb/modern/basic-add.html:
* storage/indexeddb/modern/double-abort-expected.txt:
* storage/indexeddb/modern/index-3.html:
* storage/indexeddb/resources/transaction-error.js:
* storage/indexeddb/transaction-error-expected.txt:

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

5 years ago[css border] border-image doesn't honor border-style
cavalcantii@gmail.com [Wed, 2 Dec 2015 20:25:55 +0000 (20:25 +0000)]
[css border] border-image doesn't honor border-style
https://bugs.webkit.org/show_bug.cgi?id=99922

Reviewed by Simon Fraser.

Source/WebCore:

Ensure that WebKit will be compliant to css-backgrounds spec where a
border with an image will only be rendered if there is a style defined.

Quote: "None: No border. Color and width are ignored (i.e., the border has width 0)".
Reference: http://www.w3.org/TR/css3-background/#border-style

From W3C discussion: "The fact that these properties set the style of the border is
normative". Reference: https://lists.w3.org/Archives/Public/www-style/2015Nov/0260.html

Test: fast/borders/border-image-should-not-display.html

* rendering/style/BorderData.h:
(WebCore::BorderData::hasBorder):
(WebCore::BorderData::borderLeftWidth):
(WebCore::BorderData::borderRightWidth):
(WebCore::BorderData::borderTopWidth):
(WebCore::BorderData::borderBottomWidth):
* rendering/style/BorderValue.h:
(WebCore::BorderValue::nonZero):
(WebCore::BorderValue::isVisible):

LayoutTests:

Ensure that WebKit will be compliant to css-backgrounds spec where
a border with an image will only be rendered if there is a style defined.

Previous border image tests had to be edited (i.e. define border-style)
to ensure that a decorated border would be rendered.

* fast/borders/border-image-01.html:
* fast/borders/border-image-border-radius.html:
* fast/borders/border-image-fill-no-intrinsic-size.html:
* fast/borders/border-image-longhand.html:
* fast/borders/border-image-massive-scale.html:
* fast/borders/border-image-omit-right-slice.html:
* fast/borders/border-image-outset-in-shorthand.html:
* fast/borders/border-image-outset-split-inline-expected.txt:
* fast/borders/border-image-outset-split-inline-vertical-lr-expected.txt:
* fast/borders/border-image-outset-split-inline-vertical-lr.html:
* fast/borders/border-image-outset-split-inline.html:
* fast/borders/border-image-outset.html:
* fast/borders/border-image-repeat.html:
* fast/borders/border-image-rotate-transform.html:
* fast/borders/border-image-scale-transform.html:
* fast/borders/border-image-scaled.html:
* fast/borders/border-image-scrambled.html:
* fast/borders/border-image-should-not-display-expected.html: Added.
* fast/borders/border-image-should-not-display.html: Added.
* fast/borders/border-image-side-reduction.html:
* fast/borders/border-image-slice-constrained.html:
* fast/borders/border-image-slice-missing-right.html:
* fast/borders/border-image-slices.html:
* fast/borders/border-image-source.html:
* fast/borders/border-image-trumps-radius-expected.txt:
* fast/borders/border-image-trumps-radius.html:
* fast/borders/hidpi-border-image-gradient-on-subpixels.html:
* fast/borders/resources/red.png: Added.
* fast/borders/scaled-border-image.html:
* fast/gradients/border-image-gradient-expected.txt:
* fast/gradients/border-image-gradient.html:
* fast/hidpi/image-set-border-image-comparison.html:
* fast/hidpi/image-set-border-image-dynamic.html:
* fast/hidpi/image-set-border-image-simple.html:
* fast/writing-mode/border-image-horizontal-bt.html:
* fast/writing-mode/border-image-vertical-lr.html:
* fast/writing-mode/border-image-vertical-rl.html:
* platform/mac/fast/borders/border-image-01-expected.txt:
* platform/mac/fast/borders/border-image-border-radius-expected.txt:
* platform/mac/fast/borders/border-image-longhand-expected.txt:
* platform/mac/fast/borders/border-image-massive-scale-expected.txt:
* platform/mac/fast/borders/border-image-omit-right-slice-expected.txt:
* platform/mac/fast/borders/border-image-outset-expected.txt:
* platform/mac/fast/borders/border-image-outset-in-shorthand-expected.txt:
* platform/mac/fast/borders/border-image-repeat-expected.txt:
* platform/mac/fast/borders/border-image-rotate-transform-expected.txt:
* platform/mac/fast/borders/border-image-scale-transform-expected.txt:
* platform/mac/fast/borders/border-image-scaled-expected.txt:
* platform/mac/fast/borders/border-image-scrambled-expected.txt:
* platform/mac/fast/borders/border-image-side-reduction-expected.txt:
* platform/mac/fast/borders/border-image-slice-constrained-expected.txt:
* platform/mac/fast/borders/border-image-slices-expected.txt:
* platform/mac/fast/borders/border-image-source-expected.txt:
* platform/mac/fast/borders/scaled-border-image-expected.txt:
* platform/mac/fast/hidpi/image-set-border-image-comparison-expected.txt:
* platform/mac/fast/hidpi/image-set-border-image-dynamic-expected.txt:
* platform/mac/fast/hidpi/image-set-border-image-simple-expected.txt:
* platform/mac/fast/writing-mode/border-image-horizontal-bt-expected.txt:
* platform/mac/fast/writing-mode/border-image-vertical-lr-expected.txt:
* platform/mac/fast/writing-mode/border-image-vertical-rl-expected.txt:

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

5 years ago[MediaStream] Implement MediaStreamTrack.getSettings()
eric.carlson@apple.com [Wed, 2 Dec 2015 20:20:37 +0000 (20:20 +0000)]
[MediaStream] Implement MediaStreamTrack.getSettings()
https://bugs.webkit.org/show_bug.cgi?id=151727

Reviewed by Jer Noble.

Source/WebCore:

MediaStreamTrack.getStates has been replaced by MediaStreamTrack.getSettings.

Test: fast/mediastream/MediaStreamTrack-getSettings.html

* CMakeLists.txt: MediaSourceStates.* -> MediaSourceSettings.*.
* DerivedSources.make: No more MediaSourceStates.idl.
* Modules/mediastream/CapabilityRange.cpp: MediaSourceStates.* -> MediaSourceSettings.*.
* Modules/mediastream/MediaSourceSettings.cpp: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.cpp.
(WebCore::MediaSourceSettings::create):
(WebCore::MediaSourceSettings::MediaSourceSettings):
(WebCore::MediaSourceSettings::facingMode):
(WebCore::MediaSourceStates::create): Deleted.
(WebCore::MediaSourceStates::MediaSourceStates): Deleted.
(WebCore::MediaSourceStates::sourceType): Deleted.
(WebCore::MediaSourceStates::facingMode): Deleted.
* Modules/mediastream/MediaSourceSettings.h: Copied from Source/WebCore/Modules/mediastream/MediaSourceStates.h.

MediaSourceStates.* renamed to MediaSourceSettings.* and updated to new API.
* Modules/mediastream/MediaSourceStates.cpp: Removed.
* Modules/mediastream/MediaSourceStates.h: Removed.
* Modules/mediastream/MediaSourceStates.idl: Removed.

* Modules/mediastream/MediaStreamCapabilities.cpp:
(WebCore::MediaStreamCapabilities::sourceType): Return an empty vector for now, will be fixed
  by the changes for https://bugs.webkit.org/show_bug.cgi?id=151728.
(WebCore::MediaStreamCapabilities::sourceId): RealtimeMediaSourceStates -> MediaSourceSettings.
(WebCore::MediaStreamCapabilities::facingMode): Ditto.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings): New.
(WebCore::MediaStreamTrack::getCapabilities): Don't modify states, just pass through whatever
  private track returns.
(WebCore::MediaStreamTrack::trackSettingsChanged):
(WebCore::MediaStreamTrack::states): Deleted.
(WebCore::MediaStreamTrack::trackStatesChanged): Deleted.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl: MediaSourceStates -> MediaSourceSettings.

* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::settings):
(WebCore::MediaStreamAudioSource::states): Deleted.
* Modules/webaudio/MediaStreamAudioSource.h: MediaSourceStates -> MediaSourceSettings.

* WebCore.xcodeproj/project.pbxproj: MediaSourceStates.* -> MediaSourceSettings.*.

* bindings/js/JSMediaSourceStatesCustom.cpp: Removed.
* bindings/js/JSMediaStreamTrackCustom.cpp: Added.
(WebCore::JSMediaStreamTrack::getSettings): MediaSourceSettings is a generic dictionary so
  it has to be generated manually.

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::intrinsicSize): states -> settings.
(WebCore::MediaStreamPrivate::trackStatesChanged): Deleted.
* platform/mediastream/MediaStreamPrivate.h:

* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::settings):
(WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
(WebCore::MediaStreamTrackPrivate::states): Deleted.
(WebCore::MediaStreamTrackPrivate::sourceStatesChanged): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::settingsDidChanged):
(WebCore::RealtimeMediaSource::statesDidChanged): Deleted.
* platform/mediastream/RealtimeMediaSource.h:

* platform/mediastream/RealtimeMediaSourceCapabilities.h:
(WebCore::RealtimeMediaSourceCapabilities::facingModes): States -> Settings.
(WebCore::RealtimeMediaSourceCapabilities::addFacingMode): Ditto.
(WebCore::RealtimeMediaSourceCapabilities::sourceTypes): Deleted.
(WebCore::RealtimeMediaSourceCapabilities::setSourceType): Deleted.
(WebCore::RealtimeMediaSourceCapabilities::addSourceType): Deleted.

* platform/mediastream/RealtimeMediaSourceCenter.h: States -> Settings.
* platform/mediastream/RealtimeMediaSourceSettings.cpp: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.cpp.
(WebCore::RealtimeMediaSourceSettings::facingMode):
(WebCore::RealtimeMediaSourceStates::facingMode): Deleted.
(WebCore::RealtimeMediaSourceStates::sourceType): Deleted.

* platform/mediastream/RealtimeMediaSourceSettings.h: Copied from Source/WebCore/platform/mediastream/RealtimeMediaSourceStates.h.
* platform/mediastream/RealtimeMediaSourceStates.cpp: Removed.

* platform/mediastream/RealtimeMediaSourceStates.h: Removed.
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioCaptureSource::updateStates): Deleted.

* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:

* platform/mediastream/mac/AVMediaCaptureSource.h:
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::states): Deleted.

* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::updateStates): Deleted.

* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:

* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:

* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::initializeSupportedConstraints):
(WebCore::MockRealtimeAudioSource::updateStates): Deleted.
* platform/mock/MockRealtimeAudioSource.h:

* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::capabilities): Minor cleanup.
(WebCore::MockRealtimeMediaSource::settings):
(WebCore::MockRealtimeMediaSource::supportedConstraints):
(WebCore::MockRealtimeMediaSource::states): Deleted.
* platform/mock/MockRealtimeMediaSource.h:
(WebCore::MockRealtimeMediaSource::constraints):
(WebCore::MockRealtimeMediaSource::currentStates): Deleted.

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::updateSettings):
(WebCore::MockRealtimeVideoSource::initializeCapabilities):
(WebCore::MockRealtimeVideoSource::initializeSupportedConstraints):
(WebCore::MockRealtimeVideoSource::setFrameRate): states -> settings.
(WebCore::MockRealtimeVideoSource::setSize): Ditto.
(WebCore::MockRealtimeVideoSource::drawAnimation): Ditto.
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
(WebCore::MockRealtimeVideoSource::updateStates): Deleted.
(WebCore::MockRealtimeVideoSource::setFacingMode): Deleted.
* platform/mock/MockRealtimeVideoSource.h:

LayoutTests:

* fast/mediastream/MediaStream-video-element-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop-expected.txt:
* fast/mediastream/MediaStream-video-element-track-stop.html:
* fast/mediastream/MediaStream-video-element.html:
* fast/mediastream/MediaStreamTrack-getSettings-expected.txt: Added.
* fast/mediastream/MediaStreamTrack-getSettings.html: Added.

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

5 years agoImplement the picture element.
hyatt@apple.com [Wed, 2 Dec 2015 20:13:50 +0000 (20:13 +0000)]
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.
Implement the picture element.
https://bugs.webkit.org/show_bug.cgi?id=116963

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/select-an-image-source-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/update-the-source-set-expected.txt:

Source/WebCore:

Added fast/picture tests.

* WebCore.xcodeproj/project.pbxproj:
Add HTMLPictureElement.* to the project.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
Remove the CURRENT_SRC ifdef.

(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
New helper function that checks the <source> elements of a <picture> parent
for the best match.

(WebCore::HTMLImageElement::selectImageSource):
Pull out the process of image selection into its own function so that this can
be called from many places (to ensure that dynamic changes are reflected as elements
get changed, added or removed).

(WebCore::HTMLImageElement::parseAttribute):
Call selectImageSource when attributes change.

(WebCore::HTMLImageElement::insertedInto):
If inserted into a picture element, make sure to update the source.

* html/HTMLImageElement.h:
(WebCore::HTMLImageElement::currentSrc):
Remove the CURRENT_SRC ifdef.

* html/HTMLImageElement.idl:
Remove the CURRENT_SRC ifdef.

* html/HTMLPictureElement.cpp: Added.
(WebCore::HTMLPictureElement::HTMLPictureElement):
(WebCore::HTMLPictureElement::create):
(WebCore::HTMLPictureElement::sourcesChanged):
* html/HTMLPictureElement.h: Added.
The new picture element. Has a sourcesChanged() function that is invoked whenever anything
about the <source> elements changes.

* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::insertedInto):
(WebCore::HTMLSourceElement::removedFrom):
(WebCore::HTMLSourceElement::parseAttribute):
Make sure to call sourcesChanged when new sources come and go or when attributes on
source elements change.

* html/HTMLSourceElement.h:
Added parseAttribute function so we can see when attributes change that force us to
do a dynamic update.

* html/HTMLTagNames.in:
Add the picture element.

* html/parser/HTMLSrcsetParser.h:
(WebCore::ImageCandidate::srcOrigin):
(WebCore::ImageCandidate::isEmpty):
Some helpers for picture parsing.

LayoutTests:

* fast/picture: Added.
* fast/picture/image-picture-1x-expected.txt: Added.
* fast/picture/image-picture-1x.html: Added.
* fast/picture/resources: Added.
* fast/picture/resources/blue_rect.jpg: Added.
* fast/picture/resources/currentSrcHelper.js: Added.
(fileName):
(currentSrcFileName):
(currentSrcFileNameNoParams):
* fast/picture/resources/image-set-4x.png: Added.

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

5 years agoRemoved unnecessary #if USE(JSVALUE64).
mark.lam@apple.com [Wed, 2 Dec 2015 20:10:42 +0000 (20:10 +0000)]
Removed unnecessary #if USE(JSVALUE64).
https://bugs.webkit.org/show_bug.cgi?id=151733

Not reviewed.

* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):

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

5 years ago[WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
peavo@outlook.com [Wed, 2 Dec 2015 19:46:26 +0000 (19:46 +0000)]
[WinCairo][MediaFoundation] Video is not rendered correctly on some graphics cards.
https://bugs.webkit.org/show_bug.cgi?id=151757

Reviewed by Alex Christensen.

We need to make sure we use the same bitmap format as in the Direct3D surface
in video memory when copying surface data and rendering with Cairo.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::presentSample):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):

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

5 years agoUse the JITAddGenerator snippet in the FTL.
mark.lam@apple.com [Wed, 2 Dec 2015 19:20:12 +0000 (19:20 +0000)]
Use the JITAddGenerator snippet in the FTL.
https://bugs.webkit.org/show_bug.cgi?id=151519

Reviewed by Geoffrey Garen.

One detail about how we choosing to handle operands to the binary snippets that
may be constant: the slow path call to a C++ function still needs the constant
operand loaded in a register.  To simplify things, we're choosing to always tell
LLVM to load the operands into registers even if they may be constant.  However,
even though a constant operand is preloaded in a register, the snippet generator
will not be made aware of it.  It will continue to load the constant as an
immediate.

* ftl/FTLCompile.cpp:
* ftl/FTLCompileBinaryOp.cpp:
(JSC::FTL::generateArithSubFastPath):
(JSC::FTL::generateValueAddFastPath):
- generateValueAddFastPath() currently is an exact copy of generateArithSubFastPath()
  except that it uses JITAddGenerator instead of JITSubGenerator.  When we add
  support for JITMulGenerator later, the code will start to vary.  We'll refactor
  these functions then when we have more insight into what needs to vary between
  the implementations.

* ftl/FTLCompileBinaryOp.h:
* ftl/FTLInlineCacheDescriptor.h:
* ftl/FTLInlineCacheDescriptorInlines.h:
(JSC::FTL::ValueAddDescriptor::ValueAddDescriptor):
(JSC::FTL::ValueAddDescriptor::icSize):
* ftl/FTLInlineCacheSize.cpp:
(JSC::FTL::sizeOfValueAdd):
* ftl/FTLInlineCacheSize.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::lower):
(JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):

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

5 years agoTeach DFG that ArithSub can now clobber the heap (and other things).
mark.lam@apple.com [Wed, 2 Dec 2015 19:15:33 +0000 (19:15 +0000)]
Teach DFG that ArithSub can now clobber the heap (and other things).
https://bugs.webkit.org/show_bug.cgi?id=151733

Reviewed by Geoffrey Garen.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):

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

5 years agoModern IDB: Get rid of IDBExceptionCode.
beidson@apple.com [Wed, 2 Dec 2015 19:13:02 +0000 (19:13 +0000)]
Modern IDB: Get rid of IDBExceptionCode.
https://bugs.webkit.org/show_bug.cgi?id=151753

Reviewed by Alex Christensen.

No new tests (No change in behavior).

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::count):
(WebCore::IDBClient::IDBIndex::doCount):
(WebCore::IDBClient::IDBIndex::get):
(WebCore::IDBClient::IDBIndex::doGet):
(WebCore::IDBClient::IDBIndex::getKey):
(WebCore::IDBClient::IDBIndex::doGetKey):

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::get):
(WebCore::IDBClient::IDBObjectStore::deleteFunction):
(WebCore::IDBClient::IDBObjectStore::clear):
(WebCore::IDBClient::IDBObjectStore::createIndex):
(WebCore::IDBClient::IDBObjectStore::index):
(WebCore::IDBClient::IDBObjectStore::deleteIndex):
(WebCore::IDBClient::IDBObjectStore::count):
(WebCore::IDBClient::IDBObjectStore::doCount):

* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::fireErrorAfterVersionChangeAbort):

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::abortOnServerAndCancelRequests):

* Modules/indexeddb/server/IndexValueStore.cpp:
(WebCore::IDBServer::IndexValueStore::addRecord):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::beginTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::abortTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::commitTransaction):
(WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::MemoryIDBBackingStore::createIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
(WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getCount):
(WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
(WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):

* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::putIndexKey):

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::createIndex):
(WebCore::IDBServer::MemoryObjectStore::deleteIndex):

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):

* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::IDBError):
(WebCore::IDBError::name):
(WebCore::IDBError::message):
(WebCore::idbErrorName): Deleted.
(WebCore::idbErrorDescription): Deleted.

* Modules/indexeddb/shared/IDBError.h:
(WebCore::IDBError::code):
(WebCore::IDBError::isNull):

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

5 years agoNull dereference loading Blink layout test fast/loader/unload-mutation-crash.html
jiewen_tan@apple.com [Wed, 2 Dec 2015 19:04:07 +0000 (19:04 +0000)]
Null dereference loading Blink layout test fast/loader/unload-mutation-crash.html
https://bugs.webkit.org/show_bug.cgi?id=149305
<rdar://problem/22747892>

Reviewed by Brent Fulgham.

Source/WebCore:

Add an extra guard to replaceDocument() against rude JS in unload event handlers.

Test: fast/loader/unload-mutation-crash.html

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocument):
(WebCore::DocumentWriter::begin):

LayoutTests:

This test case is from Blink r180918:
https://codereview.chromium.org/495743003

* fast/loader/unload-mutation-crash-expected.txt: Added.
* fast/loader/unload-mutation-crash.html: Added.

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

5 years ago[JSC] Handle x86 partial register stalls in Air
commit-queue@webkit.org [Wed, 2 Dec 2015 18:49:09 +0000 (18:49 +0000)]
[JSC] Handle x86 partial register stalls in Air
https://bugs.webkit.org/show_bug.cgi?id=151735

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-12-02
Reviewed by Filip Pizlo.

This patch adds a primitive false-dependency breaking
algorithm to Air. We look for redefinition of the same
variable that is too close to a partial definition.

There is not explicit dependency tracking going on,
but it is pretty fast and the extra xorps added on false-positives
are cheap anyway.

Typically, partial register stalls appear from instructions
interfering with themselves in small loops. Something like:

  Label0:
    cvtsi2sdq %eax, %xmm0
    ...
    jmp Label0

Those are correctly detected by propagating the local distance
information from block to block until no unsafe chain is found.

The test testInt32ToDoublePartialRegisterStall() checks the kind
of cases we typically find from JavaScript.
The execution time is 20% faster with a register reset (which is
astounding since the very next instruction has a real dependency).

Future tweaks will be needed when we can run more JavaScript:
-Handle function calls differently.
-Anything with a special can have hidden instructions.
 We need to take them into account.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::moveZeroToDouble):
* assembler/X86Assembler.h:
(JSC::X86Assembler::xorps_rr):
(JSC::X86Assembler::xorpd_rr):
According to the documentation, starting with Sandy Bridge,
registers reset can be done in the frontend with xorps.

* b3/B3IndexSet.h:
(JSC::B3::IndexSet::remove):
* b3/air/AirFixPartialRegisterStalls.cpp: Added.
(JSC::B3::Air::fixPartialRegisterStalls):
* b3/air/AirFixPartialRegisterStalls.h: Added.
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* b3/testb3.cpp:
(JSC::B3::testInt32ToDoublePartialRegisterStall):
(JSC::B3::run):
* jit/FPRInfo.h:

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

5 years agoWeb Inspector: Handle YieldExpressions in the ScriptSyntaxTree
commit-queue@webkit.org [Wed, 2 Dec 2015 17:27:37 +0000 (17:27 +0000)]
Web Inspector: Handle YieldExpressions in the ScriptSyntaxTree
https://bugs.webkit.org/show_bug.cgi?id=151730

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-12-02
Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Models/NativeFunctionParameters.js:
Add the Generator API.

* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._recurse):
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
Handle YieldExpressions.

LayoutTests:

* inspector/model/parse-script-syntax-tree-expected.txt:
* inspector/model/parse-script-syntax-tree.html:

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

5 years ago[Win] Run non-http tests without Cygwin
bfulgham@apple.com [Wed, 2 Dec 2015 16:53:12 +0000 (16:53 +0000)]
[Win] Run non-http tests without Cygwin
https://bugs.webkit.org/show_bug.cgi?id=151721

Reviewed by Andy Estes.

Support native 32-bit and 64-bit Python (and Perl) builds
for running tests:

1. Use "startswith('win')", rather than "== 'win32'" to support
various Windows build types.
2. Supply full path for some native Windows utilities, since the
path environment does not always have the specified, and they are
guaranteed to exist in those specific locations.
3. Make sure native Windows Python test runs pass proper environment
variables to run programs.
4. Append 'exe' suffix when running Windows executables.
5. Use the _winreg Python module on Windows, since the Cygwin 'regtool'
command doesn't exist.

* Scripts/update-webkit: Use Perl $^X command to refer to the path of
the current Perl executable, rather than requiring a new path search.
* Scripts/webkitpy/common/find_files_unittest.py:
(TestWinNormalize.test_win): Use startswith('win').
* Scripts/webkitpy/common/prettypatch_unittest.py:
(test_pretty_diff_encodings): Ditto.
* Scripts/webkitpy/common/system/executive.py:
(Executive._should_close_fds): Ditto.
(Executive.shell_command_for_script): Use startswith('win').
(Executive.kill_process): Use full path to killall executable.
(Executive.check_running_pid): Use startswith('win').
(Executive.running_pids): Ditto.
(Executive.kill_all): Ditto. Also use path to 'killall' executable when
running under native Windows Python.
(Executive._child_process_encoding): Use startswith('win').
(Executive._should_encode_child_process_arguments): Ditto.
(Executive.popen): Recognize proper script engine on Windows, since it
does not support the shebang syntax.
(Executive.run_in_parallel): Use startswith('win').
* Scripts/webkitpy/common/system/executive_unittest.py:
(never_ending_command): Ditto.
(ExecutiveTest.test_run_command_with_unicode): Ditto.
(ExecutiveTest.serial_test_kill_process): Ditto.
(ExecutiveTest.serial_test_kill_all): Ditto.
(ExecutiveTest.serial_test_check_running_pid): Ditto.
(ExecutiveTest.serial_test_run_in_parallel): Ditto.
(main): Ditto.
* Scripts/webkitpy/common/system/file_lock.py:
(FileLock._create_lock): Ditto.
(FileLock._remove_lock): Ditto.
* Scripts/webkitpy/common/system/filesystem_unittest.py:
(RealFileSystemTest.test_chdir): Ditto.
(RealFileSystemTest.test_chdir__notexists): Ditto.
(RealFileSystemTest.test_maybe_make_directory__failure): Ditto.
* Scripts/webkitpy/common/system/path_unittest.py:
(AbspathTest.test_abspath_to_uri_win): Ditto.
* Scripts/webkitpy/common/system/platforminfo.py:
(PlatformInfo._determine_os_name): Ditto.
* Scripts/webkitpy/common/system/user.py: Ditto.
* Scripts/webkitpy/layout_tests/controllers/manager_unittest.py:
(ManagerTest.integration_test_needs_servers): Ditto.
* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__): Handle upper and lower-case
driver letters.
(LayoutTestApacheHttpd._get_apache_config_file_path): Ditto.
* Scripts/webkitpy/layout_tests/servers/apache_http_server_unittest.py:
(TestLayoutTestApacheHttpd.test_start_cmd): Ditto.
* Scripts/webkitpy/layout_tests/servers/http_server_base.py:
(HttpServerBase._check_that_all_ports_are_available): Ditto.
* Scripts/webkitpy/layout_tests/servers/http_server_unittest.py:
(TestHttpServer.test_start_cmd): Ditto.
* Scripts/webkitpy/port/base.py:
(Port.to.setup_environ_for_server): Include 'COMSPEC', 'SYSTEMDRIVE',
and 'SYSTEMROOT' in environment passed to test runners.
(Port._apache_config_file_name_for_platform): Use startswith('win').
(Port._build_path): Ditto.
(Port._path_to_driver): Include 'exe' suffix when running under native
Windows.
* Scripts/webkitpy/port/driver.py:
(Driver._setup_environ_for_driver): Explicitly make some environment
variables strings.
* Scripts/webkitpy/port/server_process.py:
(ServerProcess.__init__): Use startswith('win').
* Scripts/webkitpy/port/win.py:
(WinPort): Use the win32 registry utilities on Windows, and appropriate
registry key formats.
(WinPort._ntsd_location): Revise tool search paths for Windows 10.
(WinPort.read_registry_value): Revise to use _winreg library on Windows,
and regtool on Cygwin.
(WinPort.write_registry_value): Ditto.
(WinPort.setup_crash_log_saving): Ditto.
(WinPort.restore_crash_log_saving): Ditto.
(WinPort.prevent_error_dialogs): Ditto.
(WinPort.allow_error_dialogs): Ditto.
(WinPort.find_system_pid): Revise to use Windows management
infrastructure on native Windows, continue using 'ps' on Cygwin.
(WinPort.read_registry_string): Deleted.
(WinPort.write_registry_string): Deleted.
* Scripts/webkitpy/test/main.py:
(main): Use startswith('win').
(Tester._parse_args): Ditto.

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

5 years ago[WinCairo] Compile error.
peavo@outlook.com [Wed, 2 Dec 2015 12:08:36 +0000 (12:08 +0000)]
[WinCairo] Compile error.
https://bugs.webkit.org/show_bug.cgi?id=151742

Reviewed by Csaba Osztrogon√°c.

System font flag has moved from Font class to FontData class.

* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::Font::platformInit):

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

5 years agoVersioning.
bshafiei@apple.com [Wed, 2 Dec 2015 07:49:38 +0000 (07:49 +0000)]
Versioning.

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

5 years ago[Win] Test gardening after r192895
mmaxfield@apple.com [Wed, 2 Dec 2015 03:55:44 +0000 (03:55 +0000)]
[Win] Test gardening after r192895

Unreviewed.

* fast/text/emoji-overlap-expected.html:
* fast/text/emoji-overlap.html:

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

5 years agoUnreviewed, fix build after r192931.
hs85.jeong@samsung.com [Wed, 2 Dec 2015 03:38:21 +0000 (03:38 +0000)]
Unreviewed, fix build after r192931.

* CMakeLists.txt: Remove the WKOriginDataManager in CMakeLists.txt.

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

5 years agoUnreviewed, rolling out r192894 and r192904.
commit-queue@webkit.org [Wed, 2 Dec 2015 03:23:59 +0000 (03:23 +0000)]
Unreviewed, rolling out r192894 and r192904.
https://bugs.webkit.org/show_bug.cgi?id=151738

Crashes sometimes on Windows (Requested by litherum on
#webkit).

Reverted changesets:

"[Win] Web fonts with small caps have excess whitespace with
the complex text codepath"
https://bugs.webkit.org/show_bug.cgi?id=151698
http://trac.webkit.org/changeset/192894

"Test gardening after r192894"
http://trac.webkit.org/changeset/192904

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

5 years ago[ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
utatane.tea@gmail.com [Wed, 2 Dec 2015 03:16:28 +0000 (03:16 +0000)]
[ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
https://bugs.webkit.org/show_bug.cgi?id=150792

Reviewed by Saam Barati.

.:

* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

This patch implements basic functionality of ES6 Generators in LLInt and Baseline tiers.
While the implementation has some inefficient part, the implementation covers edge cases.
Later, we will make this efficient.

    https://bugs.webkit.org/show_bug.cgi?id=151545
    https://bugs.webkit.org/show_bug.cgi?id=151546
    https://bugs.webkit.org/show_bug.cgi?id=151547
    https://bugs.webkit.org/show_bug.cgi?id=151552
    https://bugs.webkit.org/show_bug.cgi?id=151560
    https://bugs.webkit.org/show_bug.cgi?id=151586

To encourage DFG / FTL later, we take the following design.

1. Use switch_imm to jump to the save/resume points.

Instead of saving / restoring instruction pointer to resume from it, we use switch_imm to jump to the resume point.
This limits one entry point to a given generator function. This design makes inlining easy.
The generated code becomes the following.

    function @generatorNext(@generator, @generatorState, @generatorValue, @generatorResumeMode)
    {
        switch (@generatorState) {
        case Initial:
            ...
            initial sequence.
            ...

            op_save(Yield_0);  // op_save contains *virtual* jump to Yield_0.
                               // CFG shows a jump edge to Yield_0 point, but it won't be actually used.
            return ...;

        case Yield_0:
            op_resume();
            if (@generatorResumeMode == Throw)
                ...
            else if (@generatorResumeMode == Return)
                ...
            ...
            // sentValue is a value sent from a caller by `generator.next(sentValue)`.
            sentValue = @generatorValue;
            ...
            op_save(Yield_1);
            return ...;

        case Yield_1:
            op_resume();
            if (@generatorResumeMode == Throw)
                ...
            else if (@generatorResumeMode == Return)
                ...
            ...
            sentValue = @generatorValue;
            ...

        ...
        }
    }

    Resume sequence should not be emitted per yield.
    This should be done in https://bugs.webkit.org/show_bug.cgi?id=151552.

2. Store live frame registers to GeneratorFrame

To save and resume generator's state, we save all the live registers in GeneratorFrame.
And when resuming, we refill registers with saved ones.
Since saved register contains scope register, |this| etc., the environment including the scope chain will be recovered automatically.
While saving and resuming callee registers, we don't save parameter registers.
These registers will be used to control generator's resume behavior.

We perform BytecodeLivenessAnalysis in CodeBlock to determine actually *def*ined registers at that resume point.

3. GeneratorFunction will evaluate parameters before generating Generator

Generator's parameter should be evaluated before entering Generator's body. For example,

    function hello() { ... }
    function *gen(a, b = hello())
    {
        yield b;
    }
    let g = gen(20);  // Now, hello should be called.

To enable this, we evaluate parameters in GeneratorFunction, and after that, we create a Generator and return it.
This can be explained by the following pseudo code.

    function *gen(a, b = hello())
    {
        // This is generator.
        return {
            @generatorNext: function (@generator, @generatorState, @generatorValue, @generatorResumeMode)
            {
                ...
            }
        }
    }

4. op_save seems similar to conditional jump

We won't jump to elsewhere from op_save actually. But we add a *virtual* jump edge (flow) from op_save to the point so called *merge point*.
We construct the CFG as follows,

    (global generator switch) -> (initial sequence) -> (op_save) ----+-> (merge point) -> (next sequence)*
           |                                              |          |
           |                                              v          |
           |                                           (op_ret)      |
           |                                                         |
           +------------------------------------------->(op_resume)--+

By constructing such a graph,

    1. Since we have a flow from (op_save) to (merge point), at merge point, we can *use* locals that are defined before (op_save)
    2. op_save should claim that it does not define anything. And claim that it *use*s locals that are used in (merge point).
    3. at op_resume, we see *use*d locals at merge point and define all of them.

We can do the above things in use-def analysis because use-def analysis is backward analysis.
And after analyzing use-def chains, in op_save / op_resume, we only save / resume live registers at the head of merge point.

* API/JSScriptRef.cpp:
(parseScript):
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinExecutables.cpp:
(JSC::createExecutableInternal):
* builtins/GeneratorPrototype.js: Added.
(generatorResume):
(next):
(return):
(throw):
* bytecode/BytecodeBasicBlock.cpp:
(JSC::isBranch):
* bytecode/BytecodeList.json:
* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::stepOverInstruction):
(JSC::computeLocalLivenessForBytecodeOffset):
(JSC::BytecodeLivenessAnalysis::runLivenessFixpoint):
(JSC::BytecodeLivenessAnalysis::computeFullLiveness):
(JSC::BytecodeLivenessAnalysis::computeKills):
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::shrinkToFit):
(JSC::CodeBlock::validate):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::numCalleeLocals):
(JSC::CodeBlock::liveCalleeLocalsAtYield):
* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::tryGet):
(JSC::EvalCodeCache::getSlow):
(JSC::EvalCodeCache::isCacheable):
* bytecode/ExecutableInfo.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::generatorThisMode):
(JSC::ExecutableInfo::superBinding):
(JSC::ExecutableInfo::parseMode):
(JSC::ExecutableInfo::isArrowFunction): Deleted.
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::parseMode):
(JSC::UnlinkedCodeBlock::generatorThisMode):
(JSC::UnlinkedCodeBlock::superBinding):
(JSC::UnlinkedCodeBlock::isArrowFunction): Deleted.
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeParameters):
(JSC::BytecodeGenerator::newRegister):
(JSC::BytecodeGenerator::reclaimFreeRegisters):
(JSC::BytecodeGenerator::createVariable):
(JSC::BytecodeGenerator::emitCreateThis):
(JSC::BytecodeGenerator::emitNewFunctionExpressionCommon):
(JSC::BytecodeGenerator::emitNewFunctionExpression):
(JSC::BytecodeGenerator::emitNewArrowFunctionExpression):
(JSC::BytecodeGenerator::emitNewFunction):
(JSC::BytecodeGenerator::emitIteratorNextWithValue):
(JSC::BytecodeGenerator::emitYieldPoint):
(JSC::BytecodeGenerator::emitSave):
(JSC::BytecodeGenerator::emitResume):
(JSC::BytecodeGenerator::emitYield):
(JSC::BytecodeGenerator::emitDelegateYield):
(JSC::BytecodeGenerator::emitGeneratorStateChange):
(JSC::BytecodeGenerator::emitGeneratorStateLabel):
(JSC::BytecodeGenerator::beginGenerator):
(JSC::BytecodeGenerator::endGenerator):
(JSC::BytecodeGenerator::emitNewFunctionInternal): Deleted.
(JSC::BytecodeGenerator::emitNewFunctionCommon): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::generatorThisMode):
(JSC::BytecodeGenerator::superBinding):
(JSC::BytecodeGenerator::generatorRegister):
(JSC::BytecodeGenerator::generatorStateRegister):
(JSC::BytecodeGenerator::generatorValueRegister):
(JSC::BytecodeGenerator::generatorResumeModeRegister):
(JSC::BytecodeGenerator::parseMode):
(JSC::BytecodeGenerator::registerFor):
(JSC::BytecodeGenerator::makeFunction):
* bytecompiler/NodesCodegen.cpp:
(JSC::ThisNode::emitBytecode):
(JSC::emitHomeObjectForCallee):
(JSC::emitSuperBaseForCallee):
(JSC::ReturnNode::emitBytecode):
(JSC::FunctionNode::emitBytecode):
(JSC::YieldExprNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::ByteCodeParser):
(JSC::DFG::ByteCodeParser::inlineCall):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::handlePutById):
* dfg/DFGForAllKills.h:
(JSC::DFG::forAllKilledOperands):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::forAllLocalsLiveInBytecode):
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGVariableEventStream.cpp:
(JSC::DFG::VariableEventStream::reconstruct):
* ftl/FTLForOSREntryJITCode.cpp:
(JSC::FTL::ForOSREntryJITCode::initializeEntryBuffer):
* ftl/FTLForOSREntryJITCode.h:
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* ftl/FTLState.cpp:
(JSC::FTL::State::State):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::isAtom):
(JSC::MarkedBlock::isLiveCell):
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::Interpreter::dumpRegisters):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::frameRegisterCountFor):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emit_op_new_func):
(JSC::JIT::emit_op_new_generator_func):
(JSC::JIT::emitNewFuncExprCommon):
(JSC::JIT::emit_op_new_func_exp):
(JSC::JIT::emit_op_new_generator_func_exp):
(JSC::JIT::emit_op_save):
(JSC::JIT::emit_op_resume):
* jit/JITOperations.cpp:
(JSC::operationNewFunctionCommon):
* jit/JITOperations.h:
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::frameRegisterCountFor):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::traceFunctionPrologue):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createYield):
(JSC::ASTBuilder::createFunctionMetadata):
(JSC::ASTBuilder::propagateArgumentsUse):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::createGeneratorParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseYieldExpression):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseFunctionExpression):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setSourceParseMode):
(JSC::Scope::hasArguments):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::setIsFunction):
(JSC::Scope::setIsGeneratorFunction):
(JSC::Scope::setIsGenerator):
(JSC::parse):
* parser/ParserModes.h:
(JSC::isFunctionParseMode):
(JSC::isModuleParseMode):
(JSC::isProgramParseMode):
* parser/SourceCodeKey.h: Added.
(JSC::SourceCodeKey::SourceCodeKey):
(JSC::SourceCodeKey::isHashTableDeletedValue):
(JSC::SourceCodeKey::hash):
(JSC::SourceCodeKey::length):
(JSC::SourceCodeKey::isNull):
(JSC::SourceCodeKey::string):
(JSC::SourceCodeKey::operator==):
(JSC::SourceCodeKeyHash::hash):
(JSC::SourceCodeKeyHash::equal):
(JSC::SourceCodeKeyHashTraits::isEmptyValue):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createYield):
(JSC::SyntaxChecker::createFunctionMetadata):
(JSC::SyntaxChecker::operatorStackPop):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:
(JSC::SourceCodeKey::SourceCodeKey): Deleted.
(JSC::SourceCodeKey::isHashTableDeletedValue): Deleted.
(JSC::SourceCodeKey::hash): Deleted.
(JSC::SourceCodeKey::length): Deleted.
(JSC::SourceCodeKey::isNull): Deleted.
(JSC::SourceCodeKey::string): Deleted.
(JSC::SourceCodeKey::operator==): Deleted.
(JSC::SourceCodeKeyHash::hash): Deleted.
(JSC::SourceCodeKeyHash::equal): Deleted.
(JSC::SourceCodeKeyHashTraits::isEmptyValue): Deleted.
* runtime/CommonIdentifiers.h:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::ProgramExecutable::checkSyntax):
* runtime/Executable.h:
* runtime/FunctionConstructor.cpp:
(JSC::constructFunction):
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionConstructor.h:
* runtime/GeneratorFrame.cpp: Added.
(JSC::GeneratorFrame::GeneratorFrame):
(JSC::GeneratorFrame::finishCreation):
(JSC::GeneratorFrame::createStructure):
(JSC::GeneratorFrame::create):
(JSC::GeneratorFrame::save):
(JSC::GeneratorFrame::resume):
(JSC::GeneratorFrame::visitChildren):
* runtime/GeneratorFrame.h: Added.
(JSC::GeneratorFrame::locals):
(JSC::GeneratorFrame::localAt):
(JSC::GeneratorFrame::offsetOfLocals):
(JSC::GeneratorFrame::allocationSizeForLocals):
* runtime/GeneratorFunctionConstructor.cpp: Added.
(JSC::GeneratorFunctionConstructor::GeneratorFunctionConstructor):
(JSC::GeneratorFunctionConstructor::finishCreation):
(JSC::callGeneratorFunctionConstructor):
(JSC::constructGeneratorFunctionConstructor):
(JSC::GeneratorFunctionConstructor::getCallData):
(JSC::GeneratorFunctionConstructor::getConstructData):
* runtime/GeneratorFunctionConstructor.h: Added.
(JSC::GeneratorFunctionConstructor::create):
(JSC::GeneratorFunctionConstructor::createStructure):
* runtime/GeneratorFunctionPrototype.cpp: Added.
(JSC::GeneratorFunctionPrototype::GeneratorFunctionPrototype):
(JSC::GeneratorFunctionPrototype::finishCreation):
* runtime/GeneratorFunctionPrototype.h: Added.
(JSC::GeneratorFunctionPrototype::create):
(JSC::GeneratorFunctionPrototype::createStructure):
* runtime/GeneratorPrototype.cpp: Copied from Source/JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp.
(JSC::GeneratorPrototype::finishCreation):
(JSC::GeneratorPrototype::getOwnPropertySlot):
* runtime/GeneratorPrototype.h: Copied from Source/JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp.
(JSC::GeneratorPrototype::create):
(JSC::GeneratorPrototype::createStructure):
(JSC::GeneratorPrototype::GeneratorPrototype):
* runtime/GeneratorThisMode.h: Added.
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
* runtime/JSGeneratorFunction.cpp: Added.
(JSC::JSGeneratorFunction::JSGeneratorFunction):
(JSC::JSGeneratorFunction::createImpl):
(JSC::JSGeneratorFunction::create):
(JSC::JSGeneratorFunction::createWithInvalidatedReallocationWatchpoint):
* runtime/JSGeneratorFunction.h: Added.
(JSC::JSGeneratorFunction::allocationSize):
(JSC::JSGeneratorFunction::createStructure):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::generatorFunctionPrototype):
(JSC::JSGlobalObject::generatorPrototype):
(JSC::JSGlobalObject::generatorFunctionStructure):
* runtime/ModuleLoaderObject.cpp:
(JSC::moduleLoaderObjectParseModule):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* tests/es6.yaml:
* tests/es6/generators_yield_star_generic_iterables.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/es6/generators_yield_star_instances_of_iterables.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/es6/generators_yield_star_iterator_closing.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/es6/generators_yield_star_iterator_closing_via_throw.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/stress/generator-arguments-from-function.js: Added.
(shouldBe):
(test):
* tests/stress/generator-arguments.js: Added.
(shouldBe):
(g1):
* tests/stress/generator-class-methods-syntax.js: Added.
(testSyntax):
(testSyntaxError):
(testSyntaxError.Cocoa):
(testSyntax.Cocoa.prototype.ok):
(testSyntax.Cocoa):
(testSyntax.Cocoa.ok):
* tests/stress/generator-class-methods.js: Added.
(shouldBe):
(prototype.gen):
(staticGen):
(shouldBe.g.next):
* tests/stress/generator-eval-this.js: Added.
(shouldBe):
(shouldThrow):
(B):
(A):
(C.prototype.generator):
(C):
(TypeError):
* tests/stress/generator-function-constructor.js: Added.
(shouldBe):
(generatorFunctionConstructor):
* tests/stress/generator-function-name.js: Added.
(shouldBe):
(ok):
* tests/stress/generator-methods-with-non-generator.js: Added.
(shouldThrow):
* tests/stress/generator-relations.js: Added.
(shouldBe):
(generatorFunction):
* tests/stress/generator-return-before-first-call.js: Added.
(shouldBe):
(shouldBeIteratorResult):
* tests/stress/generator-return.js: Added.
(shouldBe):
(shouldBeIteratorResult):
* tests/stress/generator-this.js: Added.
(shouldBe):
(shouldThrow):
(gen):
(shouldBe.g.next):
* tests/stress/generator-throw-before-first-call.js: Added.
(unreachable):
(gen):
(catch):
* tests/stress/generator-throw.js: Added.
(shouldBe):
(shouldBeIteratorResult):
* tests/stress/generator-with-new-target.js: Added.
(shouldBe):
(gen):
* tests/stress/generator-with-super.js: Added.
(shouldThrow):
(test):
(B.prototype.gen):
(B):
(A.prototype.gen):
(A):
* tests/stress/generator-yield-star.js: Added.
(shouldBe):
(shouldThrow):
(prototype.call):
(Arrays):
(Arrays.prototype.Symbol.iterator):
(Iterator.prototype.next):
(Iterator.prototype.string_appeared_here):
(Iterator.prototype.Symbol.iterator):
(Iterator):
(gen):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FastBitVector.h:
(WTF::FastBitVector::forEachSetBit):
* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:

WebKitLibraries:

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

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

5 years agoWeb Inspector: TreeOutline should just dispatch events via WebInspector.Object
mattbaker@apple.com [Wed, 2 Dec 2015 01:37:38 +0000 (01:37 +0000)]
Web Inspector: TreeOutline should just dispatch events via WebInspector.Object
https://bugs.webkit.org/show_bug.cgi?id=148067

Reviewed by Timothy Hatcher.

TreeOutline now dispatches most events via WebInspector.Object. The onselect and
ondeselect callbacks are replaced by a SelectionDidChange event, which includes
both the selected and deselected elements in its event data. The onexpand and oncollapse
callbacks are replaced by an ElementDisclosureDidChange event. This is consistent with the
behavior of onhidden, which had no corresponding onvisible callback.

Alas, TimelineView and TreeOutlineDataGridSynchronizer depended on the order in which
TreeOutline.onselect callbacks were chained together. The synchronizer added its
callback after the timeline view, which ensured that the tree and grid were in sync
before the view handled onselect and dispatched a SelectionPathComponentsDidChange.
The change notification causes the view's path components to be read, and timeline
views need the grid selection to be in a valid state to build path components.

This is addressed by having timeline views dispatch SelectionPathComponentsDidChange
events when the grid selection changes, instead of the tree selection. The change
required that the synchronizer no longer suppress notifications when selecting grid nodes.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._updatePauseReasonSection):

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
(WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
(WebInspector.NetworkGridContentView.prototype._treeSelectionDidChange):

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel):
(WebInspector.ResourceSidebarPanel.prototype._treeSelectionDidChange):
(WebInspector.ResourceSidebarPanel.prototype._treeElementSelected): Deleted.

* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateWatchExpressionsSection):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._treeElementAdded):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._treeElementDisclosureDidChange):
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeExpandHandler): Deleted.
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._objectTreeCollapseHandler): Deleted.

* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel):
(WebInspector.SearchSidebarPanel.prototype._treeSelectionDidChange):
(WebInspector.SearchSidebarPanel.prototype._treeElementSelected): Deleted.

* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel):
(WebInspector.StorageSidebarPanel._treeSelectionDidChange):

* UserInterface/Views/TimelineDataGrid.js:
(WebInspector.TimelineDataGrid.prototype._createPopoverContent):
(WebInspector.TimelineDataGrid.prototype._popoverCallStackTreeSelectionDidChange):
(WebInspector.TimelineDataGrid):

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel):
(WebInspector.TimelineSidebarPanel.prototype._recordingsTreeSelectionDidChange):
(WebInspector.TimelineSidebarPanel.prototype._timelinesTreeSelectionDidChange):
(WebInspector.TimelineSidebarPanel.prototype._timelinesTreeElementSelected): Deleted.

* UserInterface/Views/TimelineView.js:
(WebInspector.TimelineView):
(WebInspector.TimelineView.prototype._treeSelectionDidChange):
(WebInspector.TimelineView.prototype.treeElementSelected):
Don't dispatch SelectionPathComponentsDidChange. Timeline views already do this
in response to grid selection events.

* UserInterface/Views/TreeOutline.js:
(WebInspector.TreeOutline.prototype.appendChild):
(WebInspector.TreeOutline.prototype.insertChild):
(WebInspector.TreeOutline.prototype.removeChildAtIndex):
(WebInspector.TreeOutline.prototype.removeChildren):
(WebInspector.TreeOutline.prototype.removeChildrenRecursive):
(WebInspector.TreeOutline.prototype._treeElementDidChange):
(WebInspector.TreeElement.prototype.set hidden):
(WebInspector.TreeElement.prototype.collapse):
(WebInspector.TreeElement.prototype.expand):
(WebInspector.TreeElement.prototype.select):
(WebInspector.TreeElement.prototype.deselect):
(WebInspector.TreeElement.prototype.get childrenListElement): Deleted.
Removed dead code.

* UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
(WebInspector.TreeOutlineDataGridSynchronizer):
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeSelectionDidChange):
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementAdded):
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementRemoved):
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementDisclosureDidChange):
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementVisibilityDidChange):
(WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onadd): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onremove): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onexpand): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.oncollapse): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onhidden): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.treeOutline.onselect): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementSelected): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementExpanded): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementCollapsed): Deleted.
(WebInspector.TreeOutlineDataGridSynchronizer.prototype._treeElementHiddenChanged): Deleted.

* UserInterface/Views/VisualStyleCommaSeparatedKeywordEditor.js:
(WebInspector.VisualStyleCommaSeparatedKeywordEditor):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeSelectionDidChange):
(WebInspector.VisualStyleCommaSeparatedKeywordEditor.prototype._treeElementSelected): Deleted.

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

5 years agoUnreviewed, rolling out r192914.
commit-queue@webkit.org [Wed, 2 Dec 2015 01:37:19 +0000 (01:37 +0000)]
Unreviewed, rolling out r192914.
https://bugs.webkit.org/show_bug.cgi?id=151734

JSC tests for this change are failing on 32 and 64-bit bots
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"[ES6] Implement LLInt/Baseline Support for ES6 Generators and
enable this feature"
https://bugs.webkit.org/show_bug.cgi?id=150792
http://trac.webkit.org/changeset/192914

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

5 years agoEventSenderProxy::swipeGestureWithWheelAndMomentumPhases() leaks an EventSenderSynthe...
ddkilzer@apple.com [Wed, 2 Dec 2015 01:25:12 +0000 (01:25 +0000)]
EventSenderProxy::swipeGestureWithWheelAndMomentumPhases() leaks an EventSenderSyntheticEvent
<http://webkit.org/b/151726>

Reviewed by Simon Fraser.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::swipeGestureWithWheelAndMomentumPhases):
Deploy RetainPtr<EventSenderSyntheticEvent> to fix leak.

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

5 years agoRemove WKOriginDataManager
andersca@apple.com [Wed, 2 Dec 2015 01:10:24 +0000 (01:10 +0000)]
Remove WKOriginDataManager
https://bugs.webkit.org/show_bug.cgi?id=151723

Reviewed by Andy Estes.

* UIProcess/API/C/WKOriginDataManager.cpp: Removed.
(WKOriginDataManagerGetTypeID): Deleted.
(WKOriginDataManagerGetOrigins): Deleted.
(WKOriginDataManagerDeleteEntriesForOrigin): Deleted.
(WKOriginDataManagerDeleteEntriesModifiedBetweenDates): Deleted.
(WKOriginDataManagerDeleteAllEntries): Deleted.
* UIProcess/API/C/WKOriginDataManager.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

5 years ago[SVG -> OTF Converter] Force UnitsPerEm to 1000
mmaxfield@apple.com [Wed, 2 Dec 2015 00:57:41 +0000 (00:57 +0000)]
[SVG -> OTF Converter] Force UnitsPerEm to 1000
https://bugs.webkit.org/show_bug.cgi?id=151650

Reviewed by Antti Koivisto.

Source/WebCore:

According to the Adobe Type 1 Font Format:

"Type 1 font programs generally use a 1000 to 1 scaling matrix
for the definition of the relationship of character space unites
to user space units."

Windows actually disregards the "unitsPerEm" value in the "head"
table for some calculations, and hardcodes 1000 instead. In order
to have consistent renderings on Windows and OS X, this patch
forces all generated fonts to have a unitsPerEm of 1000, and
appropriately scales all necessary values.

Test: svg/W3C-SVG-1.1/fonts-elem-03-b.svg

* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::scaleUnitsPerEm):
(WebCore::SVGToOTFFontConverter::appendHEADTable):
(WebCore::SVGToOTFFontConverter::appendOS2Table):
(WebCore::SVGToOTFFontConverter::appendVORGTable):
(WebCore::SVGToOTFFontConverter::appendVHEATable):
(WebCore::SVGToOTFFontConverter::appendVMTXTable):
(WebCore::SVGToOTFFontConverter::addKerningPair):
(WebCore::CFFBuilder::CFFBuilder):
(WebCore::CFFBuilder::boundingBox):
(WebCore::CFFBuilder::updateBoundingBox):
(WebCore::CFFBuilder::unscaledLineTo):
(WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
(WebCore::SVGToOTFFontConverter::processGlyphElement):
(WebCore::SVGToOTFFontConverter::appendLigatureGlyphs):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

LayoutTests:

Some tests have quantization differences.

* fast/ruby/ruby-expansion-cjk-2-expected.html:
* fast/ruby/ruby-expansion-cjk-3-expected.html:
* fast/ruby/ruby-expansion-cjk-4-expected.html:
* fast/ruby/ruby-expansion-cjk-5-expected.html:
* fast/ruby/ruby-expansion-cjk-expected.html:
* platform/mac-wk2/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/mac/svg/batik/text/textEffect3-expected.txt:
* platform/mac/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/wicd/test-rightsizing-b-expected.txt:
* svg/custom/acid3-test-77-expected.txt:

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

5 years agoAdd updated test result missing from http://trac.webkit.org/changeset/192924
beidson@apple.com [Wed, 2 Dec 2015 00:50:48 +0000 (00:50 +0000)]
Add updated test result missing from trac.webkit.org/changeset/192924
https://bugs.webkit.org/show_bug.cgi?id=151725

* storage/indexeddb/modern/opendatabase-request-event-expected.txt:

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

5 years agoUpdated favicon.ico with the new logo.
jond@apple.com [Wed, 2 Dec 2015 00:38:24 +0000 (00:38 +0000)]
Updated favicon.ico with the new logo.

* favicon.ico:

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

5 years agoMarking http/tests/xmlhttprequest/methods-async.html as flaky on Yosemite WK2
ryanhaddad@apple.com [Wed, 2 Dec 2015 00:38:23 +0000 (00:38 +0000)]
Marking http/tests/xmlhttprequest/methods-async.html as flaky on Yosemite WK2
https://bugs.webkit.org/show_bug.cgi?id=151729

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

5 years agoImproved accessibility handling for the small drop-down menu.
jond@apple.com [Wed, 2 Dec 2015 00:37:42 +0000 (00:37 +0000)]
Improved accessibility handling for the small drop-down menu.

* wp-content/themes/webkit/scripts/global.js:

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

5 years agoFixed font rendering. Fixed SVG rendering for Firefox.
jond@apple.com [Wed, 2 Dec 2015 00:35:45 +0000 (00:35 +0000)]
Fixed font rendering. Fixed SVG rendering for Firefox.

* wp-content/themes/webkit/images/icons.svg:
* wp-content/themes/webkit/images/inspector.svg:
* wp-content/themes/webkit/images/twitter.svg:
* wp-content/themes/webkit/style.css:
(code):
(a[name]):
(.screen-reader-text:focus):
(.page-width):
(.tile.category-web-inspector .background-image):
(.tile.category-performance .background-image):
(.tile.category-javascript .background-image):
(.tile.category-css .background-image):
(.tile.category-standards .background-image):
(.tile.category-contributing .background-image):
(.tile.category-storage .background-image):
(.tile.category-layout .background-image):
(.tile.tag-timeline .background-image):
(.tile.tag-console .background-image):
(.tile.tag-debugger .background-image):
(.tile.tag-shortcuts .background-image):
(.tile .background-image.loaded):
(body, input, textarea, select, button): Deleted.

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

5 years agoGive a more detailed message for TypeErrors that result from EnforceRange.
beidson@apple.com [Wed, 2 Dec 2015 00:20:37 +0000 (00:20 +0000)]
Give a more detailed message for TypeErrors that result from EnforceRange.
https://bugs.webkit.org/show_bug.cgi?id=151725

Reviewed by Tim Horton.

Source/WebCore:

No new tests (Covered by changes to existing tests).

* bindings/js/JSDOMBinding.cpp:
(WebCore::rangeErrorString):
(WebCore::enforceRange):

LayoutTests:

* crypto/subtle/aes-cbc-generate-key-expected.txt:
* js/dom/webidl-type-mapping-expected.txt:
* storage/indexeddb/intversion-bad-parameters-expected.txt:
* storage/indexeddb/version-change-event-basic-expected.txt:

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

5 years ago[iOS] Abrupt transition between Fullscreen -> PiP
jer.noble@apple.com [Tue, 1 Dec 2015 23:53:03 +0000 (23:53 +0000)]
[iOS] Abrupt transition between Fullscreen -> PiP
https://bugs.webkit.org/show_bug.cgi?id=151719

Reviewed by Eric Carlson.

Rather than abruptly hiding the fullscreen window, explicitly exit fullscreen mode upon entering PiP.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture):

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

5 years agoWeb Inspector: Timestamp in Tooltip of Event Markers is incorrect
commit-queue@webkit.org [Tue, 1 Dec 2015 23:46:32 +0000 (23:46 +0000)]
Web Inspector: Timestamp in Tooltip of Event Markers is incorrect
https://bugs.webkit.org/show_bug.cgi?id=151722

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

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.addMarker):
Convert the marker's time, to be relative to the start of the recording.

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

5 years agoGive String and AtomicString an existingHash() function
mmaxfield@apple.com [Tue, 1 Dec 2015 23:30:03 +0000 (23:30 +0000)]
Give String and AtomicString an existingHash() function
https://bugs.webkit.org/show_bug.cgi?id=151717

Reviewed by Andreas Kling.

Source/WebCore:

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::CharacterFallbackMapKeyHash::hash):

Source/WTF:

Test: WTF.AtomicStringExistingHash
      WTF.StringExistingHash

* wtf/text/AtomicString.h:
(WTF::AtomicString::existingHash):
* wtf/text/WTFString.h:
(WTF::String::existingHash):

Tools:

* TestWebKitAPI/Tests/WTF/AtomicString.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/WTFString.cpp:
(TestWebKitAPI::TEST):

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

5 years ago[JSC] support CoverInitializedName in nested AssignmentPatterns
commit-queue@webkit.org [Tue, 1 Dec 2015 22:47:00 +0000 (22:47 +0000)]
[JSC] support CoverInitializedName in nested AssignmentPatterns
https://bugs.webkit.org/show_bug.cgi?id=151595

Patch by Caitlin Potter <caitpotter88@gmail.com> on 2015-12-01
Reviewed by Geoffrey Garen.

A regression introduced in bug https://bugs.webkit.org/show_bug.cgi?id=151026
causes the parser to fail when attempting to parse nested
ObjectAssignmentPatterns with CoverInitializedName destructuring targets.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpressionOrPropagateErrorClass):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parseArrayLiteral):
* parser/Parser.h:
(JSC::Parser::ExpressionErrorClassifier::propagateExpressionErrorClass):
* tests/es6.yaml:
* tests/es6/destructuring_assignment_nested_cover_initialized_name.js: Added.
(test1):
(test2):

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

5 years agoAdd new library dependency for LLVMForJavaScriptCore dylib
commit-queue@webkit.org [Tue, 1 Dec 2015 22:46:18 +0000 (22:46 +0000)]
Add new library dependency for LLVMForJavaScriptCore dylib
https://bugs.webkit.org/show_bug.cgi?id=151687

Changes on open source LLVM added a new dependency to libLLVMInstrumentation.a.
Adding this dependency should be backwards compatible, since LLVM has built and
shipped this library even before the creation of FTL.

Patch by Juergen Ributzka <juergen@apple.com> on 2015-12-01
Reviewed by Geoffrey Garen.

* Configurations/LLVMForJSC.xcconfig:

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

5 years ago[Win] Build fix after r192895
mmaxfield@apple.com [Tue, 1 Dec 2015 22:43:52 +0000 (22:43 +0000)]
[Win] Build fix after r192895

Unreviewed.

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isSystemFont):
(WebCore::FontPlatformData::setIsSystemFont):
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformWidthForGlyph):

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

5 years agoRemoved escpaes to correctly pass query string arguments.
jond@apple.com [Tue, 1 Dec 2015 22:33:04 +0000 (22:33 +0000)]
Removed escpaes to correctly pass query string arguments.

* .htaccess:

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

5 years agoUpdate bindings test results after r192903.
ap@apple.com [Tue, 1 Dec 2015 22:27:04 +0000 (22:27 +0000)]
Update bindings test results after r192903.

* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):

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

5 years ago[ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
utatane.tea@gmail.com [Tue, 1 Dec 2015 22:23:16 +0000 (22:23 +0000)]
[ES6] Implement LLInt/Baseline Support for ES6 Generators and enable this feature
https://bugs.webkit.org/show_bug.cgi?id=150792

Reviewed by Saam Barati.

.:

* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

This patch implements basic functionality of ES6 Generators in LLInt and Baseline tiers.
While the implementation has some inefficient part, the implementation covers edge cases.
Later, we will make this efficient.

    https://bugs.webkit.org/show_bug.cgi?id=151545
    https://bugs.webkit.org/show_bug.cgi?id=151546
    https://bugs.webkit.org/show_bug.cgi?id=151547
    https://bugs.webkit.org/show_bug.cgi?id=151552
    https://bugs.webkit.org/show_bug.cgi?id=151560
    https://bugs.webkit.org/show_bug.cgi?id=151586

To encourage DFG / FTL later, we take the following design.

1. Use switch_imm to jump to the save/resume points.

Instead of saving / restoring instruction pointer to resume from it, we use switch_imm to jump to the resume point.
This limits one entry point to a given generator function. This design makes inlining easy.
The generated code becomes the following.

    function @generatorNext(@generator, @generatorState, @generatorValue, @generatorResumeMode)
    {
        switch (@generatorState) {
        case Initial:
            ...
            initial sequence.
            ...

            op_save(Yield_0);  // op_save contains *virtual* jump to Yield_0.
                               // CFG shows a jump edge to Yield_0 point, but it won't be actually used.
            return ...;

        case Yield_0:
            op_resume();
            if (@generatorResumeMode == Throw)
                ...
            else if (@generatorResumeMode == Return)
                ...
            ...
            // sentValue is a value sent from a caller by `generator.next(sentValue)`.
            sentValue = @generatorValue;
            ...
            op_save(Yield_1);
            return ...;

        case Yield_1:
            op_resume();
            if (@generatorResumeMode == Throw)
                ...
            else if (@generatorResumeMode == Return)
                ...
            ...
            sentValue = @generatorValue;
            ...

        ...
        }
    }

    Resume sequence should not be emitted per yield.
    This should be done in https://bugs.webkit.org/show_bug.cgi?id=151552.

2. Store live frame registers to GeneratorFrame

To save and resume generator's state, we save all the live registers in GeneratorFrame.
And when resuming, we refill registers with saved ones.
Since saved register contains scope register, |this| etc., the environment including the scope chain will be recovered automatically.
While saving and resuming callee registers, we don't save parameter registers.
These registers will be used to control generator's resume behavior.

We perform BytecodeLivenessAnalysis in CodeBlock to determine actually *def*ined registers at that resume point.

3. GeneratorFunction will evaluate parameters before generating Generator

Generator's parameter should be evaluated before entering Generator's body. For example,

    function hello() { ... }
    function *gen(a, b = hello())
    {
        yield b;
    }
    let g = gen(20);  // Now, hello should be called.

To enable this, we evaluate parameters in GeneratorFunction, and after that, we create a Generator and return it.
This can be explained by the following pseudo code.

    function *gen(a, b = hello())
    {
        // This is generator.
        return {
            @generatorNext: function (@generator, @generatorState, @generatorValue, @generatorResumeMode)
            {
                ...
            }
        }
    }

4. op_save seems similar to conditional jump

We won't jump to elsewhere from op_save actually. But we add a *virtual* jump edge (flow) from op_save to the point so called *merge point*.
We construct the CFG as follows,

    (global generator switch) -> (initial sequence) -> (op_save) ----+-> (merge point) -> (next sequence)*
           |                                              |          |
           |                                              v          |
           |                                           (op_ret)      |
           |                                                         |
           +------------------------------------------->(op_resume)--+

By constructing such a graph,

    1. Since we have a flow from (op_save) to (merge point), at merge point, we can *use* locals that are defined before (op_save)
    2. op_save should claim that it does not define anything. And claim that it *use*s locals that are used in (merge point).
    3. at op_resume, we see *use*d locals at merge point and define all of them.

We can do the above things in use-def analysis because use-def analysis is backward analysis.
And after analyzing use-def chains, in op_save / op_resume, we only save / resume live registers at the head of merge point.

* API/JSScriptRef.cpp:
(parseScript):
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinExecutables.cpp:
(JSC::createExecutableInternal):
* builtins/GeneratorPrototype.js: Added.
(generatorResume):
(next):
(return):
(throw):
* bytecode/BytecodeBasicBlock.cpp:
(JSC::isBranch):
* bytecode/BytecodeList.json:
* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::stepOverInstruction):
(JSC::computeLocalLivenessForBytecodeOffset):
(JSC::BytecodeLivenessAnalysis::runLivenessFixpoint):
(JSC::BytecodeLivenessAnalysis::computeFullLiveness):
(JSC::BytecodeLivenessAnalysis::computeKills):
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::finishCreation):
(JSC::CodeBlock::shrinkToFit):
(JSC::CodeBlock::validate):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::numCalleeLocals):
(JSC::CodeBlock::liveCalleeLocalsAtYield):
* bytecode/EvalCodeCache.h:
(JSC::EvalCodeCache::tryGet):
(JSC::EvalCodeCache::getSlow):
(JSC::EvalCodeCache::isCacheable):
* bytecode/ExecutableInfo.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::generatorThisMode):
(JSC::ExecutableInfo::superBinding):
(JSC::ExecutableInfo::parseMode):
(JSC::ExecutableInfo::isArrowFunction): Deleted.
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::parseMode):
(JSC::UnlinkedCodeBlock::generatorThisMode):
(JSC::UnlinkedCodeBlock::superBinding):
(JSC::UnlinkedCodeBlock::isArrowFunction): Deleted.
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeParameters):
(JSC::BytecodeGenerator::newRegister):
(JSC::BytecodeGenerator::reclaimFreeRegisters):
(JSC::BytecodeGenerator::createVariable):
(JSC::BytecodeGenerator::emitCreateThis):
(JSC::BytecodeGenerator::emitNewFunctionExpressionCommon):
(JSC::BytecodeGenerator::emitNewFunctionExpression):
(JSC::BytecodeGenerator::emitNewArrowFunctionExpression):
(JSC::BytecodeGenerator::emitNewFunction):
(JSC::BytecodeGenerator::emitIteratorNextWithValue):
(JSC::BytecodeGenerator::emitYieldPoint):
(JSC::BytecodeGenerator::emitSave):
(JSC::BytecodeGenerator::emitResume):
(JSC::BytecodeGenerator::emitYield):
(JSC::BytecodeGenerator::emitDelegateYield):
(JSC::BytecodeGenerator::emitGeneratorStateChange):
(JSC::BytecodeGenerator::emitGeneratorStateLabel):
(JSC::BytecodeGenerator::beginGenerator):
(JSC::BytecodeGenerator::endGenerator):
(JSC::BytecodeGenerator::emitNewFunctionInternal): Deleted.
(JSC::BytecodeGenerator::emitNewFunctionCommon): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::generatorThisMode):
(JSC::BytecodeGenerator::superBinding):
(JSC::BytecodeGenerator::generatorRegister):
(JSC::BytecodeGenerator::generatorStateRegister):
(JSC::BytecodeGenerator::generatorValueRegister):
(JSC::BytecodeGenerator::generatorResumeModeRegister):
(JSC::BytecodeGenerator::parseMode):
(JSC::BytecodeGenerator::registerFor):
(JSC::BytecodeGenerator::makeFunction):
* bytecompiler/NodesCodegen.cpp:
(JSC::ThisNode::emitBytecode):
(JSC::emitHomeObjectForCallee):
(JSC::emitSuperBaseForCallee):
(JSC::ReturnNode::emitBytecode):
(JSC::FunctionNode::emitBytecode):
(JSC::YieldExprNode::emitBytecode):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::ByteCodeParser):
(JSC::DFG::ByteCodeParser::inlineCall):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::handlePutById):
* dfg/DFGForAllKills.h:
(JSC::DFG::forAllKilledOperands):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::forAllLocalsLiveInBytecode):
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGVariableEventStream.cpp:
(JSC::DFG::VariableEventStream::reconstruct):
* ftl/FTLForOSREntryJITCode.cpp:
(JSC::FTL::ForOSREntryJITCode::initializeEntryBuffer):
* ftl/FTLForOSREntryJITCode.h:
* ftl/FTLOSREntry.cpp:
(JSC::FTL::prepareOSREntry):
* ftl/FTLState.cpp:
(JSC::FTL::State::State):
* heap/MarkedBlock.h:
(JSC::MarkedBlock::isAtom):
(JSC::MarkedBlock::isLiveCell):
* interpreter/Interpreter.cpp:
(JSC::eval):
(JSC::Interpreter::dumpRegisters):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::frameRegisterCountFor):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emitNewFuncCommon):
(JSC::JIT::emit_op_new_func):
(JSC::JIT::emit_op_new_generator_func):
(JSC::JIT::emitNewFuncExprCommon):
(JSC::JIT::emit_op_new_func_exp):
(JSC::JIT::emit_op_new_generator_func_exp):
(JSC::JIT::emit_op_save):
(JSC::JIT::emit_op_resume):
* jit/JITOperations.cpp:
(JSC::operationNewFunctionCommon):
* jit/JITOperations.h:
* llint/LLIntEntrypoint.cpp:
(JSC::LLInt::frameRegisterCountFor):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::traceFunctionPrologue):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createYield):
(JSC::ASTBuilder::createFunctionMetadata):
(JSC::ASTBuilder::propagateArgumentsUse):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::Parser):
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::stringForFunctionMode):
(JSC::Parser<LexerType>::createGeneratorParameters):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseFunctionDeclaration):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseYieldExpression):
(JSC::Parser<LexerType>::parsePropertyMethod):
(JSC::Parser<LexerType>::parseFunctionExpression):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setSourceParseMode):
(JSC::Scope::hasArguments):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::setIsFunction):
(JSC::Scope::setIsGeneratorFunction):
(JSC::Scope::setIsGenerator):
(JSC::parse):
* parser/ParserModes.h:
(JSC::isFunctionParseMode):
(JSC::isModuleParseMode):
(JSC::isProgramParseMode):
* parser/SourceCodeKey.h: Added.
(JSC::SourceCodeKey::SourceCodeKey):
(JSC::SourceCodeKey::isHashTableDeletedValue):
(JSC::SourceCodeKey::hash):
(JSC::SourceCodeKey::length):
(JSC::SourceCodeKey::isNull):
(JSC::SourceCodeKey::string):
(JSC::SourceCodeKey::operator==):
(JSC::SourceCodeKeyHash::hash):
(JSC::SourceCodeKeyHash::equal):
(JSC::SourceCodeKeyHashTraits::isEmptyValue):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createYield):
(JSC::SyntaxChecker::createFunctionMetadata):
(JSC::SyntaxChecker::operatorStackPop):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
* runtime/CodeCache.h:
(JSC::SourceCodeKey::SourceCodeKey): Deleted.
(JSC::SourceCodeKey::isHashTableDeletedValue): Deleted.
(JSC::SourceCodeKey::hash): Deleted.
(JSC::SourceCodeKey::length): Deleted.
(JSC::SourceCodeKey::isNull): Deleted.
(JSC::SourceCodeKey::string): Deleted.
(JSC::SourceCodeKey::operator==): Deleted.
(JSC::SourceCodeKeyHash::hash): Deleted.
(JSC::SourceCodeKeyHash::equal): Deleted.
(JSC::SourceCodeKeyHashTraits::isEmptyValue): Deleted.
* runtime/CommonIdentifiers.h:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/Completion.cpp:
(JSC::checkSyntax):
(JSC::checkModuleSyntax):
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::ProgramExecutable::checkSyntax):
* runtime/Executable.h:
* runtime/FunctionConstructor.cpp:
(JSC::constructFunction):
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionConstructor.h:
* runtime/GeneratorFrame.cpp: Added.
(JSC::GeneratorFrame::GeneratorFrame):
(JSC::GeneratorFrame::finishCreation):
(JSC::GeneratorFrame::createStructure):
(JSC::GeneratorFrame::create):
(JSC::GeneratorFrame::save):
(JSC::GeneratorFrame::resume):
(JSC::GeneratorFrame::visitChildren):
* runtime/GeneratorFrame.h: Added.
(JSC::GeneratorFrame::locals):
(JSC::GeneratorFrame::localAt):
(JSC::GeneratorFrame::offsetOfLocals):
(JSC::GeneratorFrame::allocationSizeForLocals):
* runtime/GeneratorFunctionConstructor.cpp: Added.
(JSC::GeneratorFunctionConstructor::GeneratorFunctionConstructor):
(JSC::GeneratorFunctionConstructor::finishCreation):
(JSC::callGeneratorFunctionConstructor):
(JSC::constructGeneratorFunctionConstructor):
(JSC::GeneratorFunctionConstructor::getCallData):
(JSC::GeneratorFunctionConstructor::getConstructData):
* runtime/GeneratorFunctionConstructor.h: Added.
(JSC::GeneratorFunctionConstructor::create):
(JSC::GeneratorFunctionConstructor::createStructure):
* runtime/GeneratorFunctionPrototype.cpp: Added.
(JSC::GeneratorFunctionPrototype::GeneratorFunctionPrototype):
(JSC::GeneratorFunctionPrototype::finishCreation):
* runtime/GeneratorFunctionPrototype.h: Added.
(JSC::GeneratorFunctionPrototype::create):
(JSC::GeneratorFunctionPrototype::createStructure):
* runtime/GeneratorPrototype.cpp: Copied from Source/JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp.
(JSC::GeneratorPrototype::finishCreation):
(JSC::GeneratorPrototype::getOwnPropertySlot):
* runtime/GeneratorPrototype.h: Copied from Source/JavaScriptCore/ftl/FTLForOSREntryJITCode.cpp.
(JSC::GeneratorPrototype::create):
(JSC::GeneratorPrototype::createStructure):
(JSC::GeneratorPrototype::GeneratorPrototype):
* runtime/GeneratorThisMode.h: Added.
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
* runtime/JSGeneratorFunction.cpp: Added.
(JSC::JSGeneratorFunction::JSGeneratorFunction):
(JSC::JSGeneratorFunction::createImpl):
(JSC::JSGeneratorFunction::create):
(JSC::JSGeneratorFunction::createWithInvalidatedReallocationWatchpoint):
* runtime/JSGeneratorFunction.h: Added.
(JSC::JSGeneratorFunction::allocationSize):
(JSC::JSGeneratorFunction::createStructure):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::generatorFunctionPrototype):
(JSC::JSGlobalObject::generatorPrototype):
(JSC::JSGlobalObject::generatorFunctionStructure):
* runtime/ModuleLoaderObject.cpp:
(JSC::moduleLoaderObjectParseModule):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:
* tests/es6.yaml:
* tests/es6/generators_yield_star_generic_iterables.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/es6/generators_yield_star_instances_of_iterables.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/es6/generators_yield_star_iterator_closing.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/es6/generators_yield_star_iterator_closing_via_throw.js:
(iterator.next):
(iterable.Symbol.iterator):
(__createIterableObject):
* tests/stress/generator-arguments-from-function.js: Added.
(shouldBe):
(test):
* tests/stress/generator-arguments.js: Added.
(shouldBe):
(g1):
* tests/stress/generator-class-methods-syntax.js: Added.
(testSyntax):
(testSyntaxError):
(testSyntaxError.Cocoa):
(testSyntax.Cocoa.prototype.ok):
(testSyntax.Cocoa):
(testSyntax.Cocoa.ok):
* tests/stress/generator-class-methods.js: Added.
(shouldBe):
(prototype.gen):
(staticGen):
(shouldBe.g.next):
* tests/stress/generator-eval-this.js: Added.
(shouldBe):
(shouldThrow):
(B):
(A):
(C.prototype.generator):
(C):
(TypeError):
* tests/stress/generator-function-constructor.js: Added.
(shouldBe):
(generatorFunctionConstructor):
* tests/stress/generator-function-name.js: Added.
(shouldBe):
(ok):
* tests/stress/generator-methods-with-non-generator.js: Added.
(shouldThrow):
* tests/stress/generator-relations.js: Added.
(shouldBe):
(generatorFunction):
* tests/stress/generator-return-before-first-call.js: Added.
(shouldBe):
(shouldBeIteratorResult):
* tests/stress/generator-return.js: Added.
(shouldBe):
(shouldBeIteratorResult):
* tests/stress/generator-this.js: Added.
(shouldBe):
(shouldThrow):
(gen):
(shouldBe.g.next):
* tests/stress/generator-throw-before-first-call.js: Added.
(unreachable):
(gen):
(catch):
* tests/stress/generator-throw.js: Added.
(shouldBe):
(shouldBeIteratorResult):
* tests/stress/generator-with-new-target.js: Added.
(shouldBe):
(gen):
* tests/stress/generator-with-super.js: Added.
(shouldThrow):
(test):
(B.prototype.gen):
(B):
(A.prototype.gen):
(A):
* tests/stress/generator-yield-star.js: Added.
(shouldBe):
(shouldThrow):
(prototype.call):
(Arrays):
(Arrays.prototype.Symbol.iterator):
(Iterator.prototype.next):
(Iterator.prototype.string_appeared_here):
(Iterator.prototype.Symbol.iterator):
(Iterator):
(gen):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FastBitVector.h:
(WTF::FastBitVector::forEachSetBit):
* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:

WebKitLibraries:

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

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

5 years agoCorrected rewrite rules to restore convenience paths.
jond@apple.com [Tue, 1 Dec 2015 22:16:53 +0000 (22:16 +0000)]
Corrected rewrite rules to restore convenience paths.

* .htaccess:

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

5 years agoRemove repetitive cruft from FTL OSR exit code in LowerDFGToLLVM
fpizlo@apple.com [Tue, 1 Dec 2015 22:12:42 +0000 (22:12 +0000)]
Remove repetitive cruft from FTL OSR exit code in LowerDFGToLLVM
https://bugs.webkit.org/show_bug.cgi?id=151718

Reviewed by Geoffrey Garen.

* b3/B3StackmapValue.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitArgumentsForPatchpointIfWillCatchException):
(JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExitDescriptor):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::DFG::LowerDFGToLLVM::blessSpeculation):
(JSC::FTL::DFG::LowerDFGToLLVM::emitOSRExitCall):
(JSC::FTL::DFG::LowerDFGToLLVM::buildExitArguments):
(JSC::FTL::DFG::LowerDFGToLLVM::callStackmap):

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

5 years agoNeed completionHandler-based WebKit C SPI for alert, confirm, and prompt
weinig@apple.com [Tue, 1 Dec 2015 22:09:49 +0000 (22:09 +0000)]
Need completionHandler-based WebKit C SPI for alert, confirm, and prompt
<rdar://problem/23320863>
https://bugs.webkit.org/show_bug.cgi?id=151708

Reviewed by Anders Carlsson.

Source/WebKit2:

Add listener based versions of alert, confirm and prompt.

* Shared/API/APIObject.h:
* Shared/API/c/WKBase.h:
* UIProcess/API/C/WKPage.cpp:
(WebKit::RunJavaScriptAlertResultListener::create):
(WebKit::RunJavaScriptAlertResultListener::~RunJavaScriptAlertResultListener):
(WebKit::RunJavaScriptAlertResultListener::call):
(WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
(WebKit::RunJavaScriptConfirmResultListener::create):
(WebKit::RunJavaScriptConfirmResultListener::~RunJavaScriptConfirmResultListener):
(WebKit::RunJavaScriptConfirmResultListener::call):
(WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
(WebKit::RunJavaScriptPromptResultListener::create):
(WebKit::RunJavaScriptPromptResultListener::~RunJavaScriptPromptResultListener):
(WebKit::RunJavaScriptPromptResultListener::call):
(WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
(WKPageSetPageUIClient):
* UIProcess/API/C/WKPageUIClient.h:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):
Update for new WKPageUIClient.

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

5 years agoRemove WebKit2.framework
andersca@apple.com [Tue, 1 Dec 2015 21:57:17 +0000 (21:57 +0000)]
Remove WebKit2.framework
https://bugs.webkit.org/show_bug.cgi?id=151715

Reviewed by Dan Bernstein.

Source/WebKit2:

* Configurations/WebKit2.xcconfig: Removed.
* UIProcess/API/Cocoa/WebKit2.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:
* mac/Info-WebKit2.plist: Removed.
* mac/MigrateHeadersToWebKit2.make: Removed.
* mac/WebKit2.m: Removed.

Tools:

* TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad.cpp:
* TestWebKitAPI/Tests/WebKit2/StopLoadingDuringDidFailProvisionalLoad_bundle.cpp:
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm:
* TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm:
* TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.h:

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

5 years agoUnreviewed common typo fix "occurance" => "occurrence".
joepeck@webkit.org [Tue, 1 Dec 2015 21:51:17 +0000 (21:51 +0000)]
Unreviewed common typo fix "occurance" => "occurrence".

Source/WebInspectorUI:

* Scripts/combine-resources.pl:
(concatenateFiles):

Tools:

* Scripts/webkitpy/tool/commands/queries.py:
(FindFlakyTests._print_statistics):

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