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