WebKit-https.git
4 years agoBuild fix. We need to escape the path or http.request would fail.
rniwa@webkit.org [Fri, 8 Apr 2016 22:37:34 +0000 (22:37 +0000)]
Build fix. We need to escape the path or http.request would fail.

* tools/js/remote.js:

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

4 years agoModern IDB: Use more IDBValue and IDBGetResult in IDBBackingStore.
beidson@apple.com [Fri, 8 Apr 2016 22:01:10 +0000 (22:01 +0000)]
Modern IDB: Use more IDBValue and IDBGetResult in IDBBackingStore.
https://bugs.webkit.org/show_bug.cgi?id=156418

Reviewed by Alex Christensen.

No new tests (Refactor, no change in behavior).

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
* Modules/indexeddb/IDBValue.h:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::addRecord):
* Modules/indexeddb/server/MemoryObjectStore.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):

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

4 years agoDebugger may dereference m_currentCallFrame even after the VM has gone idle
sbarati@apple.com [Fri, 8 Apr 2016 21:21:25 +0000 (21:21 +0000)]
Debugger may dereference m_currentCallFrame even after the VM has gone idle
https://bugs.webkit.org/show_bug.cgi?id=156413

Reviewed by Mark Lam.

There is a bug where the debugger may dereference its m_currentCallFrame
pointer after that pointer becomes invalid to read from. This happens like so:

We may step over an instruction which causes the end of execution for the
current program. This causes the VM to exit. Then, we perform a GC which
causes us to collect the global object. The global object being collected
causes us to detach the debugger. In detaching, we think we still have a
valid m_currentCallFrame, we dereference it, and crash. The solution is to
make sure we're paused when dereferencing this pointer inside ::detach().

* debugger/Debugger.cpp:
(JSC::Debugger::detach):

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

4 years agoModern IDB: Make IDBGetResult contain an IDBValue instead of a buffer, and remove...
beidson@apple.com [Fri, 8 Apr 2016 21:11:37 +0000 (21:11 +0000)]
Modern IDB: Make IDBGetResult contain an IDBValue instead of a buffer, and remove unused methods.
https://bugs.webkit.org/show_bug.cgi?id=156416

Reviewed by Alex Christensen.

No new tests (Refactor, no change in behavior).

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setGetResult):

* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::dataFromBuffer):
(WebCore::IDBGetResult::isolatedCopy):
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::IDBGetResult):
(WebCore::IDBGetResult::value):
(WebCore::IDBGetResult::encode):
(WebCore::IDBGetResult::decode):
(WebCore::IDBGetResult::valueBuffer): Deleted.
(WebCore::IDBGetResult::setValueBuffer): Deleted.
(WebCore::IDBGetResult::setKeyData): Deleted.
(WebCore::IDBGetResult::setPrimaryKeyData): Deleted.
(WebCore::IDBGetResult::setKeyPath): Deleted.

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::didGetRecordOnServer):

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
* Modules/indexeddb/IDBValue.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):

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

4 years agoFocus ring drawn at incorrect location on image map with CSS transform.
zalan@apple.com [Fri, 8 Apr 2016 21:01:50 +0000 (21:01 +0000)]
Focus ring drawn at incorrect location on image map with CSS transform.
https://bugs.webkit.org/show_bug.cgi?id=143527
<rdar://problem/21908735>

Reviewed by Simon Fraser.

Source/WebCore:

Implement pathForFocusRing for HTMLAreaElement. It follows the logic of RenderObject::addFocusRingRects().

Tests: fast/images/image-map-outline-in-positioned-container.html
       fast/images/image-map-outline-with-paint-root-offset.html
       fast/images/image-map-outline-with-scale-transform.html
       fast/images/image-map-outline.html

* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::pathForFocusRing):
* html/HTMLAreaElement.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing): Move addFocusRingRects() out of focus ring painting.
(WebCore::RenderElement::paintOutline):
* rendering/RenderElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paint):
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutline):

LayoutTests:

Implement pathForFocusRing for HTMLAreaElement.

* fast/images/image-map-outline-in-positioned-container-expected.html: Added.
* fast/images/image-map-outline-in-positioned-container.html: Added.
* fast/images/image-map-outline-with-paint-root-offset-expected.html: Added.
* fast/images/image-map-outline-with-paint-root-offset.html: Added.
* fast/images/image-map-outline-with-scale-transform-expected.html: Added.
* fast/images/image-map-outline-with-scale-transform.html: Added.

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

4 years agobmalloc: stress_aligned test fails if you increase smallMax
ggaren@apple.com [Fri, 8 Apr 2016 20:59:51 +0000 (20:59 +0000)]
bmalloc: stress_aligned test fails if you increase smallMax
https://bugs.webkit.org/show_bug.cgi?id=156414

Reviewed by Oliver Hunt.

When size exceeds alignment and is a multiple of alignment and is not
a power of two, such as 24kB with 8kB alignment, the small allocator
did not always guarantee alignment. Let's fix that.

* bmalloc/Algorithm.h:
(bmalloc::divideRoundingUp): Math is hard.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::allocate): Align to the page size unconditionally.
Even if the page size is not a power of two, it might be a multiple of
a power of two, and we want alignment to that smaller power of two to
be guaranteed.

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

4 years ago[WK1] Wheel event callback removing the window causes crash in WebCore
bfulgham@apple.com [Fri, 8 Apr 2016 20:46:25 +0000 (20:46 +0000)]
[WK1] Wheel event callback removing the window causes crash in WebCore
https://bugs.webkit.org/show_bug.cgi?id=156409
<rdar://problem/25631267>

Reviewed by Simon Fraser.

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

This is the WK1 fix for https://bugs.webkit.org/show_bug.cgi?id=150871.

Tested by fast/events/wheel-event-destroys-frame.html

* page/EventHandler.cpp:
(WebCore::widgetForElement): Added.
(WebCore::EventHandler::handleWheelEvent): Use new helper function to
clean up the code, and allow us to check that the Widget has not been
destroyed during the event handler.

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

4 years agoFix SVG benchmark test
jonlee@apple.com [Fri, 8 Apr 2016 20:19:26 +0000 (20:19 +0000)]
Fix SVG benchmark test
https://bugs.webkit.org/show_bug.cgi?id=156410

Reviewed by Dean Jackson.

* Animometer/resources/extensions.js: Update Point.zero to be a static Point.
* Animometer/tests/simple/resources/tiled-canvas-image.js:
(Stage.call._setupTiles): Refactor.
* Animometer/tests/master/resources/particles.js:
(Particle.prototype.reset): Use Point.center.
(complexity): We are not using a gradient background anymore, so remove the +1.
* Animometer/tests/master/resources/svg-particles.js: Update to use SVG transform
instead of CSS transform.

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

4 years agoTiming attack on SVG feComposite filter circumvents same-origin policy
said@apple.com [Fri, 8 Apr 2016 20:07:51 +0000 (20:07 +0000)]
Timing attack on SVG feComposite filter circumvents same-origin policy
https://bugs.webkit.org/show_bug.cgi?id=154338

Patch by Said Abou-Hallawa <sabouhallawa@apple,com> on 2016-04-08
Reviewed by Oliver Hunt.

Ensure the FEComposite arithmetic filter is clamping the resulted color
components in a constant time.

* platform/graphics/filters/FEComposite.cpp:
(WebCore::clampByte):
(WebCore::computeArithmeticPixels):

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

4 years agoWeb Inspector: get rid of InspectorBasicValue and InspectorString subclasses
bburg@apple.com [Fri, 8 Apr 2016 19:59:25 +0000 (19:59 +0000)]
Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
https://bugs.webkit.org/show_bug.cgi?id=156407
<rdar://problem/25627659>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

There's no point having these subclasses as they don't save any space.
Add m_stringValue to the union and merge some implementations of writeJSON.
Move uses of the subclass to InspectorValue and delete redundant methods.
Now, most InspectorValue methods are non-virtual so they can be templated.

* bindings/ScriptValue.cpp:
(Deprecated::jsToInspectorValue):
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::makeCall):
Don't used deleted subclasses.

* inspector/InspectorValues.cpp:
(Inspector::InspectorValue::null):
(Inspector::InspectorValue::create):
(Inspector::InspectorValue::asValue):
(Inspector::InspectorValue::asBoolean):
(Inspector::InspectorValue::asDouble):
(Inspector::InspectorValue::asInteger):
(Inspector::InspectorValue::asString):
These only need one implementation now.

(Inspector::InspectorValue::writeJSON):
Still a virtual method since Object and Array need their members.

(Inspector::InspectorObjectBase::InspectorObjectBase):
(Inspector::InspectorBasicValue::asBoolean): Deleted.
(Inspector::InspectorBasicValue::asDouble): Deleted.
(Inspector::InspectorBasicValue::asInteger): Deleted.
(Inspector::InspectorBasicValue::writeJSON): Deleted.
(Inspector::InspectorString::asString): Deleted.
(Inspector::InspectorString::writeJSON): Deleted.
(Inspector::InspectorString::create): Deleted.
(Inspector::InspectorBasicValue::create): Deleted.

* inspector/InspectorValues.h:
(Inspector::InspectorObjectBase::setBoolean):
(Inspector::InspectorObjectBase::setInteger):
(Inspector::InspectorObjectBase::setDouble):
(Inspector::InspectorObjectBase::setString):
(Inspector::InspectorArrayBase::pushBoolean):
(Inspector::InspectorArrayBase::pushInteger):
(Inspector::InspectorArrayBase::pushDouble):
(Inspector::InspectorArrayBase::pushString):
Use new factory methods.

* replay/EncodedValue.cpp:
(JSC::ScalarEncodingTraits<bool>::encodeValue):
(JSC::ScalarEncodingTraits<double>::encodeValue):
(JSC::ScalarEncodingTraits<float>::encodeValue):
(JSC::ScalarEncodingTraits<int32_t>::encodeValue):
(JSC::ScalarEncodingTraits<int64_t>::encodeValue):
(JSC::ScalarEncodingTraits<uint32_t>::encodeValue):
(JSC::ScalarEncodingTraits<uint64_t>::encodeValue):
* replay/EncodedValue.h:
Use new factory methods.

Source/WebCore:

* inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.

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

4 years agoJSContext Inspector: Fix asserts and uncaught exception showing Timeline Tab
commit-queue@webkit.org [Fri, 8 Apr 2016 19:40:48 +0000 (19:40 +0000)]
JSContext Inspector: Fix asserts and uncaught exception showing Timeline Tab
https://bugs.webkit.org/show_bug.cgi?id=156411

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-08
Reviewed by Timothy Hatcher.

* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView):
(WebInspector.OverviewTimelineView.prototype.closed):
Gracefully handle if we do not have a Network Timeline.

* UserInterface/Views/TimelineTabContentView.js:
(WebInspector.TimelineTabContentView.prototype._changeViewMode):
This function is always called by the constructor, so the assert
is not useful since it can be called when FPS is not supported.

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

4 years agoAdd IC support for arguments.length
fpizlo@apple.com [Fri, 8 Apr 2016 19:37:04 +0000 (19:37 +0000)]
Add IC support for arguments.length
https://bugs.webkit.org/show_bug.cgi?id=156389

Reviewed by Geoffrey Garen.
Source/JavaScriptCore:

This adds support for caching accesses to arguments.length for both DirectArguments and
ScopedArguments. In strict mode, we already cached these accesses since they were just
normal properties.

Amazingly, we also already supported caching of overridden arguments.length in both
DirectArguments and ScopedArguments. This is because when you override, the property gets
materialized as a normal JS property and the structure is changed.

This patch painstakingly preserves our previous caching of overridden length while
introducing caching of non-overridden length (i.e. the common case). In fact, we even cache
the case where it could either be overridden or not, since we just end up with an AccessCase
for each and they cascade to each other.

This is a >3x speed-up on microbenchmarks that do arguments.length in a polymorphic context.
Entirely monomorphic accesses were already handled by the DFG.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::calculateLiveRegistersForCallAndExceptionHandling):
(JSC::AccessCase::guardedByStructureCheck):
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generate):
(WTF::printInternal):
* bytecode/PolymorphicAccess.h:
* jit/ICStats.h:
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryRepatchIn):
* tests/stress/direct-arguments-override-length-then-access-normal-length.js: Added.
(args):
(foo):
(result.foo):

LayoutTests:

* js/regress/direct-arguments-length-expected.txt: Added.
* js/regress/direct-arguments-length.html: Added.
* js/regress/direct-arguments-overridden-length-expected.txt: Added.
* js/regress/direct-arguments-overridden-length.html: Added.
* js/regress/direct-arguments-possibly-overridden-length-expected.txt: Added.
* js/regress/direct-arguments-possibly-overridden-length.html: Added.
* js/regress/scoped-arguments-length-expected.txt: Added.
* js/regress/scoped-arguments-length.html: Added.
* js/regress/scoped-arguments-overridden-length-expected.txt: Added.
* js/regress/scoped-arguments-overridden-length.html: Added.
* js/regress/scoped-arguments-possibly-overridden-length-expected.txt: Added.
* js/regress/scoped-arguments-possibly-overridden-length.html: Added.
* js/regress/script-tests/direct-arguments-length.js: Added.
(args):
* js/regress/script-tests/direct-arguments-overridden-length.js: Added.
(args):
* js/regress/script-tests/direct-arguments-possibly-overridden-length.js: Added.
(args1):
(args2):
* js/regress/script-tests/scoped-arguments-length.js: Added.
(args):
* js/regress/script-tests/scoped-arguments-overridden-length.js: Added.
(args):
* js/regress/script-tests/scoped-arguments-possibly-overridden-length.js: Added.
(args1):
(args2):

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

4 years agoFix leaks in WebAVMediaSelectionOptionMac and WebPlaybackControlsManager
bdakin@apple.com [Fri, 8 Apr 2016 18:32:19 +0000 (18:32 +0000)]
Fix leaks in WebAVMediaSelectionOptionMac and WebPlaybackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=156379

Reviewed by Tim Horton.

These classes should use RetainPtrs.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebAVMediaSelectionOptionMac localizedDisplayName]):
(-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
(-[WebPlaybackControlsManager timing]):
(-[WebPlaybackControlsManager setTiming:]):
(-[WebPlaybackControlsManager seekableTimeRanges]):
(-[WebPlaybackControlsManager setSeekableTimeRanges:]):
(-[WebPlaybackControlsManager audioMediaSelectionOptions]):
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):

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

4 years agoTouching any IDL files rebuilds all bindings in CMake Ninja build
commit-queue@webkit.org [Fri, 8 Apr 2016 18:28:27 +0000 (18:28 +0000)]
Touching any IDL files rebuilds all bindings in CMake Ninja build
https://bugs.webkit.org/show_bug.cgi?id=156400

Patch by Fujii Hironori <Hironori.Fujii@jp.sony.com> on 2016-04-08
Reviewed by Brent Fulgham.

* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttribute):
WriteFileIfChanged does not work due to flaky results of 'keys'.
Sort results of 'keys'.

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

4 years agoRedefining a method of the same name hits an assertion
joepeck@webkit.org [Fri, 8 Apr 2016 18:18:19 +0000 (18:18 +0000)]
Redefining a method of the same name hits an assertion
https://bugs.webkit.org/show_bug.cgi?id=144258

Reviewed by Ryosuke Niwa.

* TestExpectations:
* js/script-tests/class-syntax-semicolon.js:
This test no longer asserts.

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

4 years agoUInt32ToNumber should have an Int52 path
commit-queue@webkit.org [Fri, 8 Apr 2016 18:07:25 +0000 (18:07 +0000)]
UInt32ToNumber should have an Int52 path
https://bugs.webkit.org/show_bug.cgi?id=125704

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-04-08
Reviewed by Filip Pizlo.

When dealing with big numbers, fall back to Int52 instead
of double when possible.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileUInt32ToNumber):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileUInt32ToNumber):

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

4 years ago[cmake] Use ICU include dirs in WebKit.
commit-queue@webkit.org [Fri, 8 Apr 2016 17:50:22 +0000 (17:50 +0000)]
[cmake] Use ICU include dirs in WebKit.
https://bugs.webkit.org/show_bug.cgi?id=156402

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-04-08
Reviewed by Brent Fulgham.

* CMakeLists.txt:

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

4 years ago[iOS WK2] Stop using exposedContentRect for history scroll state restoration
simon.fraser@apple.com [Fri, 8 Apr 2016 17:22:19 +0000 (17:22 +0000)]
[iOS WK2] Stop using exposedContentRect for history scroll state restoration
https://bugs.webkit.org/show_bug.cgi?id=156392

Reviewed by Tim Horton.

A future commit will alter the meaning of exposedContentRect on iOS to take into
account clipped out parts of the WKWebView. To achieve this, wean history restoration
off of using exposedContentRect for scroll state restoration. It did this to restore
the page to the same position relative to the view's top-left (to avoid jiggles caused
by changing obscured insets).

Do this by pushing the left/top obscured insets down with visible content rects updates,
storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
for scroll state restoration in WKWebView.

Source/WebCore:

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
(WebCore::HistoryItem::obscuredInset):
(WebCore::HistoryItem::setObscuredInset):
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
* platform/ScrollView.h:
(WebCore::ScrollView::platformObscuredInset):
(WebCore::ScrollView::platformSetObscuredInset):

Source/WebKit2:

* Shared/VisibleContentRectUpdateInfo.cpp: Add FloatSize for obscuredInset.
(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::obscuredInset):
(WebKit::operator==):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _processDidExit]): Rename _needsToRestoreExposedRect to _needsToRestoreScrollPosition
(-[WKWebView _didCommitLayerTree:]): Restore the scroll position using the scaled scrollOffset minus
the old obscuredInset.
(-[WKWebView _layerTreeCommitComplete]):
(-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]):
(-[WKWebView _restorePageStateToUnobscuredCenter:scale:]):
(-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _restorePageStateToExposedRect:scrollOrigin:scale:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::restorePageState):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateVisibleContentRects):
(WebKit::WebPageProxy::restorePageState):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::restorePageState):
(WebKit::WebPage::updateVisibleContentRects):

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

4 years agoBuild fix followup to http://trac.webkit.org/changeset/199230
beidson@apple.com [Fri, 8 Apr 2016 17:21:32 +0000 (17:21 +0000)]
Build fix followup to trac.webkit.org/changeset/199230

Unreviewed.

* platform/posix/FileSystemPOSIX.cpp:
(WebCore::hardLinkOrCopyFile): Stricter POSIX systems require a umask for O_CREAT opens,
  so let's provide one.

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

4 years agoRemove 14 more unnecessary uses of UsePointersEvenForNonNullableObjectArguments
darin@apple.com [Fri, 8 Apr 2016 16:59:35 +0000 (16:59 +0000)]
Remove 14 more unnecessary uses of UsePointersEvenForNonNullableObjectArguments
https://bugs.webkit.org/show_bug.cgi?id=156405

Reviewed by Chris Dumez.

* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* dom/Element.idl:
* dom/NamedNodeMap.idl:
* html/HTMLElement.idl:
* html/canvas/OESVertexArrayObject.idl:
* html/canvas/WebGLRenderingContext.idl:
* page/DOMSelection.idl:
* storage/StorageEvent.idl:
* svg/SVGSVGElement.idl:
* xml/XMLSerializer.idl:
* xml/XPathEvaluator.idl:
* xml/XPathExpression.idl:
* xml/XSLTProcessor.idl:
Removed UsePointersEvenForNonNullableObjectArguments, which was having no effect
in any of these classes. Also tweaked formatting of some of the IDL, merging things
onto single lines, changing paragraphing and indenting a bit, and fixing some typos.

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

4 years agoModern IDB (Blob support): Write blobs to temporary files and move them to the correc...
beidson@apple.com [Fri, 8 Apr 2016 16:57:29 +0000 (16:57 +0000)]
Modern IDB (Blob support): Write blobs to temporary files and move them to the correct location when storing them.
https://bugs.webkit.org/show_bug.cgi?id=156321

Reviewed by Alex Christensen, Andy Estes, and Darin Adler.

Source/WebCore:

No new tests (No testable change in behavior yet, current tests pass).

When asked to store a Blob (including Files) in IndexedDB, the Blob is written out to a temporary file.

Then when the putOrAdd request is received by IDBServer it includes a list of blobURLs and their mappings
to temporary files.

Finally, as part of storing the Blob value in the database, those temporary files are moved in to place
under the IndexedDB directory for storage and later retrieval.

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):

* Modules/indexeddb/server/IDBBackingStore.h:
(WebCore::IDBServer::IDBBackingStoreTemporaryFileHandler::~IDBBackingStoreTemporaryFileHandler):

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::IDBServer::createBackingStore):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::blobRecordsTableSchema):
(WebCore::IDBServer::blobRecordsTableSchemaAlternate):
(WebCore::IDBServer::blobFilesTableSchema):
(WebCore::IDBServer::blobFilesTableSchemaAlternate):
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidBlobTables):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::temporaryFileHandler):

* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::commit):
(WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
(WebCore::IDBServer::SQLiteIDBTransaction::reset):
(WebCore::IDBServer::SQLiteIDBTransaction::addBlobFile):
* Modules/indexeddb/server/SQLiteIDBTransaction.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::InProcessIDBServer):
(WebCore::InProcessIDBServer::accessToTemporaryFileComplete):
* Modules/indexeddb/shared/InProcessIDBServer.h:

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::blobURLsIsolatedCopy):
* bindings/js/SerializedScriptValue.h:

* platform/FileSystem.h:
* platform/gtk/FileSystemGtk.cpp:
(WebCore::hardLinkOrCopyFile):
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::hardLinkOrCopyFile):

Source/WebKit2:

The NetworkProcess writes a blob to a temporary file, then tells the UIProcess to grant the DatabaseProcess
a Sandbox Extension to that path.

It then tells the WebProcess the paths for the temporary files, which then tells the DatabaseProcess to store
the contents of those files as blob references in the database.

Since the UIProcess had already granted it a Sandbox Extension, it is able to do so.

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::idbServer):
(WebKit::DatabaseProcess::grantSandboxExtensionsForBlobs):
(WebKit::DatabaseProcess::prepareForAccessToTemporaryFile):
(WebKit::DatabaseProcess::accessToTemporaryFileComplete):
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseProcess.messages.in:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::grantSandboxExtensionsToDatabaseProcessForBlobs):
(WebKit::NetworkProcess::didGrantSandboxExtensionsToDatabaseProcessForBlobs):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::grantSandboxExtensionsToDatabaseProcessForBlobs):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

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

4 years agoAX: [ATK] Crash getting text under element in CSS table
jdiggs@igalia.com [Fri, 8 Apr 2016 16:36:01 +0000 (16:36 +0000)]
AX: [ATK] Crash getting text under element in CSS table
https://bugs.webkit.org/show_bug.cgi?id=156328

Reviewed by Chris Fleizach.

Source/WebCore:

AccessibilityRenderObject::textUnderElement() assumes (and asserts) that
the first and last child of an anonymous block will each have nodes with
which to define positions. This is not the case for CSS Tables and their
anonymous descendants. AccessibilityNodeObject:textUnderElement() is our
fallback for the instances where a text range cannot be created based on
positions, so let it handle anonymous RenderTable parts.

Test: accessibility/generated-content-with-display-table-crash.html

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement):
(WebCore::AccessibilityRenderObject::shouldGetTextFromNode):
* accessibility/AccessibilityRenderObject.h:

LayoutTests:

While this crash is currently seen only for ATK, there is nothing to
prevent another port from attempting to get all the text under a CSS
RenderTable. Hence the shared test.

* accessibility/generated-content-with-display-table-crash.html: Added.
* platform/gtk/accessibility/generated-content-with-display-table-crash-expected.txt: Added.
* platform/mac/accessibility/generated-content-with-display-table-crash-expected.txt: Added.

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

4 years agoUnreviewed.
youenn.fablet@crf.canon.fr [Fri, 8 Apr 2016 16:11:00 +0000 (16:11 +0000)]
Unreviewed.
Rebasing LayoutTests/imported/w3c/web-platform-tests/dom/nodes/MutationObserver-childList.html expectation after https://trac.webkit.org/changeset/199225.
Removing its Timeout expectation.

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

4 years agoWeb Inspector: Attempting to dismiss a popover that is already being dismissed causes...
mattbaker@apple.com [Fri, 8 Apr 2016 16:05:20 +0000 (16:05 +0000)]
Web Inspector: Attempting to dismiss a popover that is already being dismissed causes an error
https://bugs.webkit.org/show_bug.cgi?id=156385
<rdar://problem/25617962>

Reviewed by Timothy Hatcher.

The Popover element is removed from the DOM once it's fade-out transition
completes. Since Popover.dismiss proceeds as long as it's element has a
parent, successive calls to dismiss can run before the popover is removed.

Rather than rely on the presence of the popover in the DOM, set a "dismissing"
flag the first time dismiss is called, before the fade-out animation begins.

* UserInterface/Controllers/BreakpointPopoverController.js:
(WebInspector.BreakpointPopoverController.prototype._conditionCodeMirrorEscapeOrEnterKey):
Check for null popover.

* UserInterface/Views/Popover.js:
(WebInspector.Popover):
(WebInspector.Popover.prototype.dismiss):
Do nothing if already dismissing.

(WebInspector.Popover.prototype.handleEvent):
Reset dismissing flag after style transition completes.

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

4 years agoWeb Inspector: Quick Open fails to match pattern "bB" in file "abBc"
mattbaker@apple.com [Fri, 8 Apr 2016 16:04:24 +0000 (16:04 +0000)]
Web Inspector: Quick Open fails to match pattern "bB" in file "abBc"
https://bugs.webkit.org/show_bug.cgi?id=156398

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

Correct an off-by-one error in the backtrack routine that set the dead
branch index to the character just before the match that was popped.
The dead branch index should equal the index of the popped match.

* UserInterface/Controllers/ResourceQueryController.js:
(WebInspector.ResourceQueryController.prototype._findQueryMatches.backtrack):
(WebInspector.ResourceQueryController.prototype._findQueryMatches):

LayoutTests:

* inspector/unit-tests/resource-query-controller-expected.txt:
* inspector/unit-tests/resource-query-controller.html:
Test that two repeated characters in the search string are correctly
matched when the first character is lowercase and the second is uppercase.

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

4 years agoLayoutTests/imported/w3c:
youenn.fablet@crf.canon.fr [Fri, 8 Apr 2016 14:45:24 +0000 (14:45 +0000)]
LayoutTests/imported/w3c:
Testharness-based tests that time out should be able to produce detailed output
https://bugs.webkit.org/show_bug.cgi?id=145313

Reviewed by Xabier Rodriguez-Calvar.

Rebasing tests that produce output after testharness timeout() is called.

* web-platform-tests/fetch/api/request/request-cache-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-link-element/link-style-error-01-expected.txt:
* web-platform-tests/html/semantics/document-metadata/the-style-element/style-error-01-expected.txt:
* web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change-expected.txt:

Tools:
Testharness-based tests that time out should be able to produce a detailed output
https://bugs.webkit.org/show_bug.cgi?id=145313

Reviewed by Xabier Rodriguez-Calvar.

Adding timeout readonly accessor to TestRunner for both WK1 and WK2.

* DumpRenderTree/TestRunner.cpp:
(getTimeoutCallback): The js "timeout" property getter.
(TestRunner::staticValues): Adding "timeout" property to DumpRenderTree so that testRunner.timeout called from JS returns the timeout value.
* DumpRenderTree/TestRunner.h:
(TestRunner::timeout): Adding access to DRT m_timeout private value.
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: Adding timeout readonly attribute so that testRunner.timeout can be called from JS.
* WebKitTestRunner/InjectedBundle/TestRunner.h: Adding DOM timeout getter to implement timeout IDL definition.
(WTR::TestRunner::timeout):

LayoutTests:
Testharness-based tests that time out should be able to produce a detailled output
https://bugs.webkit.org/show_bug.cgi?id=145313

Reviewed by Xabier Rodriguez-Calvar.

* TestExpectations: Removed TIMEOUT for some tests for which testharness.timeout will be called just before WTR times out.
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/request/request-cache-expected.txt: GTK specific baseline.
* resources/testharnessreport.js:
(add_completion_callback): Improving error logging message. Dumping of the tests status in error case.

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

4 years agoRemove unneeded UsePointersEvenForNonNullableObjectArguments from event classes
darin@apple.com [Fri, 8 Apr 2016 09:04:17 +0000 (09:04 +0000)]
Remove unneeded UsePointersEvenForNonNullableObjectArguments from event classes
https://bugs.webkit.org/show_bug.cgi?id=156396

Reviewed by Youenn Fablet.

* dom/CompositionEvent.idl:
* dom/KeyboardEvent.idl:
* dom/MouseEvent.idl:
* dom/MutationEvent.idl:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/UIEvent.idl:
* dom/WheelEvent.idl:
Removed UsePointersEvenForNonNullableObjectArguments, which was having no effect.

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

4 years ago[css-grid] Fix positioned items with grid gaps
rego@igalia.com [Fri, 8 Apr 2016 08:52:17 +0000 (08:52 +0000)]
[css-grid] Fix positioned items with grid gaps
https://bugs.webkit.org/show_bug.cgi?id=156288

Reviewed by Darin Adler.

Source/WebCore:

When we place a positioned items in a grid with gaps,
we were not taking into accounts the gutter size.
We've to use that size to properly place and size the item.

Tests: fast/css-grid-layout/grid-positioned-items-gaps-rtl.html
       fast/css-grid-layout/grid-positioned-items-gaps.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

LayoutTests:

Added new tests checking the right behavior.

* fast/css-grid-layout/grid-positioned-items-gaps-expected.txt: Added.
* fast/css-grid-layout/grid-positioned-items-gaps-rtl-expected.txt: Added.
* fast/css-grid-layout/grid-positioned-items-gaps-rtl.html: Added.
* fast/css-grid-layout/grid-positioned-items-gaps.html: Added.

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

4 years ago[css-grid] Remove unnecessary iteration in populateGridPositions loop
jfernandez@igalia.com [Fri, 8 Apr 2016 08:01:04 +0000 (08:01 +0000)]
[css-grid] Remove unnecessary iteration in populateGridPositions loop
https://bugs.webkit.org/show_bug.cgi?id=156376

Reviewed by Darin Adler.

The populateGridPositions loop limit was set to 'lastLine'. However, the
the position of last track's start line is updated after the loop, since
it does not follow the same pattern; it does not have a content
distribution offset.

So, since we are essentially overwriting the value stored in the last
iteration, we can just lower the loop limit.

No new tests added, because there is no change in the functionality.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositions):

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

4 years agoCSP: Block XHR when calling XMLHttpRequest.send() and throw network error.
commit-queue@webkit.org [Fri, 8 Apr 2016 07:17:50 +0000 (07:17 +0000)]
CSP: Block XHR when calling XMLHttpRequest.send() and throw network error.
https://bugs.webkit.org/show_bug.cgi?id=153598
<rdar://problem/24391483>

Patch by John Wilander <wilander@apple.com> on 2016-04-08
Reviewed by Darin Adler.

Source/WebCore:

No new tests. Changes to existing tests are sufficient.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
(WebCore::XMLHttpRequest::initSend):
    Moved the CSP check from XMLHttpRequest::open() to XMLHttpRequest::initSend().
    Changed the thrown error type from Security to Network for synchronous requests.
    Changed from throwing an error to firing an error event for asynchronous requests.
    These changes are in conformance with connect-src of Content Security Policy Level 2.
    https://www.w3.org/TR/CSP2/#directive-connect-src (W3C Candidate Recommendation, 21 July 2015)

LayoutTests:

* fast/workers/resources/worker-inherits-csp-blocks-xhr.js:
(catch):
* fast/workers/worker-inherits-csp-blocks-xhr-expected.txt:
    Changed expected error from DOMException.SECURITY_ERR to DOMException.NETWORK_ERR.
* http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked-expected.txt:
* http/tests/security/contentSecurityPolicy/connect-src-xmlhttprequest-blocked.html:
    Now tests that XMLHttpRequest.send() is blocked if the URL voilates the connect-src directive in CSP.
* http/tests/security/contentSecurityPolicy/resources/worker.php:
    Added two additional calls to XMLHttpRequest.send() and switched to receiving an error event to make
    existing tests work with code changes.
* http/tests/security/contentSecurityPolicy/source-list-parsing-malformed-meta.html:
    Added an additional call to XMLHttpRequest.send() and switched to receiving an error event to make
    existing test work with code changes.
* http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr-expected.txt:
* http/tests/security/isolatedWorld/bypass-main-world-csp-for-xhr.html:
    Added an additional call to XMLHttpRequest.send() and switched to receiving an error event to make
    existing tests work with code changes.
    Refactored test mechnism with additional parameters to cover synchronous/asynchronous as well as
    same-origin/cross-origin in isolated worlds.

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

4 years agoFix various bugs in the new syncing script
rniwa@webkit.org [Fri, 8 Apr 2016 07:15:43 +0000 (07:15 +0000)]
Fix various bugs in the new syncing script
https://bugs.webkit.org/show_bug.cgi?id=156393

Reviewed by Darin Adler.

* server-tests/resources/common-operations.js: Added. This file was supposed to be added in r199191.
(addBuilderForReport):
(addSlaveForReport):
(connectToDatabaseInEveryTest):
(submitReport):
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Don't log every time we pull from buildbot
builder as this dramatically increases the amount of log we generate.
* tools/js/parse-arguments.js:
(parseArguments): Fixed a typo. This should be parseArgument*s*, not parseArgument.
* tools/js/remote.js:
(RemoteAPI.prototype.url): Fixed a bug that portSuffix wasn't being expanded in the template literal.
(RemoteAPI.prototype.configure): Added more validations with nice error messages.
(RemoteAPI.prototype.sendHttpRequest): Falling back to port 80 isn't right when scheme is https. Compute
the right port in configure instead based on the scheme.
* tools/sync-buildbot.js:
(syncLoop): Fixed the bug that syncing multiple times fail because Manifest.fetch() create new Platform
and Test objects. This results in various references in BuildRequest objects to get outdated. Fixing this
properly in Manifest.fetch() because we do need to "forget" about some tests and platforms in some cases.
For now, delete all v3 model objects and start over in each syncing cycle.
* unit-tests/tools-js-remote-tests.js: Added. Unit tests for the aforementioned changes to RemoteAPI.

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

4 years agoWeb Inspector: protocol generator should emit an error when 'type' is used instead...
bburg@apple.com [Fri, 8 Apr 2016 07:13:28 +0000 (07:13 +0000)]
Web Inspector: protocol generator should emit an error when 'type' is used instead of '$ref'
https://bugs.webkit.org/show_bug.cgi?id=156275
<rdar://problem/25569331>

Reviewed by Darin Adler.

* inspector/protocol/Heap.json: Fix a mistake that's now caught by the protocol generator.

* inspector/scripts/codegen/models.py:
(TypeReference.__init__): Check here if type_kind is on a whitelist of primitive types.
(TypeReference.referenced_name): Update comment.

Add a new test specifically for the case when the type would otherwise be resolved. Rebaseline.

* inspector/scripts/tests/expected/fail-on-type-reference-as-primitive-type.json-error: Added.
* inspector/scripts/tests/expected/fail-on-unknown-type-reference-in-type-declaration.json-error:
* inspector/scripts/tests/fail-on-type-reference-as-primitive-type.json: Added.

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

4 years ago[JSC] Enable Concurrent JIT by default
utatane.tea@gmail.com [Fri, 8 Apr 2016 07:08:19 +0000 (07:08 +0000)]
[JSC] Enable Concurrent JIT by default
https://bugs.webkit.org/show_bug.cgi?id=156341

Reviewed by Filip Pizlo.

We enable Concurrent JIT by default when DFG JIT and JSVALUE64 are enabled.
This change offers Concurrent JIT to the JSCOnly port.

* wtf/Platform.h:

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

4 years agostylebot should know about TestWebKitAPI FeatureDefines.xcconfig
commit-queue@webkit.org [Fri, 8 Apr 2016 05:04:51 +0000 (05:04 +0000)]
stylebot should know about TestWebKitAPI FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=156387

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Rubber-stamped by Dan Bernstein.

* Scripts/webkitpy/style/checkers/featuredefines.py:
(FeatureDefinesChecker.check):

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

4 years agoFontFaceSet binding does not handle null correctly
darin@apple.com [Fri, 8 Apr 2016 04:26:27 +0000 (04:26 +0000)]
FontFaceSet binding does not handle null correctly
https://bugs.webkit.org/show_bug.cgi?id=156141

Reviewed by Youenn Fablet.

Source/WebCore:

* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::FontFaceSet): Pass a reference to add rather than a pointer.
(WebCore::FontFaceSet::has): Take a reference rather than a pointer.
(WebCore::FontFaceSet::add): Ditto.
(WebCore::FontFaceSet::remove): Ditto.
(WebCore::FontFaceSet::load): Initialize ec since we check it. Caller is not required
to do this, nor is the matchingFaces function. Rearranged function to avoid needless
creation/destruction of PendingPromise for the immediate failure case. Removed some
unneeded type casts and local variables.
(WebCore::FontFaceSet::status): Use ASCIILiteral instead of ConstructFromLiteral.
No reason to use the more aggressive optimization.
(WebCore::FontFaceSet::faceFinished): Factored out a common hasReachedTerminalState
check to streamline the logic a bit.
(WebCore::FontFaceSet::load): Moved overload without a string in here; not critical
to inline it.
(WebCore::FontFaceSet::check): Ditto.

* css/FontFaceSet.h: Removed many unneeded includes and forward declarations.
Changed functions to take FontFace& instead of RefPtr<FontFace>. Removed unneeded
WebCore namespace prefixes. Use final instead of override for virtual functions.

* css/FontFaceSet.idl: Removed UsePointersEvenForNonNullableObjectArguments, which
was preserving incorrect behavior for null as demonstrated by the test cases.

LayoutTests:

* fast/text/font-face-set-javascript-expected.txt: Added expected results for new tests.
* fast/text/font-face-set-javascript.html: Added tests for handling of null, also added tests for
the has function.

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

4 years agosync-buildbot.js doesn't mark disappeared builds as failed
rniwa@webkit.org [Fri, 8 Apr 2016 04:21:32 +0000 (04:21 +0000)]
sync-buildbot.js doesn't mark disappeared builds as failed
https://bugs.webkit.org/show_bug.cgi?id=156386

Reviewed by Chris Dumez.

Fix a bug that new syncing script doesn't mark builds that it scheduled but doesn't appear when queried
by buildbot's JSON API. These are builds that got canceled by humans (e.g. buildbot was restarted, data
loss, pending build was canceled, etc...)

* server-tests/tools-buildbot-triggerable-tests.js: Added a test case.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Added a set of build requests we've matched
against BuildbotBuildEntry's. Mark build requests that didn't have any entry but supposed to be in either
'scheduled' or 'running' status as failed.

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

4 years agoRemove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
commit-queue@webkit.org [Fri, 8 Apr 2016 04:17:23 +0000 (04:17 +0000)]
Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
https://bugs.webkit.org/show_bug.cgi?id=156384

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Reviewed by Ryosuke Niwa.

.:

* Source/cmake/WebKitFeatures.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* features.json: Mark as Done.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

4 years ago[iOS] Media playback button should use appearance
dino@apple.com [Fri, 8 Apr 2016 03:59:45 +0000 (03:59 +0000)]
[iOS] Media playback button should use appearance
https://bugs.webkit.org/show_bug.cgi?id=156388

Reviewed by Simon Fraser.

With the recent change in backdrop appearance, we can
now use the system style directly for the play button.

While I was here I also updated the artwork to the
latest style (slightly rounded corners on the triangle).

Covered by the test in ManualTests/ios/start-playback-button-appearance.html.

* Modules/mediacontrols/mediaControlsiOS.css: Move the clip onto the backdrop
element. Use an appearance insted.
* Modules/mediacontrols/mediaControlsiOS.js: Remove the tint element, and
set the highlight on the glyph instead.

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

4 years ago[iOS] Play button on video is too dark
dino@apple.com [Fri, 8 Apr 2016 03:59:21 +0000 (03:59 +0000)]
[iOS] Play button on video is too dark
https://bugs.webkit.org/show_bug.cgi?id=156383
<rdar://problem/23540816>

Reviewed by Simon Fraser.

.:

Add a manual test for iOS that shows the expected appearance
of a video element. Unfortunately, due to the way we take
snapshots on iOS within our test runner, we don't get the
platform blurring effect, which means an automated test
won't work.

* ManualTests/ios/start-playback-button-appearance-expected.html: Added.
* ManualTests/ios/start-playback-button-appearance.html: Added.

Source/WebKit2:

Elements that are backed by a layer with either LightBackdropAppearance
or DarkBackdropAppearance are actually a combination of a
few layers (inside a special view). If we apply a mask to one
of those layers, it needs to be attached to the correct
child layer.

* Shared/mac/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyProperties): If we have
one of the special appearance flags, apply the mask layer to
a particular child, rather than the layer itself.

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

4 years agoWatchlist modifications:
dino@apple.com [Fri, 8 Apr 2016 03:58:46 +0000 (03:58 +0000)]
Watchlist modifications:
- remove roger_fong
- add myself to a few areas
- remove graouts from WebInspectorAPI

* Scripts/webkitpy/common/config/watchlist:

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

4 years agoA/B testing bots should prioritize user created test groups
rniwa@webkit.org [Fri, 8 Apr 2016 03:19:22 +0000 (03:19 +0000)]
A/B testing bots should prioritize user created test groups
https://bugs.webkit.org/show_bug.cgi?id=156375

Reviewed by Chris Dumez.

Order build requests preferring user created ones over ones automatically created by detect-changes.js.

Also fixed a bug in BuildbotSyncer.scheduleFirstRequestInGroupIfAvailable that it was scheduling a new
build request on a builder/slave even when we had previously scheduled another build request.

* public/include/build-requests-fetcher.php:
(BuildRequestsFetcher::fetch_incomplete_requests_for_triggerable): Order build requested based on
author_order which is 0 when it's created by an user and 1 when it's created by detect-changes.js.
Since we're using ascending order, this would put user created test groups first.
* server-tests/api-build-requests-tests.js: Updated an existing test case and added a new test case
for testing that build requests for an user created test group shows up first.
* server-tests/resources/mock-data.js:
(MockData.addAnotherMockTestGroup): Takes an extra argument to specify the author name.
* server-tests/tools-buildbot-triggerable-tests.js: Added a test case for testing that build requests
for an user created test group shows up first.
* tools/js/buildbot-syncer.js:
(BuildbotSyncer): Added _slavesWithNewRequests to keep track of build slaves on which we have already
scheduled new build requests. Don't schedule more requests on these slaves.
(BuildbotSyncer.prototype.scheduleRequest):
(BuildbotSyncer.prototype.scheduleFirstRequestInGroupIfAvailable): Add the specified slave name (or null
when slaveList is not specified) to _slavesWithNewRequests.
(BuildbotSyncer.prototype.pullBuildbot): Clear the set after pulling buildbot since any build request
we have previously scheduled should be included in one of the entires now.
* unit-tests/buildbot-syncer-tests.js: Added test cases for the aforementioned bug.
(sampleiOSConfig): Added a second slave for new test cases.

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

4 years agoImplementing caching transition puts that need to reallocate with indexing storage
fpizlo@apple.com [Fri, 8 Apr 2016 02:11:48 +0000 (02:11 +0000)]
Implementing caching transition puts that need to reallocate with indexing storage
https://bugs.webkit.org/show_bug.cgi?id=130914

Reviewed by Saam Barati.

Source/JavaScriptCore:

This enables the IC's put_by_id path to handle reallocating the out-of-line storage even if
the butterfly has indexing storage. Like the DFG, we do this by calling operations that
reallocate the butterfly. Those use JSObject API and do all of the nasty work for us, like
triggering a barrier.

This does a bunch of refactoring to how PolymorphicAccess makes calls. It's a lot easier to
do it now because the hard work is hidden under AccessGenerationState methods. This means
that custom accessors now share logic with put_by_id transitions.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::succeed):
(JSC::AccessGenerationState::calculateLiveRegistersForCallAndExceptionHandling):
(JSC::AccessGenerationState::preserveLiveRegistersToStackForCall):
(JSC::AccessGenerationState::originalCallSiteIndex):
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
(JSC::AccessCase::AccessCase):
(JSC::AccessCase::transition):
(JSC::AccessCase::generate):
(JSC::PolymorphicAccess::regenerate):
* bytecode/PolymorphicAccess.h:
(JSC::AccessGenerationState::needsToRestoreRegistersIfException):
(JSC::AccessGenerationState::liveRegistersToPreserveAtExceptionHandlingCallSite):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* jit/JITOperations.cpp:
* jit/JITOperations.h:

LayoutTests:

* js/regress/put-by-id-transition-with-indexing-header-expected.txt: Added.
* js/regress/put-by-id-transition-with-indexing-header.html: Added.
* js/regress/script-tests/put-by-id-transition-with-indexing-header.js: Added.
(allocate):

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

4 years agoRemote Inspector: When disallowing remote inspection on a debuggable, a listing is...
commit-queue@webkit.org [Fri, 8 Apr 2016 01:27:42 +0000 (01:27 +0000)]
Remote Inspector: When disallowing remote inspection on a debuggable, a listing is still sent to debuggers
https://bugs.webkit.org/show_bug.cgi?id=156380
<rdar://problem/25323727>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Reviewed by Timothy Hatcher.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::updateTarget):
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
When a target has been updated and it no longer generates a listing,
we should remove the old listing as that is now stale and should
not be sent. Not generating a listing means this target is no
longer allowed to be debugged.

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

4 years agoWeb Inspector: OpenResourceDialog should keep its resources list up-to-date
mattbaker@apple.com [Fri, 8 Apr 2016 01:24:47 +0000 (01:24 +0000)]
Web Inspector: OpenResourceDialog should keep its resources list up-to-date
https://bugs.webkit.org/show_bug.cgi?id=155321
<rdar://problem/25093890>

Reviewed by Timothy Hatcher.

The Quick Open dialog should listen for resource change events, refreshing
the resource list and current query results as needed.

* UserInterface/Views/OpenResourceDialog.js:
(WebInspector.OpenResourceDialog):
(WebInspector.OpenResourceDialog.prototype.didDismissDialog):
Unregister resource event handlers.

(WebInspector.OpenResourceDialog.prototype.didPresentDialog):
Register resource event handlers and add main frame resources.

(WebInspector.OpenResourceDialog.prototype._addResource):
Add resource to the query controller, if valid. Optionally suppress
the potentially expensive filter update, which is useful when adding
multiple resources at once.

(WebInspector.OpenResourceDialog.prototype._addResourcesForFrame):
Add the entire frame resource tree and update dialog filter.

(WebInspector.OpenResourceDialog.prototype._mainResourceDidChange):
(WebInspector.OpenResourceDialog.prototype._resourceWasAdded):

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

4 years agoRoll out the css change in mediaControlsApple.css that has been causing assertions...
adachan@apple.com [Fri, 8 Apr 2016 01:22:11 +0000 (01:22 +0000)]
Roll out the css change in mediaControlsApple.css that has been causing assertions in layout for multiple tests
https://bugs.webkit.org/show_bug.cgi?id=156381

Rubber-stamped by Alexey Proskuryakov.

Source/WebCore:

* Modules/mediacontrols/mediaControlsApple.css:
(::-webkit-media-controls):
Remove overflow: hidden.

LayoutTests:

* platform/mac/TestExpectations:
* platform/mac/media/media-document-audio-repaint-expected.txt:
* platform/mac/media/video-zoom-controls-expected.txt:

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

4 years agoWeb Inspector: Not necessary to validate webinspectord connection on iOS
commit-queue@webkit.org [Fri, 8 Apr 2016 00:40:21 +0000 (00:40 +0000)]
Web Inspector: Not necessary to validate webinspectord connection on iOS
https://bugs.webkit.org/show_bug.cgi?id=156377
<rdar://problem/25612460>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Reviewed by Simon Fraser.

* inspector/remote/RemoteInspectorXPCConnection.h:
* inspector/remote/RemoteInspectorXPCConnection.mm:
(Inspector::RemoteInspectorXPCConnection::handleEvent):

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

4 years agoClearing the application cache doesn't work.
commit-queue@webkit.org [Fri, 8 Apr 2016 00:19:45 +0000 (00:19 +0000)]
Clearing the application cache doesn't work.
https://bugs.webkit.org/show_bug.cgi?id=156354
rdar://problem/22369239

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-04-07
Reviewed by Brady Eidson.

Use the correct "ApplicationCache" directory.
Delete the caches, not just the entries.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchData):
(WebKit::WebsiteDataStore::removeData):

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

4 years agoRename ArrayMode::supportsLength to supportsSelfLength
keith_miller@apple.com [Fri, 8 Apr 2016 00:10:20 +0000 (00:10 +0000)]
Rename ArrayMode::supportsLength to supportsSelfLength
https://bugs.webkit.org/show_bug.cgi?id=156374

Reviewed by Filip Pizlo.

The name supportsLength is confusing because TypedArray have a
length function however it is on the prototype and not on the
instance. supportsSelfLength makes more sense since we use the
function during fixup to tell if we can intrinsic the length
property lookup on self accesses.

* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::supportsSelfLength):
(JSC::DFG::ArrayMode::supportsLength): Deleted.
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::attemptToMakeGetArrayLength):

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

4 years agoUnreviewed, rolling out r199199.
jiewen_tan@apple.com [Thu, 7 Apr 2016 23:38:32 +0000 (23:38 +0000)]
Unreviewed, rolling out r199199.

Revision breaks layout tests

Reverted changeset:

"fast/loader/opaque-base-url.html crashing during mac and ios
debug tests"
https://bugs.webkit.org/show_bug.cgi?id=156179
http://trac.webkit.org/changeset/199199

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

4 years agoWeb Inspector: ProfileView source links are off by 1 line, worse in pretty printed...
commit-queue@webkit.org [Thu, 7 Apr 2016 23:28:08 +0000 (23:28 +0000)]
Web Inspector: ProfileView source links are off by 1 line, worse in pretty printed code
https://bugs.webkit.org/show_bug.cgi?id=156371

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/ScriptProfiler.json:
Clarify that these locations are 1-based.

Source/WebInspectorUI:

* UserInterface/Views/ProfileDataGridNode.js:
(WebInspector.ProfileDataGridNode.prototype._displayContent):
Switch the 1-based locations in the CCT data structure to 0-based for SourceCodeLocation.

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

4 years agoMake it possible to test effect of view exposed rect on tiled backing
simon.fraser@apple.com [Thu, 7 Apr 2016 23:14:25 +0000 (23:14 +0000)]
Make it possible to test effect of view exposed rect on tiled backing
https://bugs.webkit.org/show_bug.cgi?id=156365

Reviewed by Tim Horton.

Source/WebCore:

Implement Internals::setViewExposedRect().

When the viewExposedRect is non-null, assume that we're scrollable on both axes
to avoid creation of huge tiles in this scenario.

We also need to call adjustTiledBackingScrollability() when setViewExposedRect()
has been called.

Tests: tiled-drawing/tile-coverage-view-exposed-rect.html
       tiled-drawing/tile-size-view-exposed-rect.html

* page/FrameView.cpp:
(WebCore::FrameView::adjustTiledBackingScrollability):
(WebCore::FrameView::setViewExposedRect):
* testing/Internals.cpp:
(WebCore::Internals::setViewExposedRect):
* testing/Internals.h:
* testing/Internals.idl:

Tools:

Expose testRunner.setViewSize() and internals.setViewExposedRect() to enable
testing of tile coverage when setViewExposedRect() is passed a non-null rectangle.

testRunner.setViewSize() is used instead of using window.resizeTo(), since we
can't easily resize a window to larger than the screen being tested on.

* DumpRenderTree/TestRunner.cpp:
(setViewSizeCallback):
(TestRunner::staticFunctions):
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setViewSize):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::postSetViewSize):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setViewSize):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

Tests for tile size and tile coverage when we have an exposed view rect.

* tiled-drawing/tile-coverage-view-exposed-rect-expected.txt: Added.
* tiled-drawing/tile-coverage-view-exposed-rect.html: Added.
* tiled-drawing/tile-size-view-exposed-rect-expected.txt: Added.
* tiled-drawing/tile-size-view-exposed-rect.html: Added.

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

4 years agofast/loader/opaque-base-url.html crashing during mac and ios debug tests
jiewen_tan@apple.com [Thu, 7 Apr 2016 22:44:37 +0000 (22:44 +0000)]
fast/loader/opaque-base-url.html crashing during mac and ios debug tests
https://bugs.webkit.org/show_bug.cgi?id=156179
<rdar://problem/25507719>

Reviewed by Andy Estes.

Source/WebCore:

A relative URL other than "#" with a non-hierarchical base is invalid, but prior to this
change the URL's string would still contain the invalid relative URL. To avoid mistakes
where we might later treat this URL string as a parsed URL string, set the string to
"about:blank" instead.

Test: fast/url/data-uri-based-urls.html

* platform/URL.cpp:
(WebCore::URL::init):

LayoutTests:

* TestExpectations:
* fast/url/data-uri-based-urls-expected.txt: Added.
* fast/url/data-uri-based-urls.html: Added.
* fast/url/relative-expected.txt:

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

4 years agoSkip a couple more tests that are asserting in FrameView::scheduleRelayoutOfSubtree().
adachan@apple.com [Thu, 7 Apr 2016 22:35:30 +0000 (22:35 +0000)]
Skip a couple more tests that are asserting in FrameView::scheduleRelayoutOfSubtree().

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoWeb Automation: implement Automation.addSingleCookie
bburg@apple.com [Thu, 7 Apr 2016 22:34:58 +0000 (22:34 +0000)]
Web Automation: implement Automation.addSingleCookie
https://bugs.webkit.org/show_bug.cgi?id=156319
<rdar://problem/25589605>

Reviewed by Timothy Hatcher.

Source/WebCore:

* platform/Cookie.h: Document the units used by the 'expires' field.

Source/WebKit2:

Implement this command by converting the protocol cookie to
WebCore::Cookie, then sending the cookie to NetworkProcess to
be added to the storage session using CookieJar::addCookie.

* UIProcess/Automation/Automation.json:
Clarify the units used in the 'expires' field and how the default value
for the domain field should be computed.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::addSingleCookie):
Parse the cookie and send it out via WebCookieManagerProxy.

* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::addCookie): Added.
* UIProcess/WebCookieManagerProxy.h:
* WebProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::addCookie):
* WebProcess/Cookies/WebCookieManager.h:
* WebProcess/Cookies/WebCookieManager.messages.in:
Forward the message to WebCore::addCookie.

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

4 years agoAdd ImageBitmap as under consideration on Feature Status page
jond@apple.com [Thu, 7 Apr 2016 22:31:56 +0000 (22:31 +0000)]
Add ImageBitmap as under consideration on Feature Status page
https://bugs.webkit.org/show_bug.cgi?id=156362

Reviewed by Timothy Hatcher.

* features.json:

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

4 years agoInclude Conical Gradients on the Feature Status page.
jond@apple.com [Thu, 7 Apr 2016 22:31:38 +0000 (22:31 +0000)]
Include Conical Gradients on the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=156363

Reviewed by Timothy Hatcher.

* features.json:

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

4 years agoBuild fix.
bdakin@apple.com [Thu, 7 Apr 2016 22:28:56 +0000 (22:28 +0000)]
Build fix.

* platform/mac/WebVideoFullscreenInterfaceMac.mm:

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

4 years agoIn WK1 WebVideoFullscreen interface may be accessed from WK1 main thread instead...
commit-queue@webkit.org [Thu, 7 Apr 2016 22:26:27 +0000 (22:26 +0000)]
In WK1 WebVideoFullscreen interface may be accessed from WK1 main thread instead of UI thread.
https://bugs.webkit.org/show_bug.cgi?id=154252
rdar://problem/22460539

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-04-07
Reviewed by Eric Carlson.

In WebKit1, Javascript can cause enter fullscreen to happen on the main thead, which is not
necessarily the UI thread. This can cause autolayout errors. Move this code to the UI thread.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::setUpFullscreen): Move setup to the UI thread.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]): Move call to resolveBounds to the UI thread.

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

4 years agoMark http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html...
jiewen_tan@apple.com [Thu, 7 Apr 2016 22:25:51 +0000 (22:25 +0000)]
Mark http/tests/cache/disk-cache/disk-cache-validation-back-navigation-policy.html as timeout in ios-simulator-wk2
https://bugs.webkit.org/show_bug.cgi?id=149087

Unreviewed, test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoMigrate legacy perf dashboard tests to mocha.js based tests
rniwa@webkit.org [Thu, 7 Apr 2016 22:10:50 +0000 (22:10 +0000)]
Migrate legacy perf dashboard tests to mocha.js based tests
https://bugs.webkit.org/show_bug.cgi?id=156335

Reviewed by Chris Dumez.

Migrated all legacy run-tests.js tests to mocha.js based tests. Since the new harness uses Promise
for most of asynchronous operations, refactored the tests to use Promises as well, and added more
assertions where appropriate.

Also consolidated common helper functions into server-tests/resources/common-operations.js.
Unfortunately there were multiple inconsistent implementations of addBuilder/addSlave. Some were
taking an array of reports while others were taking a single report. New shared implementation in
common-operations.js now takes a single report.

Also decreased the timeout in most tests from 10s to 1s so that tests fail early when they timeout.
Most of tests are passing under 100ms on my computer so 1s should be plenty still.

* run-tests.js: Removed.
* server-tests/admin-platforms-tests.js: Moved from tests/admin-platforms.js.
(reportsForDifferentPlatforms):
* server-tests/admin-reprocess-report-tests.js: Moved from tests/admin-reprocess-report.js.
(.addBuilder): Moved to common-operations.js.
* server-tests/api-build-requests-tests.js:
* server-tests/api-manifest.js: Use MockData.resetV3Models() instead of manually clearing maps.
* server-tests/api-measurement-set-tests.js: Moved from tests/api-measurement-set.js.
(.queryPlatformAndMetric):
(.format):
* server-tests/api-report-commits-tests.js: Moved from tests/api-report-commits.js.
* server-tests/api-report-tests.js: Moved from tests/api-report.js.
(.emptyReport):
(.emptySlaveReport):
(.reportWithSameSubtestName):
* server-tests/resources/common-operations.js: Added.
(addBuilderForReport): Extracted from tests.
(addSlaveForReport): Ditto.
(connectToDatabaseInEveryTest): Added.
(submitReport): Extracted from admin-platforms-tests.js.
* server-tests/resources/test-server.js:
(TestServer): Make TestServer a singleton since it doesn't make any sense for each module to start
its own Apache instance (that would certainly will fail).
* server-tests/tools-buildbot-triggerable-tests.js:
* tests: Removed.
* tools/js/database.js:
(Database.prototype.selectAll): Added.
(Database.prototype.selectFirstRow): Added.
(Database.prototype.selectRows): Added. Dynamically construct a query string based on arguments.

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

4 years agoBuild fix.
bdakin@apple.com [Thu, 7 Apr 2016 22:02:30 +0000 (22:02 +0000)]
Build fix.

* platform/mac/WebVideoFullscreenInterfaceMac.mm:

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

4 years agoAdd Web Animations API to Feature Status Page
jond@apple.com [Thu, 7 Apr 2016 22:01:34 +0000 (22:01 +0000)]
Add Web Animations API to Feature Status Page
https://bugs.webkit.org/show_bug.cgi?id=156360

Reviewed by Timothy Hatcher.

* features.json:

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

4 years ago[WebIDL] Add support for [EnabledAtRuntime] attributes on non-global objects
cdumez@apple.com [Thu, 7 Apr 2016 21:56:57 +0000 (21:56 +0000)]
[WebIDL] Add support for [EnabledAtRuntime] attributes on non-global objects
https://bugs.webkit.org/show_bug.cgi?id=156346

Reviewed by Ryosuke Niwa.

Add support for [EnabledAtRuntime] attributes on non-global objects by
using the same approach as for [EnabledAtRuntime] operations. This means
we add these attributes to the static property table but they get removed
at runtime in JS*Prototype::finishCreation(), if the feature is disabled,
after the eager reification of the prototype.

* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
(GenerateImplementation):
* 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_enabled_at_runtime_operation):
(webkit_dom_test_obj_get_enabled_at_runtime_attribute):
(webkit_dom_test_obj_set_enabled_at_runtime_attribute):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjEnabledAtRuntimeAttribute):
(WebCore::setJSTestObjEnabledAtRuntimeAttribute):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
(WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj enabledAtRuntimeAttribute]):
(-[DOMTestObj setEnabledAtRuntimeAttribute:]):
(-[DOMTestObj enabledAtRuntimeOperation:]):
* bindings/scripts/test/TestObj.idl:

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

4 years agoAttempted build fix.
bdakin@apple.com [Thu, 7 Apr 2016 21:55:26 +0000 (21:55 +0000)]
Attempted build fix.

* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.

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

4 years agoAdd WebKitAdditions extension point in HTMLVideoElement::supportsFullscreen()
adachan@apple.com [Thu, 7 Apr 2016 21:51:45 +0000 (21:51 +0000)]
Add WebKitAdditions extension point in HTMLVideoElement::supportsFullscreen()
https://bugs.webkit.org/show_bug.cgi?id=156366

Reviewed by Alex Christensen.

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen):

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

4 years agoAdd WOFF2 to the Feature Status page
jond@apple.com [Thu, 7 Apr 2016 21:39:57 +0000 (21:39 +0000)]
Add WOFF2 to the Feature Status page
https://bugs.webkit.org/show_bug.cgi?id=156361

Reviewed by Timothy Hatcher.

* features.json:

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

4 years agoWebPlaybackControlsManager should support mediaSelectionOptions
bdakin@apple.com [Thu, 7 Apr 2016 21:31:55 +0000 (21:31 +0000)]
WebPlaybackControlsManager should support mediaSelectionOptions
https://bugs.webkit.org/show_bug.cgi?id=156358
-and corresponding-
rdar://problem/25048743

Reviewed by Jer Noble.

This patch just implements
WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions and
WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions and passes that
information on to WebPlaybackControlsManager. If selection options are set via
the WebPlaybackControlsManager, then it gets the webVideoFullscreenModel() to
set the new value.

* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
(WebCore::mediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
(-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.

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

4 years agoTest expectation gardening for
ap@apple.com [Thu, 7 Apr 2016 21:26:16 +0000 (21:26 +0000)]
Test expectation gardening for
Assertion failure in MessagePort::contextDestroyed in http/tests/security/MessagePort/event-listener-context.html,
usually attributed to later tests
https://bugs.webkit.org/show_bug.cgi?id=94458

http/tests/security/MessagePort/event-listener-context.html is the only culprit,
so it should be skipped everywhere, and subsequent tests shouldn't be marked.

* TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

4 years agoInvalid assertion inside DebuggerScope::getOwnPropertySlot
sbarati@apple.com [Thu, 7 Apr 2016 21:25:21 +0000 (21:25 +0000)]
Invalid assertion inside DebuggerScope::getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=156357

Reviewed by Keith Miller.

The Type Profiler might profile JS code that uses DebuggerScope and accesses properties
on it. Therefore, it may have a DebuggerScope object in its log. Objects in the log
are subject to having their getOwnPropertySlot method called. Therefore, the DebuggerScope
might not always be in a valid state when its getOwnPropertySlot method is called.
Therefore, the assertion invalid.

* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::getOwnPropertySlot):

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

4 years agoWheel event callback removing the window causes crash in WebCore.
bfulgham@apple.com [Thu, 7 Apr 2016 21:15:34 +0000 (21:15 +0000)]
Wheel event callback removing the window causes crash in WebCore.
https://bugs.webkit.org/show_bug.cgi?id=150871
<rdar://problem/23418283>

Reviewed by Simon Fraser.

Source/WebCore:

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

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

Since the Frame destructor invokes EventHandler::clear, which invokes MainFrame methods,
we run the risk of attempting to dereference destroyed MainFrame elements of the current
Frame object. Instead, clear the EventHandler in the MainFrame destructor.

Finally, confirm that the mainFrame member is not being destroyed in the handful of
places that might attempt to access the mainFrame during object destruction (essentially
cleanup methods).

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

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear): Protect against accessing mainFrame content during destruction.
* page/EventHandler.cpp:
(WebCore::EventHandler::clear): Call 'clearLatchedState' instead of endFilteringDeltas.
(WebCore::EventHandler::clearLatchedState): Null-check the filter before calling it.
* page/Frame.cpp:
(WebCore::Frame::~Frame): Do not call 'setView' in the destructor for a MainFrame.
(WebCore::Frame::setView): Check for a null event handler before invoking it.
(WebCore::Frame::setMainFrameWasDestroyed): Added. Mark that the MainFrame
member of the Frame is being destroyed (if the current Frame is a MainFrame) and clear
the EventHandler member so that it doesn't attempt to access mainFrame content.
(WebCore::Frame::mainFrame): When accessing the mainFrame member, assert that the
mainFrame is not being destroyed.
* page/MainFrame.cpp:
(WebCore::MainFrame::~MainFrame): Set the m_recentWheelEventDeltaFilter to nullptr to
prevent attempts to access it during object destruction. Call the new 'setMainFrameWasDestroyed'
method to reset eventHandler and mark the MainFrame as being in the process of destruction.
* page/WheelEventDeltaFilter.cpp:
(WebCore::WheelEventDeltaFilter::filteredDelta): Add logging.
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::platformCompleteWheelEvent): Add null check.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo): Add logging.

LayoutTests:

* fast/events/wheel-event-destroys-frame-expected.txt: Added.
* fast/events/wheel-event-destroys-frame.html: Added.
* platform/ios-simulator/TestExpectations: Skip wheel-event test on iOS.

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

4 years agoAdding layout tests for the bot watcher's dashboard QUnit tests. https://bugs.webkit...
jmarcell@apple.com [Thu, 7 Apr 2016 21:08:40 +0000 (21:08 +0000)]
Adding layout tests for the bot watcher's dashboard QUnit tests. https://bugs.webkit.org/show_bug.cgi?id=155272

Reviewed by Daniel Bates.

Moved supporting resources into a resources folder and updated index.html accordingly
to point to the new locations. Added code to tests.js to dumpAsText when QUnit is done.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index-expected.txt: Added.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/index.html: Updated to point to tests.js and Mock files in resources directory.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueue.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueue.js.
(MockBuildbotQueue):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockBuildbotQueueView.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockBuildbotQueueView.js.
(MockBuildbotQueueView):
(MockBuildbotQueueView.prototype._latestProductiveIteration):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/MockTrac.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js.
(MockTrac):
(MockTrac.prototype.get oldestRecordedRevisionNumber):
(MockTrac.prototype.get latestRecordedRevisionNumber):
(MockTrac.prototype.loadMoreHistoricalData):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-git-trac-rss.xml: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-git-trac-rss.xml.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/test-fixture-trac-rss.xml: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/test-fixture-trac-rss.xml.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/resources/tests.js: Renamed from
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js.
Updated the unit tests for Trac._loaded() to point to the XML files that are now located in the 'resources' directory.
(QUnit.done): Added. Removes machine-specific output from test results and calls testRunner.notifyDone to let the layout test harness know that all testing is done.
* Scripts/run-dashboard-tests: Added.

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

4 years agoInitial implementation of annex b.3.3 behavior was incorrect
sbarati@apple.com [Thu, 7 Apr 2016 21:01:42 +0000 (21:01 +0000)]
Initial implementation of annex b.3.3 behavior was incorrect
https://bugs.webkit.org/show_bug.cgi?id=156276

Reviewed by Keith Miller.

Source/JavaScriptCore:

I almost got annex B.3.3 correct in my first implementation.
There is a subtlety here I got wrong. We always create a local binding for
a function at the very beginning of execution of a block scope. So we
hoist function declarations to their local binding within a given
block scope. When we actually evaluate the function declaration statement
itself, we must lookup the binding in the current scope, and bind the
value to the binding in the "var" scope. We perform the following
abstract operations when executing a function declaration statement.

f = lookupBindingInCurrentScope("func")
store(varScope, "func", f)

I got this wrong by performing the store to the var binding at the beginning
of the block scope instead of when we evaluate the function declaration statement.
This behavior is observable. For example, a program could change the value
of "func" before the actual function declaration statement executes.
Consider the following two functions:
```
function foo1() {
    // func === undefined
    {
        // typeof func === "function"
        function func() { } // Executing this statement binds the local "func" binding to the implicit "func" var binding.
        func = 20 // This sets the local "func" binding to 20.
    }
    // typeof func === "function"
}

function foo2() {
    // func === undefined
    {
        // typeof func === "function"
        func = 20 // This sets the local "func" binding to 20.
        function func() { } // Executing this statement binds the local "func" binding to the implicit "func" var binding.
    }
    // func === 20
}
```

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::initializeBlockScopedFunctions):
(JSC::BytecodeGenerator::hoistSloppyModeFunctionIfNecessary):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::emitNodeForLeftHandSide):
* bytecompiler/NodesCodegen.cpp:
(JSC::FuncDeclNode::emitBytecode):
* tests/stress/sloppy-mode-function-hoisting.js:
(test.foo):
(test):
(test.):
(test.bar):
(test.switch.case.0):
(test.capFoo1):
(test.switch.capFoo2):
(test.outer):
(foo):

LayoutTests:

* js/function-declarations-in-switch-statement-expected.txt:
* js/script-tests/function-declarations-in-switch-statement.js:

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

4 years agoWeb Inspector: Uncaught Exception: No resource with given URL found
commit-queue@webkit.org [Thu, 7 Apr 2016 21:00:40 +0000 (21:00 +0000)]
Web Inspector: Uncaught Exception: No resource with given URL found
https://bugs.webkit.org/show_bug.cgi?id=156259
<rdar://problem/25564749>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
SourceCode.prototype.requestContent will reject if it cannot load
content for the given resource. In that case, we already have an
earlier catch handler that displays an error message in the
ContentView, so we shouldn't show an Uncaught Exception page.
Really, we should not reject the original promise here, and
instead resolve it with an object describing the error, but
short term we should remove the uncaught exception handler for
this case.

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

4 years agoWeb Inspector: Take snapshot navigation button should match navigation button styles
commit-queue@webkit.org [Thu, 7 Apr 2016 20:59:27 +0000 (20:59 +0000)]
Web Inspector: Take snapshot navigation button should match navigation button styles
https://bugs.webkit.org/show_bug.cgi?id=156355
<rdar://problem/25325172>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-04-07
Reviewed by Timothy Hatcher.

* UserInterface/Images/Camera.svg: Added.
* UserInterface/Views/HeapAllocationsTimelineView.js:
(WebInspector.HeapAllocationsTimelineView):
Use the new image for the navigation bar button.

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

4 years agoBuild fix after r199170
achristensen@apple.com [Thu, 7 Apr 2016 20:38:03 +0000 (20:38 +0000)]
Build fix after r199170

* CMakeLists.txt:

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

4 years agoAdd WebKitAdditions extension points around preferences
adachan@apple.com [Thu, 7 Apr 2016 20:21:39 +0000 (20:21 +0000)]
Add WebKitAdditions extension points around preferences
https://bugs.webkit.org/show_bug.cgi?id=156303

Reviewed by Beth Dakin.

* Shared/WebPreferencesStore.cpp:
(WebKit::defaults):
* UIProcess/API/C/WKPreferences.cpp:

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

4 years agoRename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
adachan@apple.com [Thu, 7 Apr 2016 20:04:16 +0000 (20:04 +0000)]
Rename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
https://bugs.webkit.org/show_bug.cgi?id=156245

Reviewed by Eric Carlson.

Source/WebCore:

* Modules/mediacontrols/mediaControlsApple.css:
(::-webkit-media-controls):
Match iOS and specify overflow: hidden on the -webkit-media-controls container.
(video::-webkit-media-text-track-container):
Match iOS and specify z-index: 0 on the text track container.

* WebCore.xcodeproj/project.pbxproj:
TextTrackRepresentationiOS.h/mm have been renamed to TextTrackRepresentationCocoa.h/mm.

* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.h: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h.
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm.
(-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]):
(-[WebCoreTextTrackRepresentationCocoaHelper dealloc]):
(-[WebCoreTextTrackRepresentationCocoaHelper setParent:]):
(-[WebCoreTextTrackRepresentationCocoaHelper parent]):
(-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreTextTrackRepresentationCocoaHelper actionForLayer:forKey:]):
(TextTrackRepresentation::create):
(TextTrackRepresentationCocoa::TextTrackRepresentationCocoa):
(TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa):
(TextTrackRepresentationCocoa::update):
(TextTrackRepresentationCocoa::setContentScale):
(TextTrackRepresentationCocoa::bounds):

LayoutTests:

* platform/mac/TestExpectations:
Skip some tests with assertions after changes in MediaControlsApple.css.

* platform/mac/media/media-document-audio-repaint-expected.txt:
* platform/mac/media/video-zoom-controls-expected.txt:
Rebaseline some tests after changes in MediaControlsApple.css.

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

4 years agoImproved drop down menu with translate; cleaned up unnecessary whitespace.
jond@apple.com [Thu, 7 Apr 2016 19:57:07 +0000 (19:57 +0000)]
Improved drop down menu with translate; cleaned up unnecessary whitespace.
https://bugs.webkit.org/show_bug.cgi?id=156342

Reviewed by Timothy Hatcher.

* wp-content/themes/webkit/style.css:
(p > a[name]::before):
(.has-post-thumbnail .background-image):
(.table-of-contents):
(header .menu-item-has-children .label-toggle::after):
(.sub-menu-layer):
(.sub-menu-layer:after, .sub-menu-layer:before):
(.sub-menu-layer .menu-item):
(.menu > .menu-item > .menu-toggle:checked + .sub-menu):
(@media only screen and (max-width: 920px)):
(header .sub-menu-layer):
(@media only screen and (max-width: 415px)):
(@media only screen and (max-width: 1180px)): Deleted.
(@media only screen and (max-width: 1000px)): Deleted.
(@media only screen and (max-width: 690px)): Deleted.
(@media only screen and (max-width: 600px)): Deleted.
(@media only screen and (max-height: 415px)): Deleted.
(@media only screen and (max-width: 320px)): Deleted.

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

4 years agoCSP: Remove tests for unimplemented directive referrer
dbates@webkit.org [Thu, 7 Apr 2016 19:52:41 +0000 (19:52 +0000)]
CSP: Remove tests for unimplemented directive referrer
https://bugs.webkit.org/show_bug.cgi?id=156353

Reviewed by Andy Estes.

The Content Security Policy directive referrer was removed from the Content Security Policy Level 2 spec.,
<https://w3c.github.io/webappsec-csp/2/> (Editor's Draft, 29 August 2015). It was never implemented.
The functionality provided by this directive has been incorporated into its own meta tag and is covered
by the Referrer Policy spec., <https://w3c.github.io/webappsec-referrer-policy/>.

* http/tests/security/contentSecurityPolicy/1.1/referrer-always-http-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-http-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-http-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-http-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-https-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-https-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-https-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-always-https-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-http-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-http-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-http-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-http-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-https-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-https-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-https-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-default-https-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-http-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-http-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-http-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-http-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-https-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-https-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-https-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-empty-https-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-http-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-http-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-http-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-http-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-https-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-https-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-https-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-invalid-https-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-http-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-http-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-http-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-http-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-https-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-https-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-https-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-never-https-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-http-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-http-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-http-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-http-https.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-https-http-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-https-http.html: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-https-https-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/1.1/referrer-origin-https-https.html: Removed.
* http/tests/security/contentSecurityPolicy/resources/referrer-test-endpoint.php: Removed.
* http/tests/security/contentSecurityPolicy/resources/referrer-test.js: Removed.
* http/tests/security/contentSecurityPolicy/resources/referrer-test.php: Removed.

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

4 years agoUnreviewed follow-up fix to r199168. Add missing newline in expected output.
joepeck@webkit.org [Thu, 7 Apr 2016 19:47:27 +0000 (19:47 +0000)]
Unreviewed follow-up fix to r199168. Add missing newline in expected output.

* inspector/codemirror/resources/prettyprinting/javascript-tests/single-statement-blocks-expected.js:

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

4 years agoWe should support the ability to do a non-effectful getById
keith_miller@apple.com [Thu, 7 Apr 2016 19:38:00 +0000 (19:38 +0000)]
We should support the ability to do a non-effectful getById
https://bugs.webkit.org/show_bug.cgi?id=156116

Reviewed by Benjamin Poulain.

Currently, there is no way in JS to do a non-effectful getById. A non-effectful getById is
useful because it enables us to take different code paths based on values that we would
otherwise not be able to have knowledge of. This patch adds this new feature called
try_get_by_id that will attempt to do as much of a get_by_id as possible without performing
an effectful behavior. Thus, try_get_by_id will return the value if the slot is a value, the
GetterSetter object if the slot is a normal accessor (not a CustomGetterSetter) and
undefined if the slot is unset.  If the slot is proxied or any other cases then the result
is null. In theory, if we ever wanted to check for null we could add a sentinal object to
the global object that indicates we could not get the result.

In order to implement this feature we add a new enum GetByIdKind that indicates what to do
for accessor properties in PolymorphicAccess. If the GetByIdKind is pure then we treat the
get_by_id the same way we would for load and return the value at the appropriate offset.
Additionally, in order to make sure the we can properly compare the GetterSetter object
with === GetterSetters are now JSObjects. This comes at the cost of eight extra bytes on the
GetterSetter object but it vastly simplifies the patch. Additionally, the extra bytes are
likely to have little to no impact on memory usage as normal accessors are generally rare.

* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinExecutableCreator.cpp: Added.
(JSC::createBuiltinExecutable):
* builtins/BuiltinExecutableCreator.h: Copied from Source/JavaScriptCore/builtins/BuiltinExecutables.h.
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createDefaultConstructor):
(JSC::BuiltinExecutables::createBuiltinExecutable):
(JSC::createBuiltinExecutable):
(JSC::BuiltinExecutables::createExecutable):
(JSC::createExecutableInternal): Deleted.
* builtins/BuiltinExecutables.h:
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::tryGet):
(JSC::AccessCase::generate):
(WTF::printInternal):
* bytecode/PolymorphicAccess.h:
(JSC::AccessCase::isGet): Deleted.
(JSC::AccessCase::isPut): Deleted.
(JSC::AccessCase::isIn): Deleted.
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::reset):
* bytecode/StructureStubInfo.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitTryGetById):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_tryGetById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedGetById):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::getById):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITInlineCacheGenerator.cpp:
(JSC::JITGetByIdGenerator::JITGetByIdGenerator):
* jit/JITInlineCacheGenerator.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emitGetByValWithCachedId):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id):
* jit/Repatch.cpp:
(JSC::repatchByIdSelfAccess):
(JSC::appropriateOptimizingGetByIdFunction):
(JSC::appropriateGenericGetByIdFunction):
(JSC::tryCacheGetByID):
(JSC::repatchGetByID):
(JSC::resetGetByID):
* jit/Repatch.h:
* jsc.cpp:
(GlobalObject::finishCreation):
(functionGetGetterSetter):
(functionCreateBuiltin):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* runtime/GetterSetter.cpp:
* runtime/GetterSetter.h:
* runtime/JSType.h:
* runtime/PropertySlot.cpp:
(JSC::PropertySlot::getPureResult):
* runtime/PropertySlot.h:
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::getOwnPropertySlotCommon):
* tests/stress/try-get-by-id.js: Added.
(tryGetByIdText):
(getCaller.obj.1.throw.new.Error.let.func):
(getCaller.obj.1.throw.new.Error):
(throw.new.Error.get let):
(throw.new.Error.):
(throw.new.Error.let.get createBuiltin):
(get let):
(let.get createBuiltin):
(let.func):
(get let.func):
(get throw):

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

4 years agoWeb Inspector: Inspector hangs when trying to view a large XHR resource
joepeck@webkit.org [Thu, 7 Apr 2016 19:29:38 +0000 (19:29 +0000)]
Web Inspector: Inspector hangs when trying to view a large XHR resource
https://bugs.webkit.org/show_bug.cgi?id=144107
<rdar://problem/20669463>

Reviewed by NOBODY (OOPS!).

Previously auto formatting (initially pretty print source code) in TextEditor
was done synchronously in this order:

  (1) revealing the Editor as soon as we have content
  (2) set the CodeMirror value
  (3) pretty print with the CodeMirror editor
  (4) set the CodeMirror value
      => Layout

At the end, CodeMirror would layout once with the new content. This approach
performs very poorly when step (3) is an asynchronous action, because it would
mean CodeMirror would layout for both (2) and at the end (4) and the layout
itself can be very costly if the content is minified and so has very long
lines at the top of the file that need to be syntax highlighted and visible
since we do not wrap.

This patch changes the order of operations to benefit asynchronous formatting.
When SourceCodeTextEditor determines that it can autoformat it:

  (1) set the CodeMirror value
  (2) pretty print to source text
  (3) reveal the Editor when pretty printing is done
  (4) set the CodeMirror value
      => Layout

This maintains the fact that to undo pretty printing we can just "undo" the
editor to get the original text. This also means we only do a single
CodeMirror layout, with the pretty printed and therefore more manageable
source text for highlighting. It also means we continue to show a loading
indicator in the editor while we are pretty printing. If this is truely
done asynchronously, which is the case for JavaScript with FormatterWorker,
then the loading indicator will animate smoothly.

This sequence also works with the traditional synchronous formatters,
which we still have for CSS.

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.contentViewForRepresentedObject):
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.showDefaultContentViewForTreeElement):
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
BreakpointTreeElements can now be restored and reselected when its
source code is null. Avoid deleting the pending cookie data if a
ContentView was not shown for the resource. When the Breakpoint
and SourceCode get hooked up, this code will run again and work.

* UserInterface/Views/ScriptContentView.js:
(WebInspector.ScriptContentView.prototype._togglePrettyPrint):
* UserInterface/Views/TextResourceContentView.js:
(WebInspector.TextResourceContentView.prototype._togglePrettyPrint):
* UserInterface/Views/TextContentView.js:
(WebInspector.TextContentView.prototype._togglePrettyPrint):
New API for toggling formatting, now that it is an async operation.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor):
(WebInspector.SourceCodeTextEditor.prototype.toggleTypeAnnotations):
(WebInspector.SourceCodeTextEditor.prototype.prettyPrint):
(WebInspector.SourceCodeTextEditor.prototype._populateWithContent):
(WebInspector.SourceCodeTextEditor.prototype._proceedPopulateWithContent):
(WebInspector.SourceCodeTextEditor.prototype._prepareEditorForInitialContent):
(WebInspector.SourceCodeTextEditor.prototype._populateWithInlineScriptContent.scriptContentAvailable):
(WebInspector.SourceCodeTextEditor.prototype._populateWithInlineScriptContent):
(WebInspector.SourceCodeTextEditor.prototype._populateWithScriptContent):
(WebInspector.SourceCodeTextEditor.prototype.textEditorUpdatedFormatting):
(WebInspector.SourceCodeTextEditor.prototype._contentWillPopulate): Deleted.
Move auto formatting logic into SourceCodeTextEditor, because it
determines if content should be auto formatted, and it loads the
initial content so it can determine when to show the editor for
the first time.

When we get the initial content and determine we have to autoformat,
setup the TextEditor, but don't proceed with WillPopulate/DidPopulate
until after we have formatted text.

* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor):
(WebInspector.TextEditor.set string.update):
(WebInspector.TextEditor.prototype.set string):
(WebInspector.TextEditor.prototype.setFormatted):
(WebInspector.TextEditor.prototype.hasFormatter):
(WebInspector.TextEditor.prototype._format):
(WebInspector.TextEditor.prototype.prettyPrint):
(WebInspector.TextEditor.prototype._canUseFormatterWorker):
(WebInspector.TextEditor.prototype._startWorkerPrettyPrint):
(WebInspector.TextEditor.prototype._startCodeMirrorPrettyPrint):
(WebInspector.TextEditor.prototype._finishPrettyPrint):
(WebInspector.TextEditor.prototype._undoFormatting):
(WebInspector.TextEditor.prototype._updateAfterFormatting):
Break up the synchronous pretty printing code into multiple steps.
One path can be asynchronous formatting via FormatterWorker, another
path may be synchronous formatting using the CodeMirror formatters.

(WebInspector.TextEditor.prototype.set formatted): Deleted.
Remove the synchronous `set formatted` setter. Replace with setFormatted().

(WebInspector.TextEditor.prototype.set autoFormat): Deleted.
Remove the TextEditor's autoformat. Since formatting can be async, having
the TextEditor showing and asynchronously format its initial contents is
a recipe for poor performance causing multiple layouts of different content.
Instead, autoformatting is handled by SourceCodeTextEditor, and TextEditor
can then be shown when it has the right data.

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

4 years agoWeb Inspector: Improve JavaScript pretty printing
joepeck@webkit.org [Thu, 7 Apr 2016 19:29:32 +0000 (19:29 +0000)]
Web Inspector: Improve JavaScript pretty printing
https://bugs.webkit.org/show_bug.cgi?id=156178
<rdar://problem/25535719>

Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

Add a new EsprimaFormatter which pretty prints JavaScript source text
using the Esprima AST and Tokens. Currently we use CodeMirror's
tokenizer for pretty printing. By moving to Esprima for pretty
printing we get a few advantages: (1) can be used within a Worker
as there are no dependencies on DOM objects, (2) a full featured AST
gives more context to handling individual tokens. One disadvantage
is that Esprima requires valid input, so scripts with syntax errors
will not work.

EsprimaFormatter works by:
- Getting the Esprima AST and token stream.
- Walk all AST nodes:
  - when entering an AST node, handle any tokens before the start of this node
  - when leaving an AST node, handle any tokens that were inside the node
- Whenever we handle a new node or token check if we should preserve any
  newlines or comments that do not show up in the AST or token stream.

This allows us to handle any token based on its context. Currently the
formatter prefers to operate on tokens based on their context. So the
formatter has a case for each AST node type and handles the tokens
within that AST node. A small exception is made to special case the
handling of semicolons.

* Scripts/copy-user-interface-resources-dryrun.rb:
Add a generic check for -h, -help, --help to print usage.

* Tools/Formatting/EsprimaFormatterDebug.js: Added.
(EsprimaFormatterDebug):
(EsprimaFormatterDebug.prototype.get debugText):
(EsprimaFormatterDebug.prototype._pad):
(EsprimaFormatterDebug.prototype._debugHeader):
(EsprimaFormatterDebug.prototype._debugFooter):
(EsprimaFormatterDebug.prototype._debug):
(EsprimaFormatterDebug.prototype._debugComments):
(EsprimaFormatterDebug.prototype._debugAfterProgramNode):
(EsprimaFormatterDebug.prototype._before):
(EsprimaFormatterDebug.prototype._after):
* Tools/Formatting/codemirror-additions.css: Copied from Source/WebInspectorUI/Tools/PrettyPrinting/codemirror-additions.css.
* Tools/Formatting/index.html: Added.
* Tools/PrettyPrinting/codemirror-additions.css:
(pre): Deleted.
(a.download): Deleted.
* Tools/PrettyPrinting/index.html:
* Tools/PrettyPrinting/populate/jquery.min.js: Removed.
Add a Formatter tool that is similiar to the PrettyPrinting tool but
outputs debug information for Esprima tokens. This is useful for
iterating on tests, performance measurements, and general debugging
of token stream for any input.

* UserInterface/Controllers/FormatterSourceMap.js:
(WebInspector.FormatterSourceMap.fromSourceMapData):
(WebInspector.FormatterSourceMap.fromBuilder): Deleted.
Switch to constructing with a common data objects, instead of a Builder.

* UserInterface/Main.html:
* UserInterface/Test.html:
New files and moved files.

* UserInterface/Proxies/FormatterWorkerProxy.js: Added.
(WebInspector.FormatterWorkerProxy):
(WebInspector.FormatterWorkerProxy.singleton):
(WebInspector.FormatterWorkerProxy.canFormat):
(WebInspector.FormatterWorkerProxy.prototype.formatJavaScript):
(WebInspector.FormatterWorkerProxy.prototype.performAction):
(WebInspector.FormatterWorkerProxy.prototype._postMessage):
(WebInspector.FormatterWorkerProxy.prototype._handleMessage):
Main world object which provides a static formatJavaScript action.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor.prototype._formattedContentFromEditor):
* UserInterface/Views/TextEditor.js:
(WebInspector.TextEditor.prototype.prettyPrint.prettyPrintAndUpdateEditor):
(WebInspector.TextEditor.prototype.prettyPrint):
* UserInterface/Workers/Formatter/FormatterContentBuilder.js: Renamed from Source/WebInspectorUI/UserInterface/Controllers/FormatterContentBuilder.js.
(FormatterContentBuilder):
Simplify construction of a Builder. The constructor objects were always
the same and often unnecessary. Also move out of the WebInspector
namespace signifying it can be used within a Worker.

(FormatterContentBuilder.prototype.get originalContent): Deleted.
(FormatterContentBuilder.prototype.get formattedContent): Deleted.
(FormatterContentBuilder.prototype.get sourceMapData): Added.
Simplify getting all the data needed for SourceMaps.

(FormatterContentBuilder.prototype.setOriginalLineEndings):
A client may wish to pre-fill line endings instead of filling
while building.

(FormatterContentBuilder.prototype.appendNewline):
Auto-clear trailing whitespace on the previous line.

* UserInterface/Workers/Formatter/ESTreeWalker.js: Added.
(ESTreeWalker):
(ESTreeWalker.prototype.walk):
(ESTreeWalker.prototype._walk):
(ESTreeWalker.prototype._walkArray):
(ESTreeWalker.prototype._walkChildren):
Walk AST nodes in an ESTree format. Due to the spec's incompleteness
this is essentially Esprima's ESTree.

* UserInterface/Workers/Formatter/EsprimaFormatter.js: Added.
(EsprimaFormatter):
(EsprimaFormatter.isWhitespace):
(EsprimaFormatter.prototype.get formattedText):
(EsprimaFormatter.prototype.get sourceMapData):
(EsprimaFormatter.prototype._insertNewlinesBeforeToken):
(EsprimaFormatter.prototype._insertComment):
(EsprimaFormatter.prototype._insertSameLineTrailingComments):
(EsprimaFormatter.prototype._insertCommentsAndNewlines):
(EsprimaFormatter.prototype._before):
(EsprimaFormatter.prototype._after):
(EsprimaFormatter.prototype._isInForHeader):
(EsprimaFormatter.prototype._isRangeWhitespace):
(EsprimaFormatter.prototype._handleTokenAtNode):
(EsprimaFormatter.prototype._exitNode):
(EsprimaFormatter.prototype._afterProgram):
Pretty print source text.

* UserInterface/Workers/Formatter/FormatterUtilities.js: Added.
(Array.prototype.lastValue):
(String.prototype.lineEndings):
(isECMAScriptWhitespace):
(isECMAScriptLineTerminator):
Helpers used by the classes in the Worker code.

* UserInterface/Workers/Formatter/FormatterWorker.js: Added.
(FormatterWorker):
(FormatterWorker.prototype.formatJavaScript):
(FormatterWorker.prototype._handleMessage):
Handle the formatJavaScript action.

LayoutTests:

Expand the JavaScript formatting tests.

* inspector/codemirror/resources/prettyprinting/javascript-tests/single-statement-blocks-expected.js:
Update output now that the builder removes extra trailing whitespace automatically.

* inspector/codemirror/resources/prettyprinting/utilities.js:
Update due to simplified construction.

* inspector/formatting/formatting-javascript-expected.txt: Added.
* inspector/formatting/formatting-javascript.html: Added.
* inspector/formatting/resources/javascript-tests/arrow-functions-expected.js: Added.
* inspector/formatting/resources/javascript-tests/arrow-functions.js: Added.
* inspector/formatting/resources/javascript-tests/classes-expected.js: Added.
* inspector/formatting/resources/javascript-tests/classes.js: Added.
* inspector/formatting/resources/javascript-tests/comments-and-preserve-newlines-expected.js: Added.
* inspector/formatting/resources/javascript-tests/comments-and-preserve-newlines.js: Added.
* inspector/formatting/resources/javascript-tests/comments-only-expected.js: Added.
* inspector/formatting/resources/javascript-tests/comments-only.js: Added.
* inspector/formatting/resources/javascript-tests/do-while-statement-expected.js: Added.
* inspector/formatting/resources/javascript-tests/do-while-statement.js: Added.
* inspector/formatting/resources/javascript-tests/for-statements-expected.js: Added.
* inspector/formatting/resources/javascript-tests/for-statements.js: Added.
* inspector/formatting/resources/javascript-tests/functions-expected.js: Added.
* inspector/formatting/resources/javascript-tests/functions.js: Added.
* inspector/formatting/resources/javascript-tests/generators-expected.js: Added.
* inspector/formatting/resources/javascript-tests/generators.js: Added.
* inspector/formatting/resources/javascript-tests/if-statement-expected.js: Added.
* inspector/formatting/resources/javascript-tests/if-statement.js: Added.
* inspector/formatting/resources/javascript-tests/label-break-continue-block-expected.js: Added.
* inspector/formatting/resources/javascript-tests/label-break-continue-block.js: Added.
* inspector/formatting/resources/javascript-tests/logic-expressions-expected.js: Added.
* inspector/formatting/resources/javascript-tests/logic-expressions.js: Added.
* inspector/formatting/resources/javascript-tests/new-expression-expected.js: Added.
* inspector/formatting/resources/javascript-tests/new-expression.js: Added.
* inspector/formatting/resources/javascript-tests/object-array-literal-expected.js: Added.
* inspector/formatting/resources/javascript-tests/object-array-literal.js: Added.
* inspector/formatting/resources/javascript-tests/return-statement-expected.js: Added.
* inspector/formatting/resources/javascript-tests/return-statement.js: Added.
* inspector/formatting/resources/javascript-tests/sample-jquery-expected.js: Added.
* inspector/formatting/resources/javascript-tests/sample-jquery.js: Added.
* inspector/formatting/resources/javascript-tests/sample-normal-utilities-expected.js: Added.
* inspector/formatting/resources/javascript-tests/sample-normal-utilities.js: Added.
* inspector/formatting/resources/javascript-tests/sample-webinspector-object-expected.js: Added.
* inspector/formatting/resources/javascript-tests/sample-webinspector-object.js: Added.
* inspector/formatting/resources/javascript-tests/switch-case-default-expected.js: Added.
* inspector/formatting/resources/javascript-tests/switch-case-default.js: Added.
* inspector/formatting/resources/javascript-tests/ternary-expressions-expected.js: Added.
* inspector/formatting/resources/javascript-tests/ternary-expressions.js: Added.
* inspector/formatting/resources/javascript-tests/throw-statement-expected.js: Added.
* inspector/formatting/resources/javascript-tests/throw-statement.js: Added.
* inspector/formatting/resources/javascript-tests/try-catch-finally-statements-expected.js: Added.
* inspector/formatting/resources/javascript-tests/try-catch-finally-statements.js: Added.
* inspector/formatting/resources/javascript-tests/unary-binary-expressions-expected.js: Added.
* inspector/formatting/resources/javascript-tests/unary-binary-expressions.js: Added.
* inspector/formatting/resources/javascript-tests/variable-declaration-expected.js: Added.
* inspector/formatting/resources/javascript-tests/variable-declaration.js: Added.
* inspector/formatting/resources/javascript-tests/while-statement-expected.js: Added.
* inspector/formatting/resources/javascript-tests/while-statement.js: Added.
* inspector/formatting/resources/javascript-tests/with-statement-expected.js: Added.
* inspector/formatting/resources/javascript-tests/with-statement.js: Added.
* inspector/formatting/resources/utilities.js: Added.
Expanded test coverage for the new formatter.

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

4 years agoCookieJar should support adding synthetic cookies for developer tools
bburg@apple.com [Thu, 7 Apr 2016 19:00:53 +0000 (19:00 +0000)]
CookieJar should support adding synthetic cookies for developer tools
https://bugs.webkit.org/show_bug.cgi?id=156091
<rdar://problem/25581340>

Reviewed by Timothy Hatcher.

Source/WebCore:

This patch adds an API that can set an arbitrary cookie in cookie storage
in order to support developer tools and automated testing. It delegates storing
the cookie to a platform implementation.

No new tests because the code isn't used by any clients yet.

* loader/CookieJar.cpp:
(WebCore::addCookie): Added.
* loader/CookieJar.h:

* platform/Cookie.h:
Remove an outdated comment. This struct is used in many places.

* platform/CookiesStrategy.h: Add new method.
* platform/network/PlatformCookieJar.h: Add new method.
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::addCookie): Add a stub.
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::addCookie): Add a stub.
* platform/network/mac/CookieJarMac.mm:
(WebCore::addCookie): Add an implementation that turns the WebCore::Cookie into
an NSHTTPCookie and converts it again to CFHTTPCookie if necessary.

* platform/network/soup/CookieJarSoup.cpp:
(WebCore::addCookie): Add a stub.

* platform/spi/cf/CFNetworkSPI.h:
Add -[NSHTTPCookie _CFHTTPCookie] SPI.

Source/WebKit/mac:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::addCookie):
Add new method override.

Source/WebKit/win:

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.cpp:
Add new method override.

Source/WebKit2:

Plumb the new method through the strategy and out to the network process.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::addCookie):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::addCookie):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h:

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

4 years agoRationalize the makeSpaceForCCall stuff
fpizlo@apple.com [Thu, 7 Apr 2016 18:38:15 +0000 (18:38 +0000)]
Rationalize the makeSpaceForCCall stuff
https://bugs.webkit.org/show_bug.cgi?id=156352

Reviewed by Mark Lam.

I want to add more code to PolymorphicAccess that makes C calls, so that I can finally fix
https://bugs.webkit.org/show_bug.cgi?id=130914 (allow transition caches to handle indexing
headers).

When trying to understand what it takes to make a C call, I came across code that was making
room on the stack for spilled arguments. This logic was guarded with some complicated
condition. At first, I tried to just refactor the code so that the same ugly condition
wouldn't have to be copy-pasted everywhere that we made C calls. But then I started thinking
about the condition, and realized that it was probably wrong: if the outer PolymorphicAccess
harness decides to reuse a register for the scratchGPR then the top of the stack will store
the old value of scratchGPR, but the condition wouldn't necessarily trigger. So if the call
then overwrote something on the stack, we'd have a bad time.

Making room on the stack for a call is a cheap operation. It's orders of magnitude cheaper
than the rest of the call. Therefore, I think that it's best to just unconditionally make
room on the stack.

This patch makes us do just that. I also made the relevant helpers not inline, because I
think that we have too many inline methods in our assemblers. Now it's much easier to make
C calls from PolymorphicAccess because you just call the AssemblyHelper methods for making
space. There are no special conditions or anything like that.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generate):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitLoadStructure):
(JSC::AssemblyHelpers::makeSpaceOnStackForCCall):
(JSC::AssemblyHelpers::reclaimSpaceOnStackForCCall):
(JSC::emitRandomThunkImpl):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::makeSpaceOnStackForCCall): Deleted.
(JSC::AssemblyHelpers::reclaimSpaceOnStackForCCall): Deleted.

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

4 years agoMarking storage/indexeddb/modern/autoincrement-abort-private.html as flaky on Macs
jiewen_tan@apple.com [Thu, 7 Apr 2016 18:22:03 +0000 (18:22 +0000)]
Marking storage/indexeddb/modern/autoincrement-abort-private.html as flaky on Macs
https://bugs.webkit.org/show_bug.cgi?id=156351

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

4 years agoUnreviewed, rolling out r199128 and r199141.
commit-queue@webkit.org [Thu, 7 Apr 2016 18:06:42 +0000 (18:06 +0000)]
Unreviewed, rolling out r199128 and r199141.
https://bugs.webkit.org/show_bug.cgi?id=156348

Causes crashes on multiple webpages (Requested by keith_mi_ on
#webkit).

Reverted changesets:

"[ES6] Add support for Symbol.isConcatSpreadable."
https://bugs.webkit.org/show_bug.cgi?id=155351
http://trac.webkit.org/changeset/199128

"Unreviewed, uncomment accidentally commented line in test."
http://trac.webkit.org/changeset/199141

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

4 years agoCSP: Should only honor CSP policy delivered in meta tag that is a descendent of ...
dbates@webkit.org [Thu, 7 Apr 2016 18:03:04 +0000 (18:03 +0000)]
CSP: Should only honor CSP policy delivered in meta tag that is a descendent of <head>
https://bugs.webkit.org/show_bug.cgi?id=59858
<rdar://problem/25603538>

Reviewed by Brent Fulgham.

Source/WebCore:

Ignore the Content Security Policy meta tag if it is not a descendent of <head> as per
section HTML meta Element of the Content Security Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/>
(Editor's Draft, 29 August 2015).

Tests: http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head.html
       http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head2.html
       http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head.html
       http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head2.html

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Modified to take a boolean argument whether the http-equiv
meta tag is a descendent of <head> and to parse the value of a Content Security Policy http-equiv
only if the http-equiv meta tag is a descendent of <head>.
* dom/Document.h: Add parameter isInDocument to processHttpEquiv(). Remove javadoc-style parameters
from processHttpEquiv() comment as we do not document parameters for non-API functions using such style.
Also write the comment for processHttpEquiv() using C++ style comments instead of a C-style comment.
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process): Pass whether this element is a descendent of <head>. Additionally
update stale comment and move it closer to the code it refers to.

LayoutTests:

Add tests to ensure that we ignore the meta tags for Content-Security-Policy, Content-Security-Policy-Report-Only,
X-WebKit-CSP, and X-WebKit-CSP-Report-Only if it is not a descendent of <head>.

* http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head.html: Added.
* http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head2.html: Added.
* http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head.html: Added.
* http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head2-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head2.html: Added.

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

4 years agoRationalize the handling of PutById transitions a bit
fpizlo@apple.com [Thu, 7 Apr 2016 17:59:24 +0000 (17:59 +0000)]
Rationalize the handling of PutById transitions a bit
https://bugs.webkit.org/show_bug.cgi?id=156330

Reviewed by Mark Lam.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generate): Get rid of the specialized slow calls. We can just use the failAndIgnore jump target. We just need to make sure that we don't make observable effects until we're done with all of the fast path checks.
* bytecode/StructureStubInfo.cpp:
(JSC::StructureStubInfo::addAccessCase): MadeNoChanges indicates that we should keep trying to repatch. Currently PutById transitions might trigger the case that addAccessCase() sees null, if the transition involves an indexing header. Doing repatching in that case is probably not good. But, we should just fix this the right way eventually.

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

4 years ago[Win] Output WebCore.pdb to the same location as WebCore.lib
bfulgham@apple.com [Thu, 7 Apr 2016 17:40:48 +0000 (17:40 +0000)]
[Win] Output WebCore.pdb to the same location as WebCore.lib
https://bugs.webkit.org/show_bug.cgi?id=156256
<rdar://problem/19416363>

Reviewed by Alex Christensen.

Add a rule to WebCore's CMake generator to tell Visual Studio to output
the PDB file for the WebCore.lib in the same location as the resulting
library, rather than in the build intermediary location).

* CMakeLists.txt:

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

4 years ago[Win] Fix for JSC stress test failures.
peavo@outlook.com [Thu, 7 Apr 2016 17:31:06 +0000 (17:31 +0000)]
[Win] Fix for JSC stress test failures.
https://bugs.webkit.org/show_bug.cgi?id=156343

Reviewed by Filip Pizlo.

We need to make it clear to MSVC that the method loadPtr(ImplicitAddress address, RegisterID dest)
should be used, and not loadPtr(const void* address, RegisterID dest).

* jit/CCallHelpers.cpp:
(JSC::CCallHelpers::setupShadowChickenPacket):

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

4 years agowindow.Crypto is missing
weinig@apple.com [Thu, 7 Apr 2016 17:12:26 +0000 (17:12 +0000)]
window.Crypto is missing
<rdar://problem/25584034>
https://bugs.webkit.org/show_bug.cgi?id=156307

Reviewed by Joseph Pecoraro.

Source/WebCore:

Expose the Crypto constructor on the window object.

* page/Crypto.idl:

LayoutTests:

* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:
Update for the new Crypto constructor.

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

4 years ago[CMake][Win] Generating autoversion.h of WebKitGUID is triggered again and again
commit-queue@webkit.org [Thu, 7 Apr 2016 16:37:42 +0000 (16:37 +0000)]
[CMake][Win] Generating autoversion.h of WebKitGUID is triggered again and again
https://bugs.webkit.org/show_bug.cgi?id=156332

Patch by Fujii Hironori <Hironori.Fujii@jp.sony.com> on 2016-04-07
Reviewed by Brent Fulgham.

* PlatformWin.cmake:
Correct the output path of autoversion.h.

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

4 years ago[CMake][Win] WEBKIT_WRAP_SOURCELIST is not applied in WebCore project
commit-queue@webkit.org [Thu, 7 Apr 2016 16:27:28 +0000 (16:27 +0000)]
[CMake][Win] WEBKIT_WRAP_SOURCELIST is not applied in WebCore project
https://bugs.webkit.org/show_bug.cgi?id=156336

Patch by Fujii Hironori <Hironori.Fujii@jp.sony.com> on 2016-04-07
Reviewed by Csaba Osztrogon√°c.

* CMakeLists.txt: Do WEBKIT_WRAP_SOURCELIST for WebCore_SOURCES.

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

4 years agoREGRESSION (197987): Ingredient lists on smittenkitchen.com are full justified instea...
zalan@apple.com [Thu, 7 Apr 2016 14:55:54 +0000 (14:55 +0000)]
REGRESSION (197987): Ingredient lists on smittenkitchen.com are full justified instead of left justified.
https://bugs.webkit.org/show_bug.cgi?id=156326
<rdar://problem/25519393>

Reviewed by Antti Koivisto.

According to the spec (https://drafts.csswg.org/css-text-3/#text-align-property)
unless otherwise specified by text-align-last, the last line before
a forced break or the end of the block is start-aligned.

In this patch we check if a forced break is present and we apply text alignment accordingly.

Test: fast/css3-text/css3-text-justify/text-justify-last-line-simple-line-layout.html

Source/WebCore:

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::lastFragment): Make it optional so that we don't just check against a default fragment.
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::justifyRuns): Do not compute first run index on the current line twice.
(WebCore::SimpleLineLayout::textAlignForLine):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):

LayoutTests:

* fast/css3-text/css3-text-justify/text-justify-last-line-simple-line-layout-expected.html: Added.
* fast/css3-text/css3-text-justify/text-justify-last-line-simple-line-layout.html: Added.

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

4 years agoFrameView::qualifiesAsVisuallyNonEmpty() returns false when loading a Google search...
antti@apple.com [Thu, 7 Apr 2016 14:22:11 +0000 (14:22 +0000)]
FrameView::qualifiesAsVisuallyNonEmpty() returns false when loading a Google search results page before search results are loaded, even though the header is visible
https://bugs.webkit.org/show_bug.cgi?id=156339
<rdar://problem/24491381>

Reviewed by Andreas Kling.

Jeff's testing indicates lowering the document height threshold improves things visually during page loading.

* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty):

    Lower document height threshold to from 200 to 48 pixels.

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

4 years agoShadow DOM: Implement display: contents for slots
antti@apple.com [Thu, 7 Apr 2016 10:29:15 +0000 (10:29 +0000)]
Shadow DOM: Implement display: contents for slots
https://bugs.webkit.org/show_bug.cgi?id=149439
<rdar://problem/22731922>

Reviewed by Ryosuke Niwa.

Source/WebCore:

This patch adds support for value 'contents' of the 'display' property for <slot> elements only. The value is ignored
for other elements for now. With this display value the element does not generate a box for itself but its descendants
generate them normally.

Slots already have implicit "display: contents". With this patch the value comes from the user agent stylesheet and can
be overriden by the author.

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:

    Suport parsing display: contents.

* css/StyleResolver.cpp:
(WebCore::equivalentBlockDisplay):
(WebCore::StyleResolver::adjustRenderStyle):

    Disallow for non-slots for now.

* css/html.css:
(slot):

    Add "slot { display: contents }" to the UA sheet.

* dom/Element.cpp:
(WebCore::Element::resolveStyle):
(WebCore::Element::hasDisplayContents):
(WebCore::Element::setHasDisplayContents):

    Add a rare data bit for elements with display:contents (as we don't save the RenderStyle for them).

(WebCore::Element::rendererIsNeeded):

    Don't need renderer for display:contents.

(WebCore::Element::createElementRenderer):
* dom/Element.h:
(WebCore::Element::isVisibleInViewportChanged):
* dom/ElementAndTextDescendantIterator.h:
(WebCore::ElementAndTextDescendantIterator::operator!):
(WebCore::ElementAndTextDescendantIterator::operator bool):
(WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
(WebCore::ElementAndTextDescendantIterator::operator==):
(WebCore::ElementAndTextDescendantIterator::operator!=):

    Support initializing ElementAndTextDescendantIterator with root==current so that m_current is not nulled.
    This is needed for ComposedTreeIterator to be initialized correctly when root is a slot and the current node
    is a slotted node. The case happens in RenderTreePosition::previousSiblingRenderer when slot display is overriden
    to something else than 'contents'.

* dom/ElementRareData.h:
(WebCore::ElementRareData::hasDisplayContents):
(WebCore::ElementRareData::setHasDisplayContents):
(WebCore::ElementRareData::ElementRareData):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/style/RenderStyleConstants.h:
* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::nextSiblingRenderer):

    Test for dynamic display:contents.

* style/RenderTreeUpdater.cpp:
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::updateElementRenderer):

    Test for dynamic display:contents.

* style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):

    No need for special case.

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

    Test for dynamic display:contents.

LayoutTests:

* platform/mac/TestExpectations:

Enable fast/shadow-dom/css-scoping-shadow-slot-display-override.html, the test for overriding slot display value.

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

4 years ago[css-grid] Content box incorrectly used as non-auto min-height
svillar@igalia.com [Thu, 7 Apr 2016 10:23:53 +0000 (10:23 +0000)]
[css-grid] Content box incorrectly used as non-auto min-height
https://bugs.webkit.org/show_bug.cgi?id=155946

Reviewed by Antti Koivisto.

Source/WebCore:

When computing the minimum height value of grid items with
non-auto min-height we used to return the size of the content
box meaning that borders and paddings were incorrectly
ignored.

Note that we're also ignoring margins, but as that is a
problem also for widths it'll be fixed in a follow up patch.

Test: fast/css-grid-layout/min-height-border-box.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::minSizeForChild):

LayoutTests:

* fast/css-grid-layout/min-height-border-box-expected.txt: Added.
* fast/css-grid-layout/min-height-border-box.html: Added.

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

4 years agoReverting previous due to bad LayoutTest ChangeLog.
antti@apple.com [Thu, 7 Apr 2016 10:21:25 +0000 (10:21 +0000)]
Reverting previous due to bad LayoutTest ChangeLog.
LayoutTests:

* platform/mac/TestExpectations:

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

4 years agoSource/WebCore:
antti@apple.com [Thu, 7 Apr 2016 10:11:39 +0000 (10:11 +0000)]
Source/WebCore:
Shadow DOM: Implement display: contents for slots
https://bugs.webkit.org/show_bug.cgi?id=149439
<rdar://problem/22731922>

Reviewed by Ryosuke Niwa.

This patch adds support for value 'contents' of the 'display' property for <slot> elements only. The value is ignored
for other elements for now. With this display value the element does not generate a box for itself but its descendants
generate them normally.

Slots already have implicit "display: contents". With this patch the value comes from the user agent stylesheet and can
be overriden by the author.

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
* css/CSSValueKeywords.in:

    Suport parsing display: contents.

* css/StyleResolver.cpp:
(WebCore::equivalentBlockDisplay):
(WebCore::StyleResolver::adjustRenderStyle):

    Disallow for non-slots for now.

* css/html.css:
(slot):

    Add "slot { display: contents }" to the UA sheet.

* dom/Element.cpp:
(WebCore::Element::resolveStyle):
(WebCore::Element::hasDisplayContents):
(WebCore::Element::setHasDisplayContents):

    Add a rare data bit for elements with display:contents (as we don't save the RenderStyle for them).

(WebCore::Element::rendererIsNeeded):

    Don't need renderer for display:contents.

(WebCore::Element::createElementRenderer):
* dom/Element.h:
(WebCore::Element::isVisibleInViewportChanged):
* dom/ElementAndTextDescendantIterator.h:
(WebCore::ElementAndTextDescendantIterator::operator!):
(WebCore::ElementAndTextDescendantIterator::operator bool):
(WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
(WebCore::ElementAndTextDescendantIterator::operator==):
(WebCore::ElementAndTextDescendantIterator::operator!=):

    Support initializing ElementAndTextDescendantIterator with root==current so that m_current is not nulled.
    This is needed for ComposedTreeIterator to be initialized correctly when root is a slot and the current node
    is a slotted node. The case happens in RenderTreePosition::previousSiblingRenderer when slot display is overriden
    to something else than 'contents'.

* dom/ElementRareData.h:
(WebCore::ElementRareData::hasDisplayContents):
(WebCore::ElementRareData::setHasDisplayContents):
(WebCore::ElementRareData::ElementRareData):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/style/RenderStyleConstants.h:
* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::nextSiblingRenderer):

    Test for dynamic display:contents.

* style/RenderTreeUpdater.cpp:
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::updateElementRenderer):

    Test for dynamic display:contents.

* style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):

    No need for special case.

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

    Test for dynamic display:contents.

LayoutTests:
REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
https://bugs.webkit.org/show_bug.cgi?id=156241
<rdar://problem/25262213>

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2016-04-06
Reviewed by Simon Fraser.

* fast/text/zero-sized-fonts-expected.txt: Added.
* fast/text/zero-sized-fonts.html: Added.

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