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