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