WebKit-https.git
2 years agoConcurrent GC should be able to run splay in debug mode and earley/raytrace in releas...
fpizlo@apple.com [Fri, 18 Nov 2016 22:11:51 +0000 (22:11 +0000)]
Concurrent GC should be able to run splay in debug mode and earley/raytrace in release mode with no perf regression
https://bugs.webkit.org/show_bug.cgi?id=164282

Reviewed by Geoffrey Garen and Oliver Hunt.

PerformanceTests:

CDjs is a fun benchmark for stressing concurrent GCs, but to really give the GC a good
workout you need to increase the amount of work that the test does. This adds a second
configuration of the benchmark that has more aircraft. It uses much more memory and causes us
to do more GCs and those GCs take longer.

* JetStream/cdjs/benchmark.js:
(benchmarkImpl):
(benchmark):
* JetStream/cdjs/large.js: Added.

Source/JavaScriptCore:

The two three remaining bugs were:

- Improper ordering inside putDirectWithoutTransition() and friends. We need to make sure
  that the GC doesn't see the store to Structure::m_offset until we've resized the butterfly.
  That proved a bit tricky. On the other hand, this means that we could probably remove the
  requirement that the GC holds the Structure lock in some cases. I haven't removed that lock
  yet because I still think it might protect some weird cases, and it doesn't seem to cost us
  anything.

- CodeBlock's GC strategy needed to be made thread-safe (visitWeakly, visitChildren, and
  their friends now hold locks) and incremental-safe (we need to update predictions in the
  finalizer to make sure we clear anything that was put into a value profile towards the end
  of GC).

- The GC timeslicing scheduler needed to be made a bit more aggressive to deal with
  generational workloads like earley, raytrace, and CDjs. Once I got those benchmarks to run,
  I found that they would do many useless iterations of GC because they wouldn't pause long
  enough after rescanning weak references and roots. I added a bunch of knobs for forcing a
  pause. In the end, I realized that I could get the desired effect by putting a ceiling on
  mutator utilization. We want the GC to finish quickly if it is possible to do so, even if
  the amount of allocation that the mutator had done is low. Having a utilization ceiling
  seems to accomplish this for benchmarks with trivial heaps (earley and raytrace) as well as
  huge heaps (like CDjs in its "large" configuration).

This preserves splay performance, makes the concurrent GC more stable, and makes the
concurrent GC not a perf regression on earley or raytrace. It seems to give us great CDjs
performance as well, but this is still hard to tell because we crash a lot in that benchmark.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::visitWeakly):
(JSC::CodeBlock::visitChildren):
(JSC::CodeBlock::shouldVisitStrongly):
(JSC::CodeBlock::shouldJettisonDueToOldAge):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::determineLiveness):
(JSC::CodeBlock::WeakReferenceHarvester::visitWeakReferences):
(JSC::CodeBlock::UnconditionalFinalizer::finalizeUnconditionally):
(JSC::CodeBlock::visitOSRExitTargets):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::stronglyVisitWeakReferences):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::clearVisitWeaklyHasBeenCalled):
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):
* heap/Heap.cpp:
(JSC::Heap::ResumeTheWorldScope::ResumeTheWorldScope):
(JSC::Heap::markToFixpoint):
(JSC::Heap::beginMarking):
(JSC::Heap::addToRememberedSet):
(JSC::Heap::collectInThread):
* heap/Heap.h:
* heap/HeapInlines.h:
(JSC::Heap::mutatorFence):
* heap/MarkedBlock.cpp:
* runtime/JSCellInlines.h:
(JSC::JSCell::finishCreation):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectWithoutTransition):
(JSC::JSObject::putDirectInternal):
* runtime/Options.h:
* runtime/Structure.cpp:
(JSC::Structure::add):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::add):

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

2 years agoMarking http/tests/misc/link-rel-icon-beforeload.html as failing on mac-wk1.
ryanhaddad@apple.com [Fri, 18 Nov 2016 22:04:43 +0000 (22:04 +0000)]
Marking http/tests/misc/link-rel-icon-beforeload.html as failing on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=164933

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoWeb Inspector: TimelineDataGridNode assertions when refreshing page
mattbaker@apple.com [Fri, 18 Nov 2016 22:04:08 +0000 (22:04 +0000)]
Web Inspector: TimelineDataGridNode assertions when refreshing page
https://bugs.webkit.org/show_bug.cgi?id=162642
<rdar://problem/28505898>

Reviewed by Timothy Hatcher.

This patch fixes a number of deficiencies in the Network tab that caused
TimelineDataGridNode graphs to refresh before the tab became visible.

* UserInterface/Views/ElementsTabContentView.js:
(WebInspector.ElementsTabContentView):
(WebInspector.ElementsTabContentView.prototype.shown):
Drive-by fix: defer showing the DOM content view until the tab is shown.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView):
Drive-by event listener cleanup.
(WebInspector.NetworkGridContentView.prototype.get startTime):
(WebInspector.NetworkGridContentView.prototype.get endTime):
Back endTime with a variable, instead of using the ruler value which
isn't valid before the tab is shown for the first time.

(WebInspector.NetworkGridContentView.prototype.shown):
Force the grid to update its layout, and that of the Timeline column ruler.
During layout the ruler's secondsPerPixel value is used, which isn't
valid until the ruler does an initial layout.

(WebInspector.NetworkGridContentView.prototype.reset):
Clear pending records. This was causing duplicates to appear when the
inspected page was refreshed multiple times prior to showing the Network
tab for the first time.

(WebInspector.NetworkGridContentView.prototype.layout):
Should more closely match behavior in NetworkTimelineView.prototype.layout.
Graph end time padding is added if no longer updating the current time.

(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
Track endTime of the last record added, so that the graph end time can
be padded once the current time is no longer being updated.

(WebInspector.NetworkGridContentView.prototype._update):
(WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
Graph end time padding shouldn't be applied here, since this isn't called
if the inspected page finishes loading before the view is shown.

(WebInspector.NetworkGridContentView.prototype._clearNetworkItems): Deleted.
Replaced by an arrow function.

* UserInterface/Views/NetworkSidebarPanel.js:
(WebInspector.NetworkSidebarPanel.prototype._networkTimelineReset):
Don't show the content view if the tab is hidden.

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

2 years agoUnsupported emoji are invisible
mmaxfield@apple.com [Fri, 18 Nov 2016 21:55:09 +0000 (21:55 +0000)]
Unsupported emoji are invisible
https://bugs.webkit.org/show_bug.cgi?id=164944
<rdar://problem/28591608>

Reviewed by Dean Jackson.

Source/WebCore:

In WidthIterator, we explicitly skip characters which the OS has no font
to render with. However, for emoji, we should draw something to show that
there is missing content. Because we have nothing to draw, we can draw
the .notdef glyph (empty box, or "tofu").

Test: fast/text/emoji-draws.html

* platform/graphics/WidthIterator.cpp:
(WebCore::characterMustDrawSomething):
(WebCore::WidthIterator::advanceInternal):

LayoutTests:

* fast/text/emoji-draws-expected-mismatch.html: Added.
* fast/text/emoji-draws.html: Added.

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

2 years ago[WebIDL] Add support for record types
weinig@apple.com [Fri, 18 Nov 2016 21:47:42 +0000 (21:47 +0000)]
[WebIDL] Add support for record types
https://bugs.webkit.org/show_bug.cgi?id=164935

Reviewed by Tim Horton.

Source/WebCore:

Add support for WebIDLs record types. We map them to HashMap<String, {OtherType}>.

* bindings/generic/IDLTypes.h:
- Add IDLRecord type and helper predicate.
- Remove IDLRegExp which is no longer in WebIDL and we never supported.

* bindings/js/JSDOMBinding.cpp:
(WebCore::stringToByteString):
(WebCore::identifierToByteString):
(WebCore::valueToByteString):
(WebCore::hasUnpairedSurrogate):
(WebCore::stringToUSVString):
(WebCore::identifierToUSVString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Refactor ByteString and USVString conversion to support converting from
either a JSValue or Identifier.

* bindings/js/JSDOMConvert.h:
(WebCore::DetailConverter<IDLRecord<K, V>>):
(WebCore::JSConverter<IDLRecord<K, V>>):
Add conversion support for record types. Use Detail::IdentifierConverter helper
to convert identifiers to strings using the correct conversion rules.

(WebCore::Converter<IDLUnion<T...>>::convert):
Update comments in union conversion to match current spec. Remove check
for regular expressions and add support for record types.

* bindings/scripts/CodeGenerator.pm:
(IsRefPtrType):
Add record and union types to the list of things that aren't RefPtrs.

(IsRecordType):
Add predicate for testing if a type is a record.

(IsWrapperType):
Remove check for union. This is now handled in the IsRefPtrType check.

(SkipIncludeHeader): Deleted.
(GetSequenceInnerType): Deleted.
(GetFrozenArrayInnerType): Deleted.
(GetSequenceOrFrozenArrayInnerType): Deleted.
Remove no longer necessary functions.

* bindings/scripts/CodeGeneratorJS.pm:
(AddIncludesForImplementationType):
Remove check for includes to skip. This is now only called for interfaces, which should be included
unconditionally.

(AddToIncludesForIDLType):
Add includes and recursive includes for record types.

(GenerateOverloadedFunctionOrConstructor):
Update to account for records.

(GetGnuVTableRefForInterface):
(GetGnuVTableNameForInterface):
(GetGnuMangledNameForInterface):
(GetWinVTableNameForInterface):
(GetWinMangledNameForInterface):
Strength-reduce GetNativeTypeForConversions and GetNamespaceForInterface into their callers.

(GetBaseIDLType):
Add support for IDLRecord. Remove call to GetIDLInterfaceName now that is simply the type name.

(GetNativeType):
Simplify sequence/FrozenArray support and add record support.

(GetNativeInnerType):
Generalize GetNativeVectorInnerType to work for record types as well.

(ShouldPassWrapperByReference):
Moved so native type accessors can be together.

(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):
Add record support.

(GetNativeTypeForConversions): Deleted.
(GetNamespaceForInterface): Deleted.
(GetNativeVectorType): Deleted.
(GetIDLInterfaceName): Deleted.
(GetNativeVectorInnerType): Deleted.
Remove unneeded functions.

* bindings/scripts/IDLParser.pm:
(typeDescription):
Add helper useful for debugging, that constructs the string form of a type.

(typeByApplyingTypedefs):
Add missing call to typeByApplyingTypedefs (this is noted by a fix in JSTestCallbackFunctionWithTypedefs.h)

(parseNonAnyType):
Remove unused $subtypeName variables and add support for parsing record types.

* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:
Add tests for records and update results.

* testing/TypeConversions.h:
(WebCore::TypeConversions::testLongRecord):
(WebCore::TypeConversions::setTestLongRecord):
(WebCore::TypeConversions::testNodeRecord):
(WebCore::TypeConversions::setTestNodeRecord):
(WebCore::TypeConversions::testSequenceRecord):
(WebCore::TypeConversions::setTestSequenceRecord):
* testing/TypeConversions.idl:
Add record types so it can be tested from layout tests.

LayoutTests:

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:
Add tests for WebIDL record types.

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

2 years ago[CSS Parser] Support font-variation-settings
hyatt@apple.com [Fri, 18 Nov 2016 21:41:40 +0000 (21:41 +0000)]
[CSS Parser] Support font-variation-settings
https://bugs.webkit.org/show_bug.cgi?id=164947

Reviewed by Myles Maxfield.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariationTag):
(WebCore::consumeFontVariationSettings):
(WebCore::CSSPropertyParser::parseSingleValue):

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

2 years agoUpdate SubtleCrypto::encrypt to match the latest spec
jiewen_tan@apple.com [Fri, 18 Nov 2016 21:31:42 +0000 (21:31 +0000)]
Update SubtleCrypto::encrypt to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=164738
<rdar://problem/29257812>

Reviewed by Brent Fulgham.

LayoutTests/imported/w3c:

* WebCryptoAPI/encrypt_decrypt/test_aes_cbc-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_aes_ctr-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_aes_gcm-expected.txt:
* WebCryptoAPI/encrypt_decrypt/test_rsa_oaep-expected.txt:
* WebCryptoAPI/idlharness-expected.txt:

Source/WebCore:

This patch does following few things:
1. It updates the SubtleCrypto::encrypt method to match the latest spec:
   https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-encrypt.
   It also refers to the latest Editor's Draft to a certain degree:
   https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-encrypt.
2. It implements encrypt operations of the following algorithms: AES-CBC,
   RSAES-PKCS1-V1_5, and RSA-OAEP.
3. It addes ASSERT(parameters) for every method that accepts a
   std::unique_ptr<CryptoAlgorithmParameters>&& type parameter.
4. It changes RefPtr<CryptoKey>&& to Ref<CryptoKey>&& for every method that
   accepts a CryptoKey.

Tests: crypto/subtle/aes-cbc-encrypt-malformed-parameters.html
       crypto/subtle/aes-cbc-import-key-encrypt.html
       crypto/subtle/encrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html
       crypto/subtle/rsa-oaep-import-key-encrypt-label.html
       crypto/subtle/rsa-oaep-import-key-encrypt.html
       crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html
       crypto/workers/subtle/aes-cbc-import-key-encrypt.html
       crypto/workers/subtle/rsa-oaep-import-key-encrypt.html
       crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/BufferSource.h:
(WebCore::BufferSource::BufferSource):
Add a default constructor for initializing an empty BufferSource object.
* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
(WebCore::jsSubtleCryptoFunctionEncryptPromise):
(WebCore::JSSubtleCrypto::encrypt):
* crypto/CryptoAlgorithm.cpp:
(WebCore::CryptoAlgorithm::encrypt):
(WebCore::CryptoAlgorithm::exportKey):
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoKey.h:
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::workQueue):
* crypto/SubtleCrypto.idl:
* crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::encrypt):
(WebCore::CryptoAlgorithmAES_CBC::generateKey):
(WebCore::CryptoAlgorithmAES_CBC::importKey):
(WebCore::CryptoAlgorithmAES_CBC::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::generateKey):
(WebCore::CryptoAlgorithmAES_KW::importKey):
(WebCore::CryptoAlgorithmAES_KW::exportKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
(WebCore::CryptoAlgorithmHMAC::exportKey):
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
(WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
(WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
(WebCore::CryptoAlgorithmRSA_OAEP::generateKey):
(WebCore::CryptoAlgorithmRSA_OAEP::importKey):
(WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
(WebCore::transformAES_CBC):
(WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
(WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
(WebCore::encryptRSAES_PKCS1_v1_5):
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
(WebCore::encryptRSA_OAEP):
(WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):
* crypto/parameters/AesCbcParams.idl: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParams.h: Added.
* crypto/parameters/CryptoAlgorithmAesCbcParamsDeprecated.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h: Added.
* crypto/parameters/RsaOaepParams.idl: Added.

LayoutTests:

* TestExpectations:
* crypto/subtle/aes-cbc-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/aes-cbc-encrypt-malformed-parameters.html: Added.
* crypto/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
* crypto/subtle/aes-cbc-import-key-encrypt.html: Added.
* crypto/subtle/encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/encrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-encrypt-malformed-parameters-expected.txt: Added.
* crypto/subtle/rsa-oaep-encrypt-malformed-parameters.html: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-label-expected.txt: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt-label.html: Added.
* crypto/subtle/rsa-oaep-import-key-encrypt.html: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
* crypto/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.
* crypto/workers/subtle/aes-cbc-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/aes-cbc-import-key-encrypt.html: Added.
* crypto/workers/subtle/resources/aes-cbc-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/rsa-oaep-import-key-encrypt.js: Added.
* crypto/workers/subtle/resources/rsaes-pkcs1-v1_5-import-key-encrypt.js: Added.
* crypto/workers/subtle/rsa-oaep-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/rsa-oaep-import-key-encrypt.html: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt-expected.txt: Added.
* crypto/workers/subtle/rsaes-pkcs1-v1_5-import-key-encrypt.html: Added.

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

2 years agoAttempt to fix iOS build again.
ryanhaddad@apple.com [Fri, 18 Nov 2016 21:23:41 +0000 (21:23 +0000)]
Attempt to fix iOS build again.
<rdar://problem/29312689>

Unreviewed build fix.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack):

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

2 years ago[CSS Font Loading] FontFaceSet.load() promises don't always fire
mmaxfield@apple.com [Fri, 18 Nov 2016 20:56:36 +0000 (20:56 +0000)]
[CSS Font Loading] FontFaceSet.load() promises don't always fire
https://bugs.webkit.org/show_bug.cgi?id=164902

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/text/fontfaceset-rebuild-during-loading.html

We currently handle web fonts in two phases. The first phase is building up
StyleRuleFontFace objects which reflect the style on the page. The second is creating
CSSFontFace objects from those StyleRuleFontFace objects. When script modifies the
style on the page, we can often update the CSSFontFace objects, but there are some
modifications which we don't know how to model. For these operations, we destroy the
CSSFontFace objects and rebuild them from the newly modified StyleRuleFontFace objects.

Normally, this is fine. However, with the CSS font loading API, the CSSFontFaces back
Javascript objects which will persist across the rebuilding step mentioned above. This
means that the FontFace objects need to adopt the new CSSFontFace objects and forget
the old CSSFontFace objects.

There was one bit of state which I forgot to update during this rebuilding phase. The
FontFaceSet object contains an internal HashMap where a reference to a CSSFontFace
is used as a key. After the rebuilding phase, this reference wasn't updated to point
to the new CSSFontFace.

The solution is to instead use a reference to the higher-level FontFace as the key to
the HashMap. This object is persistent across the rebuilding phase (and it adopts
the new CSSFontFaces). There is not a lifetime problem because the FontFace holds a
strong reference to its backing CSSFontFace object.

This bug didn't cause a memory problem because the HashMap was keeping the old
CSSFontFace alive because the key was a strong reference.

This patch also adds a lengthy comment explaining how the migration works.

* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::initializeWrapper): This is another bit of state which didn't
survive the rebuilding phase. Moving it here causes it to survive.
(WebCore::CSSFontFace::wrapper):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h:

LayoutTests:

* fast/text/fontfaceset-rebuild-during-loading-expected.txt: Added.
* fast/text/fontfaceset-rebuild-during-loading.html: Added.

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

2 years ago[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the...
mmaxfield@apple.com [Fri, 18 Nov 2016 20:27:50 +0000 (20:27 +0000)]
[SVG -> OTF Font Converter] Fonts advances are not internally consistent inside the generated font file
https://bugs.webkit.org/show_bug.cgi?id=164846
<rdar://problem/29031509>

Reviewed by Darin Adler.

Source/WebCore:

The fonts I'm generating in the SVG -> OTF converter have fractional FUnit values for their advances.
The CFF table can encode that, but hmtx can't, which means the font isn't internally consistent.

Covered by existing tests.

* svg/SVGToOTFFontConversion.cpp:

LayoutTests:

* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/ios-simulator/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/ios-simulator/svg/batik/text/textEffect-expected.txt:
* platform/ios-simulator/svg/batik/text/textEffect3-expected.txt:
* platform/ios-simulator/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-02-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-01-t-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-02-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/text-intro-04-t-expected.txt:
* platform/mac/svg/batik/text/textEffect3-expected.txt:
* platform/mac/svg/batik/text/textPosition2-expected.txt:
* platform/mac/svg/custom/svg-fonts-fallback-expected.txt:
* platform/mac/svg/wicd/test-rightsizing-b-expected.txt:
* svg/W3C-SVG-1.1/fonts-elem-04-b-expected.txt:

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

2 years agoAttempt to fix iOS build.
ryanhaddad@apple.com [Fri, 18 Nov 2016 20:01:49 +0000 (20:01 +0000)]
Attempt to fix iOS build.
<rdar://problem/29312689>

Unreviewed build fix.

* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):

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

2 years ago[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
hyatt@apple.com [Fri, 18 Nov 2016 19:09:13 +0000 (19:09 +0000)]
[CSS Parser] Hook up InspectorStyleSheet to the new CSS parser.
https://bugs.webkit.org/show_bug.cgi?id=164886

Reviewed by Dean Jackson.

* css/CSSGrammar.y.in:
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.

* css/CSSPropertySourceData.cpp:
(WebCore::CSSPropertySourceData::CSSPropertySourceData):
* css/CSSPropertySourceData.h:
Add a concept of disabled to CSSPropertySourceData. This is used for
commented out properties.

(WebCore::CSSRuleSourceData::create):
(WebCore::CSSRuleSourceData::createUnknown):
(WebCore::CSSRuleSourceData::CSSRuleSourceData):
Get rid of the CSSRuleSourceData type enum, since StyleRule's type
enum is exactly the same.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::CSSParser::parseSheetForInspector):
(WebCore::CSSParser::parseDeclarationForInspector):
(WebCore::CSSParser::markSupportsRuleHeaderStart):
(WebCore::CSSParser::markRuleHeaderStart):
(WebCore::CSSParser::markPropertyEnd):
* css/parser/CSSParser.h:
Add functions that represent the new API for inspector sheet
and declaration parsing. Patch the old parse code to use StyleRule::Type
now that the CSSRuleSourceData type is gone.

* css/parser/CSSParserObserver.h:
Tweak the API for our memory management.

* inspector/InspectorStyleSheet.cpp:
(flattenSourceData):
(WebCore::parserContextForDocument):
(WebCore::StyleSheetHandler::StyleSheetHandler):
(WebCore::StyleSheetHandler::startRuleHeader):
(WebCore::StyleSheetHandler::setRuleHeaderEnd):
(WebCore::StyleSheetHandler::endRuleHeader):
(WebCore::StyleSheetHandler::observeSelector):
(WebCore::StyleSheetHandler::startRuleBody):
(WebCore::StyleSheetHandler::endRuleBody):
(WebCore::StyleSheetHandler::popRuleData):
(WebCore::fixUnparsedProperties):
(WebCore::StyleSheetHandler::fixUnparsedPropertyRanges):
(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):
(WebCore::InspectorStyle::populateAllProperties):
(WebCore::isValidSelectorListString):
(WebCore::InspectorStyleSheet::ensureSourceData):
(WebCore::InspectorStyleSheetForInlineStyle::ensureParsedDataReady):
(WebCore::InspectorStyleSheetForInlineStyle::ruleSourceData):
(WebCore::createCSSParser): Deleted.
(WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges): Deleted.
* inspector/InspectorStyleSheet.h:
(WebCore::InspectorStyleProperty::setRawTextFromStyleDeclaration):
Add the new implementation. This involves duplicating most of the old
parser code for this into a new class, StyleSheetHandler, that implements
the observer interface and builds up the same data structures as the old
parser did in response to the callbacks.

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

2 years agoWeb Inspector: Generator functions should have a displayable name when shown in stack...
joepeck@webkit.org [Fri, 18 Nov 2016 18:57:17 +0000 (18:57 +0000)]
Web Inspector: Generator functions should have a displayable name when shown in stack traces
https://bugs.webkit.org/show_bug.cgi?id=164844
<rdar://problem/29300697>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/generator-function-name.js:
Add another test now that we name the inner generator function
that we do not break the lexical resolution of names.

Source/JavaScriptCore:

* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createGeneratorFunctionBody):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createGeneratorFunctionBody):
New way to create a generator function with an inferred name.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
* parser/Parser.h:
Pass on the name of the generator wrapper function so we can
use it on the inner generator function.

LayoutTests:

* inspector/debugger/js-stacktrace-expected.txt:
* inspector/debugger/js-stacktrace.html:
Add a test case for console.trace() / Error stack inside of generators.
Modernize the test to reduce redundency and get nicer output.

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

2 years agoTried to fix some non-macOS builds.
mitz@apple.com [Fri, 18 Nov 2016 15:17:36 +0000 (15:17 +0000)]
Tried to fix some non-macOS builds.
<rdar://problems/29331425&29331438&29331722>

* platform/mac/WebPlaybackControlsManager.h:

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

2 years ago[Win32] Start releasing memory earlier when memory is running low.
pvollan@apple.com [Fri, 18 Nov 2016 10:03:18 +0000 (10:03 +0000)]
[Win32] Start releasing memory earlier when memory is running low.
https://bugs.webkit.org/show_bug.cgi?id=164862

Reviewed by Brent Fulgham.

On Windows, 32-bit processes have 2GB of memory available, where some is used by the system.
Debugging has shown that allocations might fail and cause crashes when memory usage is > ~1GB.
We should start releasing memory before we reach 1GB.

* platform/win/MemoryPressureHandlerWin.cpp:
(WebCore::CheckMemoryTimer::fired):

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

2 years agoDownloads started by context menu actions should also have a web view associated
carlosgc@webkit.org [Fri, 18 Nov 2016 07:50:57 +0000 (07:50 +0000)]
Downloads started by context menu actions should also have a web view associated
https://bugs.webkit.org/show_bug.cgi?id=164364

Reviewed by Michael Catanzaro.

Source/WebKit2:

When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.

* UIProcess/API/gtk/WebKitDownload.cpp:
(webkitDownloadCreateForRequest): Deleted.
* UIProcess/API/gtk/WebKitDownloadPrivate.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
because the WebKitDownload could have already been created by the web view download handler at this point.
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
the page client.

Tools:

Add a GTK+ unit tests to check that downloads started by the context menu have a web view associated.

* TestWebKitAPI/Tests/WebKit2Gtk/TestDownloads.cpp:
(downloadLocalFileSuccessfully):
(testDownloadOverwriteDestinationDisallowed):
(testDownloadLocalFileError):
(testDownloadRemoteFile):
(testDownloadRemoteFileError):
(testDownloadMIMEType):
(contextMenuCallback):
(testContextMenuDownloadActions):
(beforeAll):

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

2 years agoREGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
carlosgc@webkit.org [Fri, 18 Nov 2016 07:25:42 +0000 (07:25 +0000)]
REGRESSION(r208511): ImageDecoders: Crash decoding GIF images since r208511
https://bugs.webkit.org/show_bug.cgi?id=164864

Reviewed by Simon Fraser.

This happens sometimes since r208511 because the same decoder is used by more than one thread at the same
time and the decoders are not thread-safe. Several methods in ImageDecoder need to decode partially the image,
so it's possible that one method calls frameBufferAtIndex at the same times as createFrameImageAtIndex that now
can be called from the image decoder thread. Use a Lock in ImageDecoder to protect calls to frameBufferAtIndex.

* platform/image-decoders/ImageDecoder.cpp:
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
* platform/image-decoders/ImageDecoder.h:

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

2 years agoREGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
achristensen@apple.com [Fri, 18 Nov 2016 07:21:37 +0000 (07:21 +0000)]
REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=164631

Reviewed by Carlos Garcia Campos.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::convertToDownload):
I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
was not being set to nullptr before it was being checked in NetworkResourceLoader::abort

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

2 years agoFix CMake build after r208865
achristensen@apple.com [Fri, 18 Nov 2016 06:28:05 +0000 (06:28 +0000)]
Fix CMake build after r208865
https://bugs.webkit.org/show_bug.cgi?id=164894

* PlatformMac.cmake:
Add new files.

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

2 years agoAdd an experimental API to find elements across shadow boundaries
rniwa@webkit.org [Fri, 18 Nov 2016 05:30:24 +0000 (05:30 +0000)]
Add an experimental API to find elements across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=164851
<rdar://problem/28220092>

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h:

Source/WebCore:

Add window.collectMatchingElementsInFlatTree(Node node, DOMString selectors)
as an experimental API which finds a list of elements that matches the given CSS selectors
and expose it to a JSWorld on which WKBundleScriptWorldMakeAllShadowRootsOpen was called.

No new tests. More test cases are added to WebKit2.InjectedBundleMakeAllShadowRootsOpen.

* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck): Added. Abstracts checks for EnabledAtRuntime and EnabledForWorld.
(OperationShouldBeOnInstance):
(GeneratePropertiesHashTable):
(GetRuntimeEnableFunctionName): Use worldForDOMObject(this).condition() for EnabledForWorld.
Also split the line for EnabledAtRuntime and EnabledAtRuntime for a better readability.
(GenerateImplementation):
(addIterableProperties):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttribute):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorld):
(WebCore::jsTestGlobalObjectInstanceFunctionEnabledInSpecificWorldCaller):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjPrototypeFunctionWorldSpecificMethod):
(WebCore::jsTestObjPrototypeFunctionWorldSpecificMethodCaller):
* bindings/scripts/test/TestGlobalObject.idl: Added a test case.
* bindings/scripts/test/TestObj.idl: Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::collectMatchingElementsInFlatTree): Added. Implements the feature by
calling SelectorQuery's matches on a node yielded by ComposedTreeIterator.
* page/DOMWindow.h:
* page/DOMWindow.idl:

Tools:

Added test cases for window.collectMatchingElementsInFlatTree to WebKit2.InjectedBundleMakeAllShadowRootOpen.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/InjectedBundleMakeAllShadowRoot*s*Open_Bundle.cpp: Renamed
from InjectedBundleMakeAllShadowRootOpen_Bundle.cpp.
(TestWebKitAPI::InjectedBundleMakeAllShadowRootOpenTest::initialize): Added test cases for
window.collectMatchingElementsInFlatTree by calling alert() many times.
* TestWebKitAPI/Tests/WebKit2/InjectedBundleMakeAllShadowRootsOpen.cpp:
(TestWebKitAPI::runJavaScriptAlert): Added expectations for multiple test cases. Each test case
finishes with a call to alert, and moves testNumber forward.
(TestWebKitAPI::TEST): Use the newly added closed-shadow-tree-test.html
* TestWebKitAPI/Tests/WebKit2/closed-shadow-tree-test.html: Added. Creates a shadow tree with slots
and tests that window.collectMatchingElementsInFlatTree is not present when
an event named "testnormalworld" is dispatched by the injected bundle.

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

2 years agoTry to fix some non-macOS builds.
mitz@apple.com [Fri, 18 Nov 2016 05:11:18 +0000 (05:11 +0000)]
Try to fix some non-macOS builds.

* WebView/WebView.mm:

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

2 years ago[WebIDL] Add support for ByteString
weinig@apple.com [Fri, 18 Nov 2016 05:07:23 +0000 (05:07 +0000)]
[WebIDL] Add support for ByteString
https://bugs.webkit.org/show_bug.cgi?id=164901

Reviewed by Darin Adler.

Source/WebCore:

* bindings/generic/IDLTypes.h:
Make IDLByteString a IDLString.

* bindings/js/JSDOMBinding.cpp:
(WebCore::valueToByteString):
(WebCore::valueToUSVString):
* bindings/js/JSDOMBinding.h:
Add conversion function for ByteString and fix valueToUSVString to take an ExecState reference.

* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLByteString>::convert):
(WebCore::JSConverter<IDLByteString>::convert):
Add conversion functions for ByteString, using valueToByteString.

(WebCore::Converter<IDLUSVString>::convert):
Update to pass the ExecState by reference.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::handleInitMessageEvent):
Update to pass the ExecState by reference.

* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::importScripts):
Update to pass the ExecState by reference.

* bindings/scripts/CodeGenerator.pm:
Add ByteString as a string type.

* testing/TypeConversions.h:
(WebCore::TypeConversions::testByteString):
(WebCore::TypeConversions::setTestByteString):
* testing/TypeConversions.idl:
Add a testByteString attribute for testing.

LayoutTests:

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:
Add tests for ByteString using the new TypeConversions.testByteString attribute.

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

2 years agoWKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement...
rniwa@webkit.org [Fri, 18 Nov 2016 04:57:50 +0000 (04:57 +0000)]
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
https://bugs.webkit.org/show_bug.cgi?id=164857
<rdar://problem/27721742>

Reviewed by Wenson Hsieh.

Source/WebCore:

It turns out that some users want text replacement to be always enabled so change the semantics of
WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled to only disable everything else.

Instead of completely disabling spellchecking, remove all text checking options but text replacement
when the user types into an input element on which this API is used to disable spellchecking.

No new tests since we don't have a good facility to test text replacement.

* dom/Element.h:
(WebCore::Element::isSpellCheckingEnabled): Made this non-virtual now that there is no override.
* editing/Editor.cpp:
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges): Don't call resolveTextCheckingTypeMask twice.
(WebCore::Editor::resolveTextCheckingTypeMask): Filter out the text checking options if the root editable
element is inside an input element on which isSpellcheckDisabledExceptTextReplacement is set to true.
* editing/Editor.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::isSpellCheckingEnabled): Deleted.
* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::setSpellcheckDisabledExceptTextReplacement): Renamed from setSpellcheckEnabled
to reflect the new semantics.
(WebCore::HTMLInputElement::isSpellcheckDisabledExceptTextReplacement): Ditto.

Source/WebKit2:

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
(WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):

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

2 years agoResource load statistics: Cover further data records, count removed data records...
wilander@apple.com [Fri, 18 Nov 2016 03:32:53 +0000 (03:32 +0000)]
Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
https://bugs.webkit.org/show_bug.cgi?id=164659

Reviewed by Andy Estes.

Source/WebCore:

No new tests. This feature is behind a flag and off by default. Tests require real domain names.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
    All three functions are now more conservative in calls to
    m_store->fireDataModificationHandler(). They only fire when an important statistic has
    changed or data records have previously been removed for the domain in question.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode):
    Added the dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatistics::decode):
    Now takes a version parameter to control which keys to expect.
    Added the dataRecordsRemoved statistic.
(WebCore::appendHashCountedSet):
    Removed stray linefeed.
(WebCore::ResourceLoadStatistics::toString):
    Added the dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatistics::merge):
    Added the dataRecordsRemoved statistic.
* loader/ResourceLoadStatistics.h:
    Added the dataRecordsRemoved statistic.
* loader/ResourceLoadStatisticsStore.cpp:
(WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
    Now encodes a version number for the statistics model.
(WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
    Now tries to decode a version number and passes it on to statistics decoding.
(WebCore::ResourceLoadStatisticsStore::processStatistics):
    No longer gates processing on the number of data captured.
(WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
    Update function for the new dataRecordsRemoved statistic.
(WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing): Deleted.
    No longer needed since we no longer gate processing on the number of data captured.
* loader/ResourceLoadStatisticsStore.h:

Source/WebKit2:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Consistent naming with 'remove' rather than 'delete'.
    Now removes localStorage, IndexDB, disk cache, and memory cache too.
    Updates statistics with number of times it has removed data records.
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
    No longer checks whether it has enough data since the classification rules
    are absolute, not relative.
(WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
* UIProcess/WebResourceLoadStatisticsStore.h:
    Consistent naming with 'remove' rather than 'delete'.

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

2 years agoFix WinCairo build after r208740
achristensen@apple.com [Fri, 18 Nov 2016 02:41:35 +0000 (02:41 +0000)]
Fix WinCairo build after r208740
https://bugs.webkit.org/show_bug.cgi?id=164749

* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::validateAttributes):
(WebCore::GraphicsContext3D::getExtensions):
Use more references instead of pointers, like Myles did in r208740

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

2 years agoImplement TextDecoder and TextEncoder
achristensen@apple.com [Fri, 18 Nov 2016 02:11:05 +0000 (02:11 +0000)]
Implement TextDecoder and TextEncoder
https://bugs.webkit.org/show_bug.cgi?id=163771

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/encoding/api-basics-expected.txt:
* web-platform-tests/encoding/api-invalid-label-expected.txt:
* web-platform-tests/encoding/api-replacement-encodings-expected.txt:
* web-platform-tests/encoding/api-surrogates-utf8-expected.txt:
* web-platform-tests/encoding/idlharness-expected.txt:
* web-platform-tests/encoding/iso-2022-jp-decoder-expected.txt:
* web-platform-tests/encoding/single-byte-decoder-expected.txt:
* web-platform-tests/encoding/textdecoder-byte-order-marks-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-single-byte-expected.txt:
* web-platform-tests/encoding/textdecoder-fatal-streaming-expected.txt:
* web-platform-tests/encoding/textdecoder-ignorebom-expected.txt:
* web-platform-tests/encoding/textdecoder-labels-expected.txt:
* web-platform-tests/encoding/textdecoder-streaming-expected.txt:
* web-platform-tests/encoding/textdecoder-utf16-surrogates-expected.txt:
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt:
* web-platform-tests/encoding/textencoder-utf16-surrogates-expected.txt:

Source/WebCore:

This API is already implemented by Chrome and Firefox
as specified in https://encoding.spec.whatwg.org/

Covered by newly passing web platform tests.

* features.json:
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/TextDecoder.cpp: Added.
(WebCore::isEncodingWhitespace):
(WebCore::TextDecoder::create):
(WebCore::TextDecoder::TextDecoder):
(WebCore::TextDecoder::ignoreBOMIfNecessary):
(WebCore::TextDecoder::prependBOMIfNecessary):
(WebCore::codeUnitByteSize):
(WebCore::TextDecoder::decode):
(WebCore::TextDecoder::encoding):
* dom/TextDecoder.h: Added.
(WebCore::TextDecoder::fatal):
(WebCore::TextDecoder::ignoreBOM):
* dom/TextDecoder.idl: Added.
* dom/TextEncoder.cpp: Added.
(WebCore::TextEncoder::TextEncoder):
(WebCore::TextEncoder::encoding):
(WebCore::TextEncoder::encode):
* dom/TextEncoder.h: Added.
(WebCore::TextEncoder::create):
* dom/TextEncoder.idl: Added.

LayoutTests:

* fast/encoding/utf-8-non-ascii-expected.txt: Added.
* fast/encoding/utf-8-non-ascii.html: Added.
* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoTry to fix the windows build again.
weinig@apple.com [Fri, 18 Nov 2016 01:26:05 +0000 (01:26 +0000)]
Try to fix the windows build again.

* svg/SVGStringList.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
(WebCore::SVGStaticListPropertyTearOff::SVGStaticListPropertyTearOff):

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

2 years agoTry to fix the windows build.
weinig@apple.com [Fri, 18 Nov 2016 01:09:44 +0000 (01:09 +0000)]
Try to fix the windows build.

* svg/SVGStringList.h:
Remove unnecessary using declarations.

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

2 years agoRegression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
cdumez@apple.com [Fri, 18 Nov 2016 00:55:34 +0000 (00:55 +0000)]
Regression(r208672?): ASSERTION FAILED: isMainThread() in WebCore::Node::ref()
https://bugs.webkit.org/show_bug.cgi?id=164887
<rdar://problem/29319497>

Reviewed by Brady Eidson.

Restore pre-r208672 behavior where we do not ref the script execution context in the
background thread since this is unsafe. We use WTFMove(m_scriptExecutionContext)
instead of m_scriptExecutionContext.copyRef(). Before r208672, it was calling
m_scriptExecutionContext.releaseNonNull() because m_scriptExecutionContext was a
RefPtr instead of a Ref. Note that copyRef() causes 2 issues here:
1. It refs the scriptExecutionContext in a non-main thread which is unsafe and asserts.
2. The point of this postTask in the destructor is to make sure the scriptExecutionContext
   gets destroyed in the main thread so we definitely want to *transfer* ownership of
   m_scriptExecutionContext to the main thread, not ref it to pass it to the main thread.

No new tests, already covered by storage/websql/multiple-transactions-on-different-handles.html.

* Modules/webdatabase/Database.cpp:
(WebCore::Database::~Database):

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

2 years agoRebaseline fast/html/keygen.html for Sierra.
ryanhaddad@apple.com [Fri, 18 Nov 2016 00:48:06 +0000 (00:48 +0000)]
Rebaseline fast/html/keygen.html for Sierra.

Unreviewed test gardening.

* platform/mac/fast/html/keygen-expected.txt:

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

2 years ago[JSC] Drop arguments.caller
utatane.tea@gmail.com [Fri, 18 Nov 2016 00:37:28 +0000 (00:37 +0000)]
[JSC] Drop arguments.caller
https://bugs.webkit.org/show_bug.cgi?id=164859

Reviewed by Saam Barati.

JSTests:

* stress/strict-mode-arguments-caller.js: Added.
(strictArguments):
(shouldBe):

Source/JavaScriptCore:

Originally, some JavaScript engine has `arguments.caller` property.
But it easily causes some information leaks and it becomes obstacles
for secure ECMAScript (SES). In ES5, we make it deprecated in strict
mode. To do so, we explicitly set "caller" getter throwing TypeError
to arguments in strict mode.

But now, there is no modern engine which supports `arguments.caller`
in sloppy mode. So the original compatibility problem is gone and
"caller" getter in the strict mode arguments becomes meaningless.

ES2017 drops this from the spec. In this patch, we also drop this
`arguments.caller` in strict mode support.

Note that Function#caller is still alive.

* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::put):
(JSC::ClonedArguments::deleteProperty):
(JSC::ClonedArguments::defineOwnProperty):
(JSC::ClonedArguments::materializeSpecials):

LayoutTests:

* js/basic-strict-mode-expected.txt:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/strict-throw-type-error.js:
* js/script-tests/throw-type-error-is-unique.js:
(test):
* js/strict-throw-type-error-expected.txt:

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

2 years agoInlining should be disallowed when JSC_alwaysUseShadowChicken=true.
mark.lam@apple.com [Fri, 18 Nov 2016 00:23:34 +0000 (00:23 +0000)]
Inlining should be disallowed when JSC_alwaysUseShadowChicken=true.
https://bugs.webkit.org/show_bug.cgi?id=164893
<rdar://problem/29146436>

Reviewed by Saam Barati.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

2 years agoAdd _WKIconLoadingDelegate SPI.
beidson@apple.com [Fri, 18 Nov 2016 00:22:44 +0000 (00:22 +0000)]
Add _WKIconLoadingDelegate SPI.
https://bugs.webkit.org/show_bug.cgi?id=164894

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Manual testing possible in MiniBrowser now, WKTR tests coming soon in https://bugs.webkit.org/show_bug.cgi?id=164895).

With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.

WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.

For icons the app decides to load, WebKit will pass the data to the app without storing locally.

* WebCore.xcodeproj/project.pbxproj:

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

* html/LinkIconCollector.cpp:
(WebCore::iconSize):
(WebCore::compareIcons):
* html/LinkIconCollector.h:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
(WebCore::DocumentLoader::didGetLoadDecisionForIcon):
(WebCore::DocumentLoader::finishedLoadingIcon):
* loader/DocumentLoader.h:

* loader/FrameLoaderClient.h:

* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::IconLoader):
(WebCore::IconLoader::startLoading):
(WebCore::IconLoader::notifyFinished):
* loader/icon/IconLoader.h:

* platform/LinkIcon.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(WebCore::LinkIcon::encode):
(WebCore::LinkIcon::decode):

Source/WebKit2:

With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.

WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.

For icons the app decides to load, WebKit will pass the data to the app without storing locally.

* UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
(API::IconLoadingClient::~IconLoadingClient):
(API::IconLoadingClient::getLoadDecisionForIcon):

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
(-[WKWebView _iconLoadingDelegate]):
(-[WKWebView _setIconLoadingDelegate:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.

* UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
(-[_WKLinkIconParameters _initWithLinkIcon:]):
(-[_WKLinkIconParameters url]):
(-[_WKLinkIconParameters mimeType]):
(-[_WKLinkIconParameters size]):
(-[_WKLinkIconParameters iconType]):
* UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.

* UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
* UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
(WebKit::IconLoadingDelegate::IconLoadingDelegate):
(WebKit::IconLoadingDelegate::~IconLoadingDelegate):
(WebKit::IconLoadingDelegate::createIconLoadingClient):
(WebKit::IconLoadingDelegate::delegate):
(WebKit::IconLoadingDelegate::setDelegate):
(WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
(WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setIconLoadingClient):
(WebKit::WebPageProxy::getLoadDecisionForIcon):
(WebKit::WebPageProxy::finishedLoadingIcon):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::iconLoadingClient):
* UIProcess/WebPageProxy.messages.in:

* WebKit2.xcodeproj/project.pbxproj:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::useIconLoadingClient):
(WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
(WebKit::WebFrameLoaderClient::finishedLoadingIcon):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
(WebKit::WebFrameLoaderClient::setUseIconLoadingClient):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didGetLoadDecisionForIcon):
(WebKit::WebPage::setUseIconLoadingClient):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add MiniBrowser support for this new SPI, configurable with a setting.

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController loadsAllSiteIcons]):
(-[SettingsController toggleLoadsAllSiteIcons:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
(-[WK2BrowserWindowController webView:shouldLoadIconWithParameters:completionHandler:]):

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

2 years agoUpdate TestExpectations for media/modern-media-controls/pip-support/pip-support-enabl...
ryanhaddad@apple.com [Fri, 18 Nov 2016 00:11:18 +0000 (00:11 +0000)]
Update TestExpectations for media/modern-media-controls/pip-support/pip-support-enabled.html.
https://bugs.webkit.org/show_bug.cgi?id=164336

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years ago[SVG] Moving more special casing of SVG out of the bindings - SVG lists
weinig@apple.com [Thu, 17 Nov 2016 23:58:03 +0000 (23:58 +0000)]
[SVG] Moving more special casing of SVG out of the bindings - SVG lists
https://bugs.webkit.org/show_bug.cgi?id=164790

Reviewed by Alex Christensen.

- Make SVGLengthList, SVGNumberList, SVGPointList, SVGStringList, SVGPathSegList and SVGTransformList
  real classes and stop special casing them in the bindings generator. This
  removes the remaining SVG specializations for tear offs from the bindings generator.
- Renamed existing SVGLengthList, SVGNumberList, SVGPointList, SVGStringList, SVGPathSegList,
  SVGPathSegList and SVGTransformList to SVG<Type>ListValues, to make way for the new classes.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAllInOne.cpp:
Add new files.

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
Remove SVG tear off specific code!

* rendering/svg/RenderSVGShape.cpp:
* rendering/svg/RenderSVGText.cpp:
* rendering/svg/RenderSVGTextPath.cpp:
* rendering/svg/SVGRenderTreeAsText.cpp:
* svg/SVGAnimateMotionElement.cpp:
* svg/SVGClipPathElement.cpp:
* svg/SVGLinearGradientElement.cpp:
* svg/SVGRadialGradientElement.cpp:
Remove unnecessary #includes.

* rendering/svg/SVGPathData.cpp:
(WebCore::updatePathFromPolygonElement):
(WebCore::updatePathFromPolylineElement):
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::updateCharacterData):
(WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::constructFromString):
(WebCore::parseLengthListFromString):
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedLengthListAnimator::calculateDistance):
* svg/SVGAnimatedLengthList.h:
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::constructFromString):
(WebCore::SVGAnimatedNumberListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedNumberListAnimator::calculateDistance):
* svg/SVGAnimatedNumberList.h:
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal):
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::constructFromString):
(WebCore::SVGAnimatedPointListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
(WebCore::SVGAnimatedPointListAnimator::calculateDistance):
* svg/SVGAnimatedPointList.h:
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::constructFromString):
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedTransformList.h:
* svg/SVGAnimatedType.cpp:
(WebCore::SVGAnimatedType::createLengthList):
(WebCore::SVGAnimatedType::createNumberList):
(WebCore::SVGAnimatedType::createPointList):
(WebCore::SVGAnimatedType::createTransformList):
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::lengthList):
(WebCore::SVGAnimatedType::numberList):
(WebCore::SVGAnimatedType::pointList):
(WebCore::SVGAnimatedType::transformList):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::parseAttribute):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGParserUtilities.cpp:
(WebCore::pointsListFromSVGData):
* svg/SVGParserUtilities.h:
* svg/SVGPathElement.cpp:
* svg/SVGPathElement.h:
* svg/SVGPathSegListBuilder.cpp:
* svg/SVGPathSegListBuilder.h:
* svg/SVGPathSegListSource.cpp:
* svg/SVGPathSegListSource.h:
* svg/SVGPathUtilities.cpp:
(WebCore::buildSVGPathByteStreamFromSVGPathSegListValues):
(WebCore::appendSVGPathByteStreamFromSVGPathSeg):
(WebCore::buildSVGPathSegListValuesFromByteStream):
(WebCore::buildStringFromSVGPathSegListValues):
(WebCore::buildSVGPathByteStreamFromSVGPathSegList): Deleted.
(WebCore::buildSVGPathSegListFromByteStream): Deleted.
(WebCore::buildStringFromSVGPathSegList): Deleted.
* svg/SVGPathUtilities.h:
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::lookupOrCreatePointsWrapper):
(WebCore::SVGPolyElement::points):
(WebCore::SVGPolyElement::animatedPoints):
* svg/SVGPolyElement.h:
(WebCore::SVGPolyElement::pointList):
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::parseAttribute):
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseTransformAttribute):
* svg/SVGTransformable.h:
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::viewTarget):
(WebCore::SVGViewElement::parseAttribute):
* svg/SVGViewElement.h:
* svg/SVGViewElement.idl:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::transformString):
(WebCore::SVGViewSpec::transform):
(WebCore::SVGViewSpec::lookupOrCreateTransformWrapper):
(WebCore::SVGViewSpec::reset):
* svg/SVGViewSpec.h:
Update for name changes.

* svg/SVGAngle.h:
(WebCore::SVGAngle::create):
(WebCore::SVGAngle::SVGAngle):
* svg/SVGLength.h:
(WebCore::SVGLength::create):
(WebCore::SVGLength::SVGLength):
* svg/SVGMatrix.h:
(WebCore::SVGMatrix::create):
(WebCore::SVGMatrix::SVGMatrix):
* svg/SVGNumber.h:
(WebCore::SVGNumber::create):
(WebCore::SVGNumber::SVGNumber):
* svg/SVGPoint.h:
(WebCore::SVGPoint::create):
(WebCore::SVGPoint::SVGPoint):
* svg/SVGPreserveAspectRatio.h:
(WebCore::SVGPreserveAspectRatio::create):
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
* svg/SVGRect.h:
(WebCore::SVGRect::create):
(WebCore::SVGRect::SVGRect):
* svg/SVGTransform.h:
(WebCore::SVGTransform::create):
(WebCore::SVGTransform::SVGTransform):
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::create):
Pass the SVGAnimatedProperty parameter by reference.

* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::requiredFeatures):
(WebCore::SVGAnimationElement::requiredExtensions):
(WebCore::SVGAnimationElement::systemLanguage):
* svg/SVGAnimationElement.h:
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::requiredFeatures):
(WebCore::SVGCursorElement::requiredExtensions):
(WebCore::SVGCursorElement::systemLanguage):
* svg/SVGCursorElement.h:
* svg/SVGGradientElement.cpp:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::requiredFeatures):
(WebCore::SVGGraphicsElement::requiredExtensions):
(WebCore::SVGGraphicsElement::systemLanguage):
* svg/SVGGraphicsElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::requiredFeatures):
(WebCore::SVGMaskElement::requiredExtensions):
(WebCore::SVGMaskElement::systemLanguage):
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::parseAttribute):
(WebCore::SVGPatternElement::requiredFeatures):
(WebCore::SVGPatternElement::requiredExtensions):
(WebCore::SVGPatternElement::systemLanguage):
* svg/SVGPatternElement.h:
* svg/SVGTests.cpp:
(WebCore::SVGTests::synchronizeAttribute):
(WebCore::SVGTests::synchronizeRequiredFeatures):
(WebCore::SVGTests::synchronizeRequiredExtensions):
(WebCore::SVGTests::synchronizeSystemLanguage):
(WebCore::SVGTests::requiredFeatures):
(WebCore::SVGTests::requiredExtensions):
(WebCore::SVGTests::systemLanguage):
* svg/SVGTests.h:
* svg/SVGTests.idl:
Make SVGTests SVGStringLists work by adding implementations of functions
on the SVGElements that implement SVGTests, passing *this down to SVGTests.

* svg/SVGLengthList.cpp: Removed.
* svg/SVGLengthList.h:
* svg/SVGLengthList.idl:
* svg/SVGLengthListValues.cpp: Copied from svg/SVGLengthList.cpp.
* svg/SVGLengthListValues.h: Copied from svg/SVGLengthList.h.
Rename SVGLengthList to SVGLengthListValues and add an explicit implementation of
the SVGLengthList interface inheriting from SVGListPropertyTearOff<SVGLengthListValues>.

* svg/SVGNumberList.cpp: Removed.
* svg/SVGNumberList.h:
* svg/SVGNumberListValues.cpp: Copied from svg/SVGNumberList.cpp.
* svg/SVGNumberListValues.h: Copied from svg/SVGNumberList.h.
Rename SVGNumberList to SVGNumberListValues and add an explicit implementation of
the SVGNumberList interface inheriting from SVGListPropertyTearOff<SVGNumberListValues>.

* svg/SVGPathSegList.cpp:
* svg/SVGPathSegList.h:
* svg/SVGPathSegListValues.cpp: Copied from svg/SVGPathSegList.cpp.
* svg/SVGPathSegListValues.h: Copied from svg/SVGPathSegList.h.
* svg/properties/SVGPathSegListPropertyTearOff.cpp: Removed.
* svg/properties/SVGPathSegListPropertyTearOff.h: Removed.
Rename SVGPathSegList to SVGPathSegListValues and add an explicit implementation of
the SVGPathSegList interface inheriting from SVGListProperty<SVGPathSegListValues>.

* svg/SVGPointList.cpp: Removed.
* svg/SVGPointList.h:
* svg/SVGPointListValues.cpp: Copied from svg/SVGPointList.cpp.
* svg/SVGPointListValues.h: Copied from svg/SVGPointList.h.
Rename SVGPointList to SVGPointListValues and add an explicit implementation of
the SVGPointList interface inheriting from SVGListPropertyTearOff<SVGPointListValues>.

* svg/SVGStringList.cpp: Removed.
* svg/SVGStringList.h:
* svg/SVGStringListValues.cpp: Copied from svg/SVGStringList.cpp.
* svg/SVGStringListValues.h: Copied from svg/SVGStringList.h.
Rename SVGStringList to SVGStringListValues and add an explicit implementation of
the SVGStringList interface inheriting from SVGStaticListPropertyTearOff<SVGStringListValues>.

* svg/SVGTransformList.cpp: Removed.
* svg/SVGTransformList.h:
* svg/SVGTransformListValues.cpp: Copied from svg/SVGTransformList.cpp.
* svg/SVGTransformListValues.h: Copied from svg/SVGTransformList.h.
* svg/properties/SVGTransformListPropertyTearOff.h: Removed.
Rename SVGTransformList to SVGTransformListValues and add an explicit implementation of
the SVGTransformList interface inheriting from SVGListPropertyTearOff<SVGTransformListValues>.

* svg/properties/SVGAnimatedListPropertyTearOff.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
Convert to return fully specialized types for baseVal and animVal, removing many unnecessary casts
around the codebase. Also add some uses of Ref.

* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::create):
(WebCore::SVGListPropertyTearOff::SVGListPropertyTearOff):
(WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff):
Store the AnimatedListPropertyTearOff as a Ref, and pass it around by reference.

* svg/properties/SVGStaticPropertyTearOff.h:
Update to take the ContextElement by reference.

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

2 years agoCorrect a typo in a TestExpectations file.
ryanhaddad@apple.com [Thu, 17 Nov 2016 23:54:01 +0000 (23:54 +0000)]
Correct a typo in a TestExpectations file.

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoImprove URL length handling
bfulgham@apple.com [Thu, 17 Nov 2016 23:05:37 +0000 (23:05 +0000)]
Improve URL length handling
https://bugs.webkit.org/show_bug.cgi?id=164884
<rdar://problem/5909143>

Reviewed by David Kilzer.

Make sure the result of re-encoding and other fix-up stays within
expected parameters.

No new tests. No change in behavior.

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

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

2 years agoSpeculatively disable eager object zero-fill on not-x86 to let the bots decide if...
fpizlo@apple.com [Thu, 17 Nov 2016 21:37:05 +0000 (21:37 +0000)]
Speculatively disable eager object zero-fill on not-x86 to let the bots decide if that's a problem
https://bugs.webkit.org/show_bug.cgi?id=164885

Reviewed by Mark Lam.

This adds a useGCFences() function that we use to guard all eager object zero-fill and the
related fences. It currently returns true only on x86().

The goal here is to get the bots to tell us if this code is responsible for perf issues on
any non-x86 platforms. We have a few different paths that we can pursue if this turns out
to be the case. Eager zero-fill is merely the easiest way to optimize out some fences, but
we could get rid of it and instead teach B3 how to think about fences.

* assembler/CPU.h:
(JSC::useGCFences):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateImpl):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::mutatorFence):
(JSC::FTL::DFG::LowerDFGToB3::setButterfly):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::mutatorFence):
(JSC::AssemblyHelpers::storeButterfly):
(JSC::AssemblyHelpers::emitInitializeInlineStorage):
(JSC::AssemblyHelpers::emitInitializeOutOfLineStorage):

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

2 years agoRender tree should be all clean by the end of FrameView::layout().
zalan@apple.com [Thu, 17 Nov 2016 21:23:45 +0000 (21:23 +0000)]
Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162834

Reviewed by Simon Fraser.

Source/WebCore:

This is a preventive patch to ensure we don't introduce new bugs through
dirty renderers. There are still 3 failing cases and they are skipped for now (debug only).

* page/FrameView.cpp:
(WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):

LayoutTests:

* TestExpectations:

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

2 years agokeygen element should not support < 2048 RSA key lengths
bfulgham@apple.com [Thu, 17 Nov 2016 21:20:20 +0000 (21:20 +0000)]
keygen element should not support < 2048 RSA key lengths
https://bugs.webkit.org/show_bug.cgi?id=164874
<rdar://problem/22618141>

Reviewed by Dean Jackson.

Source/WebCore:

Remove the two insecure RSA choices (512-bit and 1024-bit) so that users
do not accidentally select a bad key length.

Tested by fast/html/keygen.html

* platform/LocalizedStrings.cpp:
(WebCore::keygenMenuItem512): Deleted.
(WebCore::keygenMenuItem1024): Deleted.
* platform/LocalizedStrings.h:
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString): ASSERT on bad key size.
(WebCore::getSupportedKeySizes): Remove bad key sizes.
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::WebCore::getSupportedKeySizes): Ditto.

LayoutTests:

* platform/mac/fast/html/keygen-expected.txt:
* platform/mac-elcapitan/fast/html/keygen-expected.txt:

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

2 years agoWeb Inspector: Shift clicking on named color value only shows its hex form
commit-queue@webkit.org [Thu, 17 Nov 2016 20:25:24 +0000 (20:25 +0000)]
Web Inspector: Shift clicking on named color value only shows its hex form
https://bugs.webkit.org/show_bug.cgi?id=162758

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

Source/WebInspectorUI:

* UserInterface/Models/Color.js:
(WebInspector.Color.prototype.nextFormat):
Reworked the logic for the formatting order to be the following:
 - Long HEX and Long HEXAlpha
 - RGB and RGBA
 - HSL and HSLA
 - Keyword (if applicable)
 - Short HEX (if applicable)
 - Short HEXAlpha (if applicable)
It will only show formats with alpha values if the color value has an alpha that is not 1.
If the alpha is not 1, it will not show formats with non-alpha values.

The changes to this function have no effect on the context menu items of InlineSwatch
elements.  The purpose of each of those items is to allow the user to change the format to
a specified type, whereas WebInspector.Color.prototype.nextFormat is used to cycle through
all of the relevant formats.

(WebInspector.Color.prototype._toRGBString):
(WebInspector.Color.prototype._toRGBAString):
(WebInspector.Color.prototype._toHSLString):
(WebInspector.Color.prototype._toHSLAString):
Unrelated fix of extra decimals when converting from HEX to RGB and HSL.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
(WebInspector.CSSStyleDeclarationTextEditor._inlineSwatchValueChanged):
Removed assertion for `_hasActiveInlineSwatchEditor` since the value may change from
switching the format of a color swatch (Shift-Click).

LayoutTests:

* inspector/model/color.html:
Updated the WebInspector.Color.prototype.nextFormat test for the new nextFormat logic.

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

2 years ago[JSC] remove leftover references to ES2017_ASYNCFUNCTION_SYNTAX flag
caitp@igalia.com [Thu, 17 Nov 2016 20:15:51 +0000 (20:15 +0000)]
[JSC] remove leftover references to ES2017_ASYNCFUNCTION_SYNTAX flag
https://bugs.webkit.org/show_bug.cgi?id=164879

Reviewed by Alex Christensen.

The flag was referenced in FeatureList.pm and in one of the
FeatureDefines.xcconfig files, despite being removed.

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

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

2 years agoAdd rotate to Wasm
keith_miller@apple.com [Thu, 17 Nov 2016 19:21:42 +0000 (19:21 +0000)]
Add rotate to Wasm
https://bugs.webkit.org/show_bug.cgi?id=164871

Reviewed by Filip Pizlo.

JSTests:

* wasm/wasm.json:

Source/JavaScriptCore:

Add rotate left and rotate right to Wasm. These directly map to B3 opcodes.
This also moves arm specific transformations of rotate left to lower macros
after optimization. It's a bad idea to have platform specific canonicalizations
in reduce strength since other optimizations may not be aware of it.

Add a bug to do pure CSE after lower macros after optimization since we want to
clean up RotL(value, Neg(Neg(shift))).

* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3LowerMacrosAfterOptimizations.cpp:
* b3/B3ReduceStrength.cpp:
* wasm/wasm.json:

Websites/webkit.org:

Update docs for new rotate instructions.

* docs/b3/intermediate-representation.html:

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

2 years agoAdd sqrt to Wasm
keith_miller@apple.com [Thu, 17 Nov 2016 19:07:31 +0000 (19:07 +0000)]
Add sqrt to Wasm
https://bugs.webkit.org/show_bug.cgi?id=164877

Reviewed by Mark Lam.

B3 already has a Sqrt opcode we just need to map Wasm to it.

* wasm/wasm.json:

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

2 years agoMarking http/tests/media/modern-media-controls/skip-back-support/skip-back-support...
ryanhaddad@apple.com [Thu, 17 Nov 2016 18:57:10 +0000 (18:57 +0000)]
Marking http/tests/media/modern-media-controls/skip-back-support/skip-back-support-button-click.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164616

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMarking inspector/worker/debugger-multiple-targets-pause.html as flaky.
ryanhaddad@apple.com [Thu, 17 Nov 2016 18:50:47 +0000 (18:50 +0000)]
Marking inspector/worker/debugger-multiple-targets-pause.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164872

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years ago[MediaStream][Mac] Use AVCapturePreview object for camera/microphone rendering
eric.carlson@apple.com [Thu, 17 Nov 2016 18:43:40 +0000 (18:43 +0000)]
[MediaStream][Mac] Use AVCapturePreview object for camera/microphone rendering
https://bugs.webkit.org/show_bug.cgi?id=164837
<rdar://problem/29297727>

Reviewed by Jer Noble.

No new tests, the real capture devices can not be used in layout tests.

* WebCore.xcodeproj/project.pbxproj:

Drive-by fix: clear m_settingMediaStreamSrcObject when the media player is destroyed unless
that happens as a side effect of setting video.srcObject.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::clearMediaPlayer):
* html/HTMLMediaElement.h:

Add support for realtime media source that vend a preview interface, while keeping support
for those that do not (e.g. the mock capture devices).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBuffer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareVideoSampleBufferFromTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::internalSetVolume):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):

* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::platformLayer): Deleted, no longer used.
* platform/mediastream/MediaStreamPrivate.h:

Enable/disable the preview when available.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setEnabled):
(WebCore::MediaStreamTrackPrivate::endTrack):
(WebCore::MediaStreamTrackPrivate::preview):
* platform/mediastream/MediaStreamTrackPrivate.h:

* platform/mediastream/RealtimeMediaSource.h:
(WebCore::RealtimeMediaSource::preview):
(WebCore::RealtimeMediaSource::createWeakPtr):
(WebCore::RealtimeMediaSource::platformLayer): Deleted.

Define a realtime media source preview interface.
* platform/mediastream/RealtimeMediaSourcePreview.h: Added.
(WebCore::RealtimeMediaSourcePreview::~RealtimeMediaSourcePreview):
(WebCore::RealtimeMediaSourcePreview::invalidate):
(WebCore::RealtimeMediaSourcePreview::createWeakPtr):
(WebCore::RealtimeMediaSourcePreview::RealtimeMediaSourcePreview):

Implement the preview interface.
* platform/mediastream/mac/AVAudioCaptureSource.h:
* platform/mediastream/mac/AVAudioCaptureSource.mm:
(WebCore::AVAudioSourcePreview::create):
(WebCore::AVAudioSourcePreview::AVAudioSourcePreview):
(WebCore::AVAudioSourcePreview::invalidate):
(WebCore::AVAudioSourcePreview::play):
(WebCore::AVAudioSourcePreview::pause):
(WebCore::AVAudioSourcePreview::setEnabled):
(WebCore::AVAudioSourcePreview::setVolume):
(WebCore::AVAudioSourcePreview::updateState):
(WebCore::AVAudioCaptureSource::createPreview):
* platform/mediastream/mac/AVMediaCaptureSource.h:
(WebCore::AVMediaCaptureSource::createWeakPtr):
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::reset):
(WebCore::AVMediaCaptureSource::preview):
(WebCore::AVMediaCaptureSource::removePreview):
(WebCore::AVMediaSourcePreview::AVMediaSourcePreview):
(WebCore::AVMediaSourcePreview::~AVMediaSourcePreview):
(WebCore::AVMediaSourcePreview::invalidate):
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoSourcePreview::create):
(WebCore::AVVideoSourcePreview::AVVideoSourcePreview):
(WebCore::AVVideoSourcePreview::invalidate):
(WebCore::AVVideoSourcePreview::play):
(WebCore::AVVideoSourcePreview::pause):
(WebCore::AVVideoSourcePreview::setPaused):
(WebCore::AVVideoSourcePreview::setEnabled):
(WebCore::AVVideoCaptureSource::shutdownCaptureSession):
(WebCore::AVVideoCaptureSource::processNewFrame):
(WebCore::AVVideoCaptureSource::createPreview):
(WebCore::AVVideoCaptureSource::platformLayer): Deleted.

* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::platformLayer): Deleted.
(WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::applyFrameRate):
(WebCore::MockRealtimeVideoSource::applySize):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::updatePlatformLayer): Deleted.

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

2 years agoMarking imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating.htm as flaky...
ryanhaddad@apple.com [Thu, 17 Nov 2016 18:19:55 +0000 (18:19 +0000)]
Marking imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating.htm as flaky on mac-wk2 debug.
https://bugs.webkit.org/show_bug.cgi?id=164870

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoUnreviewed, fix build after r208839.
cdumez@apple.com [Thu, 17 Nov 2016 18:08:28 +0000 (18:08 +0000)]
Unreviewed, fix build after r208839.

* dom/Node.h:
(WebCore::Node::isDescendantOf):

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

2 years agoAdd support for rotate in B3 and the relevant assemblers
keith_miller@apple.com [Thu, 17 Nov 2016 17:52:03 +0000 (17:52 +0000)]
Add support for rotate in B3 and the relevant assemblers
https://bugs.webkit.org/show_bug.cgi?id=164869

Reviewed by Geoffrey Garen.

This patch runs RotR and RotL (rotate right and left respectively)
through B3 and B3's assemblers. One thing of note is that ARM64 does
not support rotate left instead it allows negative right rotations.

This patch also fixes a theoretical bug in the assembler where
on X86 doing someShiftOp(reg, edx) would instead shift the shift
amount by the value. Additionally, this patch refactors some
of the X86 assembler to use templates when deciding how to format
the appropriate shift instruction.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::rotateRight32):
(JSC::MacroAssemblerARM64::rotateRight64):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::rotateRight32):
(JSC::MacroAssemblerX86Common::rotateLeft32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::lshift64):
(JSC::MacroAssemblerX86_64::rshift64):
(JSC::MacroAssemblerX86_64::urshift64):
(JSC::MacroAssemblerX86_64::rotateRight64):
(JSC::MacroAssemblerX86_64::rotateLeft64):
(JSC::MacroAssemblerX86_64::or64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::xorq_rm):
(JSC::X86Assembler::shiftInstruction32):
(JSC::X86Assembler::sarl_i8r):
(JSC::X86Assembler::shrl_i8r):
(JSC::X86Assembler::shll_i8r):
(JSC::X86Assembler::rorl_i8r):
(JSC::X86Assembler::rorl_CLr):
(JSC::X86Assembler::roll_i8r):
(JSC::X86Assembler::roll_CLr):
(JSC::X86Assembler::shiftInstruction64):
(JSC::X86Assembler::sarq_CLr):
(JSC::X86Assembler::sarq_i8r):
(JSC::X86Assembler::shrq_i8r):
(JSC::X86Assembler::shlq_i8r):
(JSC::X86Assembler::rorq_i8r):
(JSC::X86Assembler::rorq_CLr):
(JSC::X86Assembler::rolq_i8r):
(JSC::X86Assembler::rolq_CLr):
* b3/B3Common.h:
(JSC::B3::rotateRight):
(JSC::B3::rotateLeft):
* b3/B3Const32Value.cpp:
(JSC::B3::Const32Value::rotRConstant):
(JSC::B3::Const32Value::rotLConstant):
* b3/B3Const32Value.h:
* b3/B3Const64Value.cpp:
(JSC::B3::Const64Value::rotRConstant):
(JSC::B3::Const64Value::rotLConstant):
* b3/B3Const64Value.h:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3ReduceStrength.cpp:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::rotRConstant):
(JSC::B3::Value::rotLConstant):
(JSC::B3::Value::effects):
(JSC::B3::Value::key):
(JSC::B3::Value::typeFor):
* b3/B3Value.h:
* b3/B3ValueKey.cpp:
(JSC::B3::ValueKey::materialize):
* b3/air/AirInstInlines.h:
(JSC::B3::Air::isRotateRight32Valid):
(JSC::B3::Air::isRotateLeft32Valid):
(JSC::B3::Air::isRotateRight64Valid):
(JSC::B3::Air::isRotateLeft64Valid):
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testRotR):
(JSC::B3::testRotL):
(JSC::B3::testRotRWithImmShift):
(JSC::B3::testRotLWithImmShift):
(JSC::B3::run):

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

2 years ago[CSS Parser] Add @supports, @keyframe and media query parsing options
hyatt@apple.com [Thu, 17 Nov 2016 17:28:52 +0000 (17:28 +0000)]
[CSS Parser] Add @supports, @keyframe and media query parsing options
https://bugs.webkit.org/show_bug.cgi?id=164821

Reviewed by Sam Weinig and Zalan Bujtas.

Source/WebCore:

* css/CSSKeyframeRule.cpp:
(WebCore::StyleKeyframe::setKeyText):
* css/CSSKeyframeRule.h:
* css/CSSKeyframesRule.cpp:
(WebCore::StyleRuleKeyframes::findKeyframeIndex):
Changed to call into CSSParserImpls implementation. The new parser
is now always used when parsing the key list.

* css/MediaList.cpp:
(WebCore::MediaQuerySet::create):
(WebCore::MediaQuerySet::MediaQuerySet):
(WebCore::MediaQuerySet::set):
(WebCore::MediaQuerySet::add):
(WebCore::MediaQuerySet::remove):
(WebCore::MediaList::setMediaText):
(WebCore::parseMediaDescriptor): Deleted.
(WebCore::MediaQuerySet::internalParse): Deleted.
(WebCore::MediaQuerySet::parse): Deleted.
* css/MediaList.h:
Rewritten to remove fallback descriptor support/parsing, since no other
browser supports it, and this was part of our initial 2005 landing that
nobody else appears to use.  Media queries now call into the new parser always.

* css/MediaQueryExp.cpp:
(WebCore::featureWithValidDensity):
(WebCore::featureWithPositiveNumber):
(WebCore::MediaQueryExpression::MediaQueryExpression):
Make sure to support transform2d, animation and transition.

* css/StyleMedia.cpp:
(WebCore::StyleMedia::matchMedium):
Call the normal create now that fallback descriptor syntax is gone.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseKeyframeRule):
(WebCore::CSSParser::parseSupportsCondition):
(WebCore::CSSParser::parseInlineStyleDeclaration):
(WebCore::CSSParser::parseDeclarationDeprecated):
(WebCore::CSSParser::parseDeclaration):
(WebCore::CSSParser::parseKeyframeKeyList):
(WebCore::CSSParser::parseMediaQuery): Deleted.
(WebCore::CSSParser::parseKeyframeSelector): Deleted.
* css/parser/CSSParser.h:
Patched the old parser to have flags to call into the new parser
for supports conditions and keyframes. Rename the parseDeclaration that
is only used by the old parser to have the word Deprecated in it. Removed
the media query and key list parsing functions, since the new parser
now does it always.

* css/parser/CSSParserIdioms.cpp:
(WebCore::convertToASCIILowercaseInPlace): Deleted.
* css/parser/CSSParserIdioms.h:
* css/parser/CSSParserToken.cpp:
(WebCore::convertToASCIILowercaseInPlace):
(WebCore::CSSParserToken::convertToASCIILowercaseInPlace):
* css/parser/CSSParserToken.h:
(WebCore::CSSParserToken::value):
(WebCore::CSSParserToken::initValueFromStringView):
* css/parser/CSSParserValues.cpp:
(WebCore::CSSParserSelector::parsePseudoElementSelectorFromStringView):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAttr):
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):
(WebCore::CSSSelectorParser::consumePseudo):
Moving convertToASCIILowercase to be a CSSParserToken member function instead
of operating on StringView. This saves an extra step, since the token itself
already had all the correct members. Note that converting in-place is bad,
and we'll be removing it once the new parser turns on.

* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readMediaType):
(WebCore::MediaQueryParser::readFeature):
(WebCore::MediaQueryParser::readFeatureEnd):
Require the closing ")" on features. Fix the in-place lowercasing to only
be done for features, not for types. This matches the old parser.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createCSSStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::parseAttribute):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::mediaAttributeMatches):
Patched to call the normal MediaQuerySet::create and not the one that had fallback
descriptor support.

Source/WebKit/mac:

Fix up the create call now that fallback descriptor syntax is gone.

* DOM/DOM.mm:
(-[DOMHTMLLinkElement _mediaQueryMatches]):

LayoutTests:

Delete the fallback descriptor tests, since that feature has been
removed. Update some of the other tests based off some parsing changes
from using the new parser always.

* fast/media/media-descriptor-syntax-01-expected.html: Removed.
* fast/media/media-descriptor-syntax-01.html: Removed.
* fast/media/media-descriptor-syntax-02-expected.html: Removed.
* fast/media/media-descriptor-syntax-02.html: Removed.
* fast/media/media-descriptor-syntax-03-expected.html: Removed.
* fast/media/media-descriptor-syntax-03.html: Removed.
* fast/media/media-descriptor-syntax-04-expected.html: Removed.
* fast/media/media-descriptor-syntax-04.html: Removed.
* fast/media/media-descriptor-syntax-06-expected.html: Removed.
* fast/media/media-descriptor-syntax-06.html: Removed.
* fast/media/media-query-list-02-expected.txt:
* fast/media/media-query-list-03-expected.txt:
* fast/media/media-query-list-04-expected.txt:
* fast/media/media-query-list-05-expected.txt:
* fast/media/media-query-list-06-expected.txt:
* fast/media/mq-pointer-expected.txt:
* fast/media/w3c/test_media_queries-expected.txt:

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

2 years agoRemove pass expectation for custom-elements tests on ios-sim because CEReactions...
ryanhaddad@apple.com [Thu, 17 Nov 2016 17:21:43 +0000 (17:21 +0000)]
Remove pass expectation for custom-elements tests on ios-sim because CEReactions were disabled in r208837.
https://bugs.webkit.org/show_bug.cgi?id=164852

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

2 years agoUnreviewed, attempt to fix link error after r208841 part2
utatane.tea@gmail.com [Thu, 17 Nov 2016 10:59:38 +0000 (10:59 +0000)]
Unreviewed, attempt to fix link error after r208841 part2

Use static_cast to avoid referencing static storage.

* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):

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

2 years agoUnreviewed, attempt to fix link error after r208841
utatane.tea@gmail.com [Thu, 17 Nov 2016 10:53:16 +0000 (10:53 +0000)]
Unreviewed, attempt to fix link error after r208841

* storage/StorageMap.h:

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

2 years agoRemove async/await compile time flag and enable tests
sbarati@apple.com [Thu, 17 Nov 2016 09:05:11 +0000 (09:05 +0000)]
Remove async/await compile time flag and enable tests
https://bugs.webkit.org/show_bug.cgi?id=164828
<rdar://problem/28639334>

Reviewed by Yusuke Suzuki.

.:

* Source/cmake/WebKitFeatures.cmake:

JSTests:

* stress/async-arrow-functions-lexical-arguments-binding.js:
* stress/async-arrow-functions-lexical-new.target-binding.js:
* stress/async-arrow-functions-lexical-super-binding.js:
* stress/async-arrow-functions-lexical-this-binding.js:
* stress/async-await-basic.js:
* stress/async-await-long-loop.js:
* stress/async-await-module-reserved-word.js:
* stress/async-await-mozilla.js:
(mozSyntaxErrors):
* stress/async-await-reserved-word.js:
* stress/async-await-syntax.js:
* stress/async-await-throw-loop.js:
* stress/async-function-create-nobaseline.js:
* stress/async-function-create-optimized.js:
* stress/async-function-declaration-sinking-no-double-allocate.js:
* stress/async-function-declaration-sinking-osrexit.js:
* stress/async-function-declaration-sinking-put.js:
* stress/async-function-expression-sinking-no-double-allocate.js:
* stress/async-function-expression-sinking-osrexit.js:
* stress/async-function-expression-sinking-put.js:
* test262.yaml:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseStatementListItem):
(JSC::Parser<LexerType>::parseStatement):
(JSC::Parser<LexerType>::parseClass):
(JSC::Parser<LexerType>::parseExportDeclaration):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
(JSC::Parser<LexerType>::parseUnaryExpression):

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

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

2 years ago[Win] run-api-tests is failing.
pvollan@apple.com [Thu, 17 Nov 2016 09:04:24 +0000 (09:04 +0000)]
[Win] run-api-tests is failing.
https://bugs.webkit.org/show_bug.cgi?id=164818

Reviewed by Alexey Proskuryakov.

Make sure Visual Studio interprets string literal as utf8.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::TEST_F):

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

2 years ago[JSC] WTF::TemporaryChange with WTF::SetForScope
utatane.tea@gmail.com [Thu, 17 Nov 2016 08:48:34 +0000 (08:48 +0000)]
[JSC] WTF::TemporaryChange with WTF::SetForScope
https://bugs.webkit.org/show_bug.cgi?id=164761

Reviewed by Saam Barati.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
* bytecompiler/SetForScope.h: Removed.
* debugger/Debugger.cpp:
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::dispatchBreakpointActionLog):
(Inspector::ScriptDebugServer::dispatchBreakpointActionSound):
(Inspector::ScriptDebugServer::dispatchBreakpointActionProbe):
(Inspector::ScriptDebugServer::sourceParsed):
(Inspector::ScriptDebugServer::dispatchFunctionToListeners):
* parser/Parser.cpp:

Source/WebCore:

No behavior change.

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::define):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateModule):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
* css/StyleResolver.cpp:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFillShorthand):
(WebCore::CSSParser::parseShorthand):
(WebCore::CSSParser::parse4Values):
(WebCore::CSSParser::parseBorderRadius):
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue):
* dom/CustomElementRegistry.h:
* dom/Document.cpp:
(WebCore::Document::recalcStyle):
(WebCore::Document::styleForElementIgnoringPendingStylesheets):
(WebCore::Document::destroyRenderTree):
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* dom/Microtasks.cpp:
(WebCore::MicrotaskQueue::performMicrotaskCheckpoint):
* history/PageCache.cpp:
(WebCore::PageCache::pruneToSizeNow):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
* html/parser/CSSPreloadScanner.cpp:
(WebCore::CSSPreloadScanner::scan):
* html/parser/HTMLConstructionSite.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::handleProvisionalLoadFailure):
* loader/SubresourceLoader.cpp:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
* page/Chrome.cpp:
(WebCore::Chrome::runModal):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::applyRecursivelyWithVisibleRect):
(WebCore::FrameView::autoSizeIfEnabled):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeaders):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::commitLayerChangesAfterSublayers):
* platform/graphics/opengl/TemporaryOpenGLSetting.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::writeClipboardContents):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
* rendering/RenderBlock.cpp:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushMappingsToAncestor):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest):
* replay/EventLoopInputDispatcher.cpp:
(WebCore::EventLoopInputDispatcher::dispatchInput):
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItemIgnoringQuota):
* svg/SVGPathBlender.cpp:
(WebCore::SVGPathBlender::addAnimatedPath):

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.cpp:

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView updateTextTouchBar]):

Source/WebKit2:

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::initialize):
* PluginProcess/WebProcessConnection.cpp:
(WebKit::WebProcessConnection::didReceiveMessage):
(WebKit::WebProcessConnection::didReceiveSyncMessage):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(createEncodedObject):
(decodeObject):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTextTouchBar):
* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
(WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
* UIProcess/gtk/WebPasteboardProxyGtk.cpp:
(WebKit::WebPasteboardProxy::writeToClipboard):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::purgeBackingStores):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::dispatchTouchEvent):
(WebKit::WebPage::setInitialFocus):
(WebKit::WebPage::insertTextAsync):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
* WebProcess/WebPage/mac/WebPageMac.mm:

Source/WTF:

JavaScriptCore's bytecompiler/SetForScope.h is completely the same
to WTF::TemporaryChange. SetForScope sounds better name since it
says that this object works as Scope.

We rename WTF::TemporaryChange to WTF::SetForScope. And replace
all the use to this WTF::SetForScope.

* WTF.xcodeproj/project.pbxproj:
* wtf/SetForScope.h: Renamed from Source/WTF/wtf/TemporaryChange.h.
(WTF::SetForScope::SetForScope):
(WTF::SetForScope::~SetForScope):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/SetForScope.cpp: Renamed from Tools/TestWebKitAPI/Tests/WTF/TemporaryChange.cpp.
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):

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

2 years ago[WebCore] Clean up script loading code in XML
utatane.tea@gmail.com [Thu, 17 Nov 2016 06:47:31 +0000 (06:47 +0000)]
[WebCore] Clean up script loading code in XML
https://bugs.webkit.org/show_bug.cgi?id=161651

Reviewed by Ryosuke Niwa.

Source/WebCore:

This patch cleans up XML document script handling by using PendingScript.
Previously, we directly used CachedScript. But it is not good since we
have PendingScript wrapper.

We also disable ES6 modules for non HTML document. While ES6 modules tag
requires "defer" semantics, "defer" semantics is not implemented in non
HTML documents. And ES6 module tag is only specified in whatwg HTML spec.

* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::execute):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::executeClassicScript):
(WebCore::ScriptElement::executePendingScript):
(WebCore::ScriptElement::executeScript): Deleted.
(WebCore::ScriptElement::executeScriptForScriptRunner): Deleted.
* dom/ScriptElement.h:
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):
* html/parser/HTMLDocumentParser.cpp:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
(WebCore::HTMLScriptRunner::runScript):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::notifyFinished):
* xml/parser/XMLDocumentParser.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):
(WebCore::XMLDocumentParser::~XMLDocumentParser):
(WebCore::XMLDocumentParser::endElementNs):

LayoutTests:

Add tests that ensure modules are not executed in XHTML documents.

* js/dom/modules/module-inline-dynamic-in-xhtml-expected.txt: Added.
* js/dom/modules/module-inline-dynamic-in-xhtml.xhtml: Added.
* js/dom/modules/module-inline-simple-in-xhtml-expected.txt: Added.
* js/dom/modules/module-inline-simple-in-xhtml.xhtml: Added.
* js/dom/modules/module-src-dynamic-in-xhtml-expected.txt: Added.
* js/dom/modules/module-src-dynamic-in-xhtml.xhtml: Added.
* js/dom/modules/module-src-simple-in-xhtml-expected.txt: Added.
* js/dom/modules/module-src-simple-in-xhtml.xhtml: Added.

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

2 years agoAdd Node::isDescendantOf() overload that takes in a reference
cdumez@apple.com [Thu, 17 Nov 2016 06:24:13 +0000 (06:24 +0000)]
Add Node::isDescendantOf() overload that takes in a reference
https://bugs.webkit.org/show_bug.cgi?id=164854

Reviewed by Ryosuke Niwa.

Add Node::isDescendantOf() overload that takes in a reference as a lot
of call sites have a reference or a pointer they know is not null.

No new tests, no Web-exposed behavior change.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
* dom/Document.cpp:
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFullScreenElementOfSubtree):
(WebCore::Document::setAnimatingFullScreen):
* dom/Node.cpp:
(WebCore::Node::isDescendantOf):
(WebCore::Node::isDescendantOrShadowDescendantOf):
(WebCore::Node::contains):
* dom/Node.h:
(WebCore::Node::isDescendantOf):
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::updateForNodeRemoval):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeFastPathForIdSelector):
(WebCore::filterRootById):
* dom/TypedElementDescendantIterator.h:
(WebCore::TypedElementDescendantIteratorAdapter<ElementType>::beginAt):
(WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
(WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::beginAt):
(WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
(WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
* editing/BreakBlockquoteCommand.cpp:
(WebCore::BreakBlockquoteCommand::doApply):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::handleGeneralDelete):
(WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::textDirectionForSelection):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/TextIterator.cpp:
(WebCore::TextIterator::advance):
* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore):
(WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter):
* editing/htmlediting.cpp:
(WebCore::firstEditablePositionAfterPositionInRoot):
(WebCore::lastEditablePositionBeforePositionInRoot):
(WebCore::selectionForParagraphIteration):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
* html/CachedHTMLCollection.h:
(WebCore::traversalType>::namedItem):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formElementIndex):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::getElementById):

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

2 years agoFix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
rniwa@webkit.org [Thu, 17 Nov 2016 05:46:32 +0000 (05:46 +0000)]
Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845

Reviewed by Dan Bernstein.

Revert r208833 and fix the build by declaring AVFunctionBarMediaSelectionOption and AVThumbnail in AVKitSPI.h

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
* platform/spi/cocoa/AVKitSPI.h:

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

2 years agoREGRESSION(r208082): 1% Speedometer regression on iOS
rniwa@webkit.org [Thu, 17 Nov 2016 04:32:49 +0000 (04:32 +0000)]
REGRESSION(r208082): 1% Speedometer regression on iOS
https://bugs.webkit.org/show_bug.cgi?id=164852

Reviewed by Chris Dumez.

Source/WebCore:

Temporarily disable CEReactions entirely to recover the regression in Speedometer since
reverting r208082 wouldn't remove CEReactions from other DOM APIs and if r208082 was a regression,
then they're likely causing a regression on Speedometer as well.

* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add): Removed the release assert added in r208785
since reactions can be inserted into the backup queue while the queue is running.
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll): Ditto.
* dom/CustomElementReactionQueue.h:
(WebCore::CustomElementReactionStack::CustomElementReactionStack): Removed all the code so that this
constructor would be optimized away by clang.
(WebCore::CustomElementReactionStack::~CustomElementReactionStack): Ditto.

LayoutTests:

Add failing test expectations for various custom elements now that CEReactions is not working.

* TestExpectations:

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

2 years agoUnreviewed build fix after r208589
bfulgham@apple.com [Thu, 17 Nov 2016 02:23:16 +0000 (02:23 +0000)]
Unreviewed build fix after r208589

The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
the Resources folder, so was not deployed with WebKit. We need to treat it like
com.apple.WebProcess.sb and the other generated files.

* WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
the framework Resources.

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

2 years agoExceptionFuzz needs to placate exception check verification before overwriting a...
mark.lam@apple.com [Thu, 17 Nov 2016 01:34:32 +0000 (01:34 +0000)]
ExceptionFuzz needs to placate exception check verification before overwriting a thrown exception.
https://bugs.webkit.org/show_bug.cgi?id=164843

Reviewed by Keith Miller.

The ThrowScope will check for unchecked simulated exceptions before throwing a
new exception.  This ensures that we don't quietly overwrite a pending exception
(which should never happen, with the only exception being to rethrow the same
exception).  However, ExceptionFuzz works by intentionally throwing its own
exception even when one may already exist thereby potentially overwriting an
existing exception.  This is ok for ExceptionFuzz testing, but we need to placate
the exception check verifier before ExceptionFuzz throws its own exception.

* runtime/ExceptionFuzz.cpp:
(JSC::doExceptionFuzzing):

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

2 years agoFix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
rniwa@webkit.org [Thu, 17 Nov 2016 01:26:33 +0000 (01:26 +0000)]
Fix build on macOS Sierra when WEB_PLAYBACK_CONTROLS_MANAGER is enabled
https://bugs.webkit.org/show_bug.cgi?id=164845

Reviewed by Wenson Hsieh.

Fix builds after r208802 by wrapping code inside USE(APPLE_INTERNAL_SDK).

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):

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

2 years agoWeb Inspector: Background tabs are often updating non-stop because they think they...
commit-queue@webkit.org [Thu, 17 Nov 2016 01:15:43 +0000 (01:15 +0000)]
Web Inspector: Background tabs are often updating non-stop because they think they are visible
https://bugs.webkit.org/show_bug.cgi?id=164841
<rdar://problem/29298658>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-11-16
Reviewed by Matt Baker.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype._update):
Don't constantly update when this tab is not in the foreground.

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

2 years agoREGRESSION (r208455): LayoutTests swipe/pushState-cached-back-swipe.html and swipe...
ap@apple.com [Thu, 17 Nov 2016 01:14:35 +0000 (01:14 +0000)]
REGRESSION (r208455): LayoutTests swipe/pushState-cached-back-swipe.html and swipe/main-frame-pinning-requirement.html are failing
https://bugs.webkit.org/show_bug.cgi?id=164572

Reviewed by Tim Horton.

Tools:

* WebKitTestRunner/mac/TestControllerMac.mm: (WTR::TestController::platformResetStateToConsistentValues):
Use the correct constant.

LayoutTests:

* platform/mac-wk2/TestExpectations: Remove flakiness expectations.

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

2 years agoUnlinkedCodeBlock should not have a starting line number
ggaren@apple.com [Thu, 17 Nov 2016 01:02:06 +0000 (01:02 +0000)]
UnlinkedCodeBlock should not have a starting line number
https://bugs.webkit.org/show_bug.cgi?id=164838

Reviewed by Mark Lam.

Here's how the starting line number in UnlinkedCodeBlock used to work:

(1) Assign the source code starting line number to the parser starting
line number.

(2) Assign (1) to the AST.

(3) Subtract (1) from (2) and assign to UnlinkedCodeBlock.

Then, when linking:

(4) Add (3) to (1).

This was an awesome no-op.

Generally, unlinked code is code that is not tied to any particular
web page or resource. So, it's inappropriate to think of it having a
starting line number.

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::recordParse):
(JSC::UnlinkedCodeBlock::hasCapturedVariables):
(JSC::UnlinkedCodeBlock::firstLine): Deleted.
* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):
* runtime/CodeCache.h:
(JSC::generateUnlinkedCodeBlock):

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

2 years agoScriptExecutionContext::processMessagePortMessagesSoon() should only post task when...
cdumez@apple.com [Thu, 17 Nov 2016 00:59:04 +0000 (00:59 +0000)]
ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary
https://bugs.webkit.org/show_bug.cgi?id=164812
<rdar://problem/29148465>

Reviewed by Geoffrey Garen.

ScriptExecutionContext::processMessagePortMessagesSoon() should only post task when necessary,
meaning when there is not already one pending.

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
* dom/ScriptExecutionContext.h:

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

2 years agoUse more references in TreeScope / TreeScopeAdopter
cdumez@apple.com [Thu, 17 Nov 2016 00:39:55 +0000 (00:39 +0000)]
Use more references in TreeScope / TreeScopeAdopter
https://bugs.webkit.org/show_bug.cgi?id=164836

Reviewed by Ryosuke Niwa.

Use more references in TreeScope / TreeScopeAdopter and avoid some
unnecessary null checks.

No new tests, no Web-exposed behavior change.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::removeBetween):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
(WebCore::ContainerNode::parserAppendChild):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::addChildNodesToDeletionQueue):
* dom/Document.cpp:
(WebCore::Document::adoptNode):
(WebCore::Document::moveNodeIteratorsToNewDocument):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::addShadowRoot):
(WebCore::Element::removeShadowRoot):
(WebCore::Element::setAttributeNode):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::ensureAttr):
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::didMoveToNewDocument):
* dom/Node.h:
* dom/NodeRareData.h:
(WebCore::NodeListsNodeData::adoptDocument):
* dom/TreeScope.cpp:
(WebCore::TreeScope::TreeScope):
(WebCore::TreeScope::setParentTreeScope):
(WebCore::TreeScope::adoptIfNeeded):
* dom/TreeScope.h:
(WebCore::TreeScope::documentScope):
(WebCore::TreeScope::setDocumentScope):
* dom/TreeScopeAdopter.cpp:
(WebCore::TreeScopeAdopter::moveTreeToNewScope):
(WebCore::TreeScopeAdopter::moveShadowTreeToNewDocument):
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::updateTreeScope):
(WebCore::TreeScopeAdopter::moveNodeToNewDocument):
* dom/TreeScopeAdopter.h:
(WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
(WebCore::TreeScopeAdopter::TreeScopeAdopter):
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::didMoveToNewDocument):
* html/FormAssociatedElement.h:
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::didMoveToNewDocument):
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didMoveToNewDocument):
* html/HTMLFormControlElement.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::didMoveToNewDocument):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::didMoveToNewDocument):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::didMoveToNewDocument):
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didMoveToNewDocument):
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::didMoveToNewDocument):
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::didMoveToNewDocument):
* html/HTMLPictureElement.h:
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument):
* html/HTMLPlugInImageElement.h:
* html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::didMoveToNewDocument):
* html/HTMLTemplateElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::didMoveToNewDocument):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::didMoveToNewDocument):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::didMoveToNewDocument):
* svg/SVGImageElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::didMoveToNewDocument):
* svg/SVGSVGElement.h:

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

2 years agoAdded Web App Manifest to the Feature Status page.
jond@apple.com [Thu, 17 Nov 2016 00:37:15 +0000 (00:37 +0000)]
Added Web App Manifest to the Feature Status page.
https://bugs.webkit.org/show_bug.cgi?id=162675

Reviewed by Timothy Hatcher.

* features.json:

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

2 years agoUse more references for Document::removeFocusedNodeOfSubtree()
cdumez@apple.com [Thu, 17 Nov 2016 00:35:57 +0000 (00:35 +0000)]
Use more references for Document::removeFocusedNodeOfSubtree()
https://bugs.webkit.org/show_bug.cgi?id=164839

Reviewed by Andreas Kling.

Use more references for Document::removeFocusedNodeOfSubtree().

No new tests, no Web-exposed behavior change.

* dom/Document.cpp:
(WebCore::isNodeInSubtree):
(WebCore::Document::removeFocusedNodeOfSubtree):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::removeFocusNavigationNodeOfSubtree):
(WebCore::Document::removeFullScreenElementOfSubtree):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::removeShadowRoot):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):

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

2 years agoClear track client when removing a track
bfulgham@apple.com [Thu, 17 Nov 2016 00:35:32 +0000 (00:35 +0000)]
Clear track client when removing a track
https://bugs.webkit.org/show_bug.cgi?id=164842
<rdar://problem/29213621>

Reviewed by Eric Carlson.

Source/WebCore:

Call 'clearClient' when removing a track from an HTMLMediaElement.

Test: media/track/audio-track-add-remove.html
      media/track/video-track-add-remove.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removeAudioTrack): Call 'clearClient'
(WebCore::HTMLMediaElement::removeVideoTrack): Ditto.

LayoutTests:

* media/track/audio-track-add-remove-expected.txt: Added.
* media/track/audio-track-add-remove.html: Added.
* media/track/video-track-add-remove-expected.txt: Added.
* media/track/video-track-add-remove.html: Added.

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

2 years ago[ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
utatane.tea@gmail.com [Thu, 17 Nov 2016 00:24:37 +0000 (00:24 +0000)]
[ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
https://bugs.webkit.org/show_bug.cgi?id=164827

Reviewed by Ryosuke Niwa.

.:

* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Use Settings.in. And intentionally do not use RuntimeEnabledFeatures.
According to the pointer lock's issue[1], we should use Settings.

[1]: https://bugs.webkit.org/show_bug.cgi?id=163801

* Configurations/FeatureDefines.xcconfig:
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
* page/Settings.in:
A bit unfortunate thing is that the setter is named `setEs6ModulesEnabled`
if we use `es6ModulesEnabled` here.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences es6ModulesEnabled]):
(-[WebPreferences setES6ModulesEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::setES6ModulesEnabled):
(WebPreferences::es6ModulesEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetES6ModulesEnabled):
(WKPreferencesGetES6ModulesEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

Enabled ES6 Modules in test runners.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setES6ModulesEnabled):
* WebKitTestRunner/InjectedBundle/TestRunner.h:

LayoutTests:

* TestExpectations:

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

2 years agoUnreviewed, remove outdated comment about using PassRefPtr.
cdumez@apple.com [Thu, 17 Nov 2016 00:22:41 +0000 (00:22 +0000)]
Unreviewed, remove outdated comment about using PassRefPtr.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::parserAppendChild):

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

2 years agoUnreviewed, roll out r208811. It's not sound.
fpizlo@apple.com [Wed, 16 Nov 2016 23:57:05 +0000 (23:57 +0000)]
Unreviewed, roll out r208811. It's not sound.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::mutatorFence):
(JSC::FTL::DFG::LowerDFGToB3::setButterfly):
(JSC::FTL::DFG::LowerDFGToB3::splatWordsIfMutatorIsFenced): Deleted.

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

2 years agoWasm function parser should use template functions for each binary and unary opcode
keith_miller@apple.com [Wed, 16 Nov 2016 23:34:39 +0000 (23:34 +0000)]
Wasm function parser should use template functions for each binary and unary opcode
https://bugs.webkit.org/show_bug.cgi?id=164835

Reviewed by Mark Lam.

This patch changes the wasm function parser to call into a template specialization
for each binary/unary opcode. This change makes it easier to have custom implementations
of various opcodes. It is also, in theory a speedup since it does not require switching
on the opcode twice.

* CMakeLists.txt:
* DerivedSources.make:
* wasm/WasmB3IRGenerator.cpp:
(): Deleted.
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::binaryCase):
(JSC::Wasm::FunctionParser<Context>::unaryCase):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* wasm/WasmValidate.cpp:
* wasm/generateWasm.py:
(isBinary):
(isSimple):
* wasm/generateWasmB3IRGeneratorInlinesHeader.py: Added.
(generateSimpleCode):
* wasm/generateWasmOpsHeader.py:
(opcodeMacroizer):
* wasm/generateWasmValidateInlinesHeader.py:

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

2 years agoMarking inspector/worker/debugger-pause.html as flaky.
ryanhaddad@apple.com [Wed, 16 Nov 2016 23:32:32 +0000 (23:32 +0000)]
Marking inspector/worker/debugger-pause.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=164833

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoExceptionFuzz functions should use its client's ThrowScope.
mark.lam@apple.com [Wed, 16 Nov 2016 23:18:11 +0000 (23:18 +0000)]
ExceptionFuzz functions should use its client's ThrowScope.
https://bugs.webkit.org/show_bug.cgi?id=164834

Reviewed by Geoffrey Garen.

This is because ExceptionFuzz's purpose is to throw exceptions from its client at
exception check sites.  Using the client's ThrowScope solves 2 problems:

1. If ExceptionFuzz instantiates its own ThrowScope, the simulated throw will be
   mis-attributed to ExceptionFuzz when it should be attributed to its client.

2. One way exception scope verification works is by having ThrowScopes assert
   that there are no unchecked simulated exceptions when the ThrowScope is
   instantiated.  However, ExceptionFuzz necessarily works by inserting
   doExceptionFuzzingIfEnabled() in between a ThrowScope that simulated a throw
   and an exception check.  If we declare a ThrowScope in ExceptionFuzz's code,
   we will be instantiating the ThrowScope between the point where a simulated
   throw occurs and where the needed exception check can occur.  Hence, having
   ExceptionFuzz instantiate its own ThrowScope will fail exception scope
   verification every time.

Changing ExceptionFuzz to use its client's ThrowScope resolves both problems.

Also fixed the THROW() macro in CommonSlowPaths.cpp to use the ThrowScope that
already exists in every slow path function instead of creating a new one.

* jit/JITOperations.cpp:
* llint/LLIntSlowPaths.cpp:
* runtime/CommonSlowPaths.cpp:
* runtime/ExceptionFuzz.cpp:
(JSC::doExceptionFuzzing):
* runtime/ExceptionFuzz.h:
(JSC::doExceptionFuzzingIfEnabled):

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

2 years agoHard to write reliable UIScriptController scrollingTreeAsText tests
simon.fraser@apple.com [Wed, 16 Nov 2016 23:17:26 +0000 (23:17 +0000)]
Hard to write reliable UIScriptController scrollingTreeAsText tests
https://bugs.webkit.org/show_bug.cgi?id=164764

Reviewed by Wenson Hsieh.

Fix one cause of flakiness by resetting the WKWebView's UIScrollView scale
and scroll position between tests.

* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):

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

2 years agoslotchange event should bubble and dispatched once
rniwa@webkit.org [Wed, 16 Nov 2016 23:06:47 +0000 (23:06 +0000)]
slotchange event should bubble and dispatched once
https://bugs.webkit.org/show_bug.cgi?id=164770

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the test. Some test cases fail as they do on Chrome because it's testing an outdated version of the spec.
Will fix the test upstream later.

* web-platform-tests/shadow-dom/slotchange-event-expected.txt:

Source/WebCore:

Updated our implementation of slotchange event to match the latest specification after:
https://github.com/w3c/webcomponents/issues/571
https://dom.spec.whatwg.org/#signal-a-slot-change
The new behavior matches that of Google Chrome Canary.

In the latest specification, we no longer dispatch a separate event on ancestor slots.
Instead, we fire a single slotchange event to which a new node is assigned or from which
an existing assigned node is removed. This patch mostly removes the code that existed to
locate ancestor slot elements, and makes the event bubble up by changing a single line in
HTMLSlotElement::dispatchSlotChangeEvent.

Test: fast/shadow-dom/slotchange-event-bubbling.html

* dom/ShadowRoot.h:
* dom/SlotAssignment.cpp:
(WebCore::recursivelyFireSlotChangeEvent): Deleted.
(WebCore::SlotAssignment::didChangeSlot): Removed ChangeType from the arguments since we
no longer notify the ancestor slot elements.
(WebCore::SlotAssignment::hostChildElementDidChange):
* dom/SlotAssignment.h:
(WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
(WebCore::ShadowRoot::didChangeDefaultSlot):
(WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute):
(WebCore::ShadowRoot::innerSlotDidChange): Deleted.
* html/HTMLDetailsElement.cpp:
(WebCore::DetailsSlotAssignment::hostChildElementDidChange):
* html/HTMLSlotElement.cpp:
(WebCore::HTMLSlotElement::dispatchSlotChangeEvent): Make slotchange event bubble.

LayoutTests:

* fast/shadow-dom/slotchange-event-bubbling-expected.txt: Added.
* fast/shadow-dom/slotchange-event-bubbling.html: Added.

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

2 years agoUIScriptController: script with no async tasks fails if an earlier script registered...
simon.fraser@apple.com [Wed, 16 Nov 2016 23:05:00 +0000 (23:05 +0000)]
UIScriptController: script with no async tasks fails if an earlier script registered a callback
https://bugs.webkit.org/show_bug.cgi?id=164762

Reviewed by Wenson Hsieh.

Tools:

Make TestRunner::callUIScriptCallback() async in DumpRenderTree to match WebKitTestRunner behavior.
This fixes ui-side-script-with-callback.html in WK1, which failed because the second runUIScript()
would occur inside the completion callback from the first. This no longer happens.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::callUIScriptCallback):
* TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback):

LayoutTests:

Move the tests that use runUIScript into their own directory for easier TestExpectations management,
and fix TestExpectations to match.

* TestExpectations:
* fast/harness/uiscriptcontroller/concurrent-ui-side-scripts-expected.txt: Renamed from LayoutTests/fast/harness/concurrent-ui-side-scripts-expected.txt.
* fast/harness/uiscriptcontroller/concurrent-ui-side-scripts.html: Renamed from LayoutTests/fast/harness/concurrent-ui-side-scripts.html.
* fast/harness/uiscriptcontroller/ui-side-script-unregister-callback-expected.txt: Copied from LayoutTests/fast/harness/ui-side-script-unregister-callback-expected.txt.
* fast/harness/uiscriptcontroller/ui-side-script-unregister-callback.html: Copied from LayoutTests/fast/harness/ui-side-script-unregister-callback.html.
* fast/harness/uiscriptcontroller/ui-side-script-with-callback-expected.txt: Renamed from LayoutTests/fast/harness/ui-side-script-unregister-callback-expected.txt.
* fast/harness/uiscriptcontroller/ui-side-script-with-callback.html: Renamed from LayoutTests/fast/harness/ui-side-script-unregister-callback.html.
* fast/harness/uiscriptcontroller/ui-side-scripts-expected.txt: Renamed from LayoutTests/fast/harness/ui-side-scripts-expected.txt.
* fast/harness/uiscriptcontroller/ui-side-scripts.html: Renamed from LayoutTests/fast/harness/ui-side-scripts.html.
* platform/mac/TestExpectations:

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

2 years agoREGRESSION (r207162): [debug] loader/stateobjects LayoutTests timing out
commit-queue@webkit.org [Wed, 16 Nov 2016 22:53:48 +0000 (22:53 +0000)]
REGRESSION (r207162): [debug] loader/stateobjects LayoutTests timing out
https://bugs.webkit.org/show_bug.cgi?id=163307

Patch by Alex Christensen <achristensen@webkit.org> on 2016-11-16
Reviewed by Alexey Proskuryakov.

Source/WebCore:

* platform/URLParser.cpp:
Removed some unnecessary and redundant assertions in iterators, which are inside inner loops.
(WebCore::URLParser::parsedDataView):
(WebCore::URLParser::parse):
Add a parsedDataView that just returns a UChar instead of a StringView for 1-length views.
This speeds up debug builds considerably, which spent most of the time parsing the path
making and destroying these 1-length StringViews.  It can't hurt release builds.
* platform/URLParser.h:

LayoutTests:

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

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

2 years agoUnreviewed gardening.
achristensen@apple.com [Wed, 16 Nov 2016 22:35:51 +0000 (22:35 +0000)]
Unreviewed gardening.
https://bugs.webkit.org/show_bug.cgi?id=163127

* platform/ios-simulator/TestExpectations:
Unskip passing tests.

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

2 years agoMicro-optimize ContainerNode::removeBetween()
cdumez@apple.com [Wed, 16 Nov 2016 22:30:43 +0000 (22:30 +0000)]
Micro-optimize ContainerNode::removeBetween()
https://bugs.webkit.org/show_bug.cgi?id=164832

Reviewed by Sam Weinig.

Micro-optimize ContainerNode::removeBetween() by updating pointers only
when strictly needed and reducing branching.

No new tests, no Web-exposed behavior change.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeBetween):

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

2 years agoMicro-optimize AtomicHTMLToken::initializeAttributes()
cdumez@apple.com [Wed, 16 Nov 2016 22:28:33 +0000 (22:28 +0000)]
Micro-optimize AtomicHTMLToken::initializeAttributes()
https://bugs.webkit.org/show_bug.cgi?id=164826

Reviewed by Sam Weinig.

Micro-optimize AtomicHTMLToken::initializeAttributes():
- Use uncheckedAppend() instead of append() since we reserve capacity
  before the loop.
- Use a more efficient findAttribute() that only checks the local names
  since this function only adds attributes that have to namespace or
  prefix.

No new tests, no Web-exposed behavior change.

* html/parser/AtomicHTMLToken.h:
(WebCore::hasAttribute):
(WebCore::AtomicHTMLToken::initializeAttributes):

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

2 years agoSlight Octane regression from concurrent GC's eager object zero-fill
fpizlo@apple.com [Wed, 16 Nov 2016 22:24:45 +0000 (22:24 +0000)]
Slight Octane regression from concurrent GC's eager object zero-fill
https://bugs.webkit.org/show_bug.cgi?id=164823

Reviewed by Geoffrey Garen.

During concurrent GC, we need to eagerly zero-fill objects we allocate prior to
executing the end-of-allocation fence. This causes some regressions. This is an attempt
to fix those regressions by making them conditional on whether the mutator is fenced.

This is a slight speed-up on raytrace and boyer, and hopefully it will fix the
regression.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject):
(JSC::FTL::DFG::LowerDFGToB3::splatWordsIfMutatorIsFenced):
(JSC::FTL::DFG::LowerDFGToB3::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::allocateObject):
(JSC::FTL::DFG::LowerDFGToB3::mutatorFence):
(JSC::FTL::DFG::LowerDFGToB3::setButterfly):

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

2 years agoFix typo in LayoutTest.
joepeck@webkit.org [Wed, 16 Nov 2016 22:12:48 +0000 (22:12 +0000)]
Fix typo in LayoutTest.

Unreviewed follow-up comment.

* inspector/page/setEmulatedMedia-expected.txt:
* inspector/page/setEmulatedMedia.html:

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

2 years agoAnother build fix.
bdakin@apple.com [Wed, 16 Nov 2016 21:10:04 +0000 (21:10 +0000)]
Another build fix.

* platform/mac/WebPlaybackSessionInterfaceMac.mm:

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

2 years agoFix exception scope checking in JSGlobalObject.cpp.
mark.lam@apple.com [Wed, 16 Nov 2016 21:05:43 +0000 (21:05 +0000)]
Fix exception scope checking in JSGlobalObject.cpp.
https://bugs.webkit.org/show_bug.cgi?id=164831

Reviewed by Saam Barati.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
- Use a CatchScope here because we don't ever expect JSGlobalObject initialization
  to fail with errors.
(JSC::JSGlobalObject::put):
- Fix exception check requirements.

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

2 years agojs/dom/domjit-function-get-element-by-id-licm.html and js/dom/domjit-function-get...
utatane.tea@gmail.com [Wed, 16 Nov 2016 21:02:10 +0000 (21:02 +0000)]
js/dom/domjit-function-get-element-by-id-licm.html and js/dom/domjit-function-get-element-by-id-changed.html are flaky timeouts
https://bugs.webkit.org/show_bug.cgi?id=164797

Reviewed by Saam Barati.

The performance of the both tests rely on PureGetById.
However, PureGetById is rolled out temporary[1], these tests become timed out.
This patch makes the both tests [ PASS TIMEOUT ] until PureGetById patch[1] is
relanded or impure object optimization patch[2] is landed.

[1]: https://bugs.webkit.org/show_bug.cgi?id=163305
[2]: https://bugs.webkit.org/show_bug.cgi?id=164175

* TestExpectations:

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

2 years ago[JSC] Build broken for 32-bit x86 after r208306 with GCC 4.9
clopez@igalia.com [Wed, 16 Nov 2016 21:00:56 +0000 (21:00 +0000)]
[JSC] Build broken for 32-bit x86 after r208306 with GCC 4.9
https://bugs.webkit.org/show_bug.cgi?id=164588

Reviewed by Mark Lam.

Provide assembly for executing the cpuid instruction when compiling
in PIC mode with the GCC 4.9 EBX on 32-bit x86.

Note that the values returned by cpuid here are not used. The purpose
of calling this instruction is to force the CPU to complete and sync
any buffered modifications on registers, memory or flags before
fetching and executing the next instruction.

* wtf/Atomics.h:
(WTF::x86_cpuid):

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

2 years agoAttempted build fix.
bdakin@apple.com [Wed, 16 Nov 2016 20:58:33 +0000 (20:58 +0000)]
Attempted build fix.

* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::durationChanged):
(WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
(WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
(WebCore::WebPlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::WebPlaybackSessionInterfaceMac::seekableRangesChanged):
(WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
(WebCore::WebPlaybackSessionInterfaceMac::ensureControlsManager):

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

2 years agoRe-indent some old headers.
beidson@apple.com [Wed, 16 Nov 2016 20:43:14 +0000 (20:43 +0000)]
Re-indent some old headers.

Rubberstamped by Alex Christensen

No new tests (No behavior change).

(Also #pragma once a few of them)

* loader/DocumentLoader.h:
* loader/FrameLoaderClient.h:
* page/Frame.h:
* page/FrameTree.h:
* page/PageGroup.h:
* platform/Cursor.h:

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

2 years agoREGRESSION (r208672): Crash in com.apple.WebCore: WebCore::DatabaseContext::stopDatab...
darin@apple.com [Wed, 16 Nov 2016 20:26:59 +0000 (20:26 +0000)]
REGRESSION (r208672): Crash in com.apple.WebCore: WebCore::DatabaseContext::stopDatabases + 34
https://bugs.webkit.org/show_bug.cgi?id=164820

Reviewed by Sam Weinig.

Crash seen in existing regression tests; reliably reproducible in some test configurations.

* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::contextDestroyed): Call through to base class before calling
stopDatabases, since that might cause this object to be deallocated.
(WebCore::DatabaseContext::stopDatabases): Be sure not to clear the possibly-last reference
to this database context until after all code that accesses data members, since it might
cause this object to be deallocated.

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

2 years agoImplement WebPlaybackControlsManager
bdakin@apple.com [Wed, 16 Nov 2016 20:23:46 +0000 (20:23 +0000)]
Implement WebPlaybackControlsManager
https://bugs.webkit.org/show_bug.cgi?id=164789
-and corresponding-
rdar://problem/29275082

Reviewed by Dan Bernstein.

* platform/mac/WebPlaybackControlsManager.h:
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager dealloc]):
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
(-[WebPlaybackControlsManager generateFunctionBarThumbnailsForTimes:size:completionHandler:]):
(-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
(-[WebPlaybackControlsManager canBeginFunctionBarScrubbing]):
(-[WebPlaybackControlsManager beginFunctionBarScrubbing]):
(-[WebPlaybackControlsManager endFunctionBarScrubbing]):
(-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]):
(-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]):
(-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]):
(mediaSelectionOptions):
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
(-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
(-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
(-[WebPlaybackControlsManager togglePlayback]):
(-[WebPlaybackControlsManager setPlaying:]):
(-[WebPlaybackControlsManager isPlaying]):
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::durationChanged):
(WebCore::WebPlaybackSessionInterfaceMac::currentTimeChanged):
(WebCore::WebPlaybackSessionInterfaceMac::rateChanged):
(WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):

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

2 years agoAdd more tests for SubtleCrypto::importKey and SubtleCrypto::exportKey
jiewen_tan@apple.com [Wed, 16 Nov 2016 20:18:45 +0000 (20:18 +0000)]
Add more tests for SubtleCrypto::importKey and SubtleCrypto::exportKey
https://bugs.webkit.org/show_bug.cgi?id=164815
<rdar://problem/29281660>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: crypto/subtle/aes-import-jwk-key-export-jwk-key.html
       crypto/subtle/aes-import-jwk-key-export-raw-key.html
       crypto/subtle/aes-import-raw-key-export-jwk-key.html
       crypto/subtle/aes-import-raw-key-export-raw-key.html
       crypto/subtle/hmac-import-jwk-key-export-jwk-key.html
       crypto/subtle/hmac-import-jwk-key-export-raw-key.html
       crypto/subtle/hmac-import-raw-key-export-jwk-key.html
       crypto/subtle/hmac-import-raw-key-export-raw-key.html
       crypto/subtle/rsa-import-jwk-key-export-jwk-key-private.html
       crypto/subtle/rsa-import-jwk-key-export-jwk-key-public.html

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::create):
Add a comment.

LayoutTests:

* crypto/subtle/aes-import-jwk-key-export-jwk-key.html: Added.
* crypto/subtle/aes-import-jwk-key-export-raw-key.html: Added.
* crypto/subtle/aes-import-raw-key-export-jwk-key.html: Added.
* crypto/subtle/aes-import-raw-key-export-raw-key.html: Added.
* crypto/subtle/hmac-import-jwk-key-export-jwk-key.html: Added.
* crypto/subtle/hmac-import-jwk-key-export-raw-key.html: Added.
* crypto/subtle/hmac-import-raw-key-export-jwk-key.html: Added.
* crypto/subtle/hmac-import-raw-key-export-raw-key.html: Added.
* crypto/subtle/rsa-import-jwk-key-export-jwk-key-private.html: Added.
* crypto/subtle/rsa-import-jwk-key-export-jwk-key-public.html: Added.

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

2 years agoAdd logging support to VisibleContentRectUpdateInfo
simon.fraser@apple.com [Wed, 16 Nov 2016 19:13:04 +0000 (19:13 +0000)]
Add logging support to VisibleContentRectUpdateInfo
https://bugs.webkit.org/show_bug.cgi?id=164825

Reviewed by Zalan Bujtas.

Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
stream does single-line output, so also make a convenience dump() function that will
product multiline output. Result look like:

    (VisibleContentRectUpdateInfo
      (lastLayerTreeTransactionID 54)
      (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
      (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
      (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
      (customFixedPositionRect (219.64,935) width=980 height=1225)
      (obscuredInset width=0 height=39.50)
      (scale 1.14)
      (inStableState 0)
      (timestamp 736446.61)
      (verticalVelocity -11.36))

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::VisibleContentRectUpdateInfo::dump):
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):

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

2 years agoUpdating TestExpectations for two http/tests/security/module-crossorigin tests.
ryanhaddad@apple.com [Wed, 16 Nov 2016 19:03:02 +0000 (19:03 +0000)]
Updating TestExpectations for two http/tests/security/module-crossorigin tests.
https://bugs.webkit.org/show_bug.cgi?id=164539

Unreviewed test gardening.

* TestExpectations:

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

2 years agoRemove getMutableCachedPseudoStyle
antti@apple.com [Wed, 16 Nov 2016 18:08:30 +0000 (18:08 +0000)]
Remove getMutableCachedPseudoStyle
https://bugs.webkit.org/show_bug.cgi?id=164819

Reviewed by Zalan Bujtas.

It is only used by styleForFirstLetter.

* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter):

    Clone the original style before mutations.

(WebCore::RenderBlock::updateFirstLetterStyle):
(WebCore::RenderBlock::createFirstLetterRenderer):

    Since we have a clone already just move it in place.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::getMutableCachedPseudoStyle): Deleted.
* rendering/RenderElement.h:

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

2 years agoMake test sandbox-should-not-persist-on-navigation.html more representative of real...
dbates@webkit.org [Wed, 16 Nov 2016 18:07:25 +0000 (18:07 +0000)]
Make test sandbox-should-not-persist-on-navigation.html more representative of real-world scenario
https://bugs.webkit.org/show_bug.cgi?id=164752

Reviewed by Brent Fulgham.

Modify the test http-0.9/sandbox-should-not-persist-on-navigation.html so that it loads
a document on a default port using HTTP 0.9 to trigger the HTTP 0.9 sandbox as this
is more representative of a real-world scenario where we want a sandbox to be applied
and is the scenario that is currently covered by our HTTP 0.9 sandbox machinery.

Currently this test makes use of the pre r208549 behavior where the HTTP 0.9 sandbox
was applied to a document if one of its subresources loaded on a non-default port
using HTTP 0.9 in addition to the behavior where the sandbox is applied to a document
that loads on a default port using HTTP 0.9. Following r208549 we no longer apply the
sandbox to the document for the former case as this did not improve security much, if
any. The latter case is more representative of a real-world scenario where we want to
apply the sandbox policy and reflects our behavior following r208549.

* http/tests/security/http-0.9/resources/nph-sandbox-should-not-persist-on-navigation.pl: Added.
* http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt:
* http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation.html:
* platform/wk2/TestExpectations: Skip the HTTP-0.9 tests in WebKit2 as it uses internals.registerDefaultPortForProtocol().

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