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