d313c371b0645f70c4f44b0919f804d1c85f9d8f
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-01-21  Jer Noble  <jer.noble@apple.com>
2
3         [EME] Correctly report errors when generating key requests from AVContentKeySession.
4         https://bugs.webkit.org/show_bug.cgi?id=151963
5
6         Reviewed by Eric Carlson.
7
8         WebIDL's "unsigned long" is a 32-bit unsigned integer, and C++'s "unsigned long" is (or, can
9         be) a 64-bit integer on 64-bit platforms. Casting a negative integer to a 64-bit integer
10         results in a number which cannot be accurately stored in a double-length floating point
11         number. Previously, the mac CDM code would work around this issue by returning the absolute
12         value of NSError code returned by media frameworks. Instead, fix the underlying problem by
13         storing the MediaKeyError's systemCode as a uint32_t (which more accurately represents the
14         size of a WebIDL "unsigned long" on all platforms.)
15
16         Check the error code issued by -contentKeyRequestDataForApp:contentIdentifier:options:error:.
17
18         * Modules/encryptedmedia/CDM.h:
19         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
20         (WebCore::CDMSessionClearKey::generateKeyRequest):
21         (WebCore::CDMSessionClearKey::update):
22         * Modules/encryptedmedia/CDMSessionClearKey.h:
23         * Modules/encryptedmedia/MediaKeySession.cpp:
24         (WebCore::MediaKeySession::keyRequestTimerFired):
25         (WebCore::MediaKeySession::addKeyTimerFired):
26         (WebCore::MediaKeySession::sendError):
27         * Modules/encryptedmedia/MediaKeySession.h:
28         * Modules/mediacontrols/mediaControlsApple.js:
29         (Controller.prototype.handleReadyStateChange):
30         * WebCore.xcodeproj/project.pbxproj:
31         * html/MediaKeyError.h:
32         (WebCore::MediaKeyError::create):
33         (WebCore::MediaKeyError::systemCode):
34         * html/MediaKeyEvent.h:
35         * platform/graphics/CDMSession.h:
36         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
37         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
38         (WebCore::CDMSessionAVFoundationCF::update):
39         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
40         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
41         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
42         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
43         (WebCore::CDMSessionAVContentKeySession::update):
44         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
45         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
46         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
47         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
48         (WebCore::CDMSessionAVFoundationObjC::update):
49         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
50         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
51         (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
52         (WebCore::CDMSessionAVStreamSession::update):
53         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
54         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
55         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
56         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
57         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
58         (WebCore::CDMSessionMediaSourceAVFObjC::systemCodeForError): Deleted.
59         * testing/MockCDM.cpp:
60         (WebCore::MockCDMSession::generateKeyRequest):
61         (WebCore::MockCDMSession::update):2016-01-15  Simon Fraser  <simon.fraser@apple.com>
62
63 2016-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
64
65         [SOUP] GResource resources should be cached indefinitely in memory cache
66         https://bugs.webkit.org/show_bug.cgi?id=153275
67
68         Reviewed by Žan Doberšek.
69
70         GResources can't change so they will always return the same data,
71         we never need to revalidate them.
72
73         * loader/cache/CachedResource.cpp:
74         (WebCore::shouldCacheSchemeIndefinitely):
75
76 2016-01-21  Nan Wang  <n_wang@apple.com>
77
78         AX: [IOS] Implement next/previous text marker functions using TextIterator
79         https://bugs.webkit.org/show_bug.cgi?id=153292
80         <rdar://problem/24268243>
81
82         Reviewed by Chris Fleizach.
83
84         Added support for the refactored next/previous text marker functions on iOS. And 
85         made text marker tests working on iOS.
86         Also, fixed an issue in AXObjectCache where creating a range with a replaced node
87         at the start or end might exclude that node.
88
89         Tests: accessibility/text-marker/text-marker-previous-next.html
90                accessibility/text-marker/text-marker-with-user-select-none.html
91
92         * accessibility/AXObjectCache.cpp:
93         (WebCore::characterOffsetsInOrder):
94         (WebCore::resetNodeAndOffsetForReplacedNode):
95         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
96         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
97         (+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):
98         (+[WebAccessibilityTextMarker textMarkerWithCharacterOffset:cache:]):
99         (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]):
100         (-[WebAccessibilityTextMarker dataRepresentation]):
101         (-[WebAccessibilityTextMarker visiblePosition]):
102         (-[WebAccessibilityTextMarker characterOffset]):
103         (-[WebAccessibilityTextMarker isIgnored]):
104         (-[WebAccessibilityTextMarker accessibilityObject]):
105         (-[WebAccessibilityTextMarker description]):
106         (-[WebAccessibilityObjectWrapper stringForTextMarkers:]):
107         (blockquoteLevel):
108         (-[WebAccessibilityObjectWrapper textMarkerRange]):
109         (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
110         (-[WebAccessibilityObjectWrapper nextMarkerForMarker:]):
111         (-[WebAccessibilityObjectWrapper previousMarkerForMarker:]):
112         (-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
113         (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
114         (-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
115         (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
116         (-[WebAccessibilityObjectWrapper lengthForTextMarkers:]):
117         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]):
118         (-[WebAccessibilityObjectWrapper textMarkerRangeForMarkers:]):
119         (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
120
121 2016-01-20  Zalan Bujtas  <zalan@apple.com>
122
123         http://victordarras.fr/cssgame/ doesn't work in Safari.
124         https://bugs.webkit.org/show_bug.cgi?id=153285
125         <rdar://problem/24212369>
126
127         Reviewed by Tim Horton.
128
129         This patch adds support for hittesting ClipPathOperation::Reference.
130
131         Tests: svg/clip-path/hittest-clip-path-reference-miss.html
132
133         * rendering/RenderBlock.cpp:
134         (WebCore::RenderBlock::nodeAtPoint):
135         * rendering/RenderObject.h:
136         (WebCore::RenderObject::isSVGResourceClipper):
137         * rendering/svg/RenderSVGResourceClipper.h:
138         (isType):
139
140 2016-01-20  David Kilzer  <ddkilzer@apple.com>
141
142         ResourceHandleCFURLConnectionDelegateWithOperationQueue delegate methods don't NULL-check m_handle->client()
143         <https://webkit.org/b/152675>
144         <rdar://problem/24034044>
145
146         Reviewed by Brent Fulgham.
147
148         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
149         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
150         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
151         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
152         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
153         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
154         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
155         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
156         - Add NULL check for m_handle->client() as is done in the
157           WebCoreResourceHandleAsOperationQueueDelegate class in
158           WebCoreResourceHandleAsOperationQueueDelegate.mm.  (The NULL
159           check for -connection:didReceiveResponse: is currently
160           missing, but there are crashes there, too, that are covered by
161           Bug 152673.)
162
163 2016-01-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
164
165         Use TinyLRUCache in caching the CGColorRef in WebCore::cachedCGColor()
166         https://bugs.webkit.org/show_bug.cgi?id=153279
167
168         Reviewed by Dean Jackson.
169
170         Reuse the new template TinyLRUCache in caching the CGColor instead of
171         having the same code repeated twice.
172
173         * platform/graphics/cg/ColorCG.cpp:
174         (WebCore::leakCGColor):
175         (WebCore::RetainPtr<CGColorRef>>::createValueForKey):
176         (WebCore::cachedCGColor):
177
178 2016-01-20  Timothy Hatcher  <timothy@apple.com>
179
180         Web Inspector: InspectorCSSAgent does not call disable in willDestroyFrontendAndBackend
181         https://bugs.webkit.org/show_bug.cgi?id=153289
182         <rdar://problem/24242600>
183
184         Reviewed by Joseph Pecoraro.
185
186         * inspector/InspectorCSSAgent.cpp:
187         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend): Call disable().
188
189 2016-01-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
190
191         Refactor AtomicStringKeyedMRUCache to be a generic LRU cache
192         https://bugs.webkit.org/show_bug.cgi?id=153109
193
194         Reviewed by Darin Adler.
195
196         Replace the template specialization of AtomicStringKeyedMRUCache with
197         template derived from TinyLRUCachePolicy. Override the functions which
198         are needed for creating the values and the null value. Also replace the
199         static function which was returning a NeverDestroyed AtomicStringKeyedMRUCache
200         with a singleton function 'cache' inside the derived template.
201
202         * WebCore.xcodeproj/project.pbxproj:
203         * platform/text/AtomicStringKeyedMRUCache.h: Removed.
204         * platform/text/cf/HyphenationCF.cpp:
205         (WebCore::canHyphenate):
206         (WebCore::lastHyphenLocation):
207         (WebCore::AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef>>::createValueForNullKey): Deleted.
208         (WebCore::AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef>>::createValueForKey): Deleted.
209         (WebCore::cfLocaleCache): Deleted.
210         * platform/text/hyphen/HyphenationLibHyphen.cpp:
211         (WebCore::countLeadingSpaces):
212         (WebCore::lastHyphenLocation):
213         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): Deleted.
214         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Deleted.
215         (WebCore::hyphenDictionaryCache): Deleted.
216
217 2016-01-20  Chris Dumez  <cdumez@apple.com>
218
219         Drop support for obsolete Node.isSupported()
220         https://bugs.webkit.org/show_bug.cgi?id=153164
221
222         Reviewed by Darin Adler.
223
224         Drop support for obsolete Node.isSupported(). Chrome and Firefox already
225         dropped it.
226
227         No new tests, already covered by existing test.
228
229         * dom/Node.cpp:
230         (WebCore::Node::isSupportedForBindings):
231         * dom/Node.h:
232         * dom/Node.idl:
233
234 2016-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
235
236         Unreviewed. Fix compile warning when building with GTK+ < 3.14.
237
238         * rendering/RenderThemeGtk.cpp:
239         (WebCore::loadThemedIcon):
240
241 2016-01-20  Csaba Osztrogonác  <ossy@webkit.org>
242
243         [Mac] Speculative cmake buildfix after r195317.
244
245         * PlatformMac.cmake:
246
247 2016-01-19  Chris Dumez  <cdumez@apple.com>
248
249         DocumentType.publicId / systemId should never return null
250         https://bugs.webkit.org/show_bug.cgi?id=153264
251
252         Reviewed by Ryosuke Niwa.
253
254         DocumentType.publicId / systemId should never return null as these
255         attributes are not nullable in the IDL:
256         https://dom.spec.whatwg.org/#interface-documenttype
257
258         Instead we should return the empty string. Firefox and Chrome match the
259         specification.
260
261         No new tests, already covered by existing tests.
262
263         * dom/DocumentType.idl:
264
265 2016-01-19  Commit Queue  <commit-queue@webkit.org>
266
267         Unreviewed, rolling out r195302.
268         https://bugs.webkit.org/show_bug.cgi?id=153267
269
270         This change broke the Windows build, rolling out so it isn't
271         broken all night before investigation. (Requested by
272         ryanhaddad on #webkit).
273
274         Reverted changeset:
275
276         "[EME] Correctly report errors when generating key requests
277         from AVContentKeySession."
278         https://bugs.webkit.org/show_bug.cgi?id=151963
279         http://trac.webkit.org/changeset/195302
280
281 2016-01-19  Chris Dumez  <cdumez@apple.com>
282
283         DOMImplementation.createDocument() should treat undefined namespace as null
284         https://bugs.webkit.org/show_bug.cgi?id=153252
285
286         Reviewed by Ryosuke Niwa.
287
288         DOMImplementation.createDocument() should treat undefined namespace as null as
289         the DOMString parameter is nullable:
290         https://dom.spec.whatwg.org/#domimplementation
291
292         Firefox behaves according to the specification, Chrome does not.
293
294         No new tests, already covered by existing test.
295
296         * dom/DOMImplementation.idl:
297
298 2016-01-19  Enrica Casucci  <enrica@apple.com>
299
300         Add support for DataDetectors in WK (iOS).
301         https://bugs.webkit.org/show_bug.cgi?id=152989
302         rdar://problem/22855960
303
304         Reviewed by Tim Horton.
305
306         This is the first step toward implementing Data Detectors support
307         in WK2. The patch adds a new memeber to the Settings object
308         to retrieve the type of detection desired. The DataDetection files
309         have been moved under cocoa, since they are no longer OS X specific.
310
311         * Configurations/FeatureDefines.xcconfig:
312         * Configurations/WebCore.xcconfig:
313         * WebCore.xcodeproj/project.pbxproj:
314         * editing/cocoa/DataDetection.h: Copied from Source/WebCore/editing/mac/DataDetection.h.
315         * editing/cocoa/DataDetection.mm: Copied from Source/WebCore/editing/mac/DataDetection.mm.
316         (WebCore::detectItemAtPositionWithRange):
317         (WebCore::DataDetection::detectItemAroundHitTestResult):
318         (WebCore::DataDetection::detectContentInRange):
319         * editing/mac/DataDetection.h: Removed.
320         * editing/mac/DataDetection.mm: Removed.
321         * loader/FrameLoader.cpp:
322         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
323         * page/Settings.h:
324         * page/Settings.in:
325         * platform/spi/mac/DataDetectorsSPI.h:
326
327 2016-01-19  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
328
329         SVG 2 requires a mechanism for restricting enum values exposed through the DOM
330         https://bugs.webkit.org/show_bug.cgi?id=152814
331
332         Reviewed by Darin Adler.
333
334         No new tests (No change in functionality, blocked bugs add new tests).
335  
336         This patch adds a mechanism to restrict the values returned through the
337         SVGAnimatedEnumeration interface.
338         This is required for SVG 2, which does not expose new enumeration
339         values through the IDL.
340         See http://www.w3.org/TR/SVG2/types.html#InterfaceSVGAnimatedEnumeration
341         Getters:
342         SVG 2 does not add numeric type values for new options, new options
343         should return UNKNOWN.
344         E.g. See the table defining numeric type values for orient at
345         http://www.w3.org/TR/SVG2/painting.html#InterfaceSVGMarkerElement
346         Setters:
347         On setting baseVal, the following steps are run:
348         1. ...
349         2. If value is 0 or is not the numeric type value for any value of the reflected attribute, then set the reflected attribute to the empty string.
350
351         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
352         Override baseVal() and animVal() to perform range checks against
353         the highest exposed enum value.
354         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
355         (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal): Mark function as virtual as it's over-ridden for enumerations.
356         (WebCore::SVGAnimatedStaticPropertyTearOff::animVal): Mark function as virtual as it's over-ridden for enumerations.
357         * svg/properties/SVGPropertyTraits.h:
358         Add SVGIDLEnumLimits struct that contains function for querying the
359         highest exposed enum value.
360         (WebCore::SVGIDLEnumLimits::highestExposedEnumValue): New function that returns the highest enum value that should
361         be exposed through the DOM. This function should be specialized for enum types that need to restrict the exposed
362         values.
363
364 2016-01-19  Konstantin Tokarev  <annulen@yandex.ru>
365
366         Fixed compilation of AXObjectCache in case of !HAVE(ACCESSIBILITY).
367         https://bugs.webkit.org/show_bug.cgi?id=153243
368
369         Reviewed by Chris Fleizach.
370
371         No new tests needed.
372
373         * accessibility/AXObjectCache.h:
374         (WebCore::AXObjectCache::AXObjectCache):
375         (WebCore::nodeHasRole): Deleted.
376
377 2016-01-19  Antti Koivisto  <antti@apple.com>
378
379         Use references in SelectorChecker
380         https://bugs.webkit.org/show_bug.cgi?id=153240
381
382         Reviewed by Andreas Kling.
383
384         Element and selector can't be null in most places.
385
386         * css/ElementRuleCollector.cpp:
387         (WebCore::ElementRuleCollector::collectMatchingRules):
388         * css/SelectorChecker.cpp:
389         (WebCore::attributeValueMatches):
390         (WebCore::anyAttributeMatches):
391         (WebCore::SelectorChecker::checkOne):
392         (WebCore::SelectorChecker::matchSelectorList):
393         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
394         (WebCore::SelectorChecker::determineLinkMatchType):
395         (WebCore::isFrameFocused):
396         (WebCore::SelectorChecker::matchesFocusPseudoClass):
397         * css/SelectorChecker.h:
398         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
399         (WebCore::SelectorChecker::checkExactAttribute): Deleted.
400         * css/SelectorCheckerTestFunctions.h:
401         (WebCore::isAutofilled):
402         (WebCore::isDefaultButtonForForm):
403         (WebCore::isDisabled):
404         (WebCore::isEnabled):
405         (WebCore::isMediaDocument):
406         (WebCore::isChecked):
407         (WebCore::isInRange):
408         (WebCore::isOutOfRange):
409         (WebCore::isInvalid):
410         (WebCore::isOptionalFormControl):
411         (WebCore::isRequiredFormControl):
412         (WebCore::isValid):
413         (WebCore::isWindowInactive):
414         (WebCore::containslanguageSubtagMatchingRange):
415         (WebCore::matchesLangPseudoClass):
416         (WebCore::matchesReadOnlyPseudoClass):
417         (WebCore::matchesReadWritePseudoClass):
418         (WebCore::shouldAppearIndeterminate):
419         (WebCore::scrollbarMatchesEnabledPseudoClass):
420         (WebCore::scrollbarMatchesCornerPresentPseudoClass):
421         (WebCore::matchesFullScreenPseudoClass):
422         (WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
423         (WebCore::matchesFullScreenAncestorPseudoClass):
424         (WebCore::matchesFullScreenDocumentPseudoClass):
425         (WebCore::matchesFutureCuePseudoClass):
426         (WebCore::matchesPastCuePseudoClass):
427
428 >>>>>>> .r195316
429 2016-01-19  Chris Dumez  <cdumez@apple.com>
430
431         Unreviewed, rolling out r195179.
432
433         It relies on r195141 which was rolled out
434
435         Reverted changeset:
436
437         "Allocate style sheet media queries in BumpArena."
438         https://bugs.webkit.org/show_bug.cgi?id=153188
439         http://trac.webkit.org/changeset/195179
440
441 2016-01-19  Chris Dumez  <cdumez@apple.com>
442
443         Unreviewed, rolling out r195173.
444
445         It relies on r195141 which was rolled out
446
447         Reverted changeset:
448
449         "Give RuleSet a BumpArena and start using it for
450         RuleDataVectors."
451         https://bugs.webkit.org/show_bug.cgi?id=153169
452         http://trac.webkit.org/changeset/195173
453
454 2016-01-19  Commit Queue  <commit-queue@webkit.org>
455
456         Unreviewed, rolling out r195300.
457         https://bugs.webkit.org/show_bug.cgi?id=153244
458
459         enrica wants more time to fix Windows (Requested by thorton on
460         #webkit).
461
462         Reverted changeset:
463
464         "Add support for DataDetectors in WK (iOS)."
465         https://bugs.webkit.org/show_bug.cgi?id=152989
466         http://trac.webkit.org/changeset/195300
467
468 2016-01-19  Zalan Bujtas  <zalan@apple.com>
469
470         outline-offset does not work for inlines.
471         https://bugs.webkit.org/show_bug.cgi?id=153238
472
473         Reviewed by Simon Fraser.
474
475         Adjust outline box width/height with outline-offset.
476
477         Test: fast/inline/inlines-with-outline-offset.html
478
479         * rendering/RenderInline.cpp:
480         (WebCore::RenderInline::paintOutline):
481         (WebCore::RenderInline::paintOutlineForLine):
482
483 2016-01-19  Chris Dumez  <cdumez@apple.com>
484
485         Unreviewed, rolling out r195141.
486
487         Seems to cause crashes on iOS9 64bit
488
489         Reverted changeset:
490
491         "Fragmentation-free allocator for timeless and/or coupled
492         allocations."
493         https://bugs.webkit.org/show_bug.cgi?id=152696
494         http://trac.webkit.org/changeset/195141
495
496 2015-12-07  Jer Noble  <jer.noble@apple.com>
497
498         [EME] Correctly report errors when generating key requests from AVContentKeySession.
499         https://bugs.webkit.org/show_bug.cgi?id=151963
500
501         Reviewed by Eric Carlson.
502
503         WebIDL's "unsigned long" is a 32-bit unsigned integer, and C++'s "unsigned long" is (or, can
504         be) a 64-bit integer on 64-bit platforms. Casting a negative integer to a 64-bit integer
505         results in a number which cannot be accurately stored in a double-length floating point
506         number. Previously, the mac CDM code would work around this issue by returning the absolute
507         value of NSError code returned by media frameworks. Instead, fix the underlying problem by
508         storing the MediaKeyError's systemCode as a uint32_t (which more accurately represents the
509         size of a WebIDL "unsigned long" on all platforms.)
510
511         Check the error code issued by -contentKeyRequestDataForApp:contentIdentifier:options:error:.
512
513         * Modules/encryptedmedia/CDM.h:
514         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
515         (WebCore::CDMSessionClearKey::generateKeyRequest):
516         (WebCore::CDMSessionClearKey::update):
517         * Modules/encryptedmedia/CDMSessionClearKey.h:
518         * Modules/encryptedmedia/MediaKeySession.cpp:
519         (WebCore::MediaKeySession::keyRequestTimerFired):
520         (WebCore::MediaKeySession::addKeyTimerFired):
521         (WebCore::MediaKeySession::sendError):
522         * Modules/encryptedmedia/MediaKeySession.h:
523         * Modules/mediacontrols/mediaControlsApple.js:
524         (Controller.prototype.handleReadyStateChange):
525         * WebCore.xcodeproj/project.pbxproj:
526         * html/MediaKeyError.h:
527         (WebCore::MediaKeyError::create):
528         (WebCore::MediaKeyError::systemCode):
529         * html/MediaKeyEvent.h:
530         * platform/graphics/CDMSession.h:
531         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
532         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
533         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
534         (WebCore::CDMSessionAVContentKeySession::update):
535         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
536         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
537         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
538         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
539         (WebCore::CDMSessionAVFoundationObjC::update):
540         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
541         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
542         (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
543         (WebCore::CDMSessionAVStreamSession::update):
544         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
545         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
546         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
547         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
548         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
549         (WebCore::CDMSessionMediaSourceAVFObjC::systemCodeForError): Deleted.
550         * testing/MockCDM.cpp:
551         (WebCore::MockCDMSession::generateKeyRequest):
552         (WebCore::MockCDMSession::update):2016-01-15  Simon Fraser  <simon.fraser@apple.com>
553
554 2016-01-19  Enrica Casucci  <enrica@apple.com>
555
556         Add support for DataDetectors in WK (iOS).
557         https://bugs.webkit.org/show_bug.cgi?id=152989
558         rdar://problem/22855960
559
560         Reviewed by Tim Horton.
561
562         This is the first step toward implementing Data Detectors support
563         in WK2. The patch adds a new memeber to the Settings object
564         to retrieve the type of detection desired. The DataDetection files
565         have been moved under cocoa, since they are no longer OS X specific.
566
567         * Configurations/FeatureDefines.xcconfig:
568         * Configurations/WebCore.xcconfig:
569         * WebCore.xcodeproj/project.pbxproj:
570         * editing/cocoa/DataDetection.h: Copied from Source/WebCore/editing/mac/DataDetection.h.
571         * editing/cocoa/DataDetection.mm: Copied from Source/WebCore/editing/mac/DataDetection.mm.
572         (WebCore::detectItemAtPositionWithRange):
573         (WebCore::DataDetection::detectItemAroundHitTestResult):
574         (WebCore::DataDetection::detectContentInRange):
575         * editing/mac/DataDetection.h: Removed.
576         * editing/mac/DataDetection.mm: Removed.
577         * loader/FrameLoader.cpp:
578         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
579         * page/Settings.h:
580         * page/Settings.in:
581         * platform/spi/mac/DataDetectorsSPI.h:
582
583 2016-01-19  Chris Dumez  <cdumez@apple.com>
584
585         Unreviewed, fix typo in comment added in r195157.
586
587         * dom/DocumentType.h:
588
589 2016-01-18  Antti Koivisto  <antti@apple.com>
590
591         Selector checker should not mutate document and style
592         https://bugs.webkit.org/show_bug.cgi?id=153205
593
594         Reviewed by Darin Adler.
595
596         Selector checker currently writes affected-by bits and similar directly to the document and style during selector
597         matching. This is confusing, complicated and wrong.
598
599         This patch changes SelectorChecker and SelectorCompiler to collect style relatationship metadata to a separate
600         data structure (currently part of SelectorChecker::CheckingContext) instead of changing the document and style
601         directly. The mutations are performed later outside selector checker.
602
603         * css/ElementRuleCollector.cpp:
604         (WebCore::ElementRuleCollector::ruleMatches):
605         (WebCore::ElementRuleCollector::commitStyleRelations):
606
607             Apply the relationship bit to elements and style.
608
609         (WebCore::ElementRuleCollector::collectMatchingRulesForList):
610         * css/ElementRuleCollector.h:
611         * css/SelectorChecker.cpp:
612         (WebCore::SelectorChecker::LocalContext::LocalContext):
613
614             LocalContext is now a separate data structure.
615
616         (WebCore::addStyleRelation):
617
618             Helper for recording new style relations. This is used where code mutated elements or style directly before.
619
620         (WebCore::isFirstChildElement):
621         (WebCore::isLastChildElement):
622         (WebCore::isFirstOfType):
623         (WebCore::isLastOfType):
624         (WebCore::countElementsBefore):
625         (WebCore::countElementsOfTypeBefore):
626         (WebCore::SelectorChecker::SelectorChecker):
627         (WebCore::SelectorChecker::match):
628         (WebCore::hasScrollbarPseudoElement):
629         (WebCore::localContextForParent):
630         (WebCore::SelectorChecker::matchRecursively):
631         (WebCore::attributeValueMatches):
632         (WebCore::anyAttributeMatches):
633         (WebCore::canMatchHoverOrActiveInQuirksMode):
634         (WebCore::tagMatches):
635         (WebCore::SelectorChecker::checkOne):
636         (WebCore::SelectorChecker::matchSelectorList):
637         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
638         (WebCore::SelectorChecker::CheckingContextWithStatus::CheckingContextWithStatus): Deleted.
639         (WebCore::checkingContextForParent): Deleted.
640         * css/SelectorChecker.h:
641         (WebCore::SelectorChecker::CheckingContext::CheckingContext):
642         * css/SelectorCheckerTestFunctions.h:
643         (WebCore::isEnabled):
644         (WebCore::isMediaDocument):
645         (WebCore::isChecked):
646         (WebCore::isInRange):
647         (WebCore::isOutOfRange):
648         * css/StyleResolver.h:
649         (WebCore::checkRegionSelector):
650         * cssjit/SelectorCompiler.cpp:
651         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
652         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
653
654             Helpers for generating code for recording new style relations. This is used where code mutated elements or style directly before.
655
656         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorCheckerExcludingPseudoElements):
657         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
658         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
659         (WebCore::SelectorCompiler::addStyleRelationElementFunction):
660         (WebCore::SelectorCompiler::SelectorCodeGenerator::jumpIfNoPreviousAdjacentElement):
661         (WebCore::SelectorCompiler::SelectorCodeGenerator::moduloIsZero):
662         (WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
663         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
664         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
665         (WebCore::SelectorCompiler::elementIsActive):
666         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsActive):
667         (WebCore::SelectorCompiler::jumpIfElementIsNotEmpty):
668         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsEmpty):
669         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
670         (WebCore::SelectorCompiler::elementIsHovered):
671         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
672         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
673         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
674         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
675         (WebCore::SelectorCompiler::makeContextStyleUniqueIfNecessaryAndTestIsPlaceholderShown):
676         (WebCore::SelectorCompiler::isPlaceholderShown):
677         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):
678         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLink):
679         (WebCore::SelectorCompiler::nthFilterIsAlwaysSatisified):
680         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
681         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
682         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
683         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
684         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateMarkPseudoStyleForPseudoElement):
685         (WebCore::SelectorCompiler::SelectorCodeGenerator::addFlagsToElementStyleFromContext): Deleted.
686         (WebCore::SelectorCompiler::setNodeFlag): Deleted.
687         (WebCore::SelectorCompiler::SelectorCodeGenerator::markElementIfResolvingStyle): Deleted.
688         (WebCore::SelectorCompiler::setFirstChildState): Deleted.
689         (WebCore::SelectorCompiler::elementIsActiveForStyleResolution): Deleted.
690         (WebCore::SelectorCompiler::setElementStyleIsAffectedByEmpty): Deleted.
691         (WebCore::SelectorCompiler::setElementStyleFromContextIsAffectedByEmptyAndUpdateRenderStyleIfNecessary): Deleted.
692         (WebCore::SelectorCompiler::elementIsHoveredForStyleResolution): Deleted.
693         (WebCore::SelectorCompiler::setLastChildState): Deleted.
694         (WebCore::SelectorCompiler::setOnlyChildState): Deleted.
695         (WebCore::SelectorCompiler::makeElementStyleUniqueIfNecessaryAndTestIsPlaceholderShown): Deleted.
696         (WebCore::SelectorCompiler::setElementChildIndex): Deleted.
697         (WebCore::SelectorCompiler::setChildrenAffectedByBackwardPositionalRules): Deleted.
698         (WebCore::SelectorCompiler::setParentAffectedByLastChildOf): Deleted.
699         * dom/SelectorQuery.cpp:
700         (WebCore::SelectorDataList::selectorMatches):
701         (WebCore::SelectorDataList::selectorClosest):
702         (WebCore::SelectorDataList::matches):
703         * inspector/InspectorCSSAgent.cpp:
704         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
705         * inspector/InspectorStyleSheet.cpp:
706         (WebCore::buildObjectForSelectorHelper):
707
708 2016-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
709
710         Unreviewed. Fix GTK+ build with GTK+ < 3.14.
711
712         Flags GTK_ICON_LOOKUP_DIR_LTR and GTK_ICON_LOOKUP_DIR_RTL were
713         added in GTK+ 3.14.
714
715         * rendering/RenderThemeGtk.cpp:
716         (WebCore::loadThemedIcon):
717
718 2016-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
719
720         Unreviewed. Fix GObject DOM bindings API break after r195264.
721
722         Add webkit_dom_character_data_set_data to the list of functions
723         that used to raise exceptions.
724
725         * bindings/scripts/CodeGeneratorGObject.pm:
726         (FunctionUsedToRaiseException):
727
728 2016-01-19  Javier Fernandez  <jfernandez@igalia.com>
729
730         [css-grid][css-align] justify-self stretch is not applied for img elements
731         https://bugs.webkit.org/show_bug.cgi?id=153206
732
733         Reviewed by Darin Adler.
734
735         When computing the logical height, we check first if there is an override
736         height value set as a consequence of the stretching logic, so we use it
737         directly for any kind of element. However, in the case of the width
738         computation, we don't use such override value because it's the default
739         behavior of block-level boxes.
740
741         However, we consider some special cases which have to be treated as
742         replaced elements. Theses cases are evaluated first, so we don't let the
743         regular width computation logic to be executed, which is what we want
744         to implement the stretch behavior.
745
746         In order to let replaced elements, such images, to be stretched as a
747         consequence of the CSS alignment properties, we need to exclude grid
748         items from the cases to be treated as replaced elements during the width
749         computation.
750
751         Test: fast/css-grid-layout/grid-align-stretching-replaced-items.html
752
753         * rendering/RenderBox.cpp:
754         (WebCore::RenderBox::computeLogicalWidthInRegion):
755         (WebCore::RenderBox::hasStretchedLogicalWidth):
756         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
757         * rendering/RenderBox.h:
758
759 2016-01-19  Ryosuke Niwa  <rniwa@webkit.org>
760
761         Text::splitText doesn't update Range end points anchored on parent nodes
762         https://bugs.webkit.org/show_bug.cgi?id=153227
763
764         Reviewed by Antti Koivisto.
765
766         When a Text node is split into two and there is a Range whose boundary points' container node
767         is its parent and offset appears after the Text node, we must update the boundary points as specified
768         in step 7 of the concept "split" a Text node at https://dom.spec.whatwg.org/#concept-text-split
769
770         1. Insert new node into parent before node’s next sibling.
771         2. For each range whose start node is node and start offset is greater than offset, set its start node
772            to new node and decrease its start offset by offset.
773         3. For each range whose end node is node and end offset is greater than offset, set its end node to
774            new node and decrease its end offset by offset.
775         4. For each range whose start node is parent and start offset is equal to the index of node + 1,
776            increase its start offset by one.
777         5. For each range whose end node is parent and end offset is equal to the index of node + 1, increase
778            its end offset by one.
779
780         Fixed the bug by implementing steps 4 and 5 in boundaryTextNodesSplit. New behavior matches the DOM spec
781         as well as the behavior of Firefox.
782
783         Test: fast/dom/Range/update-range-in-split-text.html
784
785         * dom/Range.cpp:
786         (WebCore::boundaryTextNodesSplit): See above.
787         * dom/RangeBoundaryPoint.h:
788         (WebCore::RangeBoundaryPoint::setToAfterChild): Added.
789
790 2016-01-19  Ryosuke Niwa  <rniwa@webkit.org>
791
792         CharacterData::setData doesn't need ExceptionCode as an out argument
793         https://bugs.webkit.org/show_bug.cgi?id=153225
794
795         Reviewed by Antti Koivisto.
796
797         Removed the ExceptionCode out argument from CharacterData::setData since it's never used.
798
799         * dom/CharacterData.cpp:
800         (WebCore::CharacterData::setData):
801         (WebCore::CharacterData::containsOnlyWhitespace):
802         (WebCore::CharacterData::setNodeValue):
803         (WebCore::CharacterData::setDataAndUpdate):
804         * dom/CharacterData.h:
805         (WebCore::CharacterData::data):
806         (WebCore::CharacterData::dataMemoryOffset):
807         (WebCore::CharacterData::length):
808         * dom/CharacterData.idl:
809         * dom/Range.cpp:
810         (WebCore::Range::processContentsBetweenOffsets):
811         * dom/Text.cpp:
812         (WebCore::Text::replaceWholeText):
813         * editing/markup.cpp:
814         (WebCore::replaceChildrenWithFragment):
815         (WebCore::replaceChildrenWithText):
816         * html/HTMLOptionElement.cpp:
817         (WebCore::HTMLOptionElement::setText):
818         * html/HTMLScriptElement.cpp:
819         (WebCore::HTMLScriptElement::setText):
820         * html/HTMLTitleElement.cpp:
821         (WebCore::HTMLTitleElement::setText):
822
823 2016-01-19  Ryosuke Niwa  <rniwa@webkit.org>
824
825         innerHTML should always add a mutation record for removing all children
826         https://bugs.webkit.org/show_bug.cgi?id=148782
827         <rdar://problem/22571962>
828
829         Reviewed by Antti Koivisto.
830
831         Fixed the bug by disabling WebKit's optimization to avoid the node replacement when the behavior
832         is observable to scripts by either:
833          - Author scripts has a reference to the node
834          - MutationObserver can be observing this subtree
835          - Mutation events can be observing this subtree
836
837         Note that no caller of this function exposes fragment to author scripts so it couldn't be referenced.
838         It also means that we don't need to check DOMNodeInsertedIntoDocument since it doesn't bubble up
839         (it's only relevant if the text node in fragment has its event listener but that's impossible).
840
841         Test: fast/dom/innerHTML-single-text-node.html
842
843         * dom/ChildListMutationScope.h:
844         (WebCore::ChildListMutationScope::canObserve): Added.
845
846         * editing/markup.cpp:
847         (WebCore::hasMutationEventListeners): Added.
848         (WebCore::replaceChildrenWithFragment):
849
850 2016-01-18  Ryosuke Niwa  <rniwa@webkit.org>
851
852         createAttribute should lowercase the attribute name in a HTML document
853         https://bugs.webkit.org/show_bug.cgi?id=153112
854
855         Reviewed by Darin Adler.
856
857         In a HTML document, we should always lowercase localName in document.createAttribute as specified in
858         https://dom.spec.whatwg.org/#dom-document-createattribute:
859
860         1. If localName does not match the Name production in XML, throw an InvalidCharacterError exception.
861         2. If the context object is an HTML document, let localName be converted to ASCII lowercase.
862         3. Return a new attribute whose local name is localName.
863
864         Change WebKit's behavior to match the spec as well as Firefox. document.createAttributeNS will
865         continue to preserve the case as spec'ed.
866
867         No new tests are added since the behavior change is covered by existing tests.
868
869         * dom/Document.cpp:
870         (WebCore::Document::createAttribute):
871
872 2016-01-18  Brady Eidson  <beidson@apple.com>
873
874         Modern IDB: Add private-browsing variant for many IDB tests, and enable private browsing in Modern IDB.
875         https://bugs.webkit.org/show_bug.cgi?id=153179
876
877         Reviewed by Darin Adler.
878
879         Tests: Many private-browsing copies of existing IDB tests.
880
881         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
882         (WebCore::IDBClient::shouldThrowSecurityException): Allow IDB access in private browsing.
883
884 2016-01-18  Eric Carlson  <eric.carlson@apple.com>
885
886         [iOS Simulator WK1] ASSERT loading Blink layout test imported/web-platform-tests/mediacapture-streams/stream-api/mediastream/mediastream-idl.html
887         https://bugs.webkit.org/show_bug.cgi?id=153070
888         <rdar://problem/24183105>
889
890         Reviewed by Darin Adler.
891
892         No new tests, this prevents an existing test from crashing.
893
894         * platform/mock/MockRealtimeVideoSource.cpp:
895         (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Create the timer with RunLoop::current
896           instead of RunLoop::main.
897
898 2016-01-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
899
900         Reduce PassRefPtr uses in dom - 3
901         https://bugs.webkit.org/show_bug.cgi?id=153055
902
903         Reviewed by Darin Adler.
904
905         Third patch to reduce uses of PassRefPtr in WebCore/dom.
906
907         * dom/MutationObserverInterestGroup.cpp:
908         (WebCore::MutationObserverInterestGroup::enqueueMutationRecord):
909         * dom/MutationRecord.cpp:
910         (WebCore::MutationRecord::createChildList):
911         (WebCore::MutationRecord::createAttributes):
912         (WebCore::MutationRecord::createCharacterData):
913         (WebCore::MutationRecord::createWithNullOldValue):
914         * dom/MutationRecord.h:
915         * dom/NamedFlowCollection.cpp:
916         (WebCore::NamedFlowCollection::createCSSOMSnapshot):
917         * dom/NamedFlowCollection.h:
918         * dom/PendingScript.cpp:
919         (WebCore::PendingScript::releaseElementAndClear):
920         * dom/PendingScript.h:
921         * dom/ScriptRunner.h:
922         * dom/SecurityContext.h:
923         * dom/ShadowRoot.cpp:
924         (WebCore::ShadowRoot::cloneNode):
925         * dom/ShadowRoot.h:
926         * dom/SpaceSplitString.cpp:
927         (WebCore::SpaceSplitStringData::create):
928         * dom/SpaceSplitString.h:
929         * dom/TreeWalker.cpp:
930         (WebCore::TreeWalker::setCurrent):
931         (WebCore::TreeWalker::parentNode):
932         (WebCore::TreeWalker::previousNode):
933         (WebCore::TreeWalker::nextNode):
934         * dom/TreeWalker.h:
935         * dom/default/PlatformMessagePortChannel.cpp:
936         (WebCore::PlatformMessagePortChannel::entangledChannel):
937         * dom/default/PlatformMessagePortChannel.h:
938
939 2016-01-18  Nan Wang  <n_wang@apple.com>
940
941         AX: [Mac] Implement next/previous text marker functions using TextIterator
942         https://bugs.webkit.org/show_bug.cgi?id=152728
943
944         Reviewed by Chris Fleizach.
945
946         The existing AXTextMarker based calls are implemented using visible position, and that introduced
947         some bugs which make VoiceOver working incorrectly on Mac sometimes. Since TextIterator uses rendering
948         position, we tried to use it to refactor those AXTextMarker based calls.
949         In this patch, I implemented functions to navigate to previous/next text marker using Range and TextIterator.
950         Also added a conversion between visible position and character offset to make sure unconverted text marker
951         related functions are still working correctly.
952
953         Tests: accessibility/mac/previous-next-text-marker.html
954                accessibility/mac/text-marker-with-user-select-none.html
955
956         * accessibility/AXObjectCache.cpp:
957         (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
958         (WebCore::AXObjectCache::traverseToOffsetInRange):
959         (WebCore::AXObjectCache::lengthForRange):
960         (WebCore::AXObjectCache::rangeForNodeContents):
961         (WebCore::characterOffsetsInOrder):
962         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
963         (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
964         (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
965         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
966         (WebCore::AXObjectCache::nextNode):
967         (WebCore::AXObjectCache::previousNode):
968         (WebCore::AXObjectCache::visiblePositionFromCharacterOffset):
969         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
970         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
971         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
972         * accessibility/AXObjectCache.h:
973         (WebCore::CharacterOffset::CharacterOffset):
974         (WebCore::CharacterOffset::remaining):
975         (WebCore::CharacterOffset::isNull):
976         (WebCore::AXObjectCache::setNodeInUse):
977         (WebCore::AXObjectCache::removeNodeForUse):
978         (WebCore::AXObjectCache::isNodeInUse):
979         * accessibility/AccessibilityObject.cpp:
980         (WebCore::AccessibilityObject::selectionRange):
981         (WebCore::AccessibilityObject::elementRange):
982         (WebCore::AccessibilityObject::selectText):
983         (WebCore::AccessibilityObject::lineRangeForPosition):
984         (WebCore::AccessibilityObject::replacedNodeNeedsCharacter):
985         (WebCore::renderListItemContainerForNode):
986         (WebCore::listMarkerTextForNode):
987         (WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
988         (WebCore::AccessibilityObject::stringForRange):
989         (WebCore::AccessibilityObject::stringForVisiblePositionRange):
990         (WebCore::replacedNodeNeedsCharacter): Deleted.
991         * accessibility/AccessibilityObject.h:
992         (WebCore::AccessibilityObject::visiblePositionRange):
993         (WebCore::AccessibilityObject::visiblePositionRangeForLine):
994         (WebCore::AccessibilityObject::boundsForVisiblePositionRange):
995         (WebCore::AccessibilityObject::setSelectedVisiblePositionRange):
996         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
997         (isTextMarkerIgnored):
998         (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
999         (accessibilityObjectForTextMarker):
1000         (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]):
1001         (textMarkerRangeFromRange):
1002         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]):
1003         (startOrEndTextmarkerForRange):
1004         (-[WebAccessibilityObjectWrapper nextTextMarkerForNode:offset:]):
1005         (-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]):
1006         (-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]):
1007         (textMarkerForCharacterOffset):
1008         (-[WebAccessibilityObjectWrapper rangeForTextMarkerRange:]):
1009         (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]):
1010         (textMarkerForVisiblePosition):
1011         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1012
1013 2016-01-18  Olivier Blin  <olivier.blin@softathome.com>
1014
1015         [Mac] Remove unused playerToPrivateMap()
1016         https://bugs.webkit.org/show_bug.cgi?id=153203
1017
1018         Reviewed by Darin Adler.
1019
1020         This was used in previous EME implementations, but is unnecessary
1021         since r163907.
1022
1023         No new tests since this removes dead code only.
1024
1025         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1026         (WebCore::globalLoaderDelegateQueue): Deleted.
1027         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Deleted.
1028
1029 2016-01-18  Simon Fraser  <simon.fraser@apple.com>
1030
1031         Add TextStream-based logging for Position and VisiblePosition
1032         https://bugs.webkit.org/show_bug.cgi?id=153195
1033
1034         Reviewed by Ryosuke Niwa.
1035
1036         Make it easy to dump Positions and VisiblePositions with a TextStream.
1037
1038         * dom/Position.cpp:
1039         (WebCore::operator<<):
1040         * dom/Position.h:
1041         * editing/VisiblePosition.cpp:
1042         (WebCore::operator<<):
1043         * editing/VisiblePosition.h:
1044
1045 2016-01-18  Zan Dobersek  <zdobersek@igalia.com>
1046
1047         Sink the Vector<uint8_t> buffer into the SerializedScriptValue constructor
1048         https://bugs.webkit.org/show_bug.cgi?id=142634
1049
1050         Reviewed by Darin Adler.
1051
1052         Have the SerializedScriptValue constructor take in the Vector<uint8_t> buffer
1053         through an rvalue reference, avoiding the copying into the m_data member. The
1054         three-parameter constructor now takes in the Vector<String> blob URL object
1055         via const reference, and the std::unique_ptr<> object via a rvalue reference.
1056
1057         Adjust all the call sites and affected code to now either move or copy a
1058         non-movable object into the SerializedScriptValue constructor or the helper
1059         methods.
1060
1061         No new tests -- no change in behavior.
1062
1063         * bindings/js/IDBBindingUtilities.cpp:
1064         (WebCore::deserializeIDBValueDataToJSValue):
1065         (WebCore::deserializeIDBValueBuffer):
1066         (WebCore::idbValueDataToJSValue):
1067         * bindings/js/IDBBindingUtilities.h:
1068         * bindings/js/SerializedScriptValue.cpp:
1069         (WebCore::SerializedScriptValue::SerializedScriptValue):
1070         (WebCore::SerializedScriptValue::create):
1071         (WebCore::SerializedScriptValue::numberValue):
1072         (WebCore::SerializedScriptValue::undefinedValue):
1073         (WebCore::SerializedScriptValue::nullValue):
1074         * bindings/js/SerializedScriptValue.h:
1075         * testing/Internals.cpp:
1076         (WebCore::Internals::deserializeBuffer):
1077
1078 2016-01-18  Olivier Blin  <olivier.blin@softathome.com>
1079
1080         [GStreamer] Remove unused m_endTime
1081         https://bugs.webkit.org/show_bug.cgi?id=153209
1082
1083         Reviewed by Michael Catanzaro.
1084
1085         m_endTime has been unused since r47710 in MediaPlayerPrivateGStreamer.
1086
1087         No new tests since this is just a member cleanup.
1088
1089         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1090         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Deleted.
1091         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1092
1093 2016-01-18  Csaba Osztrogonác  <ossy@webkit.org>
1094
1095         Fix the --minimal build due to missing VM.h include
1096         https://bugs.webkit.org/show_bug.cgi?id=153128
1097
1098         Reviewed by Michael Catanzaro.
1099
1100         * bindings/js/WebCoreJSBuiltinInternals.h:
1101
1102 2016-01-18  Csaba Osztrogonác  <ossy@webkit.org>
1103
1104         Remove the SKIP_UNUSED_PARAM define
1105         https://bugs.webkit.org/show_bug.cgi?id=153129
1106
1107         Reviewed by Michael Catanzaro.
1108
1109         * bindings/js/WebCoreJSBuiltinInternals.cpp:
1110         (WebCore::JSBuiltinInternalFunctions::visit):
1111         (WebCore::JSBuiltinInternalFunctions::initialize):
1112         * bindings/js/WebCoreJSBuiltinInternals.h:
1113
1114 2016-01-17  Simon Fraser  <simon.fraser@apple.com>
1115
1116         More displaylist tests, and minor cleanup
1117         https://bugs.webkit.org/show_bug.cgi?id=153198
1118
1119         Reviewed by Zalan Bujtas.
1120
1121         Have the DisplayListRecorder's constructor push the recorder onto the GraphicsContext,
1122         and remove that code from GraphicsLayerCA.
1123
1124         Tests: displaylists/extent-includes-shadow.html
1125                displaylists/extent-includes-transforms.html
1126
1127         * platform/graphics/ca/GraphicsLayerCA.cpp:
1128         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
1129         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1130         (WebCore::DisplayList::Recorder::Recorder):
1131
1132 2016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
1133
1134         Remove TextRun::allowsRoundingHacks()
1135         https://bugs.webkit.org/show_bug.cgi?id=153185
1136
1137         Reviewed by Simon Fraser.
1138
1139         Rounding hacks are disallowed by default, and are only re-enabled on iOS 4 and
1140         earlier, which are not supported OSes. Because they are disallowed on all
1141         supported configurations, remove support for them wholesale.
1142
1143         No new tests.
1144
1145         * html/canvas/CanvasRenderingContext2D.cpp:
1146         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1147         * platform/graphics/FontCascade.cpp:
1148         * platform/graphics/FontCascade.h:
1149         (WebCore::FontCascade::isRoundingHackCharacter): Deleted.
1150         * platform/graphics/StringTruncator.cpp:
1151         (WebCore::stringWidth):
1152         (WebCore::truncateString):
1153         (WebCore::StringTruncator::centerTruncate):
1154         (WebCore::StringTruncator::rightTruncate):
1155         (WebCore::StringTruncator::width):
1156         (WebCore::StringTruncator::leftTruncate):
1157         (WebCore::StringTruncator::rightClipToCharacter):
1158         (WebCore::StringTruncator::rightClipToWord):
1159         * platform/graphics/StringTruncator.h:
1160         * platform/graphics/TextRun.cpp:
1161         (WebCore::TextRun::setAllowsRoundingHacks): Deleted.
1162         (WebCore::TextRun::allowsRoundingHacks): Deleted.
1163         * platform/graphics/TextRun.h:
1164         (WebCore::TextRun::TextRun):
1165         (WebCore::TextRun::applyRunRounding): Deleted.
1166         (WebCore::TextRun::applyWordRounding): Deleted.
1167         (WebCore::TextRun::disableRoundingHacks): Deleted.
1168         * platform/graphics/WidthIterator.cpp:
1169         (WebCore::WidthIterator::advanceInternal):
1170         * platform/graphics/mac/ComplexTextController.cpp:
1171         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1172         * platform/mac/DragImageMac.mm:
1173         (WebCore::widthWithFont): Deleted.
1174         (WebCore::drawAtPoint): Deleted.
1175         * rendering/RenderFileUploadControl.cpp:
1176         (WebCore::RenderFileUploadControl::fileTextValue):
1177         (WebCore::RenderFileUploadControl::paintObject): Deleted.
1178         * rendering/RenderListBox.cpp:
1179         (WebCore::RenderListBox::paintItemForeground):
1180         (WebCore::RenderListBox::updateFromElement): Deleted.
1181         * rendering/RenderTextControl.cpp:
1182         (WebCore::RenderTextControl::getAverageCharWidth): Deleted.
1183         * rendering/RenderTheme.cpp:
1184         (WebCore::RenderTheme::fileListNameForWidth):
1185         * rendering/RenderThemeMac.mm:
1186         (WebCore::RenderThemeMac::fileListNameForWidth):
1187         * rendering/svg/SVGInlineTextBox.cpp:
1188         (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
1189         * rendering/svg/SVGTextMetrics.cpp:
1190         (WebCore::SVGTextMetrics::constructTextRun): Deleted.
1191         * testing/Internals.cpp:
1192         (WebCore::Internals::resetToConsistentState): Deleted.
1193         (WebCore::Internals::allowRoundingHacks): Deleted.
1194         * testing/Internals.h:
1195         * testing/Internals.idl:
1196
1197 2016-01-16  Andreas Kling  <akling@apple.com>
1198
1199         Allocate style sheet media queries in BumpArena.
1200         <https://webkit.org/b/153188>
1201
1202         Reviewed by Antti Koivisto.
1203
1204         Teach the CSS parser to allocate MediaQuery and MediaQueryExp from BumpArena as well.
1205
1206         * css/CSSGrammar.y.in:
1207         * css/MediaQuery.h:
1208         * css/MediaQueryExp.h:
1209
1210 2016-01-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1211
1212         [GTK] Add a couple comments to ScrollbarThemeGtk
1213         https://bugs.webkit.org/show_bug.cgi?id=153184
1214
1215         Reviewed by Carlos Garcia Campos.
1216
1217         * platform/gtk/ScrollbarThemeGtk.cpp:
1218         (WebCore::ScrollbarThemeGtk::paint):
1219
1220 2016-01-16  Andreas Kling  <akling@apple.com>
1221
1222         Give RuleSet a BumpArena and start using it for RuleDataVectors.
1223         <https://webkit.org/b/153169>
1224
1225         Reviewed by Antti Koivisto.
1226
1227         Since RuleSet only supports appending rules and doesn't need to worry about removing them,
1228         it's a great candidate for BumpArena optimizations.
1229
1230         Give each RuleSet its own BumpArena and teach them how to allocate RuleDataVector objects
1231         out of them.
1232
1233         There are more things that can be done here, ideally all the sub-allocations inside RuleSet
1234         that happen via e.g Vector and HashMap would also come out of the BumpArena.
1235
1236         * css/RuleSet.cpp:
1237         (WebCore::RuleSet::RuleSet):
1238         (WebCore::RuleSet::addToRuleSet):
1239         (WebCore::RuleSet::copyShadowPseudoElementRulesFrom):
1240         * css/RuleSet.h:
1241         (WebCore::RuleSet::RuleDataVector::create):
1242         (WebCore::RuleSet::RuleSet): Deleted.
1243
1244 2016-01-16  Simon Fraser  <simon.fraser@apple.com>
1245
1246         Fix flakiness of displaylists/layer-dispay-list.html
1247         
1248         When toggling "uses display list drawing" on a GraphicsLayerCA, do
1249         a repaint.
1250
1251         * platform/graphics/ca/GraphicsLayerCA.cpp:
1252         (WebCore::GraphicsLayerCA::setUsesDisplayListDrawing):
1253
1254 2016-01-15  Simon Fraser  <simon.fraser@apple.com>
1255
1256         Remove GraphicsContext::drawConvexPolygon() and GraphicsContext::clipConvexPolygon()
1257         https://bugs.webkit.org/show_bug.cgi?id=153174
1258
1259         Reviewed by Zalan Bujtas.
1260
1261         GraphicsContext::drawConvexPolygon() and GraphicsContext::clipConvexPolygon() were
1262         poorly named (non-convex polygons are allowed), and just syntactic sugar over
1263         clipPath() and drawPath().
1264         
1265         Remove them, but add a convenience function to create a Path from a Vector of 
1266         points. For CG, we can use the more efficient CGPathAddLines().
1267         
1268         Add TextStream dumping for Path.
1269
1270         * platform/graphics/GraphicsContext.h:
1271         * platform/graphics/Path.cpp:
1272         (WebCore::Path::polygonPathFromPoints):
1273         (WebCore::Path::dump):
1274         (WebCore::operator<<):
1275         * platform/graphics/Path.h:
1276         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1277         (WebCore::GraphicsContext::setPlatformShouldAntialias):
1278         (WebCore::addConvexPolygonToContext): Deleted.
1279         (WebCore::GraphicsContext::drawConvexPolygon): Deleted.
1280         (WebCore::GraphicsContext::clipConvexPolygon): Deleted.
1281         * platform/graphics/cg/GraphicsContextCG.cpp:
1282         (WebCore::addConvexPolygonToPath): Deleted.
1283         (WebCore::GraphicsContext::drawConvexPolygon): Deleted.
1284         (WebCore::GraphicsContext::clipConvexPolygon): Deleted.
1285         * platform/graphics/cg/PathCG.cpp:
1286         (WebCore::Path::polygonPathFromPoints):
1287         (WebCore::Path::moveTo):
1288         (WebCore::Path::addLineTo):
1289         (WebCore::Path::addQuadCurveTo):
1290         (WebCore::Path::addBezierCurveTo):
1291         (WebCore::Path::addArcTo):
1292         * platform/graphics/displaylists/DisplayListItems.cpp:
1293         (WebCore::DisplayList::Item::sizeInBytes): Deleted.
1294         (WebCore::DisplayList::ClipConvexPolygon::ClipConvexPolygon): Deleted.
1295         (WebCore::DisplayList::ClipConvexPolygon::apply): Deleted.
1296         (WebCore::DisplayList::operator<<): Deleted.
1297         (WebCore::DisplayList::addConvexPolygonToPath): Deleted.
1298         (WebCore::DisplayList::DrawConvexPolygon::DrawConvexPolygon): Deleted.
1299         (WebCore::DisplayList::DrawConvexPolygon::localBounds): Deleted.
1300         (WebCore::DisplayList::DrawConvexPolygon::apply): Deleted.
1301         * platform/graphics/displaylists/DisplayListItems.h:
1302         (WebCore::DisplayList::ClipConvexPolygon::create): Deleted.
1303         (WebCore::DisplayList::ClipConvexPolygon::points): Deleted.
1304         (WebCore::DisplayList::ClipConvexPolygon::antialias): Deleted.
1305         (WebCore::DisplayList::DrawConvexPolygon::create): Deleted.
1306         (WebCore::DisplayList::DrawConvexPolygon::points): Deleted.
1307         (WebCore::DisplayList::DrawConvexPolygon::antialiased): Deleted.
1308         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1309         (WebCore::DisplayList::Recorder::drawConvexPolygon): Deleted.
1310         (WebCore::DisplayList::Recorder::clipConvexPolygon): Deleted.
1311         * platform/graphics/displaylists/DisplayListRecorder.h:
1312         * rendering/RenderBoxModelObject.cpp:
1313         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
1314         * rendering/RenderElement.cpp:
1315         (WebCore::RenderElement::drawLineForBoxSide):
1316         * rendering/RenderThemeIOS.mm:
1317         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
1318         * rendering/RenderThemeMac.mm:
1319         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
1320
1321 2016-01-16  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
1322
1323         Add Platform.cpp to ANGLESupport
1324
1325         https://bugs.webkit.org/show_bug.cgi?id=153120
1326
1327         Reviewed by Darin Adler.
1328
1329         No new tests, only addresses a build failure.
1330
1331         * CMakeLists.txt:
1332
1333 2016-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1334
1335         [GTK] List box selections stopped working again with GTK+ from current git master
1336         https://bugs.webkit.org/show_bug.cgi?id=153122
1337
1338         Reviewed by Michael Catanzaro.
1339
1340         The problem is that the ListBox selection implementation is
1341         wrong. We are using a similar implementation to GtkEntry, but
1342         GtkTreeView doesn't have a child CSS node for selections.
1343
1344         * rendering/RenderThemeGtk.cpp:
1345         (WebCore::styleColor): Don't use a child style context for ListBox selections.
1346         (WebCore::createStyleContext): Remove ListBoxSelection.
1347
1348 2016-01-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1349
1350         [SOUP] Initialize HTTP version of ResourceResponse
1351         https://bugs.webkit.org/show_bug.cgi?id=153088
1352
1353         Reviewed by Michael Catanzaro.
1354
1355         * platform/network/soup/ResourceResponseSoup.cpp:
1356         (WebCore::ResourceResponse::updateFromSoupMessage):
1357
1358 2016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
1359
1360         Tiny cleanup in FontFaceComparator
1361         https://bugs.webkit.org/show_bug.cgi?id=153044
1362
1363         Reviewed by Zalan Bujtas.
1364
1365         This is a follow-up patch to r194923.
1366
1367         No new tests because there is no behavior change.
1368
1369         * css/CSSFontSelector.cpp:
1370         (WebCore::FontFaceComparator::FontFaceComparator):
1371         (WebCore::FontFaceComparator::operator()):
1372
1373 2016-01-15  Jiewen Tan  <jiewen_tan@apple.com>
1374
1375         FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache
1376         https://bugs.webkit.org/show_bug.cgi?id=152520
1377         <rdar://problem/23305737>
1378
1379         Reviewed by Andy Estes.
1380
1381         Test: http/tests/loading/server-redirect-for-provisional-load-caching.html
1382
1383         * loader/DocumentLoader.cpp:
1384         (WebCore::DocumentLoader::responseReceived):
1385         Dispatch message to notify client that a cached resource was redirected. So,
1386         client can make proper actions to treat server side redirection.
1387         * loader/cache/CachedRawResource.h:
1388         Add a method to tell whether the cached resource was redirected.
1389
1390 2016-01-15  Chris Dumez  <cdumez@apple.com>
1391
1392         Drop obsolete HTMLDocument.width / height attributes
1393         https://bugs.webkit.org/show_bug.cgi?id=153144
1394
1395         Reviewed by Ryosuke Niwa.
1396
1397         Drop obsolete HTMLDocument.width / height attributes as these are
1398         obsolete and already not supported by other major browsers (tested
1399         Firefox and Chrome).
1400
1401         No new tests, already covered by existing tests.
1402
1403         * html/HTMLDocument.idl:
1404
1405 2016-01-15  Chris Dumez  <cdumez@apple.com>
1406
1407         Drop obsolete DocumentType.entities / notations
1408         https://bugs.webkit.org/show_bug.cgi?id=153147
1409
1410         Reviewed by Ryosuke Niwa.
1411
1412         Drop obsolete DocumentType.entities / notations attributes.
1413
1414         Firefox and Chrome already dropped those. We already dropped support for
1415         entities and notations so these always returned null.
1416
1417         No new tests, already covered by existing tests.
1418
1419         * dom/DocumentType.h:
1420         * dom/DocumentType.idl:
1421
1422 2016-01-10  Simon Fraser  <simon.fraser@apple.com>
1423
1424         Make a way to test display-list drawing
1425         https://bugs.webkit.org/show_bug.cgi?id=152956
1426
1427         Reviewed by Ryosuke Niwa.
1428
1429         Make it possible to toggle display-list drawing for a given compositing
1430         layer via internals, as well as getting a textual representation of the display
1431         list, optionally including items with platform-specific behavior.
1432         
1433         Add one test that uses this.
1434
1435         Test: displaylists/layer-dispay-list.html
1436
1437         * platform/graphics/GraphicsLayer.h:
1438         (WebCore::GraphicsLayer::displayListAsText):
1439         * platform/graphics/ca/GraphicsLayerCA.cpp:
1440         (WebCore::GraphicsLayerCA::displayListAsText):
1441         * platform/graphics/ca/GraphicsLayerCA.h:
1442         * platform/graphics/displaylists/DisplayList.cpp:
1443         (WebCore::DisplayList::DisplayList::shouldDumpForFlags):
1444         (WebCore::DisplayList::DisplayList::asText):
1445         * platform/graphics/displaylists/DisplayList.h:
1446         * rendering/RenderLayerBacking.cpp:
1447         (WebCore::RenderLayerBacking::setUsesDisplayListDrawing):
1448         (WebCore::RenderLayerBacking::displayListAsText):
1449         * rendering/RenderLayerBacking.h:
1450         * testing/Internals.cpp:
1451         (WebCore::Internals::setElementUsesDisplayListDrawing):
1452         (WebCore::Internals::displayListForElement):
1453         * testing/Internals.h:
1454         * testing/Internals.idl:
1455
1456 2016-01-15  Olivier Blin  <olivier.blin@softathome.com>
1457
1458         Fix audio build with video disabled
1459         https://bugs.webkit.org/show_bug.cgi?id=153134
1460
1461         Reviewed by Michael Catanzaro.
1462
1463         Build fails when WebAudio is enabled but VIDEO disabled.
1464
1465         No new tests since this is a build fix only.
1466
1467         * platform/audio/PlatformMediaSession.cpp:
1468         * platform/audio/PlatformMediaSession.h:
1469         * platform/audio/PlatformMediaSessionManager.cpp:
1470         * testing/Internals.cpp:
1471         (WebCore::Internals::setAudioContextRestrictions):
1472
1473 2016-01-15  Olivier Blin  <olivier.blin@softathome.com>
1474
1475         [GTK] Fix build of RenderThemeGtk without VIDEO by including HTMLInputElement
1476         https://bugs.webkit.org/show_bug.cgi?id=153133
1477
1478         Reviewed by Michael Catanzaro.
1479
1480         Build was fine with VIDEO enabled, since HTMLInputElement.h was
1481         included by transitivity through MediaControlElements.h and
1482         MediaControlElementTypes.h.
1483
1484         This seems to be broken since r194847.
1485
1486         No new tests since this is just a build fix.
1487
1488         * rendering/RenderThemeGtk.cpp:
1489
1490 2016-01-15  Ryosuke Niwa  <rniwa@webkit.org>
1491
1492         createElementNS and createAttributeNS should treat undefined namespaceURI as null string
1493         https://bugs.webkit.org/show_bug.cgi?id=153119
1494
1495         Reviewed by Chris Dumez.
1496
1497         Treat undefined as null in document.createElementNS and document.createAttributeNS as defined in:
1498         https://dom.spec.whatwg.org/#document
1499
1500         Test: fast/dom/Document/createAttributeNS-undefined-namespace.html
1501
1502         * dom/Document.idl:
1503
1504 2016-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
1505
1506         [Cocoa] Font features are not applied to the system font
1507         https://bugs.webkit.org/show_bug.cgi?id=153053
1508
1509         Reviewed by Dean Jackson.
1510
1511         We simply need to call preparePlatformFont() on it.
1512
1513         Test: fast/text/system-font-features.html
1514
1515         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1516         (WebCore::fontWithFamily):
1517
1518 2016-01-15  Tim Horton  <timothy_horton@apple.com>
1519
1520         Data detector yellow highlight location is vertically mirrored in WebKit1
1521         https://bugs.webkit.org/show_bug.cgi?id=152216
1522         <rdar://problem/23848003>
1523
1524         Reviewed by Beth Dakin.
1525
1526         No new tests, because we currently have no decent mechanism for testing
1527         where TextIndicator/Lookup/DataDetectors actually make it to the screen,
1528         nor for synthetic force-click in WebKit1.
1529
1530         * editing/mac/DictionaryLookup.h:
1531         * editing/mac/DictionaryLookup.mm:
1532         (WebCore::showPopupOrCreateAnimationController):
1533         (WebCore::DictionaryLookup::showPopup):
1534         (WebCore::DictionaryLookup::animationControllerForPopup):
1535         Add an optional function for converting between root-FrameView and
1536         handed-in-NSView coordinates, and use it to convert textBoundingRectInRootViewCoordinates
1537         into the coordinates of the WebView.
1538
1539 2016-01-15  Joseph Pecoraro  <pecoraro@apple.com>
1540
1541         Media Query (-webkit-video-playable-inline) is failing as an invalid media query expression
1542         https://bugs.webkit.org/show_bug.cgi?id=153111
1543
1544         Reviewed by Dean Jackson.
1545
1546         Test: fast/media/video-playable-inline-media-query.html
1547
1548         * css/MediaQueryEvaluator.cpp:
1549         (WebCore::video_playable_inlineMediaFeatureEval):
1550         (WebCore::isRunningOnIPhoneOrIPod): Deleted.
1551         Make the media query work regardless of the platform.
1552         It should just check the web view's settings.
1553
1554         * css/MediaQueryExp.cpp:
1555         (WebCore::featureWithoutValue):
1556         This media query expects no value, include it in the list
1557         so it is not treated as invalid.
1558
1559 2016-01-15  Zalan Bujtas  <zalan@apple.com>
1560
1561         ASSERTION FAILED: canHaveChildren() || canHaveGeneratedChildren() in WebCore::RenderElement::insertChildInternal
1562         https://bugs.webkit.org/show_bug.cgi?id=123331
1563
1564         Reviewed by Darin Adler.
1565
1566         Do not set named flow fragment bit on the flow until after the renderer is attached. Setting/resetting it too early
1567         could affect the attach/detach process itself (This is similar to attaching a multi column flow thread).
1568
1569         Test: fast/regions/input-box-with-region-assert.html
1570
1571         * rendering/RenderBlockFlow.cpp:
1572         (WebCore::RenderBlockFlow::willBeDestroyed):
1573         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
1574         (WebCore::RenderBlockFlow::setRenderNamedFlowFragment):
1575
1576 2016-01-15  Simon Fraser  <simon.fraser@apple.com>
1577
1578         Add kdebug_trace signposts for a few WebCore operations
1579         https://bugs.webkit.org/show_bug.cgi?id=153136
1580         rdar://problem/24208487
1581
1582         Reviewed by Sam Weinig.
1583
1584         Add trace points for style recalc, layout, view painting and layer painting.
1585
1586         * dom/Document.cpp:
1587         (WebCore::Document::recalcStyle):
1588         * page/FrameView.cpp:
1589         (WebCore::FrameView::layout):
1590         (WebCore::FrameView::paintContents):
1591         * platform/graphics/ca/GraphicsLayerCA.cpp:
1592         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
1593
1594 2016-01-15  Andreas Kling  <akling@apple.com>
1595
1596         Use BumpArena for style sheet object tree.
1597         <https://webkit.org/b/152696>
1598
1599         Reviewed by Antti Koivisto.
1600
1601         Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
1602         to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
1603
1604         This basically means that most objects that make up a given style sheet will end up
1605         in one (or a few) contiguous region(s) of memory, instead of being scattered all
1606         over the malloc heap.
1607
1608         In the common case (no CSSOM manipulation), the lifetimes of these objects are very
1609         predictable: everything tends to die when the StyleSheetContents dies.
1610         This dramatically improves space-efficiency in those cases, and allows us to return
1611         contiguous chunks of memory to the system once a style sheet is no longer needed.
1612
1613         One-off CSS parses that don't work within a StyleSheetContents context will have
1614         their StyleRules & co allocated through FastMalloc just like before.
1615
1616         Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
1617         predictable lifetime.
1618
1619         * css/CSSGrammar.y.in:
1620         * css/CSSKeyframesRule.h:
1621         (WebCore::StyleRuleKeyframes::create):
1622         * css/CSSParser.cpp:
1623         (WebCore::CSSParser::createStyleProperties):
1624         (WebCore::CSSParser::createMediaRule):
1625         (WebCore::CSSParser::createSupportsRule):
1626         (WebCore::CSSParser::createKeyframesRule):
1627         (WebCore::CSSParser::setArena):
1628         (WebCore::CSSParser::arena):
1629         (WebCore::CSSParser::createStyleRule):
1630         (WebCore::CSSParser::createFontFaceRule):
1631         (WebCore::CSSParser::createPageRule):
1632         (WebCore::CSSParser::createRegionRule):
1633         (WebCore::CSSParser::createViewportRule):
1634         * css/CSSParser.h:
1635         * css/CSSParserValues.cpp:
1636         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
1637         (WebCore::CSSParserSelector::adoptSelectorVector):
1638         * css/CSSParserValues.h:
1639         * css/CSSSelectorList.cpp:
1640         (WebCore::CSSSelectorList::CSSSelectorList):
1641         (WebCore::CSSSelectorList::adoptSelectorVector):
1642         (WebCore::CSSSelectorList::deleteSelectors):
1643         * css/CSSSelectorList.h:
1644         * css/StyleProperties.cpp:
1645         (WebCore::ImmutableStyleProperties::create):
1646         (WebCore::StyleProperties::immutableCopyIfNeeded):
1647         * css/StyleProperties.h:
1648         * css/StyleRule.cpp:
1649         (WebCore::StyleRule::create):
1650         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
1651         (WebCore::StyleRuleRegion::StyleRuleRegion):
1652         * css/StyleRule.h:
1653         (WebCore::StyleRule::create):
1654         (WebCore::StyleRule::parserAdoptSelectorVector):
1655         (WebCore::StyleRuleFontFace::create):
1656         (WebCore::StyleRulePage::create):
1657         (WebCore::StyleRulePage::parserAdoptSelectorVector):
1658         (WebCore::StyleRuleMedia::create):
1659         (WebCore::StyleRuleSupports::create):
1660         (WebCore::StyleRuleRegion::create):
1661         (WebCore::StyleRuleViewport::create):
1662         * css/StyleSheetContents.cpp:
1663         (WebCore::StyleSheetContents::StyleSheetContents):
1664         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1665         (WebCore::StyleSheetContents::parseStringAtPosition):
1666         * css/StyleSheetContents.h:
1667         * dom/SelectorQuery.cpp:
1668         (WebCore::SelectorQueryCache::SelectorQueryCache):
1669         (WebCore::SelectorQueryCache::add):
1670         * dom/SelectorQuery.h:
1671         * svg/SVGFontFaceElement.cpp:
1672         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
1673
1674 2016-01-15  Dave Hyatt  <hyatt@apple.com>
1675
1676         Avoid downloading the wrong image for <picture> elements.
1677         https://bugs.webkit.org/show_bug.cgi?id=153027
1678
1679         Reviewed by Dean Jackson.
1680
1681         No tests, since they are always flaky.
1682
1683         * html/HTMLImageElement.cpp:
1684         (WebCore::HTMLImageElement::HTMLImageElement):
1685         (WebCore::HTMLImageElement::~HTMLImageElement):
1686         (WebCore::HTMLImageElement::createForJSConstructor):
1687         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1688         (WebCore::HTMLImageElement::insertedInto):
1689         (WebCore::HTMLImageElement::removedFrom):
1690         (WebCore::HTMLImageElement::pictureElement):
1691         (WebCore::HTMLImageElement::setPictureElement):
1692         (WebCore::HTMLImageElement::width):
1693         * html/HTMLImageElement.h:
1694         (WebCore::HTMLImageElement::hasShadowControls):
1695         * html/HTMLPictureElement.h:
1696         * html/parser/HTMLConstructionSite.cpp:
1697         (WebCore::HTMLConstructionSite::createHTMLElement):
1698         * html/parser/HTMLPreloadScanner.cpp:
1699         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
1700
1701         Images that are built underneath a <picture> element are now connected
1702         to that picture element via a setPictureNode call from the parser. This
1703         ensures that the correct <source> elements are examined before checking the image.
1704
1705         This connection between images and their picture owners is handled using a static
1706         HashMap in HTMLImageElement. This connection is made both from the parser and from
1707         DOM insertions, and the map is queried now instead of looking directly at the
1708         image's parentNode().
1709
1710 2016-01-15  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1711
1712         [Streams API] Expose ReadableStream and relatives to Worker
1713         https://bugs.webkit.org/show_bug.cgi?id=152066
1714
1715         Reviewed by Darin Adler.
1716
1717         Covered by rebased tests.
1718
1719         * Modules/streams/ByteLengthQueuingStrategy.idl:
1720         * Modules/streams/CountQueuingStrategy.idl:
1721         * Modules/streams/ReadableStream.idl:
1722         * Modules/streams/ReadableStreamController.idl:
1723         * Modules/streams/ReadableStreamReader.idl:
1724
1725 2016-01-15  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1726
1727         CORS: Fix the handling of redirected request containing Origin null.
1728         https://bugs.webkit.org/show_bug.cgi?id=128816
1729
1730         Reviewed by Brent Fulgham.
1731
1732         Merging Blink patch from George Ancil (https://chromiumcodereview.appspot.com/20735002).
1733
1734         This patch removes the check for securityOrigin->isUnique() in passesAccessControlCheck().
1735         This check prevented a redirected request with "Origin: null" from being
1736         successful even when the response contains "Access-Control-Allow-Origin: null"
1737
1738         Tests: http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html
1739                http/tests/xmlhttprequest/redirect-cors-origin-null.html
1740
1741         * loader/CrossOriginAccessControl.cpp:
1742         (WebCore::passesAccessControlCheck):
1743
1744 2016-01-14  Commit Queue  <commit-queue@webkit.org>
1745
1746         Unreviewed, rolling out r195064.
1747         https://bugs.webkit.org/show_bug.cgi?id=153118
1748
1749         test fails most of the time (Requested by alexchristensen on
1750         #webkit).
1751
1752         Reverted changeset:
1753
1754         "Avoid downloading the wrong image for <picture> elements."
1755         https://bugs.webkit.org/show_bug.cgi?id=153027
1756         http://trac.webkit.org/changeset/195064
1757
1758 2016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
1759
1760         createElement should not lowercase non-ASCII characters
1761         https://bugs.webkit.org/show_bug.cgi?id=153114
1762
1763         Reviewed by Alex Christensen.
1764
1765         According to step 2 in https://dom.spec.whatwg.org/#dom-document-createelement, document.createElement should not
1766         lowercase non-ASCII letters, and this is also what Firefox does. Match that behavior by lowercasing the tag name
1767         by convertToASCIILowercase() instead of lower() in createElement.
1768
1769         Also merged HTMLDocument::createElement into Document::createElement for simplicity and avoid duplicating
1770         the call to isValidName and setting a DOM exception.
1771
1772         No new tests since the behavior change is covered by the existing W3C tests.
1773
1774         * dom/Document.cpp:
1775         (WebCore::Document::createElement): Create a HTML element with ASCII-lowercased tag name inside a HTML document.
1776         * dom/Document.h:
1777         * html/HTMLDocument.cpp:
1778         (WebCore::addLocalNameToSet):
1779         (WebCore::HTMLDocument::createElement): Merged into Document::createElement.
1780         * html/HTMLDocument.h:
1781
1782 2016-01-14  Brady Eidson  <beidson@apple.com>
1783
1784         Modern IDB: Support opening and deleting SQLite databases on disk.
1785         https://bugs.webkit.org/show_bug.cgi?id=153084
1786
1787         Reviewed by Alex Christensen, Sam Weinig and Andy Estes (oh my!).
1788
1789         No new tests (Infrastructure, no testable change in behavior).
1790
1791         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1792         (WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
1793         * Modules/indexeddb/IDBDatabaseIdentifier.h:
1794
1795         * Modules/indexeddb/server/IDBServer.cpp:
1796         (WebCore::IDBServer::IDBServer::create):
1797         (WebCore::IDBServer::IDBServer::IDBServer):
1798         (WebCore::IDBServer::IDBServer::createBackingStore):
1799         * Modules/indexeddb/server/IDBServer.h:
1800
1801         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1802         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
1803         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1804         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
1805         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1806
1807         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1808         (WebCore::InProcessIDBServer::create):
1809         (WebCore::InProcessIDBServer::InProcessIDBServer):
1810         * Modules/indexeddb/shared/InProcessIDBServer.h:
1811
1812 2016-01-14  Myles C. Maxfield  <mmaxfield@apple.com>
1813
1814         Mixing Content Blocking of fonts and display:none rules causes battery drain
1815         https://bugs.webkit.org/show_bug.cgi?id=153051
1816         <rdar://problem/23187709>
1817
1818         Reviewed by Alex Christensen.
1819
1820         If we have applied a rule before and we are not applying it again, don't
1821         resolve the style again.
1822
1823         Test: http/tests/contentextensions/font-display-none-repeated-layout.html
1824
1825         * contentextensions/ContentExtensionStyleSheet.cpp:
1826         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
1827         * contentextensions/ContentExtensionStyleSheet.h:
1828         * dom/ExtensionStyleSheets.cpp:
1829         (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
1830
1831 2016-01-14  Ryosuke Niwa  <rniwa@webkit.org>
1832
1833         Add document.defineCustomElement
1834         https://bugs.webkit.org/show_bug.cgi?id=153092
1835
1836         Reviewed by Chris Dumez.
1837
1838         Added document.defineCustomElement and added a constructor to HTMLElement which can be called
1839         as "super" in a subclass of HTMLElement. This is a prototype of new custom elements API and
1840         willfully violates the current specification at http://w3c.github.io/webcomponents/spec/custom/
1841
1842         Each author defined class can define multiple elements using distinct tag names. In such cases,
1843         the super call must specify the tag name. e.g.
1844
1845         class SomeCustomElement extends HTMLElement { constructor(name) { super(name); } }
1846         document.defineCustomElement('some-custom-element', SomeCustomElement);
1847         document.defineCustomElement('other-custom-element', SomeCustomElement);
1848         new SomeCustomElement('some-custom-element');
1849
1850         When a class is associated with exactly one tag name, the argument can be omitted. e.g.
1851
1852         class AnotherCustomElement extends HTMLElement {}
1853         document.defineCustomElement('another-custom-element', AnotherCustomElement);
1854         new AnotherCustomElement();
1855
1856         We allow only subclassing of HTMLElement and only in (X)HTML namespace.
1857
1858         Tests: fast/custom-elements/Document-defineCustomElement.html
1859                fast/custom-elements/HTMLElement-constructor.html
1860
1861         * CMakeLists.txt:
1862         * WebCore.xcodeproj/project.pbxproj:
1863
1864         * bindings/js/JSCustomElementInterface.cpp: Added. Abstracts an author-defined class associated
1865         with a custom element. It's a Active DOM object and lives until the associated document dies.
1866         (WebCore::JSCustomElementInterface::JSCustomElementInterface):
1867         (WebCore::JSCustomElementInterface::~JSCustomElementInterface):
1868         * bindings/js/JSCustomElementInterface.h: Added.
1869         (WebCore::JSCustomElementInterface::create):
1870         (WebCore::JSCustomElementInterface::scriptExecutionContext):
1871         (WebCore::JSCustomElementInterface::constructor):
1872
1873         * bindings/js/JSDocumentCustom.cpp:
1874         (WebCore::JSDocument::defineCustomElement): Added. Define a custom element by associating a tag
1875         name with an author defined JS class after validating arguments.
1876
1877         * bindings/js/JSHTMLElementCustom.cpp:
1878         (WebCore::constructJSHTMLElement): Added. Look up the tag name based on new.target if one is not
1879         specified. If a tag name is specified, check that new.target is associated with the tag name.
1880
1881         * dom/CustomElementDefinitions.cpp: Added.
1882         (WebCore::CustomElementDefinitions::checkName): Added. Restricts tag names similarly to
1883         http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type
1884         (WebCore::CustomElementDefinitions::defineElement): Added. Associates a JS class with a tag name.
1885         (WebCore::CustomElementDefinitions::findInterface): Added. Finds a JS class by a tag name.
1886         (WebCore::CustomElementDefinitions::findName): Added. Finds a tag name by a JS class.
1887         * dom/CustomElementDefinitions.h: Added.
1888         (WebCore::CustomElementDefinitions::CustomElementInfo): Added.
1889
1890         * dom/Document.cpp:
1891         (WebCore::Document::ensureCustomElementDefinitions): Added.
1892         * dom/Document.h:
1893         (WebCore::Document::customElementDefinitions): Added.
1894
1895         * dom/Document.idl:
1896         * html/HTMLElement.idl:
1897
1898 2016-01-14  Simon Fraser  <simon.fraser@apple.com>
1899
1900         Remove workaround for rdar://problem/23623670
1901         https://bugs.webkit.org/show_bug.cgi?id=153107
1902         rdar://problem/23633319
1903
1904         Reviewed by Tim Horton.
1905
1906         Remove the code that uses IOSurfaceAcceleratorTransformSurface() when copying from
1907         back-to-front buffer, now that CGIOSurfaceContextCreate()-code path works correctly.
1908
1909         * platform/graphics/cocoa/IOSurface.h:
1910         * platform/graphics/cocoa/IOSurface.mm:
1911         (IOSurface::ensurePlatformContext):
1912         (IOSurface::copyToSurface): Deleted.
1913
1914 2016-01-14  Beth Dakin  <bdakin@apple.com>
1915
1916         WK1 and WK2 should share more candidate request code
1917         https://bugs.webkit.org/show_bug.cgi?id=153108
1918
1919         Reviewed by Simon Fraser.
1920
1921         requestCandidatesForSelection() does not need to be exposed as an 
1922         EditorClient function. WK1 can just call invoke this code from the existing 
1923         respondToChangedSelection EditorClient function, which is what WK2 does.
1924         * editing/Editor.cpp:
1925         (WebCore::Editor::respondToChangedSelection):
1926         * loader/EmptyClients.h:
1927         * page/EditorClient.h:
1928         (WebCore::EditorClient::supportsGlobalSelection):
1929
1930 2016-01-14  Beth Dakin  <bdakin@apple.com>
1931
1932         WK2: Request completion candidates when needed
1933         https://bugs.webkit.org/show_bug.cgi?id=153040
1934         -and corresponding-
1935         rdar://problem/24155631
1936
1937         Reviewed by Enrica Casucci and Tim Horton.
1938
1939         Helper functions for stringForCandidateRequest() and 
1940         handleAcceptedCandidate()
1941         * editing/Editor.cpp:
1942         (WebCore::candidateRangeForSelection):
1943         (WebCore::candidateWouldReplaceText):
1944
1945         Request candidates for the word that is currently being typed so long as the 
1946         candidate would replace that word. Otherwise, use String().
1947         (WebCore::Editor::stringForCandidateRequest):
1948
1949         When a candidate has been accepted, insert the text.
1950         (WebCore::Editor::handleAcceptedCandidate):
1951         * editing/Editor.h:
1952
1953 2016-01-14  Daniel Bates  <dabates@apple.com>
1954
1955         Disallow use of Geolocation service from unique origins
1956         https://bugs.webkit.org/show_bug.cgi?id=153102
1957         <rdar://problem/23055645>
1958
1959         Reviewed by Alexey Proskuryakov.
1960
1961         Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html
1962                fast/dom/Geolocation/dataURL-watchPosition.html
1963                fast/dom/Geolocation/srcdoc-getCurrentPosition.html
1964                fast/dom/Geolocation/srcdoc-watchPosition.html
1965                http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html
1966                http/tests/security/sandboxed-iframe-geolocation-watchPosition.html
1967
1968         * Modules/geolocation/Geolocation.cpp:
1969         (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object
1970         associated with this script execution context.
1971         (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested
1972         from a document with a unique origin.
1973         * Modules/geolocation/Geolocation.h:
1974         * page/SecurityOrigin.h:
1975         (WebCore::SecurityOrigin::canRequestGeolocation): Added.
1976
1977 2016-01-14  Daniel Bates  <dabates@apple.com>
1978
1979         [XSS Auditor] Extract attribute truncation logic and formalize string canonicalization
1980         https://bugs.webkit.org/show_bug.cgi?id=152874
1981
1982         Reviewed by Brent Fulgham.
1983
1984         Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
1985         <https://src.chromium.org/viewvc/blink?revision=176339&view=revision>
1986
1987         Extract the src-like and script-like attribute truncation logic into independent functions
1988         towards making it more straightforward to re-purpose this logic. Additionally, formalize the
1989         concept of string canonicalization as a member function that consolidates the process of
1990         decoding URL escape sequences, truncating the decoded string (if applicable), and removing
1991         characters that are considered noise.
1992
1993         * html/parser/XSSAuditor.cpp:
1994         (WebCore::truncateForSrcLikeAttribute): Extracted from XSSAuditor::decodedSnippetForAttribute().
1995         (WebCore::truncateForScriptLikeAttribute): Ditto.
1996         (WebCore::XSSAuditor::init): Write in terms of XSSAuditor::canonicalize().
1997         (WebCore::XSSAuditor::filterCharacterToken): Updated to make use of formalized canonicalization methods.
1998         (WebCore::XSSAuditor::filterScriptToken): Ditto.
1999         (WebCore::XSSAuditor::filterObjectToken): Ditto.
2000         (WebCore::XSSAuditor::filterParamToken): Ditto.
2001         (WebCore::XSSAuditor::filterEmbedToken): Ditto.
2002         (WebCore::XSSAuditor::filterAppletToken): Ditto.
2003         (WebCore::XSSAuditor::filterFrameToken): Ditto.
2004         (WebCore::XSSAuditor::filterInputToken): Ditto.
2005         (WebCore::XSSAuditor::filterButtonToken): Ditto.
2006         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): Ditto.
2007         (WebCore::XSSAuditor::eraseAttributeIfInjected): Updated code to use early return style and avoid an unnecessary string
2008         comparison when we know that a src attribute was injected.
2009         (WebCore::XSSAuditor::canonicalizedSnippetForTagName): Renamed; formerly known as XSSAuditor::decodedSnippetForName(). Updated
2010         to make use of XSSAuditor::canonicalize().
2011         (WebCore::XSSAuditor::snippetFromAttribute): Renamed; formerly known as XSSAuditor::decodedSnippetForAttribute(). Moved
2012         truncation logic from here to WebCore::truncateFor{Script, Src}LikeAttribute.
2013         (WebCore::XSSAuditor::canonicalize): Added.
2014         (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Added.
2015         (WebCore::canonicalize): Deleted.
2016         (WebCore::XSSAuditor::decodedSnippetForName): Deleted.
2017         (WebCore::XSSAuditor::decodedSnippetForAttribute): Deleted.
2018         (WebCore::XSSAuditor::decodedSnippetForJavaScript): Deleted.
2019         * html/parser/XSSAuditor.h: Define enum class for the various attribute truncation styles.
2020
2021 2016-01-14  Daniel Bates  <dabates@apple.com>
2022
2023         [XSS Auditor] Partial bypass when web server collapses path components
2024         https://bugs.webkit.org/show_bug.cgi?id=152872
2025
2026         Reviewed by Brent Fulgham.
2027
2028         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
2029         <https://src.chromium.org/viewvc/blink?revision=167610&view=revision>
2030
2031         Test: http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html
2032
2033         * html/parser/XSSAuditor.cpp:
2034         (WebCore::isNonCanonicalCharacter):
2035         (WebCore::XSSAuditor::init):
2036         (WebCore::XSSAuditor::decodedSnippetForName):
2037         (WebCore::XSSAuditor::decodedSnippetForAttribute):
2038         (WebCore::XSSAuditor::decodedSnippetForJavaScript):
2039         (WebCore::fullyDecodeString): Deleted.
2040
2041 2016-01-14  Beth Dakin  <bdakin@apple.com>
2042
2043         imported/blink/editing/text-iterator/read-past-cloned-first-letter.html 
2044         crashes
2045         https://bugs.webkit.org/show_bug.cgi?id=153104
2046         -and corresponding-
2047         rdar://problem/24155631
2048
2049         Reviewed by Simon Fraser.
2050
2051         Though we merged the Blink test, we never merged Blink patch that fixed this 
2052         bug. So this is a merge of https://github.com/ChromiumWebApps/blink/commit/5a0d23d4368c661f621364339fde66b41ef019e5
2053         * editing/TextIterator.cpp:
2054         (WebCore::SimplifiedBackwardsTextIterator::handleFirstLetter):
2055
2056 2016-01-14  Zalan Bujtas  <zalan@apple.com>
2057
2058         ASSERTION FAILED: !newRelayoutRoot.container() || !newRelayoutRoot.container()->needsLayout() in WebCore::FrameView::scheduleRelayoutOfSubtree
2059         https://bugs.webkit.org/show_bug.cgi?id=151605#c1
2060
2061         Reviewed by David Hyatt.
2062
2063         Do not let RenderMultiColumnSet/RenderFlowThread mark ancestors dirty while updating scrollbars
2064         for overflow content. While updating scrollbars, we only layout descendants so marking parents dirty
2065         is unnecessary and could lead to an invalid dirty state.
2066
2067         Test: fast/multicol/body-stuck-with-dirty-bit-with-columns.html
2068
2069         * rendering/RenderBlockFlow.cpp:
2070         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild):
2071         * rendering/RenderFlowThread.cpp:
2072         (WebCore::RenderFlowThread::invalidateRegions):
2073         * rendering/RenderFlowThread.h:
2074         * rendering/RenderMultiColumnSet.cpp:
2075         (WebCore::RenderMultiColumnSet::prepareForLayout):
2076
2077 2016-01-14  Dave Hyatt  <hyatt@apple.com>
2078
2079         Avoid downloading the wrong image for <picture> elements.
2080         https://bugs.webkit.org/show_bug.cgi?id=153027
2081
2082         Reviewed by Dean Jackson.
2083
2084         Added test in fast/picture.
2085
2086         * html/HTMLImageElement.cpp:
2087         (WebCore::HTMLImageElement::HTMLImageElement):
2088         (WebCore::HTMLImageElement::~HTMLImageElement):
2089         (WebCore::HTMLImageElement::createForJSConstructor):
2090         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2091         (WebCore::HTMLImageElement::insertedInto):
2092         (WebCore::HTMLImageElement::removedFrom):
2093         (WebCore::HTMLImageElement::pictureElement):
2094         (WebCore::HTMLImageElement::setPictureElement):
2095         (WebCore::HTMLImageElement::width):
2096         * html/HTMLImageElement.h:
2097         (WebCore::HTMLImageElement::hasShadowControls):
2098         * html/HTMLPictureElement.h:
2099         * html/parser/HTMLConstructionSite.cpp:
2100         (WebCore::HTMLConstructionSite::createHTMLElement):
2101         * html/parser/HTMLPreloadScanner.cpp:
2102         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2103
2104         Images that are built underneath a <picture> element are now connected
2105         to that picture element via a setPictureNode call from the parser. This
2106         ensures that the correct <source> elements are examined before checking the image.
2107
2108         This connection between images and their picture owners is handled using a static
2109         HashMap in HTMLImageElement. This connection is made both from the parser and from
2110         DOM insertions, and the map is queried now instead of looking directly at the
2111         image's parentNode().
2112
2113 2016-01-14  Commit Queue  <commit-queue@webkit.org>
2114
2115         Unreviewed, rolling out r195002.
2116         https://bugs.webkit.org/show_bug.cgi?id=153098
2117
2118         Crashes many/most editing tests (Requested by ap on #webkit).
2119
2120         Reverted changeset:
2121
2122         "WK2: Request completion candidates when needed"
2123         https://bugs.webkit.org/show_bug.cgi?id=153040
2124         http://trac.webkit.org/changeset/195002
2125
2126 2016-01-14  Martin Robinson  <mrobinson@igalia.com>
2127
2128         [GTK] [EFL] Hyphenation can never work in practice due to requirements on lang tags
2129         https://bugs.webkit.org/show_bug.cgi?id=147310
2130
2131         Reviewed by Michael Catanzaro.
2132
2133         Test: platform/gtk/fast/text/hyphenate-flexible-locales.html
2134
2135         * platform/text/hyphen/HyphenationLibHyphen.cpp: Make locale matching for dictionary
2136         selection a lot looser by matching case insensitively, matching multiple dictionaries
2137         when only the language is specified, and ignoring the difference between '_' and '-' in
2138         the locale name.
2139         (WebCore::scanDirectoryForDicionaries): Now produce HashMap of Vectors instead of a single
2140         path for each locale. Also add alternate entries to handle different ways of specifying
2141         the locale.
2142         (WebCore::scanTestDictionariesDirectoryIfNecessary): Update to handle the difference
2143         in HashMap type.
2144         (WebCore::availableLocales): Ditto.
2145         (WebCore::canHyphenate): Also look for the lowercased version of the locale.
2146         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey):
2147         Key on the dictionary path now so that we can load more than one dictionary per locale.
2148         (WebCore::lastHyphenLocation): Iterate through each matched dictionary in turn.
2149
2150 2016-01-14  Per Arne Vollan  <peavo@outlook.com>
2151
2152         [Win] Remove workarounds for fixed bugs in fmod and pow.
2153         https://bugs.webkit.org/show_bug.cgi?id=153071
2154
2155         Reviewed by Brent Fulgham.
2156
2157         Compile fix, help MSVC pick correct pow overload.
2158
2159         * rendering/shapes/BoxShape.cpp:
2160         (WebCore::adjustRadiusForMarginBoxShape):
2161
2162 2016-01-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2163
2164         Fix problems with cross-origin redirects
2165         https://bugs.webkit.org/show_bug.cgi?id=116075
2166
2167         Reviewed by Daniel Bates.
2168
2169         Merging https://chromium.googlesource.com/chromium/blink/+/7ea774e478f84f355748108d2aaabca15355d512 by Ken Russell
2170         Same origin redirect responses leading to cross-origin requests were checked as cross-origin redirect responses.
2171         Introduced ClientRequestedCredentials to manage whether credentials are needed or not in the cross-origin request.
2172
2173         In addition to Blink patch, it was needed to update some loaders with the newly introduced ClientRequestedCredentials parameter.
2174         Added the clearing of "Accept-Encoding" header from cross-origin requests as Mac HTTP network layer is adding it for same-origin requests.
2175
2176         Test: http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html
2177
2178         * loader/DocumentLoader.cpp:
2179         (WebCore::DocumentLoader::startLoadingMainResource): Added new security parameter (from Blink patch).
2180         * loader/DocumentThreadableLoader.cpp:
2181         (WebCore::DocumentThreadableLoader::redirectReceived): Updated checks so that same origin redirections are not treated as cross origin redirections (from Blink patch).
2182         * loader/MediaResourceLoader.cpp:
2183         (WebCore::MediaResourceLoader::start):
2184         * loader/NetscapePlugInStreamLoader.cpp:
2185         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader): Added new security parameter.
2186         * loader/ResourceLoaderOptions.h:
2187         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions): Added new security parameter (from Blink patch).
2188         (WebCore::ResourceLoaderOptions::credentialRequest):
2189         (WebCore::ResourceLoaderOptions::setCredentialRequest):
2190         * loader/cache/CachedResourceLoader.cpp:
2191         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): Ditto.
2192         (WebCore::CachedResourceLoader::defaultCachedResourceOptions): Ditto.
2193         * loader/icon/IconLoader.cpp:
2194         (WebCore::IconLoader::startLoading): Added new security parameter.
2195         * page/EventSource.cpp:
2196         (WebCore::EventSource::connect): Added new security parameter (from Blink patch).
2197         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2198         (WebCore::WebCoreAVCFResourceLoader::startLoading): Added new security parameter.
2199         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2200         (WebCore::WebCoreAVFResourceLoader::startLoading): Ditto.
2201         * platform/network/ResourceHandleTypes.h: Added new security parameter constants (from Blink patch).
2202         * platform/network/ResourceRequestBase.cpp:
2203         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding): Function to remove "Accept-Encoding" header.
2204         * platform/network/ResourceRequestBase.h: Ditto.
2205         * xml/XMLHttpRequest.cpp:
2206         (WebCore::XMLHttpRequest::createRequest): Added new security parameter.
2207
2208 2016-01-13  Myles C. Maxfield  <mmaxfield@apple.com>
2209
2210         Addressing more post-review comments after r194566
2211
2212         Unreviewed.
2213
2214         No new tests because there is no behavior change.
2215
2216         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
2217         (WebCore::topLanguagePreference):
2218
2219 2016-01-13  Alex Christensen  <achristensen@webkit.org>
2220
2221         Implement custom protocols when using NetworkSession
2222         https://bugs.webkit.org/show_bug.cgi?id=153078
2223
2224         Reviewed by Andy Estes.
2225
2226         No new tests, but this makes the WebKit2CustomProtocolsTest api tests pass when using NetworkSession.
2227
2228         * WebCore.xcodeproj/project.pbxproj:
2229         Make NSURLConnectionSPI.h private so we can include it from within WebKit2.
2230
2231 2016-01-13  Brent Fulgham  <bfulgham@apple.com>
2232
2233         Cross-protocol, cross-site scripting (XPSS) using HTML forms
2234         https://bugs.webkit.org/show_bug.cgi?id=153017
2235         <rdar://problem/5873254>
2236
2237         Reviewed by David Kilzer.
2238
2239         * loader/DocumentLoader.cpp:
2240         (WebCore::DocumentLoader::responseReceived): If response HTTP version is 0.9,
2241         sandbox against script execution and plugins.
2242         * loader/ResourceLoader.cpp:
2243         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
2244         * loader/SubresourceLoader.cpp:
2245         (WebCore::SubresourceLoader::didReceiveResponse): Ditto.
2246         * platform/network/ResourceResponseBase.cpp:
2247         (WebCore::ResourceResponseBase::adopt): Update for HTTP version.
2248         (WebCore::ResourceResponseBase::copyData): Ditto.
2249         (WebCore::ResourceResponseBase::httpVersion): Added.
2250         (WebCore::ResourceResponseBase::setHTTPVersion): Ditto.
2251         * platform/network/ResourceResponseBase.h:
2252         (WebCore::ResourceResponseBase::encode): Update for HTTP version.
2253         (WebCore::ResourceResponseBase::decode): Ditto.
2254         * platform/network/cf/ResourceResponseCFNet.cpp:
2255         (WebCore::ResourceResponse::platformLazyInit): Capture HTTP version.
2256         * platform/network/cocoa/ResourceResponseCocoa.mm:
2257         (WebCore::ResourceResponse::platformLazyInit): Ditto.
2258
2259 2016-01-13  Beth Dakin  <bdakin@apple.com>
2260
2261         WK2: Request completion candidates when needed
2262         https://bugs.webkit.org/show_bug.cgi?id=153040
2263         -and corresponding-
2264         rdar://problem/24155631
2265
2266         Reviewed by Enrica Casucci.
2267
2268         Helper functions for stringForCandidateRequest() and 
2269         handleAcceptedCandidate()
2270         * editing/Editor.cpp:
2271         (WebCore::candidateRangeForSelection):
2272         (WebCore::candidateWouldReplaceText):
2273
2274         Request candidates for the word that is currently being typed so long as the 
2275         candidate would replace that word. Otherwise, use String().
2276         (WebCore::Editor::stringForCandidateRequest):
2277
2278         When a candidate has been accepted, insert the text.
2279         (WebCore::Editor::handleAcceptedCandidate):
2280         * editing/Editor.h:
2281
2282 2016-01-13  Myles C. Maxfield  <mmaxfield@apple.com>
2283
2284         Addressing post-review comments after r194566
2285
2286         Unreviewed.
2287
2288         No new tests because there is no behavior difference.
2289
2290         * platform/text/mac/TextBreakIteratorInternalICUMac.mm:
2291         (WebCore::textBreakLocalePreference):
2292         (WebCore::topLanguagePreference):
2293         (WebCore::getSearchLocale):
2294         (WebCore::getTextBreakLocale):
2295         (WebCore::canonicalLanguageIdentifier): Deleted.
2296
2297 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
2298
2299         formaction must return document's address when formaction is missing
2300         https://bugs.webkit.org/show_bug.cgi?id=148874
2301
2302         Reviewed by Chris Dumez.
2303
2304         Fixed the bug by falling back to document.url() when the attribute is not set or is empty in formAction getter.
2305
2306         Test: fast/forms/formaction-attribute-with-empty-value.html
2307
2308         * html/HTMLButtonElement.idl:
2309         * html/HTMLFormControlElement.cpp:
2310         (WebCore::HTMLFormControlElement::formAction): Added.
2311         (WebCore::HTMLFormControlElement::setFormAction): Added.
2312         * html/HTMLFormControlElement.h:
2313         * html/HTMLInputElement.idl:
2314
2315 2016-01-13  Chris Dumez  <cdumez@apple.com>
2316
2317         Unreviewed, rolling out r194900.
2318
2319         Roll back in as this did not actually regress PLT
2320
2321         Reverted changeset:
2322
2323         "Unreviewed, rolling out r194826."
2324         https://bugs.webkit.org/show_bug.cgi?id=153020
2325         http://trac.webkit.org/changeset/194900
2326
2327 2016-01-13  Konstantin Tokarev  <annulen@yandex.ru>
2328
2329         Removed empty #if block from Font.h
2330         https://bugs.webkit.org/show_bug.cgi?id=153067
2331
2332         Reviewed by Alex Christensen.
2333
2334         No new tests needed.
2335
2336         * platform/graphics/Font.h:
2337         (WebCore::Font::scriptCache): Deleted.
2338
2339 2016-01-13  Michael Catanzaro  <mcatanzaro@igalia.com>
2340
2341         [GTK] Consistently use virtual and override specifiers in ScrollbarThemeGtk
2342         https://bugs.webkit.org/show_bug.cgi?id=153076
2343
2344         Reviewed by Alex Christensen.
2345
2346         No behavior change.
2347
2348         * platform/gtk/ScrollbarThemeGtk.h:
2349
2350 2016-01-13  Daniel Bates  <dabates@apple.com>
2351
2352         Cleanup: XSS Auditor should avoid re-evaluating the parsed script tag
2353         https://bugs.webkit.org/show_bug.cgi?id=152870
2354
2355         Reviewed by Brent Fulgham.
2356
2357         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
2358         <https://src.chromium.org/viewvc/blink?revision=154354&view=revision>
2359
2360         Although the XSS Auditor caches the decoded start tag of a script as an optimization to
2361         avoid decoding it again when filtering the character data of the script, it is sufficient
2362         to cache whether the HTTP response contains the decoded start tag of a script. This
2363         avoids both decoding the start tag of a script and determining whether the HTTP response
2364         contains it again when filtering the character data of the script. Moreover, this removes
2365         the need to cache a string object.
2366
2367         * html/parser/XSSAuditor.cpp:
2368         (WebCore::XSSAuditor::filterCharacterToken):
2369         (WebCore::XSSAuditor::filterScriptToken):
2370         * html/parser/XSSAuditor.h:
2371
2372 2016-01-13  Commit Queue  <commit-queue@webkit.org>
2373
2374         Unreviewed, rolling out r194963.
2375         https://bugs.webkit.org/show_bug.cgi?id=153079
2376
2377         This change causes ASan tests to crash and exit early
2378         (Requested by ryanhaddad on #webkit).
2379
2380         Reverted changeset:
2381
2382         "Fragmentation-free allocator for timeless and/or coupled
2383         allocations."
2384         https://bugs.webkit.org/show_bug.cgi?id=152696
2385         http://trac.webkit.org/changeset/194963
2386
2387 2016-01-13  Daniel Bates  <dabates@apple.com>
2388
2389         [XSS Auditor] Do not include trailing comment characters in JavaScript snippets
2390         https://bugs.webkit.org/show_bug.cgi?id=152873
2391
2392         Reviewed by Brent Fulgham.
2393
2394         Merged from Blink (patch by Tom Sepez <tsepez@chromium.org>):
2395         <https://src.chromium.org/viewvc/blink?view=rev&revision=169967>
2396
2397         Test: http/tests/security/xssAuditor/script-tag-with-injected-comment.html
2398
2399         * html/parser/XSSAuditor.cpp:
2400         (WebCore::XSSAuditor::decodedSnippetForJavaScript):
2401
2402 2016-01-13  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2403
2404         WebRTC: Add support for RTCRtpSender.replaceTrack()
2405         https://bugs.webkit.org/show_bug.cgi?id=153063
2406
2407         Reviewed by Eric Carlson.
2408
2409         Add the API and infrastructure to support RTCRtpSender.replaceTrack(). The platform is
2410         reached through the RTCPeerConnection object that created the RTCRtpSender via a client
2411         interface.
2412
2413         Test: fast/mediastream/RTCRtpSender-replaceTrack.html
2414
2415         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2416         (WebCore::MediaEndpointPeerConnection::replaceTrack):
2417         * Modules/mediastream/MediaEndpointPeerConnection.h:
2418         * Modules/mediastream/PeerConnectionBackend.h:
2419         * Modules/mediastream/RTCPeerConnection.cpp:
2420         (WebCore::RTCPeerConnection::addTrack):
2421         (WebCore::RTCPeerConnection::removeTrack):
2422         (WebCore::RTCPeerConnection::replaceTrack):
2423         * Modules/mediastream/RTCPeerConnection.h:
2424         * Modules/mediastream/RTCRtpSender.cpp:
2425         (WebCore::RTCRtpSender::RTCRtpSender):
2426         (WebCore::RTCRtpSender::replaceTrack):
2427         * Modules/mediastream/RTCRtpSender.h:
2428         (WebCore::RTCRtpSenderClient::~RTCRtpSenderClient):
2429         (WebCore::RTCRtpSender::create):
2430         (WebCore::RTCRtpSender::trackId):
2431         (WebCore::RTCRtpSender::stop):
2432         * Modules/mediastream/RTCRtpSender.idl:
2433
2434 2016-01-13  Brady Eidson  <beidson@apple.com>
2435
2436         Modern IDB: A few cursor tests are flaky because JS wrappers are GC'ed.
2437         https://bugs.webkit.org/show_bug.cgi?id=153038
2438
2439         Reviewed by Alex Christensen.
2440
2441         No new tests (Couldn't write a test that was any more reliable than "flaky", so fixing the existing flaky tests will do).
2442
2443         And IDBCursor has an associated IDBRequest that is re-used each time the IDBCursor iterates.
2444         
2445         The normal ActiveDOMObject approach to prevent the IDBRequest's wrapper from being garbage collected was not good enough
2446         because, while the IDBRequest may not currently be waiting on any activity, as long as its associated IDBCursor is still
2447         reachable then the request might be reused in the future.
2448         
2449         Fortunately there's an IDL allowance for "one object keeping another alive during GC" and that's JSCustomMarkFunction
2450         combined with GenerateIsReachable.
2451         
2452         Applying those to IDBCursor and IDBRequest fix this handily.
2453         
2454         * CMakeLists.txt:
2455         * WebCore.xcodeproj/project.pbxproj:
2456
2457         * Modules/indexeddb/IDBCursor.h:
2458         (WebCore::IDBCursor::isModernCursor):
2459         * Modules/indexeddb/IDBCursor.idl:
2460         
2461         * Modules/indexeddb/IDBRequest.idl:
2462         
2463         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2464         (WebCore::IDBClient::IDBCursor::advance):
2465         (WebCore::IDBClient::IDBCursor::continueFunction):
2466         (WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
2467         (WebCore::IDBClient::IDBCursor::uncheckedIteratorCursor): Deleted. Fixed the typo of this name.
2468         * Modules/indexeddb/client/IDBCursorImpl.h:
2469         
2470         * bindings/js/JSIDBCursorCustom.cpp: Added.
2471         (WebCore::JSIDBCursor::visitAdditionalChildren):
2472
2473 2016-01-13  Zalan Bujtas  <zalan@apple.com>
2474
2475         Get text drawing working with display lists.
2476         https://bugs.webkit.org/show_bug.cgi?id=152957
2477
2478         Reviewed by Simon Fraser.
2479
2480         This patch enables text drawing for display lists.
2481
2482         * platform/graphics/FontCascade.cpp:
2483         (WebCore::FontCascade::drawGlyphBuffer):
2484         * platform/graphics/FontCascade.h:
2485         * platform/graphics/GraphicsContext.cpp:
2486         (WebCore::GraphicsContext::drawGlyphs):
2487         (WebCore::GraphicsContext::drawText): Deleted.
2488         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2489         (WebCore::FontCascade::drawGlyphs):
2490         * platform/graphics/displaylists/DisplayListItems.cpp:
2491         (WebCore::DisplayList::DrawGlyphs::apply):
2492
2493 2016-01-13  Zalan Bujtas  <zalan@apple.com>
2494
2495         Simple line layout: Add support for word-break property.
2496         https://bugs.webkit.org/show_bug.cgi?id=153054
2497
2498         Reviewed by Antti Koivisto.
2499
2500         This patch enables word-break property for simple line layout.
2501         (https://drafts.csswg.org/css-text-3/#propdef-word-break)
2502
2503         word-break: normal and keep-all -> existing, non-(force)breaking behaviour.
2504                     break-all -> breaks words when needed.
2505
2506         Covered by existing tests like fast/text/word-break.html
2507
2508         * rendering/SimpleLineLayout.cpp:
2509         (WebCore::SimpleLineLayout::createLineRuns):
2510         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
2511         (WebCore::SimpleLineLayout::printReason): Deleted.
2512         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2513         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2514         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextTextFragment):
2515         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2516         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
2517         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
2518         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isBreakable): Deleted.
2519         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split): Deleted.
2520
2521 2016-01-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2522
2523         Reference cycle between SVGPathElement and SVGPathSegWithContext leaks Document
2524         https://bugs.webkit.org/show_bug.cgi?id=151810
2525
2526         Reviewed by Darin Adler.
2527
2528         Break the reference cycle between SVGPathElement and SVGPathSegWithContext
2529         by changing the back-pointer to be a WeakPtr pointer instead of having it
2530         RefPtr. Make sure the SVGPathSegWithContext derived classes handle correctly
2531         the case when the SVGPathElement back-pointer is deleted.
2532
2533         Also change the SVGPathElement argument to the SVGPathSeg creation functions
2534         and constructors to be a const reference instead of having it as a pointer
2535         since SVGPathElement is the class factory for all these classes.
2536
2537         * svg/SVGPathElement.cpp:
2538         (WebCore::SVGPathElement::SVGPathElement):
2539         (WebCore::SVGPathElement::createSVGPathSegClosePath):
2540         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
2541         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
2542         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
2543         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
2544         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
2545         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
2546         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
2547         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
2548         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
2549         (WebCore::SVGPathElement::createSVGPathSegArcRel):
2550         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
2551         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
2552         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
2553         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
2554         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
2555         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
2556         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
2557         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
2558         (WebCore::SVGPathElement::isSupportedAttribute):
2559         * svg/SVGPathElement.h:
2560         * svg/SVGPathSegArc.h:
2561         (WebCore::SVGPathSegArc::SVGPathSegArc):
2562         * svg/SVGPathSegArcAbs.h:
2563         (WebCore::SVGPathSegArcAbs::create):
2564         (WebCore::SVGPathSegArcAbs::SVGPathSegArcAbs):
2565         * svg/SVGPathSegArcRel.h:
2566         (WebCore::SVGPathSegArcRel::create):
2567         (WebCore::SVGPathSegArcRel::SVGPathSegArcRel):
2568         * svg/SVGPathSegClosePath.h:
2569         (WebCore::SVGPathSegClosePath::create):
2570         (WebCore::SVGPathSegClosePath::SVGPathSegClosePath):
2571         * svg/SVGPathSegCurvetoCubic.h:
2572         (WebCore::SVGPathSegCurvetoCubic::SVGPathSegCurvetoCubic):
2573         * svg/SVGPathSegCurvetoCubicAbs.h:
2574         (WebCore::SVGPathSegCurvetoCubicAbs::create):
2575         (WebCore::SVGPathSegCurvetoCubicAbs::SVGPathSegCurvetoCubicAbs):
2576         * svg/SVGPathSegCurvetoCubicRel.h:
2577         (WebCore::SVGPathSegCurvetoCubicRel::create):
2578         (WebCore::SVGPathSegCurvetoCubicRel::SVGPathSegCurvetoCubicRel):
2579         * svg/SVGPathSegCurvetoCubicSmooth.h:
2580         (WebCore::SVGPathSegCurvetoCubicSmooth::SVGPathSegCurvetoCubicSmooth):
2581         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
2582         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
2583         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::SVGPathSegCurvetoCubicSmoothAbs):
2584         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
2585         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
2586         (WebCore::SVGPathSegCurvetoCubicSmoothRel::SVGPathSegCurvetoCubicSmoothRel):
2587         * svg/SVGPathSegCurvetoQuadratic.h:
2588         (WebCore::SVGPathSegCurvetoQuadratic::SVGPathSegCurvetoQuadratic):
2589         * svg/SVGPathSegCurvetoQuadraticAbs.h:
2590         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
2591         (WebCore::SVGPathSegCurvetoQuadraticAbs::SVGPathSegCurvetoQuadraticAbs):
2592         * svg/SVGPathSegCurvetoQuadraticRel.h:
2593         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
2594         (WebCore::SVGPathSegCurvetoQuadraticRel::SVGPathSegCurvetoQuadraticRel):
2595         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
2596         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
2597         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::SVGPathSegCurvetoQuadraticSmoothAbs):
2598         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
2599         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
2600         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::SVGPathSegCurvetoQuadraticSmoothRel):
2601         * svg/SVGPathSegLinetoAbs.h:
2602         (WebCore::SVGPathSegLinetoAbs::create):
2603         (WebCore::SVGPathSegLinetoAbs::SVGPathSegLinetoAbs):
2604         * svg/SVGPathSegLinetoHorizontal.h:
2605         (WebCore::SVGPathSegLinetoHorizontal::SVGPathSegLinetoHorizontal):
2606         * svg/SVGPathSegLinetoHorizontalAbs.h:
2607         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
2608         (WebCore::SVGPathSegLinetoHorizontalAbs::SVGPathSegLinetoHorizontalAbs):
2609         * svg/SVGPathSegLinetoHorizontalRel.h:
2610         (WebCore::SVGPathSegLinetoHorizontalRel::create):
2611         (WebCore::SVGPathSegLinetoHorizontalRel::SVGPathSegLinetoHorizontalRel):
2612         * svg/SVGPathSegLinetoRel.h:
2613         (WebCore::SVGPathSegLinetoRel::create):
2614         (WebCore::SVGPathSegLinetoRel::SVGPathSegLinetoRel):
2615         * svg/SVGPathSegLinetoVertical.h:
2616         (WebCore::SVGPathSegLinetoVertical::SVGPathSegLinetoVertical):
2617         * svg/SVGPathSegLinetoVerticalAbs.h:
2618         (WebCore::SVGPathSegLinetoVerticalAbs::create):
2619         (WebCore::SVGPathSegLinetoVerticalAbs::SVGPathSegLinetoVerticalAbs):
2620         * svg/SVGPathSegLinetoVerticalRel.h:
2621         (WebCore::SVGPathSegLinetoVerticalRel::create):
2622         (WebCore::SVGPathSegLinetoVerticalRel::SVGPathSegLinetoVerticalRel):
2623         * svg/SVGPathSegMovetoAbs.h:
2624         (WebCore::SVGPathSegMovetoAbs::create):
2625         (WebCore::SVGPathSegMovetoAbs::SVGPathSegMovetoAbs):
2626         * svg/SVGPathSegMovetoRel.h:
2627         (WebCore::SVGPathSegMovetoRel::create):
2628         (WebCore::SVGPathSegMovetoRel::SVGPathSegMovetoRel):
2629         * svg/SVGPathSegWithContext.h:
2630         (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
2631         (WebCore::SVGPathSegWithContext::animatedProperty):
2632         (WebCore::SVGPathSegWithContext::contextElement):
2633         (WebCore::SVGPathSegWithContext::setContextAndRole):
2634         (WebCore::SVGPathSegWithContext::commitChange):
2635         (WebCore::SVGPathSegSingleCoordinate::setY):
2636         (WebCore::SVGPathSegSingleCoordinate::SVGPathSegSingleCoordinate):
2637         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
2638         (WebCore::SVGPathSegListPropertyTearOff::clearContextAndRoles):
2639         (WebCore::SVGPathSegListPropertyTearOff::replaceItem):
2640         (WebCore::SVGPathSegListPropertyTearOff::removeItem):
2641
2642 2016-01-13  Andreas Kling  <akling@apple.com>
2643
2644         Use BumpArena for style sheet object tree.
2645         <https://webkit.org/b/152696>
2646
2647         Reviewed by Antti Koivisto.
2648
2649         Give each StyleSheetContents its own BumpArena, and plumb it down through CSSParser
2650         to allocate StyleRule, StyleProperties and CSSSelectorList's selector arrays there.
2651
2652         This basically means that most objects that make up a given style sheet will end up
2653         in one (or a few) contiguous region(s) of memory, instead of being scattered all
2654         over the malloc heap.
2655
2656         In the common case (no CSSOM manipulation), the lifetimes of these objects are very
2657         predictable: everything tends to die when the StyleSheetContents dies.
2658         This dramatically improves space-efficiency in those cases, and allows us to return
2659         contiguous chunks of memory to the system once a style sheet is no longer needed.
2660
2661         One-off CSS parses that don't work within a StyleSheetContents context will have
2662         their StyleRules & co allocated out of the global BumpArena.
2663
2664         Bonus: give SelectorQueryCache a dedicated BumpArena as well, since it has very
2665         predictable lifetime.
2666
2667         * css/CSSGrammar.y.in:
2668         * css/CSSKeyframesRule.h:
2669         (WebCore::StyleRuleKeyframes::create):
2670         * css/CSSParser.cpp:
2671         (WebCore::CSSParser::createStyleProperties):
2672         (WebCore::CSSParser::createMediaRule):
2673         (WebCore::CSSParser::createSupportsRule):
2674         (WebCore::CSSParser::createKeyframesRule):
2675         (WebCore::CSSParser::setArena):
2676         (WebCore::CSSParser::arena):
2677         (WebCore::CSSParser::createStyleRule):
2678         (WebCore::CSSParser::createFontFaceRule):
2679         (WebCore::CSSParser::createPageRule):
2680         (WebCore::CSSParser::createRegionRule):
2681         (WebCore::CSSParser::createViewportRule):
2682         * css/CSSParser.h:
2683         * css/CSSParserValues.cpp:
2684         (WebCore::CSSParserSelector::parsePseudoElementCueFunctionSelector):
2685         (WebCore::CSSParserSelector::adoptSelectorVector):
2686         * css/CSSParserValues.h:
2687         * css/CSSSelectorList.cpp:
2688         (WebCore::CSSSelectorList::CSSSelectorList):
2689         (WebCore::CSSSelectorList::adoptSelectorVector):
2690         (WebCore::CSSSelectorList::deleteSelectors):
2691         * css/CSSSelectorList.h:
2692         * css/StyleProperties.cpp:
2693         (WebCore::ImmutableStyleProperties::create):
2694         (WebCore::StyleProperties::immutableCopyIfNeeded):
2695         * css/StyleProperties.h:
2696         * css/StyleRule.cpp:
2697         (WebCore::StyleRule::create):
2698         (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
2699         (WebCore::StyleRuleRegion::StyleRuleRegion):
2700         * css/StyleRule.h:
2701         (WebCore::StyleRule::create):
2702         (WebCore::StyleRule::parserAdoptSelectorVector):
2703         (WebCore::StyleRuleFontFace::create):
2704         (WebCore::StyleRulePage::create):
2705         (WebCore::StyleRulePage::parserAdoptSelectorVector):
2706         (WebCore::StyleRuleMedia::create):
2707         (WebCore::StyleRuleSupports::create):
2708         (WebCore::StyleRuleRegion::create):
2709         (WebCore::StyleRuleViewport::create):
2710         * css/StyleSheetContents.cpp:
2711         (WebCore::StyleSheetContents::StyleSheetContents):
2712         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
2713         (WebCore::StyleSheetContents::parseStringAtPosition):
2714         * css/StyleSheetContents.h:
2715         * dom/SelectorQuery.cpp:
2716         (WebCore::SelectorQueryCache::SelectorQueryCache):
2717         (WebCore::SelectorQueryCache::add):
2718         * dom/SelectorQuery.h:
2719         * svg/SVGFontFaceElement.cpp:
2720         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
2721
2722 2016-01-13  YongGeol Jung  <yg48.jung@samsung.com>
2723
2724         [TexMap] BitmapTextureGL is not released while scene is updated continuously.
2725         https://bugs.webkit.org/show_bug.cgi?id=152524
2726
2727         Reviewed by Žan Doberšek.
2728
2729         This patch fixes two issues.
2730         First, m_releaseUnusedTexturesTimer is not fired if scene is updated within 0.5s continuously.
2731         In this case, BitmapTexturePool will not remove texture even if texture is not used for long time.
2732         Second, m_releaseUnusedTexturesTimer is triggered by acquireTexture function only.
2733         So, if next scene does not need to use BitmapTexture, remained textures in pool will not removed.
2734
2735         No new tests needed.
2736
2737         * platform/graphics/texmap/BitmapTexturePool.cpp:
2738         (WebCore::BitmapTexturePool::scheduleReleaseUnusedTextures):
2739         (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
2740
2741 2016-01-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2742
2743         [Streams API] Refactor builtin internals to prepare support for streams API in worker
2744         https://bugs.webkit.org/show_bug.cgi?id=152535
2745
2746         Reviewed by Darin Adler.
2747
2748         Moving the code that links internal functions to the GlobalObject in WebCoreJSBuiltinInternals.cpp.
2749         This file should be generated by the builtin generator once refactoring is done.
2750         This code is located in JSBuiltinInternalFunctions::initialize.
2751
2752         Adding private controller and reader constructors to the JS DOM constructor map so that they do not get garbage collected.
2753
2754         No change in behavior, except that private builtins are usable in workers (but not actually used).
2755
2756         * CMakeLists.txt:
2757         * WebCore.vcxproj/WebCore.vcxproj:
2758         * WebCore.xcodeproj/project.pbxproj:
2759         * bindings/js/JSDOMGlobalObject.cpp:
2760         (WebCore::JSDOMGlobalObject::JSDOMGlobalObject):
2761         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2762         (WebCore::JSDOMGlobalObject::finishCreation):
2763         (WebCore::JSDOMGlobalObject::visitChildren):
2764         * bindings/js/JSDOMGlobalObject.h:
2765         * bindings/js/JSDOMWindowBase.cpp:
2766         (WebCore::JSDOMWindowBase::finishCreation):
2767         (WebCore::JSDOMWindowBase::visitChildren):
2768         * bindings/js/JSDOMWindowBase.h:
2769         * bindings/js/WebCoreJSBuiltinInternals.cpp: Added.
2770         (WebCore::JSBuiltinInternalFunctions::JSBuiltinInternalFunctions):
2771         (WebCore::JSBuiltinInternalFunctions::visit):
2772         (WebCore::JSBuiltinInternalFunctions::initialize):
2773         * bindings/js/WebCoreJSBuiltinInternals.h:
2774
2775 2016-01-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2776
2777         [EFL] Fix wrong return value of paintThemePart in RenderThemeEfl
2778         https://bugs.webkit.org/show_bug.cgi?id=153058
2779
2780         Reviewed by Carlos Garcia Campos.
2781
2782         To return false in paint functions in RenderThemeEfl means that it is supported though,
2783         paintThemePart has returned false even when failing to get image cache of theme.
2784
2785         * rendering/RenderThemeEfl.cpp:
2786         (WebCore::RenderThemeEfl::paintThemePart):
2787
2788 2016-01-12  Andy Estes  <aestes@apple.com>
2789
2790         [Content Filtering] forEachContentFilterUntilBlocked should accept a lambda by rvalue reference
2791         https://bugs.webkit.org/show_bug.cgi?id=153057
2792
2793         Reviewed by Dan Bernstein.
2794
2795         No new tests. No change in behavior.
2796
2797         Instead of having ContentFilter::forEachContentFilterUntilBlocked() take a std::function, just have it take an
2798         rvalue reference to the lambda its passed.
2799
2800         * loader/ContentFilter.cpp:
2801         (WebCore::ContentFilter::forEachContentFilterUntilBlocked):
2802         * loader/ContentFilter.h:
2803
2804 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2805
2806         [GTK] Fix return value of some paint methods in RenderThemeGtk
2807         https://bugs.webkit.org/show_bug.cgi?id=153015
2808
2809         Reviewed by Michael Catanzaro.
2810
2811         The bool value returned by paint methods in RenderTheme means
2812         whether the appearance is supported or not, so we should return
2813         true when not supported (so we didn't paint anything) and false
2814         when supported (so we actually painted the theme part).
2815
2816         * rendering/RenderThemeGtk.cpp:
2817         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
2818         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
2819         (WebCore::RenderThemeGtk::paintMediaButton):
2820         (WebCore::RenderThemeGtk::paintMediaMuteButton):
2821         (WebCore::RenderThemeGtk::paintMediaPlayButton):
2822         (WebCore::RenderThemeGtk::paintMediaSliderTrack):
2823         (WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted.
2824         * rendering/RenderThemeGtk.h:
2825
2826 2016-01-12  Andy Estes  <aestes@apple.com>
2827
2828         [Content Filtering] De-virtualize PlatformContentFilter::{needsMoreData, didBlockData}()
2829         https://bugs.webkit.org/show_bug.cgi?id=153052
2830
2831         Reviewed by Andreas Kling.
2832
2833         No new tests. No change in behavior.
2834
2835         Instead of having virtual functions that each platform content filter implement in terms of their own state,
2836         store the state in the base class so that these functions can be non-virtual. Teach each subclass to update the
2837         base class state appropriately.
2838
2839         * loader/ContentFilter.h:
2840         * platform/PlatformContentFilter.h:
2841         (WebCore::PlatformContentFilter::needsMoreData):
2842         (WebCore::PlatformContentFilter::didBlockData):
2843         * platform/cocoa/NetworkExtensionContentFilter.h:
2844         * platform/cocoa/NetworkExtensionContentFilter.mm:
2845         (WebCore::NetworkExtensionContentFilter::willSendRequest):
2846         (WebCore::NetworkExtensionContentFilter::responseReceived):
2847         (WebCore::NetworkExtensionContentFilter::handleDecision):
2848         (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Deleted.
2849         (WebCore::NetworkExtensionContentFilter::needsMoreData): Deleted.
2850         (WebCore::NetworkExtensionContentFilter::didBlockData): Deleted.
2851         * platform/cocoa/ParentalControlsContentFilter.h:
2852         * platform/cocoa/ParentalControlsContentFilter.mm:
2853         (WebCore::ParentalControlsContentFilter::responseReceived):
2854         (WebCore::ParentalControlsContentFilter::updateFilterState):
2855         (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Deleted.
2856         (WebCore::ParentalControlsContentFilter::needsMoreData): Deleted.
2857         (WebCore::ParentalControlsContentFilter::didBlockData): Deleted.
2858         * platform/spi/cocoa/NEFilterSourceSPI.h:
2859         * testing/MockContentFilter.cpp:
2860         (WebCore::MockContentFilter::willSendRequest):
2861         (WebCore::MockContentFilter::maybeDetermineStatus):
2862         (WebCore::MockContentFilter::needsMoreData): Deleted.
2863         (WebCore::MockContentFilter::didBlockData): Deleted.
2864         * testing/MockContentFilter.h:
2865
2866 2016-01-12  Andy Estes  <aestes@apple.com>
2867
2868         Address missed review feedback after r194950.
2869
2870         * platform/cocoa/NetworkExtensionContentFilter.mm:
2871         (WebCore::NetworkExtensionContentFilter::initialize): Renamed the NetworkExtension dispatch queue.
2872
2873 2016-01-08  Andy Estes  <aestes@apple.com>
2874
2875         [Content Filtering] Lazily load platform frameworks
2876         https://bugs.webkit.org/show_bug.cgi?id=152881
2877         rdar://problem/23270886
2878
2879         Reviewed by Brady Eidson.
2880
2881         On Cocoa platforms, ContentFilter soft-links two frameworks that perform the underlying filtering operations.
2882         There is a one-time cost associated with the soft-linking, and the current design requires all clients to pay
2883         this cost whether or not they ever load a resource that is subject to filtering.
2884
2885         Addressed this by deferring the loading of frameworks until it is known that a resource will require filtering.
2886         It is rather simple to defer the soft-linking at the PlatformContentFilter level, but doing this alone would
2887         mean that every CachedRawResourceClient callback would be routed through ContentFilter, even in the very common
2888         case where both platform content filters are disabled. This is because checking if a platform content filter is
2889         enabled involves loading its framework, so creating a ContentFilter (which DocumentLoader will add as the
2890         CachedRawResource client in place of itself) cannot be avoided by checking that all its platform content filters
2891         are disabled.
2892
2893         Resolved this by inverting the relationship between ContentFilter and DocumentLoader. Instead of ContentFilter
2894         being the CachedRawResource's client and forwarding callbacks to DocumentLoader when one or more platform
2895         filters are enabled, DocumentLoader is now always the client and it forwards callbacks to ContentFilter.
2896         ContentFilter then returns a boolean value indicating whether or not DocumentLoader should proceed with each
2897         callback.
2898
2899         New API test: ContentFiltering.LazilyLoadPlatformFrameworks
2900
2901         * loader/ContentFilter.cpp:
2902         (WebCore::ContentFilter::create): Renamed from createIfEnabled(). Since the enabled check causes frameworks to
2903         be loaded, the check is skipped here and all types are always created.
2904         (WebCore::ContentFilter::continueAfterWillSendRequest): Renamed from willSendRequest(). Renamed requestCopy to
2905         originalRequest, and only created it for logging purposes. Since the copy was only used for logging purposes,
2906         request is now modified directly. Returned false if request is null.
2907         (WebCore::ContentFilter::continueAfterResponseReceived): Renamed from responseReceived(). Stopped asserting that
2908         resource is non-null, since it will be null in the case of substitute data loads. Stopped asserting that m_state
2909         is not Initialized, since that state was removed and the function can now be called in all states. Only logged
2910         if m_state is Filtering. Returned false if m_state is Blocked.
2911         (WebCore::ContentFilter::continueAfterDataReceived): Renamed from dataReceived(). Stopped asserting that
2912         resource is non-null and that m_state is Initialized, and moved the logging, for the same reasons as above.
2913         Returned false if m_state is Filtering or Blocked.
2914         (WebCore::ContentFilter::continueAfterNotifyFinished): Renamed from notifyFinished(). Stopped asserting that
2915         resource is non-null and that m_state is not Initialized, and moved the logging, for the same reasons as above.
2916         If m_state is not Blocked at this point, set m_state to Allowed in order for deliverResourceData() to not get
2917         caught in continueAfterDataReceived(). Returned false if m_state is Blocked or Stopped after delivering data.
2918         (WebCore::ContentFilter::createIfEnabled): Renamed to create().
2919         (WebCore::ContentFilter::~ContentFilter): Stopped removing ourself as m_mainResource's client.
2920         (WebCore::ContentFilter::willSendRequest): Renamed to continueAfterWillSendRequest().
2921         (WebCore::ContentFilter::startFilteringMainResource): Stopped adding ourself as m_mainResource's client. Stopped
2922         asserting that m_state is not Initialized and instead returned early if m_state is not Stopped.
2923         (WebCore::ContentFilter::stopFilteringMainResource): Stopped removing ourself as m_mainResource's client.
2924         (WebCore::ContentFilter::responseReceived): Renamed to continueAfterResponseReceived().
2925         (WebCore::ContentFilter::dataReceived): Renamed to continueAfterDataReceived().
2926         (WebCore::ContentFilter::redirectReceived): Removed. DocumentLoader now calls continueAfterWillSendRequest()
2927         directly on redirects.
2928         (WebCore::ContentFilter::notifyFinished): Renamed to continueAfterNotifyFinished().
2929         (WebCore::ContentFilter::didDecide): Instead of calling DocumentLoader::contentFilterDidDecide(), called
2930         DocumentLoader::contentFilterDidBlock() when m_state is Blocked.
2931         (WebCore::ContentFilter::deliverResourceData): Asserted that m_state is Allowed.
2932         * loader/ContentFilter.h: Stopped inheriting from CachedRawResourceClient. Redeclared the
2933         CachedRawResourceClient virtual functions as the continue* functions mentioned above. Made State enum private
2934         and removed Initialized. Initialized m_state to Stopped and removed its getter.
2935         (WebCore::ContentFilter::type): Returned a ContentFilter::Type that does not include an enabled function.
2936         * loader/DocumentLoader.cpp:
2937         (WebCore::DocumentLoader::notifyFinished): Returned early if ContentFilter::continueAfterNotifyFinished()
2938         returned false.
2939         (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::continueAfterWillSendRequest() even for
2940         redirects, since ContentFilter is no longer a CachedRawResourceClient and so will no longer receive
2941         redirectReceived(). Returned early if continueAfterWillSendRequest() returns false.
2942         (WebCore::DocumentLoader::responseReceived): Returned early if ContentFilter::continueAfterResponseReceived()
2943         returned false.
2944         (WebCore::DocumentLoader::dataReceived): Ditto for ContentFilter::continueAfterDataReceived().
2945         (WebCore::DocumentLoader::startLoadingMainResource): Called ContentFilter::create(), not createIfEnabled().
2946         (WebCore::DocumentLoader::becomeMainResourceClient): Called ContentFilter::startFilteringMainResource() even if
2947         m_state is not Initialized. Added ourself as a client of m_mainResource unconditionally.
2948         (WebCore::DocumentLoader::contentFilterDidBlock): Renamed from contentFilterDidDecide. Removed assertions and
2949         the early return when m_state is Allowed, since the state is guaranteed to be Blocked.
2950         (WebCore::DocumentLoader::contentFilterDidDecide): Renamed to contentFilterDidBlock.
2951         * platform/cocoa/NetworkExtensionContentFilter.h: Moved definition of HAVE_NETWORK_EXTENSION to Platform.h so
2952         that this file doesn't need to become a Private header. Made enabled() private, and declared initialize().
2953         * platform/cocoa/NetworkExtensionContentFilter.mm:
2954         (WebCore::NetworkExtensionContentFilter::initialize): Added a function to lazily initialize the object.
2955         (WebCore::NetworkExtensionContentFilter::willSendRequest): For the modern NEFilterSource, checked if it is
2956         enabled only after checking if the request is HTTP(S). If both checks pass, then called initialize().
2957         (WebCore::NetworkExtensionContentFilter::responseReceived): Ditto for the legacy NEFilterSource.
2958         * platform/cocoa/ParentalControlsContentFilter.h: Made enabled() private.
2959         * platform/cocoa/ParentalControlsContentFilter.mm:
2960         (WebCore::ParentalControlsContentFilter::responseReceived): Checked if WebFilterEvaluator is enabled only after
2961         checking if the response is from a protocol that can be handled.
2962         * testing/MockContentFilter.cpp:
2963         (WebCore::MockContentFilter::willSendRequest): Immediately set m_status to Status::Allowed if !enabled().
2964         * testing/MockContentFilter.h: Made enabled() private.
2965
2966 2016-01-12  Commit Queue  <commit-queue@webkit.org>
2967
2968         Unreviewed, rolling out r194926 and r194928.
2969         https://bugs.webkit.org/show_bug.cgi?id=153048
2970
2971         This change is causing LayoutTest crashes (Requested by
2972         ryanhaddad on #webkit).
2973
2974         Reverted changesets:
2975
2976         "Avoid downloading the wrong image for <picture> elements."
2977         https://bugs.webkit.org/show_bug.cgi?id=153027
2978         http://trac.webkit.org/changeset/194926
2979
2980         "Avoid downloading the wrong image for <picture> elements."
2981         https://bugs.webkit.org/show_bug.cgi?id=153027
2982         http://trac.webkit.org/changeset/194928
2983
2984 2016-01-11  Dean Jackson  <dino@apple.com>
2985
2986         [iOS] Antialiasing doesn't work in WebGL
2987         https://bugs.webkit.org/show_bug.cgi?id=153000
2988         <rdar://problem/9165531>
2989
2990         Reviewed by Alex Christensen.
2991
2992         WebGL has supported platform antialiasing since
2993         the beginning, but we never hooked it up for iOS
2994         because it used a slightly different extension.
2995
2996         Test: fast/canvas/webgl/antialiasing-enabled.html
2997
2998         * platform/graphics/mac/GraphicsContext3DMac.mm:
2999         (WebCore::GraphicsContext3D::endPaint): Resolve the multisampling
3000         buffer once we're done painting.
3001         (WebCore::GraphicsContext3D::~GraphicsContext3D): We never created
3002         the m_compositorTexture RenderBuffer on iOS, so no point deleting
3003         it.
3004
3005         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
3006         (WebCore::Extensions3DOpenGL::supportsExtension): The iOS extension
3007         has a slightly different name.
3008         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3009         (WebCore::GraphicsContext3D::reshapeFBOs): Make sure to create the
3010         multisample buffer with the correct format.
3011         (WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary): We
3012         need to remember what our bound frame buffer is when we
3013         enter this call, and restore it afterwards. In the middle we can
3014         discard our multisample read buffer once we have resolved it
3015         into the normal framebuffer.
3016
3017 2016-01-12  Daniel Bates  <dabates@apple.com>
3018
3019         XSS Auditor should navigate to empty substitute data on full page block
3020         https://bugs.webkit.org/show_bug.cgi?id=152868
3021         <rdar://problem/18658448>
3022
3023         Reviewed by David Kilzer and Andy Estes.
3024
3025         Derived from Blink patch (by Tom Sepez <tsepez@chromium.org>):
3026         <https://src.chromium.org/viewvc/blink?view=rev&revision=179240>
3027
3028         Test: http/tests/security/xssAuditor/block-does-not-leak-that-page-was-blocked-using-empty-data-url.html
3029
3030         * html/parser/XSSAuditorDelegate.cpp:
3031         (WebCore::XSSAuditorDelegate::didBlockScript): Modified to call NavigationScheduler::schedulePageBlock().
3032         * loader/NavigationScheduler.cpp:
3033         (WebCore::ScheduledPageBlock::ScheduledPageBlock): Added.
3034         (WebCore::NavigationScheduler::schedulePageBlock): Navigate to empty substitute data with
3035         the same URL as the originating document.
3036         * loader/NavigationScheduler.h:
3037
3038 2016-01-12  Dave Hyatt  <hyatt@apple.com>
3039
3040         Avoid downloading the wrong image for <picture> elements.
3041         https://bugs.webkit.org/show_bug.cgi?id=153027
3042
3043         Reviewed by Dean Jackson.
3044
3045         I was unable to write a reliable test for this feature (I welcome suggestions regarding
3046         how this could be tested).
3047
3048         * html/HTMLImageElement.cpp:
3049         (WebCore::HTMLImageElement::HTMLImageElement):
3050         (WebCore::HTMLImageElement::~HTMLImageElement):
3051         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3052         (WebCore::HTMLImageElement::insertedInto):
3053         (WebCore::HTMLImageElement::removedFrom):
3054         (WebCore::HTMLImageElement::pictureNode):
3055         (WebCore::HTMLImageElement::setPictureNode):
3056         * html/HTMLImageElement.h:
3057         * html/parser/HTMLConstructionSite.cpp:
3058         (WebCore::HTMLConstructionSite::createHTMLElement):
3059
3060         Images that are built underneath a <picture> element are now connected
3061         to that picture element via a setPictureNode call from the parser. This
3062         ensures that the correct <source> elements are examined before checking the image.
3063
3064         This connection between images and their picture owners is handled using a static
3065         HashMap in HTMLImageElement. This connection is made both from the parser and from
3066         DOM insertions, and the map is queried now instead of looking directly at the
3067         image's parentNode().
3068
3069         Also note the change to pass the document element's computed style in for media
3070         query evaluation. Just as with the preload scanner, the image's style can't be
3071         used as it has not been determined yet.
3072
3073 2016-01-12  Myles C. Maxfield  <mmaxfield@apple.com>
3074
3075         Cleanup in font loading code
3076         https://bugs.webkit.org/show_bug.cgi?id=153023
3077
3078         Reviewed by Zalan Bujtas.
3079
3080         See detailed notes below.
3081
3082         No new tests because there is no behavior change.
3083
3084         * css/CSSFontFace.cpp:
3085         (WebCore::CSSFontFace::isLoaded): Deleted. Never called.
3086         * css/CSSFontFace.h: Ditto.
3087         * css/CSSFontFaceSource.cpp:
3088         (WebCore::CSSFontFaceSource::font): No need to use a helper
3089         isLoaded() function.
3090         (WebCore::CSSFontFaceSource::isLoaded): Deleted. Unnecessary.
3091         * css/CSSFontFaceSource.h:
3092         * css/CSSFontFaceSrcValue.cpp:
3093         (WebCore::CSSFontFaceSrcValue::cachedFont): Un-indent code.
3094         * css/CSSFontSelector.cpp:
3095         (WebCore::registerLocalFontFacesForFamily): constructFamilyFontFaces()
3096         always returns an empty Vector. Therefore, the function of this function
3097         is to perform the ancillary processing related to the case where the Faces
3098         don't already exist. Renames the function and removes the empty vector
3099         return.
3100         (WebCore::CSSFontSelector::addFontFaceRule): Update for
3101         registerLocalFontFacesForFamily().
3102         (WebCore::FontFaceComparator::FontFaceComparator): Instead of using a static,
3103         construct a wrapper class around the comparator.
3104         (WebCore::FontFaceComparator::operator()): Ditto.
3105         (WebCore::CSSFontSelector::getFontFace): Un-indent code and update to use
3106         FontFaceComparator.
3107         (WebCore::CSSFontSelector::fallbackFontAt): Migrate off PassRefPtr.
3108         (WebCore::constructFamilyFontFaces): Deleted.
3109         (WebCore::compareFontFaces): Deleted.
3110         (WebCore::CSSFontSelector::resolvesFamilyFor): Deleted. Never called.
3111         * css/CSSFontSelector.h:
3112         * css/CSSSegmentedFontFace.cpp:
3113         (WebCore::CSSSegmentedFontFace::isValid): Deleted.
3114         (WebCore::CSSSegmentedFontFace::fontRanges): Cache negative validity results.
3115         * css/CSSSegmentedFontFace.h:
3116         * platform/graphics/FontCascade.h:
3117         (WebCore::FontCascade::fontSelector): Use nullptr.
3118         * platform/graphics/FontSelector.h:
3119
3120 2016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
3121
3122         Add a build flag for custom element
3123         https://bugs.webkit.org/show_bug.cgi?id=153005
3124
3125         Reviewed by Alex Christensen.
3126
3127         Added a build flag for enabling custom elements.
3128
3129         * Configurations/FeatureDefines.xcconfig:
3130
3131 2016-01-12  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3132
3133         WebRTC: Update RTCPeerConnection.add/removeTrack() and add test
3134         https://bugs.webkit.org/show_bug.cgi?id=153010
3135
3136         Reviewed by Eric Carlson.
3137
3138         RTCPeerConnection.add/removeTrack() are not fully spec compliant yet, since that would
3139         require support for RTCRtpTransceiver which is a new work-in-progress feature. Use
3140         Vector, instead of map, for senders and receivers since nothing is removed from these
3141         sets anymore.
3142
3143         Test: fast/mediastream/RTCPeerConnection-add-removeTrack.html
3144
3145         * Modules/mediastream/RTCPeerConnection.cpp:
3146         (WebCore::RTCPeerConnection::addTrack):
3147         (WebCore::RTCPeerConnection::removeTrack):
3148         (WebCore::RTCPeerConnection::queuedCreateOffer): Deleted.
3149         * Modules/mediastream/RTCPeerConnection.h:
3150         * Modules/mediastream/RTCRtpSender.cpp:
3151         (WebCore::RTCRtpSender::RTCRtpSender):
3152         * Modules/mediastream/RTCRtpSender.h:
3153         (WebCore::RTCRtpSender::create):
3154         (WebCore::RTCRtpSender::mediaStreamIds):
3155
3156 2016-01-12  Brady Eidson  <beidson@apple.com>
3157
3158         Modern IDB: Check in empty SQLite backing store implementation.
3159         https://bugs.webkit.org/show_bug.cgi?id=153022
3160
3161         Reviewed by Alex Christensen.
3162
3163         No new tests (No change in behavior).
3164
3165         Just to get the implementation files in the tree, this backing store currently does nothing
3166         other than return errors for every operation.
3167
3168         * CMakeLists.txt:
3169         * WebCore.xcodeproj/project.pbxproj:
3170
3171         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added.
3172         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
3173         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
3174         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
3175         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
3176         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
3177         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
3178         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
3179         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
3180         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3181         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3182         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
3183         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
3184         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
3185         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3186         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3187         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
3188         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
3189         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
3190         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
3191         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
3192         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
3193         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
3194         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
3195         * Modules/indexeddb/server/SQLiteIDBBackingStore.h: Added.
3196
3197 2016-01-12  Brady Eidson  <beidson@apple.com>
3198
3199         Modern IDB: storage/indexeddb/dont-wedge.html is flaky.
3200         https://bugs.webkit.org/show_bug.cgi?id=152892
3201
3202         Reviewed by Alex Christensen.
3203
3204         No new tests (Reenabled existing test).
3205
3206         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3207         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
3208         * Modules/indexeddb/client/IDBConnectionToServer.h:
3209         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3210
3211         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3212         (WebCore::IDBClient::IDBOpenDBRequest::requestCompleted): If the database was opened
3213           or an upgrade transaction was started, but the script execution context is already
3214           stopped, immediately message back to the server so it doesn't wedge.
3215
3216         * Modules/indexeddb/server/IDBServer.cpp:
3217         (WebCore::IDBServer::IDBServer::abortOpenAndUpgradeNeeded):
3218         * Modules/indexeddb/server/IDBServer.h:
3219
3220         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3221         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abortWithoutCallback):
3222         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
3223
3224         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3225         (WebCore::InProcessIDBServer::abortOpenAndUpgradeNeeded):
3226         * Modules/indexeddb/shared/InProcessIDBServer.h:
3227
3228 2016-01-12  Commit Queue  <commit-queue@webkit.org>
3229
3230         Unreviewed, rolling out r194826.
3231         https://bugs.webkit.org/show_bug.cgi?id=153020
3232
3233         Appears to have regressed PLT (Requested by kling on #webkit).
3234
3235         Reverted changeset:
3236
3237         "Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
3238         cont'd"
3239         https://bugs.webkit.org/show_bug.cgi?id=152902
3240         http://trac.webkit.org/changeset/194826
3241
3242 2016-01-12  Antti Koivisto  <antti@apple.com>
3243
3244         Don't reuse memory cache entries with different charset
3245         https://bugs.webkit.org/show_bug.cgi?id=110031
3246         rdar://problem/13666418
3247
3248         Reviewed by Andreas Kling.
3249
3250         Test: fast/loader/cache-encoding.html
3251
3252         * loader/cache/CachedResourceLoader.cpp:
3253         (WebCore::CachedResourceLoader::requestResource):
3254         (WebCore::logResourceRevalidationDecision):
3255         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
3256
3257             Pass full CachedResourceRequest to the function.
3258             If charset differs don't reuse the cache entry.
3259
3260         * loader/cache/CachedResourceLoader.h:
3261
3262 2016-01-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3263
3264         Use a pointer instead of PassRefPtr in AbstractView argument of UIEvent class
3265         https://bugs.webkit.org/show_bug.cgi?id=152829
3266
3267         Reviewed by Darin Adler.
3268
3269         As a step to reduce uses of PassRefPtr, UIEvent class doesn't need to use PassRefPtr for AbstractView argument.
3270         Nobody hands us ownership when making one of these objects.
3271
3272         * dom/FocusEvent.cpp:
3273         (WebCore::FocusEvent::FocusEvent):
3274         * dom/FocusEvent.h:
3275         * dom/KeyboardEvent.cpp:
3276         (WebCore::KeyboardEvent::KeyboardEvent):
3277         * dom/MouseEvent.cpp:
3278         (WebCore::MouseEvent::create):
3279         (WebCore::MouseEvent::MouseEvent):
3280         (WebCore::MouseEvent::initMouseEvent):
3281         (WebCore::SimulatedMouseEvent::create):
3282         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
3283         * dom/MouseEvent.h:
3284         * dom/MouseRelatedEvent.cpp:
3285         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
3286         * dom/MouseRelatedEvent.h:
3287         * dom/TextEvent.cpp:
3288         (WebCore::TextEvent::create):
3289         (WebCore::TextEvent::createForPlainTextPaste):
3290         (WebCore::TextEvent::createForFragmentPaste):
3291         (WebCore::TextEvent::createForDrop):
3292         (WebCore::TextEvent::createForDictation):
3293         (WebCore::TextEvent::TextEvent):
3294         (WebCore::TextEvent::initTextEvent):
3295         * dom/TextEvent.h:
3296         * dom/TouchEvent.cpp:
3297         (WebCore::TouchEvent::TouchEvent):
3298         (WebCore::TouchEvent::initTouchEvent):
3299         * dom/TouchEvent.h:
3300         * dom/UIEvent.cpp:
3301         (WebCore::UIEvent::UIEvent):
3302         (WebCore::UIEvent::initUIEvent):
3303         * dom/UIEvent.h:
3304         (WebCore::UIEvent::create):
3305         (WebCore::UIEvent::view):
3306         * dom/UIEventWithKeyState.h:
3307         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
3308
3309 2016-01-12  Csaba Osztrogonác  <ossy@webkit.org>
3310
3311         Fix unused-private-field warnings in DisplayListItems.h
3312         https://bugs.webkit.org/show_bug.cgi?id=153012
3313
3314         Reviewed by Michael Catanzaro.
3315
3316         * platform/graphics/displaylists/DisplayListItems.cpp:
3317         (WebCore::DisplayList::DrawNativeImage::DrawNativeImage):
3318         * platform/graphics/displaylists/DisplayListItems.h:
3319
3320 2016-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3321
3322         Unreviewed. Fix isRecording condition logic in GraphicsContext::roundToDevicePixels after r194816.
3323
3324         This looks like a typo introduced in r194816, we want to return early logging
3325         a message when isRecording() returns true.
3326
3327         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3328         (WebCore::GraphicsContext::roundToDevicePixels):
3329         * platform/graphics/cg/GraphicsContextCG.cpp:
3330         (WebCore::GraphicsContext::roundToDevicePixels):
3331
3332 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3333
3334         Inconsistencies in main resource load delegates when loading from history
3335         https://bugs.webkit.org/show_bug.cgi?id=150927
3336
3337         Reviewed by Michael Catanzaro.
3338
3339         When restoring a page from the page cache, even though there
3340         isn't an actual load of resources, we are still emitting the load
3341         delegates to let the API layer know there are contents being
3342         loaded in the web view. This makes the page cache restoring
3343         transparent for the API layer. However, when restoring a page from
3344         the cache, all the delegates are emitted after the load is
3345         committed. This is not consistent with real loads, where we first
3346         load the main resource and once we get a response we commit the
3347         load. This inconsistency is problematic if the API layer expects
3348         to always have a main resource with a response when the load is
3349         committed. This is the case of the GTK+ port, for example. So,
3350         this patch ensures that when a page is restored from the page
3351         cache, the main resource load delegates that are emitted until a
3352         response is received in normal loads, are emitted before the load
3353         is committed.
3354
3355         Test: http/tests/loading/main-resource-delegates-on-back-navigation.html
3356
3357         * loader/FrameLoader.cpp:
3358         (WebCore::FrameLoader::commitProvisionalLoad): When loading from
3359         the page cache, send delegate messages up to didReceiveResponse
3360         for the main resource before the load is committed, and the
3361         remaining messages afterwards.
3362
3363 2016-01-09  Andy Estes  <aestes@apple.com>
3364
3365         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
3366         https://bugs.webkit.org/show_bug.cgi?id=152950
3367         rdar://problem/24066652
3368
3369         Reviewed by Tim Horton.
3370
3371         Added a list of schemes to SchemeRegistry whose resources should always be revalidated. Taught CachedResource to
3372         return a freshness lifetime of 0 for these resources, unless the scheme is one that should be cached indefinitely.
3373
3374         New API test: WebKit2.AlwaysRevalidatedURLSchemes
3375
3376         * loader/cache/CachedResource.cpp:
3377         (WebCore::shouldCacheSchemeIndefinitely): Moved from SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely().
3378         (WebCore::CachedResource::freshnessLifetime): For a scheme that should not be cached indefinitely, return 0 if
3379         that scheme should always be revalidated according to SchemeRegistry.
3380         * platform/SchemeRegistry.cpp:
3381         (WebCore::alwaysRevalidatedSchemes):
3382         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
3383         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme):
3384         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely): Moved to WebCore::shouldCacheSchemeIndefinitely().
3385         There was no reason for this to be in SchemeRegistry.
3386         * platform/SchemeRegistry.h:
3387
3388 2016-01-11  Brady Eidson  <beidson@apple.com>
3389
3390         Modern IDB: storage/indexeddb/index-multientry.html fails under GuardMalloc/ASAN.
3391         https://bugs.webkit.org/show_bug.cgi?id=152990
3392
3393         Reviewed by Alex Christensen.
3394
3395         No new tests (Covered by re-enabling existing test).
3396
3397         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3398         (WebCore::IDBClient::IDBRequest::dispatchEvent): Use String::utf8() instead of AtomicString::characters8() for
3399           the format string, as the latter fails under ASAN.
3400           
3401         * Modules/indexeddb/server/IndexValueStore.cpp:
3402         (WebCore::IDBServer::IndexValueStore::removeEntriesWithValueKey): We can't save off pointers to IDBKeyDatas
3403           used as keys in the map, because the moment we start mutating the map the keys can be rehashed, invalidating
3404           our pointers. Save off the IDBKeyDatas by value instead.
3405
3406 2016-01-11  Joseph Pecoraro  <pecoraro@apple.com>
3407
3408         Web Inspector: Migrate Page Timeline recording to ScriptProfiler
3409         https://bugs.webkit.org/show_bug.cgi?id=152727
3410
3411         Reviewed by Brian Burg.
3412
3413         Test: inspector/script-profiler/event-type-Other.html
3414
3415         This now shares the JavaScript profiling code between JSContext and Page
3416         inspection. It also moves forward splitting the Page's Timeline domain
3417         into smaller components that can be turned on/off individually.
3418
3419         * bindings/js/JSCallbackData.cpp:
3420         (WebCore::JSCallbackData::invokeCallback):
3421         * bindings/js/JSErrorHandler.cpp:
3422         (WebCore::JSErrorHandler::handleEvent):
3423         * bindings/js/JSEventListener.cpp:
3424         (WebCore::JSEventListener::handleEvent):
3425         * bindings/js/JSMainThreadExecState.h:
3426         (WebCore::JSMainThreadExecState::profiledCall):
3427         (WebCore::JSMainThreadExecState::profiledEvaluate):
3428         * bindings/js/JSMutationCallback.cpp:
3429         (WebCore::JSMutationCallback::call):
3430         * bindings/js/ScheduledAction.cpp:
3431         (WebCore::ScheduledAction::executeFunctionInContext):
3432         * bindings/js/ScriptController.cpp:
3433         (WebCore::ScriptController::evaluateInWorld):
3434         * bindings/objc/WebScriptObject.mm:
3435         (-[WebScriptObject callWebScriptMethod:withArguments:]):
3436         (-[WebScriptObject evaluateWebScript:]):
3437         Identify entry points into JSC that we want to profile for the frontend.
3438         These were nearly all already classified for the Timeline. We added missing
3439         support for ErrorHandlers (window.onerror handler functions).
3440
3441         * inspector/InspectorTimelineAgent.cpp:
3442         (WebCore::InspectorTimelineAgent::didCallFunction):
3443         (WebCore::InspectorTimelineAgent::didEvaluateScript):
3444         (WebCore::startProfiling): Deleted.
3445         (WebCore::stopProfiling): Deleted.
3446         (WebCore::InspectorTimelineAgent::willCallFunction): Deleted.
3447         (WebCore::InspectorTimelineAgent::willEvaluateScript): Deleted.
3448         * inspector/InspectorTimelineAgent.h:
3449         TimelineAgent no longer needs to start/stop the Legacy Profiler
3450         since ScriptProfiler will automatically do that for us. Delete
3451         all code associated with that. There is still an open question
3452         regarding `console.profile` and `console.profileEnd` that
3453         starts/stops the profiler.
3454
3455 2016-01-11  Anders Carlsson  <andersca@apple.com>
3456
3457         Get rid of CFMakeCollectable, it is a no-op
3458         https://bugs.webkit.org/show_bug.cgi?id=152988
3459
3460         Reviewed by Sam Weinig.
3461
3462         * platform/mac/WebCoreNSURLExtras.mm:
3463         (WebCore::URLByTruncatingOneCharacterBeforeComponent):
3464         (WebCore::URLByRemovingComponentAndSubsequentCharacter):
3465
3466 2016-01-11  Commit Queue  <commit-queue@webkit.org>
3467
3468         Unreviewed, rolling out r194866.
3469         https://bugs.webkit.org/show_bug.cgi?id=152986
3470
3471         This change broke the mac build (Requested by ryanhaddad on
3472         #webkit).
3473
3474         Reverted changeset:
3475
3476         "[Cocoa] Add SPI to opt out a URL scheme from the memory
3477         cache"
3478         https://bugs.webkit.org/show_bug.cgi?id=152950
3479         http://trac.webkit.org/changeset/194866
3480
3481 2016-01-11  Zalan Bujtas  <zalan@apple.com>
3482
3483         Padding added to table-cell element after font-size change.
3484         https://bugs.webkit.org/show_bug.cgi?id=152796
3485
3486         Reviewed by David Hyatt.
3487
3488         Do not include intrinsicPaddingBefore value while figuring out the height of a row.
3489         In RenderTableSection::calcRowLogicalHeight() we are interested in the height of the content
3490         without the additional padding (normal padding is included).
3491
3492         Test: fast/table/table-baseline-grows.html
3493
3494         * rendering/RenderTableSection.cpp:
3495         (WebCore::RenderTableSection::calcRowLogicalHeight):
3496
3497 2016-01-11  Andy Estes  <aestes@apple.com>
3498
3499         [Cocoa] Add SPI to opt out a URL scheme from the memory cache
3500         https://bugs.webkit.org/show_bug.cgi?id=152950
3501         rdar://problem/24066652
3502
3503         Reviewed by Tim Horton.
3504
3505         Added a list of schemes to SchemeRegistry whose resources should always be revalidated. Taught CachedResource to
3506         return a freshness lifetime of 0 for these resources, unless the scheme is one that should be cached indefinitely.
3507
3508         New API test: WebKit2.AlwaysRevalidatedURLSchemes
3509
3510         * loader/cache/CachedResource.cpp:
3511         (WebCore::shouldCacheSchemeIndefinitely): Moved from SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely().
3512         (WebCore::CachedResource::freshnessLifetime): For a scheme that should not be cached indefinitely, return 0 if
3513         that scheme should always be revalidated according to SchemeRegistry.
3514         * platform/SchemeRegistry.cpp:
3515         (WebCore::alwaysRevalidatedSchemes):
3516         (WebCore::SchemeRegistry::registerURLSchemeAsAlwaysRevalidated):
3517         (WebCore::SchemeRegistry::shouldAlwaysRevalidateURLScheme):
3518         (WebCore::SchemeRegistry::shouldCacheResponsesFromURLSchemeIndefinitely): Moved to WebCore::shouldCacheSchemeIndefinitely().
3519         There was no reason for this to be in SchemeRegistry.
3520         * platform/SchemeRegistry.h:
3521
3522 2016-01-11  Dave Hyatt  <hyatt@apple.com>
3523
3524         Picture element needs to work with the preload scanner and select the correct
3525         source element instead of loading the image.
3526         https://bugs.webkit.org/show_bug.cgi?id=152983
3527
3528         Reviewed by Dean Jackson.
3529
3530         Added new tests in http/tests/loading.
3531
3532         * html/parser/HTMLPreloadScanner.cpp:
3533         (WebCore::TokenPreloadScanner::tagIdFor):
3534         (WebCore::TokenPreloadScanner::initiatorFor):
3535         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
3536         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3537         (WebCore::TokenPreloadScanner::StartTagScanner::processImageAndScriptAttribute):
3538         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3539         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
3540         (WebCore::TokenPreloadScanner::scan):
3541         * html/parser/HTMLPreloadScanner.h:
3542         (WebCore::TokenPreloadScanner::setPredictedBaseElementURL):
3543         (WebCore::TokenPreloadScanner::inPicture):
3544
3545 2016-01-11  Brady Eidson  <beidson@apple.com>
3546
3547         Modern IDB: storage/indexeddb/key-generator.html fails.
3548         https://bugs.webkit.org/show_bug.cgi?id=152981
3549
3550         Reviewed by Alex Christensen.
3551
3552         No new tests (One failing test now passes, and one test's results get a progression).
3553
3554         * Modules/indexeddb/server/IDBBackingStore.h:
3555         
3556         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3557         (WebCore::IDBServer::MemoryIDBBackingStore::generateKeyNumber): Throw an error if the current
3558           value is already over 2^53.
3559         (WebCore::IDBServer::MemoryIDBBackingStore::revertGeneratedKeyNumber):
3560         (WebCore::IDBServer::MemoryIDBBackingStore::maybeUpdateKeyGeneratorNumber): Handle double -> uint64_t
3561           conversions properly when calculating the next key.
3562         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3563         
3564         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3565         (WebCore::IDBServer::ScopeGuard::ScopeGuard): Add this utility class to call a function 
3566           any time it goes out of scope.
3567         (WebCore::IDBServer::ScopeGuard::~ScopeGuard):
3568         (WebCore::IDBServer::ScopeGuard::enable):
3569         (WebCore::IDBServer::ScopeGuard::disable):
3570         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Revert the key generator value if
3571           the put/add operation ends in error.
3572
3573 2016-01-11  Brady Eidson  <beidson@apple.com>
3574
3575         Modern IDB: storage/indexeddb/lazy-index-population.html fails.
3576         https://bugs.webkit.org/show_bug.cgi?id=152976
3577
3578         Reviewed by Alex Christensen.
3579
3580         No new tests (At least one failing test now passes).
3581
3582         We were restoring objectstores/indexes incorrectly on transaction abort.
3583
3584         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3585         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3586         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3587         (WebCore::IDBServer::MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort):
3588
3589 2016-01-11  Brady Eidson  <beidson@apple.com>
3590
3591         Modern IDB: Make MemoryIndex and MemoryObjectStore RefCounted.
3592         https://bugs.webkit.org/show_bug.cgi?id=152966
3593
3594         Reviewed by Alex Christensen.
3595
3596         No new tests (Refactor, no change in behavior)
3597
3598         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
3599         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
3600         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreDeleted):
3601         (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
3602         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
3603         
3604         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
3605         (WebCore::IDBServer::MemoryIDBBackingStore::createObjectStore):
3606         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
3607         (WebCore::IDBServer::MemoryIDBBackingStore::restoreObjectStoreForVersionChangeAbort):
3608         (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
3609         (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName):
3610         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
3611         
3612         * Modules/indexeddb/server/MemoryIndex.cpp:
3613         (WebCore::IDBServer::MemoryIndex::create):
3614         * Modules/indexeddb/server/MemoryIndex.h:
3615         
3616         * Modules/indexeddb/server/MemoryObjectStore.cpp:
3617         (WebCore::IDBServer::MemoryObjectStore::create):
3618         (WebCore::IDBServer::MemoryObjectStore::createIndex):
3619         (WebCore::IDBServer::MemoryObjectStore::maybeRestoreDeletedIndex):
3620         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName):
3621         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
3622         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForDeleteRecord):
3623         (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
3624         (WebCore::IDBServer::MemoryObjectStore::registerIndex):
3625         * Modules/indexeddb/server/MemoryObjectStore.h:
3626
3627 2016-01-11  Andreas Kling  <akling@apple.com>
3628
3629         Fix other builds after my MSVC build fix. :-|
3630
3631         * css/StyleResolver.cpp:
3632
3633 2016-01-11  Andreas Kling  <akling@apple.com>
3634
3635         Fix MSVC build after r194848.
3636
3637         Since MSVC refuses to recognize the friendship between LazyNeverDestroyed
3638         and some CSS*Value classes, make their constructors public in MSVC builds.
3639
3640         Added FIXME's to make it look extra gross.
3641
3642         * css/CSSInheritedValue.h:
3643         (WebCore::CSSInheritedValue::create): Deleted.
3644         * css/CSSInitialValue.h:
3645         * css/CSSPrimitiveValue.h:
3646         * css/CSSRevertValue.h:
3647         (WebCore::CSSRevertValue::create): Deleted.
3648         * css/CSSUnsetValue.h:
3649         (WebCore::CSSUnsetValue::create): Deleted.
3650         * css/StyleResolver.cpp:
3651         (WebCore::StyleResolver::applyProperty):
3652
3653 2016-01-11  Andreas Kling  <akling@apple.com>
3654
3655         CSSValuePool should use nonfragmented storage for eternal caches.
3656         <https://webkit.org/b/152960>
3657
3658         Reviewed by Antti Koivisto.
3659
3660         Store all of the common cached CSS value objects in contiguous arrays
3661         instead of lazily allocating them on the heap.
3662
3663         This reduces heap fragmentation (win) and removes indirection (win)
3664
3665         * css/CSSInheritedValue.h:
3666         * css/CSSInitialValue.h:
3667         * css/CSSPrimitiveValue.h:
3668         * css/CSSRevertValue.h:
3669         * css/CSSUnsetValue.h:
3670         * css/CSSValuePool.cpp:
3671         (WebCore::CSSValuePool::CSSValuePool):
3672         (WebCore::CSSValuePool::createIdentifierValue):
3673         (WebCore::CSSValuePool::createColorValue):
3674         (WebCore::CSSValuePool::createValue):
3675         (WebCore::CSSValuePool::drain): Deleted.
3676         * css/CSSValuePool.h:
3677         (WebCore::CSSValuePool::createInheritedValue):
3678         (WebCore::CSSValuePool::createImplicitInitialValue):
3679         (WebCore::CSSValuePool::createExplicitInitialValue):
3680         (WebCore::CSSValuePool::createUnsetValue):
3681         (WebCore::CSSValuePool::createRevertValue):
3682
3683 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3684
3685         [GTK] Cleanup RenderThemeGtk
3686         https://bugs.webkit.org/show_bug.cgi?id=152888
3687
3688         Reviewed by Michael Catanzaro.
3689
3690         Use a common path for GTK+ 3.19 and previous versions, simplifying
3691         the code and removing a lot of ifdefs.
3692
3693          - createStyleContext() now receives a theme part enum value, and
3694            an optional parent GtkStyleContext. It encapsulates all the
3695            differences between GTK+ 3.19 and previous version leaving the
3696            rendering code common and free of ifdefs.
3697          - Stock icons support have been removed, simplifying the code
3698            that now always renders symbolic icons, updating the colors
3699            depending on the current state.
3700          - Media button and colors have been removed, because they are
3701            unused now that we render the media controls with CSS.
3702          - ComboBox separators support has also been removed. In GTK+ 3.19
3703            combo boxes no longer have separators and most of the GTK+
3704            themes don't use the either, so it's better to simple not render
3705            them anymore in WebKit either.
3706          - Code to paint caps lock indicator has been removed too, since
3707            caps lock indicator is now shadow dom and automatically
3708            rendered by WebCore.
3709
3710         * rendering/RenderThemeGtk.cpp:
3711         (WebCore::createStyleContext):
3712         (WebCore::loadThemedIcon):
3713         (WebCore::gtkIconStateFlags):
3714         (WebCore::RenderThemeGtk::adjustRepaintRect):
3715         (WebCore::setToggleSize):
3716         (WebCore::paintToggle):
3717         (WebCore::RenderThemeGtk::setCheckboxSize):
3718         (WebCore::RenderThemeGtk::paintCheckbox):
3719         (WebCore::RenderThemeGtk::setRadioSize):
3720         (WebCore::RenderThemeGtk::paintRadio):
3721         (WebCore::RenderThemeGtk::paintButton):
3722         (WebCore::getComboBoxMetrics):
3723         (WebCore::RenderThemeGtk::popupInternalPaddingLeft):
3724         (WebCore::RenderThemeGtk::popupInternalPaddingRight):
3725         (WebCore::RenderThemeGtk::popupInternalPaddingTop):
3726         (WebCore::RenderThemeGtk::popupInternalPaddingBottom):
3727         (WebCore::RenderThemeGtk::paintMenuList):
3728         (WebCore::RenderThemeGtk::paintTextField):
3729         (WebCore::adjustSearchFieldIconStyle):
3730         (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
3731         (WebCore::paintIcon):
3732         (WebCore::paintEntryIcon):
3733         (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
3734         (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
3735         (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
3736         (WebCore::RenderThemeGtk::shouldHaveCapsLockIndicator):
3737         (WebCore::RenderThemeGtk::paintSliderTrack):
3738         (WebCore::RenderThemeGtk::paintSliderThumb):
3739         (WebCore::RenderThemeGtk::adjustSliderThumbSize):
3740         (WebCore::RenderThemeGtk::paintProgressBar):
3741         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
3742         (WebCore::paintSpinArrowButton):
3743         (WebCore::RenderThemeGtk::paintInnerSpinButton):
3744         (WebCore::styleColor):
3745         (WebCore::RenderThemeGtk::platformActiveSelectionBackgroundColor):
3746         (WebCore::RenderThemeGtk::platformInactiveSelectionBackgroundColor):
3747         (WebCore::RenderThemeGtk::platformActiveSelectionForegroundColor):
3748         (WebCore::RenderThemeGtk::platformInactiveSelectionForegroundColor):
3749         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionBackgroundColor):
3750         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionBackgroundColor):
3751         (WebCore::RenderThemeGtk::platformActiveListBoxSelectionForegroundColor):
3752         (WebCore::RenderThemeGtk::platformInactiveListBoxSelectionForegroundColor):
3753         (WebCore::RenderThemeGtk::systemColor):
3754         (WebCore::RenderThemeGtk::paintMediaButton):
3755         (WebCore::RenderThemeGtk::paintMediaFullscreenButton):
3756         (WebCore::RenderThemeGtk::paintMediaMuteButton):
3757         (WebCore::RenderThemeGtk::paintMediaPlayButton):
3758         (WebCore::RenderThemeGtk::paintMediaSeekBackButton):
3759         (WebCore::RenderThemeGtk::paintMediaSeekForwardButton):
3760         (WebCore::RenderThemeGtk::paintMediaToggleClosedCaptionsButton):
3761         * rendering/RenderThemeGtk.h:
3762
3763 2016-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
3764
3765         [GTK] Cleanup ScrollbarThemeGtk
3766         https://bugs.webkit.org/show_bug.cgi?id=152830
3767
3768         Reviewed by Michael Catanzaro.
3769
3770         Use a common path for GTK+ 3.19 and previous versions, simplifying
3771         the code and removing a lot of ifdefs. Use always a new
3772         GtkStyleContext, but when painting cache the newly created one so
3773         all paint methods use that one. We were also caching some theme
3774         properties assuming they don't change unless the theme changes,
3775         but some of them can have different values depending on the state,
3776         for example, when hovered or pressed. Those properties are now
3777         only cached when we create a new GtkStyleContext.
3778         The method updateScrollbarsFrameThickness() has also been removed,
3779         since the Scrollbar constructor already initializes the frame rect
3780         using the scrollbarThickness(). This method was not doing anything
3781         anyway, since that was called on the constructor of the theme,
3782         when there were no scrollbars registered. This also means we no
3783         longer need to track registered/unregistered scrollbars.
3784
3785         * platform/gtk/ScrollbarThemeGtk.cpp:
3786         (WebCore::ScrollbarThemeGtk::backButtonRect): Use the cached
3787         GtkStyleContext and properties or create a new.
3788         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
3789         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
3790         (WebCore::orientationStyleClass):
3791         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Create a
3792         new GtkStyleContext for the scrollbar if there isn't a cached
3793         one. Also initialize the properties that depend on the state.
3794         (WebCore::createChildStyleContext): Create a new GtkStyleContext
3795         from a parent one.
3796         (WebCore::ScrollbarThemeGtk::updateThemeProperties): Get the
3797         properties that can only change when the theme changes.
3798         (WebCore::ScrollbarThemeGtk::thumbRect): Use the cached
3799         GtkStyleContext and properties or create a new.
3800         (WebCore::adjustRectAccordingToMargin): Use always the
3801         GtkStyleContext state instead of receiving it and setting it again.
3802         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Get or create
3803         a GtkStyleContext for the scrollbar and create a child one for the trough.
3804         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Use the
3805         cached GtkStyleContext or create a new one.
3806         (WebCore::ScrollbarThemeGtk::paintThumb): Get or create a
3807         GtkStyleContext for the scrollbar and create a child ones for
3808         trough and slider.
3809         (WebCore::ScrollbarThemeGtk::paintButton): Get or create a
3810         GtkStyleContext for the scrollbar and create a child one for the button.
3811         (WebCore::ScrollbarThemeGtk::paint): Create a GtkStyleContext and
3812         cache it temporarily using TemporaryChange until the method finishes.
3813         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Use the cached
3814         GtkStyleContext and properties or create a new.
3815         (WebCore::ScrollbarThemeGtk::buttonSize): Ditto.
3816         * platform/gtk/ScrollbarThemeGtk.h:
3817
3818 2016-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
3819
3820         [SVG -> OTF Converter] Parsing failures cause use of incomplete fonts
3821         https://bugs.webkit.org/show_bug.cgi?id=152772
3822         <rdar://problem/24043104>
3823
3824         Reviewed by Simon Fraser.
3825
3826         Originally, if we fail to parse a glyph, we would simply skip the glyph. However, this means that
3827         we will create an incomplete font without all the necessary glyphs. This causes very distressing
3828         text where all the occurances of a particular letter are missing. Instead, we should treat the
3829         entire font as invalid.
3830
3831         Test: fast/text/svg-font-invalid-glyph-path-failure.html
3832
3833         * css/CSSFontFaceSource.cpp:
3834         (WebCore::CSSFontFaceSource::font):
3835         * loader/cache/CachedSVGFont.cpp:
3836         (WebCore::CachedSVGFont::ensureCustomFontData):
3837         * svg/SVGToOTFFontConversion.cpp:
3838         (WebCore::SVGToOTFFontConverter::error):
3839         (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
3840         (WebCore::SVGToOTFFontConverter::processGlyphElement):
3841         (WebCore::convertSVGToOTFFont):
3842         * svg/SVGToOTFFontConversion.h:
3843
3844 2016-01-10  Andreas Kling  <akling@apple.com>
3845
3846         Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL cont'd
3847         <https://webkit.org/b/152902>
3848
3849         Reviewed by Andy Estes.
3850
3851         Convert some more of the remaining clients to use NeverDestroyed.
3852
3853         * html/track/VTTRegion.cpp:
3854         (WebCore::VTTRegion::textTrackCueContainerShadowPseudoId):
3855         (WebCore::VTTRegion::textTrackRegionShadowPseudoId):
3856         * svg/properties/SVGAnimatedPropertyMacros.h:
3857
3858 2016-01-09  Simon Fraser  <simon.fraser@apple.com>
3859
3860         Hook up display-list drawing in GraphicsLayerCA
3861         https://bugs.webkit.org/show_bug.cgi?id=152946
3862
3863         Reviewed by Zalan Bujtas.
3864
3865         Have GraphicsLayerCA hold a DisplayList. If enabled, do a display-list record
3866         in GraphicsLayerCA::recursiveCommitChanges(), and a playback in GraphicsLayerCA::platformCALayerPaintContents().
3867         
3868         GraphicsLayerCA needs to maintain a m_hasEverPainted flag to know to do a full record
3869         at first paint (when there are no dirty rects).
3870         
3871         Plumb 'isUsingDisplayListDrawing' through to TileGrid via PlatformCALayer{Client}
3872         so that we can decorate the tile paint counters with an outline.
3873         
3874         Have RenderLayerCompositor push the displayListDrawingEnabled state down through
3875         RenderLayerBackings to GraphicsLayers.
3876         
3877         Convert RenderLayerCompositor to use initializers.
3878
3879         * platform/graphics/GraphicsLayer.cpp:
3880         (WebCore::GraphicsLayer::GraphicsLayer):
3881         * platform/graphics/GraphicsLayer.h:
3882         (WebCore::GraphicsLayer::usesDisplayListDrawing):
3883         (WebCore::GraphicsLayer::setUsesDisplayListDrawing):
3884         * platform/graphics/ca/GraphicsLayerCA.cpp:
3885         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3886         (WebCore::GraphicsLayerCA::setUsesDisplayListDrawing):
3887         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3888         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
3889         (WebCore::GraphicsLayerCA::updateDrawsContent):
3890         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
3891         * platform/graphics/ca/GraphicsLayerCA.h:
3892         * platform/graphics/ca/PlatformCALayer.cpp:
3893         (WebCore::PlatformCALayer::drawRepaintIndicator):
3894         * platform/graphics/ca/PlatformCALayerClient.h:
3895         (WebCore::PlatformCALayerClient::isUsingDisplayListDrawing):
3896         * platform/graphics/ca/TileGrid.cpp:
3897         (WebCore::TileGrid::platformCALayerShowRepaintCounter):
3898         (WebCore::TileGrid::isUsingDisplayListDrawing):
3899         * platform/graphics/ca/TileGrid.h:
3900         * platform/graphics/displaylists/DisplayList.h: Sadly need to include DisplayListItems.h
3901         to get things to compile. I wasn't able to avoid this even when making functions non-inline.
3902         * rendering/RenderLayerBacking.cpp:
3903         (WebCore::RenderLayerBacking::createGraphicsLayer):
3904         * rendering/RenderLayerCompositor.cpp:
3905         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
3906         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
3907         * rendering/RenderLayerCompositor.h:
3908
3909 2016-01-09  Zalan Bujtas  <zalan@apple.com>
3910
3911         REGRESSION (r194426): First email field is not autofilled on amazon.com
3912         https://bugs.webkit.org/show_bug.cgi?id=152945
3913         <rdar://problem/24082914>
3914
3915         Reviewed by Simon Fraser.
3916
3917         r194426 missed marking the m_layoutRoot for layout while converting to full layout (it only marked the new layout root).
3918
3919         Test: fast/forms/multiple-subtree-layout-failure.html
3920
3921         * page/FrameView.cpp:
3922         (WebCore::FrameView::scheduleRelayoutOfSubtree):
3923
3924 2016-01-09  Dan Bernstein  <mitz@apple.com>
3925
3926         [Cocoa] Allow overriding the frameworks directory independently of using a staging install path
3927         https://bugs.webkit.org/show_bug.cgi?id=152926
3928
3929         Reviewed by Tim Horton.
3930
3931         Introduce a new build setting, WK_OVERRIDE_FRAMEWORKS_DIR. When not empty, it determines
3932         where the frameworks are installed. Setting USE_STAGING_INSTALL_PATH to YES sets
3933         WK_OVERRIDE_FRAMEWORKS_DIR to $(SYSTEM_LIBRARY_DIR)/StagedFrameworks/Safari.
3934
3935         Account for the possibility of WK_OVERRIDE_FRAMEWORKS_DIR containing spaces.
3936
3937         * Configurations/WebCore.xcconfig:
3938         - Replace STAGED_FRAMEWORKS_SEARCH_PATH in FRAMEWORK_SEARCH_PATHS with
3939           WK_OVERRIDE_FRAMEWORKS_DIR and add quotes to account for spaces.
3940         - Define WEBCORE_FRAMEWORKS_DIR and PRODUCTION_FRAMEWORKS_DIR based on
3941           WK_OVERRIDE_FRAMEWORKS_DIR.
3942
3943         * WebCore.xcodeproj/project.pbxproj: Work around make’s inability to handle spaces in paths
3944           by creating a symlink to JAVASCRIPTCORE_PRIVATE_HEADERS_DIR under BUILT_PRODUCTS_DIR and
3945           using the symlink as the value of JavaScriptCore_SCRIPTS_DIR.
3946
3947 2016-01-09  Andreas Kling  <akling@apple.com>
3948
3949         Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL
3950         <https://webkit.org/b/152902>
3951
3952         Reviewed by Anders Carlsson.
3953
3954         Mostly mechanical conversion to NeverDestroyed throughout WebCore.
3955
3956         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
3957         (WebCore::stringForPlaybackTargetAvailability):
3958         * Modules/indexeddb/IDBCursor.cpp:
3959         (WebCore::IDBCursor::directionNext):
3960         (WebCore::IDBCursor::directionNextUnique):
3961         (WebCore::IDBCursor::directionPrev):
3962         (WebCore::IDBCursor::directionPrevUnique):
3963         * Modules/indexeddb/IDBTransaction.cpp:
3964         (WebCore::IDBTransaction::modeReadOnly):
3965         (WebCore::IDBTransaction::modeReadWrite):
3966         (WebCore::IDBTransaction::modeVersionChange):
3967         (WebCore::IDBTransaction::modeReadOnlyLegacy):
3968         (WebCore::IDBTransaction::modeReadWriteLegacy):
3969         * Modules/indexeddb/legacy/LegacyRequest.cpp:
3970         (WebCore::LegacyRequest::readyState):
3971         * Modules/mediacontrols/MediaControlsHost.cpp:
3972         (WebCore::MediaControlsHost::automaticKeyword):
3973         (WebCore::MediaControlsHost::forcedOnlyKeyword):
3974         (WebCore::MediaControlsHost::alwaysOnKeyword):
3975         (WebCore::MediaControlsHost::externalDeviceType):
3976         * Modules/mediasource/MediaSource.cpp:
3977         (WebCore::MediaSource::openKeyword):
3978         (WebCore::MediaSource::closedKeyword):
3979         (WebCore::MediaSource::endedKeyword):
3980         (WebCore::MediaSource::streamEndedWithError):
3981         * Modules/plugins/QuickTimePluginReplacement.mm:
3982         (WebCore::quickTimePluginReplacementScript):
3983         (WebCore::QuickTimePluginReplacement::supportsMimeType):
3984         (WebCore::QuickTimePluginReplacement::supportsFileExtension):
3985         * Modules/speech/SpeechSynthesis.cpp:
3986         (WebCore::SpeechSynthesis::boundaryEventOccurred):
3987         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3988         (WebCore::cssPropertyIDForJSCSSPropertyName):
3989         * bridge/c/c_instance.cpp:
3990         (JSC::Bindings::globalExceptionString):
3991         * css/MediaList.cpp:
3992         (WebCore::addResolutionWarningMessageToConsole):
3993         * css/StyleSheetContents.cpp:
3994         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3995         * dom/ChildListMutationScope.cpp:
3996         (WebCore::accumulatorMap):
3997         * dom/DOMImplementation.cpp:
3998         (WebCore::isSupportedSVG10Feature):
3999         (WebCore::isSupportedSVG11Feature):
4000         * dom/Document.cpp:
4001         (WebCore::Document::readyState):
4002         * dom/Element.cpp:
4003         (WebCore::Element::webkitRegionOverset):
4004         * dom/EventDispatcher.cpp:
4005         (WebCore::EventDispatcher::dispatchSimulatedClick):
4006         * dom/InlineStyleSheetOwner.cpp:
4007         (WebCore::isValidCSSContentType):
4008         * dom/MutationObserver.cpp:
4009         (WebCore::activeMutationObservers):
4010         (WebCore::suspendedMutationObservers):
4011         * dom/MutationRecord.cpp:
4012         * dom/PseudoElement.cpp:
4013         (WebCore::pseudoElementTagName):
4014         (WebCore::PseudoElement::pseudoElementNameForEvents):
4015         * dom/QualifiedName.cpp:
4016         (WebCore::qualifiedNameCache):