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