81abf5580971e0a9bcaf0a6738b4450fd6ba60cd
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
2
3         RefCounter value changed callback should be called on all changes (not just zero edge).
4         https://bugs.webkit.org/show_bug.cgi?id=154699
5
6         Reviewed by Anders Carlsson.
7
8         RefCounter currently only triggers a callback when the count goes from zero
9         to non-zero and vice-versa. Change that, to be useful to more clients.
10
11         * page/PageThrottler.cpp:
12         (WebCore::PageThrottler::PageThrottler):
13             - Updated for change in RefCounter callback siganture.
14         * platform/VNodeTracker.cpp:
15         (WebCore::VNodeTracker::VNodeTracker):
16             - Can now use RefCounter callback to trigger checkPressureState().
17         (WebCore::VNodeTracker::pressureWarningTimerFired):
18             - RefCounter count is now a size_t (%d -> %ul).
19         * platform/VNodeTracker.h:
20             - simplified VNodeTracker::token() [no longer needs to call checkPressureState()].
21
22 2016-02-26  Andreas Kling  <akling@apple.com>
23
24         Remove unused CFNetwork disk cache mmap optimization in WebKit2.
25         <https://webkit.org/b/154727>
26
27         Reviewed by Darin Adler.
28
29         Remove some now-unused SPI.
30
31         * platform/spi/cf/CFNetworkSPI.h:
32
33 2016-02-26  Commit Queue  <commit-queue@webkit.org>
34
35         Unreviewed, rolling out r197167.
36         https://bugs.webkit.org/show_bug.cgi?id=154730
37
38         This change broke the Mac build (Requested by ryanhaddad on
39         #webkit).
40
41         Reverted changeset:
42
43         "REGRESSION (188611): Search field Cancel button should not
44         overlap search text on extensions page."
45         https://bugs.webkit.org/show_bug.cgi?id=154692
46         http://trac.webkit.org/changeset/197167
47
48 2016-02-26  Martin Robinson  <mrobinson@igalia.com>
49
50         Remove libqcms support
51         https://bugs.webkit.org/show_bug.cgi?id=154707
52
53         Reviewed by Žan Doberšek.
54
55         No new tests. This change simply removes dead code.
56
57         * platform/image-decoders/ImageDecoder.h: Remove QCMS support.
58         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): Deleted.
59         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: Remove QCMS support.
60         (WebCore::JPEGImageReader::JPEGImageReader): Deleted.
61         (WebCore::JPEGImageReader::close): Deleted.
62         (WebCore::JPEGImageReader::decode): Deleted.
63         (WebCore::JPEGImageReader::colorTransform): Deleted.
64         (WebCore::JPEGImageReader::createColorTransform): Deleted.
65         (WebCore::JPEGImageDecoder::outputScanlines): Deleted.
66         * platform/image-decoders/png/PNGImageDecoder.cpp: Remove QCMS support.
67         (WebCore::PNGImageReader::PNGImageReader): Deleted.
68         (WebCore::PNGImageReader::close): Deleted.
69         (WebCore::PNGImageReader::rowBuffer): Deleted.
70         (WebCore::PNGImageReader::createRowBuffer): Deleted.
71         (WebCore::PNGImageReader::colorTransform): Deleted.
72         (WebCore::PNGImageReader::createColorTransform): Deleted.
73         (WebCore::PNGImageDecoder::headerAvailable): Deleted.
74         (WebCore::PNGImageDecoder::rowAvailable): Deleted.
75         (WebCore::PNGImageDecoder::frameComplete): Deleted.
76         * platform/image-decoders/webp/WEBPImageDecoder.cpp: Remove QCMS support.
77         (WebCore::WEBPImageDecoder::decode): Remove QCMS support.
78         (WebCore::WEBPImageDecoder::WEBPImageDecoder): Deleted.
79         (WebCore::WEBPImageDecoder::clear): Deleted.
80         (WebCore::WEBPImageDecoder::createColorTransform): Deleted.
81         (WebCore::WEBPImageDecoder::readColorProfile): Deleted.
82         (WebCore::WEBPImageDecoder::applyColorProfile): Deleted.
83         * platform/image-decoders/webp/WEBPImageDecoder.h: Remove QCMS support.
84         (WebCore::WEBPImageDecoder::colorTransform): Deleted.
85
86 2016-02-26  Zalan Bujtas  <zalan@apple.com>
87
88         RenderTheme::controlSize* methods should take const RenderStyle&.
89         https://bugs.webkit.org/show_bug.cgi?id=154708
90
91         Reviewed by Darin Adler.
92
93         No change in functionality.
94
95         * rendering/RenderTheme.h:
96         (WebCore::RenderTheme::minimumMenuListSize):
97         (WebCore::RenderTheme::popupInternalPaddingLeft):
98         (WebCore::RenderTheme::popupInternalPaddingRight):
99         (WebCore::RenderTheme::popupInternalPaddingTop):
100         (WebCore::RenderTheme::popupInternalPaddingBottom):
101         * rendering/RenderThemeMac.h:
102         * rendering/RenderThemeMac.mm:
103         (WebCore::RenderThemeMac::controlSizeForFont):
104         (WebCore::RenderThemeMac::sizeForFont):
105         (WebCore::RenderThemeMac::sizeForSystemFont):
106         (WebCore::RenderThemeMac::controlSizeForSystemFont):
107         (WebCore::RenderThemeMac::minimumProgressBarHeight):
108         (WebCore::RenderThemeMac::popupInternalPaddingLeft):
109         (WebCore::RenderThemeMac::popupInternalPaddingRight):
110         (WebCore::RenderThemeMac::popupInternalPaddingTop):
111         (WebCore::RenderThemeMac::popupInternalPaddingBottom):
112         (WebCore::RenderThemeMac::minimumMenuListSize):
113
114 2016-02-26  Zalan Bujtas  <zalan@apple.com>
115
116         REGRESSION (188611): Search field Cancel button should not overlap search text on extensions page.
117         https://bugs.webkit.org/show_bug.cgi?id=154692
118         <rdar://problem/22840453>
119
120         Reviewed by Brent Fulgham.
121
122         Adjust the cancel button position using the actual size of the cancel button.
123
124         When the input box and the font height trigger different cancel button sizes, we need to readjust
125         the rectangle returned by cancelButtonRectForBounds.
126         This fixes both the mispositioned cancel button and the squared off icon when the input field is zoomed all the way in.
127
128         Covered by existing tests.
129
130         * rendering/RenderThemeMac.mm:
131         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
132         (WebCore::RenderThemeMac::cancelButtonSizes): Update button size.
133
134 2016-02-25  Antti Koivisto  <antti@apple.com>
135
136         Implement ::slotted pseudo element
137         https://bugs.webkit.org/show_bug.cgi?id=149441
138         <rdar://problem/22731987>
139
140         Reviewed by Andreas Kling.
141
142         Based on latest in https://github.com/w3c/webcomponents/issues/331
143
144         * css/CSSGrammar.y.in:
145
146             Parse ::slotted.
147
148         * css/CSSParser.cpp:
149         (WebCore::CSSParser::detectFunctionTypeToken):
150         * css/CSSParserValues.cpp:
151         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
152         (WebCore::CSSParserSelector::parsePseudoElementSlottedFunctionSelector):
153
154             Tokenize ::slotted.
155
156         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
157         * css/CSSParserValues.h:
158         * css/CSSSelector.cpp:
159         (WebCore::CSSSelector::pseudoId):
160         * css/CSSSelector.h:
161         * css/ElementRuleCollector.cpp:
162         (WebCore::ElementRuleCollector::matchAuthorRules):
163         (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
164         (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules):
165
166             Match ::slotted selector.
167
168         (WebCore::ElementRuleCollector::collectSlottedPseudoElementRulesForSlot):
169
170             Collect ::slotted rules that may apply to an element in a slot.
171
172         (WebCore::ElementRuleCollector::matchUserRules):
173         (WebCore::ElementRuleCollector::matchUARules):
174         (WebCore::findSlottedPseudoElementSelector):
175         (WebCore::ElementRuleCollector::ruleMatches):
176         * css/ElementRuleCollector.h:
177         * css/RuleSet.cpp:
178         (WebCore::RuleSet::addRule):
179
180             Collect ::slotted rules.
181
182         (WebCore::RuleSet::shrinkToFit):
183         * css/RuleSet.h:
184         (WebCore::RuleSet::hostPseudoClassRules):
185         (WebCore::RuleSet::slottedPseudoElementRules):
186         (WebCore::RuleSet::focusPseudoClassRules):
187         (WebCore::RuleSet::universalRules):
188         * css/SelectorChecker.cpp:
189         (WebCore::SelectorChecker::checkOne):
190         * style/StyleSharingResolver.cpp:
191         (WebCore::Style::SharingResolver::resolve):
192
193             Disable style sharing for children of shadow host. They may be affected by the shadow tree style
194             which is not considered in style sharing checks.
195
196 2016-02-25  Myles C. Maxfield  <mmaxfield@apple.com>
197
198         Font size computed style is innaccurate
199         https://bugs.webkit.org/show_bug.cgi?id=154705
200         <rdar://problem/23474068>
201
202         Reviewed by Timothy Hatcher.
203
204         Safari rounds the font size value reported to getComputedStyle(). Neither Firefox
205         nor Chrome do this.
206
207         Covered by existing tests.
208
209         * css/CSSComputedStyleDeclaration.cpp:
210         (WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
211         (WebCore::fontSizeFromStyle):
212
213 2016-02-25  Chris Dumez  <cdumez@apple.com>
214
215         [Web IDL] Mark DOMString parameters as nullable when they should be
216         https://bugs.webkit.org/show_bug.cgi?id=154666
217
218         Reviewed by Darin Adler.
219
220         Mark DOMString parameters as nullable when they should be. We previously
221         emulated nullable DOMString attributes by using:
222         [TreatNullAs=NullString, TreatUndefinedAs=NullString]
223         However, this was non-standard and very verbose. Also, developers would
224         sometimes forget the [TreatUndefinedAs=NullString] part and the behavior
225         would end up being wrong for undefined.
226
227         After this clean up, the non-standard [TreatUndefinedAs=NullString] is
228         no longer used so this patch drops support for it. Only
229         [TreatNullAs=NullString] remains and this one will be renamed to
230         [TreatNullAs=EmptyString] via Bug 154654 to match Web IDL standard.
231
232         Tests: fast/dom/Element/getElementsByTagNameNS-nullable.html
233                fast/dom/Node/nullable-parameters.html
234                fast/events/storageevent-initStorageEvent-nullable.html
235
236         * Modules/mediastream/RTCPeerConnection.idl:
237         Drop [TreatUndefinedAs=NullString] from createDataChannel()'s first
238         parameter instead of marking it as nullable. This matches the
239         specification:
240         - http://w3c.github.io/webrtc-pc/#rtcpeerconnection-interface-extensions-1
241         This means there is a slight behavior change when undefined is passed, it
242         now becomes the string "undefined" instead of a null String.
243
244         * bindings/scripts/CodeGeneratorJS.pm:
245         (JSValueToNative):
246         Drop handling of [TreatUndefinedAs=] as it is no longer used.
247
248         * bindings/scripts/IDLAttributes.txt:
249         Drop support for [TreatUndefinedAs=] as it is no longer used.
250
251         * bindings/scripts/test/TestObj.idl:
252
253         * dom/DOMImplementation.idl:
254         Make a few parameters nullable and drop [TreatNullAs=NullString,
255         TreatUndefinedAs=NullString]. There is no web-exposed behavior
256         change.
257
258         * dom/Document.idl:
259         - Make a few parameters nullable and drop [TreatNullAs=NullString,
260           TreatUndefinedAs=NullString]. There is no web-exposed behavior
261           change from this.
262         - Drop these attributes from ObjC-specific bindings as they only
263           matter to JS bindings.
264         - The namespaceURI parameter to getElementsByTagNameNS() is now marked
265           as nullable even though it only treated null as a null String, not
266           undefined. This was a bug and did not match the specification:
267           https://dom.spec.whatwg.org/#document
268
269         * dom/Element.idl:
270         - Make a few parameters nullable and drop [TreatNullAs=NullString,
271           TreatUndefinedAs=NullString]. There is no web-exposed behavior
272           change from this.
273         - Drop these attributes from ObjC-specific bindings as they only
274           matter to JS bindings.
275         - The namespaceURI parameter to getElementsByTagNameNS() is now marked
276           as nullable even though it only treated null as a null String, not
277           undefined. This was a bug and did not match the specification:
278           https://dom.spec.whatwg.org/#interface-element
279
280         * dom/NamedNodeMap.idl:
281         Make a few parameters nullable and drop [TreatNullAs=NullString,
282         TreatUndefinedAs=NullString]. There is no web-exposed behavior
283         change from this.
284
285         * dom/Node.idl:
286         - Drop these attributes from isSupported() as this is not exposed
287           to JS (only native bindings) and these attributes only matter to
288           JS bindings.
289         - Make the first parameter to lookupPrefix() / isDefaultNamespace()
290           and lookupNamespaceURI() nullable. Previously, we treated null
291           as a null string but not undefined. There is therefore a slight
292           behavior change but this matches the specification:
293           https://dom.spec.whatwg.org/#node
294
295         * fileapi/Blob.idl:
296         * html/HTMLButtonElement.idl:
297         * html/HTMLCanvasElement.idl:
298         * html/HTMLFieldSetElement.idl:
299         * html/HTMLInputElement.idl:
300         * html/HTMLKeygenElement.idl:
301         * html/HTMLMediaElement.idl:
302         * html/HTMLObjectElement.idl:
303         * html/HTMLOutputElement.idl:
304         * html/HTMLSelectElement.idl:
305         * html/HTMLTextAreaElement.idl:
306         * page/DOMWindow.idl:
307         Make a few parameters nullable and drop [TreatNullAs=NullString,
308         TreatUndefinedAs=NullString]. There is no web-exposed behavior
309         change from this.
310
311         * storage/StorageEvent.idl:
312         Mark oldValueArg / newValueArg parameters to initStorageEvent()
313         as nullable. Previously, we only treated null as a null string,
314         not undefined. This is therefore a slight behavior change but
315         it matches the specification:
316         https://www.w3.org/TR/webstorage/#storageeventinit
317
318 2016-02-25  David Kilzer  <ddkilzer@apple.com>
319
320         REGRESSION (r196744): NetworkExtension.framework and NEFilterSource class are not available on Recovery partition
321         <http://webkit.org/b/154703>
322
323         Reviewed by Andy Estes.
324
325         * platform/cocoa/NetworkExtensionContentFilter.mm: Make
326         soft-linking of NetworkExtension.framework and NEFilterSource
327         class optional since they are not available on the Recovery
328         partition.  Note that NetworkExtensionContentFilter::enabled()
329         does not need to change since it already had the correct
330         behavior when getNEFilterSourceClass() returned nullptr.
331
332 2016-02-25  Ada Chan  <adachan@apple.com>
333
334         Update the definition of ENABLE_VIDEO_PRESENTATION_MODE for Mac platform
335         https://bugs.webkit.org/show_bug.cgi?id=154702
336
337         Reviewed by Dan Bernstein.
338
339         * Configurations/FeatureDefines.xcconfig:
340
341 2016-02-25  David Kilzer  <ddkilzer@apple.com>
342
343         Change ASSERT to RELEASE_ASSERT in SOFT_LINK_CLASS() macro
344
345         Follow-up fix noted by Andy Estes for:
346
347             [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
348             <http://webkit.org/b/154364>
349
350         * platform/mac/SoftLinking.h:
351         (SOFT_LINK_CLASS): Change ASSERT to RELEASE_ASSERT to check the
352         return value of objc_getClass().  This matches what we do for
353         SOFT_LINK_CLASS_FOR_SOURCE().
354
355 2016-02-25  Daniel Bates  <dabates@apple.com>
356
357         CSP: Remove SecurityPolicy script interface
358         https://bugs.webkit.org/show_bug.cgi?id=154694
359         <rdar://problem/24846482>
360
361         Reviewed by Andy Estes.
362
363         Remove the Content Security Policy script interface, SecurityPolicy. This interface was only
364         enabled when building with ENABLE(CSP_NEXT) (disabled by default).
365
366         For completeness, the SecurityPolicy interface was removed from the Content Security Policy 1.1 spec.
367         in <https://github.com/w3c/webappsec/commit/18882953ce2d8afca25f685557fef0e0471b2c9a> (12/26/2013).
368
369         * CMakeLists.txt: Remove files to DOMSecurityPolicy.{cpp, idl}.
370         * DerivedSources.cpp: Remove file JSDOMSecurityPolicy.cpp.
371         * DerivedSources.make: Remove file DOMSecurityPolicy.idl.
372         * PlatformGTK.cmake: Ditto.
373         * PlatformMac.cmake: Ditto.
374         * WebCore.xcodeproj/project.pbxproj: Remove files DOMSecurityPolicy files.
375         * bindings/scripts/CodeGeneratorGObject.pm: Remove reference to DOMSecurityPolicy.
376         * dom/Document.cpp:
377         (WebCore::Document::securityPolicy): Deleted.
378         * dom/Document.h:
379         * dom/Document.idl: Remove attribute securityPolicy.
380         * page/DOMSecurityPolicy.cpp: Removed.
381         * page/DOMSecurityPolicy.h: Removed.
382         * page/DOMSecurityPolicy.idl: Removed.
383
384 2016-02-25  Andreas Kling  <akling@apple.com>
385
386         Don't clear the weak JSString cache on memory pressure.
387         <https://webkit.org/b/154693>
388
389         Reviewed by Antti Koivisto.
390
391         This was stupid. The cache is a WeakGCMap, so all the JSStrings pointed to are
392         still alive anyway. This way we keep the ability to deduplicate common strings.
393
394         * platform/MemoryPressureHandler.cpp:
395         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory): Deleted.
396
397 2016-02-25  Chris Dumez  <cdumez@apple.com>
398
399         Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute
400         https://bugs.webkit.org/show_bug.cgi?id=154662
401
402         Reviewed by Darin Adler.
403
404         Drop [TreatReturnedNullStringAs=Undefined] WebKit-specific IDL attribute.
405         This has no standard equivalent and all uses in WebKit are either useless
406         or wrong.
407
408         Test: fast/frames/detached-frame-document-defaultCharset.html
409
410         * bindings/scripts/CodeGeneratorJS.pm:
411         (NativeToJSValue): Deleted.
412         * bindings/scripts/IDLAttributes.txt:
413         Drop support for [TreatReturnedNullStringAs=X] entirely.
414
415         * dom/Document.cpp:
416         (WebCore::Document::defaultCharset):
417         Fall back to return "UTF-8" instead of the null string, similarly to
418         what is done in for Document.characterSet. Note that this attribute
419         is non-standard and is an IE extension. Firefox never supported it
420         and Chrome dropped it last year.
421
422         * dom/Document.idl:
423         - Drop extended attribute for Document.defaultCharset as the
424           implementation has been updated to never return a null String.
425         - Drop extended attribute for Document.readyState. It was useless
426           because the implementation could never return a null String.
427
428         * xml/XMLHttpRequest.cpp:
429         (WebCore::XMLHttpRequest::getAllResponseHeaders):
430         Update implementation to return emptyString() instead of "" in case
431         of error.
432
433         * xml/XMLHttpRequest.idl:
434         Drop extended attribute from XMLHttpRequest.getAllResponseHeaders().
435         It was useless because the implementation could never return a
436         null String.
437
438         * xml/XSLTProcessor.idl:
439         Drop extended attribute from XSLTProcessor.getParameter(). The
440         operation is already marked as [Custom] so the extended attribute
441         had no effect.
442
443 2016-02-25  Gavin Barraclough  <barraclough@apple.com>
444
445         Should template RefCounter instead of RefCounter::Token
446         https://bugs.webkit.org/show_bug.cgi?id=154691
447
448         Reviewed by Anders Carlsson.
449
450         Mechanical update per RefCounter interface change.
451
452         * page/PageThrottler.cpp:
453         (WebCore::PageThrottler::mediaActivityToken):
454         (WebCore::PageThrottler::pageLoadActivityToken):
455         (WebCore::PageThrottler::setActivityFlag):
456         * page/PageThrottler.h:
457         * platform/VNodeTracker.h:
458
459 2016-02-25  Brady Eidson  <beidson@apple.com>
460
461         Remove LegacyIDB.
462         https://bugs.webkit.org/show_bug.cgi?id=150854
463
464         Reviewed by Alex Christensen.
465
466         No new tests (No change in behavior).
467
468         * CMakeLists.txt:
469         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
470         (WebCore::DOMWindowIndexedDatabase::indexedDB):
471         * Modules/indexeddb/IDBDatabaseMetadata.cpp: Removed.
472         * Modules/indexeddb/IDBDatabaseMetadata.h: Removed.
473         * Modules/indexeddb/IDBFactory.h:
474         * Modules/indexeddb/IDBIndex.h:
475         * Modules/indexeddb/IDBIndexMetadata.h: Removed.
476         * Modules/indexeddb/IDBObjectStoreMetadata.h: Removed.
477         * Modules/indexeddb/IDBOperation.h: Removed.
478         * Modules/indexeddb/IDBServerConnection.h: Removed.
479         * Modules/indexeddb/IDBTransaction.h:
480         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp:
481         (WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB):
482         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
483         * Modules/indexeddb/legacy/IDBCallbacks.h: Removed.
484         * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Removed.
485         * Modules/indexeddb/legacy/IDBCursorBackend.h: Removed.
486         * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Removed.
487         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Removed.
488         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Removed.
489         * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Removed.
490         * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Removed.
491         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Removed.
492         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Removed.
493         * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Removed.
494         * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Removed.
495         * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Removed.
496         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Removed.
497         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Removed.
498         * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Removed.
499         * Modules/indexeddb/legacy/IDBTransactionBackend.h: Removed.
500         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Removed.
501         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Removed.
502         * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Removed.
503         * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Removed.
504         * Modules/indexeddb/legacy/LegacyAny.cpp: Removed.
505         * Modules/indexeddb/legacy/LegacyAny.h: Removed.
506         * Modules/indexeddb/legacy/LegacyCursor.cpp: Removed.
507         * Modules/indexeddb/legacy/LegacyCursor.h: Removed.
508         * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Removed.
509         * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Removed.
510         * Modules/indexeddb/legacy/LegacyDatabase.cpp: Removed.
511         * Modules/indexeddb/legacy/LegacyDatabase.h: Removed.
512         * Modules/indexeddb/legacy/LegacyFactory.cpp: Removed.
513         * Modules/indexeddb/legacy/LegacyFactory.h: Removed.
514         * Modules/indexeddb/legacy/LegacyIndex.cpp: Removed.
515         * Modules/indexeddb/legacy/LegacyIndex.h: Removed.
516         * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Removed.
517         * Modules/indexeddb/legacy/LegacyObjectStore.h: Removed.
518         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Removed.
519         * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Removed.
520         * Modules/indexeddb/legacy/LegacyRequest.cpp: Removed.
521         * Modules/indexeddb/legacy/LegacyRequest.h: Removed.
522         * Modules/indexeddb/legacy/LegacyTransaction.cpp: Removed.
523         * Modules/indexeddb/legacy/LegacyTransaction.h: Removed.
524         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Removed.
525         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Removed.
526         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
527         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
528         (WebCore::IDBServer::SQLiteIDBCursor::establishStatement):
529         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
530         * Modules/indexeddb/server/SQLiteIDBCursor.h:
531         * Modules/indexeddb/shared/IDBIndexInfo.h:
532         * WebCore.xcodeproj/project.pbxproj:
533         * bindings/js/IDBBindingUtilities.cpp:
534         (WebCore::generateIndexKeysForValue): Deleted.
535         * bindings/js/IDBBindingUtilities.h:
536         * bindings/js/JSMainThreadExecState.cpp:
537         (WebCore::JSMainThreadExecState::didLeaveScriptContext): Deleted.
538         * inspector/InspectorIndexedDBAgent.cpp:
539         * loader/EmptyClients.cpp:
540         * page/DatabaseProvider.cpp:
541         (WebCore::DatabaseProvider::idbFactoryBackend): Deleted.
542         * page/DatabaseProvider.h:
543         * platform/CrossThreadCopier.cpp:
544         (WebCore::IDBDatabaseMetadata>::copy): Deleted.
545         (WebCore::IDBIndexMetadata>::copy): Deleted.
546         (WebCore::IDBObjectStoreMetadata>::copy): Deleted.
547         * platform/CrossThreadCopier.h:
548
549 2016-02-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
550
551         REGRESSION (r196268): Many assertion failures and crashes on SVG path animation tests when JS garbage collection happens quickly
552         https://bugs.webkit.org/show_bug.cgi?id=154331
553
554         Reviewed by Darin Adler.
555
556         This is not an actual regression. The bug did exist before r196268 but
557         the whole document was leaking once an SVGAnimatedProperty was created
558         so there was no way to produce this bug. After fixing the leak, one crash
559         and one assert got uncovered. Both of them happen because of the fact:
560         "if an SVGAnimatedProperty is not referenced it will be deleted."
561
562         * svg/SVGPathElement.cpp:
563         (WebCore::SVGPathElement::lookupOrCreateDWrapper):
564         The code in this function was assuming that the wrapper will be created
565         only once which happens when SVGAnimatedProperty::lookupOrCreateWrapper()
566         is called. Before making this single call, lookupOrCreateDWrapper() was
567         building an initial SVGPathSegList from byte stream. But now
568         SVGAnimatedProperty::lookupWrapper() can return false even after creating
569         the SVGAnimatedProperty because it was deleted later. Calling
570         buildSVGPathSegListFromByteStream() more than once was causing
571         SVGAnimatedListPropertyTearOff::animationStarted() to fire the assertion
572         ASSERT(m_values.size() == m_wrappers.size()) because the path segments were
573         appended twice to m_values which is in fact SVGPathElement::m_pathSegList.value.
574         The fix is to build the initial SVGPathSegList only once which should happen
575         when m_pathSegList.value.isEmpty().
576         
577         (WebCore::SVGPathElement::animatedPropertyWillBeDeleted):
578         * svg/SVGPathElement.h:
579         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
580         (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff):
581         SVGPathElement is assuming the following equivalence relation:
582         m_pathSegList.shouldSynchronize ~ SVGAnimatedProperty_is_created_and_not_null.
583         SVGPathElement::animatedPathSegList() and animatedNormalizedPathSegList()
584         set m_pathSegList.shouldSynchronize to true when SVGAnimatedProperty is
585         created but nothing sets m_pathSegList.shouldSynchronize back to false.
586         This was not a problem when the SVGAnimatedProperty was leaking but after
587         ensuring it is deleted when it is not referenced this equivalence relation
588         becomes untrue sometimes. This caused SVGPathElement::svgAttributeChanged()
589         to crash when we check m_pathSegList.shouldSynchronize and if it is true we
590         assume that SVGAnimatedProperty::lookupWrapper() will return a non-null pointer
591         and therefore we deference this pointer and call SVGAnimatedProperty::isAnimating().
592         To fix this crash we need to set m_pathSegList.shouldSynchronize back to false
593         when the associated SVGAnimatedProperty is deleted.
594
595 2016-02-25  Brady Eidson  <beidson@apple.com>
596
597         Modern IDB: WebKit 2 IPC layer.
598         https://bugs.webkit.org/show_bug.cgi?id=153808
599
600         Reviewed by Alex Christensen.
601
602         No new tests (Covered by over 1,000 existing tests).
603
604         * Modules/indexeddb/IDBKeyData.h:
605         (WebCore::IDBKeyData::encode): It's okay to encode Min and Max.
606         (WebCore::IDBKeyData::decode): It's okay to decode Min and Max.
607
608 2016-02-25  Daniel Bates  <dabates@apple.com>
609
610         CSP: Make SecurityPolicyViolationEvent more closely conform to CSP spec and enable it by default
611         https://bugs.webkit.org/show_bug.cgi?id=154522
612         <rdar://problem/24762078>
613
614         Reviewed by Brent Fulgham.
615
616         Include attributes statusCode and columnNumber in a dispatched SecurityPolicyViolationEvent and
617         as part of the SecurityPolicyViolationEventInit dictionary as per section Violation DOM Events
618         of the Content Security Policy Level 3 spec., <https://w3c.github.io/webappsec-csp/> (24 February 2016).
619         Additionally, enable dispatching of this event when a Content Security Policy violation occurs regardless
620         of whether ENABLE(CSP_NEXT) is enabled.
621
622         Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-image-https.html
623
624         * WebCore.xcodeproj/project.pbxproj: Add files JSSecurityPolicyViolationEvent.{cpp, h}.
625         * dom/EventNames.in: Enable support for SecurityPolicyViolationEvent unconditionally.
626         * dom/SecurityPolicyViolationEvent.h: Remove ENABLE(CSP_NEXT)-guard so that we compile this
627         code unconditionally. Modified SecurityPolicyViolationEventInit and SecurityPolicyViolationEvent
628         to support attributes statusCode and columnNumebr.
629         * dom/SecurityPolicyViolationEvent.idl: Add attributes statusCode and columnNumber.
630         * page/csp/ContentSecurityPolicy.cpp:
631         (WebCore::ContentSecurityPolicy::reportViolation): Modified to both dispatch a SecurityPolicyViolationEvent
632         and send a violation report (if applicable).
633
634 2016-02-25  Eric Carlson  <eric.carlson@apple.com>
635
636         [MediaStream] MediaDeviceInfo deviceId and groupId must be unique to the page's origin
637         https://bugs.webkit.org/show_bug.cgi?id=153163
638         <rdar://problem/24334526>
639
640         Reviewed by Tim Horton.
641
642         Tests: http/tests/media/media-stream/enumerate-devices-source-id-persistent.html
643                http/tests/media/media-stream/enumerate-devices-source-id.html
644
645         * Modules/mediastream/MediaDevicesRequest.cpp:
646         (WebCore::MediaDevicesRequest::start): Don't check document.hasHadActiveMediaStreamTrack, do it
647           in didCompleteTrackSourceInfoRequest where we need the information.
648         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Renamed from didCompleteCheck, save
649           device ID hash string.
650         (WebCore::hashString): Hash a string with SHA1.
651         (WebCore::MediaDevicesRequest::hashID): Hash and ID.
652         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Hash deviceId and groupId.
653         (WebCore::MediaDevicesRequest::didCompleteCheck): Deleted.
654         (WebCore::MediaDevicesRequest::getTrackSources): Deleted.
655         (WebCore::MediaDevicesRequest::didCompleteRequest): Deleted.
656         * Modules/mediastream/MediaDevicesRequest.h:
657
658         * Modules/mediastream/UserMediaPermissionCheck.cpp:
659         (WebCore::UserMediaPermissionCheck::userMediaDocumentOrigin): Renamed from securityOrigin.
660         (WebCore::UserMediaPermissionCheck::topLevelDocumentOrigin): New, return the top level document origin.
661         (WebCore::UserMediaPermissionCheck::setUserMediaAccessInfo): Renamed from setHasPersistentPermission.
662         (WebCore::UserMediaPermissionCheck::securityOrigin): Deleted.
663         (WebCore::UserMediaPermissionCheck::setHasPersistentPermission): Deleted.
664         * Modules/mediastream/UserMediaPermissionCheck.h:
665
666         * Modules/mediastream/UserMediaRequest.cpp:
667         (WebCore::UserMediaRequest::userMediaDocumentOrigin): Renamed from securityOrigin.
668         (WebCore::UserMediaRequest::topLevelDocumentOrigin): New, return the top level document origin.
669         (WebCore::UserMediaRequest::securityOrigin): Deleted.
670         * Modules/mediastream/UserMediaRequest.h:
671         (WebCore::UserMediaRequest::requiresAudio): Deleted, unused.
672         (WebCore::UserMediaRequest::requiresVideo): Ditto.
673
674         * html/HTMLMediaElement.cpp:
675         (WebCore::HTMLMediaElement::mediaPlayerMediaDeviceIdentifierStorageDirectory): Deleted, unused.
676         * html/HTMLMediaElement.h:
677
678         * platform/graphics/MediaPlayer.h:
679         (WebCore::MediaPlayerClient::mediaPlayerMediaDeviceIdentifierStorageDirectory): Deleted.
680
681         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
682         (WebCore::MediaStreamTrackSourcesRequestClient::didCompleteTrackSourceInfoRequest): Renamed from didCompleteRequest.
683
684         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
685         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources): Ditto.
686
687         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
688         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources): Ditto.
689
690 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
691
692         [GTK] Tearing when entering AC mode
693         https://bugs.webkit.org/show_bug.cgi?id=150955
694
695         Reviewed by Michael Catanzaro.
696
697         * platform/gtk/GtkUtilities.cpp:
698         (WebCore::widgetIsOnscreenToplevelWindow): Allow passing nullptr.
699
700 2016-02-24  Chris Dumez  <cdumez@apple.com>
701
702         Drop [TreatReturnedNullStringAs=Null] WebKit-specific IDL attribute
703         https://bugs.webkit.org/show_bug.cgi?id=154659
704
705         Reviewed by Sam Weinig.
706
707         Drop [TreatReturnedNullStringAs=Null] WebKit-specific IDL attribute and
708         use nullable DOMString types instead:
709         http://heycam.github.io/webidl/#idl-nullable-type
710
711         This is the standard way of doing things. We already had support
712         in the bindings generator for nullable DOMString attributes so
713         we now just leverage this support. However, our IDL parser did
714         not correctly parse nullable DOMString return values for operations.
715         This patch fixes this.
716
717         This patch also drops [TreatNullAs=NullString] and
718         [TreatUndefinedAs=NullString] for writable DOMString attributes that
719         are now marked as nullable because they are implied.
720
721         * Modules/fetch/FetchHeaders.idl:
722         * Modules/indexeddb/IDBObjectStore.idl:
723         * Modules/mediasource/DOMURLMediaSource.idl:
724         * Modules/mediastream/DOMURLMediaStream.idl:
725         * Modules/websockets/WebSocket.idl:
726         * bindings/scripts/CodeGeneratorJS.pm:
727         (NativeToJSValue): Deleted.
728         * bindings/scripts/IDLAttributes.txt:
729         * bindings/scripts/IDLParser.pm:
730         (parseAttributeOrOperationRest):
731         (parseOperationOrIterator):
732         (parseSpecialOperation):
733         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
734         (webkit_dom_test_obj_nullable_string_method):
735         (webkit_dom_test_obj_nullable_string_special_method):
736         (webkit_dom_test_obj_conditional_method3): Deleted.
737         (webkit_dom_test_obj_convert1): Deleted.
738         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
739         * bindings/scripts/test/JS/JSTestObj.cpp:
740         (WebCore::JSTestObj::getOwnPropertySlot):
741         (WebCore::JSTestObj::getOwnPropertySlotByIndex):
742         (WebCore::JSTestObj::getOwnPropertyNames):
743         (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
744         (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
745         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
746         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence): Deleted.
747         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence2): Deleted.
748         * bindings/scripts/test/JS/JSTestObj.h:
749         * bindings/scripts/test/ObjC/DOMTestObj.h:
750         * bindings/scripts/test/ObjC/DOMTestObj.mm:
751         (-[DOMTestObj nullableStringMethod]):
752         (-[DOMTestObj nullableStringStaticMethod]):
753         (-[DOMTestObj nullableStringSpecialMethod:]):
754         (-[DOMTestObj overloadedMethod1:]): Deleted.
755         (-[DOMTestObj getSVGDocument]): Deleted.
756         * bindings/scripts/test/TestObj.idl:
757         * css/CSSCharsetRule.idl:
758         * css/CSSImportRule.idl:
759         * css/CSSKeyframesRule.idl:
760         * css/CSSPageRule.idl:
761         * css/CSSRule.idl:
762         * css/CSSStyleDeclaration.idl:
763         * css/CSSStyleRule.idl:
764         * css/CSSValue.idl:
765         * css/MediaList.idl:
766         * css/StyleSheet.idl:
767         * dom/Attr.idl:
768         * dom/CharacterData.idl:
769         * dom/DOMStringList.idl:
770         * dom/Document.idl:
771         * dom/DocumentType.idl:
772         * dom/Element.idl:
773         * dom/Entity.idl:
774         * dom/MutationRecord.idl:
775         * dom/Node.idl:
776         * dom/ProcessingInstruction.idl:
777         * html/DOMSettableTokenList.idl:
778         * html/DOMTokenList.idl:
779         * html/DOMURL.idl:
780         * html/canvas/WebGLDebugShaders.idl:
781         * html/canvas/WebGLRenderingContextBase.idl:
782         * page/DOMWindow.idl:
783         * storage/Storage.idl:
784         * storage/StorageEvent.idl:
785         * xml/XMLHttpRequest.idl:
786         * xml/XPathNSResolver.idl:
787
788 2016-02-24  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
789
790         [web-animations] Add AnimationTimeline, DocumentTimeline and add extensions to Document interface
791         https://bugs.webkit.org/show_bug.cgi?id=151688
792
793         Reviewed by Dean Jackson.
794
795         - Adds DocumentTimeline interface and class implementation
796         - Implements the DocumentAnimation extension to the Document Interface that contains a default DocumentTimeline
797         - Add AnimationTimeline interface stub (i.e. without getAnimations and currentTime)
798         - Adds AnimationTimeline class implementation for AnimationTimeline interface stub
799         - Adds Javascript bindings for the above classes and interfaces
800         - Enables the WEB_ANIMATIONS compiler switch
801
802         No tests yet.  Tests will be added as class functionality is added incrementally.
803
804         * CMakeLists.txt:
805         * Configurations/FeatureDefines.xcconfig:
806         * DerivedSources.make:
807         * PlatformGTK.cmake:
808         * WebCore.vcxproj/WebCore.vcxproj:
809         * WebCore.vcxproj/WebCore.vcxproj.filters:
810         * WebCore.vcxproj/WebCoreIncludeCommon.props:
811         * WebCore.vcxproj/copyForwardingHeaders.cmd:
812         * WebCore.xcodeproj/project.pbxproj:
813         * animation/AnimationTimeline.cpp: Added.
814         (WebCore::AnimationTimeline::AnimationTimeline):
815         (WebCore::AnimationTimeline::~AnimationTimeline):
816         (WebCore::AnimationTimeline::destroy):
817         * animation/AnimationTimeline.h: Added.
818         (WebCore::AnimationTimeline::deref):
819         (WebCore::AnimationTimeline::isDocumentTimeline):
820         (WebCore::AnimationTimeline::classType):
821         * animation/AnimationTimeline.idl: Added.
822         * animation/DocumentAnimation.cpp: Added.
823         (WebCore::DocumentAnimation::DocumentAnimation):
824         (WebCore::DocumentAnimation::~DocumentAnimation):
825         (WebCore::DocumentAnimation::timeline):
826         (WebCore::DocumentAnimation::supplementName):
827         (WebCore::DocumentAnimation::from):
828         * animation/DocumentAnimation.h: Added.
829         * animation/DocumentAnimation.idl: Added.
830         * animation/DocumentTimeline.cpp: Added.
831         (WebCore::DocumentTimeline::create):
832         (WebCore::DocumentTimeline::DocumentTimeline):
833         (WebCore::DocumentTimeline::~DocumentTimeline):
834         * animation/DocumentTimeline.h: Added.
835         * animation/DocumentTimeline.idl: Added.
836         * bindings/js/JSAnimationTimelineCustom.cpp: Added.
837         (WebCore::toJS):
838         * bindings/js/JSBindingsAllInOne.cpp:
839         * bindings/scripts/CodeGeneratorGObject.pm:
840         * dom/Document.h:
841
842 2016-02-24  Brady Eidson  <beidson@apple.com>
843
844         Modern IDB: Some w3c objectstore tests crash under GuardMalloc.
845         https://bugs.webkit.org/show_bug.cgi?id=154460
846
847         Reviewed by Alex Christensen.
848
849         No new tests (Covered by existing tests).
850
851         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
852         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
853         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
854         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):  Don't delete the UniqueIDBDatabase yet 
855           if there are still any connections pending close.
856         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
857         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
858         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): It's possible that with this
859           transaction completing, and a connection finished its close process, that the UniqueIDBDatabase is
860           now ready to be deleted.
861
862         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
863         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
864         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
865
866         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
867         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
868
869 2016-02-24  Konstantin Tokarev  <annulen@yandex.ru>
870
871         [cmake] Moved PRE/POST_BUILD_COMMAND to WEBKIT_FRAMEWORK.
872         https://bugs.webkit.org/show_bug.cgi?id=154651
873
874         Reviewed by Alex Christensen.
875
876         No new tests needed.
877
878         * CMakeLists.txt: Moved shared code to WEBKIT_FRAMEWORK macro.
879
880 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
881
882         Use more references in FocusNavigationScope
883         https://bugs.webkit.org/show_bug.cgi?id=154637
884
885         Reviewed by Chris Dumez.
886
887         Use references in various functions of FocusNavigationScope as well as m_treeScope.
888
889         * page/FocusController.cpp:
890         (WebCore::FocusNavigationScope::FocusNavigationScope): Takes TreeScope& instead of TreeScope*.
891         (WebCore::FocusNavigationScope::rootNode): Returns ContainerNode& instead of ContainerNode*.
892         (WebCore::FocusNavigationScope::owner):
893         (WebCore::FocusNavigationScope::scopeOf): Takes Node& instead of Node*. Renamed from focusNavigationScopeOf.
894         (WebCore::FocusNavigationScope::scopeOwnedByShadowHost): Ditto. Renamed from focusNavigationScopeOwnedByShadowHost.
895         (WebCore::FocusNavigationScope::scopeOwnedByIFrame): Ditto. Renamed from focusNavigationScopeOwnedByIFrame.
896         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument):
897         (WebCore::FocusController::advanceFocusInDocumentOrder):
898         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Define currentScope inside the loop now that
899         the copy constructor of FocusNavigationScope no longer exists (since m_treeScope is a reference).
900         (WebCore::FocusController::findFocusableElementRecursively):
901         (WebCore::nextElementWithGreaterTabIndex):
902         (WebCore::FocusController::nextFocusableElement):
903         (WebCore::FocusController::previousFocusableElement):
904
905 2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
906
907         WebRTC: Add MediaEndpoint interface (WebRTC backend abstraction)
908         https://bugs.webkit.org/show_bug.cgi?id=150165
909
910         Reviewed by Eric Carlson.
911
912         Add the MediaEndpoint interface along with its companion objects.
913
914         MediaEndpoint interface: A WebRTC platform abstraction that is used to
915         configure how the the WebRTC backend sends and receives. It also abstracts
916         ICE functionality such as generating local candidates and doing
917         checking on remote candidates. The RTCPeerConnection API, and other API
918         objects such as RTCRtpSender/Receiver, live above MediaEndpoint.
919
920         MediaEndpointConfiguration: A settings object used to configure a
921         MediaEndpoint with, for example, ICE helper servers and other polices.
922         A MediaEndpointConfiguration is used to initialize a MediaEndpoint, but
923         can also be used to update settings.
924
925         MediaEndpointSessionConfiguration: An object that describes how the
926         MediaEndpoint should send and receive. Contains PeerMediaDescription,
927         MediaPayload and IceCandidate objects.
928
929         Tests: The MediaEndpoint platform interface has no implementations yet.
930
931         * CMakeLists.txt:
932         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
933         (WebCore::MediaEndpointPeerConnection::gotDtlsFingerprint):
934         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
935         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
936         (WebCore::MediaEndpointPeerConnection::gotRemoteSource):
937         * Modules/mediastream/MediaEndpointPeerConnection.h:
938         * WebCore.xcodeproj/project.pbxproj:
939         * platform/mediastream/IceCandidate.h: Added.
940         (WebCore::IceCandidate::create):
941         (WebCore::IceCandidate::~IceCandidate):
942         (WebCore::IceCandidate::type):
943         (WebCore::IceCandidate::setType):
944         (WebCore::IceCandidate::foundation):
945         (WebCore::IceCandidate::setFoundation):
946         (WebCore::IceCandidate::componentId):
947         (WebCore::IceCandidate::setComponentId):
948         (WebCore::IceCandidate::transport):
949         (WebCore::IceCandidate::setTransport):
950         (WebCore::IceCandidate::priority):
951         (WebCore::IceCandidate::setPriority):
952         (WebCore::IceCandidate::address):
953         (WebCore::IceCandidate::setAddress):
954         (WebCore::IceCandidate::port):
955         (WebCore::IceCandidate::setPort):
956         (WebCore::IceCandidate::tcpType):
957         (WebCore::IceCandidate::setTcpType):
958         (WebCore::IceCandidate::relatedAddress):
959         (WebCore::IceCandidate::setRelatedAddress):
960         (WebCore::IceCandidate::relatedPort):
961         (WebCore::IceCandidate::setRelatedPort):
962         (WebCore::IceCandidate::clone):
963         (WebCore::IceCandidate::IceCandidate):
964         * platform/mediastream/MediaEndpoint.cpp: Added.
965         (WebCore::createMediaEndpoint):
966         * platform/mediastream/MediaEndpoint.h: Added.
967         (WebCore::MediaEndpointClient::~MediaEndpointClient):
968         (WebCore::MediaEndpoint::~MediaEndpoint):
969         * platform/mediastream/MediaEndpointConfiguration.cpp: Added.
970         (WebCore::IceServerInfo::IceServerInfo):
971         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
972         * platform/mediastream/MediaEndpointConfiguration.h: Added.
973         (WebCore::IceServerInfo::create):
974         (WebCore::IceServerInfo::~IceServerInfo):
975         (WebCore::IceServerInfo::urls):
976         (WebCore::IceServerInfo::credential):
977         (WebCore::IceServerInfo::username):
978         (WebCore::MediaEndpointConfiguration::create):
979         (WebCore::MediaEndpointConfiguration::iceServers):
980         (WebCore::MediaEndpointConfiguration::iceTransportPolicy):
981         (WebCore::MediaEndpointConfiguration::bundlePolicy):
982         * platform/mediastream/MediaEndpointSessionConfiguration.h: Added.
983         (WebCore::MediaEndpointSessionConfiguration::create):
984         (WebCore::MediaEndpointSessionConfiguration::~MediaEndpointSessionConfiguration):
985         (WebCore::MediaEndpointSessionConfiguration::sessionId):
986         (WebCore::MediaEndpointSessionConfiguration::setSessionId):
987         (WebCore::MediaEndpointSessionConfiguration::sessionVersion):
988         (WebCore::MediaEndpointSessionConfiguration::setSessionVersion):
989         (WebCore::MediaEndpointSessionConfiguration::mediaDescriptions):
990         (WebCore::MediaEndpointSessionConfiguration::addMediaDescription):
991         (WebCore::MediaEndpointSessionConfiguration::clone):
992         (WebCore::MediaEndpointSessionConfiguration::MediaEndpointSessionConfiguration):
993         * platform/mediastream/MediaPayload.h: Added.
994         (WebCore::MediaPayload::create):
995         (WebCore::MediaPayload::~MediaPayload):
996         (WebCore::MediaPayload::type):
997         (WebCore::MediaPayload::setType):
998         (WebCore::MediaPayload::encodingName):
999         (WebCore::MediaPayload::setEncodingName):
1000         (WebCore::MediaPayload::clockRate):
1001         (WebCore::MediaPayload::setClockRate):
1002         (WebCore::MediaPayload::channels):
1003         (WebCore::MediaPayload::setChannels):
1004         (WebCore::MediaPayload::ccmfir):
1005         (WebCore::MediaPayload::setCcmfir):
1006         (WebCore::MediaPayload::nackpli):
1007         (WebCore::MediaPayload::setNackpli):
1008         (WebCore::MediaPayload::nack):
1009         (WebCore::MediaPayload::setNack):
1010         (WebCore::MediaPayload::parameters):
1011         (WebCore::MediaPayload::addParameter):
1012         (WebCore::MediaPayload::clone):
1013         (WebCore::MediaPayload::MediaPayload):
1014         * platform/mediastream/PeerMediaDescription.h: Added.
1015         (WebCore::PeerMediaDescription::create):
1016         (WebCore::PeerMediaDescription::~PeerMediaDescription):
1017         (WebCore::PeerMediaDescription::type):
1018         (WebCore::PeerMediaDescription::setType):
1019         (WebCore::PeerMediaDescription::port):
1020         (WebCore::PeerMediaDescription::setPort):
1021         (WebCore::PeerMediaDescription::address):
1022         (WebCore::PeerMediaDescription::setAddress):
1023         (WebCore::PeerMediaDescription::mode):
1024         (WebCore::PeerMediaDescription::setMode):
1025         (WebCore::PeerMediaDescription::payloads):
1026         (WebCore::PeerMediaDescription::addPayload):
1027         (WebCore::PeerMediaDescription::setPayloads):
1028         (WebCore::PeerMediaDescription::rtcpMux):
1029         (WebCore::PeerMediaDescription::setRtcpMux):
1030         (WebCore::PeerMediaDescription::rtcpAddress):
1031         (WebCore::PeerMediaDescription::setRtcpAddress):
1032         (WebCore::PeerMediaDescription::rtcpPort):
1033         (WebCore::PeerMediaDescription::setRtcpPort):
1034         (WebCore::PeerMediaDescription::mediaStreamId):
1035         (WebCore::PeerMediaDescription::setMediaStreamId):
1036         (WebCore::PeerMediaDescription::mediaStreamTrackId):
1037         (WebCore::PeerMediaDescription::setMediaStreamTrackId):
1038         (WebCore::PeerMediaDescription::dtlsSetup):
1039         (WebCore::PeerMediaDescription::setDtlsSetup):
1040         (WebCore::PeerMediaDescription::dtlsFingerprintHashFunction):
1041         (WebCore::PeerMediaDescription::setDtlsFingerprintHashFunction):
1042         (WebCore::PeerMediaDescription::dtlsFingerprint):
1043         (WebCore::PeerMediaDescription::setDtlsFingerprint):
1044         (WebCore::PeerMediaDescription::cname):
1045         (WebCore::PeerMediaDescription::setCname):
1046         (WebCore::PeerMediaDescription::ssrcs):
1047         (WebCore::PeerMediaDescription::addSsrc):
1048         (WebCore::PeerMediaDescription::clearSsrcs):
1049         (WebCore::PeerMediaDescription::iceUfrag):
1050         (WebCore::PeerMediaDescription::setIceUfrag):
1051         (WebCore::PeerMediaDescription::icePassword):
1052         (WebCore::PeerMediaDescription::setIcePassword):
1053         (WebCore::PeerMediaDescription::iceCandidates):
1054         (WebCore::PeerMediaDescription::addIceCandidate):
1055         (WebCore::PeerMediaDescription::source):
1056         (WebCore::PeerMediaDescription::setSource):
1057         (WebCore::PeerMediaDescription::clone):
1058         (WebCore::PeerMediaDescription::PeerMediaDescription):
1059
1060 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1061
1062         [Fetch API] Implement Fetch API Response
1063         https://bugs.webkit.org/show_bug.cgi?id=154536
1064
1065         Reviewed by Alex Christensen.
1066
1067         Tests: imported/w3c/web-platform-tests/fetch/api/response/response-clone.html
1068                imported/w3c/web-platform-tests/fetch/api/response/response-consume.html
1069                imported/w3c/web-platform-tests/fetch/api/response/response-error.html
1070                imported/w3c/web-platform-tests/fetch/api/response/response-idl.html
1071                imported/w3c/web-platform-tests/fetch/api/response/response-init-001.html
1072                imported/w3c/web-platform-tests/fetch/api/response/response-init-002.html
1073                imported/w3c/web-platform-tests/fetch/api/response/response-static-error.html
1074                imported/w3c/web-platform-tests/fetch/api/response/response-static-redirect.html
1075
1076         Adding Fetch Response as FetchResponse class.
1077         Constructor uses a built-in to pre-process the parameters.
1078         Support of body as ReadableStream is missing.
1079
1080         * CMakeLists.txt:
1081         * DerivedSources.make:
1082         * Modules/fetch/FetchBody.h:
1083         (WebCore::FetchBody::empty):
1084         * Modules/fetch/FetchResponse.cpp: Added.
1085         (WebCore::JSFetchResponse::body):
1086         (WebCore::isRedirectStatus):
1087         (WebCore::isNullBodyStatus):
1088         (WebCore::FetchResponse::error):
1089         (WebCore::FetchResponse::redirect):
1090         (WebCore::FetchResponse::initializeWith):
1091         (WebCore::FetchResponse::FetchResponse):
1092         (WebCore::FetchResponse::clone):
1093         (WebCore::FetchResponse::type):
1094         * Modules/fetch/FetchResponse.h: Added.
1095         (WebCore::FetchResponse::create):
1096         (WebCore::FetchResponse::redirect):
1097         (WebCore::FetchResponse::url):
1098         (WebCore::FetchResponse::redirected):
1099         (WebCore::FetchResponse::status):
1100         (WebCore::FetchResponse::ok):
1101         (WebCore::FetchResponse::statusText):
1102         (WebCore::FetchResponse::headers):
1103         (WebCore::FetchResponse::isDisturbed):
1104         (WebCore::FetchResponse::arrayBuffer):
1105         (WebCore::FetchResponse::formData):
1106         (WebCore::FetchResponse::blob):
1107         (WebCore::FetchResponse::json):
1108         (WebCore::FetchResponse::text):
1109         * Modules/fetch/FetchResponse.idl: Added.
1110         * Modules/fetch/FetchResponse.js: Added.
1111         (initializeFetchResponse):
1112         * WebCore.xcodeproj/project.pbxproj:
1113         * bindings/js/WebCoreJSBuiltins.cpp:
1114         * bindings/js/WebCoreJSBuiltins.h:
1115         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
1116         (WebCore::JSBuiltinFunctions::fetchResponseBuiltins):
1117
1118 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
1119
1120         A function named canTakeNextToken executing blocking scripts is misleading
1121         https://bugs.webkit.org/show_bug.cgi?id=154636
1122
1123         Reviewed by Darin Adler.
1124
1125         Merged canTakeNextToken into pumpTokenizer and extracted pumpTokenizerLoop out of pumpTokenizer.
1126
1127         Inlined m_parserChunkSize in HTMLParserScheduler into checkForYieldBeforeToken, and removed needsYield
1128         from PumpSession in favor of making checkForYieldBeforeToken and checkForYieldBeforeScript return a bool.
1129
1130         No new tests since this is a pure refactoring.
1131
1132         * html/parser/HTMLDocumentParser.cpp:
1133         (WebCore::HTMLDocumentParser::canTakeNextToken): Deleted.
1134         (WebCore::HTMLDocumentParser::pumpTokenizerLoop): Extracted from pumpTokenizer. We don't have to check
1135         isStopped() at the beginning since pumpTokenizer asserts that. Return true when session.needsYield would
1136         have been set to true in the old code and return false elsewhere (for stopping or incomplete token).
1137         (WebCore::HTMLDocumentParser::pumpTokenizer):
1138         * html/parser/HTMLDocumentParser.h:
1139         * html/parser/HTMLParserScheduler.cpp:
1140         (WebCore::PumpSession::PumpSession):
1141         (WebCore::HTMLParserScheduler::HTMLParserScheduler):
1142         (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript): Renamed from checkForYieldBeforeScript.
1143         * html/parser/HTMLParserScheduler.h:
1144         (WebCore::HTMLParserScheduler::shouldYieldBeforeToken): Renamed from checkForYieldBeforeToken.
1145         (WebCore::HTMLParserScheduler::isScheduledForResume):
1146         (WebCore::HTMLParserScheduler::checkForYield): Extracted from checkForYieldBeforeToken. Reset
1147         processedTokens to 1 instead of setting it to 0 here and incrementing it later as done in the old code.
1148
1149 2016-02-24  Daniel Bates  <dabates@apple.com>
1150
1151         CSP: Enable plugin-types directive by default
1152         https://bugs.webkit.org/show_bug.cgi?id=154420
1153         <rdar://problem/24730322>
1154
1155         Reviewed by Brent Fulgham.
1156
1157         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1158         (WebCore::isExperimentalDirectiveName): Move plugin-types from the directives considered
1159         experimental to...
1160         (WebCore::isCSPDirectiveName): ...the list of standard directives.
1161         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the plugin-types
1162         directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.
1163
1164 2016-02-24  Ryan Haddad  <ryanhaddad@apple.com>
1165
1166         Speculative fix for ios build.
1167
1168         Unreviewed build fix.
1169
1170         * bindings/objc/DOM.mm:
1171         (-[DOMNode nextFocusNode]):
1172         (-[DOMNode previousFocusNode]):
1173
1174 2016-02-24  Zalan Bujtas  <zalan@apple.com>
1175
1176         Background of an absolutely positioned inline element inside text-indented parent is positioned statically.
1177         https://bugs.webkit.org/show_bug.cgi?id=154019
1178
1179         Reviewed by Simon Fraser.
1180
1181         This patch ensures that statically positioned out-of-flow renderers are also text-aligned
1182         even when none of the renderers on the first line generate a linebox (so we end up with no bidi runs at all).
1183         The fix is to pass IndentTextOrNot information to startAlignedOffsetForLine through updateStaticInlinePositionForChild
1184         so that we can compute the left position for this statically positioned out of flow renderer.
1185
1186         Test: fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child.html
1187
1188         * rendering/RenderBlockFlow.cpp:
1189         (WebCore::RenderBlockFlow::adjustPositionedBlock):
1190         (WebCore::RenderBlockFlow::updateStaticInlinePositionForChild):
1191         * rendering/RenderBlockFlow.h:
1192         * rendering/RenderBlockLineLayout.cpp:
1193         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1194         (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
1195         * rendering/line/LineBreaker.cpp:
1196         (WebCore::LineBreaker::skipTrailingWhitespace):
1197         (WebCore::LineBreaker::skipLeadingWhitespace):
1198         * rendering/line/LineInlineHeaders.h: webkit.org/b/154628 fixes the bool vs IndentTextOrNot issue.
1199         (WebCore::setStaticPositions):
1200
1201 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1202
1203         Remove IteratorKey and IteratorValue declarations from JSXX class declarations.
1204         https://bugs.webkit.org/show_bug.cgi?id=154577
1205
1206         Reviewed by Myles C. Maxfield.
1207
1208         No change of behavior.
1209
1210         * bindings/scripts/CodeGeneratorJS.pm:
1211         (GenerateHeader): Deleted declaration of IteratorKey and IteratorValue.
1212         * bindings/scripts/test/JS/JSTestObj.h:
1213         (WebCore::JSTestObj::createStructure): Rebasing of binding test expectation.
1214
1215 2016-02-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1216
1217         [Fetch API] Refactor FetchHeaders initialization with iterators
1218         https://bugs.webkit.org/show_bug.cgi?id=154537
1219
1220         Reviewed by Darin Adler.
1221
1222         Covered by existing tests.
1223
1224         * Modules/fetch/FetchHeaders.cpp:
1225         (WebCore::initializeWith): Deleted.
1226         * Modules/fetch/FetchHeaders.h: Removed FetchHeaders::initializeWith.
1227         * Modules/fetch/FetchHeaders.idl: Ditto.
1228         * Modules/fetch/FetchHeaders.js:
1229         (initializeFetchHeaders): Making use of iterators to fill headers.
1230
1231 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1232
1233         Unreviewed. Fix GObject DOM bindings API break after r196998.
1234
1235         webkit_dom_node_clone_node can now raise exceptions, so rename it
1236         as webkit_dom_node_clone_node_with_error and deprecate the old one
1237         that calls the new one ignoring the error.
1238
1239         * bindings/gobject/WebKitDOMDeprecated.cpp:
1240         (webkit_dom_node_clone_node):
1241         * bindings/gobject/WebKitDOMDeprecated.h:
1242         * bindings/gobject/WebKitDOMDeprecated.symbols:
1243         * bindings/gobject/webkitdom.symbols:
1244         * bindings/scripts/CodeGeneratorGObject.pm:
1245         (FunctionUsedToNotRaiseException):
1246         (GenerateFunction):
1247
1248 2016-02-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1249
1250         REGRESSION(r195949): [GTK] Test /webkit2/WebKitWebView/insert/link is failing since r195949
1251         https://bugs.webkit.org/show_bug.cgi?id=153747
1252
1253         Reviewed by Michael Catanzaro.
1254
1255         Do not return early when reaching a boundary if there's a range
1256         selection. In that case, the selection will be cleared and
1257         accessibility will be notified.
1258
1259         Test: editing/selection/move-to-line-boundary-clear-selection.html
1260
1261         * editing/FrameSelection.cpp:
1262         (WebCore::FrameSelection::modify):
1263
1264 2016-02-24  Alejandro G. Castro  <alex@igalia.com>
1265
1266         [Gstreamer] Mediaplayer should observe the tracks and not the source
1267         https://bugs.webkit.org/show_bug.cgi?id=154582
1268
1269         Reviewed by Philippe Normand.
1270
1271         We have to observe the track objects that define the
1272         mediastream. Replace the source attributes with the new tracks and
1273         use them properly in the class.
1274
1275         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1276         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
1277         Make sure we are not observing anymore the tracks after
1278         destruction.
1279         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo): Used the track
1280         instead of the source.
1281         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio): Ditto.
1282         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Ditto.
1283         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad): Ditto.
1284         (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Ditto.
1285         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Added, new
1286         track observer API, make sure we disable the ended tracks.
1287         (WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
1288         Added, new track observer API.
1289         (WebCore::MediaPlayerPrivateGStreamerOwr::trackSettingsChanged):
1290         Added, new track observer API.
1291         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
1292         Added, new track observer API.
1293         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped): Deleted,
1294         source observer API.
1295         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
1296         Deleted, source observer API.
1297         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
1298         Deleted, source observer API.
1299         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
1300         Deleted, source observer API.
1301         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
1302         Replaced the attributes representing the source with the tracks
1303         and added the new track observer functions.
1304
1305 2016-02-23  Sergio Villar Senin  <svillar@igalia.com>
1306
1307         [css-grid] Swap the order of columns/rows in grid-gap shorthand
1308         https://bugs.webkit.org/show_bug.cgi?id=154584
1309
1310         The latest editor's draft have just changed the order. Now it
1311         should be <grid-row-gap> <grid-column-gap>?.
1312
1313         Reviewed by Darin Adler.
1314
1315         * css/CSSParser.cpp:
1316         (WebCore::CSSParser::parseGridGapShorthand):
1317         * css/CSSPropertyNames.in:
1318
1319 2016-02-24  Ryosuke Niwa  <rniwa@webkit.org>
1320
1321         Move FocusNavigationScope into FocusController.cpp
1322         https://bugs.webkit.org/show_bug.cgi?id=154630
1323
1324         Reviewed by Darin Adler.
1325
1326         Moved FocusNavigationScope from FocusController.h to FocusController.cpp.
1327
1328         * bindings/objc/DOM.mm:
1329         (-[DOMNode nextFocusNode]):
1330         (-[DOMNode previousFocusNode]):
1331         * page/FocusController.cpp:
1332         (WebCore::parentInScope):
1333         (WebCore::FocusNavigationScope::firstChildInScope): Moved into FocusNavigationScope.
1334         (WebCore::FocusNavigationScope::lastChildInScope): Ditto.
1335         (WebCore::FocusNavigationScope::nextInScope): Ditto.
1336         (WebCore::FocusNavigationScope::previousInScope): Ditto.
1337         (WebCore::FocusController::findFocusableElementAcrossFocusScope):
1338         (WebCore::FocusController::findFocusableElementRecursively):
1339         (WebCore::FocusController::findFocusableElement):
1340         (WebCore::nextElementWithGreaterTabIndex):
1341         (WebCore::previousElementWithLowerTabIndex):
1342         (WebCore::FocusController::nextFocusableElement): Added a variant for DOM.mm and WebPageIOS.mm.
1343         (WebCore::FocusController::previousFocusableElement): Ditto.
1344         (WebCore::FocusController::nextFocusableElement):
1345         (WebCore::FocusController::previousFocusableElement): Use if instead of for loop for clarity.
1346         * page/FocusController.h:
1347
1348 2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1349
1350         WebRTC: RTCPeerConnection: Sort out responsibilities of close() and stop()
1351         https://bugs.webkit.org/show_bug.cgi?id=154581
1352
1353         Reviewed by Eric Carlson.
1354
1355         Let RTCPeerConnection::close() contain all teardown logic be called by stop().
1356         close() is also responisble for stopping the PeerConnectionBackend and stopping
1357         all RTCRtpSender objects.
1358
1359         Test coverage:
1360         fast/mediastream/RTCRtpSender-replaceTrack.html (updated)
1361         fast/mediastream/RTCPeerConnection-closed-state.html
1362
1363         * Modules/mediastream/RTCPeerConnection.cpp:
1364         (WebCore::RTCPeerConnection::close):
1365         (WebCore::RTCPeerConnection::stop):
1366         (WebCore::RTCPeerConnection::RTCPeerConnection): Deleted.
1367         * Modules/mediastream/RTCPeerConnection.h:
1368
1369 2016-02-24  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1370
1371         WebRTC: Add addReceiver() function to PeerConnectionBackendClient interface
1372         https://bugs.webkit.org/show_bug.cgi?id=154583
1373
1374         Reviewed by Eric Carlson.
1375
1376         The addRecevier() notifies the PeerConnectionBackendClient that a new RTCRtpReceiver,
1377         representing an MediaStreamTrack received from a remote peer, is added.
1378
1379         * Modules/mediastream/PeerConnectionBackend.h:
1380         * Modules/mediastream/RTCPeerConnection.cpp:
1381         (WebCore::RTCPeerConnection::addReceiver):
1382         * Modules/mediastream/RTCPeerConnection.h:
1383
1384 2016-02-23  Olivier Blin  <olivier.blin@softathome.com>
1385
1386         Support building LocaleICU with light ICU (UCONFIG_NO_FORMATTING)
1387         https://bugs.webkit.org/show_bug.cgi?id=154484
1388
1389         Reviewed by Darin Adler.
1390
1391         In this mode, this makes LocaleICU with UCONFIG_NO_FORMATTING
1392         essentially the same as LocaleNone, but allows to keep using ICU for
1393         other features.
1394
1395         * platform/text/LocaleICU.cpp:
1396         (WebCore::LocaleICU::LocaleICU):
1397         (WebCore::LocaleICU::~LocaleICU):
1398         (WebCore::LocaleICU::initializeLocaleData):
1399         * platform/text/LocaleICU.h:
1400
1401 2016-02-23  Myles C. Maxfield  <mmaxfield@apple.com>
1402
1403         Remove dead FontLoader code
1404         https://bugs.webkit.org/show_bug.cgi?id=154625
1405
1406         Reviewed by Darin Adler.
1407
1408         This code has been replaced by FontFaceSet.
1409
1410         No new tests because there is no behavior change.
1411
1412         * CMakeLists.txt:
1413         * DerivedSources.cpp:
1414         * DerivedSources.make:
1415         * WebCore.vcxproj/WebCore.vcxproj:
1416         * WebCore.vcxproj/WebCore.vcxproj.filters:
1417         * WebCore.xcodeproj/project.pbxproj:
1418         * css/CSSAllInOne.cpp:
1419         * css/FontLoader.cpp: Removed.
1420         (WebCore::LoadFontCallback::create): Deleted.
1421         (WebCore::LoadFontCallback::createFromParams): Deleted.
1422         (WebCore::LoadFontCallback::~LoadFontCallback): Deleted.
1423         (WebCore::LoadFontCallback::familyCount): Deleted.
1424         (WebCore::LoadFontCallback::LoadFontCallback): Deleted.
1425         (WebCore::LoadFontCallback::notifyLoaded): Deleted.
1426         (WebCore::LoadFontCallback::notifyError): Deleted.
1427         (WebCore::FontLoader::loadFontDone): Deleted.
1428         (WebCore::FontLoader::FontLoader): Deleted.
1429         (WebCore::FontLoader::~FontLoader): Deleted.
1430         (WebCore::FontLoader::eventTargetData): Deleted.
1431         (WebCore::FontLoader::ensureEventTargetData): Deleted.
1432         (WebCore::FontLoader::eventTargetInterface): Deleted.
1433         (WebCore::FontLoader::scriptExecutionContext): Deleted.
1434         (WebCore::FontLoader::didLayout): Deleted.
1435         (WebCore::FontLoader::activeDOMObjectName): Deleted.
1436         (WebCore::FontLoader::canSuspendForDocumentSuspension): Deleted.
1437         (WebCore::FontLoader::scheduleEvent): Deleted.
1438         (WebCore::FontLoader::firePendingEvents): Deleted.
1439         (WebCore::FontLoader::beginFontLoading): Deleted.
1440         (WebCore::FontLoader::fontLoaded): Deleted.
1441         (WebCore::FontLoader::loadError): Deleted.
1442         (WebCore::FontLoader::notifyWhenFontsReady): Deleted.
1443         (WebCore::FontLoader::loadingDone): Deleted.
1444         (WebCore::FontLoader::loadFont): Deleted.
1445         (WebCore::FontLoader::checkFont): Deleted.
1446         (WebCore::applyPropertyToCurrentStyle): Deleted.
1447         (WebCore::FontLoader::resolveFontStyle): Deleted.
1448         * css/FontLoader.h: Removed.
1449         * css/FontLoader.idl: Removed.
1450         * page/FrameView.cpp:
1451
1452 2016-02-23  Per Arne Vollan  <peavo@outlook.com>
1453
1454         [WinCairo][MediaFoundation] Implement methods to set volume.
1455         https://bugs.webkit.org/show_bug.cgi?id=154580
1456
1457         Reviewed by Alex Christensen.
1458
1459         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1460         (WebCore::MediaPlayerPrivateMediaFoundation::paused):
1461         (WebCore::MediaPlayerPrivateMediaFoundation::setVolume):
1462         (WebCore::MediaPlayerPrivateMediaFoundation::supportsMuting):
1463         (WebCore::MediaPlayerPrivateMediaFoundation::setMuted):
1464         (WebCore::MediaPlayerPrivateMediaFoundation::networkState):
1465         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1466
1467 2016-02-23  Chris Dumez  <cdumez@apple.com>
1468
1469         [Reflected] IDL attributes of integer types should use HTML rules for parsing integers
1470         https://bugs.webkit.org/show_bug.cgi?id=154573
1471
1472         Reviewed by Darin Adler.
1473
1474         [Reflected] IDL attributes of integer types should use HTML rules for
1475         parsing integers:
1476         - https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes
1477
1478         Those rules are defined here:
1479         - https://html.spec.whatwg.org/#rules-for-parsing-integers
1480         - https://html.spec.whatwg.org/#rules-for-parsing-non-negative-integers
1481
1482         We already had an implementation for parsing HTML integers but our reflected
1483         attributes currently use WTFString::toInt() / toUint() instead.
1484
1485         No new tests, already covered by existing tests.
1486
1487         * dom/Element.cpp:
1488         (WebCore::Element::getIntegralAttribute):
1489         This method used by the bindings only, for reflected IDL attributed of
1490         type 'long'. Now call parseHTMLInteger() instead of String::toInt() to
1491         parse the content attribute as per the HTML specification.
1492
1493         (WebCore::Element::getUnsignedIntegralAttribute):
1494         This method used by the bindings only, for reflected IDL attributed of
1495         type 'unsigned long'. Now call parseHTMLNonNegativeInteger() instead of
1496         String::toUInt() to parse the content attribute as per the HTML
1497         specification.
1498
1499         * html/parser/HTMLParserIdioms.cpp:
1500         (WebCore::parseHTMLIntegerInternal):
1501         Fix a bug in our implementation of parseHTMLIntegerInternal() that
1502         would cause the string "−2147483648" to be parsed as 0. It should
1503         be parsed as −2147483648, which is in the valid range as per:
1504         http://heycam.github.io/webidl/#idl-long
1505
1506 2016-02-23  Chris Dumez  <cdumez@apple.com>
1507
1508         Align our implementation of Range.createContextualFragment with the specification
1509         https://bugs.webkit.org/show_bug.cgi?id=154627
1510
1511         Reviewed by Ryosuke Niwa.
1512
1513         Align our implementation of Range.createContextualFragment with the
1514         specification:
1515         - https://w3c.github.io/DOM-Parsing/#widl-Range-createContextualFragment-DocumentFragment-DOMString-fragment
1516
1517         In particular, if the Range's start node is a Document / DocumentFragment,
1518         we now create a new HTMLBodyElement and use it as context element, instead
1519         of throwing an exception.
1520
1521         This also aligns our behavior with Firefox and Chrome.
1522
1523         Tests: imported/blink/fast/dom/Range/create-contextual-fragment-from-bodyless-document-range.html
1524                imported/blink/fast/dom/Range/create-contextual-fragment-from-detached-text-node-range.html
1525                imported/blink/fast/dom/Range/create-contextual-fragment-from-document-fragment-range.html
1526                imported/blink/fast/dom/Range/create-contextual-fragment-from-document-range.html
1527                imported/blink/fast/dom/Range/create-contextual-fragment-from-xhtml-document-range.xhtml
1528                imported/blink/fast/dom/Range/create-contextual-fragment-script-not-ran.html
1529                imported/blink/fast/dom/Range/create-contextual-fragment-script-unmark-already-started.html
1530
1531         * dom/Range.cpp:
1532         (WebCore::Range::createContextualFragment):
1533
1534 2016-02-23  Dan Bernstein  <mitz@apple.com>
1535
1536         [Xcode] Linker errors display mangled names, but no longer should
1537         https://bugs.webkit.org/show_bug.cgi?id=154632
1538
1539         Reviewed by Sam Weinig.
1540
1541         * Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
1542
1543 2016-02-23  Dean Jackson  <dino@apple.com>
1544
1545         [WebGL] iOS doesn't respect the alpha:false context creation attribute
1546         https://bugs.webkit.org/show_bug.cgi?id=154617
1547         <rdar://problem/13417023>
1548
1549         Reviewed by Sam Weinig.
1550
1551         On iOS we were not respecting the alpha:false context creation
1552         attribute, which meant you always got output that could
1553         have an alpha channel.
1554
1555         The good news is that now we're setting the opaque flag on
1556         the CALayer, there should be a performance improvement when
1557         compositing WebGL into the page.
1558
1559         Test: fast/canvas/webgl/context-attributes-alpha.html
1560
1561         * platform/graphics/mac/GraphicsContext3DMac.mm:
1562         (WebCore::GraphicsContext3D::GraphicsContext3D): Don't tell the layer
1563         to be transparent.
1564         (WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Do it
1565         here instead, but based on the value of the alpha attribute.
1566
1567 2016-02-23  Daniel Bates  <dabates@apple.com>
1568
1569         CSP: Enable base-uri directive by default
1570         https://bugs.webkit.org/show_bug.cgi?id=154521
1571         <rdar://problem/24762032>
1572
1573         Reviewed by Brent Fulgham.
1574
1575         Tests: http/tests/security/contentSecurityPolicy/1.1/base-uri-default-ignored.html
1576                http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-base-uri-deny.html
1577
1578         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1579         (WebCore::isExperimentalDirectiveName): Move base-uri from the directives considered
1580         experimental to...
1581         (WebCore::isCSPDirectiveName): ...the list of standard directives.
1582         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the base-uri
1583         directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.
1584
1585 2016-02-23  Gavin Barraclough  <barraclough@apple.com>
1586
1587         Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
1588         https://bugs.webkit.org/show_bug.cgi?id=112323
1589
1590         Reviewed by Chris Dumez.
1591
1592         This feature is controlled by a runtime switch, and defaults off.
1593
1594         * Configurations/FeatureDefines.xcconfig:
1595         * page/Page.cpp:
1596         (WebCore::Page::setTimerThrottlingEnabled):
1597         * page/Settings.cpp:
1598         (WebCore::Settings::Settings):
1599         (WebCore::Settings::shouldRespectPriorityInCSSAttributeSetters):
1600         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled):
1601         (WebCore::Settings::setHiddenPageDOMTimerThrottlingAutoIncreases):
1602         * page/Settings.h:
1603         (WebCore::Settings::layoutInterval):
1604         (WebCore::Settings::hiddenPageDOMTimerThrottlingEnabled):
1605         (WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreases):
1606
1607 2016-02-23  Gavin Barraclough  <barraclough@apple.com>
1608
1609         Add a mechanism to automatically ramp up timer alignment.
1610         https://bugs.webkit.org/show_bug.cgi?id=154578
1611
1612         Reviewed by Antti Koivisto & Chris Dumez.
1613
1614         Allow timer alignment duration to be proportional to the time the page
1615         has been hidden. This implementation does so by scaling up the throttle
1616         in exponential steps, spaced exponentially far apart.
1617
1618         * page/Page.cpp:
1619         (WebCore::Page::Page):
1620             - initialize timer.
1621         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
1622             - if setting are changed fully disable/reenable to ensure new setting are read.
1623         (WebCore::Page::setTimerThrottlingEnabled):
1624             - enebled bool flag converted to an Optional<double>, tracking time throttling
1625               is enabled.
1626         (WebCore::Page::setDOMTimerAlignmentInterval):
1627             - when new mechanism is enabled schedule a timer to step up alignment.
1628         (WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
1629             - when timer fires increase alignment.
1630         * page/Page.h:
1631             - added new member.
1632         * page/Settings.cpp:
1633         (WebCore::Settings::Settings):
1634             - initialize new member.
1635         (WebCore::Settings::setHiddenPageDOMTimerThrottlingAutoIncreaseLimit):
1636             - added, update new setting. Setting to zero disabled. A non-zero value is a
1637               duration in seconds for timer throttling to ramp up to.
1638         * page/Settings.h:
1639         (WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreases):
1640             - read as boolean whether throttle increasing is enabled.
1641         (WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreaseLimit):
1642             - read throttle increasing limit.
1643
1644 2016-02-22  Ada Chan  <adachan@apple.com>
1645
1646         Refactor script that updates fullscreen buttons.
1647         https://bugs.webkit.org/show_bug.cgi?id=154562
1648
1649         Reviewed by Dean Jackson.
1650
1651         Also expose extra property and element in getCurrentControlsStatus() for future testing.
1652
1653         * Modules/mediacontrols/mediaControlsApple.js:
1654         (Controller.prototype.updatePictureInPictureButton):
1655         (Controller.prototype.updateFullscreenButtons):
1656
1657 2016-02-22  Ryosuke Niwa  <rniwa@webkit.org>
1658
1659         Calling importNode on shadow root causes a crash
1660         https://bugs.webkit.org/show_bug.cgi?id=154570
1661
1662         Reviewed by Anders Carlsson.
1663
1664         The bug was caused by a missing check in cloneNode. Added cloneNodeForBindings to explicitly throw
1665         an NotSupportedError when it's called on a shadow root. We don't clone shadow root when deep-cloning
1666         the tree so we don't have to check that condition.
1667
1668         The behavior of cloneNode is specified at:
1669         http://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface
1670         (it current says we should throw DATA_CLONE_ERR but I have an spec bug filed at
1671         https://github.com/w3c/webcomponents/issues/393)
1672
1673         The behavior of importNode and adoptNode are specified in DOM4 specification:
1674         https://dom.spec.whatwg.org/#dom-document-importnode
1675         https://dom.spec.whatwg.org/#dom-document-adoptnode
1676
1677         Tests: fast/shadow-dom/Document-prototype-adoptNode.html
1678                fast/shadow-dom/Document-prototype-importNode.html
1679                fast/shadow-dom/Node-prototype-cloneNode.html
1680
1681         * dom/Document.cpp:
1682         (WebCore::Document::importNode): Throw NotSupportedError when importing a shadow root.
1683         * dom/Node.cpp:
1684         (WebCore::Node::cloneNodeForBindings): Added.
1685         * dom/Node.h:
1686         * dom/Node.idl: Use cloneNodeForBindings here.
1687
1688 2016-02-23  Daniel Bates  <dabates@apple.com>
1689
1690         REGRESSION (r196892): No longer emit error message when CSP form-action directive is used as a source expression
1691         https://bugs.webkit.org/show_bug.cgi?id=154555
1692         <rdar://problem/24776777>
1693
1694         Reviewed by Andy Estes.
1695
1696         Fixes an issue where an error message is not emitted when directive form-action is used as a
1697         source expression. Prior to <http://trac.webkit.org/changeset/196892>, when directive form-action
1698         was used as a source expression a console error message would be emitted with the form:
1699
1700             The Content Security Policy directive 'script-src' contains 'form-action' as a source expression.
1701             Did you mean 'script-src ...; form-action...' (note the semicolon)?
1702
1703         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1704         (WebCore::isCSPDirectiveName): Return true if the specified directive name is "form-action".
1705
1706 2016-02-23  Simon Fraser  <simon.fraser@apple.com>
1707
1708         Lay the groundwork for more constness in StyleResolver-related code
1709         https://bugs.webkit.org/show_bug.cgi?id=154598
1710
1711         Reviewed by Antti Koivisto.
1712
1713         Make some of the leaf functions that are used by the style resolver take 
1714         const CSSValues, and use 'auto' more to automatically get const stack variables
1715         when appropriate.
1716
1717         * css/CSSBorderImageSliceValue.h:
1718         (WebCore::CSSBorderImageSliceValue::slices):
1719         * css/CSSPrimitiveValue.h:
1720         (WebCore::CSSPrimitiveValue::isQuirkValue):
1721         * css/FontVariantBuilder.cpp:
1722         (WebCore::extractFontVariantLigatures):
1723         (WebCore::extractFontVariantNumeric):
1724         (WebCore::extractFontVariantEastAsian):
1725         * css/FontVariantBuilder.h:
1726         * css/StyleBuilderConverter.h:
1727         (WebCore::StyleBuilderConverter::convertReflection):
1728         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
1729         * css/StyleBuilderCustom.h:
1730         (WebCore::StyleBuilderCustom::applyValueSize):
1731         (WebCore::StyleBuilderCustom::applyValueStroke):
1732         * css/StyleResolver.cpp:
1733         (WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement):
1734         (WebCore::StyleResolver::colorFromPrimitiveValue):
1735         (WebCore::StyleResolver::createFilterOperations):
1736         * css/StyleResolver.h:
1737         * css/TransformFunctions.cpp:
1738         (WebCore::transformsForValue):
1739         * css/TransformFunctions.h:
1740         * rendering/style/StylePendingImage.h:
1741         * svg/SVGLength.cpp:
1742         (WebCore::SVGLength::fromCSSPrimitiveValue):
1743         * svg/SVGLength.h:
1744
1745 2016-02-23  Manuel Rego Casasnovas  <rego@igalia.com>
1746
1747         [css-grid] Avoid duplicated calls to resolution code
1748         https://bugs.webkit.org/show_bug.cgi?id=154336
1749
1750         Reviewed by Sergio Villar Senin.
1751
1752         We were calling GridResolvedPosition::resolveGridPositionsFromStyle()
1753         several times per item.
1754
1755         We can store the GridCoordinates in
1756         RenderGrid::populateExplicitGridAndOrderIterator()
1757         and reuse them in the placement code.
1758         Once RenderGrid::placeItemsOnGrid() is over,
1759         all the items will have a definite position in both axis.
1760
1761         No new tests, no change of behavior.
1762
1763         * rendering/RenderGrid.cpp:
1764         (WebCore::RenderGrid::insertItemIntoGrid):
1765         (WebCore::RenderGrid::placeItemsOnGrid):
1766         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1767         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1768         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1769         (WebCore::RenderGrid::cachedGridCoordinate):
1770         (WebCore::RenderGrid::cachedGridSpan):
1771         * rendering/RenderGrid.h:
1772
1773 2016-02-23  Manuel Rego Casasnovas  <rego@igalia.com>
1774
1775         [css-grid] Rows track sizes are optional in grid-template shorthand
1776         https://bugs.webkit.org/show_bug.cgi?id=154586
1777
1778         Reviewed by Sergio Villar Senin.
1779
1780         You can omit the size of the rows in grid-template shorthand,
1781         even if you specify a named grid line for the end of the row,
1782         due to a change in the spec back in 2014:
1783         https://github.com/w3c/csswg-drafts/commit/9f660c4183c73c1f5279c46904dc6cb314f76194
1784
1785         Before if you want to specify a named grid line,
1786         you need to set the row size.
1787
1788         Update parsing, so it nows accepts things like:
1789             grid-template: 100px / "a" [bottom];
1790
1791         * css/CSSParser.cpp:
1792         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
1793         (WebCore::CSSParser::parseGridTemplateShorthand):
1794
1795 2016-02-23  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
1796
1797         [SVG] Update SVG source to return string literals as ASCIILiteral and add test cases for case sensitivity
1798         https://bugs.webkit.org/show_bug.cgi?id=154373
1799
1800         Reviewed by Youenn Fablet.
1801
1802         Update SVGAnimatedEnumeration toString method to return ASCIILiteral for string literals and add test cases for
1803         case-sensitivity for these elements.
1804
1805         Test: svg/dom/SVGAnimatedEnumeration-case-sensitive.html
1806
1807         * svg/SVGComponentTransferFunctionElement.h:
1808         (WebCore::SVGPropertyTraits<ComponentTransferType>::toString):
1809         * svg/SVGFEBlendElement.h:
1810         (WebCore::SVGPropertyTraits<BlendMode>::toString):
1811         * svg/SVGFEColorMatrixElement.h:
1812         (WebCore::SVGPropertyTraits<ColorMatrixType>::toString):
1813         * svg/SVGFECompositeElement.h:
1814         (WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
1815         * svg/SVGFEConvolveMatrixElement.h:
1816         (WebCore::SVGPropertyTraits<EdgeModeType>::toString):
1817         * svg/SVGFEDisplacementMapElement.h:
1818         (WebCore::SVGPropertyTraits<ChannelSelectorType>::toString):
1819         * svg/SVGFEMorphologyElement.h:
1820         (WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString):
1821         * svg/SVGFETurbulenceElement.h:
1822         (WebCore::SVGPropertyTraits<SVGStitchOptions>::toString):
1823         (WebCore::SVGPropertyTraits<TurbulenceType>::toString):
1824         * svg/SVGGradientElement.h:
1825         (WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString):
1826         * svg/SVGMarkerElement.h:
1827         (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
1828         * svg/SVGTextContentElement.h:
1829         (WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString):
1830         * svg/SVGTextPathElement.h:
1831         (WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString):
1832         (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
1833         * svg/SVGUnitTypes.h:
1834         (WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString):
1835
1836 2016-02-23  Csaba Osztrogonác  <ossy@webkit.org>
1837
1838         [Mac][cmake] Unreviewed speculative buildfix after r196779. Just for fun.
1839
1840         * PlatformMac.cmake:
1841
1842 2016-02-23  Antti Koivisto  <antti@apple.com>
1843
1844         Remove tab suspension code
1845         https://bugs.webkit.org/show_bug.cgi?id=154585
1846
1847         Reviewed by Andreas Kling.
1848
1849         It causes too many problems.
1850
1851         * page/Page.cpp:
1852         (WebCore::networkStateChanged):
1853         (WebCore::Page::Page):
1854         (WebCore::Page::setPageActivityState):
1855         (WebCore::Page::setIsVisible):
1856         (WebCore::Page::setIsVisibleInternal):
1857         (WebCore::Page::setIsPrerender):
1858         (WebCore::Page::setResourceUsageOverlayVisible):
1859         (WebCore::Page::canTabSuspend): Deleted.
1860         (WebCore::Page::setIsTabSuspended): Deleted.
1861         (WebCore::Page::setTabSuspensionEnabled): Deleted.
1862         (WebCore::Page::updateTabSuspensionState): Deleted.
1863         (WebCore::Page::tabSuspensionTimerFired): Deleted.
1864         * page/Page.h:
1865         (WebCore::Page::setEditable):
1866         (WebCore::Page::isEditable):
1867         (WebCore::Page::setShowAllPlugins):
1868
1869 2016-02-23  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1870
1871         Refactor DOM Iterator next signature
1872         https://bugs.webkit.org/show_bug.cgi?id=154531
1873
1874         Reviewed by Myles C. Maxfield.
1875
1876         Covered by existing tests.
1877
1878         * Modules/fetch/FetchHeaders.cpp:
1879         (WebCore::FetchHeaders::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
1880         * Modules/fetch/FetchHeaders.h:
1881         * bindings/js/JSKeyValueIterator.h: Using Optional<KeyValuePair> as returned iterator value.
1882         (WebCore::keyValueIteratorForEach):
1883         (WebCore::JSKeyValueIterator<JSWrapper>::next):
1884         * css/FontFaceSet.cpp:
1885         (WebCore::FontFaceSet::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
1886         * css/FontFaceSet.h:
1887
1888 2016-02-22  Gavin Barraclough  <barraclough@apple.com>
1889
1890         Some timer alignment cleanup.
1891         https://bugs.webkit.org/show_bug.cgi?id=154559
1892
1893         Reviewed by Chris Dumez.
1894
1895         Document shouldn't override Page's timer alignment policy with a lower alignment,
1896         and m_domTimerAlignmentInterval isn't really a Settings, it's just the current state
1897         for the page.
1898
1899         * dom/Document.cpp:
1900         (WebCore::Document::timerAlignmentInterval):
1901             - take the max of the possible intervals.
1902         * page/Page.cpp:
1903         (WebCore::Page::Page):
1904         (WebCore::Page::setTimerThrottlingEnabled):
1905         (WebCore::Page::setDOMTimerAlignmentInterval):
1906             - moved here from Settings.
1907         * page/Page.h:
1908         (WebCore::Page::domTimerAlignmentInterval):
1909             - moved here from Settings.
1910         * page/Settings.cpp:
1911         (WebCore::Settings::setDOMTimerAlignmentInterval): Deleted.
1912             - moved to Page.
1913         * page/Settings.h:
1914         (WebCore::Settings::domTimerAlignmentInterval): Deleted.
1915             - moved to Page.
1916
1917 2016-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
1918
1919         Font features specified in @font-face blocks don't apply to local() families
1920         https://bugs.webkit.org/show_bug.cgi?id=154554
1921
1922         Reviewed by Dean Jackson.
1923
1924         The correct variables just need to be wired up. In addition, our caches need to be sensitive
1925         to the new data.
1926
1927         Test: css3/font-feature-font-face-local.html
1928
1929         * css/CSSFontFaceSource.cpp:
1930         (WebCore::CSSFontFaceSource::font):
1931         * platform/graphics/FontCache.cpp:
1932         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
1933         (WebCore::FontPlatformDataCacheKey::operator==):
1934         (WebCore::FontPlatformDataCacheKeyHash::hash):
1935         (WebCore::FontCache::getCachedFontPlatformData):
1936         (WebCore::FontCache::fontForFamily):
1937         * platform/graphics/FontCache.h:
1938         * platform/graphics/FontFeatureSettings.h:
1939         (WebCore::FontFeature::operator!=):
1940         (WebCore::FontFeatureSettings::operator!=):
1941         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1942         (WebCore::fontWithFamily):
1943         (WebCore::FontCache::createFontPlatformData):
1944         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1945         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1946         * platform/graphics/mac/FontCacheMac.mm:
1947         (WebCore::FontCache::lastResortFallbackFont):
1948         * platform/text/TextFlags.h:
1949         (WebCore::FontVariantSettings::operator==):
1950         (WebCore::FontVariantSettings::operator!=):
1951         (WebCore::FontVariantSettings::uniqueValue):
1952
1953 2016-02-22  Daniel Bates  <dabates@apple.com>
1954
1955         REGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
1956         https://bugs.webkit.org/show_bug.cgi?id=154563
1957         <rdar://problem/24780678>
1958
1959         Reviewed by Alexey Proskuryakov.
1960
1961         Fixes an issue where the provisional loader may be deallocated when starting
1962         a load. One example where this can occur is when cancelling the provisional load
1963         as part of a form submission because the Content Security Policy of the page
1964         blocks the submission (it violates the directive form-action).
1965
1966         This crash is covered by the test http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html.
1967
1968         * loader/DocumentLoader.cpp:
1969         (WebCore::DocumentLoader::startLoadingMainResource): Take a ref before calling
1970         DocumentLoader::willSendRequest().
1971
1972 2016-02-16  Ada Chan  <adachan@apple.com>
1973
1974         Implement basic functionality in WebVideoFullscreenInterfaceMac.
1975         https://bugs.webkit.org/show_bug.cgi?id=153241
1976
1977         Reviewed by Beth Dakin.
1978
1979         * platform/cocoa/WebVideoFullscreenInterface.h:
1980         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1981         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1982         (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
1983         (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
1984         (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
1985         (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
1986         (WebCore::WebVideoFullscreenInterfaceMac::invalidate):
1987         (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
1988
1989 2016-02-22  Chris Dumez  <cdumez@apple.com>
1990
1991         REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
1992         https://bugs.webkit.org/show_bug.cgi?id=154547
1993         <rdar://problem/24772167>
1994
1995         Reviewed by Gavin Barraclough.
1996
1997         The Website was doing the following:
1998         $ var e = window.addEventListener;
1999         $ e("eventname", handler)
2000
2001         In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings
2002         implementation was caused with a thisValue which is a JSLexicalEnvironment
2003         and the implementation did not know how to convert it into a global object.
2004         The previous implementation on JSDOMWindow used to handle tis correctly
2005         because it was always calling JSValue::toThis() on the thisValue before
2006         trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis()
2007         gets the globalThisValue. This patch updates the EventTarget bindings
2008         code to call always call toThis() on the thisValue before trying to
2009         cast it. This should correctly deal with JSLexicalEnvironment and be a
2010         no-op in usual cases.
2011
2012         No new tests, extended existing test.
2013
2014         * bindings/scripts/CodeGeneratorJS.pm:
2015         (GenerateFunctionCastedThis):
2016
2017 2016-02-22  Simon Fraser  <simon.fraser@apple.com>
2018
2019         Repeated background images have the wrong position when using bottom/right-relative background-position
2020         https://bugs.webkit.org/show_bug.cgi?id=154478
2021
2022         Reviewed by Dave Hyatt.
2023
2024         Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
2025         painting repeated background images when right/bottom edges are used.
2026
2027         Also rename BackgroundEdgeOrigin to Edge
2028
2029         Test: fast/images/background-position.html
2030
2031         * css/CSSPrimitiveValueMappings.h:
2032         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2033         (WebCore::CSSPrimitiveValue::operator Edge):
2034         (WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
2035         * rendering/RenderBoxModelObject.cpp:
2036         (WebCore::resolveEdgeRelativeLength):
2037         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2038         * rendering/style/FillLayer.cpp:
2039         (WebCore::FillLayer::FillLayer):
2040         * rendering/style/FillLayer.h:
2041         (WebCore::FillLayer::backgroundXOrigin):
2042         (WebCore::FillLayer::backgroundYOrigin):
2043         (WebCore::FillLayer::setBackgroundXOrigin):
2044         (WebCore::FillLayer::setBackgroundYOrigin):
2045         * rendering/style/RenderStyleConstants.cpp:
2046         (WebCore::operator<<):
2047         * rendering/style/RenderStyleConstants.h:
2048
2049 2016-02-22  Commit Queue  <commit-queue@webkit.org>
2050
2051         Unreviewed, rolling out r196935.
2052         https://bugs.webkit.org/show_bug.cgi?id=154557
2053
2054         This change causes timeouts and crashes in LayoutTests
2055         (Requested by ryanhaddad on #webkit).
2056
2057         Reverted changeset:
2058
2059         "Enable AVFoundationNSURLSessionEnabled by default"
2060         https://bugs.webkit.org/show_bug.cgi?id=154469
2061         http://trac.webkit.org/changeset/196935
2062
2063 2016-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
2064
2065         [Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest of the class
2066         https://bugs.webkit.org/show_bug.cgi?id=153347
2067
2068         Reviewed by Antti Koivisto.
2069
2070         This patch implements the document.fonts Javascript object. It does so by briding the
2071         already-existing FontFaceSet Javascript object with the CSSFontSelector WebCore object.
2072         CSSFontSelector used to hold internal objects for each @font-face object in the
2073         Document. These objects have been moved into CSSFontFaceSet, so CSSFontSelector simply
2074         just owns an instance of a CSSFontFaceSet.
2075
2076         The lifetime of the FontFace and FontFaceSet objects is a little interesting: because
2077         all the ownership references are inside the WebCore CSSFontFace{,Set} objects, the
2078         higher-level Javascript FontFace{,Set} objects are held through a WeakPtr. This means
2079         that if all the references to these higher-level objects go away, and you re-query the
2080         document for its FontFace objects, you may get a new object (albeit with the same
2081         state as a previous object). However, this won't occur if there are any references to
2082         the old object, which means it is almost not observable.
2083
2084         This patch doesn't implement the relationship between the CSSOM and the FontFace
2085         objects. Changing one should result in a change in the other, but that will be
2086         implemented in a forthcoming patch.
2087
2088         This patch also doesn't alter the lifetime of the CSSFontSelector, which means that all
2089         the Document's fonts may be destroyed and recreated from CSS. There are a few things
2090         which can trigger this. A subsequent patch will make the CSSFontSelector outlive the
2091         Document.
2092
2093         This patch does implement (and test) the ability to add a new FontFace to the Document
2094         to cause a relayout, as well as changing properties of existing FontFace objects already
2095         in the Document to cause a relayout.
2096
2097         Test: fast/text/font-face-set-document.html
2098
2099         * Modules/fetch/FetchHeaders.cpp:
2100         (WebCore::FetchHeaders::Iterator::next): Pass an extra argument.
2101         * Modules/fetch/FetchHeaders.h:
2102         * bindings/js/JSKeyValueIterator.h: The ExecState is necessary to build an external
2103         wrapper from an existing CSSFontFace object.
2104         (WebCore::JSKeyValueIterator<JSWrapper>::next):
2105         * css/CSSFontFace.cpp:
2106         (WebCore::CSSFontFace::appendSources): Moved from CSSFontSelector.
2107         (WebCore::CSSFontFace::CSSFontFace):
2108         (WebCore::CSSFontFace::notifyClientsOfFontPropertyChange):
2109         (WebCore::CSSFontFace::setFamilies):
2110         (WebCore::CSSFontFace::calculateStyle): Shared code between CSSFontFaceSet and
2111         CSSFontFace.
2112         (WebCore::CSSFontFace::setStyle): Update to use calculateStyle().
2113         (WebCore::CSSFontFace::calculateWeight): Ditto.
2114         (WebCore::CSSFontFace::setWeight): Update to use caculateWeight().
2115         (WebCore::CSSFontFace::setUnicodeRange): Notify clients.
2116         (WebCore::CSSFontFace::setVariantLigatures): Ditto.
2117         (WebCore::CSSFontFace::setVariantPosition): Ditto.
2118         (WebCore::CSSFontFace::setVariantCaps): Ditto.
2119         (WebCore::CSSFontFace::setVariantNumeric): Ditto.
2120         (WebCore::CSSFontFace::setVariantAlternates): Ditto.
2121         (WebCore::CSSFontFace::setVariantEastAsian): Ditto.
2122         (WebCore::CSSFontFace::setFeatureSettings): Ditto.
2123         (WebCore::CSSFontFace::removeClient):
2124         (WebCore::CSSFontFace::wrapper): Build a new wrapper if one doesn't already
2125         exist. Note that this requires an ExecState to create a promise.
2126         (WebCore::CSSFontFace::setStatus):
2127         (WebCore::CSSFontFace::fontLoaded):
2128         (WebCore::CSSFontFace::pump):
2129         (WebCore::CSSFontFace::font):
2130         * css/CSSFontFace.h:
2131         * css/CSSFontFaceSet.cpp:
2132         (WebCore::CSSFontFaceSet::CSSFontFaceSet): Moved code from CSSFontSelector.
2133         (WebCore::CSSFontFaceSet::~CSSFontFaceSet):
2134         (WebCore::CSSFontFaceSet::addClient): This object can now have multiple
2135         clients.
2136         (WebCore::CSSFontFaceSet::removeClient):
2137         (WebCore::CSSFontFaceSet::incrementActiveCount): Update for multiple clients.
2138         (WebCore::CSSFontFaceSet::decrementActiveCount): Ditto.
2139         (WebCore::CSSFontFaceSet::hasFace):
2140         (WebCore::CSSFontFaceSet::registerLocalFontFacesForFamily): Moved from
2141         CSSFontSelector.
2142         (WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
2143         (WebCore::CSSFontFaceSet::addToFacesLookupTable): This helper function can
2144         be used when a property of a FontFace is changed.
2145         (WebCore::CSSFontFaceSet::add): Update to use addToFacesLookupTable().
2146         (WebCore::CSSFontFaceSet::removeFromFacesLookupTable): Same as
2147         addToFacesLookupTable().
2148         (WebCore::CSSFontFaceSet::remove): Update to use removeFromFacesLookupTable().
2149         (WebCore::CSSFontFaceSet::clear):
2150         (WebCore::CSSFontFaceSet::operator[]):
2151         (WebCore::computeFontTraitsMask): Moved from CSSFontSelector.
2152         (WebCore::CSSFontFaceSet::matchingFaces): Update to use new data structures.
2153         (WebCore::FontFaceComparator::FontFaceComparator): Moved from
2154         CSSFontSelector.
2155         (WebCore::FontFaceComparator::operator()):
2156         (WebCore::CSSFontFaceSet::getFontFace): Update to use new data structures.
2157         (WebCore::CSSFontFaceSet::fontStateChanged): Update to use multiple clients.
2158         (WebCore::CSSFontFaceSet::fontPropertyChanged): We must update our internal
2159         data structure if the family name changed.
2160         (WebCore::extractFamilies): Deleted.
2161         (WebCore::familiesIntersect): Deleted.
2162         (WebCore::CSSFontFaceSet::load): Deleted.
2163         (WebCore::CSSFontFaceSet::stateChanged): Deleted.
2164         * css/CSSFontFaceSet.h: Now needs to be RefCounted. New data structures are
2165         taken from CSSFontSelector.
2166         (WebCore::CSSFontFaceSetClient::faceFinished):
2167         (WebCore::CSSFontFaceSetClient::fontModified):
2168         (WebCore::CSSFontFaceSetClient::startedLoading):
2169         (WebCore::CSSFontFaceSetClient::completedLoading):
2170         * css/CSSFontFaceSource.h:
2171         * css/CSSFontSelector.cpp: Move code into CSSFontFaceSet.
2172         (WebCore::CSSFontSelector::CSSFontSelector):
2173         (WebCore::CSSFontSelector::~CSSFontSelector):
2174         (WebCore::CSSFontSelector::fontFaceSet):
2175         (WebCore::CSSFontSelector::isEmpty):
2176         (WebCore::CSSFontSelector::addFontFaceRule):
2177         (WebCore::CSSFontSelector::fontModified):
2178         (WebCore::CSSFontSelector::fontRangesForFamily):
2179         (WebCore::CSSFontSelector::clearDocument):
2180         (WebCore::CSSFontSelector::appendSources): Deleted.
2181         (WebCore::CSSFontSelector::familyNameFromPrimitive): Deleted.
2182         (WebCore::CSSFontSelector::registerLocalFontFacesForFamily): Deleted.
2183         (WebCore::FontFaceComparator::FontFaceComparator): Deleted.
2184         (WebCore::FontFaceComparator::operator()): Deleted.
2185         (WebCore::CSSFontSelector::getFontFace): Deleted.
2186         * css/CSSFontSelector.h:
2187         * css/CSSSegmentedFontFace.cpp:
2188         (WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
2189         * css/CSSSegmentedFontFace.h:
2190         * css/FontFace.cpp:
2191         (WebCore::FontFace::create):
2192         (WebCore::FontFace::FontFace):
2193         (WebCore::FontFace::createWeakPtr):
2194         (WebCore::FontFace::fontStateChanged):
2195         (WebCore::FontFace::stateChanged): Deleted.
2196         * css/FontFace.h:
2197         * css/FontFaceSet.cpp:
2198         (WebCore::FontFaceSet::create):
2199         (WebCore::FontFaceSet::FontFaceSet):
2200         (WebCore::FontFaceSet::~FontFaceSet):
2201         (WebCore::FontFaceSet::Iterator::next):
2202         (WebCore::FontFaceSet::has):
2203         (WebCore::FontFaceSet::size):
2204         (WebCore::FontFaceSet::add):
2205         (WebCore::FontFaceSet::remove):
2206         (WebCore::FontFaceSet::clear):
2207         (WebCore::FontFaceSet::load):
2208         (WebCore::FontFaceSet::check):
2209         (WebCore::FontFaceSet::status):
2210         (WebCore::FontFaceSet::canSuspendForDocumentSuspension):
2211         (WebCore::FontFaceSet::faceFinished):
2212         * css/FontFaceSet.h:
2213         * css/FontFaceSet.idl:
2214         * dom/Document.cpp:
2215         (WebCore::Document::fonts):
2216         * dom/Document.h:
2217         * dom/Document.idl:
2218         * svg/SVGFontFaceElement.h:
2219
2220 2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
2221
2222         [cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
2223         https://bugs.webkit.org/show_bug.cgi?id=154450
2224
2225         Reviewed by Alex Christensen.
2226
2227         No new tests needed.
2228
2229         * CMakeLists.txt:
2230
2231 2016-02-22  Konstantin Tokarev  <annulen@yandex.ru>
2232
2233         Workaround for ICE in GCC 4.8 appeared in r196846.
2234         https://bugs.webkit.org/show_bug.cgi?id=154535
2235
2236         Reviewed by Chris Dumez.
2237
2238         No new tests needed.
2239
2240         * html/HTMLFormElement.cpp:
2241         (WebCore::HTMLFormElement::autocomplete):
2242
2243 2016-02-22  Jer Noble  <jer.noble@apple.com>
2244
2245         Enable AVFoundationNSURLSessionEnabled by default
2246         https://bugs.webkit.org/show_bug.cgi?id=154469
2247
2248         Reviewed by Sam Weinig.
2249
2250         * page/Settings.cpp:
2251
2252 2016-02-22  Manuel Rego Casasnovas  <rego@igalia.com>
2253
2254         [css-grid] Swap columns and rows in grid-template shorthand
2255         https://bugs.webkit.org/show_bug.cgi?id=154472
2256
2257         Reviewed by Darin Adler.
2258
2259         The spec was modified past December to change the order of
2260         columns and rows in the grid-template shorthand:
2261         https://github.com/w3c/csswg-drafts/commit/f6c7691679a519017a80ebae44fd86c3eae5c5f9
2262
2263         Updated the parsing and modified the tests to follow the new syntax.
2264
2265         * css/CSSParser.cpp:
2266         (WebCore::CSSParser::parseGridTemplateColumns):
2267         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
2268         (WebCore::CSSParser::parseGridTemplateShorthand):
2269         (WebCore::CSSParser::parseGridTemplateRowsAndAreas): Renamed to
2270         parseGridTemplateRowsAndAreasAndColumns().
2271         * css/CSSParser.h:
2272
2273 2016-02-22  Manuel Rego Casasnovas  <rego@igalia.com>
2274
2275         [css-grid] Swap columns and rows in grid shorthand
2276         https://bugs.webkit.org/show_bug.cgi?id=154449
2277
2278         Reviewed by Darin Adler.
2279
2280         The spec was modified past December to change the order of
2281         columns and rows in the grid shorthand:
2282         https://github.com/w3c/csswg-drafts/commit/7454c7c8c5857b61bbbe2ee5f07803c264bf37e4
2283
2284         Updated the parsing and modified the tests to follow the new syntax.
2285
2286         * css/CSSParser.cpp:
2287         (WebCore::CSSParser::parseGridShorthand):
2288
2289 2016-02-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2290
2291         Binding generator should support key value iterable
2292         https://bugs.webkit.org/show_bug.cgi?id=154413
2293
2294         Reviewed by Darin Adler.
2295
2296         Covered by added layout and binding tests.
2297
2298         iterable<key, value> in a IDL file will trigger the generation of entries, keys, values, [Symbol.iterator] and forEach methods to the prototype.
2299         Updated FetchHeaders and FontFaceSet to use it.
2300
2301         IDLParser.pm parses the iterable<> and adds an iterable field in the interface containing the iterable information and objects for the five operations.
2302         IDLParser.pm is cleaned up a bit to remove previous Iterator support, which does not seem to be supported.
2303
2304         CodeGeneratorJS.pm is updated to generate the code for the five operations, using JSKeyValueIterator. Set iterators are not yet supported.
2305         Moved definition of Iterator Key and Value Type to binding generated JSXX class based on iterable<> declaration in the IDL.
2306
2307         Added binding test and Fetch Headers tests.
2308
2309         * CMakeLists.txt:
2310         * Modules/fetch/FetchHeaders.idl:
2311         * WebCore.xcodeproj/project.pbxproj:
2312         * bindings/js/JSBindingsAllInOne.cpp:
2313         * bindings/js/JSFetchHeadersCustom.cpp: Removed.
2314         * bindings/js/JSFontFaceSetCustom.cpp:
2315         (WebCore::JSFontFaceSet::ready): Removed iterable custom methods.
2316         * bindings/js/JSKeyValueIterator.h:
2317         (WebCore::createKeyValueIterator):
2318         (WebCore::keyValueIteratorForEach):
2319         * bindings/scripts/CodeGeneratorJS.pm:
2320         (GetFunctionName):
2321         (PrototypeFunctionCount):
2322         (PrototypePropertyCount):
2323         (GeneratePropertiesHashTable):
2324         (GenerateImplementation):
2325         (GenerateImplementationFunctionCall):
2326         (GenerateImplementationIterableFunctions):
2327         * bindings/scripts/IDLParser.pm:
2328         (parseOperationOrIterator):
2329         (parseOperationOrIteratorRest):
2330         (parseIterableRest):
2331         (parseOptionalIterableInterface):
2332         (applyMemberList):
2333         (parseSpecial): Deleted.
2334         * bindings/scripts/test/JS/JSTestObj.cpp:
2335         (WebCore::JSTestObjPrototype::finishCreation):
2336         (WebCore::jsTestObjPrototypeFunctionSymbolIterator):
2337         (WebCore::jsTestObjPrototypeFunctionEntries):
2338         (WebCore::jsTestObjPrototypeFunctionKeys):
2339         (WebCore::jsTestObjPrototypeFunctionValues):
2340         (WebCore::jsTestObjPrototypeFunctionForEach):
2341         * bindings/scripts/test/TestObj.idl:
2342         * css/FontFaceSet.idl:
2343
2344 2016-02-21  Chris Dumez  <cdumez@apple.com>
2345
2346         HTMLScriptElement.crossOrigin / HTMLImageElement.crossOrigin should only return known values
2347         https://bugs.webkit.org/show_bug.cgi?id=154502
2348
2349         Reviewed by Darin Adler.
2350
2351         HTMLScriptElement.crossOrigin / HTMLImageElement.crossOrigin should only
2352         return known values and should be nullable as per the specification:
2353         - https://html.spec.whatwg.org/multipage/scripting.html#attr-script-crossorigin
2354         - https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-crossorigin
2355         - https://html.spec.whatwg.org/multipage/infrastructure.html#cors-settings-attribute
2356
2357         This aligns our behavior with the HTML specification and Firefox.
2358
2359         No new tests, already covered by existing tests.
2360
2361         * bindings/scripts/CodeGeneratorJS.pm:
2362         Add support for nullable DOMString attributes. If such attribute is
2363         marked as nullable:
2364         - A null string is passed to the implementation if the setter is called
2365           with null/undefined.
2366         - null is returned to the Javascript if the getter implementation
2367           returns a null string.
2368
2369         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2370         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2371         * bindings/scripts/test/JS/JSTestObj.cpp:
2372         * bindings/scripts/test/ObjC/DOMTestObj.h:
2373         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2374         * bindings/scripts/test/TestObj.idl:
2375         Add test coverage for nullable DOMString attributes
2376         and rebaseline bindings tests.
2377
2378         * html/HTMLImageElement.cpp:
2379         * html/HTMLImageElement.h:
2380         * html/HTMLImageElement.idl:
2381         * html/HTMLScriptElement.cpp:
2382         * html/HTMLScriptElement.h:
2383         * html/HTMLScriptElement.idl:
2384         * html/parser/HTMLParserIdioms.cpp:
2385         * html/parser/HTMLParserIdioms.h:
2386
2387 2016-02-21  Chris Dumez  <cdumez@apple.com>
2388
2389         Make HTMLSelectElement.size behave as per the specification
2390         https://bugs.webkit.org/show_bug.cgi?id=154504
2391
2392         Reviewed by Darin Adler.
2393
2394         Make HTMLSelectElement.size behave as per the specification:
2395         - https://html.spec.whatwg.org/#htmlselectelement
2396         - https://html.spec.whatwg.org/#dom-select-size
2397         - https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes:idl-unsigned-long
2398
2399         In particular, it should be unsigned and be in the range [0; 2147483647].
2400
2401         Also update several unsigned long attributes in our HTML implementation to use
2402         parseHTMLNonNegativeInteger() to parse unsigned integers as per the HTML
2403         specification, instead of calling String::toUint().
2404
2405         No new tests, already covered by existing tests.
2406
2407         * html/HTMLInputElement.cpp:
2408         (WebCore::HTMLInputElement::parseAttribute):
2409         (WebCore::HTMLInputElement::size):
2410         (WebCore::HTMLInputElement::setSize):
2411         * html/HTMLInputElement.h:
2412         * html/HTMLSelectElement.cpp:
2413         (WebCore::HTMLSelectElement::parseAttribute):
2414         (WebCore::HTMLSelectElement::setSize):
2415         (WebCore::HTMLSelectElement::namedItem): Deleted.
2416         (WebCore::HTMLSelectElement::item): Deleted.
2417         * html/HTMLSelectElement.h:
2418         (WebCore::HTMLSelectElement::size):
2419         * html/HTMLSelectElement.idl:
2420         * html/HTMLTableColElement.cpp:
2421         (WebCore::HTMLTableColElement::parseAttribute):
2422         (WebCore::HTMLTableColElement::setSpan):
2423         * html/HTMLTextAreaElement.cpp:
2424         (WebCore::HTMLTextAreaElement::parseAttribute):
2425         (WebCore::HTMLTextAreaElement::setCols):
2426         (WebCore::HTMLTextAreaElement::setRows):
2427         * html/parser/HTMLParserIdioms.h:
2428         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2429         (WebCore::limitToOnlyHTMLNonNegative):
2430
2431 2016-02-21  Daniel Bates  <dabates@apple.com>
2432
2433         CSP: Enable form-action directive by default
2434         https://bugs.webkit.org/show_bug.cgi?id=154520
2435         <rdar://problem/24762029>
2436
2437         Reviewed by Sam Weinig.
2438
2439         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2440         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the form-action
2441         directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.
2442         (WebCore::isExperimentalDirectiveName): Remove form-action from the directives considered
2443         experimental.
2444
2445 2016-02-21  Chris Dumez  <cdumez@apple.com>
2446
2447         Add username / password attributes to HTMLAnchorElement / HTMLAreaElement
2448         https://bugs.webkit.org/show_bug.cgi?id=154519
2449
2450         Reviewed by Sam Weinig.
2451
2452         Add username / password attributes to HTMLAnchorElement / HTMLAreaElement as per:
2453         https://html.spec.whatwg.org/#htmlhyperlinkelementutils
2454
2455         Firefox and Chrome already implement these.
2456
2457         Also stop treating null as the empty string for the HTMLHyperlinkElementUtils
2458         attributes. This behavior does not match the specification or other browsers
2459         (tested Firefox and Chrome).
2460
2461         Test: fast/dom/HTMLAnchorElement/set-href-attribute-user-pass.html
2462
2463         * CMakeLists.txt:
2464         * DerivedSources.make:
2465         * WebCore.xcodeproj/project.pbxproj:
2466         * html/HTMLAnchorElement.cpp:
2467         (WebCore::HTMLAnchorElement::username):
2468         (WebCore::HTMLAnchorElement::setUsername):
2469         (WebCore::HTMLAnchorElement::password):
2470         (WebCore::HTMLAnchorElement::setPassword):
2471         * html/HTMLAnchorElement.h:
2472         * html/HTMLAnchorElement.idl:
2473         * html/HTMLAreaElement.idl:
2474         * html/HTMLHyperlinkElementUtils.idl: Added.
2475
2476 2016-02-21  Chris Dumez  <cdumez@apple.com>
2477
2478         iframe/frame/object.contentDocument should be on the prototype
2479         https://bugs.webkit.org/show_bug.cgi?id=154409
2480
2481         Reviewed by Sam Weinig.
2482
2483         Move iframe/frame/object.contentDocument to the prototype. They used
2484         to be on the instance due to the [CheckSecurityForNode] IDL extended
2485         attribute. This patch updates the bindings generator so that such
2486         attributes are now on the prototype. While they are now on the
2487         prototype, the security checks are still generated in the
2488         corresponding getters and setters so cross origin access is still
2489         prevented.
2490
2491         Test: http/tests/security/cross-origin-iframe-contentDocument.html
2492
2493         * bindings/scripts/CodeGeneratorJS.pm:
2494         (AttributeShouldBeOnInstance): Deleted.
2495
2496 2016-02-21  Darin Adler  <darin@apple.com>
2497
2498         Refactor LazyEventListener creation to separate Element and Document cases
2499         https://bugs.webkit.org/show_bug.cgi?id=154231
2500
2501         Reviewed by Andreas Kling.
2502
2503         * bindings/js/JSLazyEventListener.cpp:
2504         (WebCore::JSLazyEventListener::create): Added. Newly factored to separate
2505         Element, Document, and DOMWindow with overloading.
2506         (WebCore::JSLazyEventListener::createForNode): Deleted.
2507         (WebCore::JSLazyEventListener::createForDOMWindow): Deleted.
2508
2509         * bindings/js/JSLazyEventListener.h: Replaced the separate createForNode
2510         and createForDOMWindow functions with a single overloaded function create,
2511         which takes an Element, Document, or DOMWindow. Also changed indentation
2512         to match the style guide.
2513
2514         * dom/Attr.h: Added newly needed forward class declaration.
2515
2516         * dom/ContainerNode.cpp:
2517         (WebCore::ContainerNode::setAttributeEventListener): Deleted.
2518         * dom/ContainerNode.h: Deleted setAttributeEventListener override; it's now
2519         done separately by Element and Document.
2520
2521         * dom/Document.cpp:
2522         (WebCore::Document::setAttributeEventListener): Added. Makes the lazy event
2523         listener and calls through to the base class's setAttributeEventListener.
2524         (WebCore::Document::setWindowAttributeEventListener): Updated to call just
2525         create instead of createForDOMWindow.
2526
2527         * dom/Document.h: Removed some unneeded forward declarations. Added the
2528         overload for setAttributeEventListener. Removed a no longer useful comment.
2529
2530         * dom/Element.cpp:
2531         (WebCore::Element::setAttributeEventListener): Added. Makes the lazy event
2532         listener and calls through to the base class's setAttributeEventListener.
2533
2534         * dom/Element.h: Removed some unneeded forward declarations. Added the
2535         overload for setAttributeEventListener.
2536
2537         * dom/Node.h: Removed many unneeded forward declarations.
2538
2539         * dom/NodeRareData.h: Added one forward declaration.
2540
2541         * editing/Editor.h: Added one forward declaration.
2542
2543 2016-02-21  Daniel Bates  <dabates@apple.com>
2544
2545         CSP: Violation report should include column number
2546         https://bugs.webkit.org/show_bug.cgi?id=154418
2547         <rdar://problem/24729525>
2548
2549         Reviewed by Brent Fulgham.
2550
2551         Include column-number in the Content Security Policy violation report for the column number
2552         in the source script where the violation occurred (for a script violation) as per section
2553         Reporting of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2554
2555         When a CSP report is created for a script violation the source file and line number of the
2556         source code line where the violation occurred are included in the report. We now include
2557         the column number in the source file where the violation occurred so as to help narrow
2558         down the operation that triggered the violation in a complicated source code line.
2559
2560         * page/csp/ContentSecurityPolicy.cpp:
2561         (WebCore::ContentSecurityPolicy::reportViolation):
2562
2563 2016-02-21  Daniel Bates  <dabates@apple.com>
2564
2565         CSP: Violation report should include HTTP status code and effective-directive of protected resource
2566         https://bugs.webkit.org/show_bug.cgi?id=154288
2567         <rdar://problem/24674982>
2568         And
2569         https://bugs.webkit.org/show_bug.cgi?id=115707
2570         <rdar://problem/24383128>
2571
2572         Reviewed by Brent Fulgham.
2573
2574         Include status-code and effective-directive in the Content Security Policy violation report for
2575         the HTTP status code of the protected resource and name of the policy directive that was violated,
2576         respectively, as per section Reporting of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2577
2578         Test: http/tests/security/contentSecurityPolicy/report-status-code-zero-when-using-https.html
2579
2580         * page/csp/ContentSecurityPolicy.cpp:
2581         (WebCore::ContentSecurityPolicy::reportViolation): Add key status-code to the report with value
2582         equal to the HTTP response code for the document or 0 depending on whether the document was
2583         delivered over HTTP or not. Additionally, remove ENABLE(CSP_NEXT)-guard/experimentalFeaturesEnabled()-condition
2584         around code to include the effective-directive property in the report.
2585
2586 2016-02-21  Daniel Bates  <dabates@apple.com>
2587
2588         CSP: report-url directive should be ignored when contained in a policy defined via a meta element
2589         https://bugs.webkit.org/show_bug.cgi?id=154307
2590         <rdar://problem/24684817>
2591
2592         Reviewed by Brent Fulgham.
2593
2594         The Content Security Policy report-uri directive should only be honored when defined via an HTTP header
2595         as per section report-uri of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2596
2597         Currently we honor the report-uri directive when enforcing or monitoring a policy defined either via
2598         an HTML meta element or an HTTP header. Instead we should only honor this directive when defined
2599         via an HTTP header and log a message to the Web Inspector console to explain that the directive
2600         was ignored as suggested in <https://www.w3.org/TR/2015/CR-CSP2-20150721/#delivery-html-meta-element>.
2601
2602         Test: http/tests/security/contentSecurityPolicy/report-uri-in-meta-tag-ignored.html
2603
2604         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2605         (WebCore::ContentSecurityPolicyDirectiveList::parse): Modified to ignore the directive report-uri when
2606         the Content Security Policy came from an HTML meta element.
2607
2608 2016-02-21  Daniel Bates  <dabates@apple.com>
2609
2610         CSP: sandbox directive should be ignored when contained in a policy defined via a meta element
2611         https://bugs.webkit.org/show_bug.cgi?id=154299
2612         <rdar://problem/24680433>
2613
2614         Reviewed by Brent Fulgham.
2615
2616         The Content Security Policy sandbox directive should only be honored when enforcing a policy
2617         defined via an HTTP header as per section sandbox of the Content Security Policy 2.0 spec.,
2618         <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2619
2620         Currently we honor the sandbox directive when enforcing a policy defined either via an HTML
2621         meta element or an HTTP header. Instead we should only honor this directive when defined
2622         via an HTTP header and log a message to the Web Inspector console to explain that the directive
2623         was ignored as suggested in <https://www.w3.org/TR/2015/CR-CSP2-20150721/#delivery-html-meta-element>.
2624
2625         Tests: http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header2.php
2626                http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header-inherited-by-subframe.php
2627                http/tests/security/contentSecurityPolicy/sandbox-empty-in-http-header.php
2628                http/tests/security/contentSecurityPolicy/sandbox-in-meta-tag-ignored.html
2629
2630         * dom/Document.cpp:
2631         (WebCore::Document::processHttpEquiv): Substitute ContentSecurityPolicy::processHTTPEquiv() for
2632         ContentSecurityPolicy::didReceiveHeader() as the latter was made private.
2633         * page/csp/ContentSecurityPolicy.cpp:
2634         (WebCore::ContentSecurityPolicy::copyStateFrom): Updated as needed based on ContentSecurityPolicy::didReceiveHeader() change below.
2635         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
2636         (WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take argument of type ContentSecurityPolicy::PolicyFrom
2637         and pass it through to ContentSecurityPolicyDirectiveList::create().
2638         (WebCore::ContentSecurityPolicy::reportInvalidDirectiveInHTTPEquivMeta): Logs a message to the Web Inspector console
2639         that the specified directive was ignored because it was delivered via an HTML meta element.
2640         * page/csp/ContentSecurityPolicy.h: Made member function ContentSecurityPolicy::didReceiveHeader() private. Defined
2641         enum class PolicyFrom to represent the source of the Content Security Policy: HTTP equiv meta element, HTTP header, or
2642         inherited from another ContentSecurityPolicy object (this value is only used by ContentSecurityPolicy::copyStateFrom()).
2643         (WebCore::ContentSecurityPolicy::processHTTPEquiv): Added; turns around and calls ContentSecurityPolicy::didReceiveHeader().
2644         The name of this function better describes its purpose - to handle the processing of a Content Security Policy
2645         delivered via <meta http-equiv="Content-Security-Policy" content="...">.
2646         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2647         (WebCore::ContentSecurityPolicyDirectiveList::create): Modified to take argument of type ContentSecurityPolicy::PolicyFrom
2648         as pass it through to ContentSecurityPolicyDirectiveList::parse().
2649         (WebCore::ContentSecurityPolicyDirectiveList::parse): Modified to ignore the directive sandbox when the Content Security
2650         Policy came from an HTML meta element.
2651         * page/csp/ContentSecurityPolicyDirectiveList.h:
2652
2653 2016-02-21  Commit Queue  <commit-queue@webkit.org>
2654
2655         Unreviewed, rolling out r196866.
2656         https://bugs.webkit.org/show_bug.cgi?id=154515
2657
2658         still crashy on EFL/GTK (Requested by smfr on #webkit).
2659
2660         Reverted changeset:
2661
2662         "Wheel event callback removing the window causes crash in
2663         WebCore."
2664         https://bugs.webkit.org/show_bug.cgi?id=150871
2665         http://trac.webkit.org/changeset/196866
2666
2667 2016-02-20  Simon Fraser  <simon.fraser@apple.com>
2668
2669         Wheel event callback removing the window causes crash in WebCore.
2670         https://bugs.webkit.org/show_bug.cgi?id=150871
2671
2672         Reviewed by Brent Fulgham.
2673
2674         Null check the FrameView before using it, since the iframe may have been removed
2675         from its parent document inside the event handler.
2676
2677         The new test triggered a cross-load side-effect, where wheel event filtering wasn't
2678         reset between page loads. Fix by calling clearLatchedState() in EventHandler::clear(),
2679         which resets the filtering.
2680
2681         Test: fast/events/wheel-event-destroys-frame.html
2682
2683         * page/EventHandler.cpp:
2684         (WebCore::EventHandler::clear):
2685         (WebCore::EventHandler::clearLatchedState):
2686         * page/Frame.cpp:
2687         (WebCore::Frame::setView): If the view doesn't change (e.g. was and is null)
2688         don't bother clearing the event handler; should avoid EventHandler::clearLatchedState()
2689         from accessing a deleted MainFrame.
2690         * page/WheelEventDeltaFilter.cpp:
2691         (WebCore::WheelEventDeltaFilter::filteredDelta):
2692         * page/mac/EventHandlerMac.mm:
2693         (WebCore::EventHandler::platformCompleteWheelEvent):
2694         * rendering/RenderLayer.cpp:
2695         (WebCore::RenderLayer::scrollTo):
2696
2697 2016-02-20  Antti Koivisto  <antti@apple.com>
2698
2699         Resolve style iteratively
2700         https://bugs.webkit.org/show_bug.cgi?id=154355
2701
2702         Reviewed by Andreas Kling.
2703
2704         Instead of a set of recursive functions use ComposedTreeIterator for traversing the DOM
2705         tree in composed tree order.
2706
2707         This, along with maintaining explicit parent stack makes style resolve code more tractable
2708         for future work.
2709
2710         It also makes the ComposedTreeIterator the definite authority for the shape of the composed tree
2711         instead of duplicating it as a set of recursive style resolve functions. This eliminates
2712         a significant source of bugs and confusion.
2713
2714         The render tree building code path remains recursive for now.
2715
2716         * css/StyleInvalidationAnalysis.cpp:
2717         (WebCore::StyleInvalidationAnalysis::invalidateIfNeeded):
2718
2719             Invalidate the host element instead of the shadow root. This reduces need for special handling for shadow roots.
2720
2721         * dom/ComposedTreeIterator.cpp:
2722         (WebCore::ComposedTreeIterator::initializeContextStack):
2723         (WebCore::ComposedTreeIterator::dropAssertions):
2724
2725             Add support for dropping DOM mutation assertions.
2726
2727         (WebCore::ComposedTreeIterator::traverseShadowRoot):
2728         * dom/ComposedTreeIterator.h:
2729         (WebCore::ComposedTreeIterator::context):
2730         (WebCore::ComposedTreeIterator::current):
2731         * dom/PseudoElement.h:
2732         * style/StyleTreeResolver.cpp:
2733         (WebCore::Style::TreeResolver::TreeResolver):
2734         (WebCore::Style::TreeResolver::Scope::Scope):
2735         (WebCore::Style::TreeResolver::Parent::Parent):
2736         (WebCore::Style::TreeResolver::pushScope):
2737         (WebCore::Style::resetStyleForNonRenderedDescendants):
2738         (WebCore::Style::pseudoStyleCacheIsInvalid):
2739         (WebCore::Style::TreeResolver::resolveElement):
2740         (WebCore::Style::resolveTextNode):
2741         (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement):
2742         (WebCore::Style::TreeResolver::pushParent):
2743         (WebCore::Style::TreeResolver::popParent):
2744         (WebCore::Style::TreeResolver::popParentsToDepth):
2745
2746             Maintain explicit parent stack.
2747
2748         (WebCore::Style::TreeResolver::resolveComposedTree):
2749
2750             The main loop that iterates over the composed tree and computes style for dirty elements.
2751
2752         (WebCore::Style::TreeResolver::resolve):
2753         (WebCore::Style::detachRenderTree):
2754         (WebCore::Style::TreeResolver::resolveLocally): Deleted.
2755         (WebCore::Style::TreeResolver::resolveChildAtShadowBoundary): Deleted.
2756         (WebCore::Style::TreeResolver::resolveShadowTree): Deleted.
2757         (WebCore::Style::TreeResolver::resolveChildren): Deleted.
2758         (WebCore::Style::TreeResolver::resolveSlotAssignees): Deleted.
2759         (WebCore::Style::TreeResolver::resolveRecursively): Deleted.
2760
2761             Recursive functions go away.
2762
2763         * style/StyleTreeResolver.h:
2764         (WebCore::Style::TreeResolver::scope):
2765         (WebCore::Style::TreeResolver::parent):
2766
2767 2016-02-20  Andreas Kling  <akling@apple.com>
2768
2769         REGRESSION(r196780): Fake memory handler takes too long to run now.
2770
2771         Unreviewed bot fix.
2772
2773         Put the footprint comparison code behind a compile-time flag for now.
2774         It's taking too long to run on bots, and memory is getting measured
2775         before all the pressure relief code has a chance to run.
2776
2777         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2778         (WebCore::MemoryPressureHandler::install):
2779
2780 2016-02-20  Olivier Blin  <olivier.blin@softathome.com>
2781
2782         Do not require UDate in LocaleICU with !ENABLE_DATE_AND_TIME_INPUT_TYPES
2783         https://bugs.webkit.org/show_bug.cgi?id=154483
2784
2785         Reviewed by Michael Catanzaro.
2786
2787         Put initializeShortDateFormat(), dateFormat(), m_shortDateFormat and
2788         m_didCreateShortDateFormat under flag, since they are only used by
2789         code under the ENABLE_DATE_AND_TIME_INPUT_TYPES flag.
2790
2791         This helps to build with a light ICU that does not provide UDate
2792         features (with UCONFIG_NO_FORMATTING).
2793
2794         * platform/text/LocaleICU.cpp:
2795         (WebCore::LocaleICU::LocaleICU):
2796         (WebCore::LocaleICU::~LocaleICU):
2797         (WebCore::createFallbackMonthLabels): Deleted.
2798         (WebCore::createFallbackAMPMLabels): Deleted.
2799         * platform/text/LocaleICU.h:
2800
2801 2016-02-20  Olivier Blin  <olivier.blin@softathome.com>
2802
2803         Remove declaration of unimplemented methods in LocaleICU
2804         https://bugs.webkit.org/show_bug.cgi?id=154482
2805
2806         Reviewed by Michael Catanzaro.
2807
2808         detectSignAndGetDigitRange() and matchedDecimalSymbolIndex() are
2809         implemented in PlatformLocale, not LocaleICU.
2810
2811         They were moved out from LocaleICU to NumberLocalizer in r124459
2812         (2012), which has then been renamed as Localizer, then Locale, and
2813         finally PlatformLocale.
2814
2815         * platform/text/LocaleICU.h:
2816
2817 2016-02-20  Commit Queue  <commit-queue@webkit.org>
2818
2819         Unreviewed, rolling out r196837.
2820         https://bugs.webkit.org/show_bug.cgi?id=154495
2821
2822         It caused a lot of crashes in EFL and GTK bots (Requested by
2823         KaL on #webkit).
2824
2825         Reverted changeset:
2826
2827         "Wheel event callback removing the window causes crash in
2828         WebCore."
2829         https://bugs.webkit.org/show_bug.cgi?id=150871
2830         http://trac.webkit.org/changeset/196837
2831
2832 2016-02-19  Chris Dumez  <cdumez@apple.com>
2833
2834         Land release assertions to help track down a possible HTMLCollection lifetime bug
2835         https://bugs.webkit.org/show_bug.cgi?id=154490
2836
2837         Reviewed by Ryosuke Niwa.
2838
2839         Land release assertions to help track down a possible HTMLCollection
2840         lifetime bug: <rdar://problem/24457478>.
2841
2842         * bindings/js/JSHTMLCollectionCustom.cpp:
2843         (WebCore::JSHTMLCollection::getOwnPropertyNames):
2844         * html/HTMLCollection.cpp:
2845         (WebCore::HTMLCollection::HTMLCollection):
2846         (WebCore::HTMLCollection::~HTMLCollection):
2847         * html/HTMLCollection.h:
2848         (WebCore::HTMLCollection::wasDeletionStarted):
2849         * html/HTMLCollection.idl:
2850
2851 2016-02-19  Doug Russell  <d_russell@apple.com>
2852
2853         Bug 154366 - AX: AXObjectCache::visiblePositionForTextMarkerData() doesn't account for equivalent visibly equivalent positions
2854         https://bugs.webkit.org/show_bug.cgi?id=154366
2855
2856         Reviewed by Chris Fleizach.
2857
2858         Test: accessibility/mac/text-marker-line-boundary.html
2859
2860         * accessibility/AXObjectCache.cpp:
2861         (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
2862
2863 2016-02-19  Simon Fraser  <simon.fraser@apple.com>
2864
2865         Use more concrete types for parsing positions
2866         https://bugs.webkit.org/show_bug.cgi?id=154481
2867
2868         Reviewed by Dean Jackson.
2869
2870         Use CSSPrimitiveValues for position-parsing functions where possible, to avoid
2871         the need to downcast<> the values returned by the parsing functions.
2872
2873         * css/CSSParser.cpp:
2874         (WebCore::CSSParser::parseValue):
2875         (WebCore::CSSParser::parsePositionX):
2876         (WebCore::CSSParser::parsePositionY):
2877         (WebCore::CSSParser::parse4ValuesFillPosition):
2878         (WebCore::CSSParser::parse3ValuesFillPosition):
2879         (WebCore::CSSParser::parseFillPosition):
2880         (WebCore::CSSParser::parse2ValuesFillPosition):
2881         (WebCore::CSSParser::parseFillProperty):
2882         (WebCore::CSSParser::parseTransformOriginShorthand):
2883         (WebCore::CSSParser::parseBasicShapeCircle):
2884         (WebCore::CSSParser::parseBasicShapeEllipse):
2885         (WebCore::CSSParser::parseDeprecatedRadialGradient):
2886         (WebCore::CSSParser::parseRadialGradient):
2887         (WebCore::CSSParser::parseTransformOrigin):
2888         (WebCore::CSSParser::parsePerspectiveOrigin):
2889         * css/CSSParser.h:
2890
2891 2016-02-18  Gavin Barraclough  <barraclough@apple.com>
2892
2893         JSObject::getPropertySlot - index-as-propertyname, override on prototype, & shadow
2894         https://bugs.webkit.org/show_bug.cgi?id=154416
2895
2896         Reviewed by Geoff Garen.
2897
2898         * testing/Internals.cpp:
2899         (WebCore::Internals::isReadableStreamDisturbed):
2900             - fastGetOwnPropertySlot -> getOwnPropertySlot
2901               (internal method removed; test shouldn't really have been using this anyway)
2902
2903 2016-02-19  Chris Dumez  <cdumez@apple.com>
2904
2905         HTMLFormElement.autocomplete should only return known values
2906         https://bugs.webkit.org/show_bug.cgi?id=154247
2907         <rdar://problem/24658195>
2908
2909         Reviewed by Ryosuke Niwa.
2910
2911         Update HTMLFormElement.autocomplete to only return known values:
2912         - https://html.spec.whatwg.org/multipage/forms.html#dom-form-autocomplete
2913         - https://html.spec.whatwg.org/multipage/forms.html#attr-form-autocomplete
2914
2915         Also, update HTMLInputElement.autocomplete to fall back to using the form
2916         owner's autocomplete attribute ("on" or "off") when it's autocomplete
2917         attribute is omitted and the input element is wearing the "autofill
2918         expectation mantle" (i.e. the input is not hidden). If there is no
2919         form owner, the "on" value is used instead. This behavior is specified
2920         in:
2921         https://html.spec.whatwg.org/multipage/forms.html#autofilling-form-controls:-the-autocomplete-attribute:attr-fe-autocomplete-7
2922
2923         No new tests, already covered by existing tests.
2924
2925         * html/HTMLFormControlElement.cpp:
2926         (WebCore::HTMLFormControlElement::autocomplete):
2927         * html/HTMLFormElement.cpp:
2928         (WebCore::HTMLFormElement::setAutocomplete):
2929         (WebCore::HTMLFormElement::autocomplete):
2930         * html/HTMLFormElement.h:
2931         * html/HTMLFormElement.idl:
2932
2933 2016-02-19  Chris Dumez  <cdumez@apple.com>
2934
2935         Drop UnsafeVectorOverflow on ElementDescendantConstIterator::m_ancestorSiblingStack
2936         https://bugs.webkit.org/show_bug.cgi?id=154477
2937
2938         Reviewed by Ryosuke Niwa.
2939
2940         Drop UnsafeVectorOverflow on ElementDescendantConstIterator::m_ancestorSiblingStack to
2941         restore bounds checking.
2942
2943         Andreas already dropped in on ElementDescendantIterator::m_ancestorSiblingStack in
2944         r178253 but did not update the "Const" counterpart.
2945
2946         * dom/ElementDescendantIterator.h:
2947
2948 2016-02-19  Simon Fraser  <simon.fraser@apple.com>
2949
2950         Wheel event callback removing the window causes crash in WebCore.
2951         https://bugs.webkit.org/show_bug.cgi?id=150871
2952
2953         Reviewed by Brent Fulgham.
2954
2955         Null check the FrameView before using it, since the iframe may have been removed
2956         from its parent document inside the event handler.
2957         
2958         The new test triggered a cross-load side-effect, where wheel event filtering wasn't
2959         reset between page loads. Fix by calling clearLatchedState() in EventHandler::clear(),
2960         which resets the filtering.
2961
2962         Test: fast/events/wheel-event-destroys-frame.html
2963
2964         * page/EventHandler.cpp:
2965         (WebCore::EventHandler::clear):
2966         * page/WheelEventDeltaFilter.cpp:
2967         (WebCore::WheelEventDeltaFilter::filteredDelta):
2968         * page/mac/EventHandlerMac.mm:
2969         (WebCore::EventHandler::platformCompleteWheelEvent):
2970         * rendering/RenderLayer.cpp:
2971         (WebCore::RenderLayer::scrollTo):
2972
2973 2016-02-19  Myles C. Maxfield  <mmaxfield@apple.com>
2974
2975         [Win] [SVG -> OTF Converter] All uses of a font except the first one are invisible
2976         https://bugs.webkit.org/show_bug.cgi?id=154465
2977
2978         Reviewed by Alex Christensen.
2979
2980         We should re-use the existing converted data if it exists.
2981
2982         Covered by existing tests.
2983
2984         * css/CSSFontFaceSource.cpp:
2985         (WebCore::CSSFontFaceSource::font):
2986
2987 2016-02-19  Antti Koivisto  <antti@apple.com>
2988
2989         ComposedTreeIterator traverses normal children for elements with empty shadow root
2990         https://bugs.webkit.org/show_bug.cgi?id=154464
2991
2992         Reviewed by Ryosuke Niwa.
2993
2994         Test: fast/shadow-dom/composed-tree-basic.html
2995
2996         * dom/ComposedTreeIterator.cpp:
2997         (WebCore::ComposedTreeIterator::initializeContextStack):
2998         (WebCore::ComposedTreeIterator::traverseShadowRoot):
2999
3000             If the shadow root is empty continue by skipping the real children.
3001
3002         (WebCore::ComposedTreeIterator::traverseNextInShadowTree):
3003         (WebCore::composedTreeAsText):
3004         (WebCore::ComposedTreeIterator::pushContext): Deleted.
3005         * dom/ComposedTreeIterator.h:
3006         (WebCore::ComposedTreeIterator::context):
3007         (WebCore::ComposedTreeIterator::current):
3008         (WebCore::ComposedTreeIterator::traverseNext):
3009         (WebCore::composedTreeChildren):
3010         * testing/Internals.cpp:
3011         (WebCore::Internals::composedTreeAsText):
3012
3013             Testing support.
3014
3015         * testing/Internals.h:
3016         * testing/Internals.idl:
3017
3018 2016-02-19  Jer Noble  <jer.noble@apple.com>
3019
3020         Adopt CachedRawResourceClient::shouldCacheResponse() in MediaResourceLoader and WebCoreNSURLSession
3021         https://bugs.webkit.org/show_bug.cgi?id=154466
3022
3023         Reviewed by Alex Christensen.
3024
3025         Adopt the new shouldCacheResponse() callback so that byte-range
3026         requests generated by WebCoreNSURLSession are not cached.
3027
3028         * loader/MediaResourceLoader.cpp:
3029         (WebCore::MediaResource::shouldCacheResponse):
3030         * loader/MediaResourceLoader.h:
3031         * platform/graphics/PlatformMediaResourceLoader.h:
3032         (WebCore::PlatformMediaResourceClient::shouldCacheResponse):
3033         * platform/network/cocoa/WebCoreNSURLSession.mm:
3034         (-[WebCoreNSURLSession downloadTaskWithRequest:]):
3035         (-[WebCoreNSURLSession streamTaskWithHostName:port:]):
3036         (-[WebCoreNSURLSession streamTaskWithNetService:]):
3037         (-[WebCoreNSURLSessionDataTask _timingData]):
3038         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]):
3039
3040 2016-02-12  Jer Noble  <jer.noble@apple.com>
3041
3042         [Mac] CORS-compliant videos throw security errors when painting to Canvas
3043         https://bugs.webkit.org/show_bug.cgi?id=154188
3044         <rdar://problem/22959556>
3045
3046         Reviewed by Alex Christensen.
3047
3048         Pass the CORS access check results from WebCoreNSURLSession to it's client,
3049         MediaPlayerPrivateAVFoundationObjC.
3050
3051         * WebCore.xcodeproj/project.pbxproj:
3052         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3053         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3054         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Ask the WebCoreNSURLSession.
3055         * platform/network/cocoa/WebCoreNSURLSession.h:
3056         * platform/network/cocoa/WebCoreNSURLSession.mm:
3057         (-[WebCoreNSURLSession task:didReceiveCORSAccessCheckResult:]): Conditionally set _corsResults.
3058         (-[WebCoreNSURLSession didPassCORSAccessChecks]): Return _corsResults.
3059         (WebCoreNSURLSessionDataTaskClient::accessControlCheckFailed): Call -resource:accessControlCheckFailedWithError:.
3060         (WebCoreNSURLSessionDataTaskClient::loadFailed): Call -resource:loadFailedWithError:.
3061         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Set _response within the delegate queue.
3062         (-[WebCoreNSURLSessionDataTask _resource:loadFinishedWithError:]): Renamed from resourceFinished:
3063         (-[WebCoreNSURLSessionDataTask resource:accessControlCheckFailedWithError:]): Ditto.
3064         (-[WebCoreNSURLSessionDataTask resource:loadFailedWithError:]): Ditto.
3065         (-[WebCoreNSURLSessionDataTask resourceFinished:]): Ditto.
3066
3067 2016-02-19  Chris Dumez  <cdumez@apple.com>
3068
3069         Unreviewed build fix.
3070
3071         * loader/cocoa/SubresourceLoaderCocoa.mm:
3072         (WebCore::SubresourceLoader::willCacheResponse):
3073
3074 2016-02-19  Nan Wang  <n_wang@apple.com>
3075
3076         AX: Inconsistency between CharacterOffset and VisiblePostition
3077         https://bugs.webkit.org/show_bug.cgi?id=154431
3078
3079         Reviewed by Chris Fleizach.
3080
3081         VoiceOver is not getting the correct text marker from VisiblePostition when
3082         navigating using arrow keys. We should make the CharacterOffset behavior consistent
3083         with VisiblePosition so that the conversion between the two won't create different
3084         text markers.
3085         
3086         Changes are covered in the modified tests.
3087
3088         * accessibility/AXObjectCache.cpp:
3089         (WebCore::AXObjectCache::characterOffsetForTextMarkerData):
3090         (WebCore::AXObjectCache::traverseToOffsetInRange):
3091         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
3092         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
3093         (WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
3094         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
3095         (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
3096         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
3097         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
3098         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
3099         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
3100         (WebCore::AXObjectCache::nextCharacterOffset):
3101         (WebCore::AXObjectCache::previousCharacterOffset):
3102         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
3103         (WebCore::AXObjectCache::endCharacterOffsetOfWord):
3104         (WebCore::AXObjectCache::previousWordStartCharacterOffset):
3105         (WebCore::AXObjectCache::previousParagraphStartCharacterOffset):
3106         (WebCore::AXObjectCache::previousSentenceStartCharacterOffset):
3107         * accessibility/AXObjectCache.h:
3108         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3109         (-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:]):
3110
3111 2016-02-19  Jer Noble  <jer.noble@apple.com>
3112
3113         Allow CachedRawResource clients to opt out of caching on a per-response basis
3114         https://bugs.webkit.org/show_bug.cgi?id=154453
3115
3116         Reviewed by Brady Eidson.
3117
3118         For CF or NS networking clients, the system loader will ask whether the client (the
3119         SubResourceLoader in this case) wants the response to be cached. This breaks for byte
3120         range requests due to <rdar://problem/20001985>. Allow the SubresourceLoader to query
3121         its clients, and return null, if they opt out.
3122
3123         * loader/cache/CachedRawResource.cpp:
3124         (WebCore::CachedRawResource::shouldCacheResponse):
3125         * loader/cache/CachedRawResource.h:
3126         * loader/cache/CachedRawResourceClient.h:
3127         (WebCore::CachedRawResourceClient::shouldCacheResponse):
3128         * loader/cache/CachedResource.h:
3129         (WebCore::CachedResource::shouldCacheResponse):
3130         * loader/cocoa/SubresourceLoaderCocoa.mm:
3131         (WebCore::SubresourceLoader::willCacheResponse):
3132
3133 2016-02-19  Zalan Bujtas  <zalan@apple.com>
3134
3135         Blocked plug-in placeholder is sometimes not shown.
3136         https://bugs.webkit.org/show_bug.cgi?id=154434
3137         <rdar://problem/22584973>
3138
3139         Reviewed by Brent Fulgham.
3140
3141         m_isUnavailablePluginIndicatorHidden was set to false incorrectly as initial value.
3142         It prevented RenderEmbeddedObject from issuing repaint when the plugin indicator
3143         was set to visible (m_isUnavailablePluginIndicatorHidden <- false) the first time.
3144         (The reason why the indicator showed up most of the time was because some renderer
3145         triggered repaint on the view.)
3146
3147         Unable to test.
3148
3149         * rendering/RenderEmbeddedObject.cpp:
3150         (WebCore::RenderEmbeddedObject::setUnavailablePluginIndicatorIsHidden):
3151         (WebCore::RenderEmbeddedObject::RenderEmbeddedObject): Deleted.
3152         (WebCore::RenderEmbeddedObject::setUnavailablePluginIndicatorIsPressed): Deleted.
3153         * rendering/RenderEmbeddedObject.h:
3154         (WebCore::RenderEmbeddedObject::showsUnavailablePluginIndicator):
3155
3156 2016-02-19  Csaba Osztrogonác  <ossy@webkit.org>
3157
3158         Fix pessimizing-move warnings
3159         https://bugs.webkit.org/show_bug.cgi?id=154395
3160
3161         Reviewed by Michael Catanzaro.
3162
3163         * platform/graphics/efl/CairoUtilitiesEfl.cpp:
3164         (WebCore::evasObjectFromCairoImageSurface):
3165         * platform/graphics/surfaces/GLTransportSurface.cpp:
3166         (WebCore::GLTransportSurface::createTransportSurface):
3167         (WebCore::GLTransportSurfaceClient::createTransportSurfaceClient):
3168
3169 2016-02-19  Philippe Normand  <pnormand@igalia.com>
3170
3171         [GStreamer] clean-up various leaks
3172         https://bugs.webkit.org/show_bug.cgi?id=154285
3173
3174         Reviewed by Carlos Garcia Campos.
3175
3176         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
3177         (webkit_web_audio_src_init): Take full ownership of the GstTask.
3178         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
3179         (WTF::adoptGRef): Null pointer support in ASSERTs.
3180         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3181         (WebCore::initializeGStreamerAndRegisterWebKitElements): Take full ownership of the GstElementFactory pointers.
3182         (WebCore::MediaPlayerPrivateGStreamer::isAvailable): Ditto.
3183
3184 2016-02-18  Andy Estes  <aestes@apple.com>
3185
3186         Revert to dispatching the popstate event synchronously
3187         https://bugs.webkit.org/show_bug.cgi?id=153297
3188         rdar://problem/24092294
3189
3190         Reviewed by Brent Fulgham.
3191
3192         r192369 made the popstate event dispatch asynchronously, which matches what the HTML5 spec says to do. However,
3193         due to compatibility regressions we need to revert back to dispatching synchronously. This change reverts
3194         r192369's changes to Document.cpp, but retains the new tests.
3195
3196         Firing popstate synchronously makes both fast/loader/remove-iframe-during-history-navigation-different.html and
3197         fast/loader/remove-iframe-during-history-navigation-same.html crash, because their onpopstate handlers remove
3198         frames from the document that will later be accessed by HistoryController::recursiveGoToItem().
3199
3200         To prevent the crashes, this change does two things:
3201         1. Keep a reference to the current frame inside FrameLoader::loadSameDocumentItem(), since calling
3202            loadInSameDocument() might otherwise delete it.
3203         2. Handle a null frame when iterating a HistoryItem's child frames in HistoryController::recursiveGoToItem(),
3204            since calling goToItem() on one frame might cause another frame to be deleted.
3205
3206         Covered by existing tests. fast/loader/stateobjects/popstate-is-asynchronous.html was renamed to
3207         fast/loader/stateobjects/popstate-is-synchronous.html and modified to expect synchronous dispatch.
3208
3209         * dom/Document.cpp:
3210         (WebCore::Document::enqueuePopstateEvent):
3211         * loader/FrameLoader.cpp:
3212         (WebCore::FrameLoader::loadSameDocumentItem):
3213         * loader/HistoryController.cpp:
3214         (WebCore::HistoryController::recursiveGoToItem):
3215
3216 2016-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3217
3218         Unreviewed. Fix GObject DOM bindings API break after r196769.
3219
3220         * html/HTMLTextAreaElement.idl:
3221
3222 2016-02-18  Gwang Yoon Hwang  <yoon@igalia.com>
3223
3224         [GTK] Limit the number of tiles according to the visible area
3225         https://bugs.webkit.org/show_bug.cgi?id=126122
3226
3227         Reviewed by Carlos Garcia Campos.
3228
3229         TextureMapperTiledBackingStore creates tiles for whole layer bounds, which
3230         means it creates the huge amount of textures if there is an excessively big
3231         layer.  Not only it wastes the memory and the CPU time, it even can crash GPU
3232         drivers.
3233
3234         This patch modifies TextureMapperTiledBackingStore to take into account the
3235         visible area with a coverage multiplier when creating tiles.
3236
3237         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3238         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
3239         Set a flag to recalculate the visible area of the layer when there are
3240         geometric changes.
3241         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
3242         (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly):
3243         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
3244         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
3245         (WebCore::GraphicsLayerTextureMapper::markVisibleRectAsDirty):
3246         (WebCore::GraphicsLayerTextureMapper::selfOrAncestorHasActiveTransformAnimation):
3247         (WebCore::GraphicsLayerTextureMapper::computeTransformedVisibleRect):
3248         Compute the inverse transform matrix to map a global visible are to
3249         the local visible area.
3250         (WebCore::clampToContentsRectIfRectIsInfinite):
3251         (WebCore::GraphicsLayerTextureMapper::transformedVisibleRect):
3252         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
3253         (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
3254         In HiDPI, the directly composited image is uploaded to the unscaled
3255         texture to reduce memory usages. So we should apply device scale
3256         factor to render it correctly.
3257         (WebCore::TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded):
3258         Create tiles which covered by visible rect with a coverage multiplier.
3259
3260 2016-02-18  Brent Fulgham  <bfulgham@apple.com>
3261
3262         Extend HashCountedSet with a method to efficiently set the count of an entry
3263         https://bugs.webkit.org/show_bug.cgi?id=154352
3264
3265         Reviewed by Geoffrey Garen.
3266
3267         Tested by new TestWebKitAPI tests.
3268
3269         * loader/ResourceLoadStatistics.cpp:
3270         (WebCore::decodeHashCountedSet): Update to use new HashCountedSet::add method.
3271
3272 2016-02-18  Commit Queue  <commit-queue@webkit.org>
3273
3274         Unreviewed, rolling out r196790.
3275         https://bugs.webkit.org/show_bug.cgi?id=154439
3276
3277         made fast/events/wheelevent-basic-actual.txt fail in WK2
3278         (Requested by alexchristensen on #webkit).
3279
3280         Reverted changeset:
3281
3282         "Wheel event callback removing the window causes crash in
3283         WebCore."
3284         https://bugs.webkit.org/show_bug.cgi?id=150871
3285         http://trac.webkit.org/changeset/196790
3286
3287 2016-02-18  Commit Queue  <commit-queue@webkit.org>
3288
3289         Unreviewed, rolling out r196791.
3290         https://bugs.webkit.org/show_bug.cgi?id=154438
3291
3292         broke windows build (Requested by alexchristensen on #webkit).
3293
3294         Reverted changeset:
3295
3296         "Extend HashCountedSet with a method to efficiently set the
3297         count of an entry"
3298         https://bugs.webkit.org/show_bug.cgi?id=154352
3299         http://trac.webkit.org/changeset/196791
3300
3301 2016-02-18  Chris Dumez  <cdumez@apple.com>
3302
3303         window.history / window.navigator should not be replaceable
3304         https://bugs.webkit.org/show_bug.cgi?id=154412
3305
3306         Reviewed by Ryosuke Niwa.
3307
3308         window.history / window.navigator should not be replaceable as per
3309         the latest HTML specification:
3310         https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
3311
3312         Firefox and Chrome already match the specification. This patch aligns
3313         our behavior.
3314
3315         No new tests, already covered by existing tests.
3316
3317         * page/DOMWindow.idl:
3318
3319 2016-02-18  Chris Dumez  <cdumez@apple.com>
3320
3321         HTMLTableHeaderCellElement.scope should only return known values
3322         https://bugs.webkit.org/show_bug.cgi?id=154423
3323         <rdar://problem/24731018>
3324
3325         Reviewed by Ryosuke Niwa.
3326
3327         HTMLTableHeaderCellElement.scope should only return known values as per:
3328         - https://html.spec.whatwg.org/multipage/tables.html#dom-th-scope
3329
3330         Known values are document here:
3331         - https://html.spec.whatwg.org/multipage/tables.html#attr-th-scope
3332
3333         No new tests, already covered by existing test.
3334
3335         * CMakeLists.txt:
3336         * WebCore.vcxproj/WebCore.vcxproj:
3337         * WebCore.vcxproj/WebCore.vcxproj.filters:
3338         * WebCore.xcodeproj/project.pbxproj:
3339         * html/HTMLElementsAllInOne.cpp:
3340         * html/HTMLTableHeaderCellElement.cpp: Copied from Source/WebCore/html/HTMLTableHeaderCellElement.h.
3341         (WebCore::HTMLTableHeaderCellElement::scope):
3342         (WebCore::HTMLTableHeaderCellElement::setScope):
3343         * html/HTMLTableHeaderCellElement.h:
3344         * html/HTMLTableHeaderCellElement.idl:
3345
3346 2016-02-18  Brent Fulgham  <bfulgham@apple.com>
3347
3348         Extend HashCountedSet with a method to efficiently set the count of an entry
3349         https://bugs.webkit.org/show_bug.cgi?id=154352
3350
3351         Reviewed by Geoffrey Garen.
3352
3353         Tested by new TestWebKitAPI tests.
3354
3355         * loader/ResourceLoadStatistics.cpp:
3356         (WebCore::decodeHashCountedSet): Update to use new HashCountedSet::add method.
3357
3358 2016-02-18  Simon Fraser  <simon.fraser@apple.com>
3359
3360         Wheel event callback removing the window causes crash in WebCore.
3361         https://bugs.webkit.org/show_bug.cgi?id=150871
3362
3363         Reviewed by Brent Fulgham.
3364         
3365         Null check the FrameView before using it, since the iframe may have been removed
3366         from its parent document inside the event handler.
3367
3368         Test: fast/events/wheel-event-destroys-frame.html
3369
3370         * page/mac/EventHandlerMac.mm:
3371         (WebCore::EventHandler::platformCompleteWheelEvent):
3372
3373 2016-02-18  Brady Eidson  <beidson@apple.com>
3374
3375         Modern IDB: Fix IDBGetResult encoder/decoder.
3376         https://bugs.webkit.org/show_bug.cgi?id=154421
3377
3378         Reviewed by Alex Christensen.
3379
3380         No new tests, as Modern IDB is still disabled for WK2.
3381         
3382         But if you manually enable it, "Basic IndexedDB Seems To Work"
3383
3384         * Modules/indexeddb/IDBGetResult.h:
3385         (WebCore::IDBGetResult::encode):
3386         (WebCore::IDBGetResult::decode):
3387
3388 2016-02-18  Myles C. Maxfield  <mmaxfield@apple.com>
3389
3390         Addressing post-review comments after r196747.
3391
3392         Unreviewed.
3393
3394         * css/CSSFontFaceSet.h:
3395         * css/FontFaceSet.cpp:
3396         (WebCore::FontFaceSet::size):
3397         (WebCore::FontFaceSet::clear):
3398         * css/FontFaceSet.h:
3399
3400 2016-02-18  Zalan Bujtas  <zalan@apple.com>
3401
3402         Soft hyphen is not shown when it is placed at the end of an inline element
3403         https://bugs.webkit.org/show_bug.cgi?id=153980
3404
3405         Reviewed by David Hyatt.
3406
3407         This patch handles the case when the character at the breaking position does not fit the
3408         line and soft-hyphen, as the first breaking opportunity, is followed by this overflowing character.
3409         (foo&shy;bar where b overflows the line).
3410         In such cases we don't yet have an item in the breaking history so we need to take a look at
3411         the current context instead.    
3412
3413         Test: fast/text/soft-hyphen-as-first-breaking-opportunity.html
3414
3415         * rendering/line/BreakingContext.h:
3416         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
3417         (WebCore::BreakingContext::handleText):
3418
3419 2016-02-18  Andreas Kling  <akling@apple.com>
3420
3421         Fake memory pressure handler should log detailed memory breakdown.
3422         <https://webkit.org/b/154415>
3423
3424         Reviewed by Antti Koivisto.
3425
3426         Piggyback on the RESOURCE_USAGE code to implement some detailed memory footprint diffing
3427         and have the fake memory handler dump before/after/diff after it runs.
3428
3429         * page/ResourceUsageThread.h:
3430         (WebCore::TagInfo::TagInfo):
3431         * page/cocoa/ResourceUsageThreadCocoa.mm:
3432         (WebCore::logFootprintComparison):
3433         (WebCore::displayNameForVMTag):
3434         (WebCore::pagesPerVMTag):
3435         (WebCore::TagInfo::TagInfo): Deleted.
3436         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3437         (WebCore::MemoryPressureHandler::install):
3438
3439 2016-02-18  Brady Eidson  <beidson@apple.com>
3440
3441         Modern IDB: Implement server->client operations in WK2.
3442         https://bugs.webkit.org/show_bug.cgi?id=154411
3443
3444         Reviewed by Alex Christensen.
3445
3446         No change in behavior yet; Just laying the groundwork.
3447     
3448         * Modules/indexeddb/client/IDBConnectionToServer.h:
3449         * Modules/indexeddb/server/IDBServer.h:
3450         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3451         (WebCore::IDBTransactionInfo::encode):
3452         (WebCore::IDBTransactionInfo::decode):
3453
3454 2016-02-18  Csaba Osztrogonác  <ossy@webkit.org>
3455
3456         Fix unused-const-variable warning on non Cocoa platforms
3457         https://bugs.webkit.org/show_bug.cgi?id=154394
3458
3459         Reviewed by Michael Catanzaro.
3460
3461         * html/HTMLPlugInImageElement.cpp:
3462
3463 2016-02-18  Brady Eidson  <beidson@apple.com>
3464
3465         Modern IDB: Implement client->server operations in WK2.
3466         https://bugs.webkit.org/show_bug.cgi?id=154400
3467
3468         Reviewed by Alex Christensen.
3469
3470         No change in behavior yet; Just laying the groundwork.
3471
3472         * Modules/indexeddb/server/IDBServer.h:
3473         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3474         * Modules/indexeddb/shared/IDBIndexInfo.h:
3475         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3476
3477 2016-02-18  Chris Dumez  <cdumez@apple.com>
3478
3479         [Unforgeable] operations should not be writable as per Web IDL
3480         https://bugs.webkit.org/show_bug.cgi?id=154396
3481         <rdar://problem/24721063>
3482
3483         Reviewed by Ryosuke Niwa.
3484
3485         [Unforgeable] operations should not be writable as per the Web IDL specification:
3486         http://heycam.github.io/webidl/#es-operations
3487
3488         They were currently non-configurable in WebKit but still writable.
3489
3490         No new tests, already covered by existing test.
3491
3492         * bindings/scripts/CodeGeneratorJS.pm:
3493         Mark [Unforgeable] operations as ReadOnly.
3494
3495         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3496         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3497         * bindings/scripts/test/JS/JSTestObj.cpp:
3498         * bindings/scripts/test/ObjC/DOMTestObj.h:
3499         * bindings/scripts/test/ObjC/DOMTestObj.mm:
3500         * bindings/scripts/test/TestObj.idl:
3501         Add bindings test coverage for [Unforgeable].
3502
3503 2016-02-18  Chris Dumez  <cdumez@apple.com>
3504
3505         Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
3506         https://bugs.webkit.org/show_bug.cgi?id=154398
3507
3508         Reviewed by Ryosuke Niwa.
3509
3510         Fix behavior of reflecting unsigned long IDL attributes that are limited
3511         to only non-negative numbers greater than zero to comply with:
3512         - https://html.spec.whatwg.org/#limited-to-only-non-negative-numbers-greater-than-zero
3513
3514         This patch updates the following IDL attributes:
3515         - colgroup.span
3516         - col.span
3517         - input.size
3518         - textarea.cols
3519         - textareal.rows
3520
3521         All of them now:
3522         - Have "unsigned long" type on IDL size and "unsigned" type on native
3523           side.
3524         - On getting, return the value if it is in the range [1; 2147483647],
3525           otherwise return the default value.
3526         - On setting, set to the input value if it is in the range
3527           [1; 2147483647], otherwise, set to the default value.
3528
3529         Note that as per the specification, we are supposed to throw an
3530         IndexSizeError exception when trying to set those attributes to zero.
3531         However, we instead use the default value to match other browsers.
3532         It would be risky to be the only browser to throw in this case.
3533
3534         No new tests, already covered by existing test.
3535
3536         * html/HTMLInputElement.cpp:
3537         (WebCore::HTMLInputElement::parseAttribute):
3538         (WebCore::HTMLInputElement::setSize):
3539         * html/HTMLTableColElement.cpp:
3540         (WebCore::HTMLTableColElement::parseAttribute):
3541         (WebCore::HTMLTableColElement::setSpan):
3542         * html/HTMLTableColElement.h:
3543         * html/HTMLTableColElement.idl:
3544         * html/HTMLTextAreaElement.cpp:
3545         (WebCore::HTMLTextAreaElement::parseAttribute):
3546         (WebCore::HTMLTextAreaElement::setCols):
3547         (WebCore::HTMLTextAreaElement::setRows):
3548         (WebCore::HTMLTextAreaElement::shouldUseInputMethod): Deleted.
3549         * html/HTMLTextAreaElement.h:
3550         * html/HTMLTextAreaElement.idl:
3551         * html/parser/HTMLParserIdioms.h:
3552         (WebCore::limitToOnlyNonNegativeNumbersGreaterThanZero):
3553
3554 2016-02-18  David Kilzer  <ddkilzer@apple.com>
3555
3556         Remove redundant ASSERT_WITH_MESSAGE_UNUSED() from SOFT_LINK_FRAMEWORK_FOR_SOURCE() macro
3557
3558         Follow-up fix noted by Andy Estes for:
3559
3560             [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
3561             <http://webkit.org/b/154364>
3562
3563         * platform/mac/SoftLinking.h:
3564         (SOFT_LINK_FRAMEWORK_FOR_SOURCE): Remove redundant
3565         ASSERT_WITH_MESSAGE_UNUSED().
3566
3567 2016-02-18  Andreas Kling  <akling@apple.com>
3568
3569         Reduce tiling coverage immediately when memory pressure hits.
3570         <https://webkit.org/b/154374>
3571
3572         Reviewed by Simon Fraser.
3573
3574         We already had a policy that reduced tiling coverage to a minimum while the system
3575         is under memory pressure. However, that policy wouldn't kick in immediately after
3576         receiving the pressure notification, but the next time we flush compositing state.
3577
3578         This change makes it happen sooner, improving our chances to escape death!
3579
3580         * page/Page.h:
3581         * page/Page.cpp:
3582         (WebCore::Page::forEachPage):
3583
3584             Add a little helper for visiting every Page.
3585
3586         * platform/MemoryPressureHandler.cpp:
3587         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
3588
3589             When under critical memory pressure, schedule a compositing flush in all Pages.
3590             This ensures that the reduced tiling coverage policy takes effect, allowing us to
3591             immediately drop several tiles in each visible web view.
3592
3593         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3594         (WebCore::MemoryPressureHandler::install):
3595
3596             To ensure that this behavior is testable with the fake memory pressure notification,
3597             make the fake handler set the "in memory pressure" state just like the real one would.
3598             I don't know why we were not doing this previously, it was just an oversight.
3599             After the simulation completes, it schedules a runloop callback that resets the
3600             "in memory pressure" state.
3601
3602 2016-02-17  Myles C. Maxfield  <mmaxfield@apple.com>
3603
3604         [Font Loading] Implement FontFaceSet
3605         https://bugs.webkit.org/show_bug.cgi?id=153348
3606
3607         Reviewed by Simon Fraser.
3608
3609         The CSS Font Loading spec includes a FontFaceSet object which represents
3610         a collection of FontFaces. This patch implements such an object, and
3611         backs it with a vector of FontFaces. Similarly to the FontFace object,
3612         FontFaceSet is separated into a FontFaceSet frontend object and a
3613         CSSFontFaceSet backend object, which actually owns the FontFace objects.
3614         All the interaction with Promises is performed in the frontend object.
3615
3616         This patch does not implement the EventTarget part of the FontFaceSet
3617         API, so the only way to know when a font is finished loading is by using
3618         the associated Promise objects.
3619
3620         The CSS Font Loading spec describes how the Document should vend an
3621         instance of FontFaceSet which represents the font faces currently
3622         associated with the Document. However, that functionality is
3623         forthcoming. Currently, the only way to get a FontFaceSet is to create
3624         one yourself (using the constructor). Therefore, this patch does not
3625         implement the spec's notion of a "CSS-connected font face."
3626
3627         Test: fast/text/font-face-set-javascript.html
3628
3629         * CMakeLists.txt: Add new files.
3630         * DerivedSources.make: Ditto.
3631         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
3632         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
3633         * WebCore.xcodeproj/project.pbxproj: Ditto.
3634         * bindings/js/JSFontFaceSetCustom.cpp: Added.
3635         (WebCore::JSFontFaceSet::ready): Use the Promise member.
3636         (WebCore::JSFontFaceSet::entries): Use existing iterator code.
3637         (WebCore::JSFontFaceSet::keys):
3638         (WebCore::JSFontFaceSet::values):
3639         * css/CSSAllInOne.cpp: Add new files.
3640         * css/CSSFontFace.cpp: We now have a collection of clients (instead of
3641         just one). Also, we need to keep a pointer to our FontFace wrapper.
3642         (WebCore::CSSFontFace::CSSFontFace):
3643         (WebCore::CSSFontFace::addClient):
3644         (WebCore::CSSFontFace::removeClient):
3645         (WebCore::CSSFontFace::setStatus): Rename the delegate callback to be
3646         more clear.
3647         (WebCore::CSSFontFace::fontLoaded):
3648         (WebCore::CSSFontFace::addedToSegmentedFontFace): Deleted.
3649         (WebCore::CSSFontFace::removedFromSegmentedFontFace): Deleted.
3650         * css/CSSFontFace.h: Same as above.
3651         (WebCore::CSSFontFace::create):
3652         (WebCore::CSSFontFace::Client::~Client):
3653         (WebCore::CSSFontFace::Client::kick):
3654         (WebCore::CSSFontFace::Client::stateChanged):
3655         (WebCore::CSSFontFace::wrapper):
3656         (WebCore::CSSFontFaceClient::~CSSFontFaceClient): Deleted.
3657         * css/CSSFontFaceSet.cpp: Added. Initial imlementation.
3658         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
3659         (WebCore::CSSFontFaceSet::~CSSFontFaceSet):
3660         (WebCore::CSSFontFaceSet::incrementActiveCount):
3661         (WebCore::CSSFontFaceSet::decrementActiveCount):
3662         (WebCore::CSSFontFaceSet::has):
3663         (WebCore::CSSFontFaceSet::add):
3664         (WebCore::CSSFontFaceSet::remove):
3665         (WebCore::extractFamilies):
3666         (WebCore::familiesIntersect): Because this is an initial imlementation,
3667         this function is not optimized. A subsequent patch (which implements
3668         Document.fonts) will optimize this.
3669         (WebCore::CSSFontFaceSet::matchingFaces):
3670         (WebCore::CSSFontFaceSet::load):
3671         (WebCore::CSSFontFaceSet::check):
3672         (WebCore::CSSFontFaceSet::stateChanged):
3673         * css/CSSFontFaceSet.h: Added.
3674         (WebCore::CSSFontFaceSetClient::~CSSFontFaceSetClient):
3675         (WebCore::CSSFontFaceSet::size):
3676         (WebCore::CSSFontFaceSet::operator[]):
3677         (WebCore::CSSFontFaceSet::status):
3678         * css/CSSFontSelector.cpp:
3679         (WebCore::CSSFontSelector::familyNameFromPrimitive):
3680         (WebCore::CSSFontSelector::registerLocalFontFacesForFamily):
3681         (WebCore::CSSFontSelector::addFontFaceRule):
3682         (WebCore::familyNameFromPrimitive): Deleted.
3683         (WebCore::CSSFontSelector::kick): Deleted.
3684         * css/CSSFontSelector.h:
3685         * css/CSSSegmentedFontFace.cpp:
3686         (WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace):
3687         (WebCore::CSSSegmentedFontFace::appendFontFace):
3688         (WebCore::CSSSegmentedFontFace::kick):
3689         (WebCore::CSSSegmentedFontFace::fontLoaded): Deleted.
3690         * css/CSSSegmentedFontFace.h:
3691         * css/FontFace.cpp:
3692         (WebCore::FontFace::FontFace):
3693         (WebCore::FontFace::~FontFace):
3694         (WebCore::FontFace::stateChanged): Renamed to make its purpose clearer.
3695         (WebCore::FontFace::kick): Deleted.
3696         * css/FontFace.h:
3697         * css/FontFaceSet.cpp: Added.
3698         (WebCore::createPromise):
3699         (WebCore::FontFaceSet::FontFaceSet):
3700         (WebCore::FontFaceSet::~FontFaceSet):
3701         (WebCore::FontFaceSet::Iterator::Iterator):
3702         (WebCore::FontFaceSet::Iterator::next):
3703         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
3704         (WebCore::FontFaceSet::PendingPromise::~PendingPromise):
3705         (WebCore::FontFaceSet::has):
3706         (WebCore::FontFaceSet::size):
3707         (WebCore::FontFaceSet::add):
3708         (WebCore::FontFaceSet::remove):
3709         (WebCore::FontFaceSet::clear):
3710         (WebCore::FontFaceSet::load): Most of the complexity of loading is
3711         due to the promises involved. Rather than use the Javascript function
3712         Promise.all(), this patch builds a data structure to represent the
3713         promises which need to be resolved. When fonts finish loading, we look
3714         at the data structure to determine which promises to resolve.
3715         (WebCore::FontFaceSet::check):
3716         (WebCore::FontFaceSet::status):
3717         (WebCore::FontFaceSet::canSuspendForDocumentSuspension):
3718         (WebCore::FontFaceSet::startedLoading):
3719         (WebCore::FontFaceSet::completedLoading):
3720         (WebCore::FontFaceSet::fulfillPromise): Keep the promise alive.
3721         (WebCore::FontFaceSet::faceFinished):
3722         * css/FontFaceSet.h: Added.
3723         (WebCore::FontFaceSet::create):
3724         (WebCore::FontFaceSet::load):
3725         (WebCore::FontFaceSet::check):
3726         (WebCore::FontFaceSet::createIterator):
3727         (WebCore::FontFaceSet::PendingPromise::create):
3728         * css/FontFaceSet.idl: Added.
3729         * dom/EventNames.h:
3730         * dom/EventTargetFactory.in:
3731
3732 2016-02-17  Mark Lam  <mark.lam@apple.com>
3733
3734         Callers of JSString::value() should check for exceptions thereafter.
3735         https://bugs.webkit.org/show_bug.cgi?id=154346
3736
3737         Reviewed by Geoffrey Garen.
3738
3739         No new tests.  The crash that results from this issue is dependent on a race
3740         condition where an OutOfMemory error occurs precisely at the point where the
3741         JSString::value() function is called on a rope JSString.
3742
3743         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3744         (WebCore::callHTMLAllCollection):
3745         * bindings/js/JSStorageCustom.cpp:
3746         (WebCore::JSStorage::putDelegate):
3747         - Added a comment at the site of the exception check to clarify the meaning of
3748           the return value.
3749
3750 2016-02-17  David Kilzer  <ddkilzer@apple.com>
3751
3752         [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
3753         <http://webkit.org/b/154364>
3754
3755         Reviewed by Alexey Proskuryakov.
3756
3757         * platform/mac/SoftLinking.h:
3758         (SOFT_LINK_LIBRARY): Change ASSERT_WITH_MESSAGE() to
3759         RELEASE_ASSERT_WITH_MESSAGE().
3760         (SOFT_LINK_FRAMEWORK): Ditto.
3761         (SOFT_LINK_PRIVATE_FRAMEWORK): Ditto.
3762         (SOFT_LINK_STAGED_FRAMEWORK): Ditto.
3763         (SOFT_LINK_FRAMEWORK_IN_UMBRELLA): Ditto.
3764         (SOFT_LINK): Ditto.
3765         (SOFT_LINK_POINTER): Ditto.
3766         (SOFT_LINK_CONSTANT): Ditto.
3767         (SOFT_LINK_FRAMEWORK_FOR_SOURCE): Add
3768         RELEASE_ASSERT_WITH_MESSAGE() when soft-link is not
3769         optional.
3770
3771 2016-02-17  Chris Dumez  <cdumez@apple.com>
3772
3773         Regression(r196648): http://w3c-test.org/html/dom/interfaces.html redirects at the end of the test
3774         https://bugs.webkit.org/show_bug.cgi?id=154357
3775
3776         Reviewed by Alexey Proskuryakov.
3777
3778         Make location.assign() / location.replace()'s parameter mandatory,
3779         as per the specification:
3780         https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
3781
3782         Previously, calling location.assign() / location.replace() without
3783         parameter would be identical to calling location.assign("undefined") /
3784         location.replace("undefined"), which is not useful.
3785
3786         After r196648, http://w3c-test.org/html/dom/interfaces.html was able to
3787         test location.assign() / location.replace() further because they are now
3788         on the instance (where they should be) instead of the prototype. One of
3789         these tests calls these functions without parameter, expecting them to
3790         throw an exception. However, in WebKit, it would not throw and it would
3791         redirect us to http://w3c-test.org/html/dom/undefined.
3792
3793         Firefox and Chrome both follow the specification already and throw in
3794         this case.
3795
3796         No new tests, already covered by existing test.
3797
3798         * page/Location.idl:
3799         Make location.assign() / location.replace()'s parameter mandatory,
3800         as per the specification.
3801
3802 2016-02-17  Commit Queue  <commit-queue@webkit.org>
3803
3804         Unreviewed, rolling out r196738.
3805         https://bugs.webkit.org/show_bug.cgi?id=154380
3806
3807         broke css3/calc/transforms-translate.html (Requested by
3808         alexchristensen on #webkit).
3809
3810         Reverted changeset:
3811
3812         "WebKitCSSMatrix transformList with calculated relative length
3813         crashes Safari."
3814         https://bugs.webkit.org/show_bug.cgi?id=153333
3815         http://trac.webkit.org/changeset/196738
3816
3817 2016-02-17  Dean Jackson  <dino@apple.com>
3818
3819         WebKitCSSMatrix transformList with calculated relative length crashes Safari.
3820         https://bugs.webkit.org/show_bug.cgi?id=153333
3821         <rdar://problem/17198383>
3822
3823         Reviewed by Simon Fraser.
3824
3825         WebKitCSSMatrix objects should fail to construct when not
3826         using absolute lengths.
3827
3828         Updated existing tests:
3829         - transforms/cssmatrix-2d-interface.xhtml
3830         - transforms/cssmatrix-3d-interface.xhtml
3831
3832         * css/StyleBuilderConverter.h:
3833         (WebCore::StyleBuilderConverter::convertTransform): Tell transformsForValue
3834         that we don't require absolute lengths.
3835         * css/TransformFunctions.cpp:
3836         (WebCore::convertToFloatLength): Add an optional parameter that will
3837         cause the conversion to fail if the primitive value has a non-absolute
3838         length.
3839         (WebCore::transformsForValue): Pass the parameter for requiring an
3840         absolute length on to convertToFloatLength when necessary.
3841         * css/TransformFunctions.h:
3842         * css/WebKitCSSMatrix.cpp:
3843         (WebCore::WebKitCSSMatrix::setMatrixValue): In this case we do
3844         require all transform strings to have absolute lengths, not ones
3845         that depend on the font size or are calculated.
3846
3847 2016-02-17  Commit Queue  <commit-queue@webkit.org>
3848
3849         Unreviewed, rolling out r196712.
3850         https://bugs.webkit.org/show_bug.cgi?id=154371
3851
3852         This change caused 5 API test failures on ios-simulator
3853         (Requested by ryanhaddad on #webkit).
3854
3855         Reverted changeset:
3856
3857         "[iOS] Purge GraphicsServices font cache on memory warning."
3858         https://bugs.webkit.org/show_bug.cgi?id=154343
3859         http://trac.webkit.org/changeset/196712
3860
3861 2016-02-17  Brady Eidson  <beidson@apple.com>
3862
3863         Modern IDB: More Encoder/Decoder/Messaging scaffolding for WK2 IPC.
3864         https://bugs.webkit.org/show_bug.cgi?id=154356
3865
3866         Reviewed by Alex Christensen.
3867
3868         No change in behavior yet; Just laying the groundwork.
3869
3870         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
3871         (WebCore::IDBDatabaseInfo::encode):
3872         (WebCore::IDBDatabaseInfo::decode):
3873
3874         * Modules/indexeddb/shared/IDBError.h:
3875         (WebCore::IDBError::encode):
3876         (WebCore::IDBError::decode):
3877
3878         * Modules/indexeddb/shared/IDBRequestData.h:
3879         (WebCore::IDBRequestData::decode):
3880
3881         * Modules/indexeddb/shared/IDBResultData.h:
3882         (WebCore::IDBResultData::encode):
3883         (WebCore::IDBResultData::decode):
3884
3885 2016-02-17  Saam barati  <sbarati@apple.com>
3886
3887         Implement Proxy [[Get]]
3888         https://bugs.webkit.org/show_bug.cgi?id=154081
3889
3890         Reviewed by Michael Saboff.
3891
3892         Tests are in JavaScriptCore.
3893
3894         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3895         (WebCore::getProperty):
3896         (WebCore::getHashAlgorithm):
3897         * bindings/js/JSCryptoKeySerializationJWK.cpp:
3898         (WebCore::getJSArrayFromJSON):
3899         (WebCore::getStringFromJSON):
3900         (WebCore::getBooleanFromJSON):
3901         * bindings/js/JSDOMWindowCustom.cpp:
3902         (WebCore::DialogHandler::returnValue):
3903         * bindings/js/JSDictionary.cpp:
3904         (WebCore::JSDictionary::tryGetProperty):
3905         * bindings/js/JSStorageCustom.cpp:
3906         (WebCore::JSStorage::deleteProperty):
3907         (WebCore::JSStorage::deletePropertyByIndex):
3908         (WebCore::JSStorage::putDelegate):
3909         * bindings/js/SerializedScriptValue.cpp:
3910         (WebCore::CloneSerializer::getProperty):
3911         * testing/Internals.cpp:
3912         (WebCore::Internals::isReadableStreamDisturbed):
3913
3914 2016-02-17  Simon Fraser  <simon.fraser@apple.com>
3915
3916         PDFPlugin's scrollableArea container is not properly unregistered when page is going into the PageCache
3917         https://bugs.webkit.org/show_bug.cgi?id=148182
3918
3919         Reviewed by Brent Fulgham.
3920
3921         When handling Command-arrow key while showing a scrollable PDF, the timing of PDFPlugin
3922         teardown and navigation could result in PDFPlugin::destroy() getting the wrong FrameView,
3923         so the old FrameView was left with a stale pointer in its scrollableAreaSet.
3924
3925         Fix this by adding an explicit willDetatchRenderer() which is called on the plugin
3926         before the Frame gets a new FrameView.
3927
3928         Also narrow the scope of the RefPtr<Widget> in HTMLPlugInElement::defaultEventHandler()
3929         so that the Widget is not kept alive over a possible navigation.
3930
3931         I was unable to make an automated test, because reproducing the bug requires handling
3932         a Command-arrow key event in a way that the last ref to a Widget is held over the event
3933         handling, and this wasn't possible in an iframe.
3934
3935         * html/HTMLPlugInElement.cpp:
3936         (WebCore::HTMLPlugInElement::defaultEventHandler):
3937         * html/HTMLPlugInImageElement.cpp:
3938         (WebCore::HTMLPlugInImageElement::willDetachRenderers):
3939         * plugins/PluginViewBase.h:
3940         (WebCore::PluginViewBase::willDetatchRenderer):
3941         * style/StyleTreeResolver.cpp:
3942         (WebCore::Style::detachRenderTree): Drive-by nullptr.
3943
3944 2016-02-17  Brady Eidson  <beidson@apple.com>
3945
3946         Modern IDB: Encoder/Decoder/Messaging scaffolding for WK2 IPC.
3947         https://bugs.webkit.org/show_bug.cgi?id=154351
3948
3949         Reviewed by Alex Christensen.
3950
3951         No change in behavior yet; Just laying the groundwork.
3952
3953         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3954         (WebCore::IDBDatabaseIdentifier::encode):
3955         (WebCore::IDBDatabaseIdentifier::decode):
3956         
3957         * Modules/indexeddb/shared/IDBCursorInfo.h:
3958         (WebCore::IDBCursorInfo::encode):
3959         (WebCore::IDBCursorInfo::decode):
3960         
3961         * Modules/indexeddb/shared/IDBIndexInfo.h:
3962         (WebCore::IDBIndexInfo::encode):
3963         (WebCore::IDBIndexInfo::decode):
3964         
3965         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
3966         (WebCore::IDBObjectStoreInfo::encode):
3967         (WebCore::IDBObjectStoreInfo::decode):
3968         
3969         * Modules/indexeddb/shared/IDBRequestData.h:
3970         (WebCore::IDBRequestData::encode):
3971         (WebCore::IDBRequestData::decode):
3972         
3973         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
3974         (WebCore::IDBResourceIdentifier::encode):
3975         (WebCore::IDBResourceIdentifier::decode):
3976         
3977         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3978         (WebCore::IDBTransactionInfo::encode):
3979         (WebCore::IDBTransactionInfo::decode):
3980
3981 2016-02-17  Andreas Kling  <akling@apple.com>
3982
3983         [iOS] Purge GraphicsServices font cache on memory warning.
3984         <https://webkit.org/b/154343>
3985
3986         Reviewed by Antti Koivisto.
3987
3988         The GS font cache was holding on to the last retain on CSS fonts after they stop being used.
3989         Call SPI to purge it on memory pressure.
3990
3991         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3992         (WebCore::MemoryPressureHandler::platformReleaseMemory):
3993         * platform/spi/ios/GraphicsServicesSPI.h:
3994
3995 2016-02-17  Chris Dumez  <cdumez@apple.com>
3996
3997         Regression(r196648): window.showModalDialog is no longer undefined if the client does not allow showing modal dialog
3998         https://bugs.webkit.org/show_bug.cgi?id=154330
3999
4000         Reviewed by Gavin Barraclough.
4001
4002         window.showModalDialog is no longer undefined if the client does not
4003         allow showing modal dialog after r196648. This patch fixes the issue
4004         and add test coverage for this.
4005
4006         Test: fast/dom/Window/forbid-showModalDialog.html
4007
4008         * bindings/js/JSDOMWindowCustom.cpp:
4009         (WebCore::JSDOMWindow::getOwnPropertySlot):
4010         - Move the DOMWindow::canShowModalDialog() check *before* checking
4011           for static properties as showModalDialog is now in the static
4012           property table after r196648.
4013         - Add check for Base::getOwnPropertySlot() first to support overriding
4014           window.showModalDialog (This behavior matches Firefox).
4015         - Return false if DOMWindow::canShowModalDialog() returns false as this
4016           seems cleaner than claiming that the property is there but undefined.
4017
4018         * page/DOMWindow.cpp:
4019         (WebCore::DOMWindow::canShowModalDialogNow): Deleted.
4020         This was indentical to canShowModalDialog().
4021
4022         (WebCore::DOMWindow::canShowModalDialog):
4023         (WebCore::DOMWindow::setCanShowModalDialogOverride):
4024         (WebCore::DOMWindow::showModalDialog):
4025         * page/DOMWindow.h: