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