6ba898f25d45ac3cc1d1fc93206c7f2aaf400b0a
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-02-18  Zalan Bujtas  <zalan@apple.com>
2
3         Soft hyphen is not shown when it is placed at the end of an inline element
4         https://bugs.webkit.org/show_bug.cgi?id=153980
5
6         Reviewed by David Hyatt.
7
8         This patch handles the case when the character at the breaking position does not fit the
9         line and soft-hyphen, as the first breaking opportunity, is followed by this overflowing character.
10         (foo&shy;bar where b overflows the line).
11         In such cases we don't yet have an item in the breaking history so we need to take a look at
12         the current context instead.    
13
14         Test: fast/text/soft-hyphen-as-first-breaking-opportunity.html
15
16         * rendering/line/BreakingContext.h:
17         (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
18         (WebCore::BreakingContext::handleText):
19
20 2016-02-18  Andreas Kling  <akling@apple.com>
21
22         Fake memory pressure handler should log detailed memory breakdown.
23         <https://webkit.org/b/154415>
24
25         Reviewed by Antti Koivisto.
26
27         Piggyback on the RESOURCE_USAGE code to implement some detailed memory footprint diffing
28         and have the fake memory handler dump before/after/diff after it runs.
29
30         * page/ResourceUsageThread.h:
31         (WebCore::TagInfo::TagInfo):
32         * page/cocoa/ResourceUsageThreadCocoa.mm:
33         (WebCore::logFootprintComparison):
34         (WebCore::displayNameForVMTag):
35         (WebCore::pagesPerVMTag):
36         (WebCore::TagInfo::TagInfo): Deleted.
37         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
38         (WebCore::MemoryPressureHandler::install):
39
40 2016-02-18  Brady Eidson  <beidson@apple.com>
41
42         Modern IDB: Implement server->client operations in WK2.
43         https://bugs.webkit.org/show_bug.cgi?id=154411
44
45         Reviewed by Alex Christensen.
46
47         No change in behavior yet; Just laying the groundwork.
48     
49         * Modules/indexeddb/client/IDBConnectionToServer.h:
50         * Modules/indexeddb/server/IDBServer.h:
51         * Modules/indexeddb/shared/IDBTransactionInfo.h:
52         (WebCore::IDBTransactionInfo::encode):
53         (WebCore::IDBTransactionInfo::decode):
54
55 2016-02-18  Csaba Osztrogonác  <ossy@webkit.org>
56
57         Fix unused-const-variable warning on non Cocoa platforms
58         https://bugs.webkit.org/show_bug.cgi?id=154394
59
60         Reviewed by Michael Catanzaro.
61
62         * html/HTMLPlugInImageElement.cpp:
63
64 2016-02-18  Brady Eidson  <beidson@apple.com>
65
66         Modern IDB: Implement client->server operations in WK2.
67         https://bugs.webkit.org/show_bug.cgi?id=154400
68
69         Reviewed by Alex Christensen.
70
71         No change in behavior yet; Just laying the groundwork.
72
73         * Modules/indexeddb/server/IDBServer.h:
74         * Modules/indexeddb/server/UniqueIDBDatabase.h:
75         * Modules/indexeddb/shared/IDBIndexInfo.h:
76         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
77
78 2016-02-18  Chris Dumez  <cdumez@apple.com>
79
80         [Unforgeable] operations should not be writable as per Web IDL
81         https://bugs.webkit.org/show_bug.cgi?id=154396
82         <rdar://problem/24721063>
83
84         Reviewed by Ryosuke Niwa.
85
86         [Unforgeable] operations should not be writable as per the Web IDL specification:
87         http://heycam.github.io/webidl/#es-operations
88
89         They were currently non-configurable in WebKit but still writable.
90
91         No new tests, already covered by existing test.
92
93         * bindings/scripts/CodeGeneratorJS.pm:
94         Mark [Unforgeable] operations as ReadOnly.
95
96         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
97         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
98         * bindings/scripts/test/JS/JSTestObj.cpp:
99         * bindings/scripts/test/ObjC/DOMTestObj.h:
100         * bindings/scripts/test/ObjC/DOMTestObj.mm:
101         * bindings/scripts/test/TestObj.idl:
102         Add bindings test coverage for [Unforgeable].
103
104 2016-02-18  Chris Dumez  <cdumez@apple.com>
105
106         Fix behavior of reflecting unsigned long IDL attributes that are limited to only non-negative numbers greater than zero
107         https://bugs.webkit.org/show_bug.cgi?id=154398
108
109         Reviewed by Ryosuke Niwa.
110
111         Fix behavior of reflecting unsigned long IDL attributes that are limited
112         to only non-negative numbers greater than zero to comply with:
113         - https://html.spec.whatwg.org/#limited-to-only-non-negative-numbers-greater-than-zero
114
115         This patch updates the following IDL attributes:
116         - colgroup.span
117         - col.span
118         - input.size
119         - textarea.cols
120         - textareal.rows
121
122         All of them now:
123         - Have "unsigned long" type on IDL size and "unsigned" type on native
124           side.
125         - On getting, return the value if it is in the range [1; 2147483647],
126           otherwise return the default value.
127         - On setting, set to the input value if it is in the range
128           [1; 2147483647], otherwise, set to the default value.
129
130         Note that as per the specification, we are supposed to throw an
131         IndexSizeError exception when trying to set those attributes to zero.
132         However, we instead use the default value to match other browsers.
133         It would be risky to be the only browser to throw in this case.
134
135         No new tests, already covered by existing test.
136
137         * html/HTMLInputElement.cpp:
138         (WebCore::HTMLInputElement::parseAttribute):
139         (WebCore::HTMLInputElement::setSize):
140         * html/HTMLTableColElement.cpp:
141         (WebCore::HTMLTableColElement::parseAttribute):
142         (WebCore::HTMLTableColElement::setSpan):
143         * html/HTMLTableColElement.h:
144         * html/HTMLTableColElement.idl:
145         * html/HTMLTextAreaElement.cpp:
146         (WebCore::HTMLTextAreaElement::parseAttribute):
147         (WebCore::HTMLTextAreaElement::setCols):
148         (WebCore::HTMLTextAreaElement::setRows):
149         (WebCore::HTMLTextAreaElement::shouldUseInputMethod): Deleted.
150         * html/HTMLTextAreaElement.h:
151         * html/HTMLTextAreaElement.idl:
152         * html/parser/HTMLParserIdioms.h:
153         (WebCore::limitToOnlyNonNegativeNumbersGreaterThanZero):
154
155 2016-02-18  David Kilzer  <ddkilzer@apple.com>
156
157         Remove redundant ASSERT_WITH_MESSAGE_UNUSED() from SOFT_LINK_FRAMEWORK_FOR_SOURCE() macro
158
159         Follow-up fix noted by Andy Estes for:
160
161             [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
162             <http://webkit.org/b/154364>
163
164         * platform/mac/SoftLinking.h:
165         (SOFT_LINK_FRAMEWORK_FOR_SOURCE): Remove redundant
166         ASSERT_WITH_MESSAGE_UNUSED().
167
168 2016-02-18  Andreas Kling  <akling@apple.com>
169
170         Reduce tiling coverage immediately when memory pressure hits.
171         <https://webkit.org/b/154374>
172
173         Reviewed by Simon Fraser.
174
175         We already had a policy that reduced tiling coverage to a minimum while the system
176         is under memory pressure. However, that policy wouldn't kick in immediately after
177         receiving the pressure notification, but the next time we flush compositing state.
178
179         This change makes it happen sooner, improving our chances to escape death!
180
181         * page/Page.h:
182         * page/Page.cpp:
183         (WebCore::Page::forEachPage):
184
185             Add a little helper for visiting every Page.
186
187         * platform/MemoryPressureHandler.cpp:
188         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
189
190             When under critical memory pressure, schedule a compositing flush in all Pages.
191             This ensures that the reduced tiling coverage policy takes effect, allowing us to
192             immediately drop several tiles in each visible web view.
193
194         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
195         (WebCore::MemoryPressureHandler::install):
196
197             To ensure that this behavior is testable with the fake memory pressure notification,
198             make the fake handler set the "in memory pressure" state just like the real one would.
199             I don't know why we were not doing this previously, it was just an oversight.
200             After the simulation completes, it schedules a runloop callback that resets the
201             "in memory pressure" state.
202
203 2016-02-17  Myles C. Maxfield  <mmaxfield@apple.com>
204
205         [Font Loading] Implement FontFaceSet
206         https://bugs.webkit.org/show_bug.cgi?id=153348
207
208         Reviewed by Simon Fraser.
209
210         The CSS Font Loading spec includes a FontFaceSet object which represents
211         a collection of FontFaces. This patch implements such an object, and
212         backs it with a vector of FontFaces. Similarly to the FontFace object,
213         FontFaceSet is separated into a FontFaceSet frontend object and a
214         CSSFontFaceSet backend object, which actually owns the FontFace objects.
215         All the interaction with Promises is performed in the frontend object.
216
217         This patch does not implement the EventTarget part of the FontFaceSet
218         API, so the only way to know when a font is finished loading is by using
219         the associated Promise objects.
220
221         The CSS Font Loading spec describes how the Document should vend an
222         instance of FontFaceSet which represents the font faces currently
223         associated with the Document. However, that functionality is
224         forthcoming. Currently, the only way to get a FontFaceSet is to create
225         one yourself (using the constructor). Therefore, this patch does not
226         implement the spec's notion of a "CSS-connected font face."
227
228         Test: fast/text/font-face-set-javascript.html
229
230         * CMakeLists.txt: Add new files.
231         * DerivedSources.make: Ditto.
232         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
233         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
234         * WebCore.xcodeproj/project.pbxproj: Ditto.
235         * bindings/js/JSFontFaceSetCustom.cpp: Added.
236         (WebCore::JSFontFaceSet::ready): Use the Promise member.
237         (WebCore::JSFontFaceSet::entries): Use existing iterator code.
238         (WebCore::JSFontFaceSet::keys):
239         (WebCore::JSFontFaceSet::values):
240         * css/CSSAllInOne.cpp: Add new files.
241         * css/CSSFontFace.cpp: We now have a collection of clients (instead of
242         just one). Also, we need to keep a pointer to our FontFace wrapper.
243         (WebCore::CSSFontFace::CSSFontFace):
244         (WebCore::CSSFontFace::addClient):
245         (WebCore::CSSFontFace::removeClient):
246         (WebCore::CSSFontFace::setStatus): Rename the delegate callback to be
247         more clear.
248         (WebCore::CSSFontFace::fontLoaded):
249         (WebCore::CSSFontFace::addedToSegmentedFontFace): Deleted.
250         (WebCore::CSSFontFace::removedFromSegmentedFontFace): Deleted.
251         * css/CSSFontFace.h: Same as above.
252         (WebCore::CSSFontFace::create):
253         (WebCore::CSSFontFace::Client::~Client):
254         (WebCore::CSSFontFace::Client::kick):
255         (WebCore::CSSFontFace::Client::stateChanged):
256         (WebCore::CSSFontFace::wrapper):
257         (WebCore::CSSFontFaceClient::~CSSFontFaceClient): Deleted.
258         * css/CSSFontFaceSet.cpp: Added. Initial imlementation.
259         (WebCore::CSSFontFaceSet::CSSFontFaceSet):
260         (WebCore::CSSFontFaceSet::~CSSFontFaceSet):
261         (WebCore::CSSFontFaceSet::incrementActiveCount):
262         (WebCore::CSSFontFaceSet::decrementActiveCount):
263         (WebCore::CSSFontFaceSet::has):
264         (WebCore::CSSFontFaceSet::add):
265         (WebCore::CSSFontFaceSet::remove):
266         (WebCore::extractFamilies):
267         (WebCore::familiesIntersect): Because this is an initial imlementation,
268         this function is not optimized. A subsequent patch (which implements
269         Document.fonts) will optimize this.
270         (WebCore::CSSFontFaceSet::matchingFaces):
271         (WebCore::CSSFontFaceSet::load):
272         (WebCore::CSSFontFaceSet::check):
273         (WebCore::CSSFontFaceSet::stateChanged):
274         * css/CSSFontFaceSet.h: Added.
275         (WebCore::CSSFontFaceSetClient::~CSSFontFaceSetClient):
276         (WebCore::CSSFontFaceSet::size):
277         (WebCore::CSSFontFaceSet::operator[]):
278         (WebCore::CSSFontFaceSet::status):
279         * css/CSSFontSelector.cpp:
280         (WebCore::CSSFontSelector::familyNameFromPrimitive):
281         (WebCore::CSSFontSelector::registerLocalFontFacesForFamily):
282         (WebCore::CSSFontSelector::addFontFaceRule):
283         (WebCore::familyNameFromPrimitive): Deleted.
284         (WebCore::CSSFontSelector::kick): Deleted.
285         * css/CSSFontSelector.h:
286         * css/CSSSegmentedFontFace.cpp:
287         (WebCore::CSSSegmentedFontFace::~CSSSegmentedFontFace):
288         (WebCore::CSSSegmentedFontFace::appendFontFace):
289         (WebCore::CSSSegmentedFontFace::kick):
290         (WebCore::CSSSegmentedFontFace::fontLoaded): Deleted.
291         * css/CSSSegmentedFontFace.h:
292         * css/FontFace.cpp:
293         (WebCore::FontFace::FontFace):
294         (WebCore::FontFace::~FontFace):
295         (WebCore::FontFace::stateChanged): Renamed to make its purpose clearer.
296         (WebCore::FontFace::kick): Deleted.
297         * css/FontFace.h:
298         * css/FontFaceSet.cpp: Added.
299         (WebCore::createPromise):
300         (WebCore::FontFaceSet::FontFaceSet):
301         (WebCore::FontFaceSet::~FontFaceSet):
302         (WebCore::FontFaceSet::Iterator::Iterator):
303         (WebCore::FontFaceSet::Iterator::next):
304         (WebCore::FontFaceSet::PendingPromise::PendingPromise):
305         (WebCore::FontFaceSet::PendingPromise::~PendingPromise):
306         (WebCore::FontFaceSet::has):
307         (WebCore::FontFaceSet::size):
308         (WebCore::FontFaceSet::add):
309         (WebCore::FontFaceSet::remove):
310         (WebCore::FontFaceSet::clear):
311         (WebCore::FontFaceSet::load): Most of the complexity of loading is
312         due to the promises involved. Rather than use the Javascript function
313         Promise.all(), this patch builds a data structure to represent the
314         promises which need to be resolved. When fonts finish loading, we look
315         at the data structure to determine which promises to resolve.
316         (WebCore::FontFaceSet::check):
317         (WebCore::FontFaceSet::status):
318         (WebCore::FontFaceSet::canSuspendForDocumentSuspension):
319         (WebCore::FontFaceSet::startedLoading):
320         (WebCore::FontFaceSet::completedLoading):
321         (WebCore::FontFaceSet::fulfillPromise): Keep the promise alive.
322         (WebCore::FontFaceSet::faceFinished):
323         * css/FontFaceSet.h: Added.
324         (WebCore::FontFaceSet::create):
325         (WebCore::FontFaceSet::load):
326         (WebCore::FontFaceSet::check):
327         (WebCore::FontFaceSet::createIterator):
328         (WebCore::FontFaceSet::PendingPromise::create):
329         * css/FontFaceSet.idl: Added.
330         * dom/EventNames.h:
331         * dom/EventTargetFactory.in:
332
333 2016-02-17  Mark Lam  <mark.lam@apple.com>
334
335         Callers of JSString::value() should check for exceptions thereafter.
336         https://bugs.webkit.org/show_bug.cgi?id=154346
337
338         Reviewed by Geoffrey Garen.
339
340         No new tests.  The crash that results from this issue is dependent on a race
341         condition where an OutOfMemory error occurs precisely at the point where the
342         JSString::value() function is called on a rope JSString.
343
344         * bindings/js/JSHTMLAllCollectionCustom.cpp:
345         (WebCore::callHTMLAllCollection):
346         * bindings/js/JSStorageCustom.cpp:
347         (WebCore::JSStorage::putDelegate):
348         - Added a comment at the site of the exception check to clarify the meaning of
349           the return value.
350
351 2016-02-17  David Kilzer  <ddkilzer@apple.com>
352
353         [Cocoa] Always check the return value of dlopen() and dlsym() in Release builds
354         <http://webkit.org/b/154364>
355
356         Reviewed by Alexey Proskuryakov.
357
358         * platform/mac/SoftLinking.h:
359         (SOFT_LINK_LIBRARY): Change ASSERT_WITH_MESSAGE() to
360         RELEASE_ASSERT_WITH_MESSAGE().
361         (SOFT_LINK_FRAMEWORK): Ditto.
362         (SOFT_LINK_PRIVATE_FRAMEWORK): Ditto.
363         (SOFT_LINK_STAGED_FRAMEWORK): Ditto.
364         (SOFT_LINK_FRAMEWORK_IN_UMBRELLA): Ditto.
365         (SOFT_LINK): Ditto.
366         (SOFT_LINK_POINTER): Ditto.
367         (SOFT_LINK_CONSTANT): Ditto.
368         (SOFT_LINK_FRAMEWORK_FOR_SOURCE): Add
369         RELEASE_ASSERT_WITH_MESSAGE() when soft-link is not
370         optional.
371
372 2016-02-17  Chris Dumez  <cdumez@apple.com>
373
374         Regression(r196648): http://w3c-test.org/html/dom/interfaces.html redirects at the end of the test
375         https://bugs.webkit.org/show_bug.cgi?id=154357
376
377         Reviewed by Alexey Proskuryakov.
378
379         Make location.assign() / location.replace()'s parameter mandatory,
380         as per the specification:
381         https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
382
383         Previously, calling location.assign() / location.replace() without
384         parameter would be identical to calling location.assign("undefined") /
385         location.replace("undefined"), which is not useful.
386
387         After r196648, http://w3c-test.org/html/dom/interfaces.html was able to
388         test location.assign() / location.replace() further because they are now
389         on the instance (where they should be) instead of the prototype. One of
390         these tests calls these functions without parameter, expecting them to
391         throw an exception. However, in WebKit, it would not throw and it would
392         redirect us to http://w3c-test.org/html/dom/undefined.
393
394         Firefox and Chrome both follow the specification already and throw in
395         this case.
396
397         No new tests, already covered by existing test.
398
399         * page/Location.idl:
400         Make location.assign() / location.replace()'s parameter mandatory,
401         as per the specification.
402
403 2016-02-17  Commit Queue  <commit-queue@webkit.org>
404
405         Unreviewed, rolling out r196738.
406         https://bugs.webkit.org/show_bug.cgi?id=154380
407
408         broke css3/calc/transforms-translate.html (Requested by
409         alexchristensen on #webkit).
410
411         Reverted changeset:
412
413         "WebKitCSSMatrix transformList with calculated relative length
414         crashes Safari."
415         https://bugs.webkit.org/show_bug.cgi?id=153333
416         http://trac.webkit.org/changeset/196738
417
418 2016-02-17  Dean Jackson  <dino@apple.com>
419
420         WebKitCSSMatrix transformList with calculated relative length crashes Safari.
421         https://bugs.webkit.org/show_bug.cgi?id=153333
422         <rdar://problem/17198383>
423
424         Reviewed by Simon Fraser.
425
426         WebKitCSSMatrix objects should fail to construct when not
427         using absolute lengths.
428
429         Updated existing tests:
430         - transforms/cssmatrix-2d-interface.xhtml
431         - transforms/cssmatrix-3d-interface.xhtml
432
433         * css/StyleBuilderConverter.h:
434         (WebCore::StyleBuilderConverter::convertTransform): Tell transformsForValue
435         that we don't require absolute lengths.
436         * css/TransformFunctions.cpp:
437         (WebCore::convertToFloatLength): Add an optional parameter that will
438         cause the conversion to fail if the primitive value has a non-absolute
439         length.
440         (WebCore::transformsForValue): Pass the parameter for requiring an
441         absolute length on to convertToFloatLength when necessary.
442         * css/TransformFunctions.h:
443         * css/WebKitCSSMatrix.cpp:
444         (WebCore::WebKitCSSMatrix::setMatrixValue): In this case we do
445         require all transform strings to have absolute lengths, not ones
446         that depend on the font size or are calculated.
447
448 2016-02-17  Commit Queue  <commit-queue@webkit.org>
449
450         Unreviewed, rolling out r196712.
451         https://bugs.webkit.org/show_bug.cgi?id=154371
452
453         This change caused 5 API test failures on ios-simulator
454         (Requested by ryanhaddad on #webkit).
455
456         Reverted changeset:
457
458         "[iOS] Purge GraphicsServices font cache on memory warning."
459         https://bugs.webkit.org/show_bug.cgi?id=154343
460         http://trac.webkit.org/changeset/196712
461
462 2016-02-17  Brady Eidson  <beidson@apple.com>
463
464         Modern IDB: More Encoder/Decoder/Messaging scaffolding for WK2 IPC.
465         https://bugs.webkit.org/show_bug.cgi?id=154356
466
467         Reviewed by Alex Christensen.
468
469         No change in behavior yet; Just laying the groundwork.
470
471         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
472         (WebCore::IDBDatabaseInfo::encode):
473         (WebCore::IDBDatabaseInfo::decode):
474
475         * Modules/indexeddb/shared/IDBError.h:
476         (WebCore::IDBError::encode):
477         (WebCore::IDBError::decode):
478
479         * Modules/indexeddb/shared/IDBRequestData.h:
480         (WebCore::IDBRequestData::decode):
481
482         * Modules/indexeddb/shared/IDBResultData.h:
483         (WebCore::IDBResultData::encode):
484         (WebCore::IDBResultData::decode):
485
486 2016-02-17  Saam barati  <sbarati@apple.com>
487
488         Implement Proxy [[Get]]
489         https://bugs.webkit.org/show_bug.cgi?id=154081
490
491         Reviewed by Michael Saboff.
492
493         Tests are in JavaScriptCore.
494
495         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
496         (WebCore::getProperty):
497         (WebCore::getHashAlgorithm):
498         * bindings/js/JSCryptoKeySerializationJWK.cpp:
499         (WebCore::getJSArrayFromJSON):
500         (WebCore::getStringFromJSON):
501         (WebCore::getBooleanFromJSON):
502         * bindings/js/JSDOMWindowCustom.cpp:
503         (WebCore::DialogHandler::returnValue):
504         * bindings/js/JSDictionary.cpp:
505         (WebCore::JSDictionary::tryGetProperty):
506         * bindings/js/JSStorageCustom.cpp:
507         (WebCore::JSStorage::deleteProperty):
508         (WebCore::JSStorage::deletePropertyByIndex):
509         (WebCore::JSStorage::putDelegate):
510         * bindings/js/SerializedScriptValue.cpp:
511         (WebCore::CloneSerializer::getProperty):
512         * testing/Internals.cpp:
513         (WebCore::Internals::isReadableStreamDisturbed):
514
515 2016-02-17  Simon Fraser  <simon.fraser@apple.com>
516
517         PDFPlugin's scrollableArea container is not properly unregistered when page is going into the PageCache
518         https://bugs.webkit.org/show_bug.cgi?id=148182
519
520         Reviewed by Brent Fulgham.
521
522         When handling Command-arrow key while showing a scrollable PDF, the timing of PDFPlugin
523         teardown and navigation could result in PDFPlugin::destroy() getting the wrong FrameView,
524         so the old FrameView was left with a stale pointer in its scrollableAreaSet.
525
526         Fix this by adding an explicit willDetatchRenderer() which is called on the plugin
527         before the Frame gets a new FrameView.
528
529         Also narrow the scope of the RefPtr<Widget> in HTMLPlugInElement::defaultEventHandler()
530         so that the Widget is not kept alive over a possible navigation.
531
532         I was unable to make an automated test, because reproducing the bug requires handling
533         a Command-arrow key event in a way that the last ref to a Widget is held over the event
534         handling, and this wasn't possible in an iframe.
535
536         * html/HTMLPlugInElement.cpp:
537         (WebCore::HTMLPlugInElement::defaultEventHandler):
538         * html/HTMLPlugInImageElement.cpp:
539         (WebCore::HTMLPlugInImageElement::willDetachRenderers):
540         * plugins/PluginViewBase.h:
541         (WebCore::PluginViewBase::willDetatchRenderer):
542         * style/StyleTreeResolver.cpp:
543         (WebCore::Style::detachRenderTree): Drive-by nullptr.
544
545 2016-02-17  Brady Eidson  <beidson@apple.com>
546
547         Modern IDB: Encoder/Decoder/Messaging scaffolding for WK2 IPC.
548         https://bugs.webkit.org/show_bug.cgi?id=154351
549
550         Reviewed by Alex Christensen.
551
552         No change in behavior yet; Just laying the groundwork.
553
554         * Modules/indexeddb/IDBDatabaseIdentifier.h:
555         (WebCore::IDBDatabaseIdentifier::encode):
556         (WebCore::IDBDatabaseIdentifier::decode):
557         
558         * Modules/indexeddb/shared/IDBCursorInfo.h:
559         (WebCore::IDBCursorInfo::encode):
560         (WebCore::IDBCursorInfo::decode):
561         
562         * Modules/indexeddb/shared/IDBIndexInfo.h:
563         (WebCore::IDBIndexInfo::encode):
564         (WebCore::IDBIndexInfo::decode):
565         
566         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
567         (WebCore::IDBObjectStoreInfo::encode):
568         (WebCore::IDBObjectStoreInfo::decode):
569         
570         * Modules/indexeddb/shared/IDBRequestData.h:
571         (WebCore::IDBRequestData::encode):
572         (WebCore::IDBRequestData::decode):
573         
574         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
575         (WebCore::IDBResourceIdentifier::encode):
576         (WebCore::IDBResourceIdentifier::decode):
577         
578         * Modules/indexeddb/shared/IDBTransactionInfo.h:
579         (WebCore::IDBTransactionInfo::encode):
580         (WebCore::IDBTransactionInfo::decode):
581
582 2016-02-17  Andreas Kling  <akling@apple.com>
583
584         [iOS] Purge GraphicsServices font cache on memory warning.
585         <https://webkit.org/b/154343>
586
587         Reviewed by Antti Koivisto.
588
589         The GS font cache was holding on to the last retain on CSS fonts after they stop being used.
590         Call SPI to purge it on memory pressure.
591
592         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
593         (WebCore::MemoryPressureHandler::platformReleaseMemory):
594         * platform/spi/ios/GraphicsServicesSPI.h:
595
596 2016-02-17  Chris Dumez  <cdumez@apple.com>
597
598         Regression(r196648): window.showModalDialog is no longer undefined if the client does not allow showing modal dialog
599         https://bugs.webkit.org/show_bug.cgi?id=154330
600
601         Reviewed by Gavin Barraclough.
602
603         window.showModalDialog is no longer undefined if the client does not
604         allow showing modal dialog after r196648. This patch fixes the issue
605         and add test coverage for this.
606
607         Test: fast/dom/Window/forbid-showModalDialog.html
608
609         * bindings/js/JSDOMWindowCustom.cpp:
610         (WebCore::JSDOMWindow::getOwnPropertySlot):
611         - Move the DOMWindow::canShowModalDialog() check *before* checking
612           for static properties as showModalDialog is now in the static
613           property table after r196648.
614         - Add check for Base::getOwnPropertySlot() first to support overriding
615           window.showModalDialog (This behavior matches Firefox).
616         - Return false if DOMWindow::canShowModalDialog() returns false as this
617           seems cleaner than claiming that the property is there but undefined.
618
619         * page/DOMWindow.cpp:
620         (WebCore::DOMWindow::canShowModalDialogNow): Deleted.
621         This was indentical to canShowModalDialog().
622
623         (WebCore::DOMWindow::canShowModalDialog):
624         (WebCore::DOMWindow::setCanShowModalDialogOverride):
625         (WebCore::DOMWindow::showModalDialog):
626         * page/DOMWindow.h:
627         * testing/Internals.cpp:
628         (WebCore::Internals::setCanShowModalDialogOverride):
629         * testing/Internals.h:
630         * testing/Internals.idl:
631         Add support for overriding the ChromeClient's canShowModalDialog
632         decision and hook it up to Internals to add layout test coverage.
633
634 2016-02-17  Brady Eidson  <beidson@apple.com>
635
636         Modern IDB: More WK2 IPC Scaffolding.
637         https://bugs.webkit.org/show_bug.cgi?id=154317
638
639         Reviewed by Alex Christensen.
640
641         No change in behavior yet; Just laying the groundwork.
642
643         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
644         (WebCore::IDBCursorInfo::IDBCursorInfo):
645         * Modules/indexeddb/shared/IDBCursorInfo.h:
646         (WebCore::IDBCursorInfo::decode):
647         * Modules/indexeddb/shared/IDBError.h:
648         (WebCore::IDBError::decode):
649         * Modules/indexeddb/shared/IDBIndexInfo.h:
650         (WebCore::IDBIndexInfo::decode):
651         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
652         (WebCore::IDBObjectStoreInfo::decode):
653         * Modules/indexeddb/shared/IDBRequestData.cpp:
654         (WebCore::IDBRequestData::IDBRequestData):
655         * Modules/indexeddb/shared/IDBRequestData.h:
656         (WebCore::IDBRequestData::decode):
657         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
658         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
659         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
660         (WebCore::IDBResourceIdentifier::decode):
661         * Modules/indexeddb/shared/IDBResultData.cpp:
662         (WebCore::IDBResultData::IDBResultData):
663         * Modules/indexeddb/shared/IDBResultData.h:
664         (WebCore::IDBResultData::decode):
665         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
666         (WebCore::IDBTransactionInfo::IDBTransactionInfo):
667         * Modules/indexeddb/shared/IDBTransactionInfo.h:
668         (WebCore::IDBTransactionInfo::decode):
669         * WebCore.xcodeproj/project.pbxproj:
670
671 2016-02-17  Eric Carlson  <eric.carlson@apple.com>
672
673         [Win] Allow ports to disable automatic text track selection
674         https://bugs.webkit.org/show_bug.cgi?id=154322
675         <rdar://problem/24623986>
676
677         Reviewed by Brent Fulgham.
678
679         * page/CaptionUserPreferencesMediaAF.cpp:
680         (MTEnableCaption2015BehaviorPtr): Implement for Windows.
681
682 2016-02-17  Gavin Barraclough  <barraclough@apple.com>
683
684         JSDOMWindow::put should not do the same thing twice
685         https://bugs.webkit.org/show_bug.cgi?id=154334
686
687         Reviewed by Chris Dumez.
688
689         It either calls JSGlobalObject::put or Base::put. Hint: these are basically the same thing.
690         In the latter case it might call lookupPut. That's redundant; JSObject::put handles static
691         table entries.
692
693         * bindings/js/JSDOMWindowCustom.cpp:
694         (WebCore::JSDOMWindow::put):
695             - just call Base::put.
696         (WebCore::JSDOMWindow::putByIndex):
697             - just call Base::putByIndex.
698
699 2016-02-17  Nan Wang  <n_wang@apple.com>
700
701         AX: Implement sentence related text marker functions using TextIterator
702         https://bugs.webkit.org/show_bug.cgi?id=154312
703
704         Reviewed by Chris Fleizach.
705
706         Using CharacterOffset to implement sentence related text marker calls. Reused
707         logic from VisibleUnits class. Also fixed an issue where paragraph navigation
708         should skip preceding and following BR nodes.
709
710         Test: accessibility/mac/text-marker-sentence-nav.html
711
712         * accessibility/AXObjectCache.cpp:
713         (WebCore::resetNodeAndOffsetForReplacedNode):
714         (WebCore::setRangeStartOrEndWithCharacterOffset):
715         (WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
716         (WebCore::AXObjectCache::previousCharacterOffset):
717         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
718         (WebCore::AXObjectCache::endCharacterOffsetOfWord):
719         (WebCore::AXObjectCache::previousWordStartCharacterOffset):
720         (WebCore::AXObjectCache::leftWordRange):
721         (WebCore::AXObjectCache::rightWordRange):
722         (WebCore::AXObjectCache::characterBefore):
723         (WebCore::characterOffsetNodeIsBR):
724         (WebCore::parentEditingBoundary):
725         (WebCore::AXObjectCache::nextBoundary):
726         (WebCore::AXObjectCache::previousBoundary):
727         (WebCore::AXObjectCache::paragraphForCharacterOffset):
728         (WebCore::AXObjectCache::nextParagraphEndCharacterOffset):
729         (WebCore::AXObjectCache::previousParagraphStartCharacterOffset):
730         (WebCore::AXObjectCache::startCharacterOffsetOfSentence):
731         (WebCore::AXObjectCache::endCharacterOffsetOfSentence):
732         (WebCore::AXObjectCache::sentenceForCharacterOffset):
733         (WebCore::AXObjectCache::nextSentenceEndCharacterOffset):
734         (WebCore::AXObjectCache::previousSentenceStartCharacterOffset):
735         (WebCore::AXObjectCache::rootAXEditableElement):
736         (WebCore::startWordBoundary): Deleted.
737         (WebCore::endWordBoundary): Deleted.
738         (WebCore::AXObjectCache::nextWordBoundary): Deleted.
739         (WebCore::AXObjectCache::previousWordBoundary): Deleted.
740         * accessibility/AXObjectCache.h:
741         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
742         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
743         * editing/VisibleUnits.cpp:
744         (WebCore::startWordBoundary):
745         (WebCore::startOfWord):
746         (WebCore::endWordBoundary):
747         (WebCore::startSentenceBoundary):
748         (WebCore::startOfSentence):
749         (WebCore::endSentenceBoundary):
750         * editing/VisibleUnits.h:
751
752 2016-02-17  Manuel Rego Casasnovas  <rego@igalia.com>
753
754         [css-grid] GridSpan refactoring
755         https://bugs.webkit.org/show_bug.cgi?id=153868
756
757         Reviewed by Sergio Villar Senin.
758
759         Add new enum to know if a GridSpan is definite or indefinite.
760         That way we don't need GridUnresolvedSpan class (which is removed).
761         We can always have two GridSpans in GridCoordinate,
762         if the position is "auto" the GridSpan will be marked as indefinite.
763         This will allow in a follow-up patch to avoid repeated calls
764         to methods that resolve positions.
765
766         Most operations in GridSpan are restricted to definite GridSpans (access
767         to positions, iterator, etc.). For indefinite GridSpans we only need to
768         know that they're indefinite, we shouldn't use the rest of the data.
769
770         No new tests, no change of behavior.
771
772         * css/CSSGridTemplateAreasValue.cpp:
773         (WebCore::stringForPosition):
774         * css/CSSParser.cpp:
775         (WebCore::CSSParser::parseGridTemplateAreasRow):
776         * css/StyleBuilderConverter.h:
777         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
778         * rendering/RenderGrid.cpp:
779         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
780         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
781         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
782         (WebCore::RenderGrid::insertItemIntoGrid):
783         (WebCore::RenderGrid::placeItemsOnGrid):
784         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
785         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
786         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
787         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
788         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
789         (WebCore::RenderGrid::columnAxisOffsetForChild):
790         (WebCore::RenderGrid::rowAxisOffsetForChild):
791         (WebCore::RenderGrid::placeAutoMajorAxisItemsOnGrid): Deleted.
792         (WebCore::RenderGrid::autoPlacementMinorAxisDirection): Deleted.
793         (WebCore::RenderGrid::populateGridPositions): Deleted.
794         * rendering/style/GridCoordinate.h:
795         (WebCore::GridSpan::definiteGridSpan):
796         (WebCore::GridSpan::indefiniteGridSpan):
797         (WebCore::GridSpan::operator==):
798         (WebCore::GridSpan::integerSpan):
799         (WebCore::GridSpan::resolvedInitialPosition):
800         (WebCore::GridSpan::resolvedFinalPosition):
801         (WebCore::GridSpan::begin):
802         (WebCore::GridSpan::end):
803         (WebCore::GridSpan::isDefinite):
804         (WebCore::GridSpan::GridSpan):
805         (WebCore::GridCoordinate::GridCoordinate):
806         * rendering/style/GridResolvedPosition.cpp:
807         (WebCore::initialPositionSide):
808         (WebCore::finalPositionSide):
809         (WebCore::adjustGridPositionsFromStyle):
810         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
811         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
812         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
813         (WebCore::resolveGridPositionAgainstOppositePosition):
814         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
815         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
816         (WebCore::implicitNamedGridLineForSide): Deleted.
817         (WebCore::GridResolvedPosition::isNonExistentNamedLineOrArea): Deleted.
818         (WebCore::resolveNamedGridLinePositionFromStyle): Deleted.
819         (WebCore::resolveGridPositionFromStyle): Deleted.
820         * rendering/style/GridResolvedPosition.h:
821         (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
822         (WebCore::GridResolvedPosition::operator*): Deleted.
823         (WebCore::GridResolvedPosition::operator++): Deleted.
824         (WebCore::GridResolvedPosition::operator==): Deleted.
825
826 2016-02-17  Chris Dumez  <cdumez@apple.com>
827
828         Window should have its 'constructor' property on the prototype
829         https://bugs.webkit.org/show_bug.cgi?id=154037
830         <rdar://problem/24689078>
831
832         Reviewed by Gavin Barraclough.
833
834         Window should have its 'constructor' property on the prototype as per
835         the Web IDL specification:
836         http://heycam.github.io/webidl/#interface-prototype-object
837
838         Firefox and Chrome already match the specification.
839
840         No new tests, covered by:
841         - fast/dom/Window/window-constructor-settable.html
842         - fast/dom/Window/window-constructor.html
843         - http/tests/security/cross-origin-window-property-access.html
844         - imported/w3c/web-platform-tests/html/dom/interfaces.html
845
846         * bindings/scripts/CodeGeneratorJS.pm:
847         (ConstructorShouldBeOnInstance): Deleted.
848         Drop this routine as all constructors are now on the prototype.
849
850         (InstancePropertyCount):
851         Do not account for constructor properties as these can only be
852         on the prototype now.
853
854         (PrototypePropertyCount):
855         Increment the property count by 1 if the interface has a constructor
856         property (e.g. [NoInterfaceObject] interfaces do not have one).
857
858         (GeneratePropertiesHashTable):
859         Stop calling ConstructorShouldBeOnInstance() as it no longer exists.
860         Always generated the "constructor" property if:
861         1. We are generating the prototype hash table.
862         and
863         2. The interface needs a constructor (i.e. not marked as
864            [NoInterfaceObject]).
865
866         (GenerateImplementation):
867         - Drop code handling the case where ConstructorShouldBeOnInstance()
868           returns true as constructors are not always on the prototype and
869           the ConstructorShouldBeOnInstance() routine has been dropped.
870         - Drop code handling [CustomProxyToJSObject]. Now that the constructor
871           is always on the prototype, we never need to cast thisValue to a
872           JSDOMWindow (by calling toJSDOMWindow). In the Window case, thisValue
873           is now casted to a JSDOMWindowPrototype*, similarly to other interfaces
874           so we don't need a special casting function anymore.
875         - Stop generating security checks. This only impacts Window as it is the
876           only interface marked as [CheckSecurity]. The cross-origin checking code
877           as it was would not work when "constructor" is on the prototype because
878           thisValue is a JSDOMWindowPrototype, not a JSDOMWindow and we have no
879           way of getting the wrapped window. Also, the security check is no longer
880           needed because:
881           1. Accessing crossOriginWindow.constructor will not work now that
882              constructor is on the prototype because
883              JSDOMWindow::getOwnPropertySlot() already prevents access to the
884              prototype in the cross-origin case.
885           2. "constructor" is a value property, not a getter/setter. Therefore,
886              it is no possible to use the getter/setter from a same origin window
887              instance and call it on a cross origin window.
888
889 2016-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
890
891         Add a way to test ScrollAnimator
892         https://bugs.webkit.org/show_bug.cgi?id=153479
893
894         Reviewed by Michael Catanzaro.
895
896         Tests: fast/scrolling/overlay-scrollbars-scroll-corner.html
897                fast/scrolling/scroll-animator-basic-events.html
898                fast/scrolling/scroll-animator-overlay-scrollbars-hovered.html
899                fast/scrolling/scroll-animator-select-list-events.html
900
901         * CMakeLists.txt:
902         * WebCore.xcodeproj/project.pbxproj:
903         * page/FrameView.cpp:
904         (WebCore::FrameView::usesMockScrollAnimator):
905         (WebCore::FrameView::logMockScrollAnimatorMessage):
906         * page/FrameView.h:
907         * page/Settings.cpp:
908         (WebCore::Settings::setUsesMockScrollAnimator):
909         (WebCore::Settings::usesMockScrollAnimator):
910         * page/Settings.h:
911         * platform/ScrollableArea.cpp:
912         (WebCore::ScrollableArea::scrollAnimator):
913         * platform/ScrollableArea.h:
914         (WebCore::ScrollableArea::usesMockScrollAnimator):
915         (WebCore::ScrollableArea::logMockScrollAnimatorMessage):
916         * platform/mock/ScrollAnimatorMock.cpp: Added.
917         (WebCore::ScrollAnimatorMock::create):
918         (WebCore::ScrollAnimatorMock::ScrollAnimatorMock):
919         (WebCore::ScrollAnimatorMock::~ScrollAnimatorMock):
920         (WebCore::ScrollAnimatorMock::didAddVerticalScrollbar):
921         (WebCore::ScrollAnimatorMock::didAddHorizontalScrollbar):
922         (WebCore::ScrollAnimatorMock::willRemoveVerticalScrollbar):
923         (WebCore::ScrollAnimatorMock::willRemoveHorizontalScrollbar):
924         (WebCore::ScrollAnimatorMock::mouseEnteredContentArea):
925         (WebCore::ScrollAnimatorMock::mouseMovedInContentArea):
926         (WebCore::ScrollAnimatorMock::mouseExitedContentArea):
927         (WebCore::ScrollAnimatorMock::mouseEnteredScrollbar):
928         (WebCore::ScrollAnimatorMock::mouseExitedScrollbar):
929         (WebCore::ScrollAnimatorMock::mouseIsDownInScrollbar):
930         * platform/mock/ScrollAnimatorMock.h: Added.
931         * platform/mock/ScrollbarThemeMock.cpp:
932         (WebCore::ScrollbarThemeMock::usesOverlayScrollbars):
933         * platform/mock/ScrollbarThemeMock.h:
934         * rendering/RenderLayer.cpp:
935         (WebCore::RenderLayer::usesMockScrollAnimator):
936         (WebCore::RenderLayer::logMockScrollAnimatorMessage):
937         * rendering/RenderLayer.h:
938         * rendering/RenderListBox.cpp:
939         (WebCore::RenderListBox::usesMockScrollAnimator):
940         (WebCore::RenderListBox::logMockScrollAnimatorMessage):
941         * rendering/RenderListBox.h:
942         * testing/Internals.cpp:
943         (WebCore::Internals::resetToConsistentState):
944         (WebCore::Internals::setUsesMockScrollAnimator):
945         * testing/Internals.h:
946         * testing/Internals.idl:
947
948 2016-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
949
950         Unreviewed. Enable overlay scrollbars in GTK+ after r196641.
951
952         This was blocked by bug #153404, but the commit that introduced
953         the regression was rolled out in r196641.
954
955         * platform/gtk/ScrollbarThemeGtk.cpp:
956         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
957
958 2016-02-16  Gavin Barraclough  <barraclough@apple.com>
959
960         JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot
961         https://bugs.webkit.org/show_bug.cgi?id=154257
962
963         Reviewed by Chris Dumez.
964
965         * bindings/js/JSDOMWindowCustom.cpp:
966         (WebCore::JSDOMWindow::getOwnPropertySlot):
967             - JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot
968
969 2016-02-16  Gavin Barraclough  <barraclough@apple.com>
970
971         JSDOMWindow::getOwnPropertySlot should not search photo chain
972         https://bugs.webkit.org/show_bug.cgi?id=154102
973
974         Reviewed by Chris Dumez.
975
976         Should only return *own* properties.
977
978         * bindings/js/JSDOMWindowCustom.cpp:
979         (WebCore::jsDOMWindowGetOwnPropertySlotNamedItemGetter):
980
981 2016-02-16  Alex Christensen  <achristensen@webkit.org>
982
983         CMake build fix.
984
985         * PlatformMac.cmake:
986
987 2016-02-16  Chris Dumez  <cdumez@apple.com>
988
989         Navigator.geolocation should not be marked a [Replaceable] and should be on the prototype
990         https://bugs.webkit.org/show_bug.cgi?id=154304
991         <rdar://problem/24685092>
992
993         Reviewed by Gavin Barraclough.
994
995         1. Drop the [Replaceable] IDL extended attribute for navigator.geolocation
996            as this does not match other browsers or the specification:
997            - https://dev.w3.org/geo/api/spec-source.html#geolocation_interface
998         2. Move Navigator attributes to the prototype, where they should be as
999            per the Web IDL specification.
1000
1001         The previous behavior was meant as a workaround for a bug in the Amazon
1002         iOS app (rdar://problem/16332749). However, I have confirmed that the
1003         latest Amazon App no longer has any issue with those changes.
1004
1005         Test: js/navigator-set-geolocation.html
1006
1007         * Modules/geolocation/NavigatorGeolocation.idl:
1008         * bindings/scripts/CodeGeneratorJS.pm:
1009         (InterfaceRequiresAttributesOnInstanceForCompatibility): Deleted.
1010
1011 2016-02-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1012
1013         REGRESSION(r196268): WTFCrashWithSecurityImplication on SVG path animation tests
1014         https://bugs.webkit.org/show_bug.cgi?id=154221
1015
1016         Reviewed by Brent Fulgham.
1017
1018         In r196268, a destructor was added to SVGListPropertyTearOff that notifies
1019         its wrapper (the SVGAnimatedListPropertyTearoff) about its deletion. This
1020         allows the wrapper to nullify any references to the wrapped content.
1021         
1022         We needed to do the same thing for SVGPathSegListPropertyTearOff. Both
1023         SVGPathSegListPropertyTearOff and SVGListPropertyTearOff inherit from
1024         SVGListProperty and both hold pointers to SVGAnimatedListPropertyTearOff
1025         which needs to be notified.
1026         
1027         Tests: exiting svg path animation tests should not crash.
1028
1029         * svg/properties/SVGPathSegListPropertyTearOff.h:
1030         (WebCore::SVGPathSegListPropertyTearOff::~SVGPathSegListPropertyTearOff):
1031
1032 2016-02-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1033
1034         REGRESSION (r190430): WTFCrashWithSecurityImplication in:void SVGRootInlineBox::layoutCharactersInTextBoxes()
1035         https://bugs.webkit.org/show_bug.cgi?id=154185
1036
1037         Reviewed by Ryosuke Niwa.
1038
1039         This is a regression caused by adding support for HTMLSlotElement. The
1040         crash happens when adding an HTMLSlotElement to anther element which should
1041         not have it as a child like SVGTextElement for example. In this case, we
1042         were creating a RenderText which should not be happen inside an SVG document.
1043         The RenderText::createTextBox() was creating InlineTextBox for the slot's
1044         text and attach it to the SVGRootInlineBox. In layoutCharactersInTextBoxes(),
1045         the assumption is the inline box is either SVGInlineTextBox or SVGInlineFlowBox.
1046         But since we have an InlineTextBox instead, the crash happens when casting
1047         the InlineTextBox to SVGInlineFlowBox.
1048
1049         The fix is for createRenderTreeForSlotAssignees() to not create a renderer
1050         when the parent element should not have a renderer for the this element.
1051         This is the same thing we do for createRenderer() which handles the non
1052         HTMLSlotElement case and which is called also from createRenderTreeRecursively().
1053         
1054         Test: fast/shadow-dom/text-slot-child-crash.svg
1055
1056         * style/StyleTreeResolver.cpp:
1057         (WebCore::Style::moveToFlowThreadIfNeeded):
1058         (WebCore::Style::TreeResolver::createRenderer): Delete the check for
1059         shouldCreateRenderer() and handling the case when resolvedStyle is null
1060         since these are handled by the caller createRenderTreeRecursively().
1061         
1062         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
1063         Assert shouldCreateRenderer() is true for this element.
1064         
1065         (WebCore::Style::TreeResolver::createRenderTreeRecursively): Don't create
1066         the renderer if shouldCreateRenderer() returns false. Also handle the case
1067         when resolvedStyle is null and pass the new style to createRenderer().
1068         
1069         * style/StyleTreeResolver.h:
1070
1071 2016-02-16  Simon Fraser  <simon.fraser@apple.com>
1072
1073         Every RenderLayer should not have to remove itself from the scrollableArea set
1074         https://bugs.webkit.org/show_bug.cgi?id=154311
1075
1076         Reviewed by Zalan Bujtas.
1077
1078         A subset of RenderLayers are are scrollable, and get registered on the FrameView,
1079         but we pay the cost of a hash lookup for removal on every RenderLayer, which is a waste.
1080         
1081         Store a bit that tells RenderLayer that it's in the set and needs to be removed.
1082
1083         * rendering/RenderLayer.cpp:
1084         (WebCore::RenderLayer::RenderLayer):
1085         (WebCore::RenderLayer::~RenderLayer):
1086         (WebCore::RenderLayer::calculateClipRects):
1087         * rendering/RenderLayer.h:
1088
1089 2016-02-16  Daniel Bates  <dabates@apple.com>
1090
1091         CSP: Update violation report 'Content-Type' header
1092         https://bugs.webkit.org/show_bug.cgi?id=153166
1093         <rdar://problem/24383327>
1094
1095         Reviewed by Brent Fulgham.
1096
1097         Inspired by Blink patch:
1098         <https://src.chromium.org/viewvc/blink?view=rev&revision=154215>
1099
1100         Post the Content Security Policy violation report with Content-Type application/csp-report as
1101         per section Reporting of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
1102
1103         Currently we post CSP violation reports with Content-Type application/json.
1104
1105         * html/parser/XSSAuditorDelegate.cpp:
1106         (WebCore::XSSAuditorDelegate::didBlockScript): Use report type ViolationReportType::XSSAuditor to PingLoader.
1107         * loader/PingLoader.cpp:
1108         (WebCore::PingLoader::sendViolationReport): Modified to take argument of type ViolationReportType
1109         to determine the appropriate Content-Type header to use for the report. For a XSS Auditor violation report
1110         we use Content-Type application/json. For a Content Security Policy violation report we use Content-Type
1111         application/csp-report. Additionally, pass a ASCIILiteral() to ResourceRequestBase::setHTTPMethod()
1112         as opposed to a constant string literal to avoid a copy of a constant string literal.
1113         * loader/PingLoader.h: Add enum class ViolationReportType.
1114         * page/csp/ContentSecurityPolicy.cpp:
1115         (WebCore::ContentSecurityPolicy::reportViolation): Use report type ViolationReportType::ContentSecurityPolicy.
1116
1117 2016-02-16  Alex Christensen  <achristensen@webkit.org>
1118
1119         Add checks before redirecting with NetworkSession
1120         https://bugs.webkit.org/show_bug.cgi?id=154298
1121
1122         Reviewed by Andy Estes.
1123
1124         This fixes http/tests/security/cors-post-redirect-307.html and 
1125         http/tests/navigation/post-307-response.html when using NetworkSession.
1126
1127         * platform/network/ResourceRequestBase.h:
1128         WEBCORE_EXPORT some functions newly used in WebKit2.
1129
1130 2016-02-16  Daniel Bates  <dabates@apple.com>
1131
1132         CSP: Fix parsing of 'host/path' source expressions
1133         https://bugs.webkit.org/show_bug.cgi?id=153170
1134         <rdar://problem/24383407>
1135
1136         Reviewed by Brent Fulgham.
1137
1138         Merged from Blink (patch by Mike West):
1139         <https://src.chromium.org/viewvc/blink?revision=154875&view=revision>
1140
1141         Fixes an issue where a source of the form example.com/A/ was incorrectly considered
1142         invalid and hence such a requested resource would be blocked. A source of this form
1143         is valid by the definition of host-source in section Source List Syntax of the Content
1144         Security Policy 2.0 spec., <http://www.w3.org/TR/2015/CR-CSP2-20150721/>.
1145
1146         * page/csp/ContentSecurityPolicySourceList.cpp:
1147         (WebCore::ContentSecurityPolicySourceList::parseSource):
1148
1149 2016-02-16  Daniel Bates  <dabates@apple.com>
1150
1151         CSP: Disallow an empty host in a host-source source expression
1152         https://bugs.webkit.org/show_bug.cgi?id=153168
1153         <rdar://problem/24383366>
1154
1155         Reviewed by Brent Fulgham.
1156
1157         Merged from Blink (patch by rob@robwu.nl):
1158         <https://src.chromium.org/viewvc/blink?revision=180407&view=revision>
1159
1160         * page/csp/ContentSecurityPolicySourceList.cpp:
1161         (WebCore::ContentSecurityPolicySourceList::parseSource):
1162
1163 2016-02-16  Brady Eidson  <beidson@apple.com>
1164
1165         Modern IDB: WK2 IPC Scaffolding.
1166         https://bugs.webkit.org/show_bug.cgi?id=154296
1167
1168         Reviewed by Alex Christensen.
1169         
1170         No change in behavior yet; Just laying the groundwork.
1171
1172         * Modules/indexeddb/client/IDBConnectionToServer.h:
1173         * Modules/indexeddb/server/IDBConnectionToClient.h:
1174         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
1175
1176 2016-02-16  Chris Dumez  <cdumez@apple.com>
1177
1178         [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
1179         https://bugs.webkit.org/show_bug.cgi?id=154120
1180         <rdar://problem/24613231>
1181
1182         Reviewed by Gavin Barraclough.
1183
1184         Operations should be on the instance for global objects or if
1185         [Unforgeable] as per the Web IDL specification:
1186         - http://heycam.github.io/webidl/#es-operations
1187         - http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface
1188
1189         This patch implements this behavior in order to align
1190         with the specification and other browsers.
1191
1192         No new tests, already covered by existing tests.
1193
1194         * bindings/js/JSDOMWindowCustom.cpp:
1195         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1196         Update function names now that they have "Instance" in their
1197         name instead of "Prototype".
1198
1199         (WebCore::JSDOMWindow::getOwnPropertySlot):
1200         - Update function names now that they have "Instance" in their
1201           name instead of "Prototype".
1202         - Move the functions hard-coding *before* the static table check
1203           now that these functions are in the static table to maintain
1204           the previous behavior.
1205
1206         * bindings/js/JSLocationCustom.cpp:
1207         (WebCore::JSLocation::getOwnPropertySlotDelegate):
1208         Update function names now that they have "Instance" in their
1209         name instead of "Prototype".
1210
1211         * bindings/scripts/CodeGeneratorJS.pm:
1212         - Move functions to the instance if their interface is a global
1213           object or if they are marked as [Unforgeable]. Operations are
1214           now treated more like attributes, as they can now be either on
1215           the instance or the prototype. In a lot of places, I now use
1216           the naming "properties" instead of "attributes" as "properties"
1217           refer both "attributes" and "operations" / "functions".
1218
1219         * bindings/scripts/test/JS/JSTestInterface.cpp:
1220         * bindings/scripts/test/JS/JSTestObj.cpp:
1221         Rebaseline bindings tests.
1222
1223 2016-02-16  Simon Fraser  <simon.fraser@apple.com>
1224
1225         Rollout r188659. This broke scrolling of iframes and overflow when
1226         navigating back to a page in the page cache.
1227         
1228         The fix was overly agressive and had no layout test. I will fix the original
1229         issue a different way.
1230
1231         * history/CachedFrame.cpp:
1232         (WebCore::CachedFrame::CachedFrame):
1233         * page/FrameView.cpp:
1234         (WebCore::FrameView::clearScrollableAreas): Deleted.
1235         * page/FrameView.h:
1236
1237 2016-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1238
1239         [GTK] No hover-horizontal scrolling available
1240         https://bugs.webkit.org/show_bug.cgi?id=122859
1241
1242         Reviewed by Michael Catanzaro.
1243
1244         This is a regression of WebKit2, because in WebKit1 we used native
1245         widgets for frame scrollbars that handled this automatically. Now
1246         we need to also check if the mouse is over frame scrollbars to
1247         adjust the wheel event.
1248
1249         Test: platform/gtk/scrollbars/main-frame-scrollbar-horizontal-wheel-scroll.html
1250
1251         * page/EventHandler.cpp:
1252         (WebCore::EventHandler::handleWheelEvent): Pass the adjusted wheel
1253         event to platformCompleteWheelEvent().
1254         * page/gtk/EventHandlerGtk.cpp:
1255         (WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal):
1256         Check also frame scrollbars.
1257
1258 2016-02-16  Antti Koivisto  <antti@apple.com>
1259
1260         Factor id mutation style invalidation code into a class
1261         https://bugs.webkit.org/show_bug.cgi?id=154287
1262
1263         Reviewed by Andreas Kling.
1264
1265         Also add a cheap basic optimization that avoids descendant invalidation if they can not be affected.
1266
1267         It would be easy to implement fine grained invalidation like with classes and attribute selectors.
1268         However dynamic id changes are not common enough (nor recommended) to pay the memory cost of
1269         the required data structures.
1270
1271         Test: fast/css/style-invalidation-id-change-descendants.html
1272
1273         * CMakeLists.txt:
1274         * WebCore.vcxproj/WebCore.vcxproj:
1275         * WebCore.xcodeproj/project.pbxproj:
1276         * css/RuleFeature.cpp:
1277         (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
1278         (WebCore::RuleFeatureSet::add):
1279         (WebCore::RuleFeatureSet::clear):
1280         * css/RuleFeature.h:
1281         * dom/Element.cpp:
1282         (WebCore::makeIdForStyleResolution):
1283         (WebCore::Element::attributeChanged):
1284         (WebCore::checkNeedsStyleInvalidationForIdChange): Deleted.
1285         * style/IdChangeInvalidation.cpp: Added.
1286         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
1287         * style/IdChangeInvalidation.h: Added.
1288         (WebCore::Style::IdChangeInvalidation::IdChangeInvalidation):
1289         (WebCore::Style::IdChangeInvalidation::~IdChangeInvalidation):
1290
1291 2016-02-16  Andreas Kling  <akling@apple.com>
1292
1293         Drop StyleResolver and SelectorQueryCache when entering PageCache.
1294         <https://webkit.org/b/154238>
1295
1296         Reviewed by Antti Koivisto.
1297
1298         Stop keeping these around for cached pages to save lots of memory.
1299         We can easily rebuild them if a cached navigation occurs, and this
1300         way we also don't need to worry about invalidating style for cached
1301         pages in all the right places.
1302
1303         Restoring a cached page will now lead to a forced style recalc.
1304         We don't try to defer this (beyond a zero-timer) since it's going
1305         to happen anyway, and it's nicer to front-load the cost rather than
1306         stuttering on the first user content interaction.
1307
1308         * dom/Document.cpp:
1309         (WebCore::Document::setInPageCache):
1310         * history/CachedPage.cpp:
1311         (WebCore::CachedPage::restore):
1312         (WebCore::CachedPage::clear): Deleted.
1313         * history/CachedPage.h:
1314         (WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
1315         (WebCore::CachedPage::markForFullStyleRecalc): Deleted.
1316         * history/PageCache.cpp:
1317         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
1318         (WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
1319         * history/PageCache.h:
1320         * page/Frame.cpp:
1321         (WebCore::Frame::setPageAndTextZoomFactors): Deleted.
1322         * page/Page.cpp:
1323         (WebCore::Page::setViewScaleFactor): Deleted.
1324         (WebCore::Page::setDeviceScaleFactor): Deleted.
1325         (WebCore::Page::setPagination): Deleted.
1326         (WebCore::Page::setPaginationLineGridEnabled): Deleted.
1327         (WebCore::Page::setVisitedLinkStore): Deleted.
1328
1329 2016-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1330
1331         [GTK] clicking on the scrollbar trough steps rather than jumps to the clicked position
1332         https://bugs.webkit.org/show_bug.cgi?id=115363
1333
1334         Reviewed by Michael Catanzaro.
1335
1336         Allow ScrollbarTheme to decide the behavior of a button press event,
1337         instead of only deciding whether to center on thumb or not. This
1338         way we can match the current GTK+ behavior in WebKit, without
1339         affecting other ports.
1340
1341         * platform/ScrollTypes.h: Add ScrollbarButtonPressAction enum.
1342         * platform/Scrollbar.cpp:
1343         (WebCore::Scrollbar::mouseDown): Ask ScrollbarTheme to handle the
1344         event for the pressed part and do the requested action.
1345         * platform/ScrollbarTheme.cpp:
1346         (WebCore::ScrollbarTheme::handleMousePressEvent): Add default
1347         implementation. It's equivalent to the previous default implementation.
1348         * platform/ScrollbarTheme.h:
1349         * platform/gtk/ScrollbarThemeGtk.cpp:
1350         (WebCore::ScrollbarThemeGtk::handleMousePressEvent): Match current
1351         GTK+ behavior: left click centers on thumb and right click
1352         scrolls. Dragging the thumb works for left and middle buttons.
1353         * platform/gtk/ScrollbarThemeGtk.h:
1354         * platform/ios/ScrollbarThemeIOS.h: Remove shouldCenterOnThumb,
1355         and don't override handleMousePressEvent since iOS wants the
1356         default behavior.
1357         * platform/ios/ScrollbarThemeIOS.mm:
1358         * platform/mac/ScrollbarThemeMac.h: Override handleMousePressEvent
1359         and remove shouldCenterOnThumb.
1360         * platform/mac/ScrollbarThemeMac.mm:
1361         (WebCore::shouldCenterOnThumb): Same implementation just made it
1362         static to be used as helper.
1363         (WebCore::ScrollbarThemeMac::handleMousePressEvent): Return the
1364         desired action keeping the same behavior.
1365         * platform/win/ScrollbarThemeWin.cpp:
1366         (WebCore::ScrollbarThemeWin::handleMousePressEvent): Ditto.
1367         * platform/win/ScrollbarThemeWin.h:
1368         * rendering/RenderScrollbarTheme.h:
1369
1370 2016-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1371
1372         Mouse cursor doesn't change when entering scrollbars
1373         https://bugs.webkit.org/show_bug.cgi?id=154243
1374
1375         Reviewed by Simon Fraser.
1376
1377         If the scrollbar is over or very close to text or a link, when
1378         entering the scrollbar the cursor is not changed, keeping the beam
1379         or hand cursor when using the scrollbar. Same happens for image
1380         documents where the magnifier cursor is used and it remains when
1381         entering the scrollbars. We should use pointer cursor always for
1382         scrollbars.
1383
1384         * page/EventHandler.cpp:
1385         (WebCore::EventHandler::updateCursor): Request also to include
1386         frame scrollbars in hit test result.
1387         (WebCore::EventHandler::selectCursor): Use always pointer cursor
1388         for scrollbars.
1389
1390 2016-02-15  Antti Koivisto  <antti@apple.com>
1391
1392         Optimize style invalidations for attribute selectors
1393         https://bugs.webkit.org/show_bug.cgi?id=154242
1394
1395         Reviewed by Andreas Kling.
1396
1397         Currently we invalidate the whole element subtree if there are any attribute selectors for the changed attribute.
1398         This is slow as generally few if any elements are really affected. Using attribute selectors for dynamic styling
1399         should be performant.
1400
1401         This patch implements optimization strategy for attributes similar to what we already have for classes:
1402
1403         - Collect a map of all rules that contains descendant-affecting attribute selectors for a given attribute.
1404         - When an attribute value changes check if there are any such rules for it.
1405         - Check if the value change affects the results of any of the attribute selectors.
1406         - Only if it does invalidate the exact descendant elements affected by the rules.
1407
1408         Test: fast/css/style-invalidation-attribute-change-descendants.html
1409
1410         * WebCore.xcodeproj/project.pbxproj:
1411         * css/DocumentRuleSets.cpp:
1412         (WebCore::DocumentRuleSets::ancestorClassRules):
1413         (WebCore::DocumentRuleSets::ancestorAttributeRulesForHTML):
1414
1415             Create optimization RuleSets when needed.
1416
1417         * css/DocumentRuleSets.h:
1418         (WebCore::DocumentRuleSets::uncommonAttribute):
1419         (WebCore::DocumentRuleSets::features):
1420         * css/RuleFeature.cpp:
1421         (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
1422         (WebCore::makeAttributeSelectorKey):
1423         (WebCore::RuleFeatureSet::collectFeatures):
1424
1425             Collect rules with descendant affecting attribute selectors.
1426
1427         (WebCore::RuleFeatureSet::add):
1428         (WebCore::RuleFeatureSet::clear):
1429         (WebCore::RuleFeatureSet::shrinkToFit):
1430         * css/RuleFeature.h:
1431         * css/SelectorChecker.cpp:
1432         (WebCore::anyAttributeMatches):
1433         (WebCore::SelectorChecker::attributeSelectorMatches):
1434
1435             Expose function for matching single attribute selectors.
1436
1437         (WebCore::canMatchHoverOrActiveInQuirksMode):
1438         * css/SelectorChecker.h:
1439         * dom/Attr.cpp:
1440         (WebCore::Attr::setValue):
1441         (WebCore::Attr::childrenChanged):
1442         * dom/Element.cpp:
1443         (WebCore::Element::setAttributeInternal):
1444         (WebCore::makeIdForStyleResolution):
1445         (WebCore::Element::attributeChanged):
1446         (WebCore::Element::removeAttributeInternal):
1447         (WebCore::Element::addAttributeInternal):
1448         (WebCore::Element::removeAttribute):
1449
1450             Add AttributeChangeInvalidation where needed.
1451
1452         (WebCore::Element::needsStyleInvalidation):
1453
1454             Move to Element from ClassChangeInvalidation.
1455
1456         (WebCore::Element::willModifyAttribute):
1457
1458             No more full style invalidation on attribute change.
1459
1460         * style/AttributeChangeInvalidation.cpp: Added.
1461         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
1462
1463             Invalidate local style.
1464             Check if we need to invalidate descendants by looking into ancestorAttributeRules.
1465
1466         (WebCore::Style::AttributeChangeInvalidation::invalidateDescendants):
1467
1468             Use StyleInvalidationAnalysis to invalidate the subtree for the relevant rules.
1469
1470         * style/AttributeChangeInvalidation.h: Added.
1471         (WebCore::Style::AttributeChangeInvalidation::needsInvalidation):
1472         (WebCore::Style::AttributeChangeInvalidation::AttributeChangeInvalidation):
1473         (WebCore::Style::AttributeChangeInvalidation::~AttributeChangeInvalidation):
1474
1475             If needed, invalidate descendants before and after attribute change to catch rules that start and stop applying.
1476
1477 2016-02-16  Chris Dumez  <cdumez@apple.com>
1478
1479         Do security checks early in JSDOMWindow::put*()
1480         https://bugs.webkit.org/show_bug.cgi?id=154270
1481
1482         Reviewed by Gavin Barraclough.
1483
1484         Do security checks early in JSDOMWindow::put() / JSDOMWindow::putByIndex()
1485         and return as soon as possible. This makes it less error-prone as we need
1486         to do the security check only once, at the top of the function.
1487
1488         Also lock down the security further by calling lookupPut() only if the
1489         property name is "location". The "location" property is the only one that
1490         can be set cross-origin. Previously, trying to set a property such as
1491         "name" (which cannot be set cross-origin) relied on the attribute setter
1492         doing the security check when getting called. The new check is less error
1493         prone and will correctly prevent overriding window's method cross-origin
1494         once these move down from the prototype (Bug 154120).
1495
1496         Finally, the previous code was failing to set the "location" property
1497         cross-origin after the window has been reified. This patch fixes the
1498         issue by always calling the original "location" property setter from the
1499         static table in the cross-origin case.
1500
1501         Test: http/tests/security/cross-origin-reified-window-location-setting.html
1502
1503         * bindings/js/JSDOMWindowCustom.cpp:
1504         (WebCore::JSDOMWindow::put):
1505         (WebCore::JSDOMWindow::putByIndex):
1506
1507 2016-02-15  Brent Fulgham  <bfulgham@apple.com>
1508
1509         [Mac] Gather some rudimentary statistics during resource load 
1510         https://bugs.webkit.org/show_bug.cgi?id=153575
1511         <rdar://problem/24075254>
1512
1513         Reviewed by Brady Eidson.
1514
1515         Tested by: http/tests/navigation/statistics.html
1516
1517         * CMakeLists.txt:
1518         * PlatformWin.cmake:
1519         * WebCore.xcodeproj/project.pbxproj:
1520         * dom/Document.cpp:
1521         (WebCore::Document::updateLastHandledUserGestureTimestamp): Log user interaction
1522         with the ResourceLoadObserver.
1523         * loader/DocumentLoader.cpp:
1524         (WebCore::DocumentLoader::willSendRequest): Track load statistics if the
1525         user interacted with the document.
1526         * loader/ResourceLoadObserver.cpp: Added.
1527         * loader/ResourceLoadObserver.h: Added.
1528         * loader/ResourceLoadStatistics.cpp: Added.
1529         * loader/ResourceLoadStatistics.h: Added.
1530         * loader/SubresourceLoader.cpp:
1531         (WebCore::SubresourceLoader::willSendRequestInternal): Track load statistics.
1532         * page/Settings.cpp:
1533         (WebCore::Settings::setResourceLoadStatisticsEnabled): Added.
1534         * page/Settings.h:
1535         (WebCore::Settings::resourceLoadStatisticsEnabled): Added.
1536         * platform/Logging.h:
1537         * testing/Internals.cpp:
1538         (WebCore::Internals::resourceLoadStatisticsForOrigin):
1539         (WebCore::Internals::setResourceLoadStatisticsEnabled):
1540         * testing/Internals.h:
1541         * testing/Internals.idl:
1542
1543 2016-02-15  Chris Dumez  <cdumez@apple.com>
1544
1545         The following properties should exist on the global object: AudioTrackList, AudioTrack, VideoTrackList, VideoTrack
1546         https://bugs.webkit.org/show_bug.cgi?id=154250
1547         <rdar://problem/24660829>
1548
1549         Reviewed by Eric Carlson.
1550
1551         The following properties should exist on the global object:
1552         - AudioTrackList, AudioTrack, VideoTrackList, VideoTrack
1553
1554         These interfaces are not marked as [NoInterfaceObject] in:
1555         - https://html.spec.whatwg.org/#audiotracklist-and-videotracklist-objects
1556
1557         No new tests, already covered by existing tests.
1558
1559         * html/track/AudioTrack.idl:
1560         * html/track/AudioTrackList.idl:
1561         * html/track/VideoTrack.idl:
1562         * html/track/VideoTrackList.idl:
1563
1564 2016-02-15  Sam Weinig  <sam@webkit.org>
1565
1566         Stop using NSMapTable in places where we were only using it to be GC safe
1567         <rdar://problem/24063723>
1568         https://bugs.webkit.org/show_bug.cgi?id=154264
1569
1570         Reviewed by Dan Bernstein.
1571
1572         Switch from NSMapTable to HashMap.
1573
1574         * WebCore.xcodeproj/project.pbxproj:
1575         * bindings/objc/DOMInternal.h:
1576         * bindings/objc/DOMInternal.mm:
1577         * bindings/objc/WebScriptObject.mm:
1578         * bridge/objc/objc_instance.mm:
1579         * platform/spi/cocoa/NSPointerFunctionsSPI.h: Removed. No longer used.
1580
1581 2016-02-15  Myles C. Maxfield  <mmaxfield@apple.com>
1582
1583         [Font Loading] Implement FontFace JavaScript object
1584         https://bugs.webkit.org/show_bug.cgi?id=153345
1585
1586         Reviewed by Antti Koivisto.
1587
1588         Test: fast/text/font-face-javascript.html
1589
1590         This patch implements the FontFace Javascript object. This object mostly consists of
1591         style getters / setters, which we implement by parsing input strings and generating
1592         output strings similarly to getComputedStyle(). This object also has a load() function
1593         which returns a promise which will be fulfilled or rejected depending on the load.
1594         There is also a "loaded" attribute which exposes this promise directly. Also, a status
1595         field is exposed so script knows what the state of the load is.
1596
1597         Currently, loading depends on our CachedResourceLoader which is part of the Document,
1598         so this API is not available in a non-document context.
1599
1600         Another caveat is that immediate-mode font loading (where the content provides an
1601         ArrayBuffer containing the bytes of the font file) is forthcoming. This requires
1602         changing the relationship between CSSFontFaceSource and CachedFont.
1603
1604         CSSFontFace has been modified to keep a strong reference to the CSSFontSelector. This
1605         is because the lifetime of the CSSFontFace can now outlive the CSSFontSelector. When
1606         the CSSFontSelector is removed from the Document, it explicitly clears its constituent
1607         CSSFontFaces, thereby breaking the reference cycle.
1608
1609         Test: fast/text/font-face-javascript-expected.html
1610
1611         * CMakeLists.txt: Add new files.
1612         * DerivedSources.cpp: Ditto.
1613         * DerivedSources.make: Ditto.
1614         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1615         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1616         * WebCore.xcodeproj/project.pbxproj: Ditto.
1617         * bindings/js/JSDOMPromise.cpp:
1618         (WebCore::DeferredWrapper::globalObject): Remove whitespace.
1619         (WebCore::DeferredWrapper::deferred): Allow access to the inner JSC object.
1620         * bindings/js/JSDOMPromise.h:
1621         (WebCore::DOMPromise::deferred): Ditto.
1622         * bindings/js/JSFontFaceCustom.cpp: Copied from Source/WebCore/bindings/js/JSDOMPromise.cpp.
1623         (WebCore::JSFontFace::loaded):
1624         (WebCore::JSFontFace::load):
1625         * css/CSSFontFace.cpp:
1626         (WebCore::CSSFontFace::CSSFontFace): 
1627         (WebCore::CSSFontFace::adoptSource):
1628         (WebCore::CSSFontFace::updateStatus): Enforce the state machine's transitions.
1629         (WebCore::CSSFontFace::fontLoaded):
1630         (WebCore::CSSFontFace::pump):
1631         (WebCore::CSSFontFace::load):
1632         * css/CSSFontFace.h:
1633         (WebCore::CSSFontFaceClient::~CSSFontFaceClient):
1634         (WebCore::CSSFontFace::create):
1635         (WebCore::CSSFontFace::status):
1636         * css/CSSFontSelector.cpp:
1637         (WebCore::CSSFontSelector::appendSources): Update for new CSSFontFace API.
1638         (WebCore::CSSFontSelector::registerLocalFontFacesForFamily): Ditto.
1639         (WebCore::CSSFontSelector::addFontFaceRule): Ditto.
1640         (WebCore::CSSFontSelector::kick): Ditto.
1641         (WebCore::appendSources): Deleted.
1642         (WebCore::registerLocalFontFacesForFamily): Deleted.
1643         * css/CSSFontSelector.h:
1644         * css/CSSUnicodeRangeValue.cpp: Use for serializing the "unicodeRange" property.
1645         * css/FontFace.cpp:
1646         (WebCore::createPromise): Implement the remaining Javascript API functions.
1647         (WebCore::valueFromDictionary):
1648         (WebCore::FontFace::create):
1649         (WebCore::FontFace::FontFace):
1650         (WebCore::FontFace::parseString):
1651         (WebCore::FontFace::status):
1652         (WebCore::FontFace::kick):
1653         (WebCore::FontFace::load):
1654         (WebCore::FontFace::fulfillPromise):
1655         (WebCore::FontFace::rejectPromise):
1656         (WebCore::parseString): Deleted.
1657         * css/FontFace.h:
1658         (WebCore::FontFace::promise):
1659         (WebCore::FontFace::backing):
1660         (WebCore::FontFace::create): Deleted.
1661         * css/FontFace.idl: Copied from Source/WebCore/bindings/js/JSDOMPromise.cpp.
1662
1663 2016-02-15  Jer Noble  <jer.noble@apple.com>
1664
1665         Null-deref crash in DefaultAudioDestinationNode::suspend()
1666         https://bugs.webkit.org/show_bug.cgi?id=154248
1667
1668         Reviewed by Alex Christensen.
1669
1670         Drive-by fix: AudioContext should be a reference, not a pointer.
1671
1672         * Modules/webaudio/AnalyserNode.cpp:
1673         (WebCore::AnalyserNode::AnalyserNode):
1674         * Modules/webaudio/AnalyserNode.h:
1675         (WebCore::AnalyserNode::create):
1676         * Modules/webaudio/AudioBasicInspectorNode.cpp:
1677         (WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
1678         (WebCore::AudioBasicInspectorNode::connect):
1679         (WebCore::AudioBasicInspectorNode::disconnect):
1680         (WebCore::AudioBasicInspectorNode::checkNumberOfChannelsForInput):
1681         (WebCore::AudioBasicInspectorNode::updatePullStatus):
1682         * Modules/webaudio/AudioBasicInspectorNode.h:
1683         * Modules/webaudio/AudioBasicProcessorNode.cpp:
1684         (WebCore::AudioBasicProcessorNode::AudioBasicProcessorNode):
1685         (WebCore::AudioBasicProcessorNode::checkNumberOfChannelsForInput):
1686         * Modules/webaudio/AudioBasicProcessorNode.h:
1687         * Modules/webaudio/AudioBufferSourceNode.cpp:
1688         (WebCore::AudioBufferSourceNode::create):
1689         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode):
1690         (WebCore::AudioBufferSourceNode::renderFromBuffer):
1691         (WebCore::AudioBufferSourceNode::setBuffer):
1692         (WebCore::AudioBufferSourceNode::startPlaying):
1693         (WebCore::AudioBufferSourceNode::looping):
1694         (WebCore::AudioBufferSourceNode::setLooping):
1695         * Modules/webaudio/AudioBufferSourceNode.h:
1696         * Modules/webaudio/AudioContext.cpp:
1697         (WebCore::AudioContext::AudioContext):
1698         (WebCore::AudioContext::createBufferSource):
1699         (WebCore::AudioContext::createMediaElementSource):
1700         (WebCore::AudioContext::createMediaStreamDestination):
1701         (WebCore::AudioContext::createScriptProcessor):
1702         (WebCore::AudioContext::createBiquadFilter):
1703         (WebCore::AudioContext::createWaveShaper):
1704         (WebCore::AudioContext::createPanner):
1705         (WebCore::AudioContext::createConvolver):
1706         (WebCore::AudioContext::createDynamicsCompressor):
1707         (WebCore::AudioContext::createAnalyser):
1708         (WebCore::AudioContext::createGain):
1709         (WebCore::AudioContext::createDelay):
1710         (WebCore::AudioContext::createChannelSplitter):
1711         (WebCore::AudioContext::createChannelMerger):
1712         (WebCore::AudioContext::createOscillator):
1713         * Modules/webaudio/AudioContext.h:
1714         (WebCore::operator==):
1715         (WebCore::operator!=):
1716         * Modules/webaudio/AudioDestinationNode.cpp:
1717         (WebCore::AudioDestinationNode::AudioDestinationNode):
1718         (WebCore::AudioDestinationNode::render):
1719         (WebCore::AudioDestinationNode::updateIsEffectivelyPlayingAudio):
1720         * Modules/webaudio/AudioDestinationNode.h:
1721         * Modules/webaudio/AudioNode.cpp:
1722         (WebCore::AudioNode::AudioNode):
1723         (WebCore::AudioNode::connect):
1724         (WebCore::AudioNode::disconnect):
1725         (WebCore::AudioNode::setChannelCount):
1726         (WebCore::AudioNode::setChannelCountMode):
1727         (WebCore::AudioNode::setChannelInterpretation):
1728         (WebCore::AudioNode::scriptExecutionContext):
1729         (WebCore::AudioNode::processIfNecessary):
1730         (WebCore::AudioNode::checkNumberOfChannelsForInput):
1731         (WebCore::AudioNode::propagatesSilence):
1732         (WebCore::AudioNode::pullInputs):
1733         (WebCore::AudioNode::enableOutputsIfNecessary):
1734         (WebCore::AudioNode::deref):
1735         (WebCore::AudioNode::finishDeref):
1736         * Modules/webaudio/AudioNode.h:
1737         (WebCore::AudioNode::context):
1738         * Modules/webaudio/AudioNodeInput.cpp:
1739         (WebCore::AudioNodeInput::connect):
1740         (WebCore::AudioNodeInput::disconnect):
1741         (WebCore::AudioNodeInput::disable):
1742         (WebCore::AudioNodeInput::enable):
1743         (WebCore::AudioNodeInput::updateInternalBus):
1744         (WebCore::AudioNodeInput::bus):
1745         (WebCore::AudioNodeInput::internalSummingBus):
1746         (WebCore::AudioNodeInput::sumAllConnections):
1747         (WebCore::AudioNodeInput::pull):
1748         * Modules/webaudio/AudioNodeOutput.cpp:
1749         (WebCore::AudioNodeOutput::setNumberOfChannels):
1750         (WebCore::AudioNodeOutput::updateNumberOfChannels):
1751         (WebCore::AudioNodeOutput::propagateChannelCount):
1752         (WebCore::AudioNodeOutput::pull):
1753         (WebCore::AudioNodeOutput::bus):
1754         (WebCore::AudioNodeOutput::fanOutCount):
1755         (WebCore::AudioNodeOutput::paramFanOutCount):
1756         (WebCore::AudioNodeOutput::addInput):
1757         (WebCore::AudioNodeOutput::removeInput):
1758         (WebCore::AudioNodeOutput::disconnectAllInputs):
1759         (WebCore::AudioNodeOutput::addParam):
1760         (WebCore::AudioNodeOutput::removeParam):
1761         (WebCore::AudioNodeOutput::disconnectAllParams):
1762         (WebCore::AudioNodeOutput::disable):
1763         (WebCore::AudioNodeOutput::enable):
1764         * Modules/webaudio/AudioNodeOutput.h:
1765         (WebCore::AudioNodeOutput::context):
1766         * Modules/webaudio/AudioParam.cpp:
1767         (WebCore::AudioParam::value):
1768         (WebCore::AudioParam::smooth):
1769         (WebCore::AudioParam::calculateSampleAccurateValues):
1770         (WebCore::AudioParam::calculateFinalValues):
1771         (WebCore::AudioParam::calculateTimelineValues):
1772         (WebCore::AudioParam::connect):
1773         (WebCore::AudioParam::disconnect):
1774         * Modules/webaudio/AudioParam.h:
1775         (WebCore::AudioParam::create):
1776         (WebCore::AudioParam::AudioParam):
1777         * Modules/webaudio/AudioParamTimeline.cpp:
1778         (WebCore::AudioParamTimeline::valueForContextTime):
1779         * Modules/webaudio/AudioParamTimeline.h:
1780         * Modules/webaudio/AudioScheduledSourceNode.cpp:
1781         (WebCore::AudioScheduledSourceNode::AudioScheduledSourceNode):
1782         (WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
1783         (WebCore::AudioScheduledSourceNode::start):
1784         (WebCore::AudioScheduledSourceNode::finish):
1785         * Modules/webaudio/AudioScheduledSourceNode.h:
1786         * Modules/webaudio/AudioSummingJunction.cpp:
1787         (WebCore::AudioSummingJunction::AudioSummingJunction):
1788         (WebCore::AudioSummingJunction::~AudioSummingJunction):
1789         (WebCore::AudioSummingJunction::changedOutputs):
1790         (WebCore::AudioSummingJunction::updateRenderingState):
1791         * Modules/webaudio/AudioSummingJunction.h:
1792         (WebCore::AudioSummingJunction::context):
1793         * Modules/webaudio/BiquadFilterNode.cpp:
1794         (WebCore::BiquadFilterNode::BiquadFilterNode):
1795         * Modules/webaudio/BiquadFilterNode.h:
1796         (WebCore::BiquadFilterNode::create):
1797         * Modules/webaudio/BiquadProcessor.cpp:
1798         (WebCore::BiquadProcessor::BiquadProcessor):
1799         * Modules/webaudio/BiquadProcessor.h:
1800         * Modules/webaudio/ChannelMergerNode.cpp:
1801         (WebCore::ChannelMergerNode::create):
1802         (WebCore::ChannelMergerNode::ChannelMergerNode):
1803         (WebCore::ChannelMergerNode::checkNumberOfChannelsForInput):
1804         * Modules/webaudio/ChannelMergerNode.h:
1805         * Modules/webaudio/ChannelSplitterNode.cpp:
1806         (WebCore::ChannelSplitterNode::create):
1807         (WebCore::ChannelSplitterNode::ChannelSplitterNode):
1808         * Modules/webaudio/ChannelSplitterNode.h:
1809         * Modules/webaudio/ConvolverNode.cpp:
1810         (WebCore::ConvolverNode::ConvolverNode):
1811         (WebCore::ConvolverNode::setBuffer):
1812         * Modules/webaudio/ConvolverNode.h:
1813         (WebCore::ConvolverNode::create):
1814         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1815         (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode):
1816         (WebCore::DefaultAudioDestinationNode::resume):
1817         (WebCore::DefaultAudioDestinationNode::suspend):
1818         (WebCore::DefaultAudioDestinationNode::close):
1819         * Modules/webaudio/DefaultAudioDestinationNode.h:
1820         (WebCore::DefaultAudioDestinationNode::create):
1821         * Modules/webaudio/DelayNode.cpp:
1822         (WebCore::DelayNode::DelayNode):
1823         * Modules/webaudio/DelayNode.h:
1824         (WebCore::DelayNode::create):
1825         * Modules/webaudio/DelayProcessor.cpp:
1826         (WebCore::DelayProcessor::DelayProcessor):
1827         * Modules/webaudio/DelayProcessor.h:
1828         * Modules/webaudio/DynamicsCompressorNode.cpp:
1829         (WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
1830         * Modules/webaudio/DynamicsCompressorNode.h:
1831         (WebCore::DynamicsCompressorNode::create):
1832         * Modules/webaudio/GainNode.cpp:
1833         (WebCore::GainNode::GainNode):
1834         (WebCore::GainNode::checkNumberOfChannelsForInput):
1835         * Modules/webaudio/GainNode.h:
1836         (WebCore::GainNode::create):
1837         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
1838         (WebCore::MediaElementAudioSourceNode::create):
1839         (WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
1840         (WebCore::MediaElementAudioSourceNode::setFormat):
1841         * Modules/webaudio/MediaElementAudioSourceNode.h:
1842         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1843         (WebCore::MediaStreamAudioDestinationNode::create):
1844         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
1845         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
1846         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1847         (WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
1848         (WebCore::MediaStreamAudioSourceNode::setFormat):
1849         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
1850         (WebCore::OfflineAudioDestinationNode::OfflineAudioDestinationNode):
1851         (WebCore::OfflineAudioDestinationNode::offlineRender):
1852         (WebCore::OfflineAudioDestinationNode::notifyComplete):
1853         * Modules/webaudio/OfflineAudioDestinationNode.h:
1854         (WebCore::OfflineAudioDestinationNode::create):
1855         * Modules/webaudio/OscillatorNode.cpp:
1856         (WebCore::OscillatorNode::create):
1857         (WebCore::OscillatorNode::OscillatorNode):
1858         * Modules/webaudio/OscillatorNode.h:
1859         * Modules/webaudio/PannerNode.cpp:
1860         (WebCore::PannerNode::PannerNode):
1861         (WebCore::PannerNode::pullInputs):
1862         (WebCore::PannerNode::process):
1863         (WebCore::PannerNode::listener):
1864         (WebCore::PannerNode::setPanningModel):
1865         * Modules/webaudio/PannerNode.h:
1866         (WebCore::PannerNode::create):
1867         * Modules/webaudio/ScriptProcessorNode.cpp:
1868         (WebCore::ScriptProcessorNode::create):
1869         (WebCore::ScriptProcessorNode::ScriptProcessorNode):
1870         (WebCore::ScriptProcessorNode::initialize):
1871         (WebCore::ScriptProcessorNode::fireProcessEvent):
1872         * Modules/webaudio/ScriptProcessorNode.h:
1873         * Modules/webaudio/WaveShaperNode.cpp:
1874         (WebCore::WaveShaperNode::WaveShaperNode):
1875         (WebCore::WaveShaperNode::setOversample):
1876         * Modules/webaudio/WaveShaperNode.h:
1877         (WebCore::WaveShaperNode::create):
1878
1879 2016-02-15  Jer Noble  <jer.noble@apple.com>
1880
1881         Null-deref crash in DefaultAudioDestinationNode::suspend()
1882         https://bugs.webkit.org/show_bug.cgi?id=154248
1883
1884         Reviewed by Alex Christensen.
1885
1886         Null-check scriptExecutionContext() before deref.
1887
1888         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
1889         (WebCore::DefaultAudioDestinationNode::resume):
1890         (WebCore::DefaultAudioDestinationNode::suspend):
1891         (WebCore::DefaultAudioDestinationNode::close):
1892
1893 2016-02-15  Chris Dumez  <cdumez@apple.com>
1894
1895         XMLHttpRequest / XMLHttpRequestUpload should inherit XMLHttpRequestEventTarget
1896         https://bugs.webkit.org/show_bug.cgi?id=154230
1897
1898         Reviewed by Alex Christensen.
1899
1900         MLHttpRequest / XMLHttpRequestUpload should inherit XMLHttpRequestEventTarget
1901         as per:
1902         https://xhr.spec.whatwg.org/#xmlhttprequesteventtarget
1903
1904         Firefox and Chrome already match the specification.
1905
1906         No new tests, already covered by existing tests.
1907
1908         * CMakeLists.txt:
1909         * DerivedSources.make:
1910         * WebCore.vcxproj/WebCore.vcxproj:
1911         * WebCore.vcxproj/WebCore.vcxproj.filters:
1912         * WebCore.xcodeproj/project.pbxproj:
1913         * xml/XMLHttpRequest.h:
1914         * xml/XMLHttpRequest.idl:
1915         * xml/XMLHttpRequestEventTarget.h: Added.
1916         * xml/XMLHttpRequestEventTarget.idl: Copied from Source/WebCore/xml/XMLHttpRequestUpload.idl.
1917         * xml/XMLHttpRequestUpload.h:
1918         * xml/XMLHttpRequestUpload.idl:
1919
1920 2016-02-15  Jiewen Tan  <jiewen_tan@apple.com>
1921
1922         Refine SimulatedMouseEvent to support Event.isTrusted
1923         https://bugs.webkit.org/show_bug.cgi?id=154133
1924         <rdar://problem/24616246>
1925
1926         Reviewed by Darin Adler.
1927
1928         This patch extracts everything related to create/dispatch SimulatedMouseEvent from MouseEvent.h/cpp
1929         and EventDispatcher.h/cpp, and produces SimulateClick.h/cpp which will handle simulated click solely.
1930         After that, we hide the SimulatedMouseEvent and only expose simulateClick to be called. The reason is
1931         that we both want to tell whether the call sites are from user agent/bindings and keep the
1932         SimulatedMouseEvent intact.
1933
1934         Also, this patch separate Element::dispatchSimulatedClick into two: one for the user agent, and another
1935         for the bindings. Therefore, HTMLElement.click will be treated as untrusted.
1936
1937         Some of the changes in this patch referred Blink r200401:
1938         https://codereview.chromium.org/1285793004
1939
1940         Modified test:
1941         LayoutTests/imported/blink/fast/events/event-trusted.html
1942
1943         * CMakeLists.txt:
1944         * WebCore.xcodeproj/project.pbxproj:
1945         * dom/Element.cpp:
1946         (WebCore::Element::dispatchSimulatedClick):
1947         (WebCore::Element::dispatchSimulatedClickForBindings):
1948         * dom/Element.h:
1949         * dom/EventDispatcher.cpp:
1950         (WebCore::EventDispatcher::dispatchSimulatedClick): Deleted.
1951         * dom/EventDispatcher.h:
1952         * dom/MouseEvent.cpp:
1953         (WebCore::SimulatedMouseEvent::create): Deleted.
1954         (WebCore::SimulatedMouseEvent::~SimulatedMouseEvent): Deleted.
1955         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Deleted.
1956         * dom/MouseEvent.h:
1957         * dom/SimulatedClick.cpp: Added.
1958         (WebCore::simulateMouseEvent):
1959         (WebCore::simulateClick):
1960         * dom/SimulatedClick.h: Added.
1961         * html/HTMLElement.cpp:
1962         (WebCore::HTMLElement::click):
1963
1964 2016-02-15  Joseph Pecoraro  <pecoraro@apple.com>
1965
1966         Web Inspector: Web Workers have no access to console for debugging
1967         https://bugs.webkit.org/show_bug.cgi?id=26237
1968
1969         Reviewed by Timothy Hatcher.
1970
1971         This adds the most basic console message support to Workers.
1972         Messages logged from workers get surfaced through the Page's console.
1973         This lacks support for logging and interacting with arguments,
1974         which would be addressed when adding more complete Worker
1975         debugging tools.
1976
1977         Test: inspector/console/messageAdded-from-worker.html
1978
1979         * CMakeLists.txt:
1980         * WebCore.xcodeproj/project.pbxproj:
1981         Add new files.
1982
1983         * bindings/js/WorkerScriptController.cpp:
1984         (WebCore::WorkerScriptController::~WorkerScriptController):
1985         (WebCore::WorkerScriptController::initScript):
1986         Set the ConsoleClient for the Worker's global object. We route
1987         the messages to the Page's console.
1988
1989         * bindings/js/WorkerScriptController.h:
1990         * workers/WorkerConsoleClient.h: Added.
1991         * workers/WorkerConsoleClient.cpp: Added.
1992         (WebCore::WorkerConsoleClient::WorkerConsoleClient):
1993         (WebCore::WorkerConsoleClient::~WorkerConsoleClient):
1994         (WebCore::WorkerConsoleClient::profile):
1995         (WebCore::WorkerConsoleClient::profileEnd):
1996         (WebCore::WorkerConsoleClient::count):
1997         (WebCore::WorkerConsoleClient::time):
1998         (WebCore::WorkerConsoleClient::timeEnd):
1999         (WebCore::WorkerConsoleClient::timeStamp):
2000         Stub most console methods in a Worker.
2001
2002         (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
2003         Send worker log messages to the global scope and on to the main page.
2004
2005         * workers/WorkerGlobalScope.h:
2006         * workers/WorkerGlobalScope.cpp:
2007         (WebCore::WorkerGlobalScope::addConsoleMessage):
2008         (WebCore::WorkerGlobalScope::addMessageToWorkerConsole):
2009         Ideally we want to converge on simple addConsoleMessage
2010         APIs that just take a ConsoleMessage, without a barrage
2011         of parameters. Add these versions now.
2012
2013 2016-02-15  Alex Christensen  <achristensen@webkit.org>
2014
2015         CMake build fix.
2016
2017         * PlatformMac.cmake:
2018
2019 2016-02-15  Chris Dumez  <cdumez@apple.com>
2020
2021         Regression(r196563): It is no longer possible to call window.addEventListener without an explicit 'this'
2022         https://bugs.webkit.org/show_bug.cgi?id=154245
2023
2024         Reviewed by Ryosuke Niwa.
2025
2026         This patch adds support for calling the EventListener API without an
2027         explicit 'this' value. If no explicit 'this' value is passed, then we
2028         fall back to using the global object. This matches Chrome and Firefox's
2029         behavior. It also fixes the Dromaeo/cssquery-dojo.html test.
2030
2031         Test: fast/dom/Window/addEventListener-implicit-this.html
2032
2033         * bindings/scripts/CodeGeneratorJS.pm:
2034         (GenerateFunctionCastedThis):
2035
2036 2016-02-14  Gavin Barraclough  <barraclough@apple.com>
2037
2038         Organize, deduplicate & comment JSDOMWindowCustom getOwnPropertySlot
2039         https://bugs.webkit.org/show_bug.cgi?id=154224
2040
2041         Reviewed by Chris Dumez.
2042
2043         * bindings/js/JSDOMWindowCustom.cpp:
2044         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2045         (WebCore::jsDOMWindowGetOwnPropertySlotNamedItemGetter):
2046         (WebCore::JSDOMWindow::getOwnPropertySlot):
2047         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2048             - organized property access sequence into a more logical order, removed
2049               duplicated code & added comments.
2050         (WebCore::namedItemGetter): Deleted.
2051             - there was no need for a custom callback here; merged functionality into
2052               jsDOMWindowGetOwnPropertySlotNamedItemGetter.
2053         (WebCore::jsDOMWindowGetOwnPropertySlotCrossOrigin): Deleted.
2054             - renamed to jsDOMWindowGetOwnPropertySlotRestrictedAccess
2055               (this now also handles frameless access).
2056
2057 2016-02-15  Daniel Bates  <dabates@apple.com>
2058
2059         CSP: 'sandbox' should be ignored in report-only mode
2060         https://bugs.webkit.org/show_bug.cgi?id=153167
2061         <rdar://problem/22708669>
2062
2063         Reviewed by Brent Fulgham.
2064
2065         Merged from Blink (patch by Mike West):
2066         <https://src.chromium.org/viewvc/blink?revision=165322&view=revision>
2067
2068         * page/csp/ContentSecurityPolicy.cpp:
2069         (WebCore::ContentSecurityPolicy::reportInvalidDirectiveInReportOnlyMode): Added. Logs a
2070         console message to the console to explain that the specified directive is invalid in
2071         report-only mode.
2072         * page/csp/ContentSecurityPolicy.h:
2073         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2074         (WebCore::ContentSecurityPolicyDirectiveList::applySandboxPolicy): Do not apply sandbox
2075         policy when in report-only mode and call ContentSecurityPolicy::reportInvalidDirectiveInReportOnlyMode()
2076         to log a message to the console.
2077
2078 2016-02-15  Daniel Bates  <dabates@apple.com>
2079
2080         CSP: Allow schemeless source expressions to match an HTTP or HTTPS resource
2081         https://bugs.webkit.org/show_bug.cgi?id=154177
2082         <rdar://problem/22708772>
2083
2084         Reviewed by Brent Fulgham.
2085
2086         Allow a schemeless source expression to match an HTTP or HTTPS subresource when the page is
2087         delivered over HTTP as per section Matching Source Expressions of the Content Security Policy
2088         2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/> (21 July 2015).
2089
2090         Currently we have logic that implements this functionality, but it is guarded behind the compile-
2091         time macro ENABLE(CSP_NEXT) that is disabled by default. Instead we should always compile such
2092         code. In subsequent commits we will move more code out from under the ENABLE(CSP_NEXT)-guard
2093         towards removing the ENABLE_CSP_NEXT macro entirely.
2094
2095         * page/csp/ContentSecurityPolicy.cpp:
2096         (WebCore::ContentSecurityPolicy::protocolMatchesSelf):
2097
2098 2016-02-15  Konstantin Tokarev  <annulen@yandex.ru>
2099
2100         [cmake] Consolidated Linux-specific file lists.
2101         https://bugs.webkit.org/show_bug.cgi?id=154219
2102
2103         Reviewed by Gyuyoung Kim.
2104
2105         No new tests needed.
2106
2107         * PlatformEfl.cmake: Moved Linux files and include dir to Linux.cmake.
2108         * PlatformGTK.cmake: Ditto.
2109         * platform/Linux.cmake: Added.
2110
2111 2016-02-15  Csaba Osztrogonác  <ossy@webkit.org>
2112
2113         Fix the !(ENABLE(SVG_FONTS) || ENABLE(SVG_OTF_CONVERTER)) build after r196322
2114         https://bugs.webkit.org/show_bug.cgi?id=154104
2115
2116         Reviewed by Myles C. Maxfield.
2117
2118         * css/CSSFontFaceSource.cpp:
2119         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
2120
2121 2016-02-14  Antti Koivisto  <antti@apple.com>
2122
2123         Add test for class change style invalidation optimization
2124         https://bugs.webkit.org/show_bug.cgi?id=154226
2125
2126         Reviewed by Myles Maxfield.
2127
2128         Test for https://trac.webkit.org/r196383
2129
2130         Add internals.styleChangeType function.
2131
2132         Test: fast/css/style-invalidation-class-change-descendants.html
2133
2134         * testing/Internals.cpp:
2135         (WebCore::Internals::nodeNeedsStyleRecalc):
2136         (WebCore::asString):
2137         (WebCore::Internals::styleChangeType):
2138         (WebCore::Internals::description):
2139         * testing/Internals.h:
2140         * testing/Internals.idl:
2141
2142 2016-02-14  Simon Fraser  <simon.fraser@apple.com>
2143
2144         [CSS Filters] When applying an SVG filter on a composited image using CSS the image is rendered without the filter
2145         https://bugs.webkit.org/show_bug.cgi?id=154108
2146
2147         Reviewed by Sam Weinig.
2148         
2149         When checking whether we can directly composite an image, we need to check for software-rendered
2150         filters.
2151
2152         Test: compositing/filters/simple-image-with-svg-filter.html
2153
2154         * rendering/RenderLayerBacking.cpp:
2155         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
2156
2157 2016-02-14  Chris Dumez  <cdumez@apple.com>
2158
2159         Drop the [EventTarget] WebKit-specific IDL extended attribute
2160         https://bugs.webkit.org/show_bug.cgi?id=154171
2161
2162         Reviewed by Sam Weinig.
2163
2164         Drop the [EventTarget] WebKit-specific IDL extended attribute now that
2165         all interfaces inherit EventTarget when they should.
2166
2167         No new tests, no Web-Exposed behavior change.
2168
2169         * Modules/battery/BatteryManager.idl:
2170         * Modules/encryptedmedia/MediaKeySession.idl:
2171         * Modules/indexeddb/IDBDatabase.idl:
2172         * Modules/indexeddb/IDBOpenDBRequest.idl:
2173         * Modules/indexeddb/IDBRequest.idl:
2174         * Modules/indexeddb/IDBTransaction.idl:
2175         * Modules/mediasession/MediaRemoteControls.idl:
2176         * Modules/mediasource/MediaSource.idl:
2177         * Modules/mediasource/SourceBuffer.idl:
2178         * Modules/mediasource/SourceBufferList.idl:
2179         * Modules/mediastream/MediaStream.idl:
2180         * Modules/mediastream/MediaStreamTrack.idl:
2181         * Modules/mediastream/RTCDTMFSender.idl:
2182         * Modules/mediastream/RTCDataChannel.idl:
2183         * Modules/mediastream/RTCPeerConnection.idl:
2184         * Modules/notifications/Notification.idl:
2185         * Modules/speech/SpeechSynthesisUtterance.idl:
2186         * Modules/webaudio/AudioContext.idl:
2187         * Modules/webaudio/AudioNode.idl:
2188         * Modules/webaudio/OfflineAudioContext.idl:
2189         * Modules/websockets/WebSocket.idl:
2190         * bindings/scripts/CodeGeneratorGObject.pm:
2191         (ImplementsInterface):
2192         (SkipFunction): Deleted.
2193         (GenerateCFile): Deleted.
2194         * bindings/scripts/CodeGeneratorJS.pm:
2195         (InstanceNeedsVisitChildren):
2196         (GenerateImplementation):
2197         * bindings/scripts/IDLAttributes.txt:
2198         * bindings/scripts/test/TestEventTarget.idl:
2199         * bindings/scripts/test/TestNode.idl:
2200         * css/FontLoader.idl:
2201         * dom/EventTarget.idl:
2202         * dom/MessagePort.idl:
2203         * dom/Node.idl:
2204         * dom/WebKitNamedFlow.idl:
2205         * fileapi/FileReader.idl:
2206         * html/MediaController.idl:
2207         * html/track/AudioTrackList.idl:
2208         * html/track/TextTrack.idl:
2209         * html/track/TextTrackCue.idl:
2210         * html/track/TextTrackList.idl:
2211         * html/track/VideoTrackList.idl:
2212         * loader/appcache/DOMApplicationCache.idl:
2213         * page/DOMWindow.idl:
2214         * page/EventSource.idl:
2215         * page/Performance.idl:
2216         * workers/WorkerGlobalScope.idl:
2217         * xml/XMLHttpRequest.idl:
2218         * xml/XMLHttpRequestUpload.idl:
2219
2220 2016-02-14  Chris Dumez  <cdumez@apple.com>
2221
2222         Unreviewed attempt to fix the Mac CMake build after r196136
2223
2224         * PlatformMac.cmake:
2225
2226 2016-02-14  Chris Dumez  <cdumez@apple.com>
2227
2228         Unreviewed attempt to fix the Windows build.
2229
2230         * Modules/webdatabase/Database.cpp:
2231         * bridge/c/c_utility.cpp:
2232         * platform/MemoryPressureHandler.cpp:
2233
2234 2016-02-14  Chris Dumez  <cdumez@apple.com>
2235
2236         Window and WorkerGlobalScope should inherit EventTarget
2237         https://bugs.webkit.org/show_bug.cgi?id=154170
2238         <rdar://problem/24642377>
2239
2240         Reviewed by Darin Adler.
2241
2242         Window and WorkerGlobalScope should inherit EventTarget instead of
2243         duplicating the EventTarget API in their IDL. These were the last
2244         interfaces that needed fixing. The next step will be to get rid
2245         of the [EventTarget] IDL extended attribute and rely entirely
2246         on the EventTarget inheritance.
2247
2248         Test:
2249         - fast/frames/detached-frame-eventListener.html
2250         - Covered by existing tests.
2251
2252         * WebCore.xcodeproj/project.pbxproj:
2253         Add JSEventTargetCustom.h header to the project.
2254
2255         * bindings/js/JSDOMWindowCustom.cpp:
2256         Drop custom bindings for Window's addEventListener() and
2257         removeEventListener(). The only reason these needed custom
2258         code was to add a check for frameless windows. The frameless
2259         Window checks was moved to the respective methods in the
2260         JSEventTarget generated bindings.
2261
2262         * bindings/js/JSDOMWindowShell.cpp:
2263         (WebCore::JSDOMWindowShell::setWindow):
2264         Set WindowPrototype's prototype to EventTarget's prototype.
2265
2266         * bindings/js/JSDOMWindowShell.h:
2267         * bindings/js/JSDictionary.cpp:
2268         Include "DOMWindow.h" to fix the build.
2269
2270         * bindings/js/JSEventTargetCustom.cpp:
2271         (WebCore::JSEventTarget::toWrapped):
2272         Handle DOMWindow and WorkerGlobalScope explicitely in toWrapped()
2273         and get rid of the DOM_EVENT_TARGET_INTERFACES_FOR_EACH(TRY_TO_UNWRAP_WITH_INTERFACE)
2274         now that all interfaces inherit EventTarget when they should.
2275         The reason DOMWindow and WorkerGlobalScope still need special
2276         handling is because their wrappers (JSDOMWindow /
2277         JSWorkerGlobalScope) do not subclass JSEventTarget.
2278
2279         (WebCore::JSEventTargetOrGlobalScope::create):
2280         * bindings/js/JSEventTargetCustom.h: Added.
2281         (WebCore::JSEventTargetOrGlobalScope::wrapped):
2282         (WebCore::JSEventTargetOrGlobalScope::operator JSC::JSObject&):
2283         (WebCore::JSEventTargetOrGlobalScope::JSEventTargetOrGlobalScope):
2284         Add a wrapper type for JSEventTarget / JSDOMWindow and
2285         JSWorkerGlobalScope for use in the generated bindings. This is
2286         needed because JSDOMWindow and JSWorkerGlobalScope do not
2287         subclass JSEventTarget. Subclassing JSEventTarget would be
2288         complicated for them because they already subclass
2289         JSDOMWindowBase / JSWorkerGlobalScopeBase, which subclasses
2290         JSDOMGlobalObject.
2291
2292         * bindings/js/WorkerScriptController.cpp:
2293         (WebCore::WorkerScriptController::initScript):
2294         Set WorkerGlobalScopePrototype's prototype to EventTarget's prototype.
2295
2296         * bindings/scripts/CodeGeneratorJS.pm:
2297         (ShouldGenerateToJSDeclaration):
2298         Do not generate to toJS() implementation for interfaces that use
2299         the [CustomProxyToJSObject] IDL extended attribute, even if they
2300         inherit EventTarget.
2301
2302         (GetCastingHelperForThisObject):
2303         To initialize castedThis from thisValue JSValue, we now use the
2304         JSEventTargetOrGlobalScope wrapper for the EventTarget
2305         implementation. This is to work around the fact that JSDOMWindow
2306         and JSWorkerGlobalScope do not subclass JSEventTarget.
2307
2308         (GenerateFunctionCastedThis):
2309         - Drop code handling [WorkerGlobalScope] IDL extended attribute
2310           as there is no such attribute.
2311         - Use auto instead of auto* type for castedThis because
2312           JSEventTargetOrGlobalScope::create() returns a unique_ptr.
2313         - Do not check that castedThis inherits JSEventTarget in the
2314           EventTarget bindings code as this no longer holds true.
2315
2316         (GenerateImplementation):
2317         Generate frameless window() and security checks for EventTarget
2318         methods when thisValue is a JSDOMWindow.
2319
2320         * dom/EventTarget.idl:
2321         Add [JSCustomHeader] IDL Extended attribute as we need a header
2322         to expose JSEventTargetOrGlobalScope class.
2323
2324         * page/DOMWindow.idl:
2325         * workers/WorkerGlobalScope.idl:
2326         Inherit EventTarget and stop duplicating the EventTarget API.
2327         This matches the HTML specification.
2328
2329 2016-02-14  Darin Adler  <darin@apple.com>
2330
2331         Small tweaks to some SimpleLineLayout code
2332         https://bugs.webkit.org/show_bug.cgi?id=154229
2333
2334         Reviewed by Zalan Bujtas.
2335
2336         * rendering/SimpleLineLayoutFunctions.cpp:
2337         (WebCore::SimpleLineLayout::paintFlow): Use std::ceil instead of ceilf.
2338         Use auto instead of const auto& for a for loop where the local object is
2339         copied and not a reference.
2340         (WebCore::SimpleLineLayout::hitTestFlow): Use modern for loop.
2341         (WebCore::SimpleLineLayout::collectFlowOverflow): Use std::ceil instead of
2342         ceilf. Use a modern for loop, and use slightly more descriptive local
2343         variable names.
2344         (WebCore::SimpleLineLayout::computeBoundingBox): Use auto instead of
2345         const auto& as above.
2346         (WebCore::SimpleLineLayout::computeFirstRunLocation): Use auto and use
2347         the name "range" for the range rather than the name "it", since the range
2348         is not an iterator.
2349         (WebCore::SimpleLineLayout::collectAbsoluteRects): Use auto instead of
2350         const auto& as above.
2351         (WebCore::SimpleLineLayout::collectAbsoluteQuads): Ditto.
2352         (WebCore::SimpleLineLayout::showLineLayoutForFlow): Use modern for loop.
2353
2354         * rendering/SimpleLineLayoutResolver.cpp:
2355         (WebCore::SimpleLineLayout::RunResolver::Run::text): Convert from a String
2356         to a StringView using the StringView constructor instead of writing out
2357         explicit 8-bit and 16-bit cases.
2358
2359 2016-02-13  Antti Koivisto  <antti@apple.com>
2360
2361         Factor class change style invalidation code into a class
2362         https://bugs.webkit.org/show_bug.cgi?id=154163
2363
2364         Reviewed by Andreas Kling.
2365
2366         Factor this piece of functionality out of Element and into ClassChangeInvalidation class.
2367
2368         * CMakeLists.txt:
2369         * WebCore.vcxproj/WebCore.vcxproj:
2370         * WebCore.xcodeproj/project.pbxproj:
2371         * dom/Element.cpp:
2372         (WebCore::classStringHasClassName):
2373         (WebCore::Element::classAttributeChanged):
2374         (WebCore::collectClasses): Deleted.
2375         (WebCore::computeClassChange): Deleted.
2376         (WebCore::invalidateStyleForClassChange): Deleted.
2377         * style/ClassChangeInvalidation.cpp: Added.
2378         (WebCore::Style::ClassChangeInvalidation::computeClassChange):
2379         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
2380         * style/ClassChangeInvalidation.h: Added.
2381         (WebCore::Style::ClassChangeInvalidation::needsInvalidation):
2382         (WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
2383         (WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
2384
2385 2016-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
2386
2387         [Win] [SVG -> OTF Converter] SVG fonts drawn into ImageBuffers are invisible
2388         https://bugs.webkit.org/show_bug.cgi?id=154222
2389
2390         Reviewed by Antti Koivisto.
2391
2392         Windows ImageBuffer code is sensitive to broken bounding box and
2393         descent code.
2394
2395         Covered by existing tests.
2396
2397         * svg/SVGToOTFFontConversion.cpp:
2398         (WebCore::SVGToOTFFontConverter::appendHHEATable):
2399         (WebCore::SVGToOTFFontConverter::appendOS2Table):
2400         (WebCore::SVGToOTFFontConverter::processGlyphElement):
2401         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2402
2403 2016-02-13  Antti Koivisto  <antti@apple.com>
2404
2405         Add version number for default stylesheet
2406         https://bugs.webkit.org/show_bug.cgi?id=154220
2407
2408         Reviewed by Ryosuke Niwa.
2409
2410         We currently fail to update RuleFeatureSets for shadow trees when the default stylesheet grows
2411         (for example when media controls stylesheet is initialized).
2412
2413         No test since this is not causing known bugs. It is blocking optimizations in shadow trees that
2414         rely on rule features being up-to-date.
2415
2416         * css/CSSDefaultStyleSheets.cpp:
2417         (WebCore::CSSDefaultStyleSheets::loadSimpleDefaultStyle):
2418         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2419
2420             Increment version number when the default stylesheet changes.
2421
2422         * css/CSSDefaultStyleSheets.h:
2423         * css/DocumentRuleSets.cpp:
2424         (WebCore::DocumentRuleSets::appendAuthorStyleSheets):
2425         (WebCore::DocumentRuleSets::collectFeatures):
2426
2427             Store the current default stylesheet version number.
2428
2429         * css/DocumentRuleSets.h:
2430         (WebCore::DocumentRuleSets::features):
2431
2432             Collect features again if the default stylesheet has changed.
2433
2434         * css/StyleResolver.cpp:
2435         (WebCore::StyleResolver::styleForElement):
2436
2437 2016-02-13  Konstantin Tokarev  <annulen@yandex.ru>
2438
2439         [cmake] Consolidate building of GStreamer and OpenWebRTC code.
2440         https://bugs.webkit.org/show_bug.cgi?id=154116
2441
2442         Reviewed by Michael Catanzaro.
2443
2444         No new tests needed.
2445
2446         * PlatformEfl.cmake: Migrated shared code to GStreamer.cmake.
2447         * PlatformGTK.cmake: Ditto.
2448         * platform/GStreamer.cmake: Added.
2449
2450 2016-02-13  Mark Lam  <mark.lam@apple.com>
2451
2452         Add thread violation checks to WebView public APIs.
2453         https://bugs.webkit.org/show_bug.cgi?id=154183
2454
2455         Reviewed by Timothy Hatcher.
2456
2457         No new tests.  Just adding a new thread violation round.
2458
2459         * platform/ThreadCheck.h:
2460         * platform/mac/ThreadCheck.mm:
2461         - Adding WebCoreThreadViolationCheckRoundThree().
2462
2463 2016-02-12  Nan Wang  <n_wang@apple.com>
2464
2465         AX: Implement paragraph related text marker functions using TextIterator
2466         https://bugs.webkit.org/show_bug.cgi?id=154098
2467         <rdar://problem/24269675>
2468
2469         Reviewed by Chris Fleizach.
2470
2471         Using CharacterOffset to implement paragraph related text marker calls. Reused
2472         logic from VisibleUnits class. And refactored textMarkerForCharacterOffset method
2473         to get better performance. Also fixed an issue where we can't navigate through a text
2474         node with line breaks in it using next/previousCharacterOffset call.
2475
2476         Test: accessibility/mac/text-marker-paragraph-nav.html
2477
2478         * accessibility/AXObjectCache.cpp:
2479         (WebCore::AXObjectCache::traverseToOffsetInRange):
2480         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
2481         (WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
2482         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
2483         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
2484         (WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
2485         (WebCore::AXObjectCache::nextNode):
2486         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
2487         (WebCore::AXObjectCache::nextCharacterOffset):
2488         (WebCore::AXObjectCache::previousCharacterOffset):
2489         (WebCore::startWordBoundary):
2490         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
2491         (WebCore::AXObjectCache::endCharacterOffsetOfWord):
2492         (WebCore::AXObjectCache::previousWordStartCharacterOffset):
2493         (WebCore::AXObjectCache::previousWordBoundary):
2494         (WebCore::AXObjectCache::startCharacterOffsetOfParagraph):
2495         (WebCore::AXObjectCache::endCharacterOffsetOfParagraph):
2496         (WebCore::AXObjectCache::paragraphForCharacterOffset):
2497         (WebCore::AXObjectCache::nextParagraphEndCharacterOffset):
2498         (WebCore::AXObjectCache::previousParagraphStartCharacterOffset):
2499         (WebCore::AXObjectCache::rootAXEditableElement):
2500         * accessibility/AXObjectCache.h:
2501         (WebCore::CharacterOffset::remaining):
2502         (WebCore::CharacterOffset::isNull):
2503         (WebCore::CharacterOffset::isEqual):
2504         (WebCore::AXObjectCache::isNodeInUse):
2505         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2506         (+[WebAccessibilityTextMarker textMarkerWithCharacterOffset:cache:]):
2507         (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
2508         (-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
2509         (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
2510         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2511         (startOrEndTextmarkerForRange):
2512         (nextTextMarkerForCharacterOffset):
2513         (previousTextMarkerForCharacterOffset):
2514         (-[WebAccessibilityObjectWrapper nextTextMarkerForCharacterOffset:]):
2515         (-[WebAccessibilityObjectWrapper previousTextMarkerForCharacterOffset:]):
2516         (-[WebAccessibilityObjectWrapper textMarkerForCharacterOffset:]):
2517         (textMarkerForCharacterOffset):
2518         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2519         (-[WebAccessibilityObjectWrapper nextTextMarkerForNode:offset:]): Deleted.
2520         (-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]): Deleted.
2521         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:ignoreStart:]): Deleted.
2522         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]): Deleted.
2523         * editing/VisibleUnits.cpp:
2524         (WebCore::nextSentencePosition):
2525         (WebCore::findStartOfParagraph):
2526         (WebCore::findEndOfParagraph):
2527         (WebCore::startOfParagraph):
2528         (WebCore::endOfParagraph):
2529         * editing/VisibleUnits.h:
2530
2531 2016-02-12  Ryan Haddad  <ryanhaddad@apple.com>
2532
2533         Reset results for bindings tests after r196520
2534
2535         Unreviewed test gardening.
2536
2537         No new tests needed.
2538
2539         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
2540         (webkit_dom_test_event_target_dispatch_event):
2541         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
2542         (webkit_dom_test_node_dispatch_event):
2543
2544 2016-02-12  Saam barati  <sbarati@apple.com>
2545
2546         Attempting build fix from https://bugs.webkit.org/show_bug.cgi?id=154144.
2547
2548         * bindings/js/JSDOMGlobalObject.cpp:
2549         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2550
2551 2016-02-12  Daniel Bates  <dabates@apple.com>
2552
2553         CSP: 'blob:' URLs should not match 'self' in CSP source expression lists.
2554         https://bugs.webkit.org/show_bug.cgi?id=153158
2555         <rdar://problem/24383264>
2556
2557         Reviewed by Brent Fulgham.
2558
2559         A blob URL should not match source 'self' by section Security Considerations for GUID URL schemes
2560         of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/CSP2/> (21 July 2015).
2561
2562         Tests: http/tests/security/contentSecurityPolicy/blob-url-does-not-match-source-self.html
2563                http/tests/security/contentSecurityPolicy/blob-url-matches-source-blob.html
2564
2565         * page/csp/ContentSecurityPolicySourceList.cpp:
2566         (WebCore::ContentSecurityPolicySourceList::matches): Do not make a distinction between URLs that
2567         contain a nested URL (e.g. blob://http://www.example.com/...) and URLs that do not contain a nested
2568         URL. The URL of the requested resource should be matched against the source list source expressions.
2569
2570 2016-02-12  Daniel Bates  <dabates@apple.com>
2571
2572         CSP: Implement child-src directive
2573         https://bugs.webkit.org/show_bug.cgi?id=153562
2574         <rdar://problem/24610087>
2575
2576         Reviewed by Brent Fulgham.
2577
2578         Add support for the child-src directive, <https://w3c.github.io/webappsec-csp/2/#child_src> (29 August 2015),
2579         which formally replaces the deprecated frame-src directive as of the Content Security Policy 2.0 spec. The
2580         child-src directive was first introduced in the Content Security Policy 1.1 spec, <https://www.w3.org/TR/2014/WD-CSP11-20140211/>.
2581
2582         As a side effect of this change, the script URL for a Web Worker is checked against the child-src directive
2583         as opposed to the script-src directive. This is a backward incompatible change from the CSP 1.0 spec.
2584
2585         Tests: http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-blocked.html
2586                http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-redirect-blocked.html
2587                http/tests/security/contentSecurityPolicy/1.1/child-src/frame-src-takes-precedence-over-child-src.html
2588                http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked.html
2589                http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect.html
2590
2591         * loader/DocumentThreadableLoader.cpp:
2592         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Check child-src directive (if applicable).
2593         * loader/ThreadableLoader.h: Add enum value EnforceChildSrcDirective to enum class ContentSecurityPolicyEnforcement to
2594         enforce the child-src directive on redirect.
2595         * page/csp/ContentSecurityPolicy.cpp:
2596         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Added.
2597         * page/csp/ContentSecurityPolicy.h:
2598         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2599         (WebCore::ContentSecurityPolicyDirectiveList::checkSourceAndReportViolation): Add message prefix for a child-src violation.
2600         We use the same message prefix as used by Blink.
2601         (WebCore::ContentSecurityPolicyDirectiveList::allowChildContextFromSource): Added.
2602         (WebCore::ContentSecurityPolicyDirectiveList::allowChildFrameFromSource): Modified to check the frame-src
2603         directive (if specified) before checking the child-src directive by <https://w3c.github.io/webappsec-csp/2/#directive-child-src-nested>.
2604         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the child-src directive.
2605         * page/csp/ContentSecurityPolicyDirectiveList.h:
2606         * workers/AbstractWorker.cpp:
2607         (WebCore::AbstractWorker::resolveURL): Check if the script URL for the worker is allowed by the child-src directive
2608         as opposed to the script-src directive. This is a backwards incompatible change from the CSP 1.0 spec.
2609         * workers/Worker.cpp:
2610         (WebCore::Worker::create): Enforce the child-src directive on redirects (if applicable).
2611
2612 2016-02-12  Saam barati  <sbarati@apple.com>
2613
2614         The parser doesn't properly protect against global variable references in builtins
2615         https://bugs.webkit.org/show_bug.cgi?id=154144
2616
2617         Reviewed by Geoffrey Garen.
2618
2619         Change JS builtins to no longer reference global variables.
2620
2621         No new tests because old tests cover the issues here.
2622
2623         * Modules/mediastream/NavigatorUserMedia.js:
2624         (webkitGetUserMedia):
2625         * Modules/mediastream/RTCPeerConnection.js:
2626         (addIceCandidate):
2627         (getStats):
2628         * Modules/mediastream/RTCPeerConnectionInternals.js:
2629         (setLocalOrRemoteDescription):
2630         * Modules/plugins/QuickTimePluginReplacement.js:
2631         (Replacement.prototype.handleEvent):
2632         * Modules/streams/ByteLengthQueuingStrategy.js:
2633         (initializeByteLengthQueuingStrategy):
2634         * Modules/streams/CountQueuingStrategy.js:
2635         (initializeCountQueuingStrategy):
2636         * Modules/streams/ReadableStreamInternals.js:
2637         (teeReadableStream):
2638         * bindings/js/JSDOMGlobalObject.cpp:
2639         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2640         * bindings/js/WebCoreBuiltinNames.h:
2641
2642 2016-02-12  Jiewen Tan  <jiewen_tan@apple.com>
2643
2644         WebKit should expose the DOM 4 Event.isTrusted property
2645         https://bugs.webkit.org/show_bug.cgi?id=76121
2646         <rdar://problem/22558494>
2647
2648         Reviewed by Darin Adler.
2649
2650         Implements Event.isTrusted. The implementation here is slitely different from and better than
2651         the DOM specification. Here Event.isTrusted will be initialized differently depending on the
2652         callers of the constructors/create methods. If the caller is from user agent, the isTrusted
2653         will be true. Otherwise, it will be false. Since a user agent dispatched event can be catched
2654         and re-initialized/redispatched by the bindings, the flag will be unset at *Event::init*Event
2655         and EventTarget::dispatchEventForBindings. As currently there is no way to let user agent to
2656         dispatch a bindings created event, therefore we ensure that the Event.isTrusted is set for
2657         events dispatched by user agent, and unset for those by bindings.
2658
2659         EventTarget::dispatchEvent(Event*, ExceptionCode&) is renamed to EventTarget::dispatchEventForBindings
2660         in this patch as well. So that, together with the improved design of the API, developers in
2661         the future will be less likely using a wrong dispatchEvent method and setting Event.isTrusted
2662         incorrectly comparing to the DOM design.
2663
2664         After this patch, all events that are created by user agent should be dispatched by
2665         EventTarget::dispatchEvent, and those are created by bindings should be dispatched by
2666         EventTarget::dispatchEventForBindings.
2667
2668         Some of the changes in this patch referred Blink r198996:
2669         https://codereview.chromium.org/1241613004
2670
2671         Test: imported/blink/fast/events/event-trusted.html
2672
2673         * bindings/scripts/CodeGeneratorGObject.pm:
2674         (GenerateEventTargetIface):
2675         * dom/Event.cpp:
2676         (WebCore::Event::Event):
2677         (WebCore::Event::initEvent):
2678         * dom/Event.h:
2679         (WebCore::Event::isTrusted):
2680         (WebCore::Event::setUntrusted):
2681         * dom/Event.idl:
2682         * dom/EventTarget.cpp:
2683         (WebCore::EventTarget::dispatchEventForBindings):
2684         (WebCore::EventTarget::dispatchEvent): Deleted.
2685         * dom/EventTarget.h:
2686         * dom/EventTarget.idl:
2687         * page/DOMWindow.idl:
2688         * page/EventHandler.cpp:
2689         (WebCore::EventHandler::dispatchDragEvent):
2690         * workers/WorkerGlobalScope.idl:
2691
2692 2016-02-12  Brady Eidson  <beidson@apple.com>
2693
2694         Modern IDB: IDBObjectStore and IDBIndex need to be ActiveDOMObjects.
2695         https://bugs.webkit.org/show_bug.cgi?id=154153
2696
2697         Reviewed by Alex Christensen.
2698
2699         No new tests (No testable change in behavior).
2700
2701         This is needed so that IDBObjectStore and IDBIndex JS wrappers are not garbage collected
2702         while their IDBTransaction is still in progress.
2703
2704         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2705         (WebCore::IDBClient::IDBIndex::IDBIndex):
2706         (WebCore::IDBClient::IDBIndex::activeDOMObjectName):
2707         (WebCore::IDBClient::IDBIndex::canSuspendForDocumentSuspension):
2708         (WebCore::IDBClient::IDBIndex::hasPendingActivity):
2709         * Modules/indexeddb/client/IDBIndexImpl.h:
2710         
2711         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2712         (WebCore::IDBClient::IDBObjectStore::create):
2713         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
2714         (WebCore::IDBClient::IDBObjectStore::activeDOMObjectName):
2715         (WebCore::IDBClient::IDBObjectStore::canSuspendForDocumentSuspension):
2716         (WebCore::IDBClient::IDBObjectStore::hasPendingActivity):
2717         (WebCore::IDBClient::IDBObjectStore::index):
2718         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2719         
2720         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2721         (WebCore::IDBClient::IDBTransaction::objectStore):
2722         (WebCore::IDBClient::IDBTransaction::createObjectStore):
2723         (WebCore::IDBClient::IDBTransaction::createIndex):
2724
2725 2016-02-12  Brady Eidson  <beidson@apple.com>
2726
2727         Modern IDB: Simplify the relationship between IDBObjectStore and IDBIndex.
2728         https://bugs.webkit.org/show_bug.cgi?id=154187
2729
2730         Reviewed by Alex Christensen.
2731
2732         Tests: storage/indexeddb/modern/deleteindex-3-private.html
2733                storage/indexeddb/modern/deleteindex-3.html
2734
2735         Instead of allowing IDBIndex to have two different lifecycle modes, it is now always
2736         owned by an IDBObjectStore.
2737         
2738         To support the case where an IDBIndex is deleted from its IDBObjectStore, the object
2739         store simply hangs on to deleted indexes until it is destroyed itself.
2740         
2741         * Modules/indexeddb/client/IDBIndexImpl.cpp:
2742         (WebCore::IDBClient::IDBIndex::markAsDeleted):
2743         (WebCore::IDBClient::IDBIndex::ref):
2744         (WebCore::IDBClient::IDBIndex::deref):
2745         * Modules/indexeddb/client/IDBIndexImpl.h:
2746         
2747         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2748         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
2749         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2750
2751 2016-02-12  Myles C. Maxfield  <mmaxfield@apple.com>
2752
2753         [CSS Font Loading] Implement CSSFontFace Boilerplate
2754         https://bugs.webkit.org/show_bug.cgi?id=154145
2755
2756         Reviewed by Dean Jackson.
2757
2758         The CSS Font Loading spec[1] dictates that the FontFace object needs to have string
2759         accessors and mutators for a bunch of properties. Our CSSFontFace object currently
2760         contains this parsed information, but it isn't accessible via string-based methods.
2761         This patch adds the necessary accessors and mutators, and migrates CSSFontSelector
2762         to use these mutators where necessary.
2763
2764         There is more work to come on CSSFontFace; the next step is to create an .idl file
2765         and hook it up to our CSSFontFace object. In this patch I have left some
2766         unimplemented pieces (for example: where the spec dictates that some operation should
2767         throw a JavaScript exception) which will be implemented in a follow-up patch. This
2768         patch does not have any visible behavior change; I'm separating out the boilerplate
2769         into this patch in order to ease reviewing burden.
2770
2771         This patch separates the externally-facing JavaScript API into a new class, FontFace.
2772         This class owns a CSSFontFace, which provides the backing implementation. There will
2773         be a system of shared ownership of these objects once FontFaceSet is implemented.
2774
2775         No new tests because there is no behavior change.
2776
2777         * CMakeLists.txt: Add new files to CMake builds.
2778         * WebCore.vcxproj/WebCore.vcxproj: Ditto for Windows.
2779         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2780         * WebCore.xcodeproj/project.pbxproj: Ditto for Cocoa.
2781         * css/CSSAllInOne.cpp: Ditto for All-In-One builds.
2782         * css/CSSFontFace.cpp: Move shared code from CSSFontSelector into CSSFontFace.
2783         (WebCore::CSSFontFace::CSSFontFace):
2784         (WebCore::CSSFontFace::~CSSFontFace):
2785         (WebCore::CSSFontFace::setFamilies):
2786         (WebCore::CSSFontFace::setStyle):
2787         (WebCore::CSSFontFace::setWeight):
2788         (WebCore::CSSFontFace::setUnicodeRange):
2789         (WebCore::CSSFontFace::setVariantLigatures):
2790         (WebCore::CSSFontFace::setVariantPosition):
2791         (WebCore::CSSFontFace::setVariantCaps):
2792         (WebCore::CSSFontFace::setVariantNumeric):
2793         (WebCore::CSSFontFace::setVariantAlternates):
2794         (WebCore::CSSFontFace::setVariantEastAsian):
2795         (WebCore::CSSFontFace::setFeatureSettings):
2796         * css/CSSFontFace.h: Clean up.
2797         (WebCore::CSSFontFace::create):
2798         (WebCore::CSSFontFace::families):
2799         (WebCore::CSSFontFace::traitsMask):
2800         (WebCore::CSSFontFace::featureSettings):
2801         (WebCore::CSSFontFace::variantSettings):
2802         (WebCore::CSSFontFace::setVariantSettings):
2803         (WebCore::CSSFontFace::setTraitsMask):
2804         (WebCore::CSSFontFace::isLocalFallback):
2805         (WebCore::CSSFontFace::addRange): Deleted.
2806         (WebCore::CSSFontFace::insertFeature): Deleted.
2807         (WebCore::CSSFontFace::setVariantCommonLigatures): Deleted.
2808         (WebCore::CSSFontFace::setVariantDiscretionaryLigatures): Deleted.
2809         (WebCore::CSSFontFace::setVariantHistoricalLigatures): Deleted.
2810         (WebCore::CSSFontFace::setVariantContextualAlternates): Deleted.
2811         (WebCore::CSSFontFace::setVariantPosition): Deleted.
2812         (WebCore::CSSFontFace::setVariantCaps): Deleted.
2813         (WebCore::CSSFontFace::setVariantNumericFigure): Deleted.
2814         (WebCore::CSSFontFace::setVariantNumericSpacing): Deleted.
2815         (WebCore::CSSFontFace::setVariantNumericFraction): Deleted.
2816         (WebCore::CSSFontFace::setVariantNumericOrdinal): Deleted.
2817         (WebCore::CSSFontFace::setVariantNumericSlashedZero): Deleted.
2818         (WebCore::CSSFontFace::setVariantAlternates): Deleted.
2819         (WebCore::CSSFontFace::setVariantEastAsianVariant): Deleted.
2820         (WebCore::CSSFontFace::setVariantEastAsianWidth): Deleted.
2821         (WebCore::CSSFontFace::setVariantEastAsianRuby): Deleted.
2822         (WebCore::CSSFontFace::CSSFontFace): Deleted.
2823         * css/CSSFontSelector.cpp: Migrate shared code into CSSFontFace, and udpate
2824         to use the new API.
2825         (WebCore::appendSources):
2826         (WebCore::registerLocalFontFacesForFamily):
2827         (WebCore::CSSFontSelector::addFontFaceRule):
2828         (WebCore::computeTraitsMask): Deleted.
2829         (WebCore::createFontFace): Deleted.
2830         * css/FontFace.cpp: Added. External JavaScript API. Owns a CSSFontFace.
2831         (WebCore::FontFace::FontFace):
2832         (WebCore::FontFace::~FontFace):
2833         (WebCore::parseString):
2834         (WebCore::FontFace::setFamily):
2835         (WebCore::FontFace::setStyle):
2836         (WebCore::FontFace::setWeight):
2837         (WebCore::FontFace::setStretch):
2838         (WebCore::FontFace::setUnicodeRange):
2839         (WebCore::FontFace::setVariant):
2840         (WebCore::FontFace::setFeatureSettings):
2841         (WebCore::FontFace::family):
2842         (WebCore::FontFace::style):
2843         (WebCore::FontFace::weight):
2844         (WebCore::FontFace::stretch):
2845         (WebCore::FontFace::unicodeRange):
2846         (WebCore::FontFace::variant):
2847         (WebCore::FontFace::featureSettings):
2848         * css/FontFace.h: Added. Ditto.
2849         (WebCore::FontFace::create):
2850         * css/FontVariantBuilder.cpp: Added. Moved code here from FontVariantBuilder.h.
2851         Refactored to support a new client (CSSFontFace).
2852         (WebCore::extractFontVariantLigatures):
2853         (WebCore::extractFontVariantNumeric):
2854         (WebCore::extractFontVariantEastAsian):
2855         (WebCore::computeFontVariant):
2856         * css/FontVariantBuilder.h: Moved code from here into FontVariantBuilder.cpp.
2857         (WebCore::applyValueFontVariantLigatures): Deleted.
2858         (WebCore::applyValueFontVariantNumeric): Deleted.
2859         (WebCore::applyValueFontVariantEastAsian): Deleted.
2860         * css/StyleBuilderCustom.h: Update for new FontVariantBuilder API.
2861         (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
2862         (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
2863         (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
2864         * platform/text/TextFlags.h: Provide convenience classes.
2865         (WebCore::FontVariantLigaturesValues::FontVariantLigaturesValues):
2866         (WebCore::FontVariantNumericValues::FontVariantNumericValues):
2867         (WebCore::FontVariantEastAsianValues::FontVariantEastAsianValues):
2868
2869 2016-02-12  Jer Noble  <jer.noble@apple.com>
2870
2871         Build fix after r196506; publish MediaResourceLoader.h as a private header so it can be used by
2872         TestWebKitAPI.
2873
2874         * WebCore.xcodeproj/project.pbxproj:
2875
2876 2016-02-11  Jer Noble  <jer.noble@apple.com>
2877
2878         [Mac] Adopt MediaResourceLoader (instead of CachedResourceLoader) in WebCoreNSURLSession.
2879         https://bugs.webkit.org/show_bug.cgi?id=154136
2880
2881         Reviewed by Alex Christensen.
2882
2883         MediaResourceLoader already supports using CORS attribute to verify CORS access requirements
2884         when loading media resources, so use it, rather than CachedResourceLoader, as the backing for
2885         WebCoreNSURLSession.
2886
2887         * platform/network/cocoa/WebCoreNSURLSession.h:
2888         * platform/network/cocoa/WebCoreNSURLSession.mm:
2889         (-[WebCoreNSURLSession delegateQueue]):
2890         (-[WebCoreNSURLSession streamTaskWithNetService:]):
2891         (-[WebCoreNSURLSession isKindOfClass:]):
2892         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
2893         (-[WebCoreNSURLSessionDataTask _restart]):
2894         (-[WebCoreNSURLSessionDataTask _cancel]):
2895         (-[WebCoreNSURLSessionDataTask resume]):
2896         (-[WebCoreNSURLSessionDataTask _timingData]):
2897         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
2898         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
2899         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Deleted.
2900         (-[WebCoreNSURLSession loader]): Deleted.
2901         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent): Deleted.
2902         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived): Deleted.
2903         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived): Deleted.
2904         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived): Deleted.
2905         (WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished): Deleted.
2906         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]): Deleted.
2907         (-[WebCoreNSURLSessionDataTask _finish]): Deleted.
2908         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
2909         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]): Deleted.
2910         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted.
2911         (-[WebCoreNSURLSessionDataTask resourceFinished:]): Deleted.
2912         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2913         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2914
2915 2016-02-12  Alex Christensen  <achristensen@webkit.org>
2916
2917         Fix non-internal builds when using NetworkSession
2918         https://bugs.webkit.org/show_bug.cgi?id=152285
2919
2920         * platform/spi/cf/CFNetworkSPI.h:
2921         Add SPI declaration used in r194156.
2922
2923 2016-02-12  Andreas Kling  <akling@apple.com>
2924
2925         Throw out all live resource decoded data on memory pressure / suspension.
2926         <https://webkit.org/b/154176>
2927
2928         Reviewed by Antti Koivisto.
2929
2930         When pruning live resource decoded data from the memory cache,
2931         we normally avoid pruning anything that's been painted in the last second.
2932         This is an optimization to avoid getting into image decoding loops.
2933
2934         For memory pressure / process suspension scenarios this doesn't really
2935         make sense though:
2936
2937             - In the pressure case, if we have to render again soon it'll likely
2938               be a new GIF frame which we have to decode anyway.
2939
2940             - In the process suspension case, we might *never* render again,
2941               so we should be good citizens and drop all the decoded data we can.
2942
2943         This patch makes us drop all the decoded data, recently painted or not.
2944
2945         * platform/MemoryPressureHandler.cpp:
2946         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2947
2948 2016-02-12  Gavin Barraclough  <barraclough@apple.com>
2949
2950         Separate out !allowsAccess path in JSDOMWindowCustom getOwnPropertySlot
2951         https://bugs.webkit.org/show_bug.cgi?id=154156
2952
2953         Reviewed by Chris Dumez.
2954
2955         JSDOMWindowCustom getOwnPropertySlot currently allows cross-origin access to all
2956         static properties, relying on the property to perform the access check. This is
2957         a little insecure, since it is error prone - someone could easily add a property
2958         to the static table without realizing it would be automatcially exposed.
2959
2960         Instead, add a hard-coded filter to restrict access. As a future implementation
2961         we might consider autogenerating this (the properties are already tagged in IDL,
2962         we might be able to track this in a flag on the static table).
2963
2964         By separating out the handling of the same- and cross-origin access we can
2965         simplify & make the policy being enforced much clearer.
2966
2967         * bindings/js/JSDOMBinding.cpp:
2968         (WebCore::objectToStringFunctionGetter): Deleted.
2969             - removed objectToStringFunctionGetter - this duplicated functionality of
2970               nonCachingStaticFunctionGetter.
2971         * bindings/js/JSDOMBinding.h:
2972         (WebCore::objectToStringFunctionGetter): Deleted.
2973             - removed objectToStringFunctionGetter - this duplicated functionality of
2974               nonCachingStaticFunctionGetter.
2975         * bindings/js/JSDOMWindowCustom.cpp:
2976         (WebCore::jsDOMWindowGetOwnPropertySlotDisallowAccess):
2977             - explicitly handle providing access to only the things we do want to allow cross-origin.
2978         (WebCore::JSDOMWindow::getOwnPropertySlot):
2979         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2980             - push all !allowsAccess handling to jsDOMWindowGetOwnPropertySlotDisallowAccess
2981         (WebCore::childFrameGetter): Deleted.
2982             - this was just a deoptimiztion - moving access into a callback saved very
2983               little & caused more work to be duplicated.
2984
2985 2016-02-12  Sukolsak Sakshuwong  <sukolsak@gmail.com>
2986
2987         Update ICU header files to version 52
2988         https://bugs.webkit.org/show_bug.cgi?id=154160
2989
2990         Reviewed by Alex Christensen.
2991
2992         Update ICU header files to version 52 to allow the use of newer APIs.
2993
2994         No new tests because there is no behavior change.
2995
2996         * icu/unicode/bytestream.h:
2997         * icu/unicode/chariter.h:
2998         * icu/unicode/localpointer.h:
2999         * icu/unicode/platform.h:
3000         * icu/unicode/ptypes.h:
3001         * icu/unicode/putil.h:
3002         * icu/unicode/rep.h:
3003         (Replaceable::Replaceable):
3004         * icu/unicode/std_string.h:
3005         * icu/unicode/strenum.h:
3006         * icu/unicode/stringpiece.h:
3007         * icu/unicode/ubrk.h:
3008         * icu/unicode/uchar.h:
3009         * icu/unicode/ucnv.h:
3010         * icu/unicode/ucol.h:
3011         * icu/unicode/ucoleitr.h:
3012         * icu/unicode/uconfig.h:
3013         * icu/unicode/ucsdet.h:
3014         * icu/unicode/uenum.h:
3015         * icu/unicode/uidna.h:
3016         * icu/unicode/uiter.h:
3017         * icu/unicode/uloc.h:
3018         * icu/unicode/umachine.h:
3019         * icu/unicode/unistr.h:
3020         (UnicodeString::UnicodeString):
3021         (UnicodeString::operator== ):
3022         (UnicodeString::startsWith):
3023         (UnicodeString::setTo):
3024         (UnicodeString::remove):
3025         (UnicodeString::replace): Deleted.
3026         (UnicodeString::extract): Deleted.
3027         (UnicodeString::char32At): Deleted.
3028         (UnicodeString::getChar32Start): Deleted.
3029         (UnicodeString::getChar32Limit): Deleted.
3030         (UnicodeString::getTerminatedBuffer): Deleted.
3031         (UnicodeString::append): Deleted.
3032         (UnicodeString::truncate): Deleted.
3033         * icu/unicode/unorm2.h:
3034         * icu/unicode/uobject.h:
3035         * icu/unicode/urename.h:
3036         * icu/unicode/uscript.h:
3037         * icu/unicode/usearch.h:
3038         * icu/unicode/uset.h:
3039         * icu/unicode/ushape.h:
3040         * icu/unicode/ustring.h:
3041         * icu/unicode/utext.h:
3042         * icu/unicode/utf.h:
3043         * icu/unicode/utf16.h:
3044         * icu/unicode/utf8.h:
3045         * icu/unicode/utf_old.h:
3046         * icu/unicode/utypes.h:
3047         * icu/unicode/uvernum.h:
3048         * icu/unicode/uversion.h:
3049
3050 2016-02-12  Andreas Kling  <akling@apple.com>
3051
3052         [Mac] BitmapImage::decodedDataIsPurgeable() is telling lies and causing massive memory usage.
3053         <https://webkit.org/b/154172>
3054
3055         Reviewed by Antti Koivisto.
3056
3057         The underlying mechanism in CoreAnimation that made this work is no longer in place.
3058
3059         Instead of keeping purgeable frames and juggling volatility bits, we were simply caching
3060         every single frame of large GIF animations, sometimes leading to monstrous memory usage.
3061
3062         Remove the code from WebCore since it's not doing at all what it means to.
3063
3064         Now iOS and Mac will behave the same again, and frame caching decisions will be
3065         made by WebKit, based on total pixel byte size.
3066
3067         * loader/cache/CachedImage.h:
3068         * loader/cache/CachedResource.h:
3069         (WebCore::CachedResource::decodedDataIsPurgeable): Deleted.
3070         * loader/cache/MemoryCache.cpp:
3071         (WebCore::MemoryCache::pruneLiveResourcesToSize): Deleted.
3072         * platform/graphics/BitmapImage.cpp:
3073         (WebCore::BitmapImage::decodedDataIsPurgeable): Deleted.
3074         (WebCore::BitmapImage::destroyDecodedDataIfNecessary): Deleted.
3075         * platform/graphics/BitmapImage.h:
3076         * platform/graphics/Image.h:
3077         (WebCore::Image::decodedDataIsPurgeable): Deleted.
3078         * platform/graphics/cg/BitmapImageCG.cpp:
3079         (WebCore::BitmapImage::decodedDataIsPurgeable): Deleted.
3080         * platform/graphics/cg/ImageSourceCG.cpp:
3081         (WebCore::ImageSource::createFrameAtIndex): Deleted.
3082
3083 2016-02-12  Brady Eidson  <beidson@apple.com>
3084
3085         Modern IDB: Ref cycle between IDBObjectStore and IDBIndex.
3086         https://bugs.webkit.org/show_bug.cgi?id=154110
3087
3088         Reviewed by Darin Adler.
3089
3090         No new tests (Currently untestable).
3091
3092         The lifetime of IDBObjectStore and IDBIndex are closely intertwined, but we have to break the ref cycle.
3093         
3094         This patch does a few semi-gnarly things:
3095         1 - Makes both IDBIndex and IDBObjectStore have a custom marking function so they can add each other as 
3096             opaque roots.
3097         2 - Adds a lock to protect IDBObjectStore's collection of referenced indexes to support #1, as GC marking
3098             can happen on any thread.
3099         3 - Makes IDBIndex not be traditionally RefCounted; Instead, IDBIndex::ref()/deref() simply ref()/deref()
3100             the owning IDBObjectStore.
3101         4 - ...Except when somebody deletes an IDBIndex from its IDBObjectStore. Once that happens, the object
3102             store no longer has a reference back to the index, but the index still needs a reference back to the
3103             object store. To support this, the IDBIndex becomes "traditionally RefCounted" while holding a ref to
3104             its IDBObjectStore.
3105
3106         * CMakeLists.txt:
3107         * WebCore.xcodeproj/project.pbxproj:
3108
3109         * Modules/indexeddb/IDBIndex.h:
3110         (WebCore::IDBIndex::isModern):
3111         * Modules/indexeddb/IDBIndex.idl:
3112         
3113         * Modules/indexeddb/IDBObjectStore.h:
3114         (WebCore::IDBObjectStore::isModern):
3115         * Modules/indexeddb/IDBObjectStore.idl:
3116         
3117         * Modules/indexeddb/client/IDBIndexImpl.cpp:
3118         (WebCore::IDBClient::IDBIndex::objectStore):
3119         (WebCore::IDBClient::IDBIndex::openCursor):
3120         (WebCore::IDBClient::IDBIndex::doCount):
3121         (WebCore::IDBClient::IDBIndex::openKeyCursor):
3122         (WebCore::IDBClient::IDBIndex::doGet):
3123         (WebCore::IDBClient::IDBIndex::doGetKey):
3124         (WebCore::IDBClient::IDBIndex::markAsDeleted):
3125         (WebCore::IDBClient::IDBIndex::ref):
3126         (WebCore::IDBClient::IDBIndex::deref):
3127         (WebCore::IDBClient::IDBIndex::create): Deleted.
3128         * Modules/indexeddb/client/IDBIndexImpl.h:
3129         (WebCore::IDBClient::IDBIndex::modernObjectStore):
3130         
3131         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3132         (WebCore::IDBClient::IDBObjectStore::createIndex):
3133         (WebCore::IDBClient::IDBObjectStore::index):
3134         (WebCore::IDBClient::IDBObjectStore::deleteIndex):
3135         (WebCore::IDBClient::IDBObjectStore::visitReferencedIndexes):
3136         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
3137         
3138         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3139         (WebCore::IDBClient::IDBTransaction::createIndex):
3140         * Modules/indexeddb/client/IDBTransactionImpl.h:
3141         
3142         * Modules/indexeddb/legacy/LegacyIndex.cpp:
3143         (WebCore::LegacyIndex::ref):
3144         (WebCore::LegacyIndex::deref):
3145         * Modules/indexeddb/legacy/LegacyIndex.h:
3146         
3147         * bindings/js/JSIDBIndexCustom.cpp: Added.
3148         (WebCore::JSIDBIndex::visitAdditionalChildren):
3149         
3150         * bindings/js/JSIDBObjectStoreCustom.cpp:
3151         (WebCore::JSIDBObjectStore::visitAdditionalChildren):
3152
3153 2016-02-12  Csaba Osztrogonác  <ossy@webkit.org>
3154
3155         [EFL][GTK] Fix ENABLE(SVG_OTF_CONVERTER) build
3156         https://bugs.webkit.org/show_bug.cgi?id=154165
3157
3158         Reviewed by Alex Christensen.
3159
3160         * CMakeLists.txt:
3161         * css/CSSFontFaceSource.cpp:
3162         (WebCore::CSSFontFaceSource::font):
3163         * svg/SVGToOTFFontConversion.cpp:
3164         * svg/SVGToOTFFontConversion.h:
3165
3166 2016-02-12  Chris Dumez  <cdumez@apple.com>
3167
3168         Unreviewed nit fixes after r196466.
3169
3170         * Modules/speech/SpeechSynthesisUtterance.idl: Fix curly bracket
3171           placement.
3172         * bindings/scripts/CodeGeneratorJS.pm:
3173         (GenerateHeader): Use wrappableObject instead of domObject.
3174         * bindings/scripts/test/*: Rebaseline.
3175         * dom/WebKitNamedFlow.idl: Drop unnecessary #if case.
3176
3177 2016-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3178
3179         [GTK] Properly handle classes inheriting from EventTarget
3180         https://bugs.webkit.org/show_bug.cgi?id=154158
3181
3182         Reviewed by Michael Catanzaro.
3183
3184         Instead of removing its parent we now handle the case of classes
3185         having EventTarget as parent to make them implement the interface
3186         instead.
3187
3188         * bindings/scripts/CodeGeneratorGObject.pm:
3189         (ShouldBeExposedAsInterface): Whether the parent given class
3190         should be exposed as an interface instead of a parent class.
3191         (GetParentClassName): Return Object as parent for classes having
3192         a parent that should be exposed as an interface.
3193         (GetParentImplClassName): Ditto.
3194         (GetBaseClass): Ditto.
3195         (GetParentGObjType): Ditto.
3196         (SkipFunction): Add FIXME comment.
3197         (ImplementsInterface): Helper function to check if a class
3198         implements the given interface.
3199         (GenerateCFile): Check whether the class implements EventTarget to
3200         generate the interface implementation.
3201         (GenerateInterface): Do not remove the parent class when it's EventTarget.
3202
3203 2016-02-12  Commit Queue  <commit-queue@webkit.org>
3204
3205         Unreviewed, rolling out r196470.
3206         https://bugs.webkit.org/show_bug.cgi?id=154167
3207
3208         Broke some tests (Requested by anttik on #webkit).
3209
3210         Reverted changeset:
3211
3212         "Factor class change style invalidation code into a class"
3213         https://bugs.webkit.org/show_bug.cgi?id=154163
3214         http://trac.webkit.org/changeset/196470
3215
3216 2016-02-12  Antti Koivisto  <antti@apple.com>
3217
3218         Factor class change style invalidation code into a class
3219         https://bugs.webkit.org/show_bug.cgi?id=154163
3220
3221         Reviewed by Andreas Kling.
3222
3223         Factor this piece of functionality out of Element and into ClassChangeInvalidation class.
3224
3225         * CMakeLists.txt:
3226         * WebCore.vcxproj/WebCore.vcxproj:
3227         * WebCore.xcodeproj/project.pbxproj:
3228         * dom/Element.cpp:
3229         (WebCore::classStringHasClassName):
3230         (WebCore::Element::classAttributeChanged):
3231         (WebCore::collectClasses): Deleted.
3232         (WebCore::computeClassChange): Deleted.
3233         (WebCore::invalidateStyleForClassChange): Deleted.
3234         * style/ClassChangeInvalidation.cpp: Added.
3235         (WebCore::Style::ClassChangeInvalidation::computeClassChange):
3236         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
3237         * style/ClassChangeInvalidation.h: Added.
3238         (WebCore::Style::ClassChangeInvalidation::needsInvalidation):
3239         (WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
3240         (WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
3241
3242 2016-02-12  Csaba Osztrogonác  <ossy@webkit.org>
3243
3244         GCC buildfix in Source/WebCore/svg/SVGToOTFFontConversion.cpp
3245         https://bugs.webkit.org/show_bug.cgi?id=154162
3246
3247         Reviewed by Andreas Kling.
3248
3249         * svg/SVGToOTFFontConversion.cpp:
3250         (WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable):
3251
3252 2016-02-12  Andreas Kling  <akling@apple.com>
3253
3254         Don't invalidate the FontCache on memory pressure.
3255         <https://webkit.org/b/154161>
3256
3257         Reviewed by Antti Koivisto.
3258
3259         Invalidating the FontCache does more harm than good:
3260
3261             - Anything that's still in the cache at this point is also
3262               referenced outside the cache, thus will not actually get deleted.
3263
3264             - Future deduplication will fail, leading to more objects.
3265
3266             - The global FontCache generation gets bumped, causing future style
3267               recalcs to be less efficient and breaking style sharing.
3268
3269             - All FontSelector invalidation callbacks will fire, potentially
3270               causing forced full-document style recalcs.
3271
3272         In fact, the only win from invalidating the FontCache comes from some
3273         minor shrinkage in the containers that make up the cache itself.
3274
3275         * platform/MemoryPressureHandler.cpp:
3276         (WebCore::MemoryPressureHandler::releaseCriticalMemory): Deleted.
3277
3278 2016-02-11  Chris Dumez  <cdumez@apple.com>
3279
3280         [Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
3281         https://bugs.webkit.org/show_bug.cgi?id=154121
3282         <rdar://problem/24613234>
3283
3284         Reviewed by Gavin Barraclough.
3285
3286         Interfaces should inherit EventTarget instead of duplicating the
3287         EventTarget API in their IDL. Not only the duplication is ugly and
3288         error-prone, but this also does not match the specifications and
3289         have subtle web-exposed differences.
3290
3291         This patch takes care of all interfaces except for DOMWindow and
3292         WorkerGlobalScope. Those will be updated in the follow-up patch
3293         as they will require a little bit more work and testing.
3294
3295         We should also be able to get rid of the [EventTarget] WebKit IDL
3296         attribute in a follow-up.
3297
3298         No new tests, already covered by existing tests.
3299
3300         * Modules/battery/BatteryManager.idl:
3301         * Modules/encryptedmedia/MediaKeySession.idl:
3302         * Modules/indexeddb/IDBDatabase.h:
3303         * Modules/indexeddb/IDBDatabase.idl:
3304         * Modules/indexeddb/IDBRequest.h:
3305         * Modules/indexeddb/IDBRequest.idl:
3306         * Modules/indexeddb/IDBTransaction.h:
3307         * Modules/indexeddb/IDBTransaction.idl:
3308         * Modules/mediasession/MediaRemoteControls.idl:
3309         * Modules/mediasource/MediaSource.h:
3310         * Modules/mediasource/MediaSource.idl:
3311         * Modules/mediasource/SourceBuffer.h:
3312         * Modules/mediasource/SourceBuffer.idl:
3313         * Modules/mediasource/SourceBufferList.h:
3314         * Modules/mediasource/SourceBufferList.idl:
3315         * Modules/mediastream/MediaStream.h:
3316         * Modules/mediastream/MediaStream.idl:
3317         * Modules/mediastream/MediaStreamTrack.h:
3318         * Modules/mediastream/MediaStreamTrack.idl:
3319         * Modules/mediastream/RTCDTMFSender.h:
3320         * Modules/mediastream/RTCDTMFSender.idl:
3321         * Modules/mediastream/RTCDataChannel.h:
3322         * Modules/mediastream/RTCDataChannel.idl:
3323         * Modules/mediastream/RTCPeerConnection.h:
3324         * Modules/mediastream/RTCPeerConnection.idl:
3325         * Modules/notifications/Notification.idl:
3326         * Modules/speech/SpeechSynthesisUtterance.idl:
3327         * Modules/webaudio/AudioContext.idl:
3328         * Modules/webaudio/AudioNode.idl:
3329         * Modules/websockets/WebSocket.idl:
3330         * css/FontLoader.idl:
3331         * dom/EventTarget.h:
3332         * dom/MessagePort.idl:
3333         * dom/Node.h:
3334         * dom/Node.idl:
3335         * dom/WebKitNamedFlow.idl:
3336         * fileapi/FileReader.idl:
3337         * html/MediaController.idl:
3338         * html/track/AudioTrackList.idl:
3339         * html/track/TextTrack.idl:
3340         * html/track/TextTrackCue.idl:
3341         * html/track/TextTrackList.idl:
3342         * html/track/VideoTrackList.idl:
3343         * loader/appcache/DOMApplicationCache.h:
3344         * loader/appcache/DOMApplicationCache.idl:
3345         * page/EventSource.idl:
3346         * page/Performance.h:
3347         * page/Performance.idl:
3348         * workers/Worker.idl:
3349         * xml/XMLHttpRequest.h:
3350         * xml/XMLHttpRequest.idl:
3351         * xml/XMLHttpRequestUpload.idl:
3352         - Drop hardcoded EventTarget operations and inherit EventTarget instead.
3353         - Drop JSGenerateToNativeObject / JSGenerateToJSObject IDL extended
3354           attributes for interfaces inheriting the EventTarget interface as
3355           the bindings generator now does this automatically for us.
3356         - On native side, have EventTarget subclass ScriptWrappable instead of
3357           each of its subclasses doing so. The issue was that
3358           EventTargetOwner::finalize() was calling uncacheWrapper() with an
3359           EventTarget*, which would not clear inlined cached wrapped (see
3360           clearInlineCachedWrapper()) because EventTarget did not subclass
3361           ScriptWrappable. However, cacheWrapper() is called is a specific
3362           subtype pointer (e.g. Node*) and we would decide to create an
3363           inline cached wrapper because Node subclassed ScriptWrappable
3364           (as well as EventTarget).
3365
3366         * WebCore.xcodeproj/project.pbxproj:
3367         Export JSEventTarget.h as private header to fix the build.
3368
3369         * bindings/js/JSDOMBinding.h:
3370         (WebCore::wrapperKey):
3371         (WebCore::getCachedWrapper):
3372         (WebCore::cacheWrapper):
3373         (WebCore::uncacheWrapper):
3374         Use new wrapperKey() function that is generated for each bindings
3375         class that also has wrapperOwner(). This is used instead of the
3376         C cast to void* in order to cast to the base wrapped type to fix
3377         issues with multiple inheritance. The issue was that cacheWrapper()
3378         was getting called with a DOM object subtype pointer (e.g.
3379         AudioContext*) but uncacheWrapper() was getting called with a base
3380         wrapped type pointer (e.g. EventTarget*). Most of our DOM classes
3381         use multiple inheritance and thus the pointer values (used as keys
3382         in the weak map) may differ.
3383
3384         * bindings/js/JSTrackCustom.cpp:
3385         (WebCore::toJS):
3386         Call CREATE_DOM_WRAPPER() with an actual wrapped type (e.g. AudioTrack)
3387         instead of TrackBase type. TrackBase does not have corresponding
3388         generated bindings and therefore does not have a wrapperKey()
3389         function.
3390
3391         * bindings/scripts/CodeGeneratorJS.pm:
3392         (ShouldGenerateToWrapped):
3393         (ShouldGenerateToJSDeclaration):
3394         (GenerateHeader):
3395         - Generate a wrapperKey() utility function along-side wrapperOwner()
3396           to help cast to the base wrapped type.
3397         - Generate toWrapped() / toJS() utility functions for interfaces
3398           that inherit EventTarget as those are required by our
3399           implementation and this avoids having to explicitly have them in
3400           the IDL.
3401
3402         * bindings/scripts/test/*:
3403         Rebaseline bindings tests.
3404
3405 2016-02-11  Brent Fulgham  <bfulgham@apple.com>
3406
3407         Optimize texture-complete checks
3408         https://bugs.webkit.org/show_bug.cgi?id=98308
3409
3410         Reviewed by Dean Jackson.
3411
3412         No new tests: No change in behavior.
3413
3414         * html/canvas/WebGLRenderingContextBase.cpp:
3415         (WebCore::WebGLRenderingContextBase::initializeNewContext): Initially consider all
3416         textures as suspect.
3417         (WebCore::WebGLRenderingContextBase::extensions): New helper function.
3418         (WebCore::WebGLRenderingContextBase::reshape): Mark textures as invalid when appropriate.
3419         (WebCore::WebGLRenderingContextBase::bindTexture): Identify invalid textures and mark
3420         them for later fix-up. Likewise, remove 'known good' textures from the fix-up pass.
3421         (WebCore::WebGLRenderingContextBase::deleteTexture): Remove instances of the deleted texture
3422         from our set of invalid textures.
3423         (WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Only iterate through
3424         the 'bad' textures, rather than checking every single texture.
3425         * html/canvas/WebGLRenderingContextBase.h:
3426
3427 2016-02-11  Alex Christensen  <achristensen@webkit.org>
3428
3429         Assert that IDBTransaction::transitionedToFinishing transitions to finishing.
3430         https://bugs.webkit.org/show_bug.cgi?id=154061
3431
3432         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3433         (WebCore::IDBClient::IDBTransaction::transitionedToFinishing):
3434         Added assertion that we are transitioning to a finished or finishing state, based on Darin's feedback.
3435
3436 2016-02-11  Enrica Casucci  <enrica@apple.com>
3437
3438         WebContent process crashes when performing data detection on content with existing data detector links.
3439         https://bugs.webkit.org/show_bug.cgi?id=154118
3440         rdar://problem/24511860
3441
3442         Reviewed by Tim Horton.
3443
3444         The DOM mutation caused by removing the existing links, can shift the range endpoints.
3445         We now save the range enpoints as positions so that we can recreate the ranges,
3446         if a DOM mutation occurred.
3447
3448         * editing/cocoa/DataDetection.mm:
3449         (WebCore::removeResultLinksFromAnchor):
3450         (WebCore::searchForLinkRemovingExistingDDLinks):
3451         (WebCore::DataDetection::detectContentInRange):
3452
3453 2016-02-11  Jer Noble  <jer.noble@apple.com>
3454
3455         Make MediaResourceLoader behave more like a CachedResourceLoader.
3456         https://bugs.webkit.org/show_bug.cgi?id=154117
3457
3458         Reviewed by Alex Christensen.
3459
3460         MediaResourceLoader currently can only handle a single request at a time. Split the class
3461         into two, MediaResourceLoader and MediaResource, effectively wrapping CachedResourceLoader
3462         and CachedRawResource respectively. With this devision, the same loader can be used to issue
3463         multiple simultaneous resource requests.
3464
3465         This necessecitates splitting PlatformMediaResource into two classes as well.  To simplify
3466         the HTMLMediaElement, MediaPlayer, and MediaPlayerClient APIs, do not require a client
3467         object when creating the loader; instead, the client is required to create the resource.
3468         This also matches the CachedRawResource API.
3469
3470         * html/HTMLMediaElement.cpp:
3471         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader): Remove the client parameter.
3472         * html/HTMLMediaElement.h:
3473         * loader/MediaResourceLoader.cpp:
3474         (WebCore::MediaResourceLoader::MediaResourceLoader):
3475         (WebCore::MediaResourceLoader::~MediaResourceLoader):
3476         (WebCore::MediaResourceLoader::requestResource): Renamed from start().
3477         (WebCore::MediaResourceLoader::removeResource): Remove resource from live resource list.
3478         (WebCore::MediaResource::create): Utility factory.
3479         (WebCore::MediaResource::MediaResource):
3480         (WebCore::MediaResource::~MediaResource):
3481         (WebCore::MediaResource::stop): Moved from MediaResourceLoader.
3482         (WebCore::MediaResource::setDefersLoading): Ditto.
3483         (WebCore::MediaResource::responseReceived): Ditto.
3484         (WebCore::MediaResource::redirectReceived): Ditto.
3485         (WebCore::MediaResource::dataSent): Ditto.
3486         (WebCore::MediaResource::dataReceived): Ditto.
3487         (WebCore::MediaResource::notifyFinished): Ditto.
3488         (WebCore::MediaResource::getOrCreateReadBuffer): Ditto.
3489         * loader/MediaResourceLoader.h:
3490         * platform/graphics/MediaPlayer.cpp:
3491         (WebCore::MediaPlayer::createResourceLoader):
3492         * platform/graphics/MediaPlayer.h:
3493         (WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
3494         * platform/graphics/PlatformMediaResourceLoader.h:
3495         (WebCore::PlatformMediaResourceClient::~PlatformMediaResourceClient): Renamed from PlatformMediaResourceLoaderClient.
3496         (WebCore::PlatformMediaResourceClient::responseReceived): Client methods now take a reference to the resource.
3497         (WebCore::PlatformMediaResourceClient::redirectReceived): Ditto.
3498         (WebCore::PlatformMediaResourceClient::dataSent): Ditto. 
3499         (WebCore::PlatformMediaResourceClient::dataReceived): Ditto.
3500         (WebCore::PlatformMediaResourceClient::accessControlCheckFailed): Ditto.
3501         (WebCore::PlatformMediaResourceClient::loadFailed): Ditto.
3502         (WebCore::PlatformMediaResourceClient::loadFinished): Ditto.
3503         (WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Ditto.
3504         (WebCore::PlatformMediaResourceLoader::PlatformMediaResourceLoader): Ditto.
3505         (WebCore::PlatformMediaResource::PlatformMediaResource): 
3506         (WebCore::PlatformMediaResource::~PlatformMediaResource): 
3507         (WebCore::PlatformMediaResource::setClient):
3508         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3509         (webKitWebSrcStart):
3510         (webKitWebSrcNeedData):
3511         (webKitWebSrcEnoughData):
3512         (CachedResourceStreamingClient::getOrCreateReadBuffer):
3513         (CachedResourceStreamingClient::responseReceived):
3514         (CachedResourceStreamingClient::dataReceived):
3515         (CachedResourceStreamingClient::accessControlCheckFailed):
3516         (CachedResourceStreamingClient::loadFailed):
3517         (CachedResourceStreamingClient::loadFinished):
3518
3519 2016-02-11  Zalan Bujtas  <zalan@apple.com>
3520
3521         Subpixel rendering: Make focusring painting subpixel aware.
3522         https://bugs.webkit.org/show_bug.cgi?id=154111
3523
3524         Reviewed by David Hyatt.
3525
3526         Do not integral snap focusring rects while collecting them (use device pixel snapping instead
3527         right before passing them to GraphicsContext::drawFocusRing).
3528
3529         Unable to test.
3530
3531         * platform/graphics/GraphicsContext.h:
3532         * platform/graphics/displaylists/DisplayListItems.h:
3533         (WebCore::DisplayList::DrawFocusRingRects::create):
3534         (WebCore::DisplayList::DrawFocusRingRects::rects):
3535         (WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
3536         * platform/graphics/displaylists/DisplayListRecorder.cpp:
3537         (WebCore::DisplayList::Recorder::drawFocusRing):
3538         * platform/graphics/displaylists/DisplayListRecorder.h:
3539         * platform/graphics/mac/GraphicsContextMac.mm:
3540         (WebCore::GraphicsContext::drawFocusRing):
3541         * rendering/RenderBlock.cpp:
3542         (WebCore::RenderBlock::addFocusRingRectsForInlineChildren):
3543         (WebCore::RenderBlock::addFocusRingRects):
3544         * rendering/RenderBlock.h:
3545         * rendering/RenderBlockFlow.cpp:
3546         (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
3547         * rendering/RenderBlockFlow.h:
3548         * rendering/RenderBox.cpp:
3549         (WebCore::RenderBox::addFocusRingRects):
3550         * rendering/RenderBox.h:
3551         * rendering/RenderElement.cpp:
3552         (WebCore::RenderElement::paintFocusRing):
3553         (WebCore::RenderElement::issueRepaintForOutlineAuto):
3554         * rendering/RenderInline.cpp:
3555         (WebCore::RenderInline::absoluteRects):
3556         (WebCore::RenderInline::addFocusRingRects):
3557         * rendering/RenderInline.h:
3558         * rendering/RenderListBox.cpp:
3559         (WebCore::RenderListBox::addFocusRingRects):
3560         * rendering/RenderListBox.h:
3561         * rendering/RenderObject.cpp:
3562         (WebCore::RenderObject::addPDFURLRect):
3563         (WebCore::RenderObject::absoluteFocusRingQuads):
3564         * rendering/RenderObject.h:
3565         (WebCore::RenderObject::addFocusRingRects):
3566         * rendering/RenderTextControl.cpp:
3567         (WebCore::RenderTextControl::addFocusRingRects):
3568         * rendering/RenderTextControl.h:
3569         * rendering/svg/RenderSVGContainer.cpp:
3570         (WebCore::RenderSVGContainer::addFocusRingRects):
3571         * rendering/svg/RenderSVGContainer.h:
3572         * rendering/svg/RenderSVGImage.cpp:
3573         (WebCore::RenderSVGImage::addFocusRingRects):
3574         * rendering/svg/RenderSVGImage.h:
3575         * rendering/svg/RenderSVGShape.cpp:
3576         (WebCore::RenderSVGShape::addFocusRingRects):
3577         * rendering/svg/RenderSVGShape.h:
3578
3579 2016-02-11  Myles C. Maxfield  <mmaxfield@apple.com>
3580
3581         Addressing post-review comments after r196393
3582
3583         Unreviewed.
3584
3585         * css/CSSFontSelector.cpp:
3586         (WebCore::CSSFontSelector::getFontFace):
3587         * css/CSSSegmentedFontFace.h:
3588
3589 2016-02-11  Antti Koivisto  <antti@apple.com>
3590
3591         Rename Element::style() to Element::cssomStyle()
3592         https://bugs.webkit.org/show_bug.cgi?id=154107
3593
3594         Reviewed by Alex Christensen.
3595
3596         It implements the IDL "style" attribute that returns a CSSOM object.
3597         Inside WebCore "style" generally refers to a RenderStyle.
3598
3599         * dom/Element.cpp:
3600         (WebCore::Element::hasAttributeNS):
3601         (WebCore::Element::cssomStyle):
3602         (WebCore::Element::focus):
3603         (WebCore::Element::style): Deleted.
3604         * dom/Element.h:
3605         (WebCore::Element::tagQName):
3606         * dom/Element.idl:
3607         * dom/StyledElement.cpp:
3608         (WebCore::StyledElement::~StyledElement):
3609         (WebCore::StyledElement::cssomStyle):
3610         (WebCore::StyledElement::style): Deleted.
3611         * dom/StyledElement.h:
3612         (WebCore::StyledElement::synchronizeStyleAttributeInternal):
3613         (WebCore::StyledElement::collectStyleForPresentationAttribute):
3614         * editing/Editor.cpp:
3615         (WebCore::Editor::applyEditingStyleToElement):
3616         * inspector/InspectorCSSAgent.cpp:
3617         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
3618         (WebCore::InspectorCSSAgent::getInlineStylesForNode):
3619         (WebCore::InspectorCSSAgent::asInspectorStyleSheet):
3620         * inspector/InspectorStyleSheet.cpp:
3621         (WebCore::InspectorStyleSheetForInlineStyle::didModifyElementAttribute):
3622         (WebCore::InspectorStyleSheetForInlineStyle::inlineStyle):
3623         (WebCore::InspectorStyleSheetForInlineStyle::elementStyleText):
3624         * svg/SVGElement.idl:
3625
3626 2016-02-11  Konstantin Tokarev  <annulen@yandex.ru>
3627
3628         [cmake] Consolidate TextureMapper file and include dir lists.
3629         https://bugs.webkit.org/show_bug.cgi?id=154106
3630
3631         Reviewed by Michael Catanzaro.
3632
3633         No new tests needed.
3634
3635         * CMakeLists.txt: Moved texmap include dir and source list to
3636         TextureMapper.cmake, removed non-existent include dir "filters/texmap".
3637         * PlatformEfl.cmake: Moved texmap and coordinatedgraphics include
3638         dirs and source list to TextureMapper.cmake.
3639         * PlatformGTK.cmake: Ditto, also removed non-existent include dir
3640         "texmap/threadedcompositor"
3641         * PlatformWinCairo.cmake: Moved texmap files to TextureMapper.cmake.
3642         * platform/TextureMapper.cmake: Added.
3643
3644 2016-02-11  Chris Dumez  <cdumez@apple.com>
3645
3646         Move 'length' property to the prototype
3647         https://bugs.webkit.org/show_bug.cgi?id=154051
3648         <rdar://problem/24577385>
3649
3650         Reviewed by Darin Adler.
3651
3652         Move 'length' property to the prototype, where it should be. We used to
3653         keep it on the instance because our implementation of
3654         getOwnPropertySlot() was wrong for interfaces with a named property
3655         getter. However, our implementation of getOwnPropertySlot() is now
3656         spec-compliant so this should be OK.
3657
3658         Moving 'length' to the prototype is also a little bit risky in terms of
3659         performance, especially for HTMLCollection / NodeList. However, I did
3660         not see an impact on realistic benchmarks like Speedometer and only saw
3661         a small impact (< 5%) on micro-benchmarks. I propose we make our behavior
3662         correct and monitor performance. If we see any benchmark we care about
3663         regress then we should try and optimize while keeping the attribute on
3664         the prototype.
3665
3666         No new tests, already covered by existing tests.
3667
3668         * bindings/js/JSDOMBinding.h:
3669         (WebCore::getStaticValueSlotEntryWithoutCaching):
3670         * bindings/js/JSHTMLDocumentCustom.cpp:
3671         (WebCore::JSHTMLDocument::getOwnPropertySlot):
3672         (WebCore::JSHTMLDocument::nameGetter): Deleted.
3673         * bindings/js/JSLocationCustom.cpp:
3674         (WebCore::JSLocation::putDelegate):
3675         * bindings/js/JSPluginElementFunctions.h:
3676         (WebCore::pluginElementCustomGetOwnPropertySlot):
3677         * bindings/js/JSStorageCustom.cpp:
3678         (WebCore::JSStorage::deleteProperty):
3679         (WebCore::JSStorage::deletePropertyByIndex):
3680         (WebCore::JSStorage::putDelegate):
3681         Leverage the new hasStaticPropertyTable static property in the
3682         generated bindings for performance.
3683
3684         * bindings/scripts/CodeGeneratorJS.pm:
3685         (GenerateHeader):
3686         Generate a "hasStaticPropertyTable" static const boolean property
3687         for each bindings class so we can check at build time if
3688         ClassInfo::staticPropHashTable is null.
3689
3690         (AttributeShouldBeOnInstance):
3691         Move "length" to the prototype.
3692
3693         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3694         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3695         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3696         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3697         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3698         * bindings/scripts/test/JS/JSTestEventTarget.h:
3699         * bindings/scripts/test/JS/JSTestException.h:
3700         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3701         * bindings/scripts/test/JS/JSTestInterface.h:
3702         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
3703         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3704         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3705         * bindings/scripts/test/JS/JSTestNode.h:
3706         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3707         * bindings/scripts/test/JS/JSTestObj.h:
3708         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3709         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3710         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3711         * bindings/scripts/test/JS/JSTestTypedefs.h:
3712         * bindings/scripts/test/JS/JSattribute.h:
3713         * bindings/scripts/test/JS/JSreadonly.h:
3714         Rebaseline bindings tests.
3715
3716
3717 2016-02-11  Csaba Osztrogonác  <ossy@webkit.org>
3718
3719         Fix the !(ENABLE(SHADOW_DOM) || ENABLE(DETAILS_ELEMENT)) after r196281
3720         https://bugs.webkit.org/show_bug.cgi?id=154035
3721
3722         Reviewed by Antti Koivisto.
3723
3724         Follow-up fix after r196365. Removed guards around slotNodeIndex.
3725
3726         * dom/ComposedTreeIterator.h:
3727         (WebCore::ComposedTreeIterator::Context::Context):
3728
3729 2016-02-10  Ryan Haddad  <ryanhaddad@apple.com>
3730
3731         Updating bindings test reference file for JSTestEventConstructor.cpp after r196400
3732
3733         Unreviewed test gardening.
3734
3735         No new tests needed.
3736
3737         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3738         (WebCore::JSTestEventConstructorConstructor::construct):
3739
3740 2016-02-10  Eric Carlson  <eric.carlson@apple.com>
3741
3742         Update "manual" caption track logic
3743         https://bugs.webkit.org/show_bug.cgi?id=154084
3744         <rdar://problem/24530516>
3745
3746         Reviewed by Dean Jackson.
3747
3748         No new tests, media/track/track-manual-mode.html was updated.
3749
3750         * English.lproj/Localizable.strings: Add new string.
3751
3752         * html/HTMLMediaElement.cpp:
3753         (WebCore::HTMLMediaElement::addTextTrack): track.setManualSelectionMode is no more.
3754         (WebCore::HTMLMediaElement::configureTextTrackGroup): Never enable a track automatically when
3755           in manual selection mode.
3756         (WebCore::HTMLMediaElement::captionPreferencesChanged):  track.setManualSelectionMode is no more.
3757
3758         * html/track/TextTrack.cpp:
3759         (WebCore::TextTrack::containsOnlyForcedSubtitles): Return true for forced tracks.
3760         (WebCore::TextTrack::kind): Deleted.
3761         * html/track/TextTrack.h:
3762
3763         * html/track/TrackBase.h:
3764         (WebCore::TrackBase::kind): De-virtualize, nobody overrides it.
3765
3766         * page/CaptionUserPreferencesMediaAF.cpp:
3767         (WebCore::trackDisplayName): Include "forced" in the name of forced tracks.
3768
3769         * platform/LocalizedStrings.cpp:
3770         (WebCore::forcedTrackMenuItemText): New.
3771         * platform/LocalizedStrings.h:
3772
3773 2016-02-10  Jiewen Tan  <jiewen_tan@apple.com>
3774
3775         Rename *Event::create* which creates events for bindings to *Event::createForBindings* and cleanup corresponding paths
3776         https://bugs.webkit.org/show_bug.cgi?id=153903
3777         <rdar://problem/24518146>
3778
3779         Reviewed by Darin Adler.
3780
3781         Rename Event::create(const AtomicString&, const EventInit&) to Event::createForBindings
3782         (const AtomicString&, const EventInit&) and for all the subclasses as well in order to
3783         support Event.isTrusted. Besides, some of the subclasses use the create method for bindings
3784         to create events not for bindings and vice versa. Therefore, this patch also cleanup
3785         corresponding paths to ensure no misuse of the create mehtod. The same for Event::create()
3786         as it is combined with Event::initEvent to create an event for bindings for legacy content.
3787
3788         After this patch, all call sites of *Event::create* are supposed to use *Event::create
3789         to create events for user agent and *Event::createForBindings for bindings.
3790
3791         No change in behavior.
3792
3793         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
3794         (WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
3795         (WebCore::WebKitPlaybackTargetAvailabilityEvent::createForBindings):
3796         (WebCore::WebKitPlaybackTargetAvailabilityEventInit::WebKitPlaybackTargetAvailabilityEventInit): Deleted.
3797         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
3798         (WebCore::MediaKeyMessageEvent::MediaKeyMessageEvent):
3799         (WebCore::MediaKeyMessageEventInit::MediaKeyMessageEventInit): Deleted.
3800         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
3801         (WebCore::MediaKeyMessageEvent::create):
3802         (WebCore::MediaKeyMessageEvent::createForBindings):
3803         * Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
3804         (WebCore::MediaKeyNeededEvent::MediaKeyNeededEvent):
3805         (WebCore::MediaKeyNeededEventInit::MediaKeyNeededEventInit): Deleted.
3806         * Modules/encryptedmedia/MediaKeyNeededEvent.h:
3807         (WebCore::MediaKeyNeededEvent::create):
3808         (WebCore::MediaKeyNeededEvent::createForBindings):
3809         * Modules/encryptedmedia/MediaKeySession.cpp:
3810         (WebCore::MediaKeySession::sendMessage):
3811         * Modules/gamepad/GamepadEvent.h:
3812         (WebCore::GamepadEvent::create):
3813         (WebCore::GamepadEvent::createForBindings):
3814         (WebCore::GamepadEventInit::GamepadEventInit): Deleted.
3815         * Modules/indieui/UIRequestEvent.cpp:
3816         (WebCore::UIRequestEvent::createForBindings):
3817         (WebCore::UIRequestEvent::UIRequestEvent):
3818         (WebCore::UIRequestEventInit::UIRequestEventInit): Deleted.
3819         (WebCore::UIRequestEvent::create): Deleted.
3820         * Modules/indieui/UIRequestEvent.h:
3821         * Modules/mediastream/MediaStreamEvent.cpp:
3822         (WebCore::MediaStreamEvent::createForBindings):
3823         (WebCore::MediaStreamEventInit::MediaStreamEventInit): Deleted.
3824         (WebCore::MediaStreamEvent::create): Deleted.
3825         * Modules/mediastream/MediaStreamEvent.h:
3826         * Modules/mediastream/MediaStreamTrackEvent.cpp:
3827         (WebCore::MediaStreamTrackEvent::createForBindings):
3828         (WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit): Deleted.
3829         (WebCore::MediaStreamTrackEvent::create): Deleted.
3830         * Modules/mediastream/MediaStreamTrackEvent.h:
3831         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
3832         (WebCore::RTCDTMFToneChangeEvent::createForBindings):
3833         (WebCore::RTCDTMFToneChangeEvent::create): Deleted.
3834         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
3835         * Modules/mediastream/RTCDataChannelEvent.cpp:
3836         (WebCore::RTCDataChannelEvent::createForBindings):
3837         (WebCore::RTCDataChannelEvent::create): Deleted.
3838         * Modules/mediastream/RTCDataChannelEvent.h:
3839         * Modules/mediastream/RTCIceCandidateEvent.cpp:
3840         (WebCore::RTCIceCandidateEvent::createForBindings):
3841         (WebCore::RTCIceCandidateEvent::create): Deleted.
3842         * Modules/mediastream/RTCIceCandidateEvent.h:
3843         * Modules/mediastream/RTCTrackEvent.cpp:
3844         (WebCore::RTCTrackEvent::createForBindings):
3845         (WebCore::RTCTrackEventInit::RTCTrackEventInit): Deleted.
3846         (WebCore::RTCTrackEvent::create): Deleted.
3847         * Modules/mediastream/RTCTrackEvent.h:
3848         * Modules/speech/SpeechSynthesisEvent.cpp:
3849         (WebCore::SpeechSynthesisEvent::createForBindings):
3850         (WebCore::SpeechSynthesisEvent::create):
3851         (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
3852         * Modules/speech/SpeechSynthesisEvent.h:
3853         * Modules/webaudio/AudioProcessingEvent.cpp:
3854         (WebCore::AudioProcessingEvent::create): Deleted.
3855         * Modules/webaudio/AudioProcessingEvent.h:
3856         (WebCore::AudioProcessingEvent::create):
3857         (WebCore::AudioProcessingEvent::createForBindings):
3858         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
3859         (WebCore::OfflineAudioCompletionEvent::createForBindings):
3860         (WebCore::OfflineAudioCompletionEvent::create): Deleted.
3861         * Modules/webaudio/OfflineAudioCompletionEvent.h:
3862         * Modules/websockets/CloseEvent.h:
3863         (WebCore::CloseEvent::create):
3864         (WebCore::CloseEvent::createForBindings):
3865         (WebCore::CloseEvent::CloseEvent):
3866         (WebCore::CloseEventInit::CloseEventInit): Deleted.
3867         * bindings/objc/DOM.mm:
3868         (-[DOMNode nextFocusNode]):
3869         (-[DOMNode previousFocusNode]):
3870         * bindings/scripts/CodeGeneratorJS.pm:
3871         (GenerateConstructorDefinition):
3872         * dom/AnimationEvent.cpp:
3873         (WebCore::AnimationEventInit::AnimationEventInit): Deleted.
3874         * dom/AnimationEvent.h:
3875         * dom/BeforeLoadEvent.h:
3876         (WebCore::BeforeLoadEventInit::BeforeLoadEventInit): Deleted.
3877         * dom/ClipboardEvent.h:
3878         * dom/CompositionEvent.cpp:
3879         (WebCore::CompositionEventInit::CompositionEventInit): Deleted.
3880         * dom/CompositionEvent.h:
3881         * dom/CustomEvent.cpp:
3882         (WebCore::CustomEventInit::CustomEventInit): Deleted.
3883         * dom/CustomEvent.h:
3884         * dom/DeviceMotionEvent.h:
3885         * dom/DeviceOrientationEvent.h:
3886         * dom/Document.cpp:
3887         (WebCore::Document::createEvent):
3888         * dom/Element.cpp:
3889         (WebCore::Element::dispatchMouseEvent):
3890         * dom/ErrorEvent.cpp:
3891         (WebCore::ErrorEventInit::ErrorEventInit): Deleted.
3892         * dom/ErrorEvent.h:
3893         * dom/Event.cpp:
3894         (WebCore::EventInit::EventInit): Deleted.
3895         * dom/Event.h:
3896         (WebCore::Event::createForBindings):
3897         (WebCore::Event::create): Deleted.
3898         * dom/FocusEvent.cpp:
3899         (WebCore::FocusEventInit::FocusEventInit): Deleted.
3900         * dom/FocusEvent.h:
3901         * dom/HashChangeEvent.h:
3902         (WebCore::HashChangeEventInit::HashChangeEventInit): Deleted.
3903         * dom/KeyboardEvent.cpp:
3904         (WebCore::KeyboardEvent::KeyboardEvent):
3905         (WebCore::KeyboardEventInit::KeyboardEventInit): Deleted.
3906         * dom/KeyboardEvent.h:
3907         * dom/MessageEvent.cpp:
3908         (WebCore::MessageEvent::MessageEvent):
3909         (WebCore::MessageEventInit::MessageEventInit): Deleted.
3910         * dom/MessageEvent.h:
3911         * dom/MouseEvent.cpp:
3912         (WebCore::MouseEvent::createForBindings):
3913         (WebCore::MouseEvent::create):
3914         (WebCore::MouseEvent::MouseEvent):
3915         (WebCore::MouseEvent::cloneFor):
3916         (WebCore::MouseEventInit::MouseEventInit): Deleted.
3917         * dom/MouseEvent.h:
3918         (WebCore::MouseEvent::createForBindings):
3919         (WebCore::MouseEvent::create): Deleted.
3920         * dom/MouseRelatedEvent.cpp:
3921         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
3922         (WebCore::MouseRelatedEvent::init):
3923         * dom/MouseRelatedEvent.h:
3924         (WebCore::MouseRelatedEvent::screenX):
3925         (WebCore::MouseRelatedEvent::screenY):
3926         (WebCore::MouseRelatedEvent::screenLocation):
3927         (WebCore::MouseRelatedEvent::clientX):
3928         (WebCore::MouseRelatedEvent::clientY):
3929         (WebCore::MouseRelatedEvent::movementX):
3930         (WebCore::MouseRelatedEvent::movementY):
3931         (WebCore::MouseRelatedEvent::clientLocation):
3932         (WebCore::MouseRelatedEvent::isSimulated):
3933         (WebCore::MouseRelatedEvent::absoluteLocation):
3934         (WebCore::MouseRelatedEvent::setAbsoluteLocation):
3935         * dom/MutationEvent.h:
3936         * dom/OverflowEvent.cpp:
3937         (WebCore::OverflowEvent::OverflowEvent):
3938         (WebCore::OverflowEvent::initOverflowEvent):
3939         (WebCore::OverflowEventInit::OverflowEventInit): Deleted.
3940         * dom/OverflowEvent.h:
3941         * dom/PageTransitionEvent.cpp:
3942         (WebCore::PageTransitionEventInit::PageTransitionEventInit): Deleted.
3943         * dom/PageTransitionEvent.h:
3944         * dom/PopStateEvent.cpp:
3945         (WebCore::PopStateEvent::createForBindings):
3946         (WebCore::PopStateEventInit::PopStateEventInit): Deleted.
3947         (WebCore::PopStateEvent::PopStateEvent): Deleted.
3948         (WebCore::PopStateEvent::create): Deleted.
3949         * dom/PopStateEvent.h:
3950         * dom/ProgressEvent.cpp:
3951         (WebCore::ProgressEventInit::ProgressEventInit): Deleted.
3952         * dom/ProgressEvent.h:
3953         (WebCore::ProgressEvent::createForBindings):
3954         (WebCore::ProgressEvent::create): Deleted.
3955         * dom/SecurityPolicyViolationEvent.h:
3956         (WebCore::SecurityPolicyViolationEventInit::SecurityPolicyViolationEventInit): Deleted.
3957         * dom/TextEvent.cpp:
3958         (WebCore::TextEvent::createForBindings):
3959         (WebCore::TextEvent::create): Deleted.
3960         * dom/TextEvent.h:
3961         * dom/TouchEvent.h:
3962         * dom/TransitionEvent.cpp:
3963         (WebCore::TransitionEventInit::TransitionEventInit): Deleted.
3964         * dom/TransitionEvent.h:
3965         * dom/UIEvent.cpp:
3966         (WebCore::UIEventInit::UIEventInit): Deleted.
3967         * dom/UIEvent.h:
3968         (WebCore::UIEvent::createForBindings):
3969         (WebCore::UIEvent::create): Deleted.
3970         * dom/UIEventWithKeyState.h:
3971         (WebCore::UIEventWithKeyState::ctrlKey):
3972         (WebCore::UIEventWithKeyState::shiftKey):
3973         (WebCore::UIEventWithKeyState::altKey):
3974         (WebCore::UIEventWithKeyState::metaKey):
3975         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
3976         * dom/WebKitAnimationEvent.cpp:
3977         (WebCore::WebKitAnimationEventInit::WebKitAnimationEventInit): Deleted.
3978         * dom/WebKitAnimationEvent.h:
3979         * dom/WebKitTransitionEvent.cpp:
3980         (WebCore::WebKitTransitionEventInit::WebKitTransitionEventInit): Deleted.
3981         * dom/WebKitTransitionEvent.h:
3982         * dom/WheelEvent.h:
3983         * html/HTMLMediaElement.cpp:
3984         (WebCore::HTMLMediaElement::mediaPlayerKeyAdded):
3985         (WebCore::HTMLMediaElement::mediaPlayerKeyError):
3986         (WebCore::HTMLMediaElement::mediaPlayerKeyMessage):
3987         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
3988         * html/MediaKeyEvent.cpp:
3989         (WebCore::MediaKeyEvent::MediaKeyEvent):
3990         (WebCore::MediaKeyEventInit::MediaKeyEventInit): Deleted.
3991         * html/MediaKeyEvent.h:
3992         * html/canvas/WebGLContextEvent.cpp:
3993         (WebCore::WebGLContextEventInit::WebGLContextEventInit): Deleted.
3994         * html/canvas/WebGLContextEvent.h:
3995         * html/track/TrackEvent.cpp:
3996         (WebCore::TrackEvent::TrackEvent):
3997         (WebCore::TrackEventInit::TrackEventInit): Deleted.
3998         * html/track/TrackEvent.h:
3999         * html/track/TrackListBase.cpp:
4000         (TrackListBase::scheduleTrackEvent):
4001         (TrackListBase::scheduleChangeEvent):
4002         * page/EventSource.cpp:
4003         (WebCore::EventSource::createMessageEvent):
4004         * page/csp/ContentSecurityP