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