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