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