WebKit-https.git
5 years agoRemove [ Debug ] qualifiers from expectations for some imported Blink test,
ap@apple.com [Sat, 17 Oct 2015 05:20:48 +0000 (05:20 +0000)]
Remove [ Debug ] qualifiers from expectations for some imported Blink test,
as they sometimes fail in release too.

* platform/mac-wk2/TestExpectations:

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

5 years ago[EFL, AppleWin] WTF.ConcatenateCharacterArrayAndEmptyString API test failed
akling@apple.com [Sat, 17 Oct 2015 04:48:50 +0000 (04:48 +0000)]
[EFL, AppleWin] WTF.ConcatenateCharacterArrayAndEmptyString API test failed
<https://webkit.org/b/150153>

Unreviewed.

Just use simple arrays of LChar and UChar for this test instead of creating String
objects and then getting the characters8()/characters16() from them, since that
doesn't guarantee null-termination (the bug.)

* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
(TestWebKitAPI::TEST):
(TestWebKitAPI::build): Deleted.

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

5 years ago[ES6] Implement String.prototype.normalize
utatane.tea@gmail.com [Sat, 17 Oct 2015 04:37:16 +0000 (04:37 +0000)]
[ES6] Implement String.prototype.normalize
https://bugs.webkit.org/show_bug.cgi?id=150094

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements String.prototype.normalize leveraging ICU.
It can provide the feature applying {NFC, NFD, NFKC, NFKD} normalization to a given string.

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::normalize):
(JSC::stringProtoFuncNormalize):
* tests/es6.yaml:
* tests/stress/string-normalize.js: Added.
(unicode):
(shouldBe):
(shouldThrow):
(normalizeTest):

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

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

5 years agoRenderBlockFlow::*logical*ForFloat should take FloatingObject reference.
zalan@apple.com [Sat, 17 Oct 2015 03:36:56 +0000 (03:36 +0000)]
RenderBlockFlow::*logical*ForFloat should take FloatingObject reference.
https://bugs.webkit.org/show_bug.cgi?id=150266

Reviewed by Simon Fraser.

No change in behaviour.

* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForFloatLayoutAdapter<FloatTypeValue>::heightRemaining):
(WebCore::ComputeFloatOffsetAdapter<FloatTypeValue>::collectIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::repaintOverhangingFloats):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::removeFloatingObject):
(WebCore::RenderBlockFlow::removeFloatingObjectsBelow):
(WebCore::RenderBlockFlow::computeLogicalLocationForFloat):
(WebCore::RenderBlockFlow::positionNewFloats):
(WebCore::RenderBlockFlow::lowestFloatLogicalBottom):
(WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::hasOverhangingFloat):
(WebCore::RenderBlockFlow::addIntrudingFloats):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::logicalTopForFloat):
(WebCore::RenderBlockFlow::logicalBottomForFloat):
(WebCore::RenderBlockFlow::logicalLeftForFloat):
(WebCore::RenderBlockFlow::logicalRightForFloat):
(WebCore::RenderBlockFlow::logicalWidthForFloat):
(WebCore::RenderBlockFlow::logicalHeightForFloat):
(WebCore::RenderBlockFlow::setLogicalTopForFloat):
(WebCore::RenderBlockFlow::setLogicalLeftForFloat):
(WebCore::RenderBlockFlow::setLogicalHeightForFloat):
(WebCore::RenderBlockFlow::setLogicalWidthForFloat):
(WebCore::RenderBlockFlow::logicalSizeForFloat): Deleted.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::checkPaginationAndFloatsAtEndLine):
(WebCore::RenderBlockFlow::positionNewFloatOnLine):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::addOverflowFromChild):
* rendering/RenderBox.h:
(WebCore::RenderBox::addOverflowFromChild):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleFloat):
* rendering/line/LineWidth.cpp:
(WebCore::newFloatShrinksLine):
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):

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

5 years agoAvoid to insert TAB before HTML element.
commit-queue@webkit.org [Sat, 17 Oct 2015 02:15:20 +0000 (02:15 +0000)]
Avoid to insert TAB before HTML element.
https://bugs.webkit.org/show_bug.cgi?id=149295
<rdar://problem/22746706>

Patch by Jiewen Tan <jiewen_tan@apple.com> on 2015-10-16
Reviewed by Ryosuke Niwa.

Source/WebCore:

This is a merge of Blink r175047:
https://codereview.chromium.org/306583005

This patch avoids InsertTextCommand::insertTab before HTML element because
we can't set Text node as document element.

Test: editing/execCommand/insert-tab-to-html-element-crash.html

* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::insertTab):

LayoutTests:

* editing/execCommand/insert-tab-to-html-element-crash-expected.txt: Added.
* editing/execCommand/insert-tab-to-html-element-crash.html: Added.

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

5 years agoUpdate JavaScriptCore API docs
ggaren@apple.com [Fri, 16 Oct 2015 23:57:35 +0000 (23:57 +0000)]
Update JavaScriptCore API docs
https://bugs.webkit.org/show_bug.cgi?id=150262

Reviewed by Mark Lam.

Apply some edits for clarity. These came out of a docs review.

* API/JSContext.h:
* API/JSExport.h:
* API/JSManagedValue.h:
* API/JSValue.h:

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

5 years agoUnreviewed, rolling out r191204.
commit-queue@webkit.org [Fri, 16 Oct 2015 23:48:45 +0000 (23:48 +0000)]
Unreviewed, rolling out r191204.
https://bugs.webkit.org/show_bug.cgi?id=150263

This change is causing existing tests to fail (Requested by
ryanhaddad on #webkit).

Reverted changeset:

"Computed style should work correctly with slotted elements
that have display:none"
https://bugs.webkit.org/show_bug.cgi?id=150237
http://trac.webkit.org/changeset/191204

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

5 years agoAdd a WKWebView input delegate SPI
wenson_hsieh@apple.com [Fri, 16 Oct 2015 23:47:10 +0000 (23:47 +0000)]
Add a WKWebView input delegate SPI
https://bugs.webkit.org/show_bug.cgi?id=149646

Reviewed by Dan Bernstein.

Renames the existing _WKFormDelegate to _WKInputDelegate and adds a new delegate SPI method
-[_WKInputDelegate _webView:focusShouldStartInputSession:] that allows clients to allow or
disallow showing up the keyboard. To make this decision, clients are given a
_WKFocusedElementInfo, which contains information about the focused element prior to the
keyboard showing up so the client will be able to override default assistance behavior.

While the information contained in a _WKFocusedElementInfo currently seems like overkill for
_webView:focusShouldStartInputSession, our intentions are to give WebKit clients control over more
details of how node assistance works, such as being able to use a custom editor for certain
types of nodes.

* Shared/API/Cocoa/WebKitPrivate.h: Added new header _WKFocusedElementInfo.h.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _inputDelegate]):
(-[WKWebView _formDelegate]):
(-[WKWebView _setInputDelegate:]):
(-[WKWebView _setFormDelegate:]):
(-[WKWebView initWithFrame:configuration:]): Deleted canAssistOnProgrammaticFocus flag.
(-[WKWebView canAssistOnProgrammaticFocus]): Ditto.
(-[WKWebView setCanAssistOnProgrammaticFocus:]): Ditto.
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Deleted.
(-[WKWebViewConfiguration _canAssistOnProgrammaticFocus]): Deleted canAssistOnProgrammaticFocus flag.
(-[WKWebViewConfiguration _setCanAssistOnProgrammaticFocus:]): Ditto.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKFocusedElementInfo.h: Added.
* UIProcess/API/Cocoa/_WKFormDelegate.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKFormDelegate.h.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFocusedElementInfo initWithAssistedNodeInformation:isInteracting:]):
(-[WKFocusedElementInfo type]):
(-[WKFocusedElementInfo value]):
(-[WKFocusedElementInfo isUserInitiated]):
(-[WKContentView accessoryAutoFill]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): If the input delegate responds to
    shouldStartInputSession, consult it to see if we should bring up the keyboard; otherwise, use our default behavior.
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoUnreviewed. Fix typo in TypeError messages in TypedArray.prototype.forEach/filter.
keith_miller@apple.com [Fri, 16 Oct 2015 23:40:54 +0000 (23:40 +0000)]
Unreviewed. Fix typo in TypeError messages in TypedArray.prototype.forEach/filter.

* builtins/TypedArray.prototype.js:
(forEach):
(filter):

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

5 years agoUse JITSubGenerator to support UntypedUse operands for op_sub in the DFG.
mark.lam@apple.com [Fri, 16 Oct 2015 23:26:14 +0000 (23:26 +0000)]
Use JITSubGenerator to support UntypedUse operands for op_sub in the DFG.
https://bugs.webkit.org/show_bug.cgi?id=150038

Reviewed by Geoffrey Garen.

* bytecode/SpeculatedType.h:
(JSC::isUntypedSpeculationForArithmetic): Added
- Also fixed some comments.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::resultType):
* dfg/DFGAbstractValue.h:
- Added function to compute the ResultType of an operand from its SpeculatedType.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
- Fix up ArithSub to speculate its operands to be numbers.  But if an OSR exit
  due to a BadType was seen at this node, we'll fix it up to expect UntypedUse
  operands.  This gives the generated code a change to run fast if it only
  receives numeric operands.

* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateUntypedForArithmetic):

* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
- Add the C++ runtime function to implement op_sub when we really encounter the
  hard types in the operands.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileArithSub):
- Added support for UntypedUse operands using the JITSubGenerator.

* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::silentSpillAllRegisters):
(JSC::DFG::SpeculativeJIT::pickCanTrample):
(JSC::DFG::SpeculativeJIT::callOperation):

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
- Just refuse to FTL compile functions with UntypedUse op_sub operands for now.

* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::boxDouble):
(JSC::AssemblyHelpers::unboxDoubleNonDestructive):
(JSC::AssemblyHelpers::unboxDouble):
(JSC::AssemblyHelpers::boxBooleanPayload):
* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_sub):

* jit/JITSubGenerator.h:
(JSC::JITSubGenerator::generateFastPath):
(JSC::JITSubGenerator::endJumpList):
- Added some asserts to document the contract that this generator expects in
  terms of its incoming registers.

  Also fixed the generated code to not be destructive with regards to incoming
  registers.  The DFG expects this.

  Also added an endJumpList so that we don't have to jump twice for the fast
  path where both operands are ints.

* parser/ResultType.h:
(JSC::ResultType::ResultType):
- Make the internal Type bits and the constructor private.  Clients should only
  create ResultType values using one of the provided factory methods.

* tests/stress/op_sub.js: Added.
(o1.valueOf):
(stringify):
(generateScenarios):
(printScenarios):
(testCases.func):
(func):
(initializeTestCases):
(runTest):
- test op_sub results by comparing one LLINT result against the output of
  multiple LLINT, and JIT runs.  This test assume that we'll at least get the
  right result some of the time (if not all the time), and confirms that the
  various engines produce consistent results for all the various value pairs
  being tested.

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

5 years agoDisabled content blockers should not block any loads
achristensen@apple.com [Fri, 16 Oct 2015 23:21:14 +0000 (23:21 +0000)]
Disabled content blockers should not block any loads
https://bugs.webkit.org/show_bug.cgi?id=150261

Reviewed by Brady Eidson.

This fix was tested manually by reloading without content blockers
on websites with iframes and content blockers that block the contents of the iframes.

* page/UserContentController.cpp:
(WebCore::UserContentController::removeAllUserContentExtensions):
(WebCore::contentExtensionsEnabled):
(WebCore::UserContentController::processContentExtensionRulesForLoad):
(WebCore::UserContentController::actionsForResourceLoad):
Check the DocumentLoader of the main frame when checking if content extensions are disabled,
because that is the DocumentLoader that has the flag from reloading without content blockers.

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

5 years agoFix flakey test that was added for:
beidson@apple.com [Fri, 16 Oct 2015 23:15:12 +0000 (23:15 +0000)]
Fix flakey test that was added for:
Modern IDB: Add versionchange events.
https://bugs.webkit.org/show_bug.cgi?id=150149

Test flakes because two events come in different orders.

The event order actually does not matter.
The test just needs to handle either order.

* storage/indexeddb/modern/versionchange-event-expected.txt:
* storage/indexeddb/modern/versionchange-event.html:

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

5 years agoCopyBarrier must be avoided for slow TypedArrays
fpizlo@apple.com [Fri, 16 Oct 2015 22:53:11 +0000 (22:53 +0000)]
CopyBarrier must be avoided for slow TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=150217
rdar://problem/23128791

Reviewed by Michael Saboff.

Change how we access array buffer views so that we don't fire the barrier slow path, and
don't mask off the spaceBits, if the view is not FastTypedArray. That's because in that case
m_vector could be misaligned and so have meaningful non-space data in the spaceBits. Also in
that case, m_vector does not point into copied space.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::loadVectorWithBarrier):
(JSC::FTL::DFG::LowerDFGToLLVM::copyBarrier):
(JSC::FTL::DFG::LowerDFGToLLVM::isInToSpace):
(JSC::FTL::DFG::LowerDFGToLLVM::loadButterflyReadOnly):
(JSC::FTL::DFG::LowerDFGToLLVM::loadVectorReadOnly):
(JSC::FTL::DFG::LowerDFGToLLVM::removeSpaceBits):
(JSC::FTL::DFG::LowerDFGToLLVM::isFastTypedArray):
(JSC::FTL::DFG::LowerDFGToLLVM::baseIndex):
* heap/CopyBarrier.h:
(JSC::CopyBarrierBase::getWithoutBarrier):
(JSC::CopyBarrierBase::getPredicated):
(JSC::CopyBarrierBase::get):
(JSC::CopyBarrierBase::copyState):
(JSC::CopyBarrier::get):
(JSC::CopyBarrier::getPredicated):
(JSC::CopyBarrier::set):
* heap/Heap.cpp:
(JSC::Heap::copyBarrier):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::branchIfNotType):
(JSC::AssemblyHelpers::branchIfFastTypedArray):
(JSC::AssemblyHelpers::branchIfNotFastTypedArray):
(JSC::AssemblyHelpers::loadTypedArrayVector):
(JSC::AssemblyHelpers::purifyNaN):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::branchStructure):
(JSC::AssemblyHelpers::branchIfToSpace):
(JSC::AssemblyHelpers::branchIfNotToSpace):
(JSC::AssemblyHelpers::removeSpaceBits):
(JSC::AssemblyHelpers::addressForByteOffset):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitIntTypedArrayGetByVal):
(JSC::JIT::emitFloatTypedArrayGetByVal):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* runtime/JSArrayBufferView.h:
(JSC::JSArrayBufferView::vector):
(JSC::JSArrayBufferView::length):
* runtime/JSArrayBufferViewInlines.h:
(JSC::JSArrayBufferView::byteOffset):
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::typedVector):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::copyBackingStore):
(JSC::JSGenericTypedArrayView<Adaptor>::slowDownAndWasteMemory):
* tests/stress/misaligned-int8-view-byte-offset.js: Added.
* tests/stress/misaligned-int8-view-read.js: Added.
* tests/stress/misaligned-int8-view-write.js: Added.

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

5 years agoUnreviewed. Build fix for 191215.
keith_miller@apple.com [Fri, 16 Oct 2015 22:51:31 +0000 (22:51 +0000)]
Unreviewed. Build fix for 191215.

* jit/IntrinsicEmitter.cpp:

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

5 years agoTest fix after r191211
bfulgham@apple.com [Fri, 16 Oct 2015 22:44:42 +0000 (22:44 +0000)]
Test fix after r191211

Tell the 'Plug-ins.html' test to allow enumeration of all plugins.

* fast/dom/Window/Plug-ins.html:

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

5 years agoRemoving non-existent test from test expectations file
commit-queue@webkit.org [Fri, 16 Oct 2015 22:41:50 +0000 (22:41 +0000)]
Removing non-existent test from test expectations file
https://bugs.webkit.org/show_bug.cgi?id=150250

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-16
Reviewed by Simon Fraser.

* platform/mac/TestExpectations:

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

5 years ago[Win] Update initial-letter test expectation for Win port.
zalan@apple.com [Fri, 16 Oct 2015 22:37:52 +0000 (22:37 +0000)]
[Win] Update initial-letter test expectation for Win port.

Unreviewed gardening.

* platform/win/TestExpectations:

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

5 years agoMake TextStream the canonical way to log classes in WebCore
simon.fraser@apple.com [Fri, 16 Oct 2015 22:31:26 +0000 (22:31 +0000)]
Make TextStream the canonical way to log classes in WebCore
https://bugs.webkit.org/show_bug.cgi?id=150256

Reviewed by Sam Weinig.

We vacillated between PrintStream and TextStream as being the canonical way
to stringify WebCore data structures. This patch solidifies TextStream
as the solution, since it has convenient stream syntax, and is what we
use for render tree dumps.

Remove TextStream member functions that output non-simple structs
(sizes, points and rects), replacing them with free operator<< functions
in the .cpp file for the relevant class. Formatting is currently consistent
with RenderTreeAsText output, to avoid breaking tests.

Remove custom FloatRect outputting in SVG and RemoteLayerTreeTransaction.

Source/WebCore:

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FloatPoint.cpp:
(WebCore::operator<<):
(WebCore::FloatPoint::dump): Deleted.
* platform/graphics/FloatPoint.h:
* platform/graphics/FloatRect.cpp:
(WebCore::operator<<):
(WebCore::FloatRect::dump): Deleted.
* platform/graphics/FloatRect.h:
* platform/graphics/FloatSize.cpp:
(WebCore::FloatSize::FloatSize):
(WebCore::operator<<):
(WebCore::FloatSize::dump): Deleted.
* platform/graphics/FloatSize.h:
* platform/graphics/IntPoint.cpp:
(WebCore::operator<<):
(WebCore::IntPoint::dump): Deleted.
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.cpp:
(WebCore::operator<<):
(WebCore::IntRect::dump): Deleted.
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.cpp:
(WebCore::operator<<):
(WebCore::IntSize::dump): Deleted.
* platform/graphics/IntSize.h:
* platform/graphics/LayoutPoint.cpp: Copied from Source/WebCore/platform/graphics/IntPoint.cpp.
(WebCore::operator<<):
* platform/graphics/LayoutPoint.h:
* platform/graphics/LayoutRect.cpp:
(WebCore::operator<<):
* platform/graphics/LayoutRect.h:
* platform/graphics/LayoutSize.cpp: Copied from Source/WebCore/platform/graphics/IntPoint.cpp.
(WebCore::operator<<):
* platform/graphics/LayoutSize.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::dump):
* platform/text/TextStream.cpp:
(WebCore::TextStream::operator<<):
* platform/text/TextStream.h:
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::operator<<): Deleted.

Source/WebKit2:

* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::RemoteScrollingTreeTextStream::operator<<): Deleted.
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTextStream::operator<<): Deleted.

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

5 years agoAdd Intrinsic Getters and use them to fix performance on the getters of TypedArray...
keith_miller@apple.com [Fri, 16 Oct 2015 22:18:42 +0000 (22:18 +0000)]
Add Intrinsic Getters and use them to fix performance on the getters of TypedArray properties.
https://bugs.webkit.org/show_bug.cgi?id=149687

Patch by Keith Miller <keith@Keiths-MacBook-Pro-5.local> on 2015-10-16
Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Add the ability to create intrinsic getters in both the inline cache and the DFG/FTL. When the
getter fetched by a GetById has an intrinsic we know about we add a new intrinsic access case.
Once we get to the DFG, we observe that the access case was an intrinsic and add an appropriate
GetByIdVariant. We then parse the intrinsic into an appropriate DFG node.

The first intrinsics are the new TypedArray prototype getters length, byteLength, and byteOffset.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeForStubInfoWithoutExitSiteFeedback):
(JSC::GetByIdStatus::computeFor):
* bytecode/GetByIdVariant.cpp:
(JSC::GetByIdVariant::GetByIdVariant):
(JSC::GetByIdVariant::operator=):
(JSC::GetByIdVariant::canMergeIntrinsicStructures):
(JSC::GetByIdVariant::attemptToMerge):
(JSC::GetByIdVariant::dumpInContext):
* bytecode/GetByIdVariant.h:
(JSC::GetByIdVariant::intrinsicFunction):
(JSC::GetByIdVariant::intrinsic):
(JSC::GetByIdVariant::callLinkStatus): Deleted.
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::addWatchpoint):
(JSC::AccessGenerationState::restoreScratch):
(JSC::AccessGenerationState::succeed):
(JSC::AccessGenerationState::calculateLiveRegistersForCallAndExceptionHandling):
(JSC::AccessGenerationState::preserveLiveRegistersToStackForCall):
(JSC::AccessGenerationState::restoreLiveRegistersFromStackForCall):
(JSC::AccessGenerationState::restoreLiveRegistersFromStackForCallWithThrownException):
(JSC::AccessGenerationState::callSiteIndexForExceptionHandlingOrOriginal):
(JSC::AccessGenerationState::originalExceptionHandler):
(JSC::AccessGenerationState::originalCallSiteIndex):
(JSC::AccessCase::getIntrinsic):
(JSC::AccessCase::clone):
(JSC::AccessCase::visitWeak):
(JSC::AccessCase::generate):
(WTF::printInternal):
(JSC::AccessCase::AccessCase): Deleted.
(JSC::AccessCase::get): Deleted.
(JSC::AccessCase::replace): Deleted.
(JSC::AccessCase::transition): Deleted.
* bytecode/PolymorphicAccess.h:
(JSC::AccessCase::isGet):
(JSC::AccessCase::isPut):
(JSC::AccessCase::isIn):
(JSC::AccessCase::intrinsicFunction):
(JSC::AccessCase::intrinsic):
(JSC::AccessGenerationState::AccessGenerationState):
(JSC::AccessGenerationState::liveRegistersForCall):
(JSC::AccessGenerationState::callSiteIndexForExceptionHandling):
(JSC::AccessGenerationState::numberOfStackBytesUsedForRegisterPreservation):
(JSC::AccessGenerationState::needsToRestoreRegistersIfException):
(JSC::AccessGenerationState::liveRegistersToPreserveAtExceptionHandlingCallSite):
* bytecode/PutByIdVariant.h:
(JSC::PutByIdVariant::intrinsic):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::alreadyChecked):
(JSC::DFG::arrayTypeToString):
(JSC::DFG::toTypedArrayType):
(JSC::DFG::refineTypedArrayType):
(JSC::DFG::permitsBoundsCheckLowering):
* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::supportsLength):
(JSC::DFG::ArrayMode::isSomeTypedArrayView):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::attemptToInlineCall):
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
(JSC::DFG::ByteCodeParser::handleIntrinsicGetter):
(JSC::DFG::ByteCodeParser::load):
(JSC::DFG::ByteCodeParser::handleGetById):
(JSC::DFG::ByteCodeParser::presenceLike): Deleted.
(JSC::DFG::ByteCodeParser::store): Deleted.
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::convertToGetArrayLength): Deleted.
(JSC::DFG::FixupPhase::prependGetArrayLength): Deleted.
(JSC::DFG::FixupPhase::fixupChecksInBlock): Deleted.
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::tryGetFoldableView):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArray):
(JSC::DFG::SpeculativeJIT::compileGetArrayLength):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetArrayLength):
* jit/IntrinsicEmitter.cpp: Added.
(JSC::AccessCase::canEmitIntrinsicGetter):
(JSC::AccessCase::emitIntrinsicGetter):
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
* runtime/Intrinsic.h:
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::put):
(JSC::JSArrayBufferView::defineOwnProperty):
(JSC::JSArrayBufferView::deleteProperty):
(JSC::JSArrayBufferView::getOwnNonIndexPropertyNames):
(JSC::JSArrayBufferView::getOwnPropertySlot): Deleted.
(JSC::JSArrayBufferView::finalize): Deleted.
* runtime/JSDataView.cpp:
(JSC::JSDataView::getOwnPropertySlot):
(JSC::JSDataView::put):
(JSC::JSDataView::defineOwnProperty):
(JSC::JSDataView::deleteProperty):
(JSC::JSDataView::getOwnNonIndexPropertyNames):
* runtime/JSDataView.h:
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::intrinsic):
* runtime/JSGenericTypedArrayView.h:
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot):
(JSC::JSGenericTypedArrayView<Adaptor>::defineOwnProperty):
(JSC::JSGenericTypedArrayView<Adaptor>::deleteProperty):
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlotByIndex): Deleted.
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren): Deleted.
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectNativeIntrinsicGetter):
* runtime/JSObject.h:
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSTypedArrayViewPrototype::finishCreation):
* tests/stress/typedarray-add-property-to-base-object.js: Added.
(body.foo):
(body):
* tests/stress/typedarray-bad-getter.js: Added.
(body.foo):
(body.get Bar):
(body):
* tests/stress/typedarray-getter-on-self.js: Added.
(body.foo):
(body.bar):
(body.baz):
(body.get for):
(body):
* tests/stress/typedarray-intrinsic-getters-change-prototype.js: Added.
(body.foo):
(body.bar):
(body.baz):
(body):

LayoutTests:

Fix test since typedarrays no longer have length as a own property.

* js/dom/getOwnPropertyDescriptor-expected.txt:
* js/resources/getOwnPropertyDescriptor.js:

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

5 years agoWebKit2.AutoLayoutIntegration API test is failing on some of the bots
timothy_horton@apple.com [Fri, 16 Oct 2015 22:09:57 +0000 (22:09 +0000)]
WebKit2.AutoLayoutIntegration API test is failing on some of the bots
https://bugs.webkit.org/show_bug.cgi?id=150255

Reviewed by Simon Fraser.

* Scripts/run-api-tests:
(runTest):
* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm:
(-[AutoLayoutWKWebView load:withWidth:expectingContentSize:]):
(-[AutoLayoutWKWebView layoutAtMinimumWidth:andExpectContentSizeChange:]):
(-[AutoLayoutWKWebView load:expectingContentSize:]): Deleted.
(-[AutoLayoutWKWebView expectContentSizeChange:]): Deleted.
Don't set the layout size until after the load finishes and we're waiting
for the reply, so that there is no race between the new size coming in
and us waiting for it.

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

5 years agoWebEditingDelegate should be a formal protocol
andersca@apple.com [Fri, 16 Oct 2015 21:58:58 +0000 (21:58 +0000)]
WebEditingDelegate should be a formal protocol
https://bugs.webkit.org/show_bug.cgi?id=150254
<rdar://problem/23149847>

Reviewed by Dan Bernstein.

Source/WebKit/mac:

* WebView/WebEditingDelegate.h:
Move all the delegate methods inside the protocol declaration. Also make the header self-contained.

* WebView/WebView.h:
Change the type of the editing delegate and make it assign.

Tools:

* DumpRenderTree/mac/EditingDelegate.h:
Conform to the WebEditingDelegate protocol.

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

5 years agoFix some issues with TypedArrays
keith_miller@apple.com [Fri, 16 Oct 2015 21:40:21 +0000 (21:40 +0000)]
Fix some issues with TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=150216

Reviewed by Geoffrey Garen.

This fixes a couple of issues:
1) The DFG had a separate case for creating new typedarrays in the dfg when the first argument is an object.
   Since the code for creating a Typedarray in the dfg is almost the same as the code in Baseline/LLInt
   the two cases have been merged.
2) If the length property on an object was unset then the construction could crash.
3) The TypedArray.prototype.set function and the TypedArray constructor should not call [[Get]] for the
   length of the source object when the source object is a TypedArray.
4) The conditions that were used to decide if the iterator could be skipped were incorrect.
   Instead of checking for have a bad time we should have checked the Indexing type did not allow for
   indexed accessors.

* dfg/DFGOperations.cpp:
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
(JSC::constructGenericTypedArrayViewWithFirstArgument): Deleted.

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

5 years agoHide all plugin names except Flash, Java, and QuickTime
bfulgham@apple.com [Fri, 16 Oct 2015 21:25:52 +0000 (21:25 +0000)]
Hide all plugin names except Flash, Java, and QuickTime
https://bugs.webkit.org/show_bug.cgi?id=149014

Reviewed by Darin Adler.

Source/WebCore:

Revise plugin interface so that sites cannot iterate over all plugins to obtain
a list of installed plugins for fingerprinting purposes. Sites need to ask for
specific plugins by name, rather than iterating and comparing to avoid making
this information accessible for fingerprinting purposes.

* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::length): Only return length of the plugins we are
allowing to be seen.
(WebCore::DOMPluginArray::item): Only iterate through the plugins we are
allowing to be seen.
* plugins/PluginData.cpp:
(WebCore::PluginData::publiclyVisiblePlugins): Added.
* plugins/PluginData.h:

LayoutTests:

Update tests to notify internals that all plugins should be shown, not
just the publicly available ones.

* plugins/plugin-javascript-access.html:
* plugins/script-tests/navigator-mimeTypes-length.js:

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

5 years ago"enum class" some IDB enums.
beidson@apple.com [Fri, 16 Oct 2015 21:10:58 +0000 (21:10 +0000)]
"enum class" some IDB enums.
https://bugs.webkit.org/show_bug.cgi?id=150246

Reviewed by Alex Christensen.

No new tests (No change in behavior).

* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBIsValidKeyPath):
(WebCore::IDBParseKeyPath):
(WebCore::IDBKeyPath::IDBKeyPath):
(WebCore::IDBKeyPath::isValid):
(WebCore::IDBKeyPath::operator==):
(WebCore::IDBKeyPath::encode):
(WebCore::IDBKeyPath::decode):
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::IDBKeyPath::IDBKeyPath):
(WebCore::IDBKeyPath::type):
(WebCore::IDBKeyPath::array):
(WebCore::IDBKeyPath::string):
(WebCore::IDBKeyPath::isNull):
(WebCore::IDBKeyPath::encode):
(WebCore::IDBKeyPath::decode):
* Modules/indexeddb/IndexedDB.h:
* Modules/indexeddb/legacy/LegacyDatabase.cpp:
(WebCore::LegacyDatabase::createObjectStore):
* Modules/indexeddb/legacy/LegacyObjectStore.cpp:
(WebCore::LegacyObjectStore::createIndex):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath):
(WebCore::injectIDBKeyIntoScriptValue):
(WebCore::createIDBKeyFromScriptValueAndKeyPath):
(WebCore::canInjectIDBKeyIntoScriptValue):
* bindings/js/JSIDBAnyCustom.cpp:
(WebCore::toJS):
* inspector/InspectorIndexedDBAgent.cpp:

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

5 years agoAdd indexeddb/shared to the include paths.
andersca@apple.com [Fri, 16 Oct 2015 21:08:55 +0000 (21:08 +0000)]
Add indexeddb/shared to the include paths.

* WebCore.vcxproj/WebCoreIncludeCommon.props:

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

5 years agoFix Windows build.
andersca@apple.com [Fri, 16 Oct 2015 21:06:59 +0000 (21:06 +0000)]
Fix Windows build.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:

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

5 years agoREGRESSION (r191175): Still crashing when clicking back button on netflix.com
msaboff@apple.com [Fri, 16 Oct 2015 21:06:00 +0000 (21:06 +0000)]
REGRESSION (r191175): Still crashing when clicking back button on netflix.com
https://bugs.webkit.org/show_bug.cgi?id=150251

Rubber stamped by Filip Pizlo.

Turning off Tail Calls and disabling tests until the crash is fixed.

Source/JavaScriptCore:

* runtime/Options.h:
* tests/es6.yaml:
* tests/stress/dfg-tail-calls.js:
(nonInlinedTailCall.callee):
* tests/stress/mutual-tail-call-no-stack-overflow.js:
(shouldThrow):
* tests/stress/tail-call-in-inline-cache.js:
(tail):
* tests/stress/tail-call-no-stack-overflow.js:
(shouldThrow):
* tests/stress/tail-call-recognize.js:
(callerMustBeRun):
* tests/stress/tail-call-varargs-no-stack-overflow.js:
(shouldThrow):

LayoutTests:

* js/caller-property-expected.txt:

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

5 years agoRemove some dead menu code
andersca@apple.com [Fri, 16 Oct 2015 21:02:33 +0000 (21:02 +0000)]
Remove some dead menu code
https://bugs.webkit.org/show_bug.cgi?id=150247

Reviewed by Andreas Kling.

* Shared/WebContextMenuItemData.cpp:
(WebKit::WebContextMenuItemData::WebContextMenuItemData):
(WebKit::WebContextMenuItemData::encode): Deleted.
* Shared/WebContextMenuItemData.h:
(WebKit::WebContextMenuItemData::selectionHandler): Deleted.
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::nsMenuItem):

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

5 years agoComputed style should work correctly with slotted elements that have display:none
antti@apple.com [Fri, 16 Oct 2015 20:50:22 +0000 (20:50 +0000)]
Computed style should work correctly with slotted elements that have display:none
https://bugs.webkit.org/show_bug.cgi?id=150237

Reviewed by Andreas Kling.

Source/WebCore:

If an element has display:none we don't normally retain or even compute its style (as it is not rendered).
If getComputedStyle is invoked for such element we resolve the style (along with any ancestors) and cache
it separately to rare data. This path needs to work with slotted elements in shadow trees.

This patch also make computedStyle() iterative rather than recursive.

Test: fast/shadow-dom/computed-style-display-none.html

* dom/Document.cpp:
(WebCore::Document::styleForElementIgnoringPendingStylesheets):

    Pass in the parent style instead of invoking computedStyle() recursively.

* dom/Document.h:
* dom/Element.cpp:
(WebCore::beforeOrAfterPseudoElement):
(WebCore::Element::existingComputedStyle):
(WebCore::Element::resolveComputedStyle):

    Iterative resolve function that uses composed tree iterator.

(WebCore::Element::computedStyle):

    Factor into helpers.

* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::computedStyle):

    Use the composed tree iterator.

LayoutTests:

* editing/style/apply-style-atomic-expected.txt:

    Rebase.

* fast/css/getComputedStyle/getComputedStyle-with-pseudo-element-expected.txt:
* fast/css/getComputedStyle/getComputedStyle-with-pseudo-element.html:

    We now also compute style of display:none pseudo elements correctly.
    This is a progression and matches other browsers.

* fast/shadow-dom/computed-style-display-none-expected.txt: Added.
* fast/shadow-dom/computed-style-display-none.html: Added.

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

5 years ago[iOS] Update initial-letter results for iOS port.
zalan@apple.com [Fri, 16 Oct 2015 20:46:32 +0000 (20:46 +0000)]
[iOS] Update initial-letter results for iOS port.

Unreviewed gardening.

* platform/ios-simulator/fast/css-generated-content/initial-letter-basic-expected.txt:
* platform/ios-simulator/fast/css-generated-content/initial-letter-sunken-expected.txt:

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

5 years agoAdd MacroAssembler::callProbe() for supporting lambda JIT probes.
mark.lam@apple.com [Fri, 16 Oct 2015 20:36:44 +0000 (20:36 +0000)]
Add MacroAssembler::callProbe() for supporting lambda JIT probes.
https://bugs.webkit.org/show_bug.cgi?id=150186

Reviewed by Geoffrey Garen.

With callProbe(), we can now make probes that are lambdas.  For example, we can
now conveniently add probes like so:

    // When you know exactly which register you want to inspect:
    jit.callProbe([] (MacroAssembler::ProbeContext* context) {
        intptr_t value = reinterpret_cast<intptr_t>(context->cpu.eax);
        dataLogF("eax %p\n", context->cpu.eax); // Inspect the register.
        ASSERT(value > 10); // Add test code for debugging.
    });

    // When you want to inspect whichever register the JIT allocated:
    auto reg = op1.gpr();
    jit.callProbe([reg] (MacroAssembler::ProbeContext* context) {
        intptr_t value = reinterpret_cast<intptr_t>(context->gpr(reg));
        dataLogF("reg %s: %ld\n", context->gprName(reg), value);
        ASSERT(value > 10);
    });

callProbe() is only meant to be used for debugging sessions.  It is not
appropriate to use it in permanent code (even for debug builds).
This is because:
1. The probe mechanism saves and restores all (and I really mean "all")
   registers, and is inherently slow.
2. callProbe() currently works by allocating (via new) a std::function to
   guarantee that it is persisted for the duration that the JIT generated code is
   live.  We don't currently delete it ever i.e. it leaks a bit of memory each
   time the JIT generates code that contains such a lambda probe.

These limitations are acceptable for a debugging session (assuming you're not
debugging a memory leak), but not for deployment code.  If there's a need, we can
plug that leak in another patch.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::CPUState::fpr):
- Removed an unnecessary empty line.
(JSC::AbstractMacroAssembler::ProbeContext::gpr):
(JSC::AbstractMacroAssembler::ProbeContext::fpr):
(JSC::AbstractMacroAssembler::ProbeContext::gprName):
(JSC::AbstractMacroAssembler::ProbeContext::fprName):
- Added some convenience functions that will make using the probe mechanism
  easier.

* assembler/MacroAssembler.cpp:
(JSC::StdFunctionData::StdFunctionData):
(JSC::stdFunctionCallback):
(JSC::MacroAssembler::callProbe):
* assembler/MacroAssembler.h:

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

5 years agoASSERT in imported/blink/fast/block/float/overhanging-float-crashes-when-sibling...
hyatt@apple.com [Fri, 16 Oct 2015 20:29:41 +0000 (20:29 +0000)]
ASSERT in imported/blink/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html
https://bugs.webkit.org/show_bug.cgi?id=150249

Reviewed by Myles Maxfield.

Covered by existing tests.

* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
Make sure the "unset" value has an equals implementation.

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

5 years agoRemove unused StructureRareData::m_cachedGenericPropertyNameEnumerator.
akling@apple.com [Fri, 16 Oct 2015 20:27:52 +0000 (20:27 +0000)]
Remove unused StructureRareData::m_cachedGenericPropertyNameEnumerator.
<https://webkit.org/b/150244>

Reviewed by Geoffrey Garen.

Remove an unused field from StructureRareData.

* runtime/StructureRareData.cpp:
(JSC::StructureRareData::visitChildren): Deleted.
* runtime/StructureRareData.h:

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

5 years agoSource/WebCore:
beidson@apple.com [Fri, 16 Oct 2015 20:04:13 +0000 (20:04 +0000)]
Source/WebCore:
Modern IDB: Handle versionchange events.
https://bugs.webkit.org/show_bug.cgi?id=150149

Reviewed by Alex Christensen.

Test: storage/indexeddb/modern/versionchange-event.html

- IDBVersionChangeEvents are now dispatched to open connections when a
  version upgrade request comes in.
- Once all of those open connections have closed, the version upgrade
  request is handled.

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::fireVersionChangeEvent):
(WebCore::IDBClient::IDBConnectionToServer::registerDatabaseConnection):
(WebCore::IDBClient::IDBConnectionToServer::unregisterDatabaseConnection):
* Modules/indexeddb/client/IDBConnectionToServer.h:

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::fireVersionChangeEvent):
* Modules/indexeddb/client/IDBDatabaseImpl.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::invokeTransactionScheduler):
(WebCore::IDBServer::UniqueIDBDatabase::transactionSchedulingTimerFired):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

LayoutTests:
Modern IDB: Add versionchange events.
https://bugs.webkit.org/show_bug.cgi?id=150149

Reviewed by Alex Christensen.

* storage/indexeddb/modern/versionchange-event-expected.txt: Added.
* storage/indexeddb/modern/versionchange-event.html: Added.

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

5 years agoAlways enable MASM_PROBE for debug builds.
mark.lam@apple.com [Fri, 16 Oct 2015 20:02:21 +0000 (20:02 +0000)]
Always enable MASM_PROBE for debug builds.
https://bugs.webkit.org/show_bug.cgi?id=150190

Reviewed by Geoffrey Garen.

* wtf/Platform.h:

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

5 years agobmalloc: per-thread cache data structure should be smaller
ggaren@apple.com [Fri, 16 Oct 2015 19:59:30 +0000 (19:59 +0000)]
bmalloc: per-thread cache data structure should be smaller
https://bugs.webkit.org/show_bug.cgi?id=150218

Reviewed by Andreas Kling.

Reduce the number of entries in the range cache because it's really
big, and the bigness only helps in cases of serious fragmentation, and
it only saves us a little bit of lock acquisition time.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::scavenge):
(bmalloc::Allocator::refillAllocatorSlowCase):
(bmalloc::Allocator::refillAllocator):
(bmalloc::Allocator::allocateLarge):
(bmalloc::Allocator::allocateSlowCase):
(bmalloc::Allocator::allocateBumpRangeSlowCase): Deleted.
(bmalloc::Allocator::allocateBumpRange): Deleted.
* bmalloc/Allocator.h: Pass through the empty allocator and the range
cache when refilling, and refill both. Otherwise, we always immediately
pop the last item in the range cache, wasting that slot of capacity.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallBumpRanges):
(bmalloc::Heap::allocateMediumBumpRanges): Account for the fact that
the range cache is no longer big enough to guarantee that it can hold
all the ranges in a page.

(bmalloc::Heap::refillSmallBumpRangeCache): Deleted.
(bmalloc::Heap::refillMediumBumpRangeCache): Deleted.

* bmalloc/Heap.h: Move VMHeap to the end of the object because it
contains a lot of unused / wasted space, and we want to pack our data
together in memory.

* bmalloc/Sizes.h: Make the range cache smaller.

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

5 years agoFirst line box in paragraph using initial-letter overflows.
zalan@apple.com [Fri, 16 Oct 2015 19:53:04 +0000 (19:53 +0000)]
First line box in paragraph using initial-letter overflows.
https://bugs.webkit.org/show_bug.cgi?id=147977
<rdar://problem/22901553>

Reviewed by David Hyatt.

When initial-letter float is present, we should shrink the first
line even if it's not intersected with the block's current height.
This is because of the sunken behaviour of initial-letter.

Source/WebCore:

Test: fast/css-generated-content/initial-letter-first-line-wrapping.html

* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::positionNewFloatOnLine):
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleFloat):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineBreaker.h:
(WebCore::LineBreaker::positionNewFloatOnLine):
* rendering/line/LineWidth.cpp:
(WebCore::newFloatShrinksLine):
(WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
* rendering/line/LineWidth.h:

LayoutTests:

* fast/css-generated-content/initial-letter-first-line-wrapping-expected.html: Added.
* fast/css-generated-content/initial-letter-first-line-wrapping.html: Added.
* platform/mac/fast/css-generated-content/initial-letter-basic-expected.txt: progression.

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

5 years agoMove more code to WebContextMenuProxyMac
andersca@apple.com [Fri, 16 Oct 2015 19:52:42 +0000 (19:52 +0000)]
Move more code to WebContextMenuProxyMac
https://bugs.webkit.org/show_bug.cgi?id=150240

Reviewed by Tim Horton.

* UIProcess/WebContextMenuProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::contextMenuClient):
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::initializeShareMenuItem):
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::platformInitializeShareMenuItem): Deleted.

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

5 years agoUnreviewed, rolling out r191190.
keith_miller@apple.com [Fri, 16 Oct 2015 19:47:04 +0000 (19:47 +0000)]
Unreviewed, rolling out r191190.

Patch needs some design changes.

Reverted changeset:

"Fix some issues with TypedArrays"
https://bugs.webkit.org/show_bug.cgi?id=150216
http://trac.webkit.org/changeset/191190

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

5 years agoUpdate testharness.js to web-platform-tests version
youenn.fablet@crf.canon.fr [Fri, 16 Oct 2015 19:26:38 +0000 (19:26 +0000)]
Update testharness.js to web-platform-tests version
https://bugs.webkit.org/show_bug.cgi?id=150234

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* resources/web-platform-tests-modules.json: updated testharness module version.
* web-platform-tests/dom/interfaces-expected.txt: Rebased test expectation.
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01-expected.txt: Ditto.
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02-expected.txt: Ditto.
* web-platform-tests/dom/nodes/Node-isEqualNode-expected.txt: Ditto.
* web-platform-tests/html/dom/interfaces-expected.txt: Ditto.
* web-platform-tests/html/dom/interfaces.html: Removed a method from Window as this is timing out the test otherwise.

LayoutTests:

* resources/testharness.js:
(WindowTestEnvironment):
(WindowTestEnvironment.prototype._dispatch):
(WindowTestEnvironment.prototype._forEach_windows):
(WindowTestEnvironment.prototype.on_tests_ready):
(WindowTestEnvironment.prototype.setup_messages):
(WindowTestEnvironment.prototype.next_default_test_name):
(WindowTestEnvironment.prototype.on_new_harness_properties):
(WindowTestEnvironment.prototype.add_on_loaded_callback):
(WindowTestEnvironment.prototype.test_timeout):
(WindowTestEnvironment.prototype.global_scope):
(WorkerTestEnvironment):
(WorkerTestEnvironment.prototype._dispatch):
(WorkerTestEnvironment.prototype._add_message_port):
(WorkerTestEnvironment.prototype.next_default_test_name):
(WorkerTestEnvironment.prototype.on_new_harness_properties):
(WorkerTestEnvironment.prototype.on_tests_ready):
(WorkerTestEnvironment.prototype.add_on_loaded_callback):
(WorkerTestEnvironment.prototype.test_timeout):
(WorkerTestEnvironment.prototype.global_scope):
(DedicatedWorkerTestEnvironment):
(DedicatedWorkerTestEnvironment.prototype.on_tests_ready):
(SharedWorkerTestEnvironment):
(SharedWorkerTestEnvironment.prototype.on_tests_ready):
(ServiceWorkerTestEnvironment):
(ServiceWorkerTestEnvironment.prototype.add_on_loaded_callback):
(create_test_environment):
(is_shared_worker):
(is_service_worker):
(test):
(async_test):
(promise_test):
(this.wait_for):
(EventWatcher):
(setup):
(step_timeout):
(format_value): Deleted.

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

5 years agoMove all the probe trampolines into their respective MacroAssembler files.
mark.lam@apple.com [Fri, 16 Oct 2015 19:10:21 +0000 (19:10 +0000)]
Move all the probe trampolines into their respective MacroAssembler files.
https://bugs.webkit.org/show_bug.cgi?id=150239

Reviewed by Saam Barati.

This patch does not introduce any behavior changes.  It only moves the
ctiMasmProbeTrampoline implementations from the respective JITStubs<CPU>.h
files to the corresponding MacroAssembler<CPU>.cpp files.

I also had to make some minor changes to get the code to build after this move:
1. Added #include <wtf/InlineASM.h> in the MacroAssembler<CPU>.cpp files
   because the ctiMasmProbeTrampoline is an inline assembly blob.
2. In the moved code, convert MacroAssembler:: qualifiers to the CPU specific
   MacroAssembler equivalent.  The referenced entities were always defined in
   the CPU specific MacroAssembler anyway, and indirectly referenced through
   the generic MacroAssembler.

With this, we can get rid of all the JITStubs<CPU>.cpp files.  There is one
exception: JITStubsMSVC64.asm.  However, that one is unrelated to the probe
mechanism.  So, I'll leave it as is.

We can also remove JITStubs.cpp and JITStubs.h which are now empty except for
some stale unused code.

This patch has been build tested for x86, x86_64, armv7, and arm64.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/MacroAssemblerARM.cpp:
(JSC::MacroAssemblerARM::probe):
* assembler/MacroAssemblerARM64.cpp:
(JSC::arm64ProbeTrampoline):
(JSC::MacroAssemblerARM64::probe):
* assembler/MacroAssemblerARMv7.cpp:
(JSC::MacroAssemblerARMv7::probe):
* assembler/MacroAssemblerX86Common.cpp:
* bytecode/CodeBlock.cpp:
* ftl/FTLCompile.cpp:
* ftl/FTLLink.cpp:
* jit/JITArithmetic.cpp:
* jit/JITArithmetic32_64.cpp:
* jit/JITCode.h:
* jit/JITExceptions.cpp:
* jit/JITStubs.cpp: Removed.
* jit/JITStubs.h: Removed.
* jit/JITStubsARM.h: Removed.
* jit/JITStubsARM64.h: Removed.
* jit/JITStubsARMv7.h: Removed.
* jit/JITStubsX86.h: Removed.
* jit/JITStubsX86Common.h: Removed.
* jit/JITStubsX86_64.h: Removed.
* jit/JSInterfaceJIT.h:
* llint/LLIntOffsetsExtractor.cpp:
* runtime/CommonSlowPaths.cpp:

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

5 years agoFix some issues with TypedArrays
keith_miller@apple.com [Fri, 16 Oct 2015 18:37:14 +0000 (18:37 +0000)]
Fix some issues with TypedArrays
https://bugs.webkit.org/show_bug.cgi?id=150216

Reviewed by Michael Saboff.

This fixes a couple of issues:
1) The DFG had a separate case for creating new typedarrays in the dfg when the first argument is an object.
   Since the code for creating a Typedarray in the dfg is almost the same as the code in Baseline/LLInt
   the two cases have been merged.
2) If the length property on an object was unset then the construction could crash.
3) The TypedArray.prototype.set function and the TypedArray constructor should not call [[Get]] for the
   length of the source object when the source object is a TypedArray.
4) The conditions that were used to decide if the iterator could be skipped were incorrect.
   Instead of checking for have a bad time we should have checked the Indexing type did not allow for
   indexed accessors.

* dfg/DFGOperations.cpp:
(JSC::DFG::newTypedArrayWithOneArgument): Deleted.
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewFromIterator):
(JSC::constructGenericTypedArrayViewWithFirstArgument):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewPrototypeFunctions.h:
(JSC::genericTypedArrayViewProtoFuncSet):
* tests/stress/typedarray-construct-iterator.js: Added.
(iterator.return.next):
(iterator):
(body):

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

5 years agoUnreviewed, skip imported/w3c/web-platform-tests/dom/interfaces.html on Debug builds.
cdumez@apple.com [Fri, 16 Oct 2015 18:30:23 +0000 (18:30 +0000)]
Unreviewed, skip imported/w3c/web-platform-tests/dom/interfaces.html on Debug builds.

This test is slow and sometimes times out.

* TestExpectations:

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

5 years agoThe value sanitization algorithm for input[type=url] should strip whitespaces
commit-queue@webkit.org [Fri, 16 Oct 2015 18:24:08 +0000 (18:24 +0000)]
The value sanitization algorithm for input[type=url] should strip whitespaces
https://bugs.webkit.org/show_bug.cgi?id=148864
rdar://problem/22589358

Patch by Keith Rollin <krollin@apple.com> on 2015-10-16
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Rebaseline two W3C HTML tests given changes in input[type=url].value
sanitization.

* web-platform-tests/html/semantics/forms/the-input-element/type-change-state-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/url-expected.txt:

Source/WebCore:

Follow the sanitization algorithm specified in:
https://html.spec.whatwg.org/multipage/forms.html#url-state-(type=url)

Chrome also has the same issue with url.html. Firefox passes.  All
three browsers have multiple issues with type-change-state.html, with
each browser having a different set of failures. Addressing this in
WebKit is another issue outside the scope of bz=148864. For now, I'm
updating that test to capture current WebKit behavior.

No new tests (covered by existing tests):
- web-platform-tests/html/semantics/forms/the-input-element/type-change-state.html
- web-platform-tests/html/semantics/forms/the-input-element/url.html

* html/TextFieldInputType.h:
* html/URLInputType.cpp:
(WebCore::URLInputType::sanitizeValue):
* html/URLInputType.h:

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

5 years agoWeb Inspector: Add "unset" to CSS value autocompletion
commit-queue@webkit.org [Fri, 16 Oct 2015 18:20:39 +0000 (18:20 +0000)]
Web Inspector: Add "unset" to CSS value autocompletion
https://bugs.webkit.org/show_bug.cgi?id=127616

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

* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.forProperty):
Treat "unset" similiar to "initial". Also, no need for "initial"
in an individual property's list. We always include it.

* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel):
(WebInspector.VisualStyleDetailsPanel.prototype._populateDisplaySection):
(WebInspector.VisualStyleDetailsPanel.prototype._populateAlignmentSection):
Add "Unset" alongside "Initial".

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

5 years agoRemove NodeRenderingTraversal
antti@apple.com [Fri, 16 Oct 2015 18:01:57 +0000 (18:01 +0000)]
Remove NodeRenderingTraversal
https://bugs.webkit.org/show_bug.cgi?id=150226

Reviewed by Chris Dumez.

It has been reduced to an implementation detail of FocusController. Move the remaining
functions there as they have no general utility (and are wrong for focus navigation too).

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/NodeRenderingTraversal.cpp: Removed.
* dom/NodeRenderingTraversal.h: Removed.
* page/FocusController.cpp:
(WebCore::firstChildInScope):
(WebCore::lastChildInScope):
(WebCore::parentInScope):
(WebCore::nextInScope):
(WebCore::previousInScope):
(WebCore::FocusNavigationScope::FocusNavigationScope):
(WebCore::FocusNavigationScope::focusNavigationScopeOf):
(WebCore::FocusController::findElementWithExactTabIndex):
(WebCore::nextElementWithGreaterTabIndex):
(WebCore::previousElementWithLowerTabIndex):
(WebCore::FocusController::nextFocusableElement):
(WebCore::FocusController::previousFocusableElement):

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

5 years agoFixing test expectations for css2.1/tables/table-anonymous-objects-045.xht on win
commit-queue@webkit.org [Fri, 16 Oct 2015 17:56:35 +0000 (17:56 +0000)]
Fixing test expectations for css2.1/tables/table-anonymous-objects-045.xht on win
https://bugs.webkit.org/show_bug.cgi?id=150125

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-16
Reviewed by Zalan Bujtas.

* platform/win/css2.1/tables/table-anonymous-objects-045-expected.txt:

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

5 years agoBuild fix. "all" keyword introduction exposed a typo bug in the grid-area property...
hyatt@apple.com [Fri, 16 Oct 2015 17:44:36 +0000 (17:44 +0000)]
Build fix. "all" keyword introduction exposed a typo bug in the grid-area property definition.

* css/CSSPropertyNames.in:

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

5 years agoHook up autolayout intrinsic sizing for WKWebView
timothy_horton@apple.com [Fri, 16 Oct 2015 17:30:27 +0000 (17:30 +0000)]
Hook up autolayout intrinsic sizing for WKWebView
https://bugs.webkit.org/show_bug.cgi?id=150219
<rdar://problem/20016905>

Reviewed by Simon Fraser.

New API test: WebKit2.AutoLayoutIntegration.

* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):
When autosizing a document in which the body expands to the size of
the view (a feature of quirks mode), the first (width-determining)
autosizing will resize the view to the document height (which is at
least the body height), and the second time around, the height will
not decrease (because it was expanded to the size of the view).

Instead, the first time around, we should use the computed width,
but shrink the height back down to the minimum, and then expand
only as much as needed to fit the content.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView intrinsicContentSize]):
(-[WKWebView _setIntrinsicContentSize:]):
(-[WKWebView _minimumLayoutWidth]):
(-[WKWebView _setMinimumLayoutWidth:]):
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add a simple SPI to specify the minimum width that a WKWebView will attempt
to lay out to, similar to WKView except just a width, not a size, and
with no option to force the height to the view size. Similar behavior can
be achieved by clients by setting custom autolayout constraints on the view.

* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::intrinsicContentSizeDidChange):
Forward intrinsic content size changes to the WKWebView, not its inner WKView,
if we have one.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Only set the autosizing fixed minimum height if we're using that behavior;
otherwise, setting it to the view's height will end up accidentally
turning on that behavior (which involves an extra layout per resize!).

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/AutoLayoutIntegration.mm: Added.
(-[AutoLayoutNavigationDelegate webView:didFinishNavigation:]):
(-[AutoLayoutWKWebView load:expectingContentSize:]):
(-[AutoLayoutWKWebView expectContentSizeChange:]):
(-[AutoLayoutWKWebView invalidateIntrinsicContentSize]):
(TEST):
Add a variety of tests, including one which catches the bug that
the WebCore part of this patch fixes.

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

5 years agoModern IDB: Support IDBDatabase.close().
beidson@apple.com [Fri, 16 Oct 2015 17:18:57 +0000 (17:18 +0000)]
Modern IDB: Support IDBDatabase.close().
https://bugs.webkit.org/show_bug.cgi?id=150150

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to storage/indexeddb/modern/opendatabase-versions.html).

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::IDBDatabase):
(WebCore::IDBClient::IDBDatabase::~IDBDatabase):
(WebCore::IDBClient::IDBDatabase::close):
(WebCore::IDBClient::IDBDatabase::maybeCloseInServer):
(WebCore::IDBClient::IDBDatabase::commitTransaction):
* Modules/indexeddb/client/IDBDatabaseImpl.h:
(WebCore::IDBClient::IDBDatabase::databaseConnectionIdentifier):

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::result):

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::hasNonFinishedTransactions):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

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

LayoutTests:

* storage/indexeddb/modern/opendatabase-versions-expected.txt:
* storage/indexeddb/modern/opendatabase-versions.html:

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

5 years agoUse the ShowContextMenu message for service menus as well
andersca@apple.com [Fri, 16 Oct 2015 17:08:14 +0000 (17:08 +0000)]
Use the ShowContextMenu message for service menus as well
https://bugs.webkit.org/show_bug.cgi?id=150206

Reviewed by Tim Horton.

* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::encode):
(WebKit::ContextMenuContextData::decode):
* Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::type):
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::isServicesMenu):
(WebKit::ContextMenuContextData::needsServicesMenu): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenu):
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::populate):
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showSelectionServiceMenu): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleSelectionServiceClick):

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

5 years agoHTMLPreloadScanner should preload iframes
cdumez@apple.com [Fri, 16 Oct 2015 17:06:06 +0000 (17:06 +0000)]
HTMLPreloadScanner should preload iframes
https://bugs.webkit.org/show_bug.cgi?id=150097
<rdar://problem/23094475>

Reviewed by Antti Koivisto.

Source/WebCore:

HTMLPreloadScanner should preload iframes to decrease page load time.

Tests:
- fast/preloader/frame-src.html
- http/tests/loading/preload-no-store-frame-src.html

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::tagIdFor):
(WebCore::TokenPreloadScanner::initiatorFor):
(WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
(WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
(WebCore::TokenPreloadScanner::StartTagScanner::setUrlToLoad): Deleted.
(WebCore::TokenPreloadScanner::StartTagScanner::charset): Deleted.
* html/parser/HTMLPreloadScanner.h:

LayoutTests:

Add layout test to check that iframes are indeed preloaded.

* fast/preloader/frame-src-expected.txt: Added.
* fast/preloader/frame-src.html: Added.
* fast/preloader/resources/testFrame.html: Added.
* http/tests/loading/preload-no-store-frame-src-expected.txt: Added.
* http/tests/loading/preload-no-store-frame-src.html: Added.

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

5 years agoUnreviewed fix after r191175.
ossy@webkit.org [Fri, 16 Oct 2015 16:30:41 +0000 (16:30 +0000)]
Unreviewed fix after r191175.

* js/regress-150220-expected.txt: Added.

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

5 years agoImplement the "all" CSS property.
hyatt@apple.com [Fri, 16 Oct 2015 16:12:03 +0000 (16:12 +0000)]
Implement the "all" CSS property.
https://bugs.webkit.org/show_bug.cgi?id=116966

Reviewed by Zalan Bujtas.

Source/WebCore:

Added new tests in fast/css.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
Don't support "all" from computed style for now.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
Make sure to bail after checking inherit/unset/initial for all, since you can't actually
accept longhand values in the shorthand declarations.

(WebCore::CSSParser::parseAnimationProperty):
"all" for animations is a special value and should not be confused with the property. It
animates everything and does not omit unicode-bidi/direction the way the "all" property does.

* css/CSSPropertyNames.in:
Add the "all" property to the list and use a special keyword in the Longhands value, "all",
that makeprop.pl will look for. This way we don't have to dump every single CSS property
into the Longhands expression, since that would be nuts.

* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
Look for a common value across all properties supported by "all". That way you can get
back inherit/initial/unset from it.

* css/makeprop.pl:
Make the perl script look for "all" in the longhand list, and if it sees it, put every
single CSS property into the list for the all shorthand.

LayoutTests:

Added tests for the "all property, including a variables test!

* fast/css/all-keyword-direction-expected.html: Added.
* fast/css/all-keyword-direction.html: Added.
* fast/css/all-keyword-inherit-expected.html: Added.
* fast/css/all-keyword-inherit.html: Added.
* fast/css/all-keyword-initial-expected.html: Added.
* fast/css/all-keyword-initial.html: Added.
* fast/css/all-keyword-unset-expected.html: Added.
* fast/css/all-keyword-unset.html: Added.
* fast/css/variables/all-keyword-unset-expected.html: Added.
* fast/css/variables/all-keyword-unset.html: Added.

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

5 years agoBinding generator should use templated JSXXConstructor
youenn.fablet@crf.canon.fr [Fri, 16 Oct 2015 15:56:12 +0000 (15:56 +0000)]
Binding generator should use templated JSXXConstructor
https://bugs.webkit.org/show_bug.cgi?id=149952

Reviewed by Darin Adler.

Adding constructor templates:
- JSDOMConstructor: usual JS constructors
- JSDOMNamedConstructor: for named constructors
- JSDOMConstructorNotConstructable: for objects that cannot be constructed directly from JS.

Binding generator is using these 3 templates and is generating specializations for construct, initializeProperties and s_info.
These templates may also be used for private or custom constructors as examplified by JSImageConstructor
and JSReadableStream reader and controller private constructors.

Updated binding generator to use those templates.
Updated JSImageConstructor.cpp to use JSDOMNamedConstructor.
Updated default template implementation of JSBuiltinConstructor::createObject.
Updated generated helper routines of binding generator to fit with the templates.

A further patch should remove DOMConstructorWithDocument and DOMConstructorJSBuiltinObject.

Covered by binding tests.

* bindings/js/JSDOMConstructor.h:
(WebCore::JSDOMConstructorNotConstructable::create):
(WebCore::JSDOMConstructorNotConstructable::createStructure):
(WebCore::JSDOMConstructorNotConstructable::JSDOMConstructorNotConstructable):
(WebCore::JSDOMConstructorNotConstructable::initializeProperties):
(WebCore::JSDOMConstructorNotConstructable<JSClass>::finishCreation):
(WebCore::JSDOMConstructor::create):
(WebCore::JSDOMConstructor::createStructure):
(WebCore::JSDOMConstructor::JSDOMConstructor):
(WebCore::JSDOMConstructor::initializeProperties):
(WebCore::JSDOMConstructor<JSClass>::finishCreation):
(WebCore::JSDOMConstructor<JSClass>::getConstructData):
(WebCore::JSDOMNamedConstructor::create):
(WebCore::JSDOMNamedConstructor::createStructure):
(WebCore::JSDOMNamedConstructor::JSDOMNamedConstructor):
(WebCore::JSDOMNamedConstructor::initializeProperties):
(WebCore::JSDOMNamedConstructor<JSClass>::finishCreation):
(WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::image):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::initializeProperties):
(WebCore::JSImageConstructor::construct):
(WebCore::createImageConstructor):
* bindings/js/JSImageConstructor.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GetConstructorTemplateClassName):
(GenerateConstructorDeclaration):
(GenerateOverloadedConstructorDefinition):
(GenerateConstructorDefinition):
(GenerateConstructorHelperMethods):
(GenerateImplementation): Deleted.
(GenerateConstructorDefinitions): Deleted.
(HasCustomSetter): Deleted.
(HasCustomMethod): Deleted.
(NeedsConstructorProperty): Deleted.
(ComputeFunctionSpecial): Deleted.
(AddJSBuiltinIncludesIfNeeded): Deleted.
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
(WebCore::JSTestActiveDOMObjectPrototype::finishCreation): Deleted.
(WebCore::JSTestActiveDOMObject::JSTestActiveDOMObject): Deleted.
* bindings/scripts/test/JS/JSTestCallback.cpp:
(WebCore::JSTestCallbackConstructor::initializeProperties):
(WebCore::JSTestCallback::callbackWithNoParam): Deleted.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::initializeProperties):
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation): Deleted.
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject): Deleted.
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype): Deleted.
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype): Deleted.
(WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy): Deleted.
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
(WebCore::JSTestCustomNamedGetterConstructor::initializeProperties):
(WebCore::JSTestCustomNamedGetterPrototype::finishCreation): Deleted.
(WebCore::JSTestCustomNamedGetter::JSTestCustomNamedGetter): Deleted.
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::JSTestEventConstructorConstructor::construct):
(WebCore::JSTestEventConstructorConstructor::initializeProperties):
(WebCore::JSTestEventConstructorPrototype::finishCreation): Deleted.
(WebCore::JSTestEventConstructor::JSTestEventConstructor): Deleted.
(WebCore::JSTestEventConstructor::getPrototype): Deleted.
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTargetConstructor::initializeProperties):
(WebCore::JSTestEventTargetPrototype::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::JSTestExceptionConstructor::initializeProperties):
(WebCore::JSTestExceptionPrototype::finishCreation): Deleted.
(WebCore::JSTestException::JSTestException): Deleted.
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
(WebCore::JSTestGenerateIsReachablePrototype::finishCreation): Deleted.
(WebCore::JSTestGenerateIsReachable::JSTestGenerateIsReachable): Deleted.
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::JSTestInterfaceConstructor::construct):
(WebCore::JSTestInterfaceConstructor::initializeProperties):
(WebCore::JSTestInterfaceConstructor::getConstructData):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
(WebCore::JSTestJSBuiltinConstructorConstructor::createJSObject):
(WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
(WebCore::JSTestJSBuiltinConstructorPrototype::finishCreation): Deleted.
(WebCore::JSTestJSBuiltinConstructor::JSTestJSBuiltinConstructor): Deleted.
(WebCore::JSTestJSBuiltinConstructor::createPrototype): Deleted.
(WebCore::JSTestJSBuiltinConstructor::getPrototype): Deleted.
(WebCore::JSTestJSBuiltinConstructor::destroy): Deleted.
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
(WebCore::JSTestMediaQueryListListenerPrototype::finishCreation): Deleted.
(WebCore::JSTestMediaQueryListListener::JSTestMediaQueryListListener): Deleted.
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::JSTestNamedConstructorConstructor::initializeProperties):
(WebCore::JSTestNamedConstructorNamedConstructor::construct):
(WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
(WebCore::JSTestNamedConstructorPrototype::finishCreation): Deleted.
(WebCore::JSTestNamedConstructor::JSTestNamedConstructor): Deleted.
(WebCore::jsTestNamedConstructorConstructor): Deleted.
(WebCore::JSTestNamedConstructor::getConstructor): Deleted.
(WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots): Deleted.
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodeConstructor::construct):
(WebCore::JSTestNodeConstructor::initializeProperties):
(WebCore::JSTestNodePrototype::finishCreation): Deleted.
(WebCore::JSTestNode::JSTestNode): Deleted.
(WebCore::JSTestNode::getPrototype): Deleted.
* bindings/scripts/test/JS/JSTestNondeterministic.cpp:
(WebCore::JSTestNondeterministicConstructor::initializeProperties):
(WebCore::JSTestNondeterministicPrototype::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::construct):
(WebCore::JSTestObjConstructor::initializeProperties):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::JSTestOverloadedConstructorsConstructor::construct):
(WebCore::JSTestOverloadedConstructorsConstructor::initializeProperties):
(WebCore::constructJSTestOverloadedConstructors1): Deleted.
(WebCore::constructJSTestOverloadedConstructors2): Deleted.
(WebCore::JSTestOverloadedConstructorsPrototype::finishCreation): Deleted.
(WebCore::JSTestOverloadedConstructors::JSTestOverloadedConstructors): Deleted.
(WebCore::JSTestOverloadedConstructors::createPrototype): Deleted.
(WebCore::JSTestOverloadedConstructors::getPrototype): Deleted.
(WebCore::JSTestOverloadedConstructors::destroy): Deleted.
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::JSTestOverrideBuiltinsConstructor::initializeProperties):
(WebCore::JSTestOverrideBuiltinsPrototype::finishCreation): Deleted.
(WebCore::JSTestOverrideBuiltins::JSTestOverrideBuiltins): Deleted.
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterfaceConstructor::initializeProperties):
(WebCore::JSTestSerializedScriptValueInterfacePrototype::finishCreation): Deleted.
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::JSTestTypedefsConstructor::construct):
(WebCore::JSTestTypedefsConstructor::initializeProperties):
(WebCore::JSTestTypedefsPrototype::finishCreation): Deleted.
* bindings/scripts/test/JS/JSattribute.cpp:
(WebCore::JSattributeConstructor::initializeProperties):
(WebCore::JSattributePrototype::finishCreation): Deleted.
(WebCore::JSattribute::JSattribute): Deleted.
* bindings/scripts/test/JS/JSreadonly.cpp:
(WebCore::JSreadonlyConstructor::initializeProperties):
(WebCore::JSreadonlyPrototype::finishCreation): Deleted.
(WebCore::JSreadonly::JSreadonly): Deleted.

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

5 years agoREGRESSION (r190289): Repro crash clicking back button on netflix.com
msaboff@apple.com [Fri, 16 Oct 2015 14:43:02 +0000 (14:43 +0000)]
REGRESSION (r190289): Repro crash clicking back button on netflix.com
https://bugs.webkit.org/show_bug.cgi?id=150220

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Since constructors check for a valid new "this" object and return it, we can't make
a tail call to another function from within a constructor.

Re-enabled the tail calls and the related tail call tests.

Did some other miscellaneous clean up in the tail call code as part of the debugging.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::callPreflight):
* interpreter/Interpreter.h:
(JSC::calleeFrameForVarargs):
* runtime/Options.h:
* tests/es6.yaml:
* tests/stress/dfg-tail-calls.js:
(nonInlinedTailCall.callee):
* tests/stress/mutual-tail-call-no-stack-overflow.js:
(shouldThrow):
* tests/stress/tail-call-in-inline-cache.js:
(tail):
* tests/stress/tail-call-no-stack-overflow.js:
(shouldThrow):
* tests/stress/tail-call-recognize.js:
(callerMustBeRun):
* tests/stress/tail-call-varargs-no-stack-overflow.js:
(shouldThrow):

LayoutTests:

Added a new regression test.  Changed the expected output of caller-property
to correspond with tail calls enabled.

* js/caller-property-expected.txt:
* js/regress-150220-expected.tx: Added.
* js/regress-150220.html: Added.
* js/script-tests/regress-150220.js: Added.
(Obj):
(SubObj):

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

5 years ago[GStreamer] ASSERTION FAILED: !m_adoptionIsRequired in MediaSourceGStreamer::addSourc...
carlosgc@webkit.org [Fri, 16 Oct 2015 10:47:31 +0000 (10:47 +0000)]
[GStreamer] ASSERTION FAILED: !m_adoptionIsRequired in MediaSourceGStreamer::addSourceBuffer
https://bugs.webkit.org/show_bug.cgi?id=150229

Reviewed by Philippe Normand.

This happens in the debug bot in all media source tests that run
that code. The problem is that we are creating a RefPtr without
adopting the reference.

* platform/graphics/gstreamer/MediaSourceGStreamer.cpp:
(WebCore::MediaSourceGStreamer::addSourceBuffer): Use
SourceBufferPrivateGStreamer::create().
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::create): Added to make
sure you can't create a SourceBufferPrivateGStreamer without
adopting the reference.
(WebCore::SourceBufferPrivateGStreamer::SourceBufferPrivateGStreamer):
Takes a reference to the client instead of a PassRefPtr.
* platform/graphics/gstreamer/SourceBufferPrivateGStreamer.h:

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

5 years agoUnreviewed EFL Gardening on 15th Oct.
commit-queue@webkit.org [Fri, 16 Oct 2015 07:29:58 +0000 (07:29 +0000)]
Unreviewed EFL Gardening on 15th Oct.
https://bugs.webkit.org/show_bug.cgi?id=150223

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-10-16

* platform/efl/TestExpectations:

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

5 years ago[GTK] Try to fix the build after r191137
commit-queue@webkit.org [Fri, 16 Oct 2015 07:14:03 +0000 (07:14 +0000)]
[GTK] Try to fix the build after r191137
https://bugs.webkit.org/show_bug.cgi?id=150222

Patch by Hunseop Jeong <hs85.jeong@samsung.com> on 2015-10-16
Reviewed by Carlos Garcia Campos.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithKeyEvent):
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::populate):
(WebKit::WebContextMenuProxyGtk::showContextMenu):
(WebKit::WebContextMenuProxyGtk::hideContextMenu):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
* UIProcess/gtk/WebContextMenuProxyGtk.h:
(WebKit::WebContextMenuProxyGtk::create):
(WebKit::WebContextMenuProxyGtk::gtkMenu):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::WebPopupMenuProxyGtk):
* UIProcess/gtk/WebPopupMenuProxyGtk.h:
(WebKit::WebPopupMenuProxyGtk::create):
(WebKit::WebPopupMenuProxyGtk::setCurrentlySelectedMenuItem):

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

5 years ago[Content Extensions] Content blocking rules are not consulted for pings
achristensen@apple.com [Fri, 16 Oct 2015 04:26:43 +0000 (04:26 +0000)]
[Content Extensions] Content blocking rules are not consulted for pings
https://bugs.webkit.org/show_bug.cgi?id=149873

Patch by Roopesh Chander <roop@roopc.net> on 2015-10-15
Reviewed by Alex Christensen.

Source/WebCore:

This patch makes requests sent through the PingLoader
respect content blocking rules. Specifically, the following
are now subject to content blocking rules:

 1. <a ping> pings
 2. Images loaded in unload / beforeunload / pagehide handlers
 3. X-XSS-Protection / CSP violation reports

Tests: http/tests/contentextensions/block-cookies-in-csp-report.html
       http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html
       http/tests/contentextensions/block-cookies-in-ping.html
       http/tests/contentextensions/block-csp-report.html
       http/tests/contentextensions/block-image-load-in-onunload.html
       http/tests/contentextensions/block-ping.html
       http/tests/contentextensions/hide-on-csp-report.html

* loader/PingLoader.cpp:
(WebCore::processContentExtensionRulesForLoad):
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):

LayoutTests:

Tests for ensuring that requests loaded through the PingLoader
are subject to content blocking rules.

* http/tests/contentextensions/block-cookies-in-csp-report-expected.txt: Added.
* http/tests/contentextensions/block-cookies-in-csp-report.html: Added.
* http/tests/contentextensions/block-cookies-in-csp-report.html.json: Added.
* http/tests/contentextensions/block-cookies-in-image-load-in-onunload-expected.txt: Added.
* http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html: Added.
* http/tests/contentextensions/block-cookies-in-image-load-in-onunload.html.json: Added.
* http/tests/contentextensions/block-cookies-in-ping-expected.txt: Added.
* http/tests/contentextensions/block-cookies-in-ping.html: Added.
* http/tests/contentextensions/block-cookies-in-ping.html.json: Added.
* http/tests/contentextensions/block-csp-report-expected.txt: Added.
* http/tests/contentextensions/block-csp-report.html: Added.
* http/tests/contentextensions/block-csp-report.html.json: Added.
* http/tests/contentextensions/block-image-load-in-onunload-expected.txt: Added.
* http/tests/contentextensions/block-image-load-in-onunload.html: Added.
* http/tests/contentextensions/block-image-load-in-onunload.html.json: Added.
* http/tests/contentextensions/block-ping-expected.txt: Added.
* http/tests/contentextensions/block-ping.html: Added.
* http/tests/contentextensions/block-ping.html.json: Added.
* http/tests/contentextensions/hide-on-csp-report-expected.txt: Added.
* http/tests/contentextensions/hide-on-csp-report.html: Added.
* http/tests/contentextensions/hide-on-csp-report.html.json: Added.
* http/tests/contentextensions/resources/check-ping.html: Added.
* http/tests/contentextensions/resources/delete-ping.php: Added.
* http/tests/contentextensions/resources/get-ping-data.php: Added.
* http/tests/contentextensions/resources/ping-file-path.php: Added.
* http/tests/contentextensions/resources/redirect.php: Added.
* http/tests/contentextensions/resources/save-ping.php: Added.

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

5 years agoUnreviewed gardening. Make inspector/heap/gc.html more reliable.
joepeck@webkit.org [Fri, 16 Oct 2015 03:54:06 +0000 (03:54 +0000)]
Unreviewed gardening. Make inspector/heap/gc.html more reliable.

* inspector/heap/gc.html:
Stop outputing after we see the first Full GC. Resolving waits
for pending events which could incldue more GCs.

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

5 years agoUnreviewed. Attempted EFL build fix 2 after r191159.
joepeck@webkit.org [Fri, 16 Oct 2015 03:07:25 +0000 (03:07 +0000)]
Unreviewed. Attempted EFL build fix 2 after r191159.

* PlatformEfl.cmake:

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

5 years agoUnreviewed. Attempted EFL build fix after r191159.
joepeck@webkit.org [Fri, 16 Oct 2015 02:58:36 +0000 (02:58 +0000)]
Unreviewed. Attempted EFL build fix after r191159.

* PlatformEfl.cmake:

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

5 years ago EFL build fix since r191137
gyuyoung.kim@webkit.org [Fri, 16 Oct 2015 02:51:06 +0000 (02:51 +0000)]
 EFL build fix since r191137

 Unreviewed EFL build fix.

* UIProcess/CoordinatedGraphics/WebView.cpp: Removed.

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

5 years agoUnreviewed. Build fix after r191160.
joepeck@webkit.org [Fri, 16 Oct 2015 02:36:29 +0000 (02:36 +0000)]
Unreviewed. Build fix after r191160.

* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::didGarbageCollect):

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

5 years agoUnreviewed. Revert part of r191159 which caused ASSERTs.
joepeck@webkit.org [Fri, 16 Oct 2015 02:34:24 +0000 (02:34 +0000)]
Unreviewed. Revert part of r191159 which caused ASSERTs.

A review comment suggested using WeakPtr. It is not suitable
here and causes ASSERTs across threads. Will address separately.

* inspector/agents/InspectorHeapAgent.h:
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::didGarbageCollect):
(Inspector::InspectorHeapAgent::InspectorHeapAgent): Deleted.

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

5 years agoWeb Inspector: Include Garbage Collection Event in Timeline
joepeck@webkit.org [Fri, 16 Oct 2015 02:15:56 +0000 (02:15 +0000)]
Web Inspector: Include Garbage Collection Event in Timeline
https://bugs.webkit.org/show_bug.cgi?id=142510

Reviewed by Geoffrey Garen and Brian Burg.

Source/JavaScriptCore:

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
Include new files in the build.

* heap/HeapObserver.h:
(JSC::HeapObserver::~HeapObserver):
* heap/Heap.cpp:
(JSC::Heap::willStartCollection):
(JSC::Heap::didFinishCollection):
* heap/Heap.h:
(JSC::Heap::addObserver):
(JSC::Heap::removeObserver):
Allow observers on heap to add hooks for starting / ending garbage collection.

* inspector/InspectorEnvironment.h:
* inspector/JSGlobalObjectInspectorController.cpp:
(Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
(Inspector::JSGlobalObjectInspectorController::vm):
* inspector/JSGlobalObjectInspectorController.h:
Access the VM through the InspectorEnvironment as it won't change.

* inspector/agents/InspectorHeapAgent.cpp: Added.
(Inspector::InspectorHeapAgent::InspectorHeapAgent):
(Inspector::InspectorHeapAgent::~InspectorHeapAgent):
(Inspector::InspectorHeapAgent::didCreateFrontendAndBackend):
(Inspector::InspectorHeapAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorHeapAgent::enable):
(Inspector::InspectorHeapAgent::disable):
(Inspector::InspectorHeapAgent::gc):
(Inspector::protocolTypeForHeapOperation):
(Inspector::InspectorHeapAgent::willGarbageCollect):
(Inspector::InspectorHeapAgent::didGarbageCollect):
* inspector/agents/InspectorHeapAgent.h: Added.
* inspector/protocol/Heap.json: Added.
New domain and agent to handle tasks related to the JavaScriptCore heap.

Source/WebCore:

Tests: inspector/heap/garbageCollected.html
       inspector/heap/gc.html

* ForwardingHeaders/heap/HeapObserver.h: Added.
* ForwardingHeaders/inspector/agents/InspectorHeapAgent.h: Added.
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
Forwarding headers.

* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::vm):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::vm):
* inspector/WorkerInspectorController.h:
Implement InspectorEnvironment::vm and create a Heap agent for the
Page inspector controller.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
(Array.prototype.partition):
Helper to partition an Array into two arrays.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Base/Main.js:
(WebInspector.loaded):
* UserInterface/Test.html:
* UserInterface/Test/Test.js:
(WebInspector.loaded):
* UserInterface/Protocol/HeapObserver.js: Added.
(WebInspector.HeapObserver.prototype.garbageCollected):
(WebInspector.HeapObserver):
Create the new observer and manager.

* UserInterface/Models/GarbageCollection.js: Added.
(WebInspector.GarbageCollection):
(WebInspector.GarbageCollection.fromPayload):
(WebInspector.GarbageCollection.prototype.get type):
(WebInspector.GarbageCollection.prototype.get startTime):
(WebInspector.GarbageCollection.prototype.get endTime):
(WebInspector.GarbageCollection.prototype.get duration):
Model object for Heap.GarbageCollection.

* UserInterface/Controllers/HeapManager.js: Added.
(WebInspector.HeapManager):
(WebInspector.HeapManager.prototype.garbageCollected):
Dispatch events with the GC object.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager):
(WebInspector.TimelineManager.prototype._garbageCollected):
Include new GC Timeline Events as Script events.

* UserInterface/Views/ScriptTimelineOverviewGraph.js:
(WebInspector.ScriptTimelineOverviewGraph.prototype.updateLayout):
For the Script overview, make two sets of bars, one for Scripts and one for GCs.
The GCs bar will be overlaid on top of the the Scripts bar. This is particularly
useful since a GC can happen during script execution.

* UserInterface/Images/TimelineRecordGarbageCollection.svg: Added.
* UserInterface/Main.html:
* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord.prototype.isGarbageCollection):
(WebInspector.ScriptTimelineRecord.EventType.displayName):
* UserInterface/Views/ScriptTimelineDataGridNode.js:
(WebInspector.ScriptTimelineDataGridNode.prototype.get data):
(WebInspector.ScriptTimelineDataGridNode.prototype.createCellContent):
(WebInspector.ScriptTimelineDataGridNode):
* UserInterface/Views/ScriptTimelineView.js:
(WebInspector.ScriptTimelineView.prototype._processPendingRecords):
* UserInterface/Views/SourceCodeTimelineTreeElement.js:
(WebInspector.SourceCodeTimelineTreeElement):
* UserInterface/Views/TimelineIcons.css:
(.garbage-collection-profile-record .icon):
* UserInterface/Views/TimelineRecordBar.css:
(.timeline-record-bar.timeline-record-type-script.script-timeline-record-garbage-collected > .segment):
UI for GC events.

* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.createCombinedBars):
Simplify by storing start time into a variable.

* UserInterface/Views/TimelineRecordTreeElement.js:
(WebInspector.TimelineRecordTreeElement):
Icon for GC events.

LayoutTests:

* inspector/heap/garbageCollected-expected.txt: Added.
* inspector/heap/garbageCollected.html: Added.
* inspector/heap/gc-expected.txt: Added.
* inspector/heap/gc.html: Added.

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

5 years agoRemove deprecated function insertRule(), replace with appendRule()
dino@apple.com [Fri, 16 Oct 2015 01:33:00 +0000 (01:33 +0000)]
Remove deprecated function insertRule(), replace with appendRule()
https://bugs.webkit.org/show_bug.cgi?id=150188

Unreviewed. This was a mistake in my review of Ryan's patch.
The CSSOM is confusing. This test was not always using a CSSKeyframesRule
object, so it should still be calling insertRule. This does produce
a console message, so added that to the expected result.

* http/tests/css/resources/shared-stylesheet-mutation.js:
(executeTests): Back to insertRule.
* http/tests/css/shared-stylesheet-mutation-expected.txt:
* http/tests/css/shared-stylesheet-mutation-preconstruct-expected.txt:

* http/tests/css/resources/shared-stylesheet-mutation.js:
(executeTests): Back to insertRule.

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

5 years agoUnreviewed, rolling out r191156.
commit-queue@webkit.org [Fri, 16 Oct 2015 00:34:38 +0000 (00:34 +0000)]
Unreviewed, rolling out r191156.
https://bugs.webkit.org/show_bug.cgi?id=150215

Introduced crashing test (Requested by bradee-oh on #webkit).

Reverted changeset:

"Modern IDB: Support IDBDatabase.close()."
https://bugs.webkit.org/show_bug.cgi?id=150150
http://trac.webkit.org/changeset/191156

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

5 years agoModern IDB: Support IDBDatabase.close().
beidson@apple.com [Fri, 16 Oct 2015 00:25:02 +0000 (00:25 +0000)]
Modern IDB: Support IDBDatabase.close().
https://bugs.webkit.org/show_bug.cgi?id=150150

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to storage/indexeddb/modern/opendatabase-versions.html).

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBDatabaseImpl.cpp:
(WebCore::IDBClient::IDBDatabase::IDBDatabase):
(WebCore::IDBClient::IDBDatabase::~IDBDatabase):
(WebCore::IDBClient::IDBDatabase::close):
(WebCore::IDBClient::IDBDatabase::maybeCloseInServer):
(WebCore::IDBClient::IDBDatabase::commitTransaction):
* Modules/indexeddb/client/IDBDatabaseImpl.h:
(WebCore::IDBClient::IDBDatabase::databaseConnectionIdentifier):

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::result):

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::handleOpenDatabaseOperations): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::hasNonFinishedTransactions):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

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

LayoutTests:

* storage/indexeddb/modern/opendatabase-versions-expected.txt:
* storage/indexeddb/modern/opendatabase-versions.html:

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

5 years agoPatch parseKeywordValue to accept "unset" so that it goes down the faster parsing...
hyatt@apple.com [Fri, 16 Oct 2015 00:18:35 +0000 (00:18 +0000)]
Patch parseKeywordValue to accept "unset" so that it goes down the faster parsing path.
https://bugs.webkit.org/show_bug.cgi?id=150213

Reviewed by Dean Jackson.

No new tests as correctness doesn't change (just speed).

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

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

5 years agoMarking another disk-cache test as flaky on mac-wk2
commit-queue@webkit.org [Fri, 16 Oct 2015 00:09:38 +0000 (00:09 +0000)]
Marking another disk-cache test as flaky on mac-wk2
https://bugs.webkit.org/show_bug.cgi?id=149087

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-15
Reviewed by Alexey Proskuryakov.

* platform/mac-wk2/TestExpectations:

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

5 years agoAdd support for the CSS 'unset' keyword.
hyatt@apple.com [Thu, 15 Oct 2015 23:54:46 +0000 (23:54 +0000)]
Add support for the CSS 'unset' keyword.
https://bugs.webkit.org/show_bug.cgi?id=148614

Reviewed by Dean Jackson.

Source/WebCore:

Added new test in fast/css, and existing variables tests also use unset in several tests.

* WebCore.xcodeproj/project.pbxproj:
Add CSSUnsetValue.cpp to the project.

* bindings/objc/DOMCSS.mm:
(kitClass):
Make sure UNSET is handled in the switch.

* css/CSSParser.cpp:
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseCustomPropertyDeclaration):
Add cases to create a CSSUnsetValue properly.

* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::styleImage):
(WebCore::CSSToStyleMap::mapFillAttachment):
(WebCore::CSSToStyleMap::mapFillClip):
(WebCore::CSSToStyleMap::mapFillComposite):
(WebCore::CSSToStyleMap::mapFillBlendMode):
(WebCore::CSSToStyleMap::mapFillOrigin):
(WebCore::CSSToStyleMap::mapFillImage):
(WebCore::CSSToStyleMap::mapFillRepeatX):
(WebCore::CSSToStyleMap::mapFillRepeatY):
(WebCore::convertToLengthSize):
(WebCore::CSSToStyleMap::mapFillSize):
(WebCore::CSSToStyleMap::mapFillXPosition):
(WebCore::CSSToStyleMap::mapFillYPosition):
(WebCore::CSSToStyleMap::mapFillMaskSourceType):
(WebCore::CSSToStyleMap::mapAnimationDelay):
(WebCore::CSSToStyleMap::mapAnimationDirection):
(WebCore::CSSToStyleMap::mapAnimationDuration):
(WebCore::CSSToStyleMap::mapAnimationFillMode):
(WebCore::CSSToStyleMap::mapAnimationIterationCount):
(WebCore::CSSToStyleMap::mapAnimationName):
(WebCore::CSSToStyleMap::mapAnimationPlayState):
(WebCore::CSSToStyleMap::mapAnimationProperty):
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
(WebCore::CSSToStyleMap::mapAnimationTrigger):
The background and animation functions need to check for unset and be able to map it properly to initial. This is done
with a new treatAsInitial method on CSSValue that can take the property ID and check for both initial
or unset on a non-inherited property.

* css/CSSUnsetValue.cpp: Added.
(WebCore::CSSUnsetValue::customCSSText):
* css/CSSUnsetValue.h: Added.
(WebCore::CSSUnsetValue::create):
(WebCore::CSSUnsetValue::equals):
(WebCore::CSSUnsetValue::CSSUnsetValue):
This new value looks exactly like CSSInheritedValue and CSSInitialValue.

* css/CSSValue.cpp:
(WebCore::CSSValue::cssValueType):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::isInvalidCustomPropertyValue):
(WebCore::CSSValue::treatAsInheritedValue):
(WebCore::CSSValue::treatAsInitialValue):
* css/CSSValue.h:
(WebCore::CSSValue::isUnsetValue):
Add isUnsetValue and the UnsetClass. Add support for treatAsInheritedValue and treatAsInitialValue to have
a way to query for initial/inherit or the matching unset type.

* css/CSSValueKeywords.in:
Add the unset keyword.

* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::CSSValuePool):
* css/CSSValuePool.h:
(WebCore::CSSValuePool::createUnsetValue):
Have a singleton model for unset just like we do for inherit/initial.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Handle unset correctly. It maps to inherit for inherited properties and initial for non-inherited ones.

LayoutTests:

* TestExpectations:
Remove the 3 failing variables tests that used the unset keyword now that they pass.

* fast/css/unset-keyword-expected.html: Added.
* fast/css/unset-keyword.html: Added.
New test for both inherited and initial properties.

* fast/css/variables/test-suite/129-expected.html: Added.
* fast/css/variables/test-suite/129.html: Added.
* fast/css/variables/test-suite/130-expected.html: Added.
* fast/css/variables/test-suite/130.html: Added.
* fast/css/variables/test-suite/134-expected.html: Added.
* fast/css/variables/test-suite/134.html: Added.
* fast/css/variables/test-suite/failures/129-expected.html: Removed.
* fast/css/variables/test-suite/failures/129.html: Removed.
* fast/css/variables/test-suite/failures/130-expected.html: Removed.
* fast/css/variables/test-suite/failures/130.html: Removed.
* fast/css/variables/test-suite/failures/134-expected.html: Removed.
* fast/css/variables/test-suite/failures/134.html: Removed.
Move these tests into the passing directory.

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

5 years agoMigrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
mmaxfield@apple.com [Thu, 15 Oct 2015 23:20:07 +0000 (23:20 +0000)]
Migrate to CGContextSetBaseCTM() and CGContextResetClip() from WKSI
https://bugs.webkit.org/show_bug.cgi?id=150155

Reviewed by Tim Horton.

Source/WebCore:

No new tests because there is no behavior change.

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::platformApplyDeviceScaleFactor):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::putByteArray):
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.
* WebView/WebView.mm:
(-[WebView _setBaseCTM:forContext:]):

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.

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

5 years agoRemove deprecated function insertRule(), replace with appendRule()
dino@apple.com [Thu, 15 Oct 2015 23:18:09 +0000 (23:18 +0000)]
Remove deprecated function insertRule(), replace with appendRule()
https://bugs.webkit.org/show_bug.cgi?id=150188

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-15
Reviewed by Dean Jackson.

* http/tests/css/resources/shared-stylesheet-mutation.js:
(executeTests):

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

5 years agoFix the iOS build. And hopefully not breaking the other builds
dino@apple.com [Thu, 15 Oct 2015 23:03:17 +0000 (23:03 +0000)]
Fix the iOS build. And hopefully not breaking the other builds
at the same time.

* UIProcess/PageClient.h:
* UIProcess/WebContextMenuProxy.cpp:
* UIProcess/WebContextMenuProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:

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

5 years agoUnreviewed, rolling out r191135.
commit-queue@webkit.org [Thu, 15 Oct 2015 23:02:43 +0000 (23:02 +0000)]
Unreviewed, rolling out r191135.
https://bugs.webkit.org/show_bug.cgi?id=150197

This patch causes 50+ LayoutTest crashes related to the
inspector (Requested by ryanhaddad on #webkit).

Reverted changeset:

"Web Inspector: JavaScriptCore should parse sourceURL and
sourceMappingURL directives"
https://bugs.webkit.org/show_bug.cgi?id=150096
http://trac.webkit.org/changeset/191135

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

5 years agoUse the context inside WebContextMenuProxyMac
andersca@apple.com [Thu, 15 Oct 2015 22:51:33 +0000 (22:51 +0000)]
Use the context inside WebContextMenuProxyMac
https://bugs.webkit.org/show_bug.cgi?id=150196

Reviewed by Tim Horton.

* UIProcess/WebContextMenuProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::populate):
(WebKit::WebContextMenuProxyMac::showContextMenu):

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

5 years agoUse the context menu location that's stored in the context data
andersca@apple.com [Thu, 15 Oct 2015 22:34:20 +0000 (22:34 +0000)]
Use the context menu location that's stored in the context data
https://bugs.webkit.org/show_bug.cgi?id=150194

Reviewed by Tim Horton.

* UIProcess/WebContextMenuProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/mac/WebContextMenuProxyMac.h:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::showContextMenu):

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

5 years agoFixed the build.
mitz@apple.com [Thu, 15 Oct 2015 22:20:03 +0000 (22:20 +0000)]
Fixed the build.

* platform/network/mac/ResourceHandleMac.mm:

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

5 years agoStore the context menu data and user data in the WebContextMenuProxy object
andersca@apple.com [Thu, 15 Oct 2015 22:15:45 +0000 (22:15 +0000)]
Store the context menu data and user data in the WebContextMenuProxy object
https://bugs.webkit.org/show_bug.cgi?id=150191

Reviewed by Tim Horton.

* UIProcess/PageClient.h:
* UIProcess/WebContextMenuProxy.cpp:
(WebKit::WebContextMenuProxy::WebContextMenuProxy):
* UIProcess/WebContextMenuProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createContextMenuProxy):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createContextMenuProxy):
* UIProcess/mac/WebContextMenuProxyMac.h:
(WebKit::WebContextMenuProxyMac::create):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):

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

5 years ago[Cocoa] Stop using WKSetNSURLConnectionDefersCallbacks
mitz@apple.com [Thu, 15 Oct 2015 21:59:24 +0000 (21:59 +0000)]
[Cocoa] Stop using WKSetNSURLConnectionDefersCallbacks
https://bugs.webkit.org/show_bug.cgi?id=150189

Reviewed by Anders Carlsson.

Source/WebCore:

* platform/ios/WebCoreSystemInterfaceIOS.mm: Removed definition.
* platform/mac/WebCoreSystemInterface.h: Removed declaration.
* platform/mac/WebCoreSystemInterface.mm: Removed definition.

* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::start): Changed to use -[NSURLConnection setDefersLoading:].
(WebCore::ResourceHandle::platformSetDefersLoading): Ditto.

* platform/spi/cocoa/NSURLConnectionSPI.h: Added declaration of
  -[NSURLConnection setDefersLoading:].

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Removed initialization.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Removed initialization.

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

5 years ago2015-10-15 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Thu, 15 Oct 2015 21:52:05 +0000 (21:52 +0000)]
2015-10-15  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, rolling out r191003.
        https://bugs.webkit.org/show_bug.cgi?id=150042

        We're seeing some crashes in GC beneath speculationFromCell. Maybe this
        patch caused them?

        Reverted changeset:

        CodeBlock write barriers should be precise
        https://bugs.webkit.org/show_bug.cgi?id=150042
        http://trac.webkit.org/changeset/191003

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

5 years agoFix build.
andersca@apple.com [Thu, 15 Oct 2015 21:31:09 +0000 (21:31 +0000)]
Fix build.

* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::~FrameInfo):
* UIProcess/API/APIFrameInfo.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:

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

5 years agoCTTE menu proxies
andersca@apple.com [Thu, 15 Oct 2015 21:27:15 +0000 (21:27 +0000)]
CTTE menu proxies
https://bugs.webkit.org/show_bug.cgi?id=150187

Reviewed by Tim Horton.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showPopupMenu):
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPopupMenuProxy.h:
(WebKit::WebPopupMenuProxy::WebPopupMenuProxy):
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy): Deleted.
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createPopupMenuProxy):
(WebKit::PageClientImpl::createContextMenuProxy):
* UIProcess/mac/WebContextMenuProxyMac.h:
(WebKit::WebContextMenuProxyMac::create):
(WebKit::WebContextMenuProxyMac::page):
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
(WebKit::WebContextMenuProxyMac::~WebContextMenuProxyMac):
(WebKit::WebContextMenuProxyMac::contextMenuItemSelected):
* UIProcess/mac/WebPopupMenuProxyMac.h:
(WebKit::WebPopupMenuProxyMac::create):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::WebPopupMenuProxyMac):

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

5 years agoAdd -[WKFrameInfo _handle]
andersca@apple.com [Thu, 15 Oct 2015 21:16:03 +0000 (21:16 +0000)]
Add -[WKFrameInfo _handle]
https://bugs.webkit.org/show_bug.cgi?id=150185
rdar://problem/23132371

Reviewed by Tim Horton.

* UIProcess/API/APIFrameInfo.cpp:
(API::FrameInfo::FrameInfo):
* UIProcess/API/APIFrameInfo.h:
* UIProcess/API/Cocoa/WKFrameInfo.mm:
(-[WKFrameInfo _handle]):
* UIProcess/API/Cocoa/WKFrameInfoInternal.h:
* UIProcess/API/Cocoa/WKFrameInfoPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfoInternal.h.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showPopupMenu):
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPopupMenuProxy.h:
(WebKit::WebPopupMenuProxy::WebPopupMenuProxy):
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoWeb Inspector: JavaScriptCore should parse sourceURL and sourceMappingURL directives
commit-queue@webkit.org [Thu, 15 Oct 2015 20:50:02 +0000 (20:50 +0000)]
Web Inspector: JavaScriptCore should parse sourceURL and sourceMappingURL directives
https://bugs.webkit.org/show_bug.cgi?id=150096

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

Source/JavaScriptCore:

* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::scriptCommentPattern): Deleted.
(Inspector::ContentSearchUtilities::findScriptSourceURL): Deleted.
(Inspector::ContentSearchUtilities::findScriptSourceMapURL): Deleted.
* inspector/ContentSearchUtilities.h:
No longer need to search script content.

* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchDidParseSource):
Carry over the sourceURL and sourceMappingURL from the SourceProvider.

* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::sourceMapURLForScript):
(Inspector::InspectorDebuggerAgent::didParseSource):
No longer do content searching.

* parser/Lexer.cpp:
(JSC::Lexer<T>::setCode):
(JSC::Lexer<T>::skipWhitespace):
(JSC::Lexer<T>::parseCommentDirective):
(JSC::Lexer<T>::parseCommentDirectiveValue):
(JSC::Lexer<T>::consume):
(JSC::Lexer<T>::lex):
* parser/Lexer.h:
(JSC::Lexer::sourceURL):
(JSC::Lexer::sourceMappingURL):
(JSC::Lexer::sourceProvider): Deleted.
Give lexer the ability to detect script comment directives.
This just consumes characters in single line comments and
ultimately sets the sourceURL or sourceMappingURL found.

* parser/Parser.h:
(JSC::Parser<LexerType>::parse):
* parser/SourceProvider.h:
(JSC::SourceProvider::url):
(JSC::SourceProvider::sourceURL):
(JSC::SourceProvider::sourceMappingURL):
(JSC::SourceProvider::setSourceURL):
(JSC::SourceProvider::setSourceMappingURL):
After parsing a script, update the Source Provider with the
value of directives that may have been found in the script.

Source/WebInspectorUI:

* UserInterface/Test/InspectorProtocol.js:
(InspectorProtocol._sendMessage):
(InspectorProtocol.dispatchMessageFromBackend):
This is only used for tests, so avoid console.log
and just dump directly to the system console.

LayoutTests:

* inspector/debugger/sourceURLs-expected.txt: Added.
* inspector/debugger/sourceURLs.html: Added.
sourceURL and sourceMappingURL detection.

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

5 years agoInferredTypeTable should ref its keys
fpizlo@apple.com [Thu, 15 Oct 2015 20:34:10 +0000 (20:34 +0000)]
InferredTypeTable should ref its keys
https://bugs.webkit.org/show_bug.cgi?id=150138
rdar://problem/23080555

Reviewed by Michael Saboff.

InferredTypeTable was incorrectly using a key hash traits that caused the underlying HashTable to
store keys as UniquedStringImpl* rather than RefPtr<UniquedStringImpl>, even though the HashMap's
nominal key type was RefPtr<UniquedStringImpl>. This arose because I copy-pasted the HashMap type
instantiation from other places and then made random changes to adapt it to my needs, rather than
actually thinking about what I was doing. The solution is to remove the key hash traits argument,
since all it accomplishes is to produce this bug.

The way this bug manifested is probably best described in http://webkit.org/b/150008. After a while
the InferredTypeTable would have dangling references to its strings, if some recompilation or other
thing caused us to drop all other references to those strings. InferredTypeTable is particularly
susceptible to this because it is designed to know about a superset of the property names that its
client Structures know about. The debug assert would then happen when we rehashed the
InferredTypeTable's HashMap, because we'd try to get the hashes of strings that were already
deleted. AFAICT, we didn't have release crashes arising from those strings' memory being returned
to the OS - but it's totally possible that this could have happened. So, we definitely should treat
this bug as more than just a debug issue.

Interestingly, we could have also solved this problem by changing the hash function to use PtrHash.
In all other ways, it's OK for InferredTypeTable to hold dangling references, since it uses the
address of the UniquedStringImpl as a way to name an abstract heap. It's fine if the name of an
abstract heap is a bogus memory address, and it's also fine if that name referred to an entirely
different UniquedStringImpl at some point in the past. That's a nice benefit of any data structure
that keys by abstract heap - if two of them get unified then it's no big deal. I've filed another
bug, http://webkit.org/b/150137 about changing all of our UniquedStringImpl* hashing to use
PtrHash.

* runtime/Identifier.h: Add a comment about http://webkit.org/b/150137.
* runtime/InferredTypeTable.h: Fix the bug.
* tests/stress/inferred-type-table-stale-identifiers.js: Added. I couldn't get this to cause a crash before my change, but it's an interesting test nonetheless.

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

5 years agoUpdate the help message of --system-malloc
ossy@webkit.org [Thu, 15 Oct 2015 20:21:06 +0000 (20:21 +0000)]
Update the help message of --system-malloc
https://bugs.webkit.org/show_bug.cgi?id=150169

Reviewed by Geoffrey Garen.

* Scripts/webkitperl/FeatureList.pm:

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

5 years agoCSSKeyframesRule::appendRule is deprecated, but is actually the spec
dino@apple.com [Thu, 15 Oct 2015 19:57:43 +0000 (19:57 +0000)]
CSSKeyframesRule::appendRule is deprecated, but is actually the spec
https://bugs.webkit.org/show_bug.cgi?id=150113

Reviewed by Simon Fraser.

Source/WebCore:

I stupidly deprecated the wrong function in
http://trac.webkit.org/changeset/174469

* css/CSSKeyframesRule.cpp:
(WebCore::CSSKeyframesRule::insertRule): Swap the code between these two.
(WebCore::CSSKeyframesRule::appendRule):

LayoutTests:

Update tests to deprecate the correct function.

* animations/change-keyframes-expected.txt:
* animations/keyframes-rule.html:
* animations/unprefixed-keyframes-rule.html:

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

5 years agoThe menu location and menu items should be part of ContextMenuContextData
andersca@apple.com [Thu, 15 Oct 2015 19:56:38 +0000 (19:56 +0000)]
The menu location and menu items should be part of ContextMenuContextData
https://bugs.webkit.org/show_bug.cgi?id=150182

Reviewed by Andreas Kling.

* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::encode):
(WebKit::ContextMenuContextData::decode):
* Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::menuLocation):
(WebKit::ContextMenuContextData::menuItems):
(WebKit::ContextMenuContextData::ContextMenuContextData):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenu):
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showSelectionServiceMenu):
* WebProcess/WebPage/WebContextMenu.cpp:
(WebKit::WebContextMenu::show):

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

5 years agoAdd MASM_PROBE support for ARM64.
mark.lam@apple.com [Thu, 15 Oct 2015 19:54:02 +0000 (19:54 +0000)]
Add MASM_PROBE support for ARM64.
https://bugs.webkit.org/show_bug.cgi?id=150128

Reviewed by Michael Saboff.

* JavaScriptCore.xcodeproj/project.pbxproj:
* assembler/ARM64Assembler.h:
- Convert the ARM64 registers enum list into a macro list so that we can use
  it elsewhere e.g. to declare fields in the probe CPUState.
  Also de-tabbed the contents of the ARM64Registers namespace since the enum
  list change touches almost all of it anyway. This reduces the amount of
  complaints from the style checker.

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::CPUState::registerName):
(JSC::AbstractMacroAssembler::CPUState::registerValue):
- Change CPUState methods to allow for registers ID that do not map to one of
  its fields. This is needed because ARM64's registers include aliases for some
  register names. The CPUState will not allocate separate storage for the
  aliases.

* assembler/MacroAssemblerARM64.cpp: Added.
(JSC::arm64ProbeTrampoline):
- Unlike the probe mechanism for other CPUs, the ARM64 implementation does not
  allow the probe function to modify the sp and pc registers.  We insert this
  wrapper function between ctiMasmProbeTrampoline() and the user's probe function
  so that we can check if the user tried to modify sp and pc.  If so, we will
  print an error message so that we can alert the user that we don't support
  that on ARM64.

  See the comment in ctiMasmProbeTrampoline() in JITStubsARM64.h for details
  on why we cannot support sp and pc modifications by the probe function.

(JSC::MacroAssemblerARM64::probe):

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::repatchCall):
(JSC::MacroAssemblerARM64::makeBranch):
* jit/JITStubs.cpp:
* jit/JITStubsARM64.h: Added.

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

5 years ago[Win] Update anonymous table results for Win port.
zalan@apple.com [Thu, 15 Oct 2015 19:52:34 +0000 (19:52 +0000)]
[Win] Update anonymous table results for Win port.

Unreviewed gardening.

* platform/win/css2.1/tables/table-anonymous-objects-103-expected.txt: Added.
* platform/win/css2.1/tables/table-anonymous-objects-104-expected.txt: Added.
* platform/win/css2.1/tables/table-anonymous-objects-117-expected.txt: Added.
* platform/win/css2.1/tables/table-anonymous-objects-118-expected.txt: Added.
* platform/win/css2.1/tables/table-anonymous-objects-119-expected.txt: Added.
* platform/win/css2.1/tables/table-anonymous-objects-120-expected.txt: Added.

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

5 years agoImplement CSS Variables.
hyatt@apple.com [Thu, 15 Oct 2015 19:48:58 +0000 (19:48 +0000)]
Implement CSS Variables.
https://bugs.webkit.org/show_bug.cgi?id=19660

Reviewed by Dean Jackson.

Source/WebCore:

Added new tests in fast/css/custom-properties and fast/css/variables.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
Add CSSVariableValue.cpp and CSSVariableDependentValue.cpp to builds.

* css/CSSCalculationValue.cpp:
(WebCore::hasDoubleValue):
Handle the new CSS_PARSER_WHITESPACE value.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
Patched to make sure style is updated so that dynamic changes to custom properties are reflected
immediately when querying values.

(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::CSSComputedStyleDeclaration::item):
The custom properties table is a reference and not a pointer now.

* css/CSSCustomPropertyValue.h:
(WebCore::CSSCustomPropertyValue::create):
(WebCore::CSSCustomPropertyValue::createInvalid):
(WebCore::CSSCustomPropertyValue::customCSSText):
(WebCore::CSSCustomPropertyValue::equals):
(WebCore::CSSCustomPropertyValue::isInvalid):
(WebCore::CSSCustomPropertyValue::containsVariables):
(WebCore::CSSCustomPropertyValue::value):
(WebCore::CSSCustomPropertyValue::CSSCustomPropertyValue):
The CSSCustomPropertyValue represents a custom property/value pair in the back end. It holds on
to both the property name and a CSSValueList that has the original parser terms. This class also
doubles as the invalid-at-compute-time value for custom properties when they contain cycles, etc.

* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
 * css/CSSFunctionValue.h:
(WebCore::CSSFunctionValue::buildParserValueSubstitutingVariables):
Hands back a CSSParserValue for a function with variables replaced with their real values (or fallback).

* css/CSSGrammar.y.in:
Many changes to support the var() syntax and to handle error conditions and cases.

* css/CSSParser.cpp:
(WebCore::filterProperties):
Null check the value here. Shouldn't happen, but being paranoid.

(WebCore::CSSParser::parseVariableDependentValue):
This function converts a CSSValueList back into a CSSParserValueList and then passes
it off to the parser. If the result parses, successfully, then the parsed CSSValue is handed back.

(WebCore::CSSParser::parseValue):
Detect when a property value contains variables and simply make a CSSVariableDependentValue to hold
a copy of the parser value list (as a CSSValueList). We defer parsing the list until compute-time
when we know the values of the variables to use.

(WebCore::CSSParser::parseCustomPropertyDeclaration):
Add support for inherit, initial and variable references in custom properties.

(WebCore::CSSParser::detectFunctionTypeToken):
Add support for detection of the "var" token.

(WebCore::CSSParser::realLex):
Fix the parsing of custom properties to allow "--" and to allow them to start with digits, e.g., "--0".

* css/CSSParser.h:
Add parseVariableDependentValue function for handling variable substitution and subsequent parsing
of the resolved parser value list.

* css/CSSParserValues.cpp:
(WebCore::CSSParserValueList::containsVariables):
Get rid of the toString() function (no longer needed) and replace it with containsVariables(). This
check is used to figure out if a parser value list has variables and thus needs to defer parsing
until later.

(WebCore::CSSParserValue::createCSSValue):
Add support for the creation of values for variables, CSSVariableValues.

(WebCore::CSSParserValueList::toString): Deleted.
No longer needed.

* css/CSSParserValues.h:
Add CSSParserVariable as a new kind of parser value. This represents a var() that is encountered
during parsing. It is similar to a function except it has to hold both the reference (custom property name)
and fallback arguments.

* css/CSSPrimitiveValue.cpp:
(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
Add support for CSS_PARSER_WHITESPACE as a way of preserving whitespace as a parsed item (variables can
be only whitespace, and this has to be retained).

(WebCore::CSSPrimitiveValue::buildParserValue):
Conversion from a CSSPrimitiveValue back into a parser value is handled by this function.

* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isParserOperator):
(WebCore::CSSPrimitiveValue::parserOperator):
Add ability to get parser operator info. Add the buildParserValue declaration.

* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
(WebCore::CSSValue::isInvalidCustomPropertyValue):
* css/CSSValue.h:
Add support for variable values and variable dependent values.

* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCSSText):
Improve serialization to not output extra spaces when a comma operator is a value.

(WebCore::CSSValueList::containsVariables):
Whether or not a CSSVariableValue can be found somewhere within the list (or its descendants).

(WebCore::CSSValueList::checkVariablesForCycles):
Called to check variables for cycles.

(WebCore::CSSValueList::buildParserValueSubstitutingVariables):
(WebCore::CSSValueList::buildParserValueListSubstitutingVariables):
Functions that handle converting the value list to a parser value list while making
variable substitutions along the way.

* css/CSSValueList.h:
Add the new buildParserXXX functions.

* css/CSSVariableDependentValue.cpp: Added.
(WebCore::CSSVariableDependentValue::checkVariablesForCycles):
* css/CSSVariableDependentValue.h: Added.
(WebCore::CSSVariableDependentValue::create):
(WebCore::CSSVariableDependentValue::customCSSText):
(WebCore::CSSVariableDependentValue::equals):
(WebCore::CSSVariableDependentValue::propertyID):
(WebCore::CSSVariableDependentValue::valueList):
(WebCore::CSSVariableDependentValue::CSSVariableDependentValue):
This value represents a list of terms that have not had variables substituted yet. The list
is held by the value so that it can be converted back into a parser value list once the
variable values are known.

* css/CSSVariableValue.cpp: Added.
(WebCore::CSSVariableValue::CSSVariableValue):
(WebCore::CSSVariableValue::customCSSText):
(WebCore::CSSVariableValue::equals):
(WebCore::CSSVariableValue::buildParserValueListSubstitutingVariables):
* css/CSSVariableValue.h: Added.
(WebCore::CSSVariableValue::create):
(WebCore::CSSVariableValue::name):
(WebCore::CSSVariableValue::fallbackArguments):
This value represents a var() itself. It knows how to do the substitution of the variable
value and to apply fallback if that value is not present.

* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue):
(WebCore::StyleProperties::borderSpacingValue):
(WebCore::StyleProperties::getLayeredShorthandValue):
(WebCore::StyleProperties::getShorthandValue):
(WebCore::StyleProperties::getCommonValue):
(WebCore::StyleProperties::getPropertyCSSValue):
(WebCore::StyleProperties::getPropertyCSSValueInternal):
(WebCore::StyleProperties::asText):
(WebCore::StyleProperties::copyPropertiesInSet):
* css/StyleProperties.h:
Patched to factor property fetching into an internal method so that variables can work with shorthands
in the CSS OM.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
Resolve variable values at compute time. If they fail to resolve, use inherit or initial as the
value (depending on whether the property inherits by default).

(WebCore::StyleResolver::resolvedVariableValue):
Helper function that calls parseVariableDependentValue and gets the resolved result.

(WebCore::StyleResolver::applyCascadedProperties):
After custom properties have been collected, we check for cycles and perform variable substitutions.
This way we get all the variables replaced before we inherit down the style tree.

* css/StyleResolver.h:
Add resolvedVariableValue declaration.

* css/makeprop.pl:
Make sure custom properties are inherited by default.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
This function handles updating variables with cycles to be invalid in the RenderStyle. It then also
handles the replacement of variables found in custom properties with resolved values. All custom
properties are either invalid or are real non-variable-dependent value lists after this function
completes.

* rendering/style/RenderStyle.h:
Add checkVariablesInCustomProperties declaration.

* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::create):
(WebCore::StyleCustomPropertyData::copy):
(WebCore::StyleCustomPropertyData::operator==):
(WebCore::StyleCustomPropertyData::operator!=):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::getCustomPropertyValue):
(WebCore::StyleCustomPropertyData::values):
(WebCore::StyleCustomPropertyData::hasCustomProperty):
(WebCore::StyleCustomPropertyData::containsVariables):
(WebCore::StyleCustomPropertyData::setContainsVariables):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
Miscellaneous cleanup, and the addition of whether or not the properties still contain variable
dependent values that need to be resolved.

LayoutTests:

* fast/css/custom-properties/inheritance-expected.html: Added.
* fast/css/custom-properties/inheritance.html: Added.
* fast/css/variables: Added.
* fast/css/variables/custom-property-computed-style-access-expected.html: Added.
* fast/css/variables/custom-property-computed-style-access.html: Added.
* fast/css/variables/custom-property-dynamic-update-expected.html: Added.
* fast/css/variables/custom-property-dynamic-update.html: Added.
* fast/css/variables/custom-property-simple-cycle-expected.html: Added.
* fast/css/variables/custom-property-simple-cycle.html: Added.
* fast/css/variables/inherited-fallback-expected.html: Added.
* fast/css/variables/inherited-fallback.html: Added.
* fast/css/variables/invalid-reference-expected.html: Added.
* fast/css/variables/invalid-reference.html: Added.
* fast/css/variables/rule-property-get-css-value-expected.html: Added.
* fast/css/variables/rule-property-get-css-value.html: Added.
* fast/css/variables/rule-property-get-expected.html: Added.
* fast/css/variables/rule-property-get.html: Added.
* fast/css/variables/rule-serialization-expected.html: Added.
* fast/css/variables/rule-serialization.html: Added.

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

5 years agoFix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) build after r191112
ossy@webkit.org [Thu, 15 Oct 2015 19:46:24 +0000 (19:46 +0000)]
Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) build after r191112
https://bugs.webkit.org/show_bug.cgi?id=150175

Reviewed by Antti Koivisto.

* dom/ComposedTreeAncestorIterator.h:
(WebCore::ComposedTreeAncestorIterator::traverseParent):
* dom/ComposedTreeIterator.cpp:
(WebCore::ComposedTreeIterator::initializeShadowStack):
* dom/Element.cpp:
(WebCore::Element::childrenChanged):

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

5 years agoGet rid of the only once used isIntegerArray function
ossy@webkit.org [Thu, 15 Oct 2015 19:34:09 +0000 (19:34 +0000)]
Get rid of the only once used isIntegerArray function
https://bugs.webkit.org/show_bug.cgi?id=150170

Reviewed by Geoffrey Garen.

* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues):

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

5 years agoFix some typos in comments.
mark.lam@apple.com [Thu, 15 Oct 2015 19:31:12 +0000 (19:31 +0000)]
Fix some typos in comments.
https://bugs.webkit.org/show_bug.cgi?id=150181

Rubber stamped by Michael Saboff.

* jit/JITStubsARM.h:
* jit/JITStubsARMv7.h:

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

5 years agoRebaselining css2.1/tables/table-anonymous-objects-045.xht for win
commit-queue@webkit.org [Thu, 15 Oct 2015 18:38:58 +0000 (18:38 +0000)]
Rebaselining css2.1/tables/table-anonymous-objects-045.xht for win
https://bugs.webkit.org/show_bug.cgi?id=150125

Patch by Ryan Haddad <ryanhaddad@apple.com> on 2015-10-15
Reviewed by Zalan Bujtas.

* platform/win/css2.1/tables/table-anonymous-objects-045-expected.txt:

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

5 years agoRefactoring: give the MASM probe CPUState methods shorter names.
mark.lam@apple.com [Thu, 15 Oct 2015 18:37:38 +0000 (18:37 +0000)]
Refactoring: give the MASM probe CPUState methods shorter names.
https://bugs.webkit.org/show_bug.cgi?id=150177

Reviewed by Michael Saboff.

The existing names are longer than they need to be.  Renaming them as follows:
    For GPR, registerName ==> gprName
    For GPR, registerValue ==> gpr
    For FPR, registerName ==> fprName
    For FPR, registerValue ==> fpr

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::CPUState::gprName):
(JSC::AbstractMacroAssembler::CPUState::fprName):
(JSC::AbstractMacroAssembler::CPUState::gpr):
(JSC::AbstractMacroAssembler::CPUState::fpr):
(JSC::AbstractMacroAssembler::CPUState::registerName): Deleted.
(JSC::AbstractMacroAssembler::CPUState::registerValue): Deleted.

* assembler/MacroAssemblerPrinter.cpp:
(JSC::printRegister):
(JSC::printMemory):
- Updated to use the new names.

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

5 years ago[iOS] Update anonymous table results for iOS port.
zalan@apple.com [Thu, 15 Oct 2015 18:09:50 +0000 (18:09 +0000)]
[iOS] Update anonymous table results for iOS port.

Unreviewed gardening.

* platform/ios-simulator/css2.1/tables/table-anonymous-objects-103-expected.txt: Added.
* platform/ios-simulator/css2.1/tables/table-anonymous-objects-104-expected.txt: Added.
* platform/ios-simulator/css2.1/tables/table-anonymous-objects-117-expected.txt: Added.
* platform/ios-simulator/css2.1/tables/table-anonymous-objects-118-expected.txt: Added.
* platform/ios-simulator/css2.1/tables/table-anonymous-objects-119-expected.txt: Added.
* platform/ios-simulator/css2.1/tables/table-anonymous-objects-120-expected.txt: Added.

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