Add Node.treeRoot
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-01-26  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Add Node.treeRoot
4         https://bugs.webkit.org/show_bug.cgi?id=153537
5
6         Reviewed by Antti Koivisto.
7
8         Exposed highestAncestor as Node.prototype.treeRoot, which was added to shadow DOM spec in
9         https://github.com/w3c/webcomponents/commit/6864a40fe4efa8a737e78512e3c85319ddc5bf8b
10
11         See also:
12         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-node-interface
13
14         Test: fast/shadow-dom/Node-interface-treeRoot.html
15
16         * dom/Node.idl:
17
18 2016-01-26  Ryosuke Niwa  <rniwa@webkit.org>
19
20         Rename HTMLSlotElement.getDistributedNodes to getAssignedNodes
21         https://bugs.webkit.org/show_bug.cgi?id=153534
22
23         Reviewed by Antti Koivisto.
24
25         Did the rename.
26
27         * html/HTMLSlotElement.idl:
28
29 2016-01-27  Tim Horton  <timothy_horton@apple.com>
30
31         Need to be able to specify MIME type for <attachment> without filename or handle
32         https://bugs.webkit.org/show_bug.cgi?id=153552
33         <rdar://problem/20145857>
34
35         Reviewed by Anders Carlsson.
36
37         Tests: fast/attachment/attachment-default-icon.html
38                fast/attachment/attachment-type-attribute.html
39
40         * html/HTMLAttachmentElement.cpp:
41         (WebCore::HTMLAttachmentElement::parseAttribute):
42         Invalidate attachment when 'type' attribute changes.
43
44         (WebCore::HTMLAttachmentElement::attachmentType):
45         * html/HTMLAttachmentElement.h:
46         * platform/graphics/Icon.h:
47         * platform/graphics/mac/IconMac.mm:
48         (WebCore::Icon::createIconForUTI):
49         (WebCore::Icon::createIconForMIMEType):
50         Add Icon class methods to retrieve an icon given a UTI or MIME type.
51
52         * rendering/RenderThemeMac.mm:
53         (WebCore::paintAttachmentIcon):
54         Use the 'type' attribute (a MIME type) if we have one. Otherwise,
55         use the filename. Lastly fall back to a plain file icon (using the root
56         file UTI, public.data).
57
58 2016-01-27  Alexey Proskuryakov  <ap@apple.com>
59
60         Remove ENABLE_CURRENTSRC
61         https://bugs.webkit.org/show_bug.cgi?id=153545
62
63         Reviewed by Simon Fraser.
64
65         * Configurations/FeatureDefines.xcconfig:
66
67 2016-01-26  Anders Carlsson  <andersca@apple.com>
68
69         Stop echoing echo commands to stdout
70         https://bugs.webkit.org/show_bug.cgi?id=153531
71
72         Reviewed by Csaba Osztrogonác.
73
74         * DerivedSources.make:
75
76 2016-01-26  Jer Noble  <jer.noble@apple.com>
77
78         Calling video.controls=true during a scrub operation cancels scrub.
79         https://bugs.webkit.org/show_bug.cgi?id=153494
80
81         Reviewed by Eric Carlson.
82
83         Test: media/media-controls-drag-timeline-set-controls-property.html
84
85         Verify that the video.controls attribute actually changed before tearing down and
86         re-adding the media controls to the Shadow DOM.
87
88         * Modules/mediacontrols/mediaControlsApple.js:
89         (Controller.prototype.handleControlsChange):
90         (Controller.prototype.hasControls):
91
92 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
93
94         [GTK][EFL] Rename ScrollAnimationNone as ScrollAnimationSmooth
95         https://bugs.webkit.org/show_bug.cgi?id=153481
96
97         Reviewed by Simon Fraser.
98
99         ScrollAnimationNone has always been used by EFL and GTK ports to
100         implement smooth scrolling. I think it should be possible for
101         other scroll animators to implement smooth scrolling or even
102         implement other kind of scroll animations. For example, in the
103         future I would like to have kinetic scrolling implemented for the
104         GTK+ port to match all other GTK+ application and decide at
105         runtime between different animations without having to use a
106         different scroll animator class. So, this patch also moves the
107         smooth scrolling animation implementation to its own class
108         ScrollAnimationSmooth that impements an interface ScrollAnimation
109         that could be used to implement other animations. This will allow
110         the GTK+ port to add its own scroll animator class and still
111         support smooth scrolling sharing the code with the
112         ScrollAnimationSmooth.
113
114         * PlatformEfl.cmake: Add new files to compilation and remove ScrollAnimationNone.
115         * PlatformGTK.cmake: Ditto.
116         * platform/ScrollAnimation.h: Added.
117         (WebCore::ScrollAnimation::serviceAnimation):
118         (WebCore::ScrollAnimation::ScrollAnimation):
119         * platform/ScrollAnimationSmooth.cpp: Added.
120         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
121         (WebCore::ScrollAnimationSmooth::scroll):
122         (WebCore::ScrollAnimationSmooth::stop):
123         (WebCore::ScrollAnimationSmooth::updateVisibleLengths):
124         (WebCore::ScrollAnimationSmooth::setCurrentPosition):
125         (WebCore::ScrollAnimationSmooth::serviceAnimation):
126         (WebCore::ScrollAnimationSmooth::~ScrollAnimationSmooth):
127         (WebCore::curveAt):
128         (WebCore::attackCurve):
129         (WebCore::releaseCurve):
130         (WebCore::coastCurve):
131         (WebCore::curveIntegralAt):
132         (WebCore::attackArea):
133         (WebCore::releaseArea):
134         (WebCore::getAnimationParametersForGranularity):
135         (WebCore::ScrollAnimationSmooth::updatePerAxisData):
136         (WebCore::ScrollAnimationSmooth::animateScroll):
137         (WebCore::ScrollAnimationSmooth::animationTimerFired):
138         (WebCore::ScrollAnimationSmooth::startNextTimer):
139         (WebCore::ScrollAnimationSmooth::animationTimerActive):
140         * platform/ScrollAnimationSmooth.h: Added.
141         * platform/ScrollAnimator.cpp:
142         (WebCore::ScrollAnimator::scroll):
143         (WebCore::ScrollAnimator::scrollToOffsetWithoutAnimation):
144         (WebCore::ScrollAnimator::setCurrentPosition):
145         (WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset):
146         (WebCore::ScrollAnimator::notifyPositionChanged):
147         (WebCore::ScrollAnimator::scrollOffsetOnAxis):
148         * platform/ScrollAnimator.h:
149         (WebCore::ScrollAnimator::ScrollAnimator::currentPosition):
150         * platform/ScrollAnimatorNone.cpp: Removed.
151         * platform/ScrollAnimatorNone.h: Removed.
152         * platform/ScrollAnimatorSmooth.cpp: Added.
153         (WebCore::ScrollAnimator::create):
154         (WebCore::ScrollAnimatorSmooth::ScrollAnimatorSmooth):
155         (WebCore::ScrollAnimatorSmooth::~ScrollAnimatorSmooth):
156         (WebCore::ScrollAnimatorSmooth::scroll):
157         (WebCore::ScrollAnimatorSmooth::scrollToOffsetWithoutAnimation):
158         (WebCore::ScrollAnimatorSmooth::cancelAnimations):
159         (WebCore::ScrollAnimatorSmooth::serviceScrollAnimations):
160         (WebCore::ScrollAnimatorSmooth::willEndLiveResize):
161         (WebCore::ScrollAnimatorSmooth::didAddVerticalScrollbar):
162         (WebCore::ScrollAnimatorSmooth::didAddHorizontalScrollbar):
163         * platform/ScrollAnimatorSmooth.h: Added.
164         * platform/mac/ScrollAnimatorMac.mm:
165         (WebCore::ScrollAnimatorMac::immediateScrollToPosition):
166         (WebCore::ScrollAnimatorMac::immediateScrollBy):
167
168 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
169
170         Overlay scrollbars should always use the whole contents
171         https://bugs.webkit.org/show_bug.cgi?id=153352
172
173         Reviewed by Michael Catanzaro.
174
175         In case of having both horizontal and vertical scrollbars, the
176         scrollbars respect the scroll corner. That looks good for legacy
177         scrollbars that show the track, but with the overlay indicators
178         it looks weird that the indicator stops so early before the end of
179         the contents, giving the impression that there's something else to
180         scroll. This happens because the scroll corner is transparent, so
181         it's not obvious that's the scroll corner. It also happens with
182         the text areas having a resizer. Legacy scrollbars take into
183         account the resizer, which is good, but I expect overlay
184         scrollbars to be rendered also over the resizer. The resizer takes
185         precedence so you can still click and drag to resize the text area.
186         In the case of main frame scrollbars we are indeed returning an
187         empty rectangle from ScrollView::scrollCornerRect() when using
188         overlay scrollbars, but when calculating the size of the
189         scrollbars we are using the actual width/height instead of the
190         occupied with/height. For other scrollbars
191         RenderLayer::scrollCornerRect() is not checking whether scrollbars
192         are overlay or not and we are always returning a scroll corner
193         rectangle when scrollbars are present.
194
195         * platform/ScrollView.cpp:
196         (WebCore::ScrollView::updateScrollbars): Use the occupied
197         width/height when calculating the space the one scrollbar
198         should leave for the other.
199         * rendering/RenderLayer.cpp:
200         (WebCore::RenderLayer::scrollCornerRect): Return an empty
201         rectangle when using overlay scrollbars.
202
203 2016-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
204
205         ScrollAnimator is not notified when mouse entered, moved or exited a RenderListBox
206         https://bugs.webkit.org/show_bug.cgi?id=153398
207
208         Reviewed by Michael Catanzaro.
209
210         EvenHandler is checking whether the enclosing layer of a node is
211         registered as scrollable area of its frame view. That doesn't work
212         for list boxes, because they are the scrollable area
213         themselves. Also when entering a list box the node under mouse is
214         not usually the list box itself, but any of its children, a
215         HTMLOptionElement or a HTMLOptGroupElement. Instead of comparing
216         layers, we should find the enclosing scrollable area of the target
217         elements and compare them to decide whether the mouse has entered,
218         left or moved a scrollable area.
219
220         * page/EventHandler.cpp:
221         (WebCore::enclosingScrollableArea): Return the enclosing
222         scrollable area of the given node. If the node doesn't have a
223         renderer, it traverses its parents. If the renderer is a
224         RenderListBox it is returned, otherwhise the enclosing layer is
225         returned.
226         (WebCore::EventHandler::mouseMoved): Use enclosingScrollableArea.
227         (WebCore::EventHandler::updateMouseEventTargetNode): Ditto.
228
229 2016-01-26  Sam Weinig  <sam@webkit.org>
230
231         Try touching DerivedSources.make to force rebuilding.
232
233         * DerivedSources.make:
234         * page/DOMWindow.idl:
235
236 2016-01-26  Sam Weinig  <sam@webkit.org>
237
238         Try to force a rebuild.
239
240         * page/DOMWindow.idl:
241
242 2016-01-26  Chris Dumez  <cdumez@apple.com>
243
244         fast/history/page-cache-webdatabase-no-transaction-db.html flakily crashes
245         https://bugs.webkit.org/show_bug.cgi?id=153525
246
247         Reviewed by Andreas Kling.
248
249         The test was crashing because DatabaseThread::hasPendingDatabaseActivity()
250         was accessing m_openDatabaseSet from the main thread without any locking
251         mechanism. This is an issue because m_openDatabaseSet is altered by the
252         database thread.
253
254         No new tests, already covered by fast/history/page-cache-webdatabase-no-transaction-db.html.
255
256         * Modules/webdatabase/DatabaseThread.cpp:
257         (WebCore::DatabaseThread::databaseThread):
258         (WebCore::DatabaseThread::recordDatabaseOpen):
259         (WebCore::DatabaseThread::recordDatabaseClosed):
260         (WebCore::DatabaseThread::hasPendingDatabaseActivity):
261         * Modules/webdatabase/DatabaseThread.h:
262
263 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
264
265         Unreviewed CMake build fix after r195644.
266
267         * PlatformMac.cmake:
268
269 2016-01-26  Brady Eidson  <beidson@apple.com>
270
271         Modern IDB: Key generator support for SQLite backend.
272         https://bugs.webkit.org/show_bug.cgi?id=153427
273
274         Reviewed by Alex Christensen.
275
276         No new tests (Existing failing tests now pass, others improved).
277
278         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
279         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
280         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
281         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
282         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
283         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
284         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
285
286 2016-01-26  Simon Fraser  <simon.fraser@apple.com>
287
288         Allow canvas to use display-list drawing for testing
289         https://bugs.webkit.org/show_bug.cgi?id=153475
290
291         Reviewed by Dean Jackson.
292
293         Optionally have 2D <canvas> use display-list drawing, which is only enabled
294         via Internals for now.
295
296         Support displayListAsText() and replayDisplayListAsText() on canvas, so we can
297         use it to test playback optimizations. [Note that displayListAsText() always
298         returns an empty string currently, because the display list is cleared when the
299         canvas is painted to the page.]
300
301         Display list rendering is implemented by giving CanvasRenderingContext2D an
302         optional DisplayListDrawingContext, which packages up a display list, recorder
303         and recording context. The existing paintRenderingResultsToCanvas() is overridden
304         to replay the recorded display list into the primary canvas context.
305
306         Tracked replay display lists are stored in a static map, keyed by the CanvasRenderingContext2D.
307
308         Test: displaylists/canvas-display-list.html
309
310         * html/HTMLCanvasElement.cpp:
311         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
312         (WebCore::HTMLCanvasElement::getContext):
313         (WebCore::HTMLCanvasElement::paint):
314         (WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
315         (WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
316         (WebCore::HTMLCanvasElement::displayListAsText):
317         (WebCore::HTMLCanvasElement::replayDisplayListAsText):
318         * html/HTMLCanvasElement.h:
319         * html/canvas/CanvasRenderingContext.h:
320         * html/canvas/CanvasRenderingContext2D.cpp:
321         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
322         (WebCore::contextDisplayListMap):
323         (WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D):
324         (WebCore::CanvasRenderingContext2D::setTracksDisplayListReplay):
325         (WebCore::CanvasRenderingContext2D::displayListAsText):
326         (WebCore::CanvasRenderingContext2D::replayDisplayListAsText):
327         (WebCore::CanvasRenderingContext2D::paintRenderingResultsToCanvas):
328         (WebCore::CanvasRenderingContext2D::drawingContext):
329         (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): Deleted.
330         * html/canvas/CanvasRenderingContext2D.h:
331         * testing/Internals.cpp:
332         (WebCore::Internals::setElementUsesDisplayListDrawing):
333         (WebCore::Internals::setElementTracksDisplayListReplay):
334         (WebCore::Internals::displayListForElement):
335         (WebCore::Internals::replayDisplayListForElement):
336
337 2016-01-26  Joseph Pecoraro  <pecoraro@apple.com>
338
339         Generalize ResourceUsageData gathering to be used outside of ResourceUsageOverlay
340         https://bugs.webkit.org/show_bug.cgi?id=153509
341         <rdar://problem/24354291>
342
343         Reviewed by Andreas Kling.
344
345         * CMakeLists.txt:
346         * PlatformMac.cmake:
347         * WebCore.xcodeproj/project.pbxproj:
348         * page/Page.cpp:
349         * page/Page.h:
350         * page/Settings.cpp:
351         * page/Settings.h:
352         * page/ResourceUsageOverlay.cpp:
353         * page/ResourceUsageOverlay.h:
354         Add new files to the build and updated ENABLE flag name.
355
356         * page/ResourceUsageData.cpp: Added.
357         (WebCore::ResourceUsageData::ResourceUsageData):
358         * page/ResourceUsageData.h: Added.
359         (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
360         Platform agnostic resource data that may be used by multiple clients,
361         such as the ResourceUsageOverlay and later the Inspector.
362
363         * page/ResourceUsageThread.h: Added.
364         * page/ResourceUsageThread.cpp: Added.
365         (WebCore::ResourceUsageThread::ResourceUsageThread):
366         (WebCore::ResourceUsageThread::singleton):
367         (WebCore::ResourceUsageThread::addObserver):
368         (WebCore::ResourceUsageThread::removeObserver):
369         (WebCore::ResourceUsageThread::waitUntilObservers):
370         (WebCore::ResourceUsageThread::notifyObservers):
371         (WebCore::ResourceUsageThread::createThreadIfNeeded):
372         (WebCore::ResourceUsageThread::threadCallback):
373         (WebCore::ResourceUsageThread::threadBody):
374         Platform agnostic resource usage thread that can be used to gather data
375         into a ResourceUsageData struct on a background thread and notify observers
376         on the main thread. Platforms need only implement ResourceUsageThread::platformThreadBody
377         to populate the ResourceUsageData struct with data.
378
379         * page/cocoa/ResourceUsageOverlayCocoa.mm:
380         (WebCore::HistoricMemoryCategoryInfo::HistoricMemoryCategoryInfo):
381         (WebCore::HistoricResourceUsageData::HistoricResourceUsageData):
382         (WebCore::historicUsageData):
383         (WebCore::appendDataToHistory):
384         (WebCore::ResourceUsageOverlay::platformInitialize):
385         (WebCore::ResourceUsageOverlay::platformDestroy):
386         (WebCore::drawMemHistory):
387         (WebCore::drawMemoryPie):
388         (WebCore::ResourceUsageOverlay::platformDraw):
389         Move CPU and memory resource usage calculations to ResourceUsageThread.
390         The overlay adds itself as an observer, and builds its RingBuffer list
391         of data from notifications from the ResourceUsageThread. Renamed
392         some of the fields.
393
394         * page/cocoa/ResourceUsageThreadCocoa.mm: Added.
395         (WebCore::vmPageSize):
396         (WebCore::TagInfo::TagInfo):
397         (WebCore::pagesPerVMTag):
398         (WebCore::cpuUsage):
399         (WebCore::categoryForVMTag):
400         (WebCore::ResourceUsageThread::platformThreadBody):
401         Extracted from ResourceUsageOverlayCocoa.
402
403         * page/scrolling/ScrollingThread.cpp:
404         (WebCore::ScrollingThread::dispatch):
405         Drive-by, don't call singleton again, we already have the result.
406
407 2016-01-26  Simon Fraser  <simon.fraser@apple.com>
408
409         Use initializers in HTMLCanvasElement
410         https://bugs.webkit.org/show_bug.cgi?id=153472
411
412         Reviewed by Michael Catanzaro.
413
414         Use initializers, and re-order member variables for better packing.
415
416         * html/HTMLCanvasElement.cpp:
417         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
418         * html/HTMLCanvasElement.h:
419
420 2016-01-26  Chris Dumez  <cdumez@apple.com>
421
422         Setting HTMLInputElement.value to null to set its value to the empty string
423         https://bugs.webkit.org/show_bug.cgi?id=153519
424
425         Reviewed by Ryosuke Niwa.
426
427         Setting HTMLInputElement.value to null to set its value to the empty string:
428         - https://html.spec.whatwg.org/#htmlinputelement
429         - http://heycam.github.io/webidl/#TreatNullAs
430
431         WebKit would previously unset the value attribute instead, which caused
432         it to fallback to input.defaultValue if set.
433
434         Firefox and Chrome behave correctly.
435
436         Test: fast/dom/HTMLInputElement/input-value-set-null.html
437
438         * html/HTMLInputElement.cpp:
439         (WebCore::HTMLInputElement::setValue):
440
441 2016-01-26  Anders Carlsson  <andersca@apple.com>
442
443         WebKitAdditions should be able to modify derived source rules
444         https://bugs.webkit.org/show_bug.cgi?id=153514
445
446         Reviewed by Tim Horton.
447
448         * DerivedSources.make:
449         Include WebCoreDerivedSourcesAdditions.make.
450
451         * WebCore.xcodeproj/project.pbxproj:
452         Pass our WebKitAdditions paths as include paths to make.
453
454 2016-01-26  Chris Dumez  <cdumez@apple.com>
455
456         document.open() / write() should be prevented in beforeunload event handlers
457         https://bugs.webkit.org/show_bug.cgi?id=153432
458
459         Reviewed by Ryosuke Niwa.
460
461         document.open() / write() should be prevented in beforeunload event handlers:
462         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
463         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
464         - https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
465         - https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
466
467         Test: fast/frames/page-beforeunload-document-open.html
468
469         * loader/FrameLoader.cpp:
470         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
471
472 2016-01-26  Chris Dumez  <cdumez@apple.com>
473
474         Add support for HTMLDataElement
475         https://bugs.webkit.org/show_bug.cgi?id=153459
476
477         Reviewed by Ryosuke Niwa.
478
479         Add support for HTMLDataElement:
480         https://html.spec.whatwg.org/multipage/semantics.html#the-data-element
481
482         Firefox already supports it.
483
484         No new tests, already covered by existing tests.
485
486         * CMakeLists.txt:
487         * DerivedSources.cpp:
488         * DerivedSources.make:
489         * WebCore.vcxproj/WebCore.vcxproj:
490         * WebCore.vcxproj/WebCore.vcxproj.filters:
491         * WebCore.xcodeproj/project.pbxproj:
492         * html/HTMLDataElement.cpp: Added.
493         (WebCore::HTMLDataElement::create):
494         (WebCore::HTMLDataElement::HTMLDataElement):
495         * html/HTMLDataElement.h: Added.
496         * html/HTMLDataElement.idl: Added.
497         * html/HTMLElementsAllInOne.cpp:
498         * html/HTMLTagNames.in:
499
500 2016-01-26  Commit Queue  <commit-queue@webkit.org>
501
502         Unreviewed, rolling out r195610.
503         https://bugs.webkit.org/show_bug.cgi?id=153513
504
505         The test added with this change is timing out on almost every
506         run (Requested by ryanhaddad on #webkit).
507
508         Reverted changeset:
509
510         "Calling video.controls=true during a scrub operation cancels
511         scrub."
512         https://bugs.webkit.org/show_bug.cgi?id=153494
513         http://trac.webkit.org/changeset/195610
514
515 2016-01-26  Brady Eidson  <beidson@apple.com>
516
517         History.pushState causes intense memory pressure.
518         https://bugs.webkit.org/show_bug.cgi?id=153435
519
520         Reviewed by Sam Weinig, Oliver Hunt, and Geoff Garen.
521
522         Tests: fast/loader/stateobjects/pushstate-frequency-iframe.html
523                fast/loader/stateobjects/pushstate-frequency-with-user-gesture.html
524                fast/loader/stateobjects/pushstate-frequency.html
525                fast/loader/stateobjects/replacestate-frequency-iframe.html
526                fast/loader/stateobjects/replacestate-frequency-with-user-gesture.html
527                fast/loader/stateobjects/replacestate-frequency.html
528                loader/stateobjects/pushstate-size-iframe.html
529                loader/stateobjects/pushstate-size.html
530                loader/stateobjects/replacestate-size-iframe.html
531                loader/stateobjects/replacestate-size.html
532
533         Add restrictions on how frequently push/replaceState can be called,
534         as well as how much of a cumulative payload they can deliver.
535         
536         * bindings/js/JSHistoryCustom.cpp:
537         (WebCore::JSHistory::pushState):
538         (WebCore::JSHistory::replaceState):
539         
540         * page/History.cpp:
541         (WebCore::History::stateObjectAdded):
542         * page/History.h:
543
544 2016-01-26  Anders Carlsson  <andersca@apple.com>
545
546         Add a Dictionary overload that returns an Optional result
547         https://bugs.webkit.org/show_bug.cgi?id=153507
548
549         Reviewed by Tim Horton.
550
551         * bindings/js/Dictionary.h:
552         (WebCore::Dictionary::get):
553
554 2016-01-26  Philip Rogers  <pdr@chromium.org>
555
556         Let SVG images not taint canvases except when containing foreignObjects
557         https://bugs.webkit.org/show_bug.cgi?id=119639
558
559         Reviewed by Brent Fulgham.
560
561         r153876 caused SVG images to not taint canvases but the patch allowed
562         for subimage resources. This can be a problem if a subimage (e.g., data
563         uri image) contains a foreignObject which can violate security (e.g.,
564         visited links).
565
566         This patch updates SVGImage::hasSingleSecurityOrigin to check if the
567         image contains any foreignObjects or images that themselves contain
568         foreignObjects. SVG images without foreignObjects are allowed to not
569         taint canvases.
570
571         Canvas patterns are problematic because an animated SVG image can switch
572         between tainting and not tainting the canvas. A FIXME has been added to
573         solve this, and in the meantime we cause SVG images to taint patterns.
574
575         Tests: svg/as-image/svg-canvas-pattern-with-link-tainted.html
576                svg/as-image/svg-canvas-svg-with-feimage-with-link-tainted.html
577                svg/as-image/svg-canvas-svg-with-image-with-link-tainted.html
578
579         * html/canvas/CanvasPattern.cpp:
580         (WebCore::CanvasPattern::CanvasPattern):
581         (WebCore::CanvasPattern::~CanvasPattern):
582         * svg/SVGFEImageElement.cpp:
583         (WebCore::SVGFEImageElement::~SVGFEImageElement):
584         (WebCore::SVGFEImageElement::hasSingleSecurityOrigin):
585         (WebCore::SVGFEImageElement::clearResourceReferences):
586         * svg/SVGFEImageElement.h:
587         * svg/SVGImageElement.cpp:
588         (WebCore::SVGImageElement::create):
589         (WebCore::SVGImageElement::hasSingleSecurityOrigin):
590         (WebCore::SVGImageElement::isSupportedAttribute):
591         * svg/SVGImageElement.h:
592         * svg/graphics/SVGImage.cpp:
593         (WebCore::SVGImage::hasSingleSecurityOrigin):
594
595 2016-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
596
597         CSSGrammar.y:1742.31-34: warning: unused value: $3
598         https://bugs.webkit.org/show_bug.cgi?id=153462
599
600         Reviewed by Alex Christensen.
601
602         This warning indicates that we have a memory leak. From the bison manual:
603
604         "Right-hand side symbols of a rule that explicitly triggers a syntax error via YYERROR are
605         not discarded automatically. As a rule of thumb, destructors are invoked only when user
606         actions cannot manage the memory."
607
608         Arguably a design error, but that's how it is.
609
610         * css/CSSGrammar.y.in:
611
612 2016-01-26  Jer Noble  <jer.noble@apple.com>
613
614         Calling video.controls=true during a scrub operation cancels scrub.
615         https://bugs.webkit.org/show_bug.cgi?id=153494
616
617         Reviewed by Eric Carlson.
618
619         Test: media/media-controls-drag-timeline-set-controls-property.html
620
621         Verify that the video.controls attribute actually changed before tearing down and
622         re-adding the media controls to the Shadow DOM.
623
624         * Modules/mediacontrols/mediaControlsApple.js:
625         (Controller.prototype.handleControlsChange):
626         (Controller.prototype.hasControls):
627
628 2016-01-26  Jeremy Noble  <jer.noble@apple.com>
629
630         [EME][Mac] Crash in [AVStreamSession addStreamDataParser:]; uncaught exception
631         https://bugs.webkit.org/show_bug.cgi?id=153495
632
633         Reviewed by Eric Carlson.
634
635         When AVContentKeySession is not available, fall back to pre-AVContentKeySession behavior;
636         namely, immediately create an AVStreamSession object in
637         willProvideContentKeyRequestInitializationData, rather than waiting for didProvide.
638
639         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
640         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
641
642 2016-01-26  Dean Jackson  <dino@apple.com>
643
644         [iOS] Documents without an explicit width should not get fast tapping
645         https://bugs.webkit.org/show_bug.cgi?id=153465
646         <rdar://problem/23962529>
647
648         Reviewed by Simon Fraser (and Wenson Hseih).
649
650         As the title says, documents that do not set a viewport should
651         not get the fast click behaviour. There were complaints that we broke
652         double-tap to scroll in ImageDocuments where the image was narrow and long.
653
654         The fix is to just keep a flag that tells the UI process if the
655         width was explicit. However, it turns out that those ImageDocuments
656         are given an explicit device-width, which is fine for scaling but
657         really should behave as auto for fast tapping. So we also need
658         to tell the UIProcess if the viewport arguments came from an
659         ImageDocument.
660
661         Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html
662
663         * dom/ViewportArguments.cpp:
664         (WebCore::findSizeValue): Add a parameter that toggles a flag
665         if the size was explicitly set.
666         (WebCore::setViewportFeature): Remember if the width was
667         explicit.
668         * dom/ViewportArguments.h: Add a widthWasExplicit flag.
669         (WebCore::ViewportArguments::operator==):
670
671 2016-01-25  Dave Hyatt  <hyatt@apple.com>
672
673         Speculative fixes for crashing in viewportChangeAffectedPicture
674         https://bugs.webkit.org/show_bug.cgi?id=153450
675
676         Reviewed by Dean Jackson.
677
678         Don't attach any conditions to the removal of a picture element from
679         the document's HashSet. This ensures that if the condition is ever
680         wrong for any reason, we'll still remove the picture element on
681         destruction.
682
683         Fix the media query evaluation to match the other evaluations (used by
684         the preload scanner and HTMLImageElement). This includes using the
685         document element's computed style instead of our own and also null
686         checking the document element first. This is the likely cause of the
687         crashes.
688
689         * html/HTMLPictureElement.cpp:
690         (WebCore::HTMLPictureElement::~HTMLPictureElement):
691         (WebCore::HTMLPictureElement::didMoveToNewDocument):
692         (WebCore::HTMLPictureElement::viewportChangeAffectedPicture):
693
694 2016-01-26  Chris Dumez  <cdumez@apple.com>
695
696         Make sure a page is still PageCache-able after firing the 'pagehide' events
697         https://bugs.webkit.org/show_bug.cgi?id=153449
698
699         Reviewed by Andreas Kling.
700
701         Make sure a page is still PageCache-able after firing the 'pagehide'
702         events and abort if it isn't. This should improve robustness and it is
703         easy for pagehide event handlers to do things that would make a Page no
704         longer PageCache-able and this leads to bugs that are difficult to
705         investigate.
706
707         To achieve this, the 'pagehide' event firing logic was moved out of the
708         CachedFrame constructor. It now happens earlier in
709         PageCache::addIfCacheable() after checking if the page is cacheable and
710         before constructing the CachedPage / CachedFrames. After firing the
711         'pagehide' event in PageCache::addIfCacheable(), we check again that
712         the page is still cacheable and we abort early if it is not.
713
714         * history/CachedFrame.cpp:
715         (WebCore::CachedFrame::CachedFrame):
716         * history/PageCache.cpp:
717         (WebCore::setInPageCache):
718         (WebCore::firePageHideEventRecursively):
719         (WebCore::PageCache::addIfCacheable):
720         * history/PageCache.h:
721         * loader/FrameLoader.cpp:
722         (WebCore::FrameLoader::commitProvisionalLoad):
723
724 2016-01-26  Beth Dakin  <bdakin@apple.com>
725
726         Rubber-stamped by Tim Horton.
727
728         Add one more bit of SPI.
729         * platform/spi/mac/NSSpellCheckerSPI.h:
730
731 2016-01-26  Olivier Blin  <olivier.blin@softathome.com>
732
733         Fix build with ENABLE_DEVICE_ORIENTATION on non-iOS platforms
734         https://bugs.webkit.org/show_bug.cgi?id=153490
735
736         Reviewed by Michael Catanzaro.
737
738         This has been broken since r178702, which changed the Page
739         argument from a pointer to a reference in logCanCachePageDecision().
740
741         No new tests since this is a build fix.
742
743         * history/PageCache.cpp:
744         (WebCore::canCachePage):
745
746 2016-01-25  Ada Chan  <adachan@apple.com>
747
748         Move WebVideoFullscreenManager and related classes from iOS specific folders to cocoa folders
749         https://bugs.webkit.org/show_bug.cgi?id=153473
750
751         Reviewed by Eric Carlson.
752
753         No new tests, just moving files.
754
755         * WebCore.xcodeproj/project.pbxproj:
756         Update due to changes to the file locations.
757         * platform/cocoa/WebVideoFullscreenModel.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModel.h.
758         * platform/cocoa/WebVideoFullscreenModelVideoElement.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.h.
759         (WebCore::WebVideoFullscreenModelVideoElement::create):
760         Fix a style error by moving the opening curly brace down one line.
761         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenModelVideoElement.mm.
762
763 2016-01-26  Konstantin Tokarev  <annulen@yandex.ru>
764
765         Do not convert GlyphBufferAdvance to FloatSize
766         https://bugs.webkit.org/show_bug.cgi?id=153429
767
768         GlyphBufferAdvance is not necessaryly convertible to FloatSize.
769         Also, this code was doing extra work by transforming height value.
770
771         Reviewed by Antti Koivisto.
772
773         No new tests needed.
774
775         * rendering/svg/SVGTextRunRenderingContext.cpp:
776         (WebCore::SVGGlyphToPathTranslator::extents):
777
778 2016-01-22  Ada Chan  <adachan@apple.com>
779
780         Enable API related to the video fullscreen layer in MediaPlayerPrivateAVFoundationObjC
781         also on Mac with video presentation mode support.
782         https://bugs.webkit.org/show_bug.cgi?id=153222
783
784         Reviewed by Eric Carlson.
785
786         No new tests. Covered by existing tests.
787
788         Introduce VideoFullscreenLayerManager to deal with the video layer when switching
789         between inline and fullscreen mode. We'll reuse it in other MediaPlayerPrivateInterface
790         implementations.
791
792         Now that MediaPlayerPrivateAVFoundationObjC's platform layer can be a WebVideoContainerLayer,
793         this exposes a bug in PlatformCALayerCocoa::clone() where we assumed the platform layer
794         is always an AVPlayerLayer if the PlatformCALayer's layer type is LayerTypeAVPlayerLayer.
795         Add a helper method to get an AVPlayerLayer from a PlatformCALayerCocoa (which also handles
796         WebVideoContainerLayer case) and use it in PlatformCALayerCocoa::clone().
797
798         * WebCore.xcodeproj/project.pbxproj:
799         Add VideoFullscreenLayerManager to the project.
800
801         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
802         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
803         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
804         Create m_videoFullscreenLayerManager. The video inline layer, video fullscreen layer,
805         and the video fullscreen frame are now managed by that class.
806         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
807         Just call VideoFullscreenLayerManager::setVideoLayer() to handle adding the video
808         layer in either the inline or fullscreen layer.
809         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer):
810         Call VideoFullscreenLayerManager::didDestroyVideoLayer().
811         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformLayer):
812         Get the video inline layer from VideoFullscreenLayerManager.
813         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
814         Call VideoFullscreenLayerManager::setVideoFullscreenLayer().
815         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
816         Call VideoFullscreenLayerManager::setVideoFullscreenFrame().
817         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
818         Guard the iOS specific code properly.
819         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
820         Get the video fullscreen layer from VideoFullscreenLayerManager.
821         (WebCore::MediaPlayerPrivateAVFoundationObjC::requiresTextTrackRepresentation):
822         Ditto.
823         (WebCore::MediaPlayerPrivateAVFoundationObjC::syncTextTrackBounds):
824         Get the video fullscreen layer and video fullscreen frame from VideoFullscreenLayerManager.
825         (WebCore::MediaPlayerPrivateAVFoundationObjC::setTextTrackRepresentation):
826         Get the video fullscreen layer from VideoFullscreenLayerManager.
827
828         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.h: Added.
829         (WebCore::VideoFullscreenLayerManager::videoInlineLayer):
830         (WebCore::VideoFullscreenLayerManager::videoFullscreenLayer):
831         (WebCore::VideoFullscreenLayerManager::videoFullscreenFrame):
832         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm: Added.
833         (-[WebVideoContainerLayer setBounds:]):
834         (-[WebVideoContainerLayer setPosition:]):
835         WebVideoContainerLayer was moved from MediaPlayerPrivateAVFoundationObjC.mm.
836         (WebCore::VideoFullscreenLayerManager::create):
837         (WebCore::VideoFullscreenLayerManager::VideoFullscreenLayerManager):
838         (WebCore::VideoFullscreenLayerManager::setVideoLayer):
839         Code moved from MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer().
840         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
841         Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer().
842         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenFrame):
843         Code moved from MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame().
844         (WebCore::VideoFullscreenLayerManager::didDestroyVideoLayer):
845         Code moved from MediaPlayerPrivateAVFoundationObjC::destroyVideoLayer().
846
847         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
848         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
849         (PlatformCALayerCocoa::clone):
850         Use the new PlatformCALayerCocoa::avPlayerLayer() method to get the AVPlayerLayer from both the
851         destination and source PlatformCALayers.
852         (PlatformCALayerCocoa::avPlayerLayer):
853         Return nil if the layer type is not LayerTypeAVPlayerLayer. Otherwise, return the
854         platform layer if it is indeed an AVPlayerLayer. If not, it should be a WebVideoContainerLayer
855         and we should return its sublayer which should be an AVPlayerLayer.
856
857 2016-01-26  Chris Dumez  <cdumez@apple.com>
858
859         First parameter to window.showModalDialog() should be mandatory
860         https://bugs.webkit.org/show_bug.cgi?id=153436
861
862         Reviewed by Youenn Fablet.
863
864         Make window.showModalDialog()'s first parameter mandatory to match the
865         last specification containing it:
866         http://dev.w3.org/html5/spec-preview/user-prompts.html#dialogs-implemented-using-separate-documents
867
868         The new behavior also matches Firefox, while Chrome no longer supports
869         this operation.
870
871         With this change, the W3C HTML test suite no longer hangs in the middle
872         because it mistakenly pops up a modal dialog during testing.
873
874         Test: fast/dom/Window/showModalDialog-mandatory-parameter.html
875
876         * bindings/js/JSDOMWindowCustom.cpp:
877         (WebCore::JSDOMWindow::showModalDialog):
878
879 2016-01-26  Eric Carlson  <eric.carlson@apple.com>
880
881         LayoutTest media/airplay-target-availability.html is flaky
882         https://bugs.webkit.org/show_bug.cgi?id=153100
883         <rdar://problem/24346796>
884
885         Reviewed by Daniel Bates.
886
887         No new tests, media/airplay-target-availability.html was updated
888
889         * Modules/mediasession/WebMediaSessionManager.cpp:
890         (WebCore::WebMediaSessionManager::clientStateDidChange): Schedule a configuration scan if
891           any of the config flags have changed.
892         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): Update logging.
893
894 2016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
895
896         Main frame scrollbars not updated on hovering when using overlay scrollbars
897         https://bugs.webkit.org/show_bug.cgi?id=153304
898
899         Reviewed by Michael Catanzaro.
900
901         Legacy scrollbars were fixed in r194155, but overlay scrollbars
902         are not notified when they are hovered. This is because the layer
903         hit test in RenderView::hitTest always returns true when using
904         overlay scrollbars and we are returning early in such case,
905         ignoring the HitTestRequest::AllowFrameScrollbars flag. So, in
906         case of using overlay scrollbars we still need to check the
907         RenderView scrollbars even when the layer hit test succeeded.
908
909         * rendering/RenderView.cpp:
910         (WebCore::RenderView::hitTest):
911
912 2016-01-26  Daniel Bates  <dabates@apple.com>
913
914         LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
915         https://bugs.webkit.org/show_bug.cgi?id=153250
916         <rdar://problem/12172843>
917         And
918         <rdar://problem/24248040>
919
920         Reviewed by Alexey Proskuryakov.
921
922         Remove an incorrect assertion that the absolute URL associated with a protection space cannot
923         contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
924         This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
925         with the invariants for WebCore::protectionSpaceMapKeyFromURL().
926
927         Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
928                http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html
929
930         * platform/network/CredentialStorage.cpp:
931         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
932
933 2016-01-26  Daniel Bates  <dabates@apple.com>
934
935         Remove XMLHttpRequestException
936         https://bugs.webkit.org/show_bug.cgi?id=102698
937         <rdar://problem/24338476>
938
939         Reviewed by Chris Dumez.
940
941         Inspired by a patch by Erik Arvidsson.
942
943         As per <https://xhr.spec.whatwg.org> (21 January 2016) and <https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts> (25 January 2016)
944         XMLHttpRequest and WorkerGlobalScope.importScripts() should throw a DOMException object instead
945         of a XMLHttpRequestException object when a NetworkError, AbortError, or TimeoutError occur. This
946         makes the behavior of WebKit more closely conform to these standards as well as the behavior of
947         other browsers.
948
949         * CMakeLists.txt: Remove entries for XMLHttpRequestException.idl and XMLHttpRequestException.cpp.
950         * DerivedSources.make: Remove entry for XMLHttpRequestException.idl.
951         * WebCore.order: Remove exported symbols for XMLHttpRequestException.
952         * WebCore.vcxproj/WebCore.vcxproj: Remove entries for JSXMLHttpRequestException.{cpp, h}, XMLHttpRequestException.{cpp, h}
953         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
954         * WebCore.xcodeproj/project.pbxproj: Ditto.
955         * bindings/js/JSExceptionBase.cpp:
956         (WebCore::toExceptionBase): Remove logic for XMLHttpRequestException.
957         * dom/DOMExceptions.in: Remove entry for XMLHttpRequestException.
958         * workers/WorkerGlobalScope.cpp:
959         (WebCore::WorkerGlobalScope::importScripts): Throw DOMException.NETWORK_ERR instead of XMLHttpRequestException.NETWORK_ERR.
960         * xml/XMLHttpRequest.cpp:
961         (WebCore::XMLHttpRequest::createRequest): Ditto.
962         (WebCore::XMLHttpRequest::didFail): Throw DOMException.ABORT_ERR instead of XMLHttpRequestException.ABORT_ERR.
963         (WebCore::XMLHttpRequest::didReachTimeout): Throw DOMException.TIMEOUT_ERR instead of XMLHttpRequestException.TIMEOUT_ERR.
964         * xml/XMLHttpRequestException.cpp: Removed.
965         * xml/XMLHttpRequestException.h: Removed.
966         * xml/XMLHttpRequestException.idl: Removed.
967
968 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
969
970         WebCoreJSBuiltins do not use to do conditional include
971         https://bugs.webkit.org/show_bug.cgi?id=153306
972
973         Reviewed by Alex Christensen.
974
975         Removing compilation guards as builtin generator adds them in the files themselves.
976         Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.
977
978         No change in behavior.
979
980         * Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
981         * Modules/mediastream/NavigatorUserMedia.js: Making it @conditional.
982         * bindings/js/WebCoreJSBuiltins.cpp:
983         * bindings/js/WebCoreJSBuiltins.h:
984
985 2016-01-25  Alex Christensen  <achristensen@webkit.org>
986
987         Fix internal Windows build
988         https://bugs.webkit.org/show_bug.cgi?id=153469
989
990         Reviewed by Brent Fulgham.
991
992         * CMakeLists.txt:
993         Pass the GPERF_EXECUTABLE that we found to perl scripts so they can use it instead of just calling gperf.
994         This is needed for builds where gperf is not in the PATH.
995         * DerivedSources.make:
996         Pass "gperf" as the gperf command to retain existing functionality on mac.
997         * bindings/scripts/preprocess-idls.pl:
998         (CygwinPathIfNeeded):
999         * bindings/scripts/preprocessor.pm:
1000         (applyPreprocessor):
1001         Add /cygdrive/c/cygwin/bin to the PATH before calling cygpath.
1002         This is needed for builds where we are using cygwin, but C:/cygwin/bin is not in the PATH.
1003         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1004         * css/makeSelectorPseudoElementsMap.py:
1005         * css/makeprop.pl:
1006         * platform/network/create-http-header-name-table:
1007         Use the gperf executable passed in as a command line parameter if it is given.
1008
1009 2016-01-25  Simon Fraser  <simon.fraser@apple.com>
1010
1011         DisplayList items can log paths now
1012         https://bugs.webkit.org/show_bug.cgi?id=153417
1013
1014         Reviewed by Zalan Bujtas.
1015
1016         Now that Path supports TextStream logging, clean up its output a little and
1017         enable dumping of Paths in DisplayListItems.
1018
1019         * platform/graphics/Path.cpp:
1020         (WebCore::operator<<):
1021         * platform/graphics/displaylists/DisplayListItems.cpp:
1022         (WebCore::DisplayList::operator<<):
1023
1024 2016-01-25  Antti Koivisto  <antti@apple.com>
1025
1026         Fix the comment.
1027
1028         * rendering/style/RenderStyle.h:
1029
1030 2016-01-25  Enrica Casucci  <enrica@apple.com>
1031
1032         Add support for DataDetectors in WK (iOS).
1033         https://bugs.webkit.org/show_bug.cgi?id=152989
1034         rdar://problem/22855960
1035
1036         Reviewed by Tim Horton.
1037
1038         Adding new helper functions for data detection related tasks.
1039         The patch also fixes a bug when creating DOM ranges from DDQueryRange
1040         spanning multiple fragments.
1041
1042         * editing/cocoa/DataDetection.h:
1043         * editing/cocoa/DataDetection.mm:
1044         (WebCore::DataDetection::isDataDetectorLink):
1045         (WebCore::DataDetection::dataDetectorIdentifier):
1046         (WebCore::detectItemAtPositionWithRange):
1047         (WebCore::DataDetection::detectItemAroundHitTestResult):
1048         (WebCore::resultIsURL):
1049         (WebCore::removeResultLinksFromAnchor):
1050         (WebCore::searchForLinkRemovingExistingDDLinks):
1051         (WebCore::DataDetection::detectContentInRange):
1052
1053 2016-01-25  Myles C. Maxfield  <mmaxfield@apple.com>
1054
1055         Remove broken cache from CSSFontFaceSource
1056         https://bugs.webkit.org/show_bug.cgi?id=153440
1057
1058         Reviewed by Simon Fraser.
1059
1060         This cache has been broken since 2013 (r158085). Given we didn't notice a perf
1061         hit when it broke, and the fact it's been broken for years, it clearly isn't
1062         necessary.
1063
1064         https://bugs.webkit.org/show_bug.cgi?id=153414 consists of a fairly invasive
1065         change to CSSFontFaceSource; this patch includes a working version of this
1066         cache, along with an easy way to enable/disable it (to measure possible perf
1067         changes).
1068
1069         This patch is a short-term cleanup patch in the mean time until the above
1070         invasive change gets landed.
1071
1072         No new tests because there is no behavior (or performance!) change.
1073
1074         * css/CSSFontFaceSource.cpp:
1075         (WebCore::CSSFontFaceSource::font):
1076         (WebCore::CSSFontFaceSource::~CSSFontFaceSource): Deleted.
1077         (WebCore::CSSFontFaceSource::pruneTable): Deleted.
1078         (WebCore::CSSFontFaceSource::fontLoaded): Deleted.
1079         * css/CSSFontFaceSource.h:
1080
1081 2016-01-25  Sam Weinig  <sam@webkit.org>
1082
1083         Try to fix the simulator build.
1084
1085         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1086
1087 2016-01-25  Sam Weinig  <sam@webkit.org>
1088
1089         Roll back in r195559 with a build fix.
1090
1091         * WebCore.xcodeproj/project.pbxproj:
1092         * editing/cocoa/DataDetection.mm:
1093         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
1094         * platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
1095         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1096
1097 2016-01-25  Commit Queue  <commit-queue@webkit.org>
1098
1099         Unreviewed, rolling out r195559.
1100         https://bugs.webkit.org/show_bug.cgi?id=153458
1101
1102         This change broke the iOS build (Requested by ryanhaddad on
1103         #webkit).
1104
1105         Reverted changeset:
1106
1107         "Fix the ASAN build."
1108         http://trac.webkit.org/changeset/195559
1109
1110 2016-01-25  Antti Koivisto  <antti@apple.com>
1111
1112         Resolving direction and writing mode properties should not mutate document
1113         https://bugs.webkit.org/show_bug.cgi?id=153446
1114
1115         Reviewed by Andreas Kling.
1116
1117         Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.
1118
1119         * css/StyleBuilderCustom.h:
1120         (WebCore::StyleBuilderCustom::applyValueDirection):
1121         (WebCore::StyleBuilderCustom::resetEffectiveZoom):
1122         (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode):
1123         (WebCore::StyleBuilderCustom::applyValueWebkitTextOrientation):
1124         * css/StyleResolver.cpp:
1125         (WebCore::StyleResolver::styleForElement):
1126         * dom/Document.cpp:
1127         (WebCore::Document::Document):
1128         * dom/Document.h:
1129         (WebCore::Document::markers):
1130         (WebCore::Document::directionSetOnDocumentElement): Deleted.
1131         (WebCore::Document::writingModeSetOnDocumentElement): Deleted.
1132         (WebCore::Document::setDirectionSetOnDocumentElement): Deleted.
1133         (WebCore::Document::setWritingModeSetOnDocumentElement): Deleted.
1134         * rendering/RenderBox.cpp:
1135         (WebCore::RenderBox::styleDidChange):
1136         * rendering/style/RenderStyle.h:
1137         * style/StyleResolveForDocument.cpp:
1138         (WebCore::Style::resolveForDocument):
1139
1140 2016-01-25  Sam Weinig  <sam@webkit.org>
1141
1142         Fix the ASAN build.
1143
1144         * WebCore.xcodeproj/project.pbxproj:
1145         * editing/cocoa/DataDetection.mm:
1146         * platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
1147         * platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
1148         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1149
1150 2016-01-25  Alex Christensen  <achristensen@webkit.org>
1151
1152         [Win] Another build fix after r195545
1153
1154         * CMakeLists.txt:
1155         r195548 didn't change all the pre-builds back to post-builds.
1156
1157 2016-01-25  Alex Christensen  <achristensen@webkit.org>
1158
1159         [Win] Fix clean build after r195545.
1160
1161         * CMakeLists.txt:
1162         * PlatformWin.cmake:
1163         I got a little carried away.  WebCore already had a pre-build event.  It was correct before r195545.
1164
1165 2016-01-25  Beth Dakin  <bdakin@apple.com>
1166
1167         Handle soft spaces after accepted candidates
1168         https://bugs.webkit.org/show_bug.cgi?id=153331
1169         -and corresponding-
1170         rdar://problem/23958418
1171
1172         Reviewed by Darin Adler.
1173
1174         Candidates now come with built-in spaces, so we should not insert a space for 
1175         them.
1176         * editing/Editor.cpp:
1177         (WebCore::Editor::handleAcceptedCandidate):
1178
1179         New SPI to properly handle these soft spaces.
1180         * platform/spi/mac/NSSpellCheckerSPI.h:
1181
1182 2016-01-25  Alex Christensen  <achristensen@webkit.org>
1183
1184         [Win] Copy forwarding headers before building a project
1185         https://bugs.webkit.org/show_bug.cgi?id=153434
1186
1187         Reviewed by Brent Fulgham.
1188
1189         * CMakeLists.txt:
1190         * PlatformWin.cmake:
1191
1192 2016-01-25  Brady Eidson  <beidson@apple.com>
1193
1194         Modern IDB: Implement getIndexRecord in the SQLite backing store.
1195         https://bugs.webkit.org/show_bug.cgi?id=153425
1196
1197         Reviewed by Darin Adler.
1198
1199         No new tests (Some failures now pass, other failures progressed closer to passing).
1200
1201         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1202         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1203
1204 2016-01-25  Eric Carlson  <eric.carlson@apple.com>
1205
1206         Media "ended" event incorrectly fires when currentTime is set
1207         https://bugs.webkit.org/show_bug.cgi?id=150348
1208         <rdar://problem/24247974>
1209
1210         Reviewed by Jer Noble.
1211
1212         Test: media/media-ended-fired-once.html
1213
1214         * html/HTMLMediaElement.cpp:
1215         (WebCore::HTMLMediaElement::invalidateCachedTime): Always mark m_cachedTime as invalid.
1216
1217 2016-01-25  Konstantin Tokarev  <annulen@yandex.ru>
1218
1219         Do not convert GlyphBufferAdvance to FloatSize
1220         https://bugs.webkit.org/show_bug.cgi?id=153421
1221
1222         Reviewed by Simon Fraser.
1223
1224         No new tests needed.
1225
1226         * platform/graphics/displaylists/DisplayListItems.cpp:
1227         (WebCore::DisplayList::DrawGlyphs::computeBounds):
1228
1229 2016-01-22  Ryosuke Niwa  <rniwa@webkit.org>
1230
1231         document.createElement should be able to create a custom element
1232         https://bugs.webkit.org/show_bug.cgi?id=153173
1233
1234         Reviewed by Darin Adler.
1235
1236         Added the support for constructing a custom element via document.createElement.
1237
1238         Extracted HTMLElementFactory::createKnownElement, which returns nullptr when the specified name doesn't match
1239         any builtin element instead of out of HTMLUnknownElement, out of HTMLElementFactory::createElement.
1240
1241         Test: fast/custom-elements/Document-createElement.html
1242
1243         * bindings/js/JSCustomElementInterface.cpp:
1244         (WebCore::JSCustomElementInterface::constructHTMLElement): Added. Constructs a custom element by invoking its
1245         constructor. We allow exceptions to be thrown by the constructor so the caller is responsible for checking
1246         any exceptions in the ExecState before preceeding if the returned value is null.
1247
1248         * bindings/js/JSCustomElementInterface.h:
1249         (WebCore::JSCustomElementInterface::constructSVGElement): Added.
1250         * bindings/js/JSElementCustom.cpp:
1251         (WebCore::toJSNewlyCreated): Exit early if the element is a custom element as the wrapper had already been
1252         created by super() call inside the custom element'c constructor.
1253
1254         * bindings/js/JSMainThreadExecState.h:
1255         (WebCore::JSMainThreadExecState):
1256         * bindings/js/JSMainThreadExecStateInstrumentation.h:
1257         (WebCore::JSMainThreadExecState::instrumentFunctionInternal): Generalized from instrumentFunctionCall so that
1258         we can use it for both call and construct.
1259         (WebCore::JSMainThreadExecState::instrumentFunctionCall): Specialized the above function for call.
1260         (WebCore::JSMainThreadExecState::instrumentFunctionConstruct): Ditto for construct.
1261
1262         * dom/CustomElementDefinitions.cpp:
1263         (WebCore::CustomElementDefinitions::findInterface): Added.
1264         * dom/CustomElementDefinitions.h:
1265
1266         * dom/Document.cpp:
1267         (WebCore::createHTMLElementWithNameValidation): Extracted from createElement.
1268         (WebCore::Document::createElementForBindings): Renamed from createElement. Specifies
1269         ShouldCreateCustomElement::Create to create a custom element before using fallback elements.
1270         * dom/Document.h:
1271         * dom/Document.idl:
1272
1273         * dom/Node.h:
1274         (WebCore::Node::isCustomElement): Added. This flag is used to identify a custom element.
1275         (WebCore::Node::setIsCustomElement): Added.
1276
1277         * dom/make_names.pl: Extracted createKnownElement from createElement for createHTMLElementWithNameValidation.
1278
1279         * inspector/InspectorCSSAgent.cpp:
1280         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Use qualified name object to instantiate
1281         a style element and set type content attribute.
1282         * inspector/InspectorDOMAgent.cpp:
1283         (WebCore::InspectorDOMAgent::setNodeName): Use createElementForBindings here since we might be creating an
1284         arbitrary element here. Also use RefPtr instead of raw pointers while mutating DOM for safety.
1285
1286 2016-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1287
1288         REGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773
1289         https://bugs.webkit.org/show_bug.cgi?id=153194
1290
1291         Reviewed by Michael Catanzaro.
1292
1293         In r192773 we implemented the JavaScriptCore garbage collector
1294         timers for the GTK+ port. Those timers schedule sources in the
1295         current thread default main context, but JS web worker threads
1296         implementation doesn't use WTF::RunLoop, but its own WorkerRunLoop
1297         class that doesn't create a GMainContext for the new thread. This
1298         means that for web sites using workers, we are now doing garbage
1299         collection of worker VMs in the main thread which ends up in a
1300         deadlock at some point. We need to ensure that worker threads
1301         create a GMainContext and push it as the default one for the
1302         thread before the WorkerGlobalScope is created. This way when the
1303         worker Heap is created, the GC timers use the right context to
1304         schedule their sources. And then we need to check if there are
1305         sources pending in the thread main context on every worker run
1306         loop iteration.
1307
1308         * workers/WorkerRunLoop.cpp:
1309         (WebCore::WorkerRunLoop::runInMode):
1310         * workers/WorkerThread.cpp:
1311         (WebCore::WorkerThread::workerThread):
1312
1313 2016-01-25  Commit Queue  <commit-queue@webkit.org>
1314
1315         Unreviewed, rolling out r195533.
1316         https://bugs.webkit.org/show_bug.cgi?id=153423
1317
1318         It is again breaking builds of several ports (Requested by
1319         youenn on #webkit).
1320
1321         Reverted changeset:
1322
1323         "WebCoreJSBuiltins do not use to do conditional include"
1324         https://bugs.webkit.org/show_bug.cgi?id=153306
1325         http://trac.webkit.org/changeset/195533
1326
1327 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1328
1329         WebCoreJSBuiltins do not use to do conditional include
1330         https://bugs.webkit.org/show_bug.cgi?id=153306
1331
1332         Reviewed by Alex Christensen.
1333
1334         Removing compilation guards as builtin generator adds them in the files themselves.
1335         Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.
1336
1337         No change in behavior.
1338
1339         * Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
1340         * bindings/js/WebCoreJSBuiltins.cpp:
1341         * bindings/js/WebCoreJSBuiltins.h:
1342
1343 2016-01-25  Commit Queue  <commit-queue@webkit.org>
1344
1345         Unreviewed, rolling out r195531.
1346         https://bugs.webkit.org/show_bug.cgi?id=153420
1347
1348         It is breaking builds of several ports (Requested by youenn on
1349         #webkit).
1350
1351         Reverted changeset:
1352
1353         "WebCoreJSBuiltins do not use to do conditional include"
1354         https://bugs.webkit.org/show_bug.cgi?id=153306
1355         http://trac.webkit.org/changeset/195531
1356
1357 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1358
1359         WebCoreJSBuiltins do not use to do conditional include
1360         https://bugs.webkit.org/show_bug.cgi?id=153306
1361
1362         Reviewed by Alex Christensen.
1363
1364         Removing compilation guards as builtin generator adds them in the files themselves.
1365
1366         No change in behavior.
1367
1368         * bindings/js/WebCoreJSBuiltins.cpp:
1369         * bindings/js/WebCoreJSBuiltins.h:
1370
1371 2016-01-25  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1372
1373         [Fetch API] Implement Fetch API Headers
1374         https://bugs.webkit.org/show_bug.cgi?id=152384
1375
1376         Reviewed by Darin Adler.
1377
1378         Adding Fetch Headers API as a wapper around HTTPHeaderMap.
1379
1380         Tests: imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html
1381                imported/w3c/web-platform-tests/fetch/api/headers/headers-casing.html
1382                imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html
1383                imported/w3c/web-platform-tests/fetch/api/headers/headers-idl.html
1384                imported/w3c/web-platform-tests/fetch/api/headers/headers-nameshake.html
1385                imported/w3c/web-platform-tests/fetch/api/headers/headers-normalize.html
1386                imported/w3c/web-platform-tests/fetch/api/headers/headers-structure.html
1387
1388         * CMakeLists.txt:
1389         * DerivedSources.cpp:
1390         * DerivedSources.make:
1391         * Modules/fetch/FetchHeaders.cpp: Added.
1392         (WebCore::FetchHeaders::initializeWith):
1393         (WebCore::isForbiddenHeaderName):
1394         (WebCore::isForbiddenResponseHeaderName):
1395         (WebCore::isSimpleHeader):
1396         (WebCore::canWriteHeader):
1397         (WebCore::FetchHeaders::append):
1398         (WebCore::FetchHeaders::remove):
1399         (WebCore::FetchHeaders::get):
1400         (WebCore::FetchHeaders::has):
1401         (WebCore::FetchHeaders::set):
1402         * Modules/fetch/FetchHeaders.h: Added.
1403         (WebCore::FetchHeaders::create):
1404         (WebCore::FetchHeaders::~FetchHeaders):
1405         (WebCore::FetchHeaders::internalHeaders):
1406         (WebCore::FetchHeaders::FetchHeaders):
1407         * Modules/fetch/FetchHeaders.idl: Added.
1408         * Modules/fetch/FetchHeaders.js: Added.
1409         (initializeFetchHeaders):
1410         * WebCore.xcodeproj/project.pbxproj:
1411         * bindings/js/WebCoreBuiltinNames.h:
1412         * bindings/js/WebCoreJSBuiltins.cpp:
1413         * bindings/js/WebCoreJSBuiltins.h:
1414         (WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
1415         (WebCore::JSBuiltinFunctions::fetchHeadersBuiltins):
1416         * platform/network/HTTPHeaderMap.cpp:
1417         (WebCore::HTTPHeaderMap::contains):
1418         (WebCore::HTTPHeaderMap::remove):
1419         * platform/network/HTTPHeaderMap.h:
1420
1421 2016-01-22  Sergio Villar Senin  <svillar@igalia.com>
1422
1423         [css-grid] grid shorthand must reset gap properties to their initial values
1424         https://bugs.webkit.org/show_bug.cgi?id=153354
1425
1426         Reviewed by Darin Adler.
1427
1428         Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
1429         'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
1430         their values, it must in any case reset them to the initial ones.
1431
1432         * css/CSSParser.cpp:
1433         (WebCore::CSSParser::parseGridShorthand):
1434         * css/CSSPropertyNames.in:
1435
1436 2016-01-24  Brady Eidson  <beidson@apple.com>
1437
1438         Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
1439         https://bugs.webkit.org/show_bug.cgi?id=153415
1440
1441         Reviewed by Darin Adler.
1442
1443         No new tests (Handful of tests now pass, improvements on a handful of others).
1444
1445         * Modules/indexeddb/server/IDBBackingStore.h:
1446         
1447         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
1448         (WebCore::IDBServer::MemoryIDBBackingStore::deleteIndex):
1449         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1450         
1451         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1452         (WebCore::IDBServer::MemoryObjectStore::takeIndexByIdentifier):
1453         (WebCore::IDBServer::MemoryObjectStore::deleteIndex):
1454         (WebCore::IDBServer::MemoryObjectStore::deleteAllIndexes):
1455         (WebCore::IDBServer::MemoryObjectStore::takeIndexByName): Deleted.
1456         * Modules/indexeddb/server/MemoryObjectStore.h:
1457         
1458         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1459         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1460         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
1461         (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
1462         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1463         
1464         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1465         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
1466         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1467         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1468         
1469         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1470         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
1471         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
1472         
1473         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1474         (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
1475         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
1476         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
1477         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1478         
1479         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
1480         (WebCore::IDBObjectStoreInfo::deleteIndex):
1481         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
1482
1483 2016-01-24  Brady Eidson  <beidson@apple.com>
1484
1485         Unreviewed, speculative fix for:
1486         Modern IDB: Some IDB tests crash in ~SQLiteIDBBackingStore
1487         https://bugs.webkit.org/show_bug.cgi?id=153418
1488
1489         No new tests.
1490
1491         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1492         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore): Clear the global object
1493           before wiping out the VM.
1494
1495 2016-01-24  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1496
1497         Reduce PassRefPtr uses in dom - 4
1498         https://bugs.webkit.org/show_bug.cgi?id=153270
1499
1500         Reviewed by Darin Adler.
1501
1502         As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
1503
1504         * bindings/js/JSDeviceMotionEventCustom.cpp:
1505         (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
1506         * dom/DeviceMotionData.cpp:
1507         (WebCore::DeviceMotionData::create):
1508         (WebCore::DeviceMotionData::DeviceMotionData):
1509         * dom/DeviceMotionData.h:
1510         * dom/Document.cpp:
1511         (WebCore::Document::setBodyOrFrameset):
1512         (WebCore::Document::setFocusedElement):
1513         (WebCore::Document::setDecoder):
1514         (WebCore::Document::pushCurrentScript):
1515         * dom/Document.h:
1516         * dom/Event.cpp:
1517         (WebCore::Event::cloneFor):
1518         * dom/Event.h:
1519         * dom/MouseEvent.cpp:
1520         (WebCore::MouseEvent::cloneFor):
1521         * dom/MouseEvent.h:
1522         * dom/NodeIterator.cpp:
1523         (WebCore::NodeIterator::NodePointer::NodePointer):
1524         (WebCore::NodeIterator::NodeIterator):
1525         * dom/NodeIterator.h:
1526         (WebCore::NodeIterator::create):
1527         * html/RadioInputType.cpp:
1528         (WebCore::RadioInputType::handleKeydownEvent):
1529         * platform/ios/DeviceMotionClientIOS.mm:
1530         (WebCore::DeviceMotionClientIOS::motionChanged):
1531         * xml/XSLTProcessor.cpp:
1532         (WebCore::XSLTProcessor::createDocumentFromSource):
1533
1534 2016-01-24  Myles C. Maxfield  <mmaxfield@apple.com>
1535
1536         [Font Loading] General cleanup
1537         https://bugs.webkit.org/show_bug.cgi?id=153403
1538
1539         Reviewed by Darin Adler.
1540
1541         It turns out that CSSFontFaceSource::m_hasExternalSVGFont exactly equals
1542         whether or not CSSFontFaceSource::m_font is a CachedSVGFont. Therefore,
1543         the variable is redundant.
1544
1545         In addition, it was being passed to functions on CSSFontFaceSource::m_font,
1546         which means it was always true inside the CachedSVGFont subclass and
1547         always false for the CachedFont. Therefore, there is no reason pass this
1548         variable to these functions because its value can be determined at
1549         authorship time.
1550
1551         No new tests because there is no behavior change.
1552
1553         * css/CSSFontFaceSource.cpp:
1554         (WebCore::CSSFontFaceSource::font):
1555         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
1556         * css/CSSFontFaceSource.h:
1557         * css/CSSFontSelector.cpp:
1558         (WebCore::createFontFace):
1559         * loader/cache/CachedFont.cpp:
1560         (WebCore::CachedFont::ensureCustomFontData):
1561         (WebCore::CachedFont::createFont):
1562         * loader/cache/CachedFont.h:
1563         * loader/cache/CachedSVGFont.cpp:
1564         (WebCore::CachedSVGFont::createFont):
1565         (WebCore::CachedSVGFont::ensureCustomFontData):
1566         * loader/cache/CachedSVGFont.h:
1567         * platform/network/HTTPParsers.cpp:
1568         (WebCore::isValidHTTPToken):
1569         * xml/XMLHttpRequest.cpp:
1570         (WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod):
1571
1572 2016-01-24  Chris Dumez  <cdumez@apple.com>
1573
1574         An XMLDocument interface should be exposed on the global Window object
1575         https://bugs.webkit.org/show_bug.cgi?id=153378
1576         <rdar://problem/24315465>
1577
1578         Reviewed by Darin Adler.
1579
1580         Expose an XMLDocument interface on the global Window object, as per:
1581         - https://dom.spec.whatwg.org/#xmldocument
1582
1583         DOMImplementation.createDocument() now returns an XMLDocument instead
1584         of a Document, as per:
1585         - https://dom.spec.whatwg.org/#dom-domimplementation-createdocument
1586
1587         Previously, WebKit would alias XMLDocument to Document which caused
1588         some W3C tests to fail.
1589
1590         Chrome and Firefox already match the specification here.
1591
1592         No new tests, already covered by existing tests.
1593
1594         * CMakeLists.txt:
1595         * DerivedSources.cpp:
1596         * DerivedSources.make:
1597         * WebCore.vcxproj/WebCore.vcxproj:
1598         * WebCore.vcxproj/WebCore.vcxproj.filters:
1599         * WebCore.xcodeproj/project.pbxproj:
1600         * bindings/js/JSBindingsAllInOne.cpp:
1601         * bindings/js/JSDocumentCustom.cpp:
1602         (WebCore::createNewDocumentWrapper):
1603         * dom/DOMImplementation.cpp:
1604         (WebCore::DOMImplementation::createDocument):
1605         * dom/DOMImplementation.h:
1606         * dom/DOMImplementation.idl:
1607         * dom/Document.cpp:
1608         (WebCore::Document::cloneDocumentWithoutChildren):
1609         * dom/Document.h:
1610         (WebCore::Document::isXMLDocument):
1611         (WebCore::Document::create): Deleted.
1612         (WebCore::Document::createNonRenderedPlaceholder): Deleted.
1613         * dom/XMLDocument.h: Added.
1614         (WebCore::XMLDocument::create):
1615         (WebCore::XMLDocument::createXHTML):
1616         (WebCore::XMLDocument::XMLDocument):
1617         (isType):
1618         * dom/XMLDocument.idl: Added.
1619         * inspector/DOMPatchSupport.cpp:
1620         (WebCore::DOMPatchSupport::patchDocument):
1621         * inspector/InspectorDOMAgent.cpp:
1622         (WebCore::InspectorDOMAgent::setOuterHTML):
1623         * page/DOMWindow.idl:
1624         * page/PageSerializer.cpp:
1625         (WebCore::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
1626         * svg/SVGDocument.cpp:
1627         (WebCore::SVGDocument::SVGDocument):
1628         * svg/SVGDocument.h:
1629         * svg/SVGDocument.idl:
1630         * xml/XMLHttpRequest.cpp:
1631         (WebCore::XMLHttpRequest::responseXML):
1632         * xml/XSLTProcessor.cpp:
1633         (WebCore::XSLTProcessor::createDocumentFromSource):
1634
1635 2016-01-24  Brady Eidson  <beidson@apple.com>
1636
1637         Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store.
1638         https://bugs.webkit.org/show_bug.cgi?id=153410
1639
1640         Reviewed by Darin Adler.
1641
1642         No new tests (Covered by unskipping many existing tests).
1643
1644         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1645         (WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
1646         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1647         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
1648         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1649         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1650
1651         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1652         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreateBackingStoreCursor):
1653         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
1654         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1655
1656         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1657         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenBackingStoreCursor):
1658         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
1659
1660 2016-01-24  Simon Fraser  <simon.fraser@apple.com>
1661
1662         Make the dumped display list representation a bit more compact
1663         https://bugs.webkit.org/show_bug.cgi?id=153409
1664
1665         Reviewed by Zalan Bujtas.
1666
1667         Don't make a group for every display list item.
1668
1669         * platform/graphics/displaylists/DisplayList.cpp:
1670         (WebCore::DisplayList::DisplayList::asText):
1671
1672 2016-01-24  Simon Fraser  <simon.fraser@apple.com>
1673
1674         Add testing for display list replay, and skip clipped-out items on replay
1675         https://bugs.webkit.org/show_bug.cgi?id=153408
1676
1677         Reviewed by Zalan Bujtas.
1678         
1679         Make it possible to save and serialize a DisplayList of Items which were
1680         actually applied on replay, so that replay-time optimizations can be tested.
1681         
1682         This exposes internals.setElementTracksDisplayListReplay() and
1683         internals.replayDisplayListForElement().
1684         
1685         Do a trivial replay-time optimization, which is to skip items whose extents are
1686         outside the replay clip.
1687
1688         Test: displaylists/replay-skip-clipped-rect.html
1689
1690         * platform/graphics/GraphicsLayer.cpp:
1691         (WebCore::GraphicsLayer::GraphicsLayer):
1692         * platform/graphics/GraphicsLayer.h:
1693         (WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
1694         (WebCore::GraphicsLayer::isTrackingDisplayListReplay):
1695         (WebCore::GraphicsLayer::replayDisplayListAsText):
1696         * platform/graphics/ca/GraphicsLayerCA.cpp:
1697         (WebCore::layerDisplayListMap): Use a singleton map to store the replay display lists
1698         to avoid bloating GraphicsLayerCA for test-only code. The map stores a pair of the
1699         replay list and a clip rect, which are both dumped. Dumping the clip rect ensures that
1700         we're reporting the replay for the correct tile in a test (since there will be a replay
1701         for each tile).
1702         (WebCore::GraphicsLayerCA::~GraphicsLayerCA):
1703         (WebCore::GraphicsLayerCA::platformCALayerPaintContents):
1704         (WebCore::GraphicsLayerCA::setIsTrackingDisplayListReplay):
1705         (WebCore::GraphicsLayerCA::replayDisplayListAsText):
1706         * platform/graphics/ca/GraphicsLayerCA.h:
1707         * platform/graphics/displaylists/DisplayList.h:
1708         (WebCore::DisplayList::DisplayList::appendItem):
1709         * platform/graphics/displaylists/DisplayListReplayer.cpp:
1710         (WebCore::DisplayList::Replayer::replay): In the unlikely event of tracking replays,
1711         allocate a new DisplayList and append to it items which actually get applied.
1712         * platform/graphics/displaylists/DisplayListReplayer.h:
1713         * rendering/RenderLayerBacking.cpp:
1714         (WebCore::RenderLayerBacking::setIsTrackingDisplayListReplay):
1715         (WebCore::RenderLayerBacking::replayDisplayListAsText):
1716         * rendering/RenderLayerBacking.h:
1717         * testing/Internals.cpp:
1718         (WebCore::Internals::setElementTracksDisplayListReplay):
1719         (WebCore::Internals::replayDisplayListForElement):
1720         * testing/Internals.h:
1721         * testing/Internals.idl:
1722
1723 2016-01-23  Wonchul Lee  <wonchul.lee@collabora.co.uk>
1724
1725         [GTK] Fix media controls displaying without controls attribute
1726         https://bugs.webkit.org/show_bug.cgi?id=152500
1727
1728         Media controls is not displayed without controls attribute by default
1729         when the video element has text track. It'll be displayed on fullscreen
1730         regardless of controls attribute.
1731
1732         Reviewed by Michael Catanzaro.
1733
1734         * Modules/mediacontrols/mediaControlsGtk.js:
1735         (ControllerGtk.prototype.shouldHaveControls):
1736         (ControllerGtk.prototype.reconnectControls):
1737         (ControllerGtk.prototype.removeControls):
1738         (ControllerGtk.prototype.configureControls): Deleted.
1739 2016-01-23  Alex Christensen  <achristensen@webkit.org>
1740
1741         Use credentials from a URL with NetworkSession like we did with ResourceHandle
1742         https://bugs.webkit.org/show_bug.cgi?id=153328
1743
1744         Reviewed by Alexey Proskuryakov.
1745
1746         This patch fixes at least http/tests/xmlhttprequest/basic-auth-credentials-escaping.html when using NetworkSession.
1747
1748         * platform/network/ProtectionSpaceBase.h:
1749         (WebCore::ProtectionSpaceBase::encodingRequiresPlatformData):
1750         * platform/network/ResourceRequestBase.h:
1751         Add some WEBCORE_EXPORT macros for functions that are now used in WebKit2.
1752
1753 2016-01-23  Brady Eidson  <beidson@apple.com>
1754
1755         Modern IDB: Implement clearing object stores and opening cursors in the SQLite backend.
1756         https://bugs.webkit.org/show_bug.cgi?id=153396
1757
1758         Reviewed by Alex Christensen.
1759
1760         No new tests (Some failing tests now pass, others improved).
1761
1762         Copy more LegacyIDB SQLite backend code over to the new SQLite backend.
1763         
1764         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1765         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
1766         (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
1767         (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
1768
1769 2016-01-22  Commit Queue  <commit-queue@webkit.org>
1770
1771         Unreviewed, rolling out r195493.
1772         https://bugs.webkit.org/show_bug.cgi?id=153397
1773
1774         Broke authenticaiton tests (leaks credentials) (Requested by
1775         ap on #webkit).
1776
1777         Reverted changeset:
1778
1779         "LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-
1780         unterminated.html crashing"
1781         https://bugs.webkit.org/show_bug.cgi?id=153250
1782         http://trac.webkit.org/changeset/195493
1783
1784 2016-01-20  Ryosuke Niwa  <rniwa@webkit.org>
1785
1786         HTMLElement::nodeName should not upper case non-ASCII characters
1787         https://bugs.webkit.org/show_bug.cgi?id=153231
1788
1789         Reviewed by Darin Adler.
1790
1791         Use the newly added convertToASCIIUppercase to generate the string for tagName and nodeName.
1792
1793         Test: fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html
1794
1795         * dom/QualifiedName.cpp:
1796         (WebCore::QualifiedName::localNameUpper): Use convertToASCIIUppercase.
1797         * html/HTMLElement.cpp:
1798         (WebCore::HTMLElement::nodeName): Use convertToASCIIUppercase.
1799
1800 2016-01-22  Brady Eidson  <beidson@apple.com>
1801
1802         Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
1803         https://bugs.webkit.org/show_bug.cgi?id=153381
1804
1805         Reviewed by Alex Christensen.
1806
1807         No new tests (This resolves many of the currently crashing/asserting tests).
1808
1809         Right now we're porting the Legacy IDB SQLite backend to Modern IDB.
1810         
1811         The way the Legacy backend works is restricted to one transaction at a time.
1812         
1813         There's many tricks we can play to resolve this, but that task is better performed
1814         once all of the basic functionality is done.
1815         
1816         Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382
1817
1818         * Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
1819         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1820         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1821         
1822         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1823         (WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
1824         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1825         (WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
1826         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
1827           not support simultaneous transactions but there is a transaction in progress, return.
1828         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1829
1830 2016-01-22  Chris Dumez  <cdumez@apple.com>
1831
1832         document.charset should be an alias for document.characterSet
1833         https://bugs.webkit.org/show_bug.cgi?id=153367
1834
1835         Reviewed by Ryosuke Niwa.
1836
1837         document.charset should be an alias for document.characterSet:
1838         - https://dom.spec.whatwg.org/#dom-document-charset
1839
1840         It should also be read-only.
1841
1842         Chrome matches the specification.
1843
1844         No new tests, already covered by existing tests.
1845
1846         * dom/Document.h:
1847         * dom/Document.idl:
1848
1849 2016-01-22  Chris Dumez  <cdumez@apple.com>
1850
1851         Document.open / Document.write should be prevented while the document is being unloaded
1852         https://bugs.webkit.org/show_bug.cgi?id=153255
1853         <rdar://problem/22741293>
1854
1855         Reviewed by Ryosuke Niwa.
1856
1857         Document.open / Document.write should be prevented while the document
1858         is being unloaded, as per the HTML specification:
1859         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
1860         - https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
1861
1862         This patch is aligning our behavior with the specification and Firefox.
1863         Calling Document.open / Document.write during the document was being
1864         unloaded would cause us to crash as this was unexpected.
1865
1866         Tests: fast/frames/page-hide-document-open.html
1867                fast/frames/page-unload-document-open.html
1868
1869         * WebCore.xcodeproj/project.pbxproj:
1870         Add new IgnoreOpensDuringUnloadCountIncrementer.h header.
1871
1872         * dom/Document.cpp:
1873         (WebCore::Document::open):
1874         Abort if the document's ignore-opens-during-unload counter is greater
1875         than zero, as per:
1876         https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
1877
1878         (WebCore::Document::write):
1879         Abort if the insertion point is undefined and the document's
1880         ignore-opens-during-unload counter is greater than zero, as per:
1881         https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)
1882
1883         * dom/Document.h:
1884         Add data member to maintain the document's ignore-opens-during-unload counter:
1885         https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter
1886
1887         * dom/IgnoreOpensDuringUnloadCountIncrementer.h: Added.
1888         Add utility class to increment / decrement a document's
1889         ignore-opens-during-unload counter.
1890
1891         * history/CachedFrame.cpp:
1892         (WebCore::CachedFrame::CachedFrame):
1893         When a page goes into PageCache, we don't end up calling
1894         FrameLoader::detachChildren() so we need to increment the document's
1895         ignore-opens-during-unload counter before calling stopLoading() on each
1896         subframe.
1897
1898         * loader/FrameLoader.cpp:
1899         (WebCore::FrameLoader::detachChildren):
1900         detachChildren() will end up firing the pagehide / unload events in each
1901         child frame so we increment the parent frame's document's
1902         ignore-opens-during-unload counter. This behavior matches the text of:
1903         https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document
1904
1905         As per the spec, the document's ignore-opens-during-unload counter should
1906         be incremented before firing the pagehide / unload events at the document's
1907         Window object. It should be decremented only after firing the pagehide /
1908         unload events in each subframe. This is needed in case a subframe tries to
1909         call document.open / document.write on a parent frame's document, from its
1910         pagehide or unload handler.
1911
1912         (WebCore::FrameLoader::dispatchUnloadEvents):
1913         Increment the document's ignore-opens-during-unload counter before firing
1914         the pagehide / unload events and decrement it after. As per the spec, we
1915         are not supposed to decrement this early. We actually supposed to wait
1916         until the pagehide / unload events have been fired in all the subframes.
1917         For this reason, we take care of re-incrementing the document's
1918         ignore-opens-during-unload in detachChildren(), which will take care of
1919         firing the pagehide / unload in the subframes.
1920
1921 2016-01-22  Brady Eidson  <beidson@apple.com>
1922
1923         Modern IDB: Implement put, get, and delete records for the SQLite backend.
1924         https://bugs.webkit.org/show_bug.cgi?id=153375
1925
1926         Reviewed by Alex Christensen.
1927
1928         No new tests (Covered by many existing tests now passing).
1929
1930         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1931         (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
1932         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
1933         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
1934         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1935         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
1936         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1937
1938 2016-01-22  Enrica Casucci  <enrica@apple.com>
1939
1940         Add support for DataDetectors in WK (iOS).
1941         https://bugs.webkit.org/show_bug.cgi?id=152989
1942         rdar://problem/22855960
1943
1944         Reviewed by Tim Horton.
1945
1946         This patch adds the logic to perform data detection and modify
1947         the DOM by adding data detector links as appropriate.
1948         The data detector results returned by detectContentInRange are
1949         stored in the Frame object.
1950
1951         * editing/cocoa/DataDetection.h:
1952         * editing/cocoa/DataDetection.mm:
1953         (WebCore::resultIsURL):
1954         (WebCore::constructURLStringForResult):
1955         (WebCore::removeResultLinksFromAnchor):
1956         (WebCore::searchForLinkRemovingExistingDDLinks):
1957         (WebCore::dataDetectorTypeForCategory):
1958         (WebCore::buildQuery):
1959         (WebCore::DataDetection::detectContentInRange):
1960         * loader/FrameLoader.cpp:
1961         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1962         * page/Frame.h:
1963         (WebCore::Frame::setDataDetectionResults):
1964         (WebCore::Frame::dataDetectionResults):
1965         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
1966         (DDQueryOffsetCompare):
1967
1968 2016-01-22  Daniel Bates  <dabates@apple.com>
1969
1970         LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
1971         https://bugs.webkit.org/show_bug.cgi?id=153250
1972         <rdar://problem/12172843>
1973         And
1974         <rdar://problem/24248040>
1975
1976         Reviewed by Alexey Proskuryakov.
1977
1978         Remove an incorrect assertion that the absolute URL associated with a protection space cannot
1979         contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
1980         This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
1981         with the invariants for WebCore::protectionSpaceMapKeyFromURL().
1982
1983         Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
1984                http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html
1985
1986         * platform/network/CredentialStorage.cpp:
1987         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
1988
1989 2016-01-22  Chris Dumez  <cdumez@apple.com>
1990
1991         DOMImplementation.createHTMLDocument("") should append an empty Text Node to the title Element
1992         https://bugs.webkit.org/show_bug.cgi?id=153374
1993
1994         Reviewed by Ryosuke Niwa.
1995
1996         DOMImplementation.createHTMLDocument("") should append an empty Text
1997         Node to the title Element as per the steps at:
1998         - https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument (step 6)
1999
2000         Firefox and Chrome follow the specification here.
2001
2002         Previously, WebKit would rely on HTMLTitleElement.text setter which
2003         does not create a Text Node if the title is the empty string, as per:
2004         - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
2005         - https://dom.spec.whatwg.org/#dom-node-textcontent
2006
2007         No new tests, already covered by existing test.
2008
2009         * dom/DOMImplementation.cpp:
2010         (WebCore::DOMImplementation::createHTMLDocument):
2011
2012 2016-01-17  Ada Chan  <adachan@apple.com>
2013
2014         Add a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClient::supportsVideoFullscreen().
2015         https://bugs.webkit.org/show_bug.cgi?id=153220
2016
2017         Reviewed by Eric Carlson.
2018
2019         No new tests, just code refactoring.
2020
2021         * Modules/mediacontrols/MediaControlsHost.cpp:
2022         (WebCore::MediaControlsHost::supportsFullscreen):
2023         Just pass in VideoFullscreenModeStandard as this is used for checking the standard fullscreen case.
2024
2025         * html/HTMLMediaElement.cpp:
2026         (WebCore::HTMLMediaElement::enterFullscreen):
2027         Only use the FullScreen API if the mode is VideoFullscreenModeStandard. Call ChromeClient::supportsVideoFullscreen()
2028         with the mode.
2029         (WebCore::HTMLMediaElement::exitFullscreen):
2030         Move the fullscreen element check up so we can use this method to exit picture-in-picture mode.
2031         * html/HTMLMediaElement.h:
2032
2033         * html/HTMLVideoElement.cpp:
2034         (WebCore::HTMLVideoElement::supportsFullscreen):
2035         Ditto.
2036         (WebCore::HTMLVideoElement::webkitEnterFullscreen):
2037         Pass in VideoFullscreenModeStandard to supportsFullscreen() as this is used for the standard fullscreen case.
2038         (WebCore::HTMLVideoElement::webkitSupportsFullscreen):
2039         Ditto.
2040         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
2041         Pass in the correct VideoFullscreenMode to supportsFullscreen() corresponding to the mode string passed in.
2042         (WebCore::HTMLVideoElement::setFullscreenMode):
2043         Pass in the mode to supportsFullscreen().
2044         * html/HTMLVideoElement.h:
2045
2046         * html/MediaController.h:
2047         * html/MediaControllerInterface.h:
2048         Make supportsFullscreen() take a VideoFullscreenMode.
2049
2050         * html/shadow/MediaControls.cpp:
2051         (WebCore::MediaControls::reset):
2052         Pass in VideoFullscreenModeStandard to supportsFullscreen() here since this is used for the standard
2053         fullscreen button.
2054         * html/shadow/MediaControlsApple.cpp:
2055         (WebCore::MediaControlsApple::reset):
2056         Ditto.
2057
2058         * page/ChromeClient.h:
2059         Make supportsVideoFullscreen() take a VideoFullscreenMode.
2060
2061         * rendering/HitTestResult.cpp:
2062         (WebCore::HitTestResult::mediaSupportsFullscreen):
2063         (WebCore::HitTestResult::toggleMediaFullscreenState):
2064         (WebCore::HitTestResult::enterFullscreenForVideo):
2065         Pass in VideoFullscreenModeStandard in the code relating to the standard fullscreen.
2066
2067 2016-01-22  Chris Dumez  <cdumez@apple.com>
2068
2069         Document.URL / Document.documentURI should return "about:blank" instead of empty string / null
2070         https://bugs.webkit.org/show_bug.cgi?id=153363
2071         <rdar://problem/22549736>
2072
2073         Reviewed by Ryosuke Niwa.
2074
2075         Document.URL / Document.documentURI should return "about:blank" instead
2076         of empty string / null, as per the specification:
2077         - https://dom.spec.whatwg.org/#dom-document-url
2078         - https://dom.spec.whatwg.org/#concept-document-url
2079
2080         Also, Document.documentURI should be an alias for Document.URL as per:
2081         - https://dom.spec.whatwg.org/#dom-document-url
2082
2083         Firefox matches the specification.
2084
2085         No new tests, already covered by existing W3C tests.
2086
2087         * dom/Document.h:
2088         (WebCore::Document::urlForBindings):
2089         * dom/Document.idl:
2090
2091 2016-01-22  Brent Fulgham  <bfulgham@apple.com>
2092
2093         Don't ignore the return value of CCRandomCopyBytes
2094         https://bugs.webkit.org/show_bug.cgi?id=153369
2095         <rdar://problem/22198376>
2096         <rdar://problem/22198378>
2097
2098         Reviewed by Alexey Proskuryakov.
2099
2100         Tested by existing Crypto tests.
2101
2102         * crypto/mac/CryptoKeyMac.cpp:
2103         (WebCore::CryptoKey::randomData): RELEASE_ASSERT if CCRandomCopyBytes ever returns
2104         anything besides kCCSuccess.
2105         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
2106         (WebCore::createAndStoreMasterKey): Ditto.
2107         (WebCore::wrapSerializedCryptoKey): Ditto.
2108
2109 2016-01-21  Sam Weinig  <sam@webkit.org>
2110
2111         Treat non-https actions on secure pages as mixed content
2112         <rdar://problem/23144492>
2113         https://bugs.webkit.org/show_bug.cgi?id=153322
2114
2115         Reviewed by Alexey Proskuryakov.
2116
2117         Tests:  http/tests/security/mixedContent/insecure-form-in-iframe.html
2118                 http/tests/security/mixedContent/insecure-form-in-main-frame.html
2119                 http/tests/security/mixedContent/javascript-url-form-in-main-frame.html
2120
2121         * html/HTMLFormElement.cpp:
2122         (WebCore::HTMLFormElement::parseAttribute):
2123         Check form actions for mixed content.
2124
2125         * loader/MixedContentChecker.cpp:
2126         (WebCore::MixedContentChecker::checkFormForMixedContent):
2127         * loader/MixedContentChecker.h:
2128         Add new function to check and warn if a form's action is mixed content.
2129
2130 2016-01-22  Nan Wang  <n_wang@apple.com>
2131
2132         AX: Crash in setTextMarkerDataWithCharacterOffset
2133         https://bugs.webkit.org/show_bug.cgi?id=153365
2134         <rdar://problem/24287924>
2135
2136         Reviewed by Chris Fleizach.
2137
2138         Sometimes when we try to create a text marker range from a stale text marker with a removed
2139         node, it will cause crash. Fixed it by adding a null check for the AccessibilityObject we
2140         create in setTextMarkerDataWithCharacterOffset.
2141
2142         Test: accessibility/text-marker/text-marker-range-with-removed-node-crash.html
2143
2144         * accessibility/AXObjectCache.cpp:
2145         (WebCore::AXObjectCache::setTextMarkerDataWithCharacterOffset):
2146
2147 2016-01-22  Brady Eidson  <beidson@apple.com>
2148
2149         Modern IDB: Add transactions and create/delete object store to SQLite backend
2150         https://bugs.webkit.org/show_bug.cgi?id=153359
2151
2152         Reviewed by Alex Christensen.
2153
2154         No new tests (Covered by many tests now passing).
2155
2156         * Modules/indexeddb/server/IDBBackingStore.h: Change deleteObjectStore to work on an ID instead of name.
2157
2158         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2159         (WebCore::IDBServer::MemoryIDBBackingStore::deleteObjectStore):
2160         (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByIdentifier):
2161         (WebCore::IDBServer::MemoryIDBBackingStore::takeObjectStoreByName): Deleted.
2162         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2163
2164         Clean up filename generation a bit to actually match the previous directory structure.
2165         Add begin/commit/abort transaction support.
2166         Add create/delete object store support:
2167         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2168         (WebCore::IDBServer::SQLiteIDBBackingStore::filenameForDatabaseName):
2169         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory):
2170         (WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath):
2171         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2172         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
2173         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
2174         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
2175         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
2176         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
2177         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
2178         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2179         
2180         Clean up SQLiteIDBTransaction to fit with the new WebCore backing store model, which is slightly
2181         different from the old WebKit2 backing store model:
2182         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2183         (WebCore::IDBServer::SQLiteIDBTransaction::SQLiteIDBTransaction):
2184         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
2185         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
2186         (WebCore::IDBServer::SQLiteIDBTransaction::abort):
2187         (WebCore::IDBServer::SQLiteIDBTransaction::reset):
2188         (WebCore::IDBServer::SQLiteIDBTransaction::rollback): Deleted.
2189         * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2190         (WebCore::IDBServer::SQLiteIDBTransaction::transactionIdentifier):
2191         (WebCore::IDBServer::SQLiteIDBTransaction::mode):
2192         
2193         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2194         (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
2195         (WebCore::IDBServer::UniqueIDBDatabase::performDeleteObjectStore):
2196         (WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteObjectStore):
2197         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2198         
2199         * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
2200         (WebCore::IDBDatabaseInfo::deleteObjectStore):
2201         * Modules/indexeddb/shared/IDBDatabaseInfo.h:
2202         
2203         * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
2204         (WebCore::IDBObjectStoreInfo::maxIndexID):
2205         
2206         * Modules/indexeddb/shared/IDBTransactionInfo.h:
2207         (WebCore::IDBTransactionInfo::identifier):
2208
2209 2016-01-22  Antti Koivisto  <antti@apple.com>
2210
2211         Style resolver initialization cleanups
2212         https://bugs.webkit.org/show_bug.cgi?id=153356
2213
2214         Reviewed by Simon Fraser.
2215
2216             Simplify StyleResolver::State initialization.
2217             Also use more references and other cleanups.
2218
2219         * css/MediaQueryMatcher.cpp:
2220         (WebCore::MediaQueryMatcher::prepareEvaluator):
2221         * css/StyleMedia.cpp:
2222         (WebCore::StyleMedia::matchMedium):
2223         * css/StyleResolver.cpp:
2224         (WebCore::StyleResolver::State::clear):
2225         (WebCore::StyleResolver::StyleResolver):
2226         (WebCore::StyleResolver::classNamesAffectedByRules):
2227         (WebCore::StyleResolver::State::State):
2228
2229             Initialize State using a constructor instead of bunch of construction functions.
2230             Remove m_styledElement field which is just a casted version of m_element.
2231
2232         (WebCore::StyleResolver::State::updateConversionData):
2233         (WebCore::StyleResolver::State::setStyle):
2234         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
2235         (WebCore::StyleResolver::canShareStyleWithElement):
2236         (WebCore::StyleResolver::locateSharedStyle):
2237         (WebCore::isAtShadowBoundary):
2238         (WebCore::StyleResolver::styleForElement):
2239         (WebCore::StyleResolver::styleForKeyframe):
2240         (WebCore::StyleResolver::keyframeStylesForAnimation):
2241         (WebCore::StyleResolver::pseudoStyleForElement):
2242         (WebCore::StyleResolver::styleForPage):
2243         (WebCore::StyleResolver::pseudoStyleRulesForElement):
2244         (WebCore::StyleResolver::clearCachedPropertiesAffectedByViewportUnits):
2245         (WebCore::isCacheableInMatchedPropertiesCache):
2246
2247             Disallow caching of document element style entirely because the writing-mode and direction properties have special handling.
2248             The existing check wasn't robust.
2249
2250         (WebCore::extractDirectionAndWritingMode):
2251         (WebCore::StyleResolver::applyMatchedProperties):
2252         (WebCore::StyleResolver::applyPropertyToStyle):
2253         (WebCore::StyleResolver::State::initElement): Deleted.
2254         (WebCore::StyleResolver::initElement): Deleted.
2255         (WebCore::StyleResolver::State::initForStyleResolve): Deleted.
2256         * css/StyleResolver.h:
2257         (WebCore::StyleResolver::mediaQueryEvaluator):
2258         (WebCore::StyleResolver::State::State):
2259         (WebCore::StyleResolver::State::document):
2260         (WebCore::StyleResolver::State::element):
2261         (WebCore::StyleResolver::State::style):
2262         (WebCore::StyleResolver::State::takeStyle):
2263         (WebCore::StyleResolver::State::styledElement): Deleted.
2264         * dom/Element.cpp:
2265         (WebCore::Element::resolveStyle):
2266         * page/animation/KeyframeAnimation.cpp:
2267         (WebCore::KeyframeAnimation::KeyframeAnimation):
2268         * rendering/RenderElement.cpp:
2269         (WebCore::RenderElement::getUncachedPseudoStyle):
2270         (WebCore::RenderElement::containingBlockForFixedPosition):
2271         * rendering/RenderNamedFlowFragment.cpp:
2272         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
2273         * style/StyleTreeResolver.cpp:
2274         (WebCore::Style::TreeResolver::styleForElement):
2275         * svg/SVGElement.cpp:
2276         (WebCore::SVGElement::customStyleForRenderer):
2277         (WebCore::SVGElement::computedStyle):
2278         (WebCore::addQualifiedName):
2279         * svg/SVGElementRareData.h:
2280         (WebCore::SVGElementRareData::ensureAnimatedSMILStyleProperties):
2281         (WebCore::SVGElementRareData::overrideComputedStyle):
2282
2283 2016-01-22  Chris Fleizach  <cfleizach@apple.com>
2284
2285         AX: <code> group and friends should have a custom subrole
2286         https://bugs.webkit.org/show_bug.cgi?id=153282
2287
2288         Reviewed by Mario Sanchez Prada.
2289
2290         Add some custom subroles for the mac for code, ins, del, cite, var, samp, pre, kbd,
2291         so that assistive tech can recognize them.
2292
2293         Test: accessibility/mac/subroles-for-formatted-groups.html
2294
2295         * accessibility/AccessibilityObject.cpp:
2296         (WebCore::AccessibilityObject::isStyleFormatGroup):
2297         * accessibility/AccessibilityObject.h:
2298         * accessibility/AccessibilityRenderObject.cpp:
2299         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2300         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2301         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2302         (-[WebAccessibilityObjectWrapper subrole]):
2303
2304 2016-01-22  Enrica Casucci  <enrica@apple.com>
2305
2306         Remove dependency from DataDetectorsCore on iOS.
2307         https://bugs.webkit.org/show_bug.cgi?id=153358
2308         rdar://problem/24294651
2309
2310         Reviewed by Anders Carlsson.
2311
2312         Avoid build dependencies.
2313
2314         * Configurations/WebCore.xcconfig:
2315
2316 2016-01-22  Chris Fleizach  <cfleizach@apple.com>
2317
2318         AX: ARIA combo boxes are not returning the right value for selected text range
2319         https://bugs.webkit.org/show_bug.cgi?id=153260
2320
2321         Reviewed by Darin Adler.
2322
2323         Just because an element has an ARIA role doesn't mean we should always use the selected text range of the whole document.
2324         If the element is also a text based ARIA control, we can still use the element's inner text range to return the right value.
2325
2326         Test: accessibility/selected-text-range-aria-elements.html
2327
2328         * accessibility/AccessibilityRenderObject.cpp:
2329         (WebCore::AccessibilityRenderObject::selectedTextRange):
2330
2331 2016-01-22  Chris Dumez  <cdumez@apple.com>
2332
2333         Unreviewed iOS build fix after r195452.
2334
2335         * accessibility/AccessibilityNodeObject.cpp:
2336         (WebCore::AccessibilityNodeObject::colorValue):
2337
2338 2016-01-21  Dave Hyatt  <hyatt@apple.com>
2339
2340         Elements with overflow and border-radius don't show in multicolumn properly.
2341         https://bugs.webkit.org/show_bug.cgi?id=152920
2342
2343         Reviewed by Simon Fraser.
2344
2345         Added new test in fast/multicol.
2346
2347         * rendering/RenderLayer.cpp:
2348         (WebCore::RenderLayer::convertToLayerCoords):
2349         (WebCore::RenderLayer::offsetFromAncestor):
2350         (WebCore::RenderLayer::clipToRect):
2351         * rendering/RenderLayer.h:
2352
2353         Make sure the crawl up the containing block chain to apply clips properly offsets
2354         to account for columns. convertToLayerCoords could already handle this, so
2355         offsetFromAncestor now takes the same extra argument (whether or not to adjust for
2356         columns) that convertToLayerCoords does.
2357
2358 2016-01-22  Darin Adler  <darin@apple.com>
2359
2360         Reduce use of equalIgnoringCase to just ignore ASCII case
2361         https://bugs.webkit.org/show_bug.cgi?id=153266
2362
2363         Reviewed by Ryosuke Niwa.
2364
2365         Changed many call sites that were using equalIgnoringCase to instead use
2366         equalLettersIgnoringASCIICase. What these all have in common is that the
2367         thing they are comparing with is a string literal that has all lowercase
2368         letters, spaces, and a few simple examples of punctuation.
2369
2370         Not 100% sure that the new function name is just right, but it's a long name
2371         so it's easy to change it with a global replace if we come up with a better one.
2372
2373         Or if we decide ther eis no need for the "letters" optimization, we can change
2374         these all to just use equalIgnoringASCIICase, also with a global replace.
2375
2376         Also made a few tweaks to some code nearby and some includes.
2377
2378         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
2379         (WebCore::CDMPrivateClearKey::supportsKeySystem): Use equalLettersIgnoringASCIICase.
2380         (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Ditto.
2381         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
2382         (WebCore::CDMSessionClearKey::update): Ditto.
2383         * Modules/plugins/YouTubePluginReplacement.cpp:
2384         (WebCore::YouTubePluginReplacement::supportsMimeType): Ditto.
2385         (WebCore::YouTubePluginReplacement::supportsFileExtension): Ditto.
2386         * Modules/webdatabase/DatabaseAuthorizer.cpp:
2387         (WebCore::DatabaseAuthorizer::createVTable): Ditto.
2388         (WebCore::DatabaseAuthorizer::dropVTable): Ditto.
2389         * Modules/websockets/WebSocketHandshake.cpp:
2390         (WebCore::WebSocketHandshake::readHTTPHeaders): Ditto.
2391         (WebCore::WebSocketHandshake::checkResponseHeaders): Ditto.
2392         * accessibility/AXObjectCache.cpp:
2393         (WebCore::AXObjectCache::findAriaModalNodes): Ditto.
2394         (WebCore::AXObjectCache::handleMenuItemSelected): Ditto.
2395         (WebCore::AXObjectCache::handleAriaModalChange): Ditto.
2396         (WebCore::isNodeAriaVisible): Ditto.
2397         * accessibility/AccessibilityListBoxOption.cpp:
2398         (WebCore::AccessibilityListBoxOption::isEnabled): Ditto.
2399
2400         * accessibility/AccessibilityNodeObject.cpp:
2401         (WebCore::AccessibilityNodeObject::determineAccessibilityRole): Use isColorControl
2402         instead of checking the typeAttr of the HTMLInputElement directly.
2403         (WebCore::AccessibilityNodeObject::isEnabled): Use equalLettersIgnoringASCIICase.
2404         (WebCore::AccessibilityNodeObject::isPressed): Ditto.
2405         (WebCore::AccessibilityNodeObject::isChecked): Ditto.
2406         (WebCore::AccessibilityNodeObject::isMultiSelectable): Ditto.
2407         (WebCore::AccessibilityNodeObject::isRequired): Ditto.
2408         (WebCore::shouldUseAccessibilityObjectInnerText): Ditto.
2409         (WebCore::AccessibilityNodeObject::colorValue): Ditto.
2410
2411         * accessibility/AccessibilityObject.cpp:
2412         (WebCore::AccessibilityObject::contentEditableAttributeIsEnabled):
2413         Use equalLettersIgnoringASCIICase.
2414         (WebCore::AccessibilityObject::ariaIsMultiline): Ditto.
2415         (WebCore::AccessibilityObject::liveRegionStatusIsEnabled): Ditto.
2416         (WebCore::AccessibilityObject::sortDirection): Ditto.
2417         (WebCore::AccessibilityObject::supportsARIAPressed): Ditto.
2418         (WebCore::AccessibilityObject::supportsExpanded): Ditto.
2419         (WebCore::AccessibilityObject::isExpanded): Ditto.
2420         (WebCore::AccessibilityObject::checkboxOrRadioValue): Ditto.
2421         (WebCore::AccessibilityObject::isARIAHidden): Ditto.
2422         * accessibility/AccessibilityRenderObject.cpp:
2423         (WebCore::AccessibilityRenderObject::supportsARIADragging): Ditto.
2424         (WebCore::AccessibilityRenderObject::defaultObjectInclusion): Ditto.
2425         (WebCore::AccessibilityRenderObject::elementAttributeValue): Ditto.
2426         (WebCore::AccessibilityRenderObject::isSelected): Ditto.
2427         (WebCore::AccessibilityRenderObject::determineAccessibilityRole): Ditto.
2428         (WebCore::AccessibilityRenderObject::orientation): Ditto.
2429         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute): Ditto.
2430         (WebCore::AccessibilityRenderObject::canSetValueAttribute): Ditto.
2431         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic): Ditto.
2432
2433         * accessibility/AccessibilityTableCell.cpp:
2434         (WebCore::AccessibilityTableCell::ariaRowSpan): Use == to compare a string
2435         with "0" since there is no need to "ignore case" when there are no letters.
2436
2437         * css/CSSCalculationValue.cpp:
2438         (WebCore::CSSCalcValue::create): Use equalLettersIgnoringASCIICase.
2439
2440         * css/CSSCalculationValue.h: Removed unneeded include of CSSParserValues.h.
2441         * css/CSSCustomPropertyValue.h: Ditto.
2442
2443         * css/CSSFontFaceSrcValue.cpp:
2444         (WebCore::CSSFontFaceSrcValue::isSVGFontFaceSrc): Use equalLettersIgnoringASCIICase.
2445
2446         * css/CSSGrammar.y.in: Use equalLettersIgnoringASCIICase. Also restructured the code
2447         a bit to have more normal formatting and reordered it slightly.
2448
2449         * css/CSSParser.cpp:
2450         (WebCore::equal): Deleted.
2451         (WebCore::equalIgnoringCase): Deleted.
2452         (WebCore::equalLettersIgnoringASCIICase): Added. Replaces function templates named
2453         equal and equalIgnoringCase that are no longer used.
2454         (WebCore::CSSParser::parseValue): Use equalLettersIgnoringASCIICase.
2455         (WebCore::CSSParser::parseNonElementSnapPoints): Ditto.
2456         (WebCore::CSSParser::parseAlt): Ditto.
2457         (WebCore::CSSParser::parseContent): Ditto.
2458         (WebCore::CSSParser::parseFillImage): Ditto.
2459         (WebCore::CSSParser::parseAnimationName): Ditto.
2460         (WebCore::CSSParser::parseAnimationTrigger): Ditto.
2461         (WebCore::CSSParser::parseAnimationProperty): Ditto.
2462         (WebCore::CSSParser::parseKeyframeSelector): Ditto.
2463         (WebCore::CSSParser::parseAnimationTimingFunction): Ditto.
2464         (WebCore::CSSParser::parseGridTrackList): Ditto.
2465         (WebCore::CSSParser::parseGridTrackSize): Ditto.
2466         (WebCore::CSSParser::parseDashboardRegions): Ditto.
2467         (WebCore::CSSParser::parseClipShape): Ditto.
2468         (WebCore::CSSParser::parseBasicShapeInset): Ditto.
2469         (WebCore::CSSParser::parseBasicShape): Ditto.
2470         (WebCore::CSSParser::parseFontFaceSrcURI): Ditto.
2471         (WebCore::CSSParser::parseFontFaceSrc): Ditto.
2472         (WebCore::CSSParser::isCalculation): Ditto.
2473         (WebCore::CSSParser::parseColorFromValue): Ditto.
2474         (WebCore::CSSParser::parseBorderImage): Ditto.
2475         (WebCore::parseDeprecatedGradientPoint): Ditto.
2476         (WebCore::parseDeprecatedGradientColorStop): Ditto.
2477         (WebCore::CSSParser::parseDeprecatedGradient): Ditto.
2478         (WebCore::CSSParser::parseLinearGradient): Ditto.
2479         (WebCore::CSSParser::parseRadialGradient): Ditto.
2480         (WebCore::CSSParser::isGeneratedImageValue): Ditto.
2481         (WebCore::CSSParser::parseGeneratedImage): Ditto.
2482         (WebCore::filterInfoForName): Ditto.
2483         (WebCore::validFlowName): Ditto.
2484         (WebCore::CSSParser::realLex): Ditto.
2485         (WebCore::isValidNthToken): Ditto.
2486         * css/CSSParserValues.cpp:
2487         (WebCore::CSSParserSelector::parsePagePseudoSelector): Ditto.
2488
2489         * css/CSSParserValues.h:
2490         (WebCore::equalLettersIgnoringASCIICase): Added.
2491
2492         * css/CSSVariableDependentValue.h: Removed unneeded include of CSSParserValues.h.
2493
2494         * css/MediaList.cpp:
2495         (WebCore::reportMediaQueryWarningIfNeeded): Use equalLettersIgnoringASCIICase.
2496         * css/MediaQueryEvaluator.cpp:
2497         (WebCore::MediaQueryEvaluator::mediaTypeMatch): Ditto.
2498         (WebCore::MediaQueryEvaluator::mediaTypeMatchSpecific): Ditto.
2499         (WebCore::evalResolution): Ditto.
2500
2501         * css/SelectorPseudoTypeMap.h: Removed unneeded include of CSSParserValues.h.
2502
2503         * css/StyleBuilderConverter.h:
2504         (WebCore::StyleBuilderConverter::convertTouchCallout): Use equalLettersIgnoringASCIICase.
2505
2506         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: Added an include of
2507         CSSParserValues.h since it's no longer included by SelectorPseudoTypeMap.h.
2508
2509         * dom/Document.cpp:
2510         (WebCore::setParserFeature): Use equalLettersIgnoringASCIICase.
2511         (WebCore::Document::processReferrerPolicy): Ditto.
2512         (WebCore::Document::createEvent): Ditto.
2513         (WebCore::Document::parseDNSPrefetchControlHeader): Ditto.
2514
2515         * dom/Element.cpp:
2516         (WebCore::Element::spellcheckAttributeState): Use isNull instead of doing
2517         checking equality with nullAtom. Use isEmpty instead of equalIgnoringCase("").
2518         Use equalLettersIgnoringASCIICase.
2519         (WebCore::Element::canContainRangeEndPoint): Ditto.
2520
2521         * dom/InlineStyleSheetOwner.cpp:
2522         (WebCore::isValidCSSContentType): Use equalLettersIgnoringASCIICase.
2523         Added comment about peculiar behavior where we do case-sensitive processing of
2524         the MIME type if the document is XML.
2525
2526         * dom/ScriptElement.cpp:
2527         (WebCore::ScriptElement::requestScript): Use equalLettersIgnoringASCIICase.
2528         (WebCore::ScriptElement::isScriptForEventSupported): Ditto.
2529         * dom/SecurityContext.cpp:
2530         (WebCore::SecurityContext::parseSandboxPolicy): Ditto.
2531         * dom/ViewportArguments.cpp:
2532         (WebCore::findSizeValue): Ditto.
2533         (WebCore::findScaleValue): Ditto.
2534         (WebCore::findBooleanValue): Ditto.
2535
2536         * editing/EditorCommand.cpp:
2537         (WebCore::executeDefaultParagraphSeparator): Use equalLettersIgnoringASCIICase.
2538         (WebCore::executeInsertBacktab): Use ASCIILiteral.
2539         (WebCore::executeInsertHTML): Use emptyString.
2540         (WebCore::executeInsertLineBreak): Use ASCIILiteral.
2541         (WebCore::executeInsertNewline): Ditto.
2542         (WebCore::executeInsertTab): Ditto.
2543         (WebCore::executeJustifyCenter): Ditto.
2544         (WebCore::executeJustifyFull): Ditto.
2545         (WebCore::executeJustifyLeft): Ditto.
2546         (WebCore::executeJustifyRight): Ditto.
2547         (WebCore::executeStrikethrough): Ditto.
2548         (WebCore::executeStyleWithCSS): Use equalLettersIgnoringASCIICase.
2549         (WebCore::executeUseCSS): Ditto.
2550         (WebCore::executeSubscript): Use ASCIILiteral.
2551         (WebCore::executeSuperscript): Ditto.
2552         (WebCore::executeToggleBold): Ditto.
2553         (WebCore::executeToggleItalic): Ditto.
2554         (WebCore::executeUnderline): Ditto.
2555         (WebCore::executeUnscript): Ditto.
2556         (WebCore::stateBold): Ditto.
2557         (WebCore::stateItalic): Ditto.
2558         (WebCore::stateStrikethrough): Ditto.
2559         (WebCore::stateSubscript): Ditto.
2560         (WebCore::stateSuperscript): Ditto.
2561         (WebCore::stateUnderline): Ditto.
2562         (WebCore::stateJustifyCenter): Ditto.
2563         (WebCore::stateJustifyFull): Ditto.
2564         (WebCore::stateJustifyLeft): Ditto.
2565         (WebCore::stateJustifyRight): Ditto.
2566         (WebCore::valueFormatBlock): Use emptyString.
2567         (WebCore::Editor::Command::value): Use ASCIILiteral.
2568
2569         * editing/TextIterator.cpp:
2570         (WebCore::isRendererReplacedElement): Use equalLettersIgnoringASCIICase.
2571
2572         * fileapi/Blob.cpp:
2573         (WebCore::Blob::isNormalizedContentType): Use isASCIIUpper.
2574
2575         * history/HistoryItem.cpp:
2576         (WebCore::HistoryItem::setFormInfoFromRequest): Use equalLettersIgnoringASCIICase.
2577
2578         * html/Autocapitalize.cpp:
2579         (WebCore::valueOn): Deleted.
2580         (WebCore::valueOff): Deleted.
2581         (WebCore::valueNone): Deleted.
2582         (WebCore::valueWords): Deleted.
2583         (WebCore::valueSentences): Deleted.
2584         (WebCore::valueAllCharacters): Deleted.
2585         (WebCore::autocapitalizeTypeForAttributeValue): Use equalLettersIgnoringASCIICase.
2586         (WebCore::stringForAutocapitalizeType): Put the AtomicString globals right in the
2587         switch statement instead of in separate functions.
2588
2589         * html/HTMLAnchorElement.cpp:
2590         (WebCore::HTMLAnchorElement::draggable): Use equalLettersIgnoringASCIICase.
2591         * html/HTMLAreaElement.cpp:
2592         (WebCore::HTMLAreaElement::parseAttribute): Ditto.
2593         * html/HTMLBRElement.cpp:
2594         (WebCore::HTMLBRElement::collectStyleForPresentationAttribute): Ditto.
2595         * html/HTMLBodyElement.cpp:
2596         (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Ditto.
2597         * html/HTMLButtonElement.cpp:
2598         (WebCore::HTMLButtonElement::parseAttribute): Ditto.
2599
2600         * html/HTMLCanvasElement.cpp:
2601         (WebCore::HTMLCanvasElement::toDataURL): Use ASCIILiteral.
2602
2603         * html/HTMLDivElement.cpp:
2604         (WebCore::HTMLDivElement::collectStyleForPresentationAttribute):
2605         Use equalLettersIgnoringASCIICase.
2606
2607         * html/HTMLDocument.cpp:
2608         (WebCore::HTMLDocument::designMode): Use ASCIILiteral.
2609         (WebCore::HTMLDocument::setDesignMode): Use equalLettersIgnoringASCIICase.
2610
2611         * html/HTMLElement.cpp:
2612         (WebCore::HTMLElement::nodeName): Updated comment.
2613         (WebCore::isLTROrRTLIgnoringCase): Use equalLettersIgnoringASCIICase.
2614         (WebCore::contentEditableType): Ditto.
2615         (WebCore::HTMLElement::collectStyleForPresentationAttribute): Ditto.
2616         (WebCore::toValidDirValue): Ditto.
2617         (WebCore::HTMLElement::insertAdjacent): Ditto.
2618         (WebCore::contextElementForInsertion): Ditto.
2619         (WebCore::HTMLElement::applyAlignmentAttributeToStyle): Ditto.
2620         (WebCore::HTMLElement::setContentEditable): Ditto.
2621         (WebCore::HTMLElement::draggable): Ditto.
2622         (WebCore::HTMLElement::translateAttributeMode): Ditto.
2623         (WebCore::HTMLElement::hasDirectionAuto): Ditto.
2624         (WebCore::HTMLElement::directionality): Ditto.
2625         (WebCore::HTMLElement::dirAttributeChanged): Ditto.
2626         (WebCore::HTMLElement::addHTMLColorToStyle): Ditto.
2627         * html/HTMLEmbedElement.cpp:
2628         (WebCore::HTMLEmbedElement::collectStyleForPresentationAttribute): Ditto.
2629         * html/HTMLFormControlElement.cpp:
2630         (WebCore::HTMLFormControlElement::autocorrect): Ditto.
2631         * html/HTMLFormElement.cpp:
2632         (WebCore::HTMLFormElement::autocorrect): Ditto.
2633         (WebCore::HTMLFormElement::shouldAutocomplete): Ditto.
2634         * html/HTMLFrameElementBase.cpp:
2635         (WebCore::HTMLFrameElementBase::parseAttribute): Ditto.
2636
2637         * html/HTMLFrameSetElement.cpp:
2638         (WebCore::HTMLFrameSetElement::parseAttribute): Use equalLettersIgnoringASCIICase.
2639         Use == when comparing with "0" and "1" since there is no need for case folding.
2640
2641         * html/HTMLHRElement.cpp:
2642         (WebCore::HTMLHRElement::collectStyleForPresentationAttribute):
2643         Use equalLettersIgnoringASCIICase.
2644         * html/HTMLImageElement.cpp:
2645         (WebCore::HTMLImageElement::draggable): Ditto.
2646         * html/HTMLInputElement.cpp:
2647         (WebCore::HTMLInputElement::parseAttribute): Ditto.
2648         * html/HTMLKeygenElement.cpp:
2649         (WebCore::HTMLKeygenElement::appendFormData): Ditto.
2650         * html/HTMLMarqueeElement.cpp:
2651         (WebCore::HTMLMarqueeElement::collectStyleForPresentationAttribute): Ditto.
2652         * html/HTMLMediaElement.cpp:
2653         (WebCore::HTMLMediaElement::parseAttribute): Ditto.
2654         * html/HTMLMetaElement.cpp:
2655         (WebCore::HTMLMetaElement::process): Ditto.
2656
2657         * html/HTMLObjectElement.cpp:
2658         (WebCore::mapDataParamToSrc): Use references, modern for loops, simplify
2659         logic to not use array indices, use ASCIILiteral and equalLettersIgnoringASCIICase.
2660         (WebCore::HTMLObjectElement::parametersForPlugin): Update to call new function.
2661         (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Use equalLettersIgnoringASCIICase.
2662         (WebCore::HTMLObjectElement::containsJavaApplet): Ditto.
2663         * html/HTMLParagraphElement.cpp:
2664         (WebCore::HTMLParagraphElement::collectStyleForPresentationAttribute): Ditto.
2665         * html/HTMLParamElement.cpp:
2666         (WebCore::HTMLParamElement::isURLParameter): Ditto.
2667         * html/HTMLTableElement.cpp:
2668         (WebCore::getBordersFromFrameAttributeValue): Ditto.
2669         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
2670         (WebCore::HTMLTableElement::parseAttribute): Ditto.
2671         * html/HTMLTablePartElement.cpp:
2672         (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
2673         * html/HTMLTextAreaElement.cpp:
2674         (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
2675         * html/HTMLTextFormControlElement.cpp:
2676         (WebCore::HTMLTextFormControlElement::setRangeText): Ditto.
2677         (WebCore::HTMLTextFormControlElement::directionForFormData): Ditto.
2678         * html/HTMLVideoElement.cpp:
2679         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
2680         * html/InputType.cpp:
2681         (WebCore::InputType::applyStep): Ditto.
2682         * html/LinkRelAttribute.cpp:
2683         (WebCore::LinkRelAttribute::LinkRelAttribute): Ditto.
2684         * html/MediaElementSession.cpp:
2685         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled): Ditto.
2686         * html/NumberInputType.cpp:
2687         (WebCore::NumberInputType::sizeShouldIncludeDecoration): Ditto.
2688         * html/RangeInputType.cpp:
2689         (WebCore::RangeInputType::createStepRange): Ditto.
2690         (WebCore::RangeInputType::handleKeydownEvent): Ditto.
2691         * html/StepRange.cpp:
2692         (WebCore::StepRange::parseStep): Ditto.
2693         * html/canvas/CanvasStyle.cpp:
2694         (WebCore::parseColor): Ditto.
2695         * html/parser/HTMLConstructionSite.cpp:
2696         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype): Ditto.
2697         * html/parser/HTMLElementStack.cpp:
2698         (WebCore::HTMLElementStack::isHTMLIntegrationPoint): Ditto.
2699         * html/parser/HTMLMetaCharsetParser.cpp:
2700         (WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes): Ditto.
2701         * html/parser/HTMLPreloadScanner.cpp:
2702         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Ditto.
2703         (WebCore::TokenPreloadScanner::StartTagScanner::crossOriginModeAllowsCookies): Ditto.
2704         * html/parser/HTMLTreeBuilder.cpp:
2705         (WebCore::HTMLTreeBuilder::processStartTagForInBody): Ditto.
2706         (WebCore::HTMLTreeBuilder::processStartTagForInTable): Ditto.
2707         * html/parser/XSSAuditor.cpp:
2708         (WebCore::isDangerousHTTPEquiv): Ditto.
2709
2710         * html/track/WebVTTParser.cpp:
2711         (WebCore::WebVTTParser::hasRequiredFileIdentifier): Removed unneeded special case
2712         for empty string.
2713
2714         * inspector/InspectorPageAgent.cpp:
2715         (WebCore::createXHRTextDecoder): Use equalLettersIgnoringASCIICase.
2716         * inspector/NetworkResourcesData.cpp:
2717         (WebCore::createOtherResourceTextDecoder): Ditto.
2718         * loader/CrossOriginAccessControl.cpp:
2719         (WebCore::isOnAccessControlSimpleRequestHeaderWhitelist): Ditto.
2720         * loader/DocumentLoader.cpp:
2721         (WebCore::DocumentLoader::continueAfterContentPolicy): Ditto.
2722         * loader/FormSubmission.cpp:
2723         (WebCore::appendMailtoPostFormDataToURL): Ditto.
2724         (WebCore::FormSubmission::Attributes::parseEncodingType): Ditto.
2725         (WebCore::FormSubmission::Attributes::parseMethodType): Ditto.
2726         * loader/FrameLoader.cpp:
2727         (WebCore::FrameLoader::shouldPerformFragmentNavigation): Ditto.
2728         (WebCore::FrameLoader::shouldTreatURLAsSrcdocDocument): Ditto.
2729         * loader/ImageLoader.cpp:
2730         (WebCore::ImageLoader::updateFromElement): Ditto.
2731         * loader/MediaResourceLoader.cpp:
2732         (WebCore::MediaResourceLoader::start): Ditto.
2733         * loader/SubframeLoader.cpp:
2734         (WebCore::SubframeLoader::createJavaAppletWidget): Ditto.
2735         * loader/TextResourceDecoder.cpp:
2736         (WebCore::TextResourceDecoder::determineContentType): Ditto.
2737         * loader/TextTrackLoader.cpp:
2738         (WebCore::TextTrackLoader::load): Ditto.
2739         * loader/appcache/ApplicationCache.cpp:
2740         (WebCore::ApplicationCache::requestIsHTTPOrHTTPSGet): Ditto.
2741         * loader/cache/CachedCSSStyleSheet.cpp:
2742         (WebCore::CachedCSSStyleSheet::canUseSheet): Ditto.
2743         * loader/cache/CachedResource.cpp:
2744         (WebCore::shouldCacheSchemeIndefinitely): Ditto.
2745         * page/DOMSelection.cpp:
2746         (WebCore::DOMSelection::modify): Ditto.
2747         * page/EventSource.cpp:
2748         (WebCore::EventSource::didReceiveResponse): Ditto.
2749         * page/FrameView.cpp:
2750         (WebCore::FrameView::scrollToAnchor): Ditto.
2751         * page/Performance.cpp:
2752         (WebCore::Performance::webkitGetEntriesByType): Ditto.
2753         * page/PerformanceResourceTiming.cpp:
2754         (WebCore::passesTimingAllowCheck): Ditto.
2755
2756         * page/SecurityOrigin.cpp:
2757         (WebCore::SecurityOrigin::SecurityOrigin): Use emptyString.
2758         (WebCore::SecurityOrigin::toString): Use ASCIILiteral.
2759         (WebCore::SecurityOrigin::databaseIdentifier): Ditto.
2760
2761         * page/UserContentURLPattern.cpp:
2762         (WebCore::UserContentURLPattern::parse): Use equalLettersIgnoringASCIICase.
2763         (WebCore::UserContentURLPattern::matches): Ditto.
2764         * platform/URL.cpp:
2765         (WebCore::URL::protocolIs): Ditto.
2766
2767         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
2768         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
2769         Changed to use early exit and equalLettersIgnoringASCIICase. Added comment
2770         about inconsistency with next function.
2771         (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType): Added comment
2772         about inconsistency with previous function.
2773
2774         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2775         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
2776         Use equalLettersIgnoringASCIICase.
2777         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2778         (WebCore::CDMSessionAVStreamSession::generateKeyRequest): Ditto.
2779         * platform/graphics/cg/ImageBufferCG.cpp:
2780         (WebCore::utiFromMIMEType): Ditto.
2781
2782         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2783         (WebCore::FontCache::similarFont): Changed to not use so many global
2784         variables and use equalLettersIgnoringASCIICase.
2785         * platform/graphics/ios/FontCacheIOS.mm:
2786         (WebCore::platformFontWithFamilySpecialCase): Ditto.
2787
2788         * platform/graphics/mac/FontCustomPlatformData.cpp:
2789         (WebCore::FontCustomPlatformData::supportsFormat): Use equalLettersIgnoringASCIICase.
2790         * platform/mac/PasteboardMac.mm:
2791         (WebCore::Pasteboard::readString): Ditto.
2792         * platform/network/BlobResourceHandle.cpp:
2793         (WebCore::BlobResourceHandle::createAsync): Ditto.
2794         (WebCore::BlobResourceHandle::loadResourceSynchronously): Ditto.
2795         * platform/network/CacheValidation.cpp:
2796         (WebCore::parseCacheControlDirectives): Ditto.
2797         * platform/network/FormData.h:
2798         (WebCore::FormData::parseEncodingType): Ditto.
2799         * platform/network/HTTPParsers.cpp:
2800         (WebCore::contentDispositionType): Ditto.
2801         (WebCore::parseXFrameOptionsHeader): Ditto.
2802
2803         * platform/network/ResourceResponseBase.cpp:
2804         (WebCore::ResourceResponseBase::isHTTP): Use protocolIsInHTTPFamily, which is
2805         both clearer and more efficient.
2806         (WebCore::ResourceResponseBase::isAttachment): Rewrite to be a bit more terse
2807         and use equalLettersIgnoringASCIICase.
2808
2809         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
2810         (WebCore::ResourceHandleCFURLConnectionDelegate::createResourceRequest):
2811         Use equalLettersIgnoringASCIICase.
2812         * platform/network/mac/ResourceHandleMac.mm:
2813         (WebCore::ResourceHandle::willSendRequest): Ditto.
2814         * platform/sql/SQLiteDatabase.cpp:
2815         (WebCore::SQLiteDatabase::open): Ditto.
2816         * platform/sql/SQLiteStatement.cpp:
2817         (WebCore::SQLiteStatement::isColumnDeclaredAsBlob): Ditto.
2818
2819         * platform/text/TextEncodingRegistry.cpp:
2820         (WebCore::defaultTextEncodingNameForSystemLanguage): Use ASCIILiteral
2821         and equalLettersIgnoringASCIICase.
2822
2823         * rendering/mathml/RenderMathMLFraction.cpp:
2824         (WebCore::RenderMathMLFraction::updateFromElement): Use equalLettersIgnoringASCIICase.
2825         * svg/SVGToOTFFontConversion.cpp:
2826         (WebCore::SVGToOTFFontConverter::compareCodepointsLexicographically): Ditto.
2827         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Ditto.
2828         * testing/InternalSettings.cpp:
2829         (WebCore::InternalSettings::setEditingBehavior): Ditto.
2830         (WebCore::InternalSettings::setShouldDisplayTrackKind): Ditto.
2831         (WebCore::InternalSettings::shouldDisplayTrackKind): Ditto.
2832         * testing/Internals.cpp:
2833         (WebCore::markerTypeFrom): Ditto.
2834         (WebCore::markerTypesFrom): Ditto.
2835         (WebCore::Internals::mediaElementHasCharacteristic): Ditto.
2836         (WebCore::Internals::setCaptionDisplayMode): Ditto.
2837         (WebCore::Internals::beginMediaSessionInterruption): Ditto.
2838         (WebCore::Internals::endMediaSessionInterruption): Ditto.
2839         (WebCore::Internals::setMediaSessionRestrictions): Ditto.
2840         (WebCore::Internals::setMediaElementRestrictions): Ditto.
2841         (WebCore::Internals::postRemoteControlCommand): Ditto.
2842         (WebCore::Internals::setAudioContextRestrictions): Ditto.
2843         (WebCore::Internals::setMockMediaPlaybackTargetPickerState): Ditto.
2844         * testing/MockCDM.cpp:
2845         (WebCore::MockCDM::supportsKeySystem): Ditto.
2846         (WebCore::MockCDM::supportsKeySystemAndMimeType): Ditto.
2847         (WebCore::MockCDM::supportsMIMEType): Ditto.
2848         * xml/XMLHttpRequest.cpp:
2849         (WebCore::isSetCookieHeader): Ditto.
2850         (WebCore::XMLHttpRequest::responseXML): Ditto.
2851         (WebCore::XMLHttpRequest::isAllowedHTTPMethod): Ditto.
2852         (WebCore::XMLHttpRequest::didReceiveData): Ditto.
2853
2854 2016-01-22  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2855
2856         Remove PassRefPtr from ResourceRequest and FormData
2857         https://bugs.webkit.org/show_bug.cgi?id=153229
2858
2859         Reviewed by Chris Dumez.
2860
2861         Covered by existing tests.
2862
2863         Making ResourceRequest::setHTTPBody take a RefPtr<FormData>&&.
2864         Moving FormData from PassRefPtr to RefPtr.
2865
2866         * html/parser/XSSAuditorDelegate.cpp:
2867         (WebCore::XSSAuditorDelegate::didBlockScript):
2868         * loader/FormSubmission.cpp:
2869         (WebCore::FormSubmission::populateFrameLoadRequest):
2870         * loader/FrameLoader.cpp:
2871         (WebCore::FrameLoader::loadPostRequest):
2872         (WebCore::FrameLoader::loadDifferentDocumentItem):
2873         * loader/PingLoader.cpp:
2874         (WebCore::PingLoader::sendViolationReport):
2875         * loader/PingLoader.h:
2876         * page/ContentSecurityPolicy.cpp:
2877         (WebCore::ContentSecurityPolicy::reportViolation):
2878         * platform/network/FormData.cpp:
2879         (WebCore::FormData::create):
2880         (WebCore::FormData::createMultiPart):
2881         (WebCore::FormData::copy):
2882         (WebCore::FormData::deepCopy):
2883         (WebCore::FormData::resolveBlobReferences):
2884         * platform/network/FormData.h:
2885         (WebCore::FormData::decode):
2886         * platform/network/ResourceRequestBase.cpp:
2887         (WebCore::ResourceRequestBase::adopt):
2888         (WebCore::ResourceRequestBase::setHTTPBody):
2889         * platform/network/ResourceRequestBase.h:
2890         (WebCore::ResourceRequestBase::setHTTPBody):
2891         * platform/network/cf/FormDataStreamCFNet.cpp:
2892         (WebCore::setHTTPBody):
2893         * platform/network/cf/FormDataStreamCFNet.h:
2894         * platform/network/cf/ResourceRequestCFNet.cpp:
2895         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2896         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2897         * platform/network/cocoa/ResourceRequestCocoa.mm:
2898         (WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
2899         * platform/network/curl/ResourceHandleManager.cpp:
2900         (WebCore::getFormElementsCount):
2901         * platform/network/mac/FormDataStreamMac.h:
2902         * platform/network/mac/FormDataStreamMac.mm:
2903         (WebCore::setHTTPBody):
2904         * platform/network/soup/ResourceHandleSoup.cpp:
2905         (WebCore::doRedirect):
2906         * xml/XMLHttpRequest.cpp:
2907         (WebCore::XMLHttpRequest::createRequest):
2908
2909 2016-01-22  Csaba Osztrogonác  <ossy@webkit.org>
2910
2911         Fix the !ENABLE(INDEXED_DATABASE) build after r195443
2912         https://bugs.webkit.org/show_bug.cgi?id=153350
2913
2914         Unreviewed buildfix.
2915
2916         * page/Page.cpp:
2917         (WebCore::Page::setSessionID):
2918
2919 2016-01-22  ChangSeok Oh  <changseok.oh@collabora.com>
2920
2921         [GTK] Remove a focus ring on anchor node when focused by mouse.
2922         https://bugs.webkit.org/show_bug.cgi?id=136121
2923
2924         Reviewed by Michael Catanzaro.
2925
2926         Safari, Chrome and FF don't show a focus ring, the dotted rectangle on anchor node
2927         for mouse clicking. I think the behavior is reasonable and looks better.
2928         No reason for gtk & efl ports to keep the focus on anchor node. Of course, this change should not
2929         affect the focus ring for tab navigation.
2930
2931         No new tests since an existing test can cover this.
2932         Tests: fast/events/click-focus-anchor.html
2933
2934         * html/HTMLAnchorElement.cpp:
2935         (WebCore::HTMLAnchorElement::isMouseFocusable):
2936
2937 2016-01-21  Simon Fraser  <simon.fraser@apple.com>
2938
2939         REGRESSION (r168244): Content in horizontal-bt page is offset such that only the end is viewable and there is a white gap at the top
2940         https://bugs.webkit.org/show_bug.cgi?id=136019
2941
2942         Reviewed by Dan Bernstein.
2943
2944         In horizontal-bt documents (where the page starts scrolled to the bottom, and scrolling up goes into negative scroll positions),
2945         the position of the root content layer would be set incorrectly by the scrolling thread, resulting in misplaced
2946         content.
2947
2948         Fix by having the renamed "yPositionForRootContentLayer" take scroll origin into
2949         account, and being more consistent about using scrollOrigin to position this layer.
2950
2951         Test: fast/scrolling/programmatic-horizontal-bt-document-scroll.html
2952
2953         * page/FrameView.cpp:
2954         (WebCore::FrameView::yPositionForFooterLayer): Moved
2955         (WebCore::FrameView::positionForRootContentLayer): Take scrollOrigin, and subtract it from the computed value.
2956         (WebCore::FrameView::yPositionForRootContentLayer): Renamed.
2957         * page/FrameView.h:
2958         * page/scrolling/AsyncScrollingCoordinator.cpp:
2959         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): We've already pushed the new scrollPosition onto the FrameView,
2960         so we can just use the member function to compute the positionForContentsLayer.
2961         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2962         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): This is the bug fix; FrameView::positionForRootContentLayer()
2963         now takes scrollOrigin into account.
2964         * rendering/RenderLayerCompositor.cpp:
2965         (WebCore::RenderLayerCompositor::updateRootLayerPosition): Rather than using the documentRect, position the root content layer
2966         in terms of the scroll origin (which is -documentRect.location()).
2967
2968 2016-01-21  Brady Eidson  <beidson@apple.com>
2969
2970         Modern IDB: Support populating/extracting database metadata with SQLite backend.
2971         Nhttps://bugs.webkit.org/show_bug.cgi?id=153318
2972
2973         Reviewed by Alex Christensen.
2974
2975         No new tests (Covered by current tests).
2976
2977         * CMakeLists.txt:
2978         * WebCore.xcodeproj/project.pbxproj:
2979
2980         * Modules/indexeddb/client/IDBDatabaseImpl.cpp:
2981         (WebCore::IDBClient::IDBDatabase::willAbortTransaction): Committing transactions can abort if the commit
2982           ends in error.
2983
2984         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2985         (WebCore::IDBClient::IDBTransaction::didCommit): Before a committing transaction is aborted, notify the
2986           IDBDatabase that it aborted.
2987
2988         Copied over from WK2:
2989         * Modules/indexeddb/server/IDBSerialization.cpp: Added.
2990         (WebCore::serializeIDBKeyPath):
2991         (WebCore::deserializeIDBKeyPath):
2992         (WebCore::serializeIDBKeyData):
2993         (WebCore::deserializeIDBKeyData):
2994         * Modules/indexeddb/server/IDBSerialization.h: Added.
2995
2996         * Modules/indexeddb/server/IDBServer.cpp:
2997         (WebCore::IDBServer::IDBServer::createBackingStore): Optionally create a SQLite backing store.
2998         
2999         Mostly copied over verbatim from WebKit2's UniqueIDBDatabaseBackingStoreSQLite.cpp: 
3000         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3001         (WebCore::IDBServer::idbKeyCollate):
3002         (WebCore::IDBServer::v1RecordsTableSchema):
3003         (WebCore::IDBServer::v1RecordsTableSchemaAlternate):
3004         (WebCore::IDBServer::v2RecordsTableSchema):
3005         (WebCore::IDBServer::v2RecordsTableSchemaAlternate):
3006         (WebCore::IDBServer::createOrMigrateRecordsTableIfNecessary):
3007         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidRecordsTable):
3008         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
3009         (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
3010         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
3011         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
3012         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
3013         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
3014         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
3015         (WebCore::IDBServer::SQLiteIDBBackingStore::unregisterCursor):
3016         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
3017         
3018         Copied over from WK2:
3019         * Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added.
3020         (WebCore::IDBServer::SQLiteIDBCursor::maybeCreate):
3021         (WebCore::IDBServer::SQLiteIDBCursor::SQLiteIDBCursor):
3022         (WebCore::IDBServer::buildIndexStatement):
3023         (WebCore::IDBServer::buildObjectStoreStatement):
3024         (WebCore::IDBServer::SQLiteIDBCursor::establishStatement):
3025         (WebCore::IDBServer::SQLiteIDBCursor::createSQLiteStatement):
3026         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
3027         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
3028         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
3029         (WebCore::IDBServer::SQLiteIDBCursor::advance):
3030         (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
3031         (WebCore::IDBServer::SQLiteIDBCursor::advanceOnce):
3032         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
3033         (WebCore::IDBServer::SQLiteIDBCursor::iterate):
3034         * Modules/indexeddb/server/SQLiteIDBCursor.h: Added.
3035         (WebCore::IDBServer::SQLiteIDBCursor::identifier):
3036         (WebCore::IDBServer::SQLiteIDBCursor::transaction):
3037         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreID):
3038         (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
3039         (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
3040         (WebCore::IDBServer::SQLiteIDBCursor::currentValueBuffer):
3041         (WebCore::IDBServer::SQLiteIDBCursor::didError):
3042
3043         Copied over from WK2:
3044         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: Added.
3045         (WebCore::IDBServer::SQLiteIDBTransaction::SQLiteIDBTransaction):
3046         (WebCore::IDBServer::SQLiteIDBTransaction::~SQLiteIDBTransaction):
3047         (WebCore::IDBServer::SQLiteIDBTransaction::begin):
3048         (WebCore::IDBServer::SQLiteIDBTransaction::commit):
3049         (WebCore::IDBServer::SQLiteIDBTransaction::reset):
3050         (WebCore::IDBServer::SQLiteIDBTransaction::rollback):
3051         (WebCore::IDBServer::SQLiteIDBTransaction::maybeOpenCursor):
3052         (WebCore::IDBServer::SQLiteIDBTransaction::closeCursor):
3053         (WebCore::IDBServer::SQLiteIDBTransaction::notifyCursorsOfChanges):
3054         (WebCore::IDBServer::SQLiteIDBTransaction::clearCursors):
3055         (WebCore::IDBServer::SQLiteIDBTransaction::inProgress):
3056         * Modules/indexeddb/server/SQLiteIDBTransaction.h: Added.
3057         (WebCore::IDBServer::SQLiteIDBTransaction::transactionIdentifier):
3058         (WebCore::IDBServer::SQLiteIDBTransaction::mode):
3059         (WebCore::IDBServer::SQLiteIDBTransaction::sqliteTransaction):
3060
3061         * page/Page.cpp:
3062         (WebCore::Page::setSessionID): If the new SessionID is different from the last one,
3063           clear the IDBConnectionToServer.
3064         (WebCore::Page::idbConnection): Always ask the DatabaseProvider; It handles whether or not 
3065           the session is ephemeral.
3066
3067 2016-01-21  Alex Christensen  <achristensen@webkit.org>
3068
3069         CMake build fix after r195302.
3070
3071         * PlatformMac.cmake:
3072
3073 2016-01-21  Ryosuke Niwa  <rniwa@webkit.org>
3074
3075         createElementFromSavedToken shouldn't have the code to create a non-HTML element
3076         https://bugs.webkit.org/show_bug.cgi?id=153327
3077
3078         Reviewed by Chris Dumez.
3079
3080         Since HTMLConstructionSite::createElementFromSavedToken is only used to instantiate a formatting element,
3081         there is no need for it to support creating a non-HTML elements. Remove the branch and assert that this
3082         is indeed the case.
3083
3084         createElementFromSavedToken is called in HTMLTreeBuilder::callTheAdoptionAgency and HTMLConstructionSite's
3085         reconstructTheActiveFormattingElements. In both cases, the stack item passed to createElementFromSavedToken
3086         is guaranteed to be in the list of active formatting elements, which only contains formatting elements.
3087
3088         No new tests since there is no behavioral change.
3089
3090         * html/parser/HTMLConstructionSite.cpp:
3091         (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
3092         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
3093         (WebCore::HTMLConstructionSite::insertFormattingElement):
3094         (WebCore::HTMLConstructionSite::createElement): Returns Ref<Element> instead of PassRefPtr<Element>.
3095         (WebCore::HTMLConstructionSite::createHTMLElement): Ditto.
3096         (WebCore::HTMLConstructionSite::createElementFromSavedToken): Ditto. Removed the code to instantiate
3097         a non-HTML element. Also assert that an element created by this function is a formatting tag.
3098         * html/parser/HTMLConstructionSite.h:
3099         * html/parser/HTMLTreeBuilder.cpp:
3100         (WebCore::HTMLConstructionSite::isFormattingTag): Put into HTMLConstructionSite to add an assertion.
3101         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
3102
3103 2016-01-21  Andreas Kling  <akling@apple.com>
3104
3105         CGImageSource sometimes retains temporary SharedBuffer data indefinitely, doubling memory cost.
3106         <https://webkit.org/b/153325>
3107
3108         Reviewed by Anders Carlsson.
3109
3110         After a resource has finished downloading, and has been cached to disk cache,
3111         we mmap() the disk cached version so we can throw out the temporary download buffer.
3112
3113         Due to the way CGImageSource works on Mac/iOS, it's not possible to replace the data
3114         being decoded once the image has been fully decoded once. When doing the replacement,
3115         we'd end up with the SharedBuffer wrapping the mmap() data, and the CGImageSource
3116         keeping the old SharedBuffer::DataBuffer alive, effectively doubling the memory cost.
3117
3118         This patch adds a CachedResource::didReplaceSharedBufferContents() callback that
3119         CachedImage implements to throw out the decoded data. This is currently the only way
3120         to make CGImageSource drop the retain it holds on the SharedBuffer::DataBuffer.
3121         The downside of this approach is that we'll sometimes incur the cost of one additional
3122         image decode after an image downloads and is cached for the first time.
3123
3124         I put a FIXME in there since we could do better with a little help from CGImageSource.
3125
3126         * loader/cache/CachedImage.cpp:
3127         (WebCore::CachedImage::didReplaceSharedBufferContents):
3128         * loader/cache/CachedImage.h:
3129         * loader/cache/CachedResource.cpp:
3130         (WebCore::CachedResource::tryReplaceEncodedData):
3131         * loader/cache/CachedResource.h:
3132         (WebCore::CachedResource::didReplaceSharedBufferContents):
3133
3134 2016-01-21  Beth Dakin  <bdakin@apple.com>
3135
3136         Add the ability to update WebKitAdditions to WK2
3137         https://bugs.webkit.org/show_bug.cgi?id=153320
3138         -and corresponding-
3139         rdar://problem/23639629
3140
3141         Reviewed by Anders Carlsson.
3142
3143         This SPI is un-used now.
3144         * platform/spi/mac/NSSpellCheckerSPI.h:
3145
3146 2016-01-21  Simon Fraser  <simon.fraser@apple.com>
3147
3148         GraphicsContext: low quality drawImage and drawImageBuffer should use InterpolationLow
3149         https://bugs.webkit.org/show_bug.cgi?id=49002
3150
3151         Reviewed by Chris Dumez.
3152
3153         When using low quality image scaling for images which are getting painted often,
3154         the code used InterpolationNone, which make the images look even worse than they should.
3155
3156         Not easily testable.
3157
3158         * platform/graphics/GraphicsContext.cpp:
3159         (WebCore::GraphicsContext::drawImage):
3160         (WebCore::GraphicsContext::drawImageBuffer):
3161         (WebCore::GraphicsContext::drawConsumingImageBuffer):
3162
3163 2016-01-19  Ada Chan  <adachan@apple.com>
3164
3165         Make it possible to enable VIDEO_PRESENTATION_MODE on other Cocoa platforms.
3166         https://bugs.webkit.org/show_bug.cgi?id=153218
3167
3168         Reviewed by Eric Carlson.
3169
3170         No new tests. Code refactoring.
3171
3172         * Configurations/FeatureDefines.xcconfig:
3173         * WebCore.xcodeproj/project.pbxproj:
3174         Move WebVideoFullscreenInterface.h from ios to cocoa.
3175         * html/HTMLVideoElement.cpp:
3176         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
3177         The declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
3178         so include that header instead. Guard the supportsPictureInPicture() call with PLATFORM(COCOA)
3179         as that method is only defined in Cocoa.
3180         * platform/cocoa/WebVideoFullscreenInterface.h: Renamed from Source/WebCore/platform/ios/WebVideoFullscreenInterface.h.
3181         Also move the declaration of supportsPictureInPicture() here.
3182         * platform/graphics/MediaPlayer.cpp:
3183         * platform/graphics/MediaPlayer.h:
3184         * platform/graphics/MediaPlayerPrivate.h:
3185         Implementations of methods related to the video fullscreen layer are now guarded by
3186         PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)) instead.
3187         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3188         Declaration of supportsPictureInPicture() has been moved to WebVideoFullscreenInterface.h
3189         * platform/mac/WebVideoFullscreenInterfaceMac.mm: Added.
3190         (WebCore::supportsPictureInPicture):
3191         Return false for now.
3192
3193 2016-01-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
3194
3195         A crash reproducible in Path::isEmpty() under RenderSVGShape::paint()
3196         https://bugs.webkit.org/show_bug.cgi?id=149613
3197
3198         Reviewed by Darin Adler.
3199
3200         When RenderSVGRoot::layout() realizes its layout size has changed and
3201         it has resources which have relative sizes, it marks all the clients of
3202         the resources for invalidates regardless whether they belong to the
3203         same RenderSVGRoot or not. But it reruns the layout only for its children.
3204         If one of these clients comes before the current RenderSVGRoot in the render
3205         tree, ee end up having renderer marked for invalidation at rendering time.
3206         This also prevents scheduling the layout if the same renderer is marked
3207         for another invalidation later. We prevent this because we do not want
3208         to schedule another layout for a renderer which is already marked for
3209         invalidation. This can cause crash if the renderer is an RenderSVGPath.
3210         
3211         The fix is to mark "only" the clients of a resource which belong to the
3212         same RenderSVGRoot of the resource. Also we need to run the layout for
3213         all the resources which belong to different RenderSVGRoots before running
3214         the layout for an SVG renderer.
3215          
3216         Tests: svg/custom/filter-update-different-root.html
3217                svg/custom/pattern-update-different-root.html
3218
3219         * rendering/svg/RenderSVGResourceContainer.cpp:
3220         (WebCore::RenderSVGResourceContainer::markAllClientsForInvalidation):
3221         We should not mark any client outside the current root for invalidation
3222         
3223         * rendering/svg/RenderSVGResourceContainer.h: Remove unneeded private keyword.
3224         
3225         * rendering/svg/RenderSVGRoot.cpp:
3226         (WebCore::RenderSVGRoot::addResourceForClientInvalidation):
3227         Code clean up; use findTreeRootObject() instead of repeating the same code.
3228         
3229         * rendering/svg/RenderSVGShape.cpp:
3230         (WebCore::RenderSVGShape::isEmpty): Avoid crashing if RenderSVGShape::isEmpty()
3231         is called before calling RenderSVGShape::layout().
3232          
3233         * rendering/svg/RenderSVGText.cpp:
3234         (WebCore::RenderSVGText::layout): findTreeRootObject() now returns a pointer.
3235         
3236         * rendering/svg/SVGRenderSupport.cpp:
3237         (WebCore::SVGRenderSupport::findTreeRootObject): I do think nothing 
3238         guarantees that an SVG renderer has to have an RenderSVGRoot in its
3239         ancestors. So change this function to return a pointer. Also Provide
3240         the non-const version of this function.
3241          
3242         (WebCore::SVGRenderSupport::layoutDifferentRootIfNeeded): Runs the layout
3243         if needed for all the resources which belong to different RenderSVGRoots.
3244         
3245         (WebCore::SVGRenderSupport::layoutChildren): Make sure all the renderer's
3246         resources which belong to different RenderSVGRoots are laid out before
3247         running the layout for this renderer.
3248         
3249         * rendering/svg/SVGRenderSupport.h: Remove a mysterious comment.
3250         
3251         * rendering/svg/SVGResources.cpp:
3252         (WebCore::SVGResources::layoutDifferentRootIfNeeded): Run the layout for
3253         all the resources which belong to different RenderSVGRoots outside the
3254         context of their RenderSVGRoots.
3255         
3256         * rendering/svg/SVGResources.h:
3257         (WebCore::SVGResources::clipper):
3258         (WebCore::SVGResources::markerStart):
3259         (WebCore::SVGResources::markerMid):
3260         (WebCore::SVGResources::markerEnd):
3261         (WebCore::SVGResources::masker):
3262         (WebCore::SVGResources::filter):
3263         (WebCore::SVGResources::fill):
3264         (WebCore::SVGResources::stroke):
3265         Code clean up; use nullptr instead of 0.
3266
3267 2016-01-21  Jer Noble  <jer.noble@apple.com>
3268
3269         [EME] Correctly report errors when generating key requests from AVContentKeySession.
3270         https://bugs.webkit.org/show_bug.cgi?id=151963
3271
3272         Reviewed by Eric Carlson.
3273
3274         WebIDL's "unsigned long" is a 32-bit unsigned integer, and C++'s "unsigned long" is (or, can
3275         be) a 64-bit integer on 64-bit platforms. Casting a negative integer to a 64-bit integer
3276         results in a number which cannot be accurately stored in a double-length floating point
3277         number. Previously, the mac CDM code would work around this issue by returning the absolute
3278         value of NSError code returned by media frameworks. Instead, fix the underlying problem by
3279         storing the MediaKeyError's systemCode as a uint32_t (which more accurately represents the
3280         size of a WebIDL "unsigned long" on all platforms.)
3281
3282         Check the error code issued by -contentKeyRequestDataForApp:contentIdentifier:options:error:.
3283
3284         * Modules/encryptedmedia/CDM.h:
3285         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
3286         (WebCore::CDMSessionClearKey::generateKeyRequest):
3287         (WebCore::CDMSessionClearKey::update):
3288         * Modules/encryptedmedia/CDMSessionClearKey.h:
3289         * Modules/encryptedmedia/MediaKeySession.cpp:
3290         (WebCore::MediaKeySession::keyRequestTimerFired):
3291         (WebCore::MediaKeySession::addKeyTimerFired):
3292         (WebCore::MediaKeySession::sendError):
3293         * Modules/encryptedmedia/MediaKeySession.h:
3294         * Modules/mediacontrols/mediaControlsApple.js:
3295         (Controller.prototype.handleReadyStateChange):
3296         * WebCore.xcodeproj/project.pbxproj:
3297         * html/MediaKeyError.h:
3298         (WebCore::MediaKeyError::create):
3299         (WebCore::MediaKeyError::systemCode):
3300         * html/MediaKeyEvent.h:
3301         * platform/graphics/CDMSession.h:
3302         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
3303         (WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
3304         (WebCore::CDMSessionAVFoundationCF::update):
3305         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
3306         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
3307         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
3308         (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
3309         (WebCore::CDMSessionAVContentKeySession::update):
3310         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
3311         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
3312         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
3313         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
3314         (WebCore::CDMSessionAVFoundationObjC::update):
3315         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
3316         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
3317         (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
3318         (WebCore::CDMSessionAVStreamSession::update):
3319         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
3320         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3321         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3322         (WebCore::CDMSessionMediaSourceAVFObjC::layerDidReceiveError):
3323         (WebCore::CDMSessionMediaSourceAVFObjC::rendererDidReceiveError):
3324         (WebCore::CDMSessionMediaSourceAVFObjC::systemCodeForError): Deleted.
3325         * testing/MockCDM.cpp:
3326         (WebCore::MockCDMSession::generateKeyRequest):
3327         (WebCore::MockCDMSession::update):2016-01-15  Simon Fraser  <simon.fraser@apple.com>
3328
3329 2016-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3330
3331         [SOUP] GResource resources should be cached indefinitely in memory cache
3332         https://bugs.webkit.org/show_bug.cgi?id=153275
3333
3334         Reviewed by Žan Doberšek.
3335
3336         GResources can't change so they will always return the same data,
3337         we never need to revalidate them.
3338
3339         * loader/cache/CachedResource.cpp:
3340         (WebCore::shouldCacheSchemeIndefinitely):
3341
3342 2016-01-21  Nan Wang  <n_wang@apple.com>
3343
3344         AX: [IOS] Implement next/previous text marker functions using TextIterator
3345         https://bugs.webkit.org/show_bug.cgi?id=153292
3346         <rdar://problem/24268243>
3347
3348         Reviewed by Chris Fleizach.
3349
3350         Added support for the refactored next/previous text marker functions on iOS. And 
3351         made text marker tests working on iOS.
3352         Also, fixed an issue in AXObjectCache where creating a range with a replaced node
3353         at the start or end might exclude that node.
3354
3355         Tests: accessibility/text-marker/text-marker-previous-next.html
3356                accessibility/text-marker/text-marker-with-user-select-none.html
3357
3358         * accessibility/AXObjectCache.cpp:
3359         (WebCore::characterOffsetsInOrder):
3360         (WebCore::resetNodeAndOffsetForReplacedNode):
3361         (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
3362         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3363         (+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):
3364         (+[WebAccessibilityTextMarker textMarkerWithCharacterOffset:cache:]):
3365         (+[WebAccessibilityTextMarker startOrEndTextMarkerForRange:isStart:cache:]):
3366         (-[WebAccessibilityTextMarker dataRepresentation]):
3367         (-[WebAccessibilityTextMarker visiblePosition]):
3368         (-[WebAccessibilityTextMarker characterOffset]):
3369         (-[WebAccessibilityTextMarker isIgnored]):
3370         (-[WebAccessibilityTextMarker accessibilityObject]):
3371         (-[WebAccessibilityTextMarker description]):
3372         (-[WebAccessibilityObjectWrapper stringForTextMarkers:]):
3373         (blockquoteLevel):
3374         (-[WebAccessibilityObjectWrapper textMarkerRange]):
3375         (-[WebAccessibilityObjectWrapper accessibilityObjectForTextMarker:]):
3376         (-[WebAccessibilityObjectWrapper nextMarkerForMarker:]):
3377         (-[WebAccessibilityObjectWrapper previousMarkerForMarker:]):
3378         (-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
3379         (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
3380         (-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
3381         (-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
3382         (-[WebAccessibilityObjectWrapper lengthForTextMarkers:]):
3383         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForTextMarkers:isStart:]):
3384         (-[WebAccessibilityObjectWrapper textMarkerRangeForMarkers:]):
3385         (-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
3386
3387 2016-01-20  Zalan Bujtas  <zalan@apple.com>
3388
3389         http://victordarras.fr/cssgame/ doesn't work in Safari.
3390         https://bugs.webkit.org/show_bug.cgi?id=153285
3391         <rdar://problem/24212369>
3392
3393         Reviewed by Tim Horton.
3394
3395         This patch adds support for hittesting ClipPathOperation::Reference.
3396
3397         Tests: svg/clip-path/hittest-clip-path-reference-miss.html
3398
3399         * rendering/RenderBlock.cpp:
3400         (WebCore::RenderBlock::nodeAtPoint):
3401         * rendering/RenderObject.h:
3402         (WebCore::RenderObject::isSVGResourceClipper):
3403         * rendering/svg/RenderSVGResourceClipper.h:
3404         (isType):
3405
3406 2016-01-20  David Kilzer  <ddkilzer@apple.com>
3407
3408         ResourceHandleCFURLConnectionDelegateWithOperationQueue delegate methods don't NULL-check m_handle->client()
3409         <https://webkit.org/b/152675>
3410         <rdar://problem/24034044>
3411
3412         Reviewed by Brent Fulgham.
3413
3414         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3415         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
3416         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
3417         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
3418         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
3419         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
3420         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
3421         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
3422         - Add NULL check for m_handle->client() as is done in the
3423           WebCoreResourceHandleAsOperationQueueDelegate class in
3424           WebCoreResourceHandleAsOperationQueueDelegate.mm.  (The NULL
3425           check for -connection:didReceiveResponse: is currently
3426           missing, but there are crashes there, too, that are covered by
3427           Bug 152673.)
3428
3429 2016-01-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3430
3431         Use TinyLRUCache in caching the CGColorRef in WebCore::cachedCGColor()
3432         https://bugs.webkit.org/show_bug.cgi?id=153279
3433
3434         Reviewed by Dean Jackson.
3435
3436         Reuse the new template TinyLRUCache in caching the CGColor instead of
3437         having the same code repeated twice.
3438
3439         * platform/graphics/cg/ColorCG.cpp:
3440         (WebCore::leakCGColor):
3441         (WebCore::RetainPtr<CGColorRef>>::createValueForKey):
3442         (WebCore::cachedCGColor):
3443
3444 2016-01-20  Timothy Hatcher  <timothy@apple.com>
3445
3446         Web Inspector: InspectorCSSAgent does not call disable in willDestroyFrontendAndBackend
3447         https://bugs.webkit.org/show_bug.cgi?id=153289
3448         <rdar://problem/24242600>
3449
3450         Reviewed by Joseph Pecoraro.
3451
3452         * inspector/InspectorCSSAgent.cpp:
3453         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend): Call disable().
3454
3455 2016-01-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3456
3457         Refactor AtomicStringKeyedMRUCache to be a generic LRU cache
3458         https://bugs.webkit.org/show_bug.cgi?id=153109
3459
3460         Reviewed by Darin Adler.
3461
3462         Replace the template specialization of AtomicStringKeyedMRUCache with
3463         template derived from TinyLRUCachePolicy. Override the functions which
3464         are needed for creating the values and the null value. Also replace the
3465         static function which was returning a NeverDestroyed AtomicStringKeyedMRUCache
3466         with a singleton function 'cache' inside the derived template.
3467
3468         * WebCore.xcodeproj/project.pbxproj:
3469         * platform/text/AtomicStringKeyedMRUCache.h: Removed.
3470         * platform/text/cf/HyphenationCF.cpp:
3471         (WebCore::canHyphenate):
3472         (WebCore::lastHyphenLocation):
3473         (WebCore::AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef>>::createValueForNullKey): Deleted.
3474         (WebCore::AtomicStringKeyedMRUCache<RetainPtr<CFLocaleRef>>::createValueForKey): Deleted.
3475         (WebCore::cfLocaleCache): Deleted.
3476         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3477         (WebCore::countLeadingSpaces):
3478         (WebCore::lastHyphenLocation):
3479         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): Deleted.
3480         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Deleted.
3481         (WebCore::hyphenDictionaryCache): Deleted.
3482
3483 2016-01-20  Chris Dumez  <cdumez@apple.com>
3484
3485         Drop support for obsolete Node.isSupported()
3486         https://bugs.webkit.org/show_bug.cgi?id=153164
3487
3488         Reviewed by Darin Adler.
3489
3490         Drop support for obsolete Node.isSupported(). Chrome and Firefox already
3491         dropped it.
3492
3493         No new tests, already covered by existing test.
3494
3495         * dom/Node.cpp:
3496         (WebCore::Node::isSupportedForBindings):
3497         * dom/Node.h:
3498         * dom/Node.idl:
3499
3500 2016-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3501
3502         Unreviewed. Fix compile warning when building with GTK+ < 3.14.
3503
3504         * rendering/RenderThemeGtk.cpp:
3505         (WebCore::loadThemedIcon):
3506
3507 2016-01-20  Csaba Osztrogonác  <ossy@webkit.org>
3508
3509         [Mac] Speculative cmake buildfix after r195317.