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