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