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