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