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