Outline should contribute to visual overflow.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-02-06  Zalan Bujtas  <zalan@apple.com>
2
3         Outline should contribute to visual overflow.
4         https://bugs.webkit.org/show_bug.cgi?id=153299
5
6         This patch eliminates the special outline handling (RenderView::setMaximalOutlineSize).
7         Now that outline is part of visual overflow, we don't have to inflate the layers to accomodate
8         outline borders.
9         This patch fixes several focusring related repaint issues. However when both the outline: auto
10         and the descendant renderer are composited, we still don't paint properly in certain cases. -not a regression.
11         (Also when parent renderer has overflow: hidden repaint does not take outline into account. -regression.)
12         It changes column behavior (see TestExpectations) since outline behaves now like any other visual overflow properties.
13
14         Reviewed by David Hyatt.
15
16         Test: fast/repaint/focus-ring-repaint.html
17               fast/repaint/focus-ring-repaint-with-negative-offset.html
18
19         * css/html.css: resetting to old behavior.
20         (:focus):
21         (input:focus, textarea:focus, isindex:focus, keygen:focus, select:focus):
22         * rendering/InlineFlowBox.cpp:
23         (WebCore::InlineFlowBox::addToLine):
24         (WebCore::InlineFlowBox::addOutlineVisualOverflow):
25         (WebCore::InlineFlowBox::computeOverflow):
26         (WebCore::InlineFlowBox::paint): Deleted.
27         * rendering/InlineFlowBox.h:
28         * rendering/RenderBlock.cpp:
29         (WebCore::RenderBlock::computeOverflow):
30         (WebCore::RenderBlock::outlineStyleForRepaint):
31         (WebCore::RenderBlock::paint): Deleted.
32         * rendering/RenderBlockFlow.cpp:
33         (WebCore::RenderBlockFlow::layoutBlock): Deleted.
34         (WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren): Deleted.
35         * rendering/RenderBlockLineLayout.cpp:
36         (WebCore::RenderBlockFlow::addOverflowFromInlineChildren):
37         * rendering/RenderBox.cpp:
38         (WebCore::RenderBox::addVisualEffectOverflow):
39         (WebCore::RenderBox::applyVisualEffectOverflow):
40         (WebCore::RenderBox::clippedOverflowRectForRepaint): Deleted.
41         * rendering/RenderBoxModelObject.h:
42         * rendering/RenderDetailsMarker.cpp:
43         (WebCore::RenderDetailsMarker::paint): Deleted.
44         * rendering/RenderElement.cpp:
45         (WebCore::RenderElement::insertChildInternal):
46         (WebCore::RenderElement::styleDidChange):
47         (WebCore::RenderElement::repaintAfterLayoutIfNeeded):
48         (WebCore::RenderElement::issueRepaintForOutlineAuto):
49         (WebCore::RenderElement::updateOutlineAutoAncestor):
50         (WebCore::RenderElement::computeMaxOutlineSize): Deleted.
51         (WebCore::RenderElement::styleWillChange): Deleted.
52         * rendering/RenderElement.h:
53         (WebCore::RenderElement::hasContinuation):
54         * rendering/RenderInline.cpp:
55         (WebCore::RenderInline::paintOutlineForLine): Deleted.
56         * rendering/RenderLayer.cpp:
57         (WebCore::RenderLayer::calculateClipRects):
58         * rendering/RenderLineBoxList.cpp:
59         (WebCore::RenderLineBoxList::anyLineIntersectsRect):
60         (WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
61         (WebCore::RenderLineBoxList::paint):
62         (WebCore::isOutlinePhase): Deleted.
63         * rendering/RenderLineBoxList.h:
64         * rendering/RenderListBox.cpp:
65         (WebCore::RenderListBox::computePreferredLogicalWidths):
66         * rendering/RenderListMarker.cpp:
67         (WebCore::RenderListMarker::paint): Deleted.
68         * rendering/RenderObject.cpp:
69         (WebCore::RenderObject::propagateRepaintToParentWithOutlineAutoIfNeeded): The renderer with outline: auto is responsible for
70         painting focusring around the descendants. If we issued repaint only on the descendant when it changes,
71         the focusring would not refresh properly. We have to find the ancestor with outline: auto, inflate the repaint rect and
72         issue the repaint on the ancestor if we crossed repaint container.
73  
74         (WebCore::RenderObject::repaintUsingContainer):
75         (WebCore::RenderObject::adjustRectForOutlineAndShadow):
76         (WebCore::RenderObject::setHasOutlineAutoAncestor):
77         (WebCore::RenderObject::adjustRectWithMaximumOutline): Deleted.
78         
79         * rendering/RenderObject.h: We mark the descendants of outline: auto so that
80         when a child renderer changes we can propagate the repaint to the ancestor with outline.
81
82         (WebCore::RenderObject::hasOutlineAutoAncestor):
83         (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
84         * rendering/RenderRegion.cpp:
85         (WebCore::RenderRegion::overflowRectForFlowThreadPortion):
86         * rendering/RenderReplaced.cpp:
87         (WebCore::RenderReplaced::shouldPaint): Deleted.
88         (WebCore::RenderReplaced::clippedOverflowRectForRepaint): Deleted.
89         * rendering/RenderTable.cpp:
90         (WebCore::RenderTable::paint): Deleted.
91         * rendering/RenderTableCell.cpp:
92         (WebCore::RenderTableCell::clippedOverflowRectForRepaint): Deleted.
93         (WebCore::RenderTableCell::paintCollapsedBorders): Deleted.
94         * rendering/RenderTableRow.cpp:
95         (WebCore::RenderTableRow::layout):
96         (WebCore::RenderTableRow::clippedOverflowRectForRepaint): Deleted.
97         * rendering/RenderTableSection.cpp:
98         (WebCore::RenderTableSection::layoutRows):
99         (WebCore::RenderTableSection::computeOverflowFromCells): Deleted.
100         (WebCore::RenderTableSection::paintObject): Deleted.
101         * rendering/RenderTheme.h:
102         (WebCore::RenderTheme::platformFocusRingWidth):
103         * rendering/RenderView.cpp:
104         (WebCore::RenderView::setMaximalOutlineSize): Deleted.
105         * rendering/RenderView.h:
106         * rendering/style/RenderStyle.cpp:
107         (WebCore::RenderStyle::changeAffectsVisualOverflow):
108         (WebCore::RenderStyle::outlineWidth):
109         * rendering/style/RenderStyle.h:
110
111 2016-02-06  Andreas Kling  <akling@apple.com>
112
113         [iOS] Throw away linked code when navigating to a new page.
114         <https://webkit.org/b/153851>
115
116         Reviewed by Gavin Barraclough.
117
118         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
119         Linked code is tied to a specific global object, and as we're creating a new one for the
120         new page, none of it is useful to us here.
121
122         In the event that the user navigates back, the cost of relinking some code will be far
123         lower than the memory cost of keeping all of it around.
124
125         This landed previously but was rolled out due to a Speedometer regression. I've made one
126         minor but important change here: only throw away code if we're navigating away from an
127         existing history item. Or in other words, don't throw away code for "force peeks" or any
128         other navigations that are not traditional top-level main frame navigations.
129
130         * bindings/js/GCController.cpp:
131         (WebCore::GCController::deleteAllLinkedCode):
132         * bindings/js/GCController.h:
133         * loader/FrameLoader.cpp:
134         (WebCore::FrameLoader::commitProvisionalLoad):
135
136 2016-02-06  Konstantin Tokarev  <annulen@yandex.ru>
137
138         Added implementations of AXObjectCache methods for !HAVE(ACCESSIBILITY).
139         https://bugs.webkit.org/show_bug.cgi?id=153924
140
141         Reviewed by Andreas Kling.
142
143         No new tests needed.
144
145         * accessibility/AXObjectCache.h:
146         (WebCore::AXObjectCache::ariaModalNode): Added stub implementation.
147         (WebCore::AXObjectCache::postLiveRegionChangeNotification): Ditto.
148         (WebCore::AXObjectCache::rangeForNodeContents): Ditto.
149         (WebCore::AXObjectCache::setIsSynchronizingSelection): Ditto.
150         (WebCore::AXObjectCache::setTextSelectionIntent): Ditto.
151         (WebCore::AXAttributeCacheEnabler::AXAttributeCacheEnabler): Ditto.
152         (WebCore::AXAttributeCacheEnabler::~AXAttributeCacheEnabler): Ditto.
153
154 2016-02-04  Antti Koivisto  <antti@apple.com>
155
156         Use scope stack instead of nested TreeResolvers for shadow trees
157         https://bugs.webkit.org/show_bug.cgi?id=153893
158
159         Reviewed by Andreas Kling.
160
161         Make TreeResolver per-document. This is a step towards iterative style resolve.
162
163         This is done replacing use of nested TreeResolvers with a scope stack that maintains
164         the style resolver and the selector filter for the current tree scope.
165
166         * style/StyleTreeResolver.cpp:
167         (WebCore::Style::ensurePlaceholderStyle):
168         (WebCore::Style::TreeResolver::Scope::Scope):
169         (WebCore::Style::TreeResolver::TreeResolver):
170         (WebCore::Style::shouldCreateRenderer):
171         (WebCore::Style::TreeResolver::styleForElement):
172         (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot):
173         (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees):
174         (WebCore::Style::TreeResolver::createRenderTreeRecursively):
175         (WebCore::Style::TreeResolver::resolveLocally):
176         (WebCore::Style::TreeResolver::resolveShadowTree):
177         (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement):
178         (WebCore::Style::TreeResolver::resolveChildren):
179         (WebCore::Style::TreeResolver::resolveSlotAssignees):
180         (WebCore::Style::TreeResolver::resolveRecursively):
181         (WebCore::Style::TreeResolver::resolve):
182         (WebCore::Style::detachRenderTree):
183         * style/StyleTreeResolver.h:
184         (WebCore::Style::TreeResolver::scope):
185         (WebCore::Style::TreeResolver::pushScope):
186         (WebCore::Style::TreeResolver::pushEnclosingScope):
187         (WebCore::Style::TreeResolver::popScope):
188
189 2016-02-06  Commit Queue  <commit-queue@webkit.org>
190
191         Unreviewed, rolling out r196104.
192         https://bugs.webkit.org/show_bug.cgi?id=153940
193
194         Regressed Speedometer on iOS (Requested by kling on #webkit).
195
196         Reverted changeset:
197
198         "[iOS] Throw away linked code when navigating to a new page."
199         https://bugs.webkit.org/show_bug.cgi?id=153851
200         http://trac.webkit.org/changeset/196104
201
202 2016-02-05  Beth Dakin  <bdakin@apple.com>
203
204         ScrollbarPainters needs to be deallocated on the main thread
205         https://bugs.webkit.org/show_bug.cgi?id=153932
206         -and corresponding-
207         rdar://problem/24015483
208
209         Reviewed by Geoff Garen.
210
211         Follow-up fix since the first one was still race-y.
212         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
213         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
214         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
215
216 2016-02-05  Beth Dakin  <bdakin@apple.com>
217
218         ScrollbarPainters needs to be deallocated on the main thread
219         https://bugs.webkit.org/show_bug.cgi?id=153932
220         -and corresponding-
221         rdar://problem/24015483
222
223         Reviewed by Tim Horton.
224
225         Ensure the the destructor of ScrollingTreeFrameScrollingNodeMac and the 
226         assignments done in this class are not responsible for deallocating the 
227         ScrollbarPainter. 
228         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
229         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
230         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
231
232 2016-02-05  Chris Dumez  <cdumez@apple.com>
233
234         Instance property getters / setters cannot be called on another instance of the same type
235         https://bugs.webkit.org/show_bug.cgi?id=153895
236
237         Reviewed by Gavin Barraclough.
238
239         It should be possible to call instance property getters / setters on
240         other instances of the same type, as per the WEB IDL specification:
241         - http://heycam.github.io/webidl/#dfn-attribute-getter
242         - http://heycam.github.io/webidl/#dfn-attribute-setter
243
244         This matches the behavior of Firefox.
245
246         The issue without our bindings was that the getters / setters were
247         using |slotBase| instead of |thisValue| and therefore ended up using
248         the instance the getter was taken from instead of the actual target
249         object.
250
251         Test:
252         js/instance-property-getter-other-instance.html
253         js/instance-property-setter-other-instance.html
254
255         * bindings/scripts/CodeGeneratorJS.pm:
256         (GenerateImplementation):
257         - Have instance getters / setters use thisValue instead of slotBase.
258         - In the case of interfaces that have attributes on the instance for
259           compatibility reasons, try the prototype object if |thisValue| does
260           does have the right type, instead of using slotBase like previously.
261           I believe this maintains the original compatibility intention while
262           also behaving correctly when called on another instance.
263
264         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
265         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
266         * bindings/scripts/test/JS/JSTestException.cpp:
267         * bindings/scripts/test/JS/JSTestInterface.cpp:
268         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
269         * bindings/scripts/test/JS/JSTestNode.cpp:
270         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
271         * bindings/scripts/test/JS/JSTestObj.cpp:
272         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
273         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
274         * bindings/scripts/test/JS/JSattribute.cpp:
275         Rebaseline bindings tests.
276
277 2016-02-05  Brady Eidson  <beidson@apple.com>
278
279         Modern IDB: UniqueIDBDatabase's m_databaseInfo is unsafely used from multiple threads.
280         https://bugs.webkit.org/show_bug.cgi?id=153912
281
282         Reviewed by Alex Christensen.
283
284         No new tests (Anything testable about this patch is already covered by existing tests).
285
286         * Modules/indexeddb/server/IDBBackingStore.h:
287
288         * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
289         (WebCore::IDBServer::MemoryIDBBackingStore::infoForObjectStore):
290         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
291
292         Teach the SQLiteIDBBackingStore to actually keep its m_databaseInfo up to date as it changes,
293         and to revert it when version change transactions abort:
294         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
295         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
296         (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
297         (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
298         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
299         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
300         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
301         (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
302         (WebCore::IDBServer::SQLiteIDBBackingStore::infoForObjectStore):
303         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
304
305         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
306         (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Use the IDBBackingStore's copy of the 
307           IDBObjectStoreInfo, meant only for the database thread, instead of the UniqueIDBDatabase's copy, 
308           which is meant only for the main thread.
309
310 2016-02-05  Alex Christensen  <achristensen@webkit.org>
311
312         Clean up Blob code
313         https://bugs.webkit.org/show_bug.cgi?id=153910
314
315         Reviewed by Alexey Proskuryakov.
316
317         No new tests, no change in behavior.
318
319         * css/StyleSheet.h:
320         * fileapi/Blob.cpp:
321         (WebCore::Blob::Blob):
322         (WebCore::Blob::normalizedContentType):
323         (WebCore::Blob::isNormalizedContentType):
324         (WebCore::Blob::registry):
325         * fileapi/Blob.h:
326         * fileapi/BlobURL.cpp:
327         (WebCore::BlobURL::createPublicURL):
328         * fileapi/BlobURL.h:
329         (WebCore::BlobURL::BlobURL):
330         (WebCore::BlobURL::blobProtocol): Deleted.
331         * platform/PlatformStrategies.cpp:
332         (WebCore::setPlatformStrategies):
333         (WebCore::hasPlatformStrategies): Deleted.
334         * platform/PlatformStrategies.h:
335         * platform/network/BlobRegistry.cpp:
336         (WebCore::blobRegistry):
337         * platform/network/BlobRegistry.h:
338         * platform/network/BlobRegistryImpl.cpp:
339         (WebCore::BlobRegistryImpl::~BlobRegistryImpl):
340         (WebCore::createResourceHandle):
341         (WebCore::registerBlobResourceHandleConstructor):
342         (WebCore::BlobRegistryImpl::createResourceHandle):
343         (WebCore::BlobRegistryImpl::appendStorageItems):
344         (WebCore::BlobRegistryImpl::registerFileBlobURL):
345         (WebCore::BlobRegistryImpl::registerBlobURL):
346         * platform/network/BlobRegistryImpl.h:
347         * platform/network/BlobResourceHandle.cpp:
348         (WebCore::BlobResourceHandle::loadResourceSynchronously):
349         (WebCore::BlobResourceHandle::BlobResourceHandle):
350         * platform/network/ResourceHandle.h:
351
352 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
353
354         [GTK] Scrollbars incorrectly rendered with older versions of GTK+
355         https://bugs.webkit.org/show_bug.cgi?id=153861
356
357         Reviewed by Michael Catanzaro.
358
359         The theme doesn't really know it's a scrollbar. Older versions of
360         GTK+ require to explicitly add the scrollbar style class to the
361         child GtkStyleContext.
362
363         * platform/gtk/ScrollbarThemeGtk.cpp:
364         (WebCore::createChildStyleContext):
365
366 2016-02-05  Carlos Garcia Campos  <cgarcia@igalia.com>
367
368         [GTK] Scrollbars not correctly rendered in non GNOME environments
369         https://bugs.webkit.org/show_bug.cgi?id=153860
370
371         Reviewed by Michael Catanzaro.
372
373         I noticed this in a matchbox environment, where there's no
374         gnome-setting-daemon running. The problem is only with the
375         scrollbars, because we initialize the GtkSettings in
376         RenderThemeGtk and notify the ScrollbarTheme when it changes, but
377         ScrollbarTheme is created before RenderThemeGtk so we initialize
378         the theme properties before the GtkSettings have been
379         initialized. We can just let the ScrollbarTheme monitor the
380         theme itself instead of relying on being notified by the WebCore
381         layer.
382
383         * platform/gtk/ScrollbarThemeGtk.cpp:
384         (WebCore::themeChangedCallback):
385         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
386         * rendering/RenderThemeGtk.cpp:
387         (WebCore::gtkStyleChangedCallback): Deleted.
388
389 2016-02-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
390
391         Remove DOMWrapped parameter from JSKeyValueIterator
392         https://bugs.webkit.org/show_bug.cgi?id=153859
393
394         Reviewed by Sam Weinig.
395
396         No change in behavior.
397
398         Using std::declval to infer DOMWrapped from JSWrapper::wrapped.
399
400         * bindings/js/JSFetchHeadersCustom.cpp:
401         (WebCore::JSFetchHeaders::entries):
402         (WebCore::JSFetchHeaders::keys):
403         (WebCore::JSFetchHeaders::values):
404         * bindings/js/JSKeyValueIterator.h:
405         (WebCore::createIterator):
406         (WebCore::JSKeyValueIterator<JSWrapper>::destroy):
407         (WebCore::JSKeyValueIterator<JSWrapper>::next):
408         (WebCore::JSKeyValueIteratorPrototypeFunctionNext):
409         (WebCore::JSKeyValueIteratorPrototype<JSWrapper>::finishCreation):
410
411 2016-02-05  Nan Wang  <n_wang@apple.com>
412
413         AX: WebKit hanging when VoiceOver attempts to focus in on page
414         https://bugs.webkit.org/show_bug.cgi?id=153899
415         <rdar://problem/24506603>
416
417         Reviewed by Chris Fleizach.
418
419         The VisiblePosition to CharacterOffset conversion will lead to an infinite loop if the
420         nextVisiblePostion call is returning the original VisiblePosition. Fixed it by breaking out
421         of the loop early in that situation. 
422
423         Test: accessibility/text-marker/character-offset-visible-position-conversion-hang.html
424
425         * accessibility/AXObjectCache.cpp:
426         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
427
428 2016-02-04  Joseph Pecoraro  <pecoraro@apple.com>
429
430         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
431         https://bugs.webkit.org/show_bug.cgi?id=153500
432         <rdar://problem/24352458>
433
434         Reviewed by Timothy Hatcher.
435
436         * bindings/js/JSDOMWindowBase.cpp:
437         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
438         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
439         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
440         * bindings/js/JSDOMWindowBase.h:
441         * bindings/js/JSWorkerGlobalScopeBase.cpp:
442         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
443         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
444         * bindings/js/JSWorkerGlobalScopeBase.h:
445         * inspector/InspectorController.h:
446         * inspector/InspectorController.cpp:
447         (WebCore::InspectorController::legacyProfilerEnabled):
448         (WebCore::InspectorController::setLegacyProfilerEnabled):
449         Be more explicit about enabling legacy profiling.
450
451         * inspector/InspectorTimelineAgent.cpp:
452         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
453         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
454         TimelineAgent doesn't need to recompile if using the sampling profiler.
455         This breaks console.profile, but console.profile should move to using
456         the sampling profiler as well.
457
458         (WebCore::InspectorTimelineAgent::startFromConsole):
459         (WebCore::InspectorTimelineAgent::stopFromConsole):
460         (WebCore::startProfiling): Deleted.
461         (WebCore::stopProfiling): Deleted.
462         Inlined the use once static functions.
463
464         * page/PageConsoleClient.cpp:
465         (WebCore::PageConsoleClient::profile):
466         (WebCore::PageConsoleClient::profileEnd):
467         Added FIXMEs for improving console.profile and profileEnd.
468
469         * testing/Internals.cpp:
470         (WebCore::Internals::resetToConsistentState):
471         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
472         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
473         * testing/Internals.h:
474         * testing/Internals.idl:
475         Be more explicit about enabling legacy profiling.
476
477 2016-02-04  Brent Fulgham  <bfulgham@apple.com>
478
479         Follow-up: Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
480         https://bugs.webkit.org/show_bug.cgi?id=153657
481         <rdar://problem/24413107>
482
483         Reviewed by Darin Adler.
484
485         * plugins/PluginData.cpp:
486         (WebCore::shouldBePubliclyVisible): Revise comments to provide a
487         better explanation of the function and why it exists.
488
489 2016-02-04  Jonathan Davis  <jond@apple.com>
490
491         Add Fetch API and CSS Variables to feature status
492         https://bugs.webkit.org/show_bug.cgi?id=153896
493
494         Reviewed by Timothy Hatcher.
495
496         * features.json:
497
498 2016-02-04  Daniel Bates  <dabates@apple.com>
499
500         WebKit for iOS Simulator fails to build with public iOS SDK
501         https://bugs.webkit.org/show_bug.cgi?id=153881
502
503         Reviewed by Alex Christensen.
504
505         Make constants have internal linkage to match the Apple Internal SDK.
506
507         * platform/spi/ios/MobileGestaltSPI.h:
508
509 2016-02-04  Chris Dumez  <cdumez@apple.com>
510
511         Object.getOwnPropertyDescriptor() returns incomplete descriptor for instance properties
512         https://bugs.webkit.org/show_bug.cgi?id=153817
513
514         Reviewed by Geoffrey Garen.
515
516         Update the bindings generator so that property getters / setters now
517         make sure |this| has the right type and throw a TypeError if it does
518         not, as per:
519         - http://heycam.github.io/webidl/#dfn-attribute-getter (step 2.4.2)
520         - http://heycam.github.io/webidl/#dfn-attribute-setter (step 3.5)
521
522         This was an issue when doing something like:
523         Object.getOwnPropertyDescriptor(window, "location").get.call(nonWindow)
524
525         We would call toJSDOMWindow(thisValue), which would return null as
526         thisValue is not a JSDOMWindow. We would then dereference this null
527         pointer and crash. We now do a null check and throw a TypeError in
528         this case, as per the Web IDL specification.
529
530         The generated bindings still have some non-spec compliant behavior
531         though:
532         1. The getters / setters of instance properties use slotBase instead
533            of thisValue, which means that calling instanceA's getter on
534            instanceB returns instanceA's property insteas of instanceB's.
535         2. Global object property getters should not require an explicit
536            |this| so calling the following should work:
537            - Object.getOwnPropertyDescriptor(window, "location").get.call()
538            We currently throw in this case.
539
540         These issues will be addressed in follow-up patches.
541
542         Tests: js/getOwnPropertyDescriptor-unforgeable-attributes.html
543                js/getOwnPropertyDescriptor-window-attributes.html
544                js/instance-property-getter-other-instance.html
545
546         * bindings/scripts/CodeGeneratorJS.pm:
547         (GenerateImplementation):
548         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
549         (WebCore::jsTestActiveDOMObjectExcitingAttr):
550         * bindings/scripts/test/JS/JSTestException.cpp:
551         (WebCore::jsTestExceptionName):
552         * bindings/scripts/test/JS/JSTestObj.cpp:
553         (WebCore::jsTestObjConstructorTestSubObj):
554         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
555         (WebCore::jsTestObjConditionalAttr4Constructor):
556         (WebCore::jsTestObjConditionalAttr5Constructor):
557         (WebCore::jsTestObjConditionalAttr6Constructor):
558         (WebCore::jsTestObjContentDocument):
559         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
560         (WebCore::setJSTestObjConditionalAttr4Constructor):
561         (WebCore::setJSTestObjConditionalAttr5Constructor):
562         (WebCore::setJSTestObjConditionalAttr6Constructor):
563         (WebCore::setJSTestObjConstructor): Deleted.
564         (WebCore::setJSTestObjConstructorStaticStringAttr): Deleted.
565         (WebCore::setJSTestObjConditionalAttr3): Deleted.
566         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
567         (WebCore::jsTestTypedefsConstructorTestSubObj):
568
569 2016-02-04  Brady Eidson  <beidson@apple.com>
570
571         Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
572         https://bugs.webkit.org/show_bug.cgi?id=153438.
573
574         Reviewed by Alex Christensen.
575
576         Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
577                storage/indexeddb/modern/idbkey-array-equality.html
578
579         * Modules/indexeddb/IDBKeyData.cpp:
580         (WebCore::IDBKeyData::loggingString):
581         (WebCore::IDBKeyData::operator==): Fix obvious bug.
582
583 2016-02-04  Chris Dumez  <cdumez@apple.com>
584
585         Unreviewed, fix the EFL clean build after r196123
586         https://bugs.webkit.org/show_bug.cgi?id=153875
587
588         * CMakeLists.txt:
589         * PlatformGTK.cmake:
590         * PlatformMac.cmake:
591         * html/DOMSettableTokenList.h:
592         * html/DOMSettableTokenList.idl:
593
594 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
595
596         PageGroup::captionPreferences should return a reference
597         https://bugs.webkit.org/show_bug.cgi?id=153877
598         <rdar://problem/24506917>
599
600         Reviewed by Jer Noble.
601
602         No new tests, no functional change.
603
604         * Modules/mediacontrols/MediaControlsHost.cpp:
605         (WebCore::MediaControlsHost::sortedTrackListForMenu):
606         (WebCore::MediaControlsHost::displayNameForTrack):
607         (WebCore::MediaControlsHost::captionMenuOffItem):
608         (WebCore::MediaControlsHost::captionDisplayMode):
609         * dom/Document.cpp:
610         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks):
611         * html/HTMLMediaElement.cpp:
612         (WebCore::HTMLMediaElement::HTMLMediaElement):
613         (WebCore::HTMLMediaElement::addTextTrack):
614         (WebCore::HTMLMediaElement::configureTextTrackGroup):
615         (WebCore::HTMLMediaElement::setSelectedTextTrack):
616         (WebCore::HTMLMediaElement::configureTextTracks):
617         (WebCore::HTMLMediaElement::captionPreferencesChanged):
618         (WebCore::HTMLMediaElement::mediaPlayerPreferredAudioCharacteristics):
619         * html/shadow/MediaControlElements.cpp:
620         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
621         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
622         (WebCore::MediaControlTextTrackContainerElement::updateActiveCuesFontSize):
623         * page/PageGroup.cpp:
624         (WebCore::PageGroup::captionPreferencesChanged):
625         (WebCore::PageGroup::captionPreferences):
626         * page/PageGroup.h:
627         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
628         (WebVideoFullscreenModelVideoElement::updateLegibleOptions):
629         * testing/InternalSettings.cpp:
630         (WebCore::InternalSettings::setShouldDisplayTrackKind):
631         (WebCore::InternalSettings::shouldDisplayTrackKind):
632         * testing/Internals.cpp:
633         (WebCore::Internals::resetToConsistentState):
634         (WebCore::Internals::Internals):
635         (WebCore::Internals::userPreferredAudioCharacteristics):
636         (WebCore::Internals::setUserPreferredAudioCharacteristic):
637         (WebCore::Internals::captionsStyleSheetOverride):
638         (WebCore::Internals::setCaptionsStyleSheetOverride):
639         (WebCore::Internals::setPrimaryAudioTrackLanguageOverride):
640         (WebCore::Internals::setCaptionDisplayMode):
641
642 2016-02-04  Konstantin Tokarev  <annulen@yandex.ru>
643
644         Removed unused Settings::setPrivateBrowsingEnabled.
645         https://bugs.webkit.org/show_bug.cgi?id=153869
646
647         Reviewed by Alexey Proskuryakov.
648
649         Implementation of Settings::setPrivateBrowsingEnabled was removed
650         in r166661, but declaration is still here.
651
652         No new tests needed.
653
654         * page/Settings.h:
655         (WebCore::Settings::setPrivateBrowsingEnabled): Deleted.
656
657 2016-02-04  Eric Carlson  <eric.carlson@apple.com>
658
659         Don't discard in-band cues with negative start times
660         https://bugs.webkit.org/show_bug.cgi?id=153867
661         <rdar://problem/19588632>
662
663         Reviewed by Jer Noble.
664
665         No new tests, updated and un-skipped http/tests/media/track-in-band-hls-metadata.html.
666
667         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
668         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):  ASSERT if passed negative time value.
669         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Ditto. Correct logging.
670
671         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
672         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): ASSERT if passed negative time value.
673         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Convert negative cue times to zero.
674         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
675           Ditto.
676
677 2016-02-04  Hyemi Shin  <hyemi.sin@samsung.com>
678
679         Specify an exception for createChannelMerger, createChannelSplitter and createPeriodicWave
680         https://bugs.webkit.org/show_bug.cgi?id=150925
681
682         Reviewed by Darin Adler.
683
684         createChannelMerger and createChannelSplitter should throw INDEX_SIZE_ERR
685         for invalid numberOfInputs value.
686         createPeriodicWave should throw INDEX_SIZE_ERR for invalid lengths of parameters.
687
688         Tests: webaudio/audiochannelmerger-basic.html
689                webaudio/audiochannelsplitter.html
690                webaudio/periodicwave-lengths.html
691
692         * Modules/webaudio/AudioContext.cpp:
693         (WebCore::AudioContext::createChannelSplitter):
694         (WebCore::AudioContext::createChannelMerger):
695         (WebCore::AudioContext::createPeriodicWave):
696
697 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
698
699         [Fetch API] Add support for iterating over Headers
700         https://bugs.webkit.org/show_bug.cgi?id=153787
701
702         Reviewed by Darin Adler.
703
704         Relanding, updating bindings/js/JSKeyValueIterator.h for Windows bots.
705
706         Covered by updated tests.
707         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
708         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
709         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
710
711         * CMakeLists.txt:
712         * Modules/fetch/FetchHeaders.cpp:
713         (WebCore::FetchHeaders::Iterator::next):
714         (WebCore::FetchHeaders::Iterator::Iterator):
715         * Modules/fetch/FetchHeaders.h:
716         (WebCore::FetchHeaders::createIterator):
717         * Modules/fetch/FetchHeaders.idl:
718         * WebCore.xcodeproj/project.pbxproj:
719         * bindings/js/JSBindingsAllInOne.cpp:
720         * bindings/js/JSDOMBinding.h:
721         (WebCore::jsPair):
722         * bindings/js/JSFetchHeadersCustom.cpp: Added.
723         (WebCore::JSFetchHeaders::entries):
724         (WebCore::JSFetchHeaders::keys):
725         (WebCore::JSFetchHeaders::values):
726         * bindings/js/JSKeyValueIterator.h: Added.
727         (WebCore::JSKeyValueIteratorPrototype::create):
728         (WebCore::JSKeyValueIteratorPrototype::createStructure):
729         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
730         (WebCore::createIterator):
731         (WebCore::DOMWrapped>::destroy):
732         (WebCore::DOMWrapped>::next):
733         (WebCore::DOMWrapped>::finishCreation):
734
735 2016-02-04  Chris Dumez  <cdumez@apple.com>
736
737         Merge DOMTokenList and DOMSettableTokenList
738         https://bugs.webkit.org/show_bug.cgi?id=153677
739         <rdar://problem/24419675>
740
741         Reviewed by Sam Weinig.
742
743         Merge DOMTokenList and DOMSettableTokenList, as per a recent
744         specification change:
745         - https://github.com/whatwg/dom/pull/120
746         - https://github.com/whatwg/html/issues/361
747
748         No new tests, already covered by existing tests.
749
750         * CMakeLists.txt:
751         * DerivedSources.cpp:
752         * WebCore.vcxproj/WebCore.vcxproj:
753         * WebCore.vcxproj/WebCore.vcxproj.filters:
754         * WebCore.xcodeproj/project.pbxproj:
755         * dom/Element.idl:
756         * dom/Node.h:
757         * dom/NodeRareData.h:
758         * html/AttributeDOMTokenList.h:
759         * html/DOMSettableTokenList.cpp: Removed.
760         * html/DOMSettableTokenList.h:
761         * html/DOMSettableTokenList.idl:
762         * html/DOMTokenList.cpp:
763         (WebCore::DOMTokenList::setValue):
764         * html/DOMTokenList.h:
765         * html/DOMTokenList.idl:
766         * html/HTMLAnchorElement.idl:
767         * html/HTMLAreaElement.idl:
768         * html/HTMLElement.cpp:
769         * html/HTMLElement.idl:
770         * html/HTMLIFrameElement.cpp:
771         (WebCore::HTMLIFrameElement::sandbox):
772         * html/HTMLIFrameElement.h:
773         * html/HTMLIFrameElement.idl:
774         * html/HTMLLinkElement.cpp:
775         (WebCore::HTMLLinkElement::sizes):
776         * html/HTMLLinkElement.h:
777         * html/HTMLLinkElement.idl:
778         * html/HTMLOutputElement.cpp:
779         (WebCore::HTMLOutputElement::htmlFor):
780         * html/HTMLOutputElement.h:
781         * html/HTMLOutputElement.idl:
782         * html/HTMLTableCellElement.idl:
783         * page/DOMWindow.cpp:
784         * page/DOMWindow.idl:
785
786 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
787
788         Unreviewed.
789         Reverting r196115 and r19116, related tohttps://bugs.webkit.org/show_bug.cgi?id=153787.
790
791 2016-02-04  Alejandro G. Castro  <alex@igalia.com>
792
793         [GTK] Implement mediastream mediaplayer
794         https://bugs.webkit.org/show_bug.cgi?id=153541
795
796         Reviewed by Martin Robinson.
797
798         Added the implementation of the mediaplayer for the
799         mediastream. The code was implemented by Philippe Normand and
800         Alessandro Decina.
801
802         * PlatformGTK.cmake: Added the file to the compilation.
803         * html/HTMLMediaElement.cpp:
804         (WebCore::HTMLMediaElement::setSrcObject): Set the src of the
805         media element to the mediastream.
806         * platform/graphics/MediaPlayer.cpp:
807         (WebCore::buildMediaEnginesVector): Register the mediastream
808         mediaplayer as an option in the media engines vector.
809         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp: Added.
810         (WebCore::MediaPlayerPrivateGStreamerOwr::MediaPlayerPrivateGStreamerOwr):
811         (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
812         (WebCore::MediaPlayerPrivateGStreamerOwr::play):
813         (WebCore::MediaPlayerPrivateGStreamerOwr::pause):
814         (WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo):
815         (WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio):
816         (WebCore::MediaPlayerPrivateGStreamerOwr::currentTime):
817         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
818         (WebCore::MediaPlayerPrivateGStreamerOwr::loadingFailed):
819         (WebCore::MediaPlayerPrivateGStreamerOwr::didLoadingProgress):
820         (WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad):
821         (WebCore::MediaPlayerPrivateGStreamerOwr::stop):
822         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
823         (WebCore::MediaPlayerPrivateGStreamerOwr::getSupportedTypes):
824         (WebCore::MediaPlayerPrivateGStreamerOwr::supportsType):
825         (WebCore::MediaPlayerPrivateGStreamerOwr::isAvailable):
826         (WebCore::MediaPlayerPrivateGStreamerOwr::createGSTAudioSinkBin):
827         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped):
828         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
829         (WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
830         (WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
831         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
832         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h: Added.
833         (WebCore::MediaPlayerPrivateGStreamerOwr::engineDescription):
834         (WebCore::MediaPlayerPrivateGStreamerOwr::load):
835         (WebCore::MediaPlayerPrivateGStreamerOwr::cancelLoad):
836         (WebCore::MediaPlayerPrivateGStreamerOwr::prepareToPlay):
837         (WebCore::MediaPlayerPrivateGStreamerOwr::duration):
838         (WebCore::MediaPlayerPrivateGStreamerOwr::seek):
839         (WebCore::MediaPlayerPrivateGStreamerOwr::seeking):
840         (WebCore::MediaPlayerPrivateGStreamerOwr::setRate):
841         (WebCore::MediaPlayerPrivateGStreamerOwr::setPreservesPitch):
842         (WebCore::MediaPlayerPrivateGStreamerOwr::paused):
843         (WebCore::MediaPlayerPrivateGStreamerOwr::hasClosedCaptions):
844         (WebCore::MediaPlayerPrivateGStreamerOwr::setClosedCaptionsVisible):
845         (WebCore::MediaPlayerPrivateGStreamerOwr::maxTimeSeekable):
846         (WebCore::MediaPlayerPrivateGStreamerOwr::buffered):
847         (WebCore::MediaPlayerPrivateGStreamerOwr::totalBytes):
848         (WebCore::MediaPlayerPrivateGStreamerOwr::bytesLoaded):
849         (WebCore::MediaPlayerPrivateGStreamerOwr::canLoadPoster):
850         (WebCore::MediaPlayerPrivateGStreamerOwr::setPoster):
851         (WebCore::MediaPlayerPrivateGStreamerOwr::isLiveStream):
852         (WebCore::MediaPlayerPrivateGStreamerOwr::audioSink):
853
854 2016-02-04  Youenn Fablet  <youenn.fablet@crf.canon.fr>
855
856         [Fetch API] Add support for iterating over Headers
857         https://bugs.webkit.org/show_bug.cgi?id=153787
858
859         Reviewed by Darin Adler.
860
861         Covered by updated tests.
862         Introducing template class (JSKeyValueIterator) to support key-value iterators in DOM classes.
863         Using JSKeyValueIterator to implement Headers entries(), keys() and values() as custom methods.
864         Binding generator should be updated to generate directly these custom methods and handle iterator Symbol.
865
866         * CMakeLists.txt:
867         * Modules/fetch/FetchHeaders.cpp:
868         (WebCore::FetchHeaders::Iterator::next):
869         (WebCore::FetchHeaders::Iterator::Iterator):
870         * Modules/fetch/FetchHeaders.h:
871         (WebCore::FetchHeaders::createIterator):
872         * Modules/fetch/FetchHeaders.idl:
873         * WebCore.xcodeproj/project.pbxproj:
874         * bindings/js/JSDOMBinding.h:
875         (WebCore::jsPair):
876         * bindings/js/JSBindingsAllInOne.cpp:
877         * bindings/js/JSFetchHeadersCustom.cpp: Added.
878         (WebCore::JSFetchHeaders::entries):
879         (WebCore::JSFetchHeaders::keys):
880         (WebCore::JSFetchHeaders::values):
881         * bindings/js/JSKeyValueIterator.h: Added.
882         (WebCore::JSKeyValueIteratorPrototype::create):
883         (WebCore::JSKeyValueIteratorPrototype::createStructure):
884         (WebCore::JSKeyValueIteratorPrototype::JSKeyValueIteratorPrototype):
885         (WebCore::JSKeyValueIteratorPrototypeFuncNext):
886
887 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
888
889         Do not show context menu when right clicking on a scrollbar
890         https://bugs.webkit.org/show_bug.cgi?id=153493
891
892         Reviewed by Michael Catanzaro.
893
894         Scrollbars don't currently handle right clicks, but we are showing
895         the context menu when they are right clicked. This is not desired
896         at least in GTK+ and I've checked that it isn't consistent with
897         other applications in Mac either.
898
899         Test: fast/events/contextmenu-on-scrollbars.html
900
901         * page/EventHandler.cpp:
902         (WebCore::EventHandler::sendContextMenuEvent):
903
904 2016-02-03  Andreas Kling  <akling@apple.com>
905
906         [iOS] Throw away linked code when navigating to a new page.
907         <https://webkit.org/b/153851>
908
909         Reviewed by Gavin Barraclough.
910
911         When navigating to a new page, tell JSC to throw out any linked code it has lying around.
912         Linked code is tied to a specific global object, and as we're creating a new one for the
913         new page, none of it is useful to us here.
914         In the event that the user navigates back, the cost of relinking some code will be far
915         lower than the memory cost of keeping all of it around.
916
917         * bindings/js/GCController.cpp:
918         (WebCore::GCController::deleteAllLinkedCode):
919         * bindings/js/GCController.h:
920         * loader/FrameLoader.cpp:
921         (WebCore::FrameLoader::commitProvisionalLoad):
922
923 2016-02-03  Alex Christensen  <achristensen@webkit.org>
924
925         Report wasBlocked and cannotShowURL errors when using NetworkSession
926         https://bugs.webkit.org/show_bug.cgi?id=153846
927
928         Reviewed by Antti Koivisto.
929
930         No new tests, but this fixes http/tests/xmlhttprequest/redirect-cross-origin-2.html
931         when using NetworkSession.
932
933         * platform/URL.h:
934         WEBCORE_EXPORT because we are using portAllowed in WebKit2 now.
935
936 2016-02-03  Jer Noble  <jer.noble@apple.com>
937
938         iOS build fix after Yosemite build fix broke iOS build.
939
940         * platform/network/cocoa/WebCoreNSURLSession.h:
941         * platform/network/cocoa/WebCoreNSURLSession.mm:
942
943 2016-02-03  Beth Dakin  <bdakin@apple.com>
944
945         Accepted candidates should not be autocorrected
946         https://bugs.webkit.org/show_bug.cgi?id=153813
947         -and corresponding-
948         rdar://problem/24066924
949
950         Reviewed by Darin Adler.
951
952         New document marker to mark inserted candidates. This was we can treat 
953         inserted candidates just like a RejectedCorrection and we won’t accidentally 
954         autocorrect them later on.
955         * dom/DocumentMarker.h:
956         (WebCore::DocumentMarker::AllMarkers::AllMarkers):
957         * editing/AlternativeTextController.cpp:
958         (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
959
960         When handling an acceptant candidate, set m_isHandlingAcceptedCandidate to
961         true while the text is being inserted, and then mark the range as an accepted 
962         candidate.
963         * editing/Editor.cpp:
964         (WebCore::Editor::handleAcceptedCandidate):
965         * editing/Editor.h:
966         (WebCore::Editor::isHandlingAcceptedCandidate):
967
968         If frame.editor. isHandlingAcceptedCandidate() then return early from 
969         markMisspellingsAfterTyping.
970         * editing/TypingCommand.cpp:
971         (WebCore::TypingCommand::markMisspellingsAfterTyping):
972
973         Add some test infrastructure. 
974         * testing/Internals.cpp:
975         (WebCore::Internals::handleAcceptedCandidate):
976         * testing/Internals.h:
977         * testing/Internals.idl:
978
979 2016-02-03  Jer Noble  <jer.noble@apple.com>
980
981         [Win] Pass entire request (rather than just URL) to clients of WebCoreAVCFResourceLoader
982         https://bugs.webkit.org/show_bug.cgi?id=153653
983
984         Reviewed by Brent Fulgham.
985
986         This will allow those clients to see the byte-range request ("Range:") header and respond
987         appropriately.
988
989         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
990         (WebCore::WebCoreAVCFResourceLoader::startLoading):
991
992 2016-02-03  Jer Noble  <jer.noble@apple.com>
993
994         Yosemite build fix; hide the entire WebCoreNSURLSessionDataTask class from Yosemite and prior.
995
996         * platform/network/cocoa/WebCoreNSURLSession.h:
997         * platform/network/cocoa/WebCoreNSURLSession.mm:
998         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
999         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
1000
1001 2016-02-03  Jer Noble  <jer.noble@apple.com>
1002
1003         [EME][Mac] MediaKeys.createSession() fails with initData containing a contentId whose length is > 1/2 the initData.
1004         https://bugs.webkit.org/show_bug.cgi?id=153517
1005         <rdar://problem/24303782>
1006
1007         Reviewed by Eric Carlson.
1008
1009         The length of contentId is given in bytes, not Uint16 characters. Use the former when extracting
1010         the contentId string from the initData.
1011
1012         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1013         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
1014
1015 2016-02-03  Jer Noble  <jer.noble@apple.com>
1016
1017         [Mac] Wrap a resource and resource loader in a NSURLSession-like object for use by lower level frameworks
1018         https://bugs.webkit.org/show_bug.cgi?id=153669
1019
1020         Reviewed by Alex Christensen.
1021
1022         API Test: WebCore.WebCoreNSURLSession
1023
1024         Add a NSURLSession-like object, which wraps a CachedResourceLoader and CachedRawResource, which we can
1025         hand to lower-level frameworks, so that network loads by those frameworks use WebKit's loader.
1026
1027         * platform/network/cocoa/WebCoreNSURLSession.h: Added.
1028         * platform/network/cocoa/WebCoreNSURLSession.mm: Added.
1029         (-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]):
1030         (-[WebCoreNSURLSession dealloc]):
1031         (-[WebCoreNSURLSession copyWithZone:]):
1032         (-[WebCoreNSURLSession delegateQueue]):
1033         (-[WebCoreNSURLSession configuration]):
1034         (-[WebCoreNSURLSession loader]):
1035         (-[WebCoreNSURLSession finishTasksAndInvalidate]):
1036         (-[WebCoreNSURLSession invalidateAndCancel]):
1037         (-[WebCoreNSURLSession resetWithCompletionHandler:]):
1038         (-[WebCoreNSURLSession flushWithCompletionHandler:]):
1039         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]):
1040         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]):
1041         (-[WebCoreNSURLSession dataTaskWithRequest:]):
1042         (-[WebCoreNSURLSession dataTaskWithURL:]):
1043         (-[WebCoreNSURLSession uploadTaskWithRequest:fromFile:]):
1044         (-[WebCoreNSURLSession uploadTaskWithRequest:fromData:]):
1045         (-[WebCoreNSURLSession uploadTaskWithStreamedRequest:]):
1046         (-[WebCoreNSURLSession downloadTaskWithRequest:]):
1047         (-[WebCoreNSURLSession downloadTaskWithURL:]):
1048         (-[WebCoreNSURLSession downloadTaskWithResumeData:]):
1049         (-[WebCoreNSURLSession streamTaskWithHostName:port:]):
1050         (-[WebCoreNSURLSession streamTaskWithNetService:]):
1051         (-[WebCoreNSURLSession isKindOfClass:]):
1052
1053         Add a C++ class which can act as a CachedRawResourceClient, passing the results back to a WebCoreNSURLSessionDataTask:
1054
1055         (WebCore::WebCoreNSURLSessionDataTaskClient::WebCoreNSURLSessionDataTaskClient):
1056         (WebCore::WebCoreNSURLSessionDataTaskClient::dataSent):
1057         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
1058         (WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived):
1059         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1060         (WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished):
1061
1062         Add a NSURLSessionDataTask-like object, which takes a request, then uses it to create and wrap a CachedRawResource.
1063         Becase NSURSessionDataTask is intended to be used off-main-thread, care must be taken to dispatch back to the main-
1064         (or web-) thread before calling CachedRawResource functions.
1065
1066         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]):
1067         (-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
1068         (-[WebCoreNSURLSessionDataTask copyWithZone:]):
1069         (-[WebCoreNSURLSessionDataTask _restart]):
1070         (-[WebCoreNSURLSessionDataTask _cancel]):
1071         (-[WebCoreNSURLSessionDataTask _finish]):
1072         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]):
1073         (-[WebCoreNSURLSessionDataTask cancel]):
1074         (-[WebCoreNSURLSessionDataTask suspend]):
1075         (-[WebCoreNSURLSessionDataTask resume]):
1076         (-[WebCoreNSURLSessionDataTask _timingData]):
1077         (-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]):
1078         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
1079         (-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
1080         (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]):
1081         (-[WebCoreNSURLSessionDataTask resourceFinished:]):
1082         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
1083
1084 2016-02-03  Darin Adler  <darin@apple.com>
1085
1086         Convert another batch of String::lower callsites to something better, typically convertToASCIILowercase
1087         https://bugs.webkit.org/show_bug.cgi?id=153789
1088
1089         Reviewed by Sam Weinig.
1090
1091         * dom/DOMImplementation.cpp:
1092         (WebCore::DOMImplementation::isXMLMIMEType): Use equalLettersIgnoringASCIICase
1093         and the boolean argument to endsWith to ignore ASCII case.
1094         (WebCore::DOMImplementation::isTextMIMEType): Ditto. Also simplified the logic
1095         by removing an if statement.
1096
1097         * dom/Document.cpp:
1098         (WebCore::isSeparator): Deleted. Moved to WindowFeatures.cpp.
1099         (WebCore::processArguments): Ditto.
1100         (WebCore::Document::processViewport): Call the processFeaturesString function
1101         from WindowFeatures.h; the code here was originally just a pasted copy of that code!
1102         (WebCore::Document::processFormatDetection): Ditto.
1103
1104         * html/HTMLCanvasElement.cpp:
1105         (WebCore::HTMLCanvasElement::toEncodingMimeType): Remove now-unneeded
1106         lowercasing of MIME type before calling isSupportedImageMIMETypeForEncoding,
1107         since the MIME type registry now ignores ASCII case. Use convertToASCIILowercase
1108         on the return value, to preserve behavior.
1109         (WebCore::HTMLCanvasElement::toDataURL): Minor coding style tweaks.
1110
1111         * html/HTMLEmbedElement.cpp:
1112         (WebCore::HTMLEmbedElement::parseAttribute): Use convertToASCIILowercase for
1113         the service type here.
1114
1115         * html/HTMLImageElement.cpp:
1116         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Remove now-unneeded
1117         lowercasing since MIME type registry now ignores ASCII case. And use
1118         equalLettersIgnoringASCIICase for the case here.
1119
1120         * html/HTMLInputElement.cpp:
1121         (WebCore::parseAcceptAttribute): Use convertToASCIILowercase for the type here.
1122
1123         * html/HTMLLinkElement.cpp:
1124         (WebCore::HTMLLinkElement::parseAttribute): Use convertToASCIILowercase for the
1125         media value here.
1126
1127         * html/HTMLMediaElement.cpp:
1128         (WebCore::HTMLMediaElement::canPlayType): Use convertToASCIILowercase for the
1129         content type here.
1130         (WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.
1131
1132         * html/HTMLObjectElement.cpp:
1133         (WebCore::HTMLObjectElement::parseAttribute): Use convertToASCIILowercase for
1134         the service type here.
1135
1136         * html/HTMLTrackElement.cpp:
1137         (WebCore::HTMLTrackElement::parseAttribute): Use convertToASCIILowercase for
1138         the kind here.
1139         (WebCore::HTMLTrackElement::ensureTrack): Ditto. Also use fastGetAttribute
1140         since this is neither the style attribute nor an animatable SVG attribute.
1141
1142         * html/parser/HTMLTreeBuilder.cpp:
1143         (WebCore::createCaseMap): Use convertToASCIILowercase for the local names here.
1144
1145         * inspector/DOMPatchSupport.cpp:
1146         (WebCore::DOMPatchSupport::patchNode): Use containsIgnoringASCIICase instead
1147         of combining lower with find == notFound here.
1148         (WebCore::nodeName): Use convertToASCIILowercase here.
1149
1150         * inspector/InspectorOverlay.cpp:
1151         (WebCore::buildObjectForElementData): Use convertToASCIILowercase for node
1152         name here.
1153
1154         * inspector/InspectorPageAgent.cpp:
1155         (WebCore::createXHRTextDecoder): Remove a now-unneeded call to lower since
1156         DOMImplementation::isXMLMIMEType now ignores ASCII case.
1157
1158         * inspector/InspectorStyleSheet.cpp:
1159         (WebCore::lowercasePropertyName): Use convertToASCIILowercase for property
1160         names here. Also use startsWith rather than a hand-written alternative.
1161         (WebCore::InspectorStyle::populateAllProperties): Use the return value of
1162         the add function to avoid doing a double hash table lookp.
1163         (WebCore::InspectorStyle::styleWithProperties): Use convertToASCIILowercase
1164         to lowercase the property name.
1165
1166         * inspector/NetworkResourcesData.cpp:
1167         (WebCore::createOtherResourceTextDecoder): Remove unneeded call to lower since
1168         DOMImplement::isXMLMIMEType now ignores ASCII case.
1169
1170         * loader/CrossOriginAccessControl.cpp:
1171         (WebCore::createAccessControlPreflightRequest): Use convertToASCIILowercase
1172         to lowercase the access control request header field value.
1173
1174         * loader/cache/CachedScript.cpp:
1175         (WebCore::CachedScript::mimeType): Use convertToASCIILowercase on the content type.
1176
1177         * page/CaptionUserPreferencesMediaAF.cpp:
1178         (WebCore::languageIdentifier): Use convertToASCIILowercase on the language code.
1179
1180         * page/DOMWindow.cpp:
1181         (WebCore::DOMWindow::open): Call parseWindowFeatures instead of using the
1182         constructor for WindowFeatures.
1183         (WebCore::DOMWindow::showModalDialog): Call parseDialogFeatures instead of
1184         using the constructor for WindowFeatures.
1185
1186         * page/EventHandler.cpp:
1187         (WebCore::findDropZone): Remove unneeded lowercasing and empty string checking,
1188         and use the option SpaceSplitString already has to convert to lowercase.
1189         (WebCore::EventHandler::handleAccessKey): Remove unneeded call to lower since
1190         getElementByAccessKey now ignores case. Also tweaked coding style a bit.
1191
1192         * page/OriginAccessEntry.cpp:
1193         (WebCore::OriginAccessEntry::OriginAccessEntry): Use convertToASCIILowercase
1194         on the protocol and host.
1195         (WebCore::OriginAccessEntry::matchesOrigin): Ditto.
1196
1197         * page/SecurityOrigin.cpp:
1198         (WebCore::shouldTreatAsUniqueOrigin): Remove unneeded call to lower since
1199         SchemeRegistry now ignores ASCII case.
1200         (WebCore::SecurityOrigin::SecurityOrigin): Use convertToASCIILowercase on
1201         the protocol and host.
1202         (WebCore::SecurityOrigin::setDomainFromDOM): Use convertToASCIILowercase on
1203         the domain.
1204         (WebCore::SecurityOrigin::canDisplay): Remove call to lower since SchemeRegistry
1205         now ignores ASCII case and because this now uses equalIgnoringASCIICase in
1206         one place that used to use exact matching.
1207
1208         * page/WindowFeatures.cpp: Refactored so this is now some helper functions
1209         plus a struct rather than a class.
1210         (WebCore::isSeparator): Renamed this and removed special handling for NUL.
1211         (WebCore::parseWindowFeatures): Moved the code that was formerly in the
1212         WindowFeatures constructor in here. Refactored the parsing into the
1213         processFeaturesString function, shared with the functions in Document that
1214         do the same kind of parsing. Removed the code that converts the entire string
1215         to lowercase before parsing.
1216         (WebCore::processFeaturesString): Moved the improved version of this function
1217         here from Document.cpp; more efficient because it doesn't allocate strings.
1218         (WebCore::setWindowFeature): Changed to be a function private to this file
1219         with internal linkage. Use equalLettersIgnoringASCIICase so we no longer
1220         rely on converting the string to lowercase before parsing.
1221         (WebCore::parseDialogFeatures): Similar refactoring, but also changed all
1222         the default handling to use Optional<> instead of default values.
1223         (WebCore::boolFeature): Changed to use option and to ignore ASCII case.
1224         (WebCore::floatFeature): Ditto.
1225         (WebCore::parseDialogFeaturesMap): Removed the calls to lower, which are
1226         not needed any more.
1227
1228         * page/WindowFeatures.h: Added default values for all the data members,
1229         and removed all the functions from the WindowFeatures struct. Added the two
1230         functions for parsing window and dialog features. Also added the
1231         processFeaturesString function so we can share it with Document.cpp.
1232
1233         * platform/SchemeRegistry.cpp:
1234         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal): Use
1235         equalLettersIgnoringASCIICase to ignore ASCII case.
1236
1237         * platform/efl/MIMETypeRegistryEfl.cpp:
1238         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
1239         and equalIgnoringASCIICase rather than calling lower.
1240
1241         * platform/graphics/MediaPlayer.cpp:
1242         (WebCore::MediaPlayer::load): Use convertToASCIILowercase on MIME type and
1243         key system.
1244         (WebCore::MediaPlayer::generateKeyRequest): Ditto.
1245         (WebCore::MediaPlayer::addKey): Ditto.
1246         (WebCore::MediaPlayer::cancelKeyRequest): Ditto.
1247
1248         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1249         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Use
1250         convertToASCIILowercase on vendor string.
1251
1252         * platform/gtk/MIMETypeRegistryGtk.cpp:
1253         (WebCore::MIMETypeRegistry::getMIMETypeForExtension): Use a modern for loop,
1254         and equalIgnoringASCIICase rather than calling lower.
1255
1256         * platform/mac/PasteboardMac.mm:
1257         (WebCore::cocoaTypeFromHTMLClipboardType): Use convertToASCIILowercase
1258         on the type. Also did a bit of renaming and tweaking the logic.
1259
1260 2016-02-03  Dave Hyatt  <hyatt@apple.com>
1261
1262         Implement hanging-punctuation property parsing.
1263         https://bugs.webkit.org/show_bug.cgi?id=18109.
1264
1265         Reviewed by Zalan Bujtas.
1266
1267         Added parsing test in fast/css.
1268
1269         * css/CSSComputedStyleDeclaration.cpp:
1270         (WebCore::renderEmphasisPositionFlagsToCSSValue):
1271         (WebCore::hangingPunctuationToCSSValue):
1272         (WebCore::fillRepeatToCSSValue):
1273         (WebCore::ComputedStyleExtractor::propertyValue):
1274         * css/CSSParser.cpp:
1275         (WebCore::CSSParser::parseValue):
1276         (WebCore::CSSParser::parseTextIndent):
1277         (WebCore::CSSParser::parseHangingPunctuation):
1278         (WebCore::CSSParser::parseLineBoxContain):
1279         * css/CSSParser.h:
1280         * css/CSSPrimitiveValueMappings.h:
1281         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
1282         (WebCore::CSSPrimitiveValue::operator HangingPunctuation):
1283         (WebCore::CSSPrimitiveValue::operator LineBreak):
1284         * css/CSSPropertyNames.in:
1285         * css/CSSValueKeywords.in:
1286         * css/StyleBuilderConverter.h:
1287         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
1288         (WebCore::StyleBuilderConverter::convertHangingPunctuation):
1289         * rendering/style/RenderStyle.cpp:
1290         (WebCore::RenderStyle::changeRequiresLayout):
1291         * rendering/style/RenderStyle.h:
1292         * rendering/style/RenderStyleConstants.h:
1293         (WebCore::operator| ):
1294         (WebCore::operator|= ):
1295         * rendering/style/StyleRareInheritedData.cpp:
1296         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1297         (WebCore::StyleRareInheritedData::operator==):
1298         * rendering/style/StyleRareInheritedData.h:
1299
1300 2016-02-03  Jessie Berlin  <jberlin@webkit.org>
1301
1302         Build fix.
1303
1304         [NSEvent context] has always returned nil. Replace uses with nullptr.
1305
1306         * page/mac/EventHandlerMac.mm:
1307         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
1308
1309 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1310
1311         [GTK] Layout Test http/tests/appcache/different-https-origin-resource-main.html is failing
1312         https://bugs.webkit.org/show_bug.cgi?id=145253
1313
1314         Reviewed by Michael Catanzaro.
1315
1316         The problem is that when the load is cancelled while the
1317         connection is still being established,
1318         SoupMessage::notify::tls-errors is emitted and the handler calls
1319         ResourceHandleClient::didFail() which can delete the ResourceHandle.
1320
1321         * platform/network/soup/ResourceHandleSoup.cpp:
1322         (WebCore::tlsErrorsChangedCallback): Protect the ResourceHandle
1323         for the scope of the callback because
1324         ResourceHandleClient::didFail() could delete the object.
1325
1326 2016-02-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1327
1328         REGRESSION(r191948): [GStreamer] 4 new timeouts on layout tests.
1329         https://bugs.webkit.org/show_bug.cgi?id=152797
1330
1331         Reviewed by Darin Adler.
1332
1333         Always schedule messages to the main thread, even when the bus
1334         sync handlder was called in the main thread. It seems that
1335         GStreamer expects things to happen in the next main loop
1336         iteration.
1337
1338         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1339         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1340
1341 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1342
1343         [TexMap] CompositingCoordinator should store the overlay layer, flush it as appropriate
1344         https://bugs.webkit.org/show_bug.cgi?id=152058
1345
1346         Reviewed by Michael Catanzaro.
1347
1348         Previously, the CompositingCoordinator only added the overlay layer to the
1349         layer tree, but flushing its compositing state is also required. For that to
1350         happen, CompositingCoordinator has to store a pointer to the overlay layer
1351         object and flush it in ::flushPendingLayerChanges().
1352
1353         Overlay layers are most prominently used by the Web Inspector to highlight
1354         the DOM elements on the Web page that are being hovered in the inspector.
1355
1356         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1357         (WebCore::CompositingCoordinator::CompositingCoordinator):
1358         (WebCore::CompositingCoordinator::setRootCompositingLayer):
1359         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
1360         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
1361
1362 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1363
1364         [CoordinatedGraphics] CompositingCoordinator destructor is scheduling layer flushes
1365         https://bugs.webkit.org/show_bug.cgi?id=153823
1366
1367         Reviewed by Carlos Garcia Campos.
1368
1369         Purging the backing stores during the CompositingCoordinator destructor
1370         is also scheduling layer flushes in the object's client, which is an object
1371         of the LayerTreeHost-deriving class that owns the CompositingCoordinator
1372         object in question and is also being destroyed.
1373
1374         In case of ThreadedCoordinatedLayerTreeHost, this scheduling can access
1375         the RunLoop::Timer object which has already been destroyed, causing a
1376         crash. Another problem with this is that we're invoking a virtual function
1377         on an object that's being destructed, which works well enough in this case
1378         but should be discouraged in general.
1379
1380         In order to avoid this, add the m_isDestructing boolean to the
1381         CompositingCoordinator class, flip it to true during the destruction,
1382         and check for its falseness before scheduling a layer flush.
1383
1384         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1385         (WebCore::CompositingCoordinator::CompositingCoordinator):
1386         (WebCore::CompositingCoordinator::~CompositingCoordinator):
1387         (WebCore::CompositingCoordinator::notifyFlushRequired):
1388         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
1389
1390 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1391
1392         [TexMap] Don't use RELEASE_ASSERT in TextureMapperLayer::computeTransformsRecursive()
1393         https://bugs.webkit.org/show_bug.cgi?id=153822
1394
1395         Reviewed by Carlos Garcia Campos.
1396
1397         * platform/graphics/texmap/TextureMapperLayer.cpp:
1398         (WebCore::TextureMapperLayer::computeTransformsRecursive):
1399         Use ASSERT to check that the m_children members are indeed children
1400         of the current layer, RELEASE_ASSERT probably slipped in unnoticed
1401         at some point.
1402
1403 2016-02-03  Zan Dobersek  <zdobersek@igalia.com>
1404
1405         PlatformPathCairo: Lazily allocate the path surface
1406         https://bugs.webkit.org/show_bug.cgi?id=153821
1407
1408         Reviewed by Carlos Garcia Campos.
1409
1410         Move the static variable that holds the Cairo surface into
1411         the pathSurface() function (previously getPathSurface). This
1412         way the surface will only be allocated once the function is
1413         called for the first time from the CairoPath surface.
1414
1415         No change in functionality, just a cleanup.
1416
1417         * platform/graphics/cairo/PlatformPathCairo.cpp:
1418         (WebCore::pathSurface):
1419         (WebCore::CairoPath::CairoPath):
1420         (WebCore::getPathSurface): Deleted.
1421
1422 2016-02-02  Fujii Hironori  <Hironori.Fujii@jp.sony.com>
1423
1424         ASSERTION FAILED: roundedIntPoint(rendererMappedResult) == roundedIntPoint(result)
1425         https://bugs.webkit.org/show_bug.cgi?id=153576
1426
1427         Reviewed by Darin Adler.
1428
1429         Tests: fast/block/geometry-map-assertion-with-rounding-negative-half.html
1430
1431         The results of roundedIntPoint of FloatPoint and LayoutPoint may be different
1432         because of the uniqueness of LayoutUnit::round introduced by this bug
1433         <https://bugs.webkit.org/show_bug.cgi?id=107208>.
1434         Should convert a FloatPoint to a LayoutPoint before rounding.
1435
1436         * rendering/RenderGeometryMap.cpp:
1437         (WebCore::RenderGeometryMap::mapToContainer):
1438
1439 2016-02-02  Aakash Jain  <aakash_jain@apple.com>
1440
1441         Remove references to CallFrameInlines.h
1442         https://bugs.webkit.org/show_bug.cgi?id=153810
1443
1444         Reviewed by Mark Lam.
1445
1446         * ForwardingHeaders/interpreter/CallFrameInlines.h: Removed.
1447
1448 2016-02-02  Jinyoung Hur  <hur.ims@navercorp.com>
1449
1450         WEBGL_debug_shaders should be disabled for OpenGLES backend also
1451         https://bugs.webkit.org/show_bug.cgi?id=153788
1452
1453         Reviewed by Darin Adler.
1454
1455         WEBGL_debug_shaders extension is disabled for OpenGL backed platform
1456         because the implementation is not fully compliant to the spec yet.
1457         Because this is not an OpenGL-specific problem, WEBGL_debug_shaders extension
1458         should be disabled for OpenGLES backed platforms also.
1459
1460         No new tests, already covered by existing tests.
1461
1462         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1463         (WebCore::Extensions3DOpenGL::supportsExtension): Deleted.
1464         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1465         (WebCore::Extensions3DOpenGLCommon::supports):
1466
1467 2016-02-02  Brady Eidson  <beidson@apple.com>
1468
1469         Modern IDB: storage/indexeddb/cursor-primary-key-order.html fails with SQLite backend.
1470         https://bugs.webkit.org/show_bug.cgi?id=153800
1471
1472         Reviewed by Alex Christensen.
1473
1474         No new tests (Existing tests now unskipped).
1475
1476         The IndexRecords SQL schema did not order things by primaryKey.
1477         
1478         Easy fix to the schema. Sadly requires a migration...
1479
1480         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1481         (WebCore::IDBServer::v1IndexRecordsTableSchema):
1482         (WebCore::IDBServer::v1IndexRecordsTableSchemaAlternate):
1483         (WebCore::IDBServer::v2IndexRecordsTableSchema):
1484         (WebCore::IDBServer::v2IndexRecordsTableSchemaAlternate):
1485         (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
1486         (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
1487         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1488
1489 2016-02-02  Tim Horton  <timothy_horton@apple.com>
1490
1491         <attachment> should attempt to guess the icon from the file extension if all else fails
1492         https://bugs.webkit.org/show_bug.cgi?id=153804
1493         <rdar://problem/24448146>
1494
1495         Reviewed by Anders Carlsson.
1496
1497         Test: fast/attachment/attachment-icon-from-file-extension.html
1498
1499         * platform/graphics/Icon.h:
1500         * platform/graphics/mac/IconMac.mm:
1501         (WebCore::Icon::createIconForFileExtension):
1502         * rendering/RenderThemeMac.mm:
1503         (WebCore::iconForAttachment):
1504         If we can't find an icon any other way, try assuming that the title is a filename,
1505         grab its extension, and have NSWorkspace try to work out an icon for it.
1506
1507 2016-02-02  Antti Koivisto  <antti@apple.com>
1508
1509         Factor style sharing code out of StyleResolver
1510         https://bugs.webkit.org/show_bug.cgi?id=153768
1511
1512         Reviewed by Darin Adler.
1513
1514         Move the code to a new class, Style::SharingResolver.
1515
1516         When resolving document style we query the sharing resolver first before using the regular style resolver.
1517         Other paths that call style resolver were mostly already disabling it with DisallowStyleSharing flag.
1518
1519         * WebCore.xcodeproj/project.pbxproj:
1520         * css/ElementRuleCollector.cpp:
1521         (WebCore::MatchRequest::MatchRequest):
1522         (WebCore::ElementRuleCollector::matchAllRules):
1523         (WebCore::ElementRuleCollector::hasAnyMatchingRules):
1524
1525             More const.
1526
1527         * css/ElementRuleCollector.h:
1528         (WebCore::ElementRuleCollector::setRegionForStyling):
1529         (WebCore::ElementRuleCollector::setMedium):
1530         * css/MediaQueryMatcher.cpp:
1531         (WebCore::MediaQueryMatcher::prepareEvaluator):
1532         * css/StyleMedia.cpp:
1533         (WebCore::StyleMedia::matchMedium):
1534         * css/StyleResolver.cpp:
1535         (WebCore::StyleResolver::State::cacheBorderAndBackground):
1536         (WebCore::StyleResolver::StyleResolver):
1537         (WebCore::StyleResolver::sweepMatchedPropertiesCache):
1538         (WebCore::StyleResolver::State::State):
1539         (WebCore::StyleResolver::State::setStyle):
1540         (WebCore::isAtShadowBoundary):
1541         (WebCore::StyleResolver::styleForElement):
1542         (WebCore::StyleResolver::classNamesAffectedByRules): Deleted.
1543         (WebCore::parentElementPreventsSharing): Deleted.
1544         (WebCore::StyleResolver::locateCousinList): Deleted.
1545         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet): Deleted.
1546         (WebCore::StyleResolver::canShareStyleWithControl): Deleted.
1547         (WebCore::elementHasDirectionAuto): Deleted.
1548         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes): Deleted.
1549         (WebCore::StyleResolver::canShareStyleWithElement): Deleted.
1550         (WebCore::StyleResolver::findSiblingForStyleSharing): Deleted.
1551         (WebCore::StyleResolver::locateSharedStyle): Deleted.
1552
1553             Style sharing code moves to SharingResolver.
1554
1555         * css/StyleResolver.h:
1556         (WebCore::StyleResolver::mediaQueryEvaluator):
1557         (WebCore::StyleResolver::State::regionForStyling):
1558         (WebCore::StyleResolver::State::elementLinkState):
1559         (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle):
1560         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
1561         (WebCore::StyleResolver::state):
1562         (WebCore::StyleResolver::setTextOrientation):
1563         (WebCore::StyleResolver::State::setElementAffectedByClassRules): Deleted.
1564         (WebCore::StyleResolver::State::elementAffectedByClassRules): Deleted.
1565         (WebCore::StyleResolver::styleNotYetAvailable): Deleted.
1566
1567             Placeholder code moves to TreeResolver.
1568
1569         * dom/VisitedLinkState.cpp:
1570         (WebCore::linkAttribute):
1571         (WebCore::VisitedLinkState::invalidateStyleForAllLinks):
1572         (WebCore::linkHashForElement):
1573         (WebCore::VisitedLinkState::invalidateStyleForLink):
1574         (WebCore::VisitedLinkState::determineLinkStateSlowCase):
1575         * dom/VisitedLinkState.h:
1576         (WebCore::VisitedLinkState::determineLinkState):
1577         * html/HTMLFormControlElement.h:
1578         * rendering/RenderElement.cpp:
1579         (WebCore::RenderElement::getUncachedPseudoStyle):
1580         * rendering/RenderNamedFlowFragment.cpp:
1581         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
1582         * rendering/style/RenderStyle.cpp:
1583         (WebCore::RenderStyle::isStyleAvailable):
1584         (WebCore::RenderStyle::hasUniquePseudoStyle):
1585         * style/StyleSharingResolver.cpp: Added.
1586         (WebCore::Style::SharingResolver::SharingResolver):
1587         (WebCore::Style::parentElementPreventsSharing):
1588         (WebCore::Style::elementHasDirectionAuto):
1589         (WebCore::Style::SharingResolver::searchSimilar):
1590         (WebCore::Style::SharingResolver::findSibling):
1591         (WebCore::Style::SharingResolver::locateCousinList):
1592         (WebCore::Style::canShareStyleWithControl):
1593         (WebCore::Style::SharingResolver::canShareStyleWithElement):
1594         (WebCore::Style::SharingResolver::styleSharingCandidateMatchesRuleSet):
1595         (WebCore::Style::SharingResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
1596         (WebCore::Style::SharingResolver::classNamesAffectedByRules):
1597         * style/StyleSharingResolver.h: Added.
1598         * style/StyleTreeResolver.cpp:
1599         (WebCore::Style::ensurePlaceholderStyle):
1600         (WebCore::Style::TreeResolver::TreeResolver):
1601         (WebCore::Style::TreeResolver::styleForElement):
1602
1603             Try to use SharingResolver first.
1604             Also move placeholder style handling here, it is only relevant when resolving document style.
1605
1606         (WebCore::Style::postResolutionCallbacksAreSuspended):
1607         (WebCore::Style::isPlaceholderStyle):
1608         * style/StyleTreeResolver.h:
1609         * svg/SVGElement.cpp:
1610         (WebCore::SVGElement::customStyleForRenderer):
1611         * svg/SVGElementRareData.h:
1612         (WebCore::SVGElementRareData::overrideComputedStyle):
1613
1614 2016-02-02  Tim Horton  <timothy_horton@apple.com>
1615
1616         <attachment> icon should be a folder for the custom MIME type multipart/x-folder
1617         https://bugs.webkit.org/show_bug.cgi?id=153795
1618         <rdar://problem/24416632>
1619
1620         Reviewed by Anders Carlsson.
1621
1622         Test: fast/attachment/attachment-folder-icon.html
1623
1624         * rendering/RenderThemeMac.mm:
1625         (WebCore::iconForAttachment):
1626         (WebCore::paintAttachmentIcon):
1627         Mail uses this special MIME type to indicate that something is a folder, which there
1628         isn't a normal non-deprecated MIME type for.
1629
1630 2016-02-02  Brady Eidson  <beidson@apple.com>
1631
1632         Modern IDB: storage/indexeddb/cursor-continue-validity.html fails.
1633         https://bugs.webkit.org/show_bug.cgi?id=153791
1634
1635         Reviewed by Alex Christensen.
1636
1637         No new tests (Existing test now unskipped).
1638
1639         There was a preexisting check in the SQLite cursor for remembering the current record and
1640         refusing to refetch it.
1641         
1642         This check was causing this bug, because we needed to refetch the current record.
1643         
1644         Removing the check (and its associated flag) doesn't regress any other test, and fixes this one.
1645
1646         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1647         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
1648         (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1649         * Modules/indexeddb/server/SQLiteIDBCursor.h:
1650
1651 2016-02-01  Dave Hyatt  <hyatt@apple.com>
1652
1653         Add a line grid pagination SPI to WebKit.
1654         https://bugs.webkit.org/show_bug.cgi?id=153757
1655         <rdar://problem/23041598>
1656
1657         Reviewed by Anders Carlsson.
1658
1659         New tests in fast/multicol/pagination.
1660
1661         * page/Page.cpp:
1662         (WebCore::Page::setPaginationLineGridEnabled):
1663         * page/Page.h:
1664         (WebCore::Page::paginationLineGridEnabled):
1665         Add a boolean to the page to turn the line grid on and off.
1666
1667         * rendering/RenderBox.cpp:
1668         (WebCore::RenderBox::styleDidChange):
1669         Propagate the body's font up to the paginated RenderView so that
1670         it can be used to establish the line grid.
1671
1672         * style/StyleResolveForDocument.cpp:
1673         (WebCore::Style::resolveForDocument):
1674         Set up a line grid with containment snapping by default if the
1675         line grid enabled flag is set.
1676
1677         * testing/Internals.cpp:
1678         (WebCore::Internals::resetToConsistentState):
1679         (WebCore::Internals::setPagination):
1680         (WebCore::Internals::setPaginationLineGridEnabled):
1681         (WebCore::Internals::configurationForViewport):
1682         * testing/Internals.h:
1683         (WebCore::Internals::setPagination):
1684         * testing/Internals.idl:
1685         Add support for testing the grid being enabled.
1686
1687 2016-02-01  Antti Koivisto  <antti@apple.com>
1688
1689         Tab suspension code shouldn't use page cache cacheability logic
1690         https://bugs.webkit.org/show_bug.cgi?id=153680
1691
1692         Reviewed by Andreas Kling.
1693
1694         Most of PageCache::canCache() is unnecessary for tab suspension.
1695
1696         Also improve robustness and introduce 1 minute delay before suspending.
1697
1698         * page/Page.cpp:
1699         (WebCore::Page::setPageActivityState):
1700         (WebCore::Page::setIsVisible):
1701         (WebCore::Page::setIsVisibleInternal):
1702         (WebCore::Page::setIsPrerender):
1703         (WebCore::Page::canTabSuspend):
1704
1705             Include visibility test here.
1706
1707             Instead of calling PageCache::canCache() just check for each frame
1708             - that the document is loaded
1709             - that active DOM objects allow suspension
1710
1711         (WebCore::Page::setIsTabSuspended):
1712         (WebCore::Page::setTabSuspensionEnabled):
1713         (WebCore::Page::updateTabSuspensionState):
1714
1715             Refactor for robustness.
1716
1717         (WebCore::Page::tabSuspensionTimerFired):
1718
1719             Call canTabSuspend, the result might have changed.
1720
1721         (WebCore::Page::scheduleTabSuspension): Deleted.
1722         * page/Page.h:
1723
1724 2016-02-02  Yusuke Suzuki  <utatane.tea@gmail.com>
1725
1726         [JSC] Introduce BytecodeIntrinsic constant rep like @undefined
1727         https://bugs.webkit.org/show_bug.cgi?id=153737
1728
1729         Reviewed by Darin Adler.
1730
1731         * Modules/fetch/FetchHeaders.js:
1732         (initializeFetchHeaders):
1733         * Modules/streams/ReadableStream.js:
1734         (initializeReadableStream):
1735         (closeDestination):
1736         (abortDestination):
1737         (pipeTo):
1738         * Modules/streams/ReadableStreamInternals.js:
1739         (privateInitializeReadableStreamController):
1740         (teeReadableStream):
1741         (isReadableStreamReader):
1742         (errorReadableStream):
1743         (finishClosingReadableStream):
1744         (enqueueInReadableStream):
1745         (readFromReadableStreamReader):
1746         * Modules/streams/ReadableStreamReader.js:
1747         (releaseLock):
1748         * Modules/streams/StreamInternals.js:
1749         (shieldingPromiseResolve):
1750         (promiseInvokeOrNoopNoCatch):
1751         (promiseInvokeOrFallbackOrNoop):
1752         (validateAndNormalizeQueuingStrategy):
1753         * Modules/streams/WritableStream.js:
1754         (initializeWritableStream):
1755         (write):
1756         * Modules/streams/WritableStreamInternals.js:
1757         (errorWritableStream):
1758
1759 2016-02-02  Brady Eidson  <beidson@apple.com>
1760
1761         Modern IDB: storage/indexeddb/dont-wedge.html sometimes ASSERTs.
1762         https://bugs.webkit.org/show_bug.cgi?id=153790
1763
1764         Reviewed by Tim Horton.
1765
1766         No new tests (Failing test now unskipped).
1767
1768         This test uncovered an unhandled race where the main thread tried to perform an OpenDB operation 
1769         multiple times while it was already in-progress on the server thread.
1770
1771         There was already a flag meant to cover this race, and it just needed to be applied to one more site.
1772         
1773         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1774         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1775         (WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
1776
1777 2016-02-02  Daniel Bates  <dabates@apple.com>
1778
1779         CSP: Support checking content security policy without a script execution context
1780         https://bugs.webkit.org/show_bug.cgi?id=153748
1781         <rdar://problem/24439149>
1782
1783         Reviewed by Darin Alder.
1784
1785         Towards checking a Web Worker's content security policy against a redirected worker
1786         script load or redirected XHR request for an XHR request initiated from it, we should
1787         support instantiating a ContentSecurityPolicy object without a ScriptExecutionContext.
1788
1789         No functionality was changed. So, no new tests.
1790
1791         * dom/Document.cpp:
1792         (WebCore::Document::initSecurityContext): Pass |this| as a reference instead of as a pointer.
1793         * page/csp/ContentSecurityPolicy.cpp: Remove extraneous includes ScriptState.h, TextEncoding.h,
1794         and URL.h as they are included by ContentSecurityPolicy.h, FormDataList.h and FormData.h, respectively.
1795         (WebCore::CSPSource::CSPSource): Take a constant reference to a ContentSecurityPolicy instead
1796         of a pointer since we never expected a null pointer.
1797         (WebCore::CSPSource::schemeMatches): Move logic for checking the protocol of source "self"
1798         from here to ContentSecurityPolicy::protocolMatchesSelf() because we may not have a security
1799         origin if ContentSecurityPolicy was initiated without a ScriptExecutionContext object.
1800         (WebCore::CSPSourceList::allowSelf): Added.
1801         (WebCore::CSPSourceList::CSPSourceList): Take a constant reference to a ContentSecurityPolicy
1802         instead of a pointer since we never expected a null pointer. Remove fields from member
1803         initialization list that can be initialized using C++11 in-class initialization syntax.
1804         (WebCore::CSPSourceList::matches): Call ContentSecurityPolicy::urlMatchesSelf() to match the
1805         effective URL against the URL of source "self".
1806         (WebCore::CSPSourceList::parse): Update code as necessary now that m_policy is a reference
1807         instead of a pointer.
1808         (WebCore::CSPSourceList::parseSource): Simplify code by setting internal member fields directly
1809         instead of via member functions.
1810         (WebCore::CSPSourceList::parsePath): Update code as necessary now that m_policy is a reference
1811         instead of a pointer.
1812         (WebCore::CSPDirective::CSPDirective): Take a constant reference to a ContentSecurityPolicy
1813         instead of a pointer since we never expected a null pointer.
1814         (WebCore::CSPDirective::policy): Return a reference to a const ContentSecurityPolicy.
1815         (WebCore::MediaListDirective::MediaListDirective): Take a constant reference to a ContentSecurityPolicy
1816         instead of a pointer since we never expected a null pointer.
1817         (WebCore::MediaListDirective::parse): Update code as necessary now that m_policy is a reference
1818         instead of a pointer.
1819         (WebCore::SourceListDirective::SourceListDirective): Take a constant reference to a ContentSecurityPolicy
1820         instead of a pointer since we never expected a null pointer.
1821         (WebCore::SourceListDirective::allows): Write in terms of CSPSourceList::allowSelf() because we
1822         may not have a security origin to get a URL from if ContentSecurityPolicy was initiated without
1823         a ScriptExecutionContext object.
1824         (WebCore::CSPDirectiveList::reportURIs): Change return type from Vector<URL> to Vector<String>
1825         The caller will convert the strings to URLs with respect to the script execution context.
1826         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
1827         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
1828         was initiated without a ScriptExecutionContext object.
1829         (WebCore::CSPDirectiveList::CSPDirectiveList): Take a reference to a ContentSecurityPolicy
1830         instead of a pointer since we never expected a null pointer. It would be better to take a const
1831         reference to a ContentSecurityPolicy, but ContentSecurityPolicy::applySandboxPolicy() needs to set
1832         state on ContentSecurityPolicy :(
1833         (WebCore::CSPDirectiveList::create): Ditto.
1834         (WebCore::CSPDirectiveList::reportViolation): Update code as necessary now that m_policy is a reference
1835         instead of a pointer.
1836         (WebCore::CSPDirectiveList::checkEvalAndReportViolation): Ditto.
1837         (WebCore::CSPDirectiveList::checkInlineAndReportViolation): Ditto.
1838         (WebCore::CSPDirectiveList::parseDirective): Ditto.
1839         (WebCore::CSPDirectiveList::parseReportURI): Store the report URI as a string instead of a URL
1840         because we may not have a security origin to compute the absolute URL if ContentSecurityPolicy
1841         was initiated without a ScriptExecutionContext object.
1842         (WebCore::CSPDirectiveList::setCSPDirective): Update code as necessary now that m_policy is a reference
1843         instead of a pointer.
1844         (WebCore::CSPDirectiveList::applySandboxPolicy): Ditto.
1845         (WebCore::CSPDirectiveList::parseReflectedXSS): Ditto.
1846         (WebCore::CSPDirectiveList::addDirective): Ditto.
1847         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Modified to take the ScriptExecutionObject
1848         as a reference and compute the CSPSource object for "self" and cache the protocol for "self". Removed
1849         field m_overrideInlineStyleAllowed from the member initialization list and used C++11 in-class
1850         initialization syntax to initialize it. Added overloaded constructor that takes a SecurityOrigin object.
1851         We are not making use of this overloaded constructor at this time. We will in a subsequent patch.
1852         (WebCore::ContentSecurityPolicy::didReceiveHeader): Store the eval disabled error message for
1853         the last parsed policy in a member field instead of using it as part of disabling eval execution
1854         on the script execution context because we may not have such a context.
1855         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext): Applies the content security
1856         policy eval and sandbox restrictions to the script execution context.
1857         (WebCore::ContentSecurityPolicy::urlMatchesSelf): Match the specified URL against the URL for
1858         source "self".
1859         (WebCore::ContentSecurityPolicy::protocolMatchesSelf): Match the protocol of the specified URL
1860         against the protocol for source "self".
1861         (WebCore::ContentSecurityPolicy::gatherReportURIs): Modified to use the script execution context
1862         to compute the absolute URL for each report URI.
1863         (WebCore::ContentSecurityPolicy::reportViolation): Bail out if we do not have a script execution
1864         context.
1865         (WebCore::ContentSecurityPolicy::logToConsole): Only log to the console if we have a script
1866         execution context.
1867         (WebCore::ContentSecurityPolicy::reportBlockedScriptExecutionToInspector): Only report blocked
1868         script execution to the Web Inspector if we have a script execution context.
1869         (WebCore::CSPSourceList::addSourceSelf): Deleted.
1870         (WebCore::CSPSourceList::addSourceStar): Deleted.
1871         (WebCore::CSPSourceList::addSourceUnsafeInline): Deleted.
1872         (WebCore::CSPSourceList::addSourceUnsafeEval): Deleted.
1873         (WebCore::CSPDirectiveList::gatherReportURIs): Deleted.
1874         (WebCore::ContentSecurityPolicy::securityOrigin): Deleted.
1875         (WebCore::ContentSecurityPolicy::url): Deleted.
1876         (WebCore::ContentSecurityPolicy::completeURL): Deleted.
1877         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Deleted.
1878         * page/csp/ContentSecurityPolicy.h:
1879         (WebCore::ContentSecurityPolicy::enforceSandboxFlags): Accumulates the parsed sandbox flags. We
1880         will apply the sandbox flags in ContentSecurityPolicy::applyPolicyToScriptExecutionContext().
1881         * workers/WorkerGlobalScope.cpp:
1882         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate ContentSecurityPolicy.
1883         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Move instantiation of
1884         ContentSecurityPolicy from here to constructor.
1885
1886 2016-02-02  Eric Carlson  <eric.carlson@apple.com>
1887
1888         Allow ports to disable automatic text track selection
1889         https://bugs.webkit.org/show_bug.cgi?id=153761
1890         <rdar://problem/24416768>
1891
1892         Reviewed by Darin Adler.
1893
1894         Test: media/track/track-manual-mode.html
1895
1896         * Modules/mediacontrols/MediaControlsHost.cpp:
1897         (WebCore::MediaControlsHost::manualKeyword): New.
1898         (WebCore::MediaControlsHost::captionDisplayMode): Support 'manual' mode.
1899         * Modules/mediacontrols/MediaControlsHost.h:
1900
1901         * Modules/mediacontrols/mediaControlsApple.js:
1902         (Controller.prototype.buildCaptionMenu): Check the 'off' item when in manual mode.
1903
1904         * html/HTMLMediaElement.cpp:
1905         (WebCore::HTMLMediaElement::addTextTrack): Update m_captionDisplayMode when called for the first
1906           time so it is always correct. Set the track's manual selection mode as appropriate.
1907         (WebCore::HTMLMediaElement::captionPreferencesChanged): Set each track's manual selection 
1908           mode as appropriate.
1909
1910         * html/track/TextTrack.cpp:
1911         (WebCore::TextTrack::kind): Return 'subtitles' for forced tracks when in manual mode.
1912         * html/track/TextTrack.h:
1913
1914         * html/track/TrackBase.h:
1915         (WebCore::TrackBase::kind): Make virtual.
1916
1917         * page/CaptionUserPreferences.cpp:
1918         (WebCore::CaptionUserPreferences::beginBlockingNotifications): New.
1919         (WebCore::CaptionUserPreferences::endBlockingNotifications): Ditto.
1920         (WebCore::CaptionUserPreferences::notify): Don't notify when blocked.
1921         * page/CaptionUserPreferences.h:
1922
1923         * page/CaptionUserPreferencesMediaAF.cpp:
1924         (WebCore::CaptionUserPreferencesMediaAF::CaptionUserPreferencesMediaAF): Set manual mode 
1925           when appropriate.
1926         (WebCore::CaptionUserPreferencesMediaAF::captionDisplayMode): Check manual mode.
1927         (WebCore::CaptionUserPreferencesMediaAF::setCaptionDisplayMode): Ditto.
1928         (WebCore::CaptionUserPreferencesMediaAF::setPreferredLanguage): Ditto.
1929         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Return zero when in manual mode.
1930         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Consider manual mode. Fix
1931           typos in logging.
1932
1933         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1934         (WebCore::mediaDescriptionForKind): Return 'auxiliary' when in manual mode.
1935
1936         * testing/Internals.cpp:
1937         (WebCore::Internals::setCaptionDisplayMode): Support manual mode.
1938
1939 2016-02-02  Adrien Plazas  <aplazas@igalia.com>
1940
1941         REGRESSION(r195899): ASSERTION FAILED: is<Target>(source) in EventPath::retargetTouch() since r195899
1942         https://bugs.webkit.org/show_bug.cgi?id=153741
1943
1944         Reviewed by Ryosuke Niwa.
1945
1946         * dom/EventDispatcher.cpp:
1947         (WebCore::EventPath::retargetTouch):
1948
1949 2016-02-01  Joseph Pecoraro  <pecoraro@apple.com>
1950
1951         Web Inspector: High Level Memory Overview Instrument
1952         https://bugs.webkit.org/show_bug.cgi?id=153516
1953         <rdar://problem/24356378>
1954
1955         Reviewed by Brian Burg.
1956
1957         Add a new agent that gathers data from the ResourceUsageThread
1958         and sends to the frontend.
1959
1960         Test: inspector/memory/tracking.html
1961
1962         * CMakeLists.txt:
1963         * Configurations/FeatureDefines.xcconfig:
1964         * WebCore.xcodeproj/project.pbxproj:
1965         New files.
1966
1967         * inspector/InspectorController.cpp:
1968         (WebCore::InspectorController::InspectorController):
1969         Add the new agent.
1970
1971         * inspector/InspectorMemoryAgent.h: Added.
1972         * inspector/InspectorMemoryAgent.cpp: Added.
1973         (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
1974         (WebCore::InspectorMemoryAgent::didCreateFrontendAndBackend):
1975         (WebCore::InspectorMemoryAgent::willDestroyFrontendAndBackend):
1976         (WebCore::InspectorMemoryAgent::startTracking):
1977         (WebCore::InspectorMemoryAgent::stopTracking):
1978         (WebCore::InspectorMemoryAgent::collectSample):
1979         Implement the agent by adding / removing it as a ResourceUsage
1980         observer. When receiving the data forward it to the frontend.
1981
1982 2016-02-01  Alex Christensen  <achristensen@webkit.org>
1983
1984         Fix CMake build.
1985
1986         * PlatformMac.cmake:
1987
1988 2016-02-01  Brady Eidson  <beidson@apple.com>
1989
1990         Modern IDB: Cursors (still) do not keep their opening request alive.
1991         https://bugs.webkit.org/show_bug.cgi?id=153724
1992
1993         Reviewed by Alex Christensen.
1994
1995         No new tests (All existing tests pass without flakiness).
1996
1997         IDBCursors did not properly keep their JS wrappers alive.
1998         Making them ActiveDOMObjects that keep track of how many requests might be in flight fixes this.
1999         This also makes them actually keep their opening-request live via the opaque-root mechanism.
2000         
2001         IDBCursorWithValue also needed to opt in to all of these mechanisms.
2002
2003         * CMakeLists.txt:
2004         * WebCore.xcodeproj/project.pbxproj:
2005
2006         * Modules/indexeddb/IDBCursor.h:
2007         (WebCore::IDBCursor::hasPendingActivity): The base IDBCursor always has no pending activity,
2008           to maintain current behavior in LegacyIDB. This weirdness will go away when LegacyIDB does.
2009         * Modules/indexeddb/IDBCursor.idl:
2010         * Modules/indexeddb/IDBCursorWithValue.idl:
2011
2012         Track a count for all outstanding requests to keep the cursor alive as an ActiveDOMObject.
2013         * Modules/indexeddb/client/IDBCursorImpl.cpp:
2014         (WebCore::IDBClient::IDBCursor::IDBCursor):
2015         (WebCore::IDBClient::IDBCursor::update):
2016         (WebCore::IDBClient::IDBCursor::uncheckedIterateCursor):
2017         (WebCore::IDBClient::IDBCursor::deleteFunction):
2018         (WebCore::IDBClient::IDBCursor::activeDOMObjectName):
2019         (WebCore::IDBClient::IDBCursor::canSuspendForDocumentSuspension):
2020         (WebCore::IDBClient::IDBCursor::hasPendingActivity):
2021         (WebCore::IDBClient::IDBCursor::decrementOutstandingRequestCount):
2022         * Modules/indexeddb/client/IDBCursorImpl.h:
2023         
2024         Rework the "delete" family of functions on the object store to allow for returning a modern IDBRequest.
2025         A lot of this can go away when LegacyIDB does.
2026         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
2027         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
2028         (WebCore::IDBClient::IDBObjectStore::doDelete):
2029         (WebCore::IDBClient::IDBObjectStore::modernDelete):
2030         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2031         
2032         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2033         (WebCore::IDBClient::IDBRequest::setSource): Setup a ScopeGuard to decrement the cursor's request
2034           count whenever it makes sense to do so.
2035         (WebCore::IDBClient::IDBRequest::dispatchEvent): Clear the ScopeGuard (if it exists) to decrement the count.
2036         (WebCore::IDBClient::IDBRequest::willIterateCursor): Set the ScopeGuard.
2037         (WebCore::IDBClient::IDBRequest::didOpenOrIterateCursor): Clear the ScopeGuard (if it exists) to decrement the count.
2038         * Modules/indexeddb/client/IDBRequestImpl.h:
2039         
2040         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2041         (WebCore::IDBServer::ScopeGuard::ScopeGuard): Deleted.
2042         (WebCore::IDBServer::ScopeGuard::~ScopeGuard): Deleted.
2043         (WebCore::IDBServer::ScopeGuard::enable): Deleted.
2044         (WebCore::IDBServer::ScopeGuard::disable): Deleted.
2045         
2046         * bindings/js/JSIDBCursorWithValueCustom.cpp: Added.
2047         (WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
2048         
2049         * platform/ScopeGuard.h: Added.
2050         (WebCore::ScopeGuard::ScopeGuard):
2051         (WebCore::ScopeGuard::~ScopeGuard):
2052         (WebCore::ScopeGuard::enable):
2053         (WebCore::ScopeGuard::disable):
2054
2055 2016-02-01  Sun-woo Nam  <sunny.nam@samsung.com>
2056
2057         Free Colormap when XWindow is destroyed.
2058         https://bugs.webkit.org/show_bug.cgi?id=153413
2059
2060         Reviewed by Žan Doberšek.
2061
2062         Colormap is needed to create XWindow and it should be freed when XWindow is destroyed.
2063         Unless Colormap is freed before destroying XWindow, memory leak is suspected.
2064         XFreeColormap therefore is needed on X11Helper.
2065
2066         * platform/graphics/surfaces/glx/X11Helper.cpp: Added XFreeColormap.
2067         (WebCore::X11Helper::destroyWindow):
2068
2069 2016-02-01  Tim Horton  <timothy_horton@apple.com>
2070
2071         Move some SPI declarations into the appropriate SPI header
2072         https://bugs.webkit.org/show_bug.cgi?id=153755
2073
2074         Reviewed by Darin Adler.
2075
2076         * platform/graphics/cocoa/IOSurface.mm:
2077         * platform/spi/cg/CoreGraphicsSPI.h:
2078
2079 2016-02-01  Tim Horton  <timothy_horton@apple.com>
2080
2081         Snapshot surfaces are forever wired after being compressed
2082         https://bugs.webkit.org/show_bug.cgi?id=153751
2083         <rdar://problem/24354546>
2084
2085         Reviewed by Darin Adler.
2086
2087         * platform/graphics/cocoa/IOSurface.mm:
2088         (IOSurface::convertToFormat):
2089         Allow IOSurfaceAccelerator to unwire surfaces after they're transformed.
2090
2091 2016-02-01  Dan Bernstein  <mitz@apple.com>
2092
2093         <rdar://problem/20150072> [iOS] Remove some file upload code only needed before iOS 9
2094         https://bugs.webkit.org/show_bug.cgi?id=153754
2095
2096         Reviewed by Darin Adler.
2097
2098         * English.lproj/Localizable.strings: Updated for removal of WebKit2 string.
2099
2100 2016-02-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
2101
2102         Cache the Path instead of creating it every time it is required
2103         https://bugs.webkit.org/show_bug.cgi?id=152939
2104
2105         Reviewed by Darin Adler.
2106
2107         Instead of creating the Path object every time it is required, we should 
2108         cache it in an LRU cache. TinyLRUCache returns a reference to the cached
2109         entry so we do not have to pay the cost of copying it either.
2110
2111         * platform/graphics/FloatRoundedRect.h:
2112         (WebCore::operator!=):
2113         Implement the inequality operator for FloatRoundedRect since it is
2114         called by TinyLRUCache.
2115         
2116         * rendering/ClipPathOperation.h:
2117         Return a reference to the path in the cache since instead of creating a
2118         new copy.
2119         
2120         * rendering/style/BasicShapes.cpp:
2121         (WebCore::SVGPathTranslatedByteStream::SVGPathTranslatedByteStream):
2122         (WebCore::SVGPathTranslatedByteStream::operator==):
2123         (WebCore::SVGPathTranslatedByteStream::operator!=):
2124         (WebCore::SVGPathTranslatedByteStream::isEmpty):
2125         (WebCore::SVGPathTranslatedByteStream::path):
2126         This struct holds an offset and an SVGPathByteStream. It is the key of 
2127         the LRU cache for the the translated SVGPathByteStream.
2128         
2129         (WebCore::EllipsePathPolicy::isKeyNull):
2130         (WebCore::EllipsePathPolicy::createValueForKey):
2131         (WebCore::RoundedRectPathPolicy::isKeyNull):
2132         (WebCore::RoundedRectPathPolicy::createValueForKey):
2133         (WebCore::PolygonPathPolicy::isKeyNull):
2134         (WebCore::PolygonPathPolicy::createValueForKey):
2135         (WebCore::TranslatedByteStreamPathPolicy::isKeyNull):
2136         (WebCore::TranslatedByteStreamPathPolicy::createValueForKey):
2137         Inherit from the LRU cache policy template, so have a specific name for
2138         the desired path contents and pass this class explicitly to the LRU cache
2139         template.
2140         
2141         (WebCore::cachedEllipsePath):
2142         (WebCore::cachedRoundedRectPath):
2143         (WebCore::cachedPolygonPath):
2144         (WebCore::cachedTranslatedByteStreamPath):
2145         Return a cached path object for specific path contents.
2146         
2147         (WebCore::BasicShapeCircle::path):
2148         (WebCore::BasicShapeEllipse::path):
2149         (WebCore::BasicShapePolygon::path):
2150         (WebCore::BasicShapePath::path):
2151         (WebCore::BasicShapeInset::path):
2152         Get the Path object from the cache; create a new one if it does not exist.
2153         
2154         * rendering/style/BasicShapes.h:
2155         Change the prototype of the path() function to return a reference to the
2156         path in the cache instead of a having to copying it.
2157         
2158         * svg/SVGPathByteStream.h:
2159         (WebCore::SVGPathByteStream::operator!=):
2160         Implement the inequality operator for SVGPathByteStream because it is
2161         called by TinyLRUCache.
2162
2163 2016-02-01  Chris Dumez  <cdumez@apple.com>
2164
2165         Move properties that use custom bindings to the prototype
2166         https://bugs.webkit.org/show_bug.cgi?id=153735
2167
2168         Reviewed by Darin Adler.
2169
2170         Move properties that use custom bindings to the prototype. Whether a
2171         property's bindings code is generated or custom-written should not
2172         impact where the property is located.
2173
2174         No new tests, already covered by existing tests.
2175
2176         * bindings/js/JSHTMLDocumentCustom.cpp:
2177         (WebCore::JSHTMLDocument::getOwnPropertySlot):
2178         Add null-check for staticPropHashTable. HTMLDocument no longer has
2179         any property on the instance so staticPropHashTable is now null.
2180
2181         * bindings/scripts/CodeGeneratorJS.pm:
2182
2183 2016-02-01  Jer Noble  <jer.noble@apple.com>
2184
2185         REGRESSION(r195770): Use-after-free in ResourceLoaderOptions::cachingPolicy
2186         https://bugs.webkit.org/show_bug.cgi?id=153727
2187         <rdar://problem/24429886>
2188
2189         Reviewed by Chris Dumez.
2190
2191         The `this` object may be freed after calling deleteIfPossible(). Make the early-return-if-
2192         deleted more explicit, and only check allowsCaching() after the deleteIfPossible() return
2193         value check.
2194
2195         * loader/cache/CachedResource.cpp:
2196         (WebCore::CachedResource::removeClient):
2197
2198 2016-02-01  Dan Bernstein  <mitz@apple.com>
2199
2200         Tried to fix a build after r195899.
2201
2202         * dom/EventContext.h: Enabled TouchEventContext type trait specialization on iOS.
2203
2204 2016-02-01  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2205
2206         [Fetch API] Implement Fetch API Request
2207         https://bugs.webkit.org/show_bug.cgi?id=153437
2208
2209         Added support for Fetch Request and Body.
2210         Body is sharing functionality between Request and Response.
2211         Conversion between various body types are not implemented yet.
2212
2213         Added a FetchOptions class. Options in this class are partially redundant with ResourceLoaderOptions.
2214
2215         Fixing bug in Headers constructor.
2216         Making error reporting in case of modifying headers compliant with the spec.
2217
2218         Reviewed by Darin Adler.
2219
2220         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-clone.sub.html
2221                imported/w3c/web-platform-tests/fetch/api/request/request-consume.html
2222                imported/w3c/web-platform-tests/fetch/api/request/request-disturbed.html
2223                imported/w3c/web-platform-tests/fetch/api/request/request-error.html
2224                imported/w3c/web-platform-tests/fetch/api/request/request-headers.html
2225                imported/w3c/web-platform-tests/fetch/api/request/request-idl.html
2226                imported/w3c/web-platform-tests/fetch/api/request/request-init-001.sub.html
2227                imported/w3c/web-platform-tests/fetch/api/request/request-init-002.html
2228                imported/w3c/web-platform-tests/fetch/api/request/request-init-003.sub.html
2229                imported/w3c/web-platform-tests/fetch/api/request/request-structure.html
2230
2231         * CMakeLists.txt:
2232         * DerivedSources.cpp:
2233         * DerivedSources.make:
2234         * Modules/fetch/FetchBody.cpp: Added.
2235         (WebCore::FetchBody::initBody):
2236         (WebCore::FetchBody::clear):
2237         (WebCore::FetchBody::processIfEmptyOrDisturbed):
2238         (WebCore::FetchBody::arrayBuffer):
2239         (WebCore::FetchBody::formData):
2240         (WebCore::FetchBody::blob):
2241         (WebCore::FetchBody::text):
2242         (WebCore::FetchBody::json):
2243         * Modules/fetch/FetchBody.h: Added.
2244         (WebCore::FetchBody::~FetchBody):
2245         (WebCore::FetchBody::isEmpty):
2246         (WebCore::FetchBody::isDisturbed):
2247         (WebCore::FetchBody::setDisturbed):
2248         (WebCore::FetchBody::setMimeType):
2249         (WebCore::FetchBody::mimeType):
2250         * Modules/fetch/FetchBody.idl: Added.
2251         * Modules/fetch/FetchHeaders.cpp:
2252         (WebCore::canWriteHeader):
2253         (WebCore::FetchHeaders::append):
2254         (WebCore::FetchHeaders::remove):
2255         (WebCore::FetchHeaders::set):
2256         (WebCore::FetchHeaders::fill): Helper routine implementing https://fetch.spec.whatwg.org/#concept-headers-fill
2257         * Modules/fetch/FetchHeaders.h: Adding header getter/setter for FetchRequest.
2258         (WebCore::FetchHeaders::fastGet):
2259         (WebCore::FetchHeaders::fastSet):
2260         * Modules/fetch/FetchHeaders.js: Fixing bug in constructor (covered by modified headers-basc.html test).
2261         (initializeFetchHeaders):
2262         * Modules/fetch/FetchOptions.h: Added.
2263         (WebCore::FetchOptions::FetchOptions):
2264         (WebCore::FetchOptions::type):
2265         (WebCore::FetchOptions::destination):
2266         (WebCore::FetchOptions::mode):
2267         (WebCore::FetchOptions::credentials):
2268         (WebCore::FetchOptions::cache):
2269         (WebCore::FetchOptions::redirect):
2270         (WebCore::FetchOptions::referrerPolicy):
2271         (WebCore::FetchOptions::setType):
2272         (WebCore::FetchOptions::setDestination):
2273         (WebCore::FetchOptions::setMode):
2274         (WebCore::FetchOptions::setCredentials):
2275         (WebCore::FetchOptions::setCache):
2276         (WebCore::FetchOptions::setRedirect):
2277         (WebCore::FetchOptions::setReferrerPolicy):
2278         * Modules/fetch/FetchRequest.cpp: Added.
2279         (WebCore::FetchRequest::create):
2280         (WebCore::FetchRequest::FetchRequest):
2281         (WebCore::FetchRequest::init):
2282         (WebCore::FetchRequest::setReferrer):
2283         (WebCore::FetchRequest::setReferrerPolicy):
2284         (WebCore::FetchRequest::setMode):
2285         (WebCore::FetchRequest::setCredentials):
2286         (WebCore::FetchRequest::setCache):
2287         (WebCore::FetchRequest::setRedirect):
2288         (WebCore::FetchRequest::type):
2289         (WebCore::FetchRequest::destination):
2290         (WebCore::FetchRequest::referrerPolicy):
2291         (WebCore::FetchRequest::referrer):
2292         (WebCore::FetchRequest::mode):
2293         (WebCore::FetchRequest::credentials):
2294         (WebCore::FetchRequest::cache):
2295         (WebCore::FetchRequest::redirect):
2296         (WebCore::FetchRequest::setMethod):
2297         (WebCore::FetchRequest::clone):
2298         * Modules/fetch/FetchRequest.h: Added.
2299         (WebCore::FetchRequest::method):
2300         (WebCore::FetchRequest::url):
2301         (WebCore::FetchRequest::integrity):
2302         (WebCore::FetchRequest::headers):
2303         * Modules/fetch/FetchRequest.idl: Added.
2304         * WebCore.xcodeproj/project.pbxproj:
2305         * bindings/js/Dictionary.h:
2306         (WebCore::Dictionary::execState):
2307         * bindings/js/JSDictionary.cpp:
2308         (WebCore::JSDictionary::convertValue):
2309         * bindings/js/JSDictionary.h:
2310         (WebCore::JSDictionary::get):
2311
2312 2016-01-31  Jeremy Jones  <jeremyj@apple.com>
2313
2314         Add resize event for HTMLMediaElement
2315         https://bugs.webkit.org/show_bug.cgi?id=125715
2316
2317         Reviewed by Darin Adler.
2318
2319         Tests: http/tests/media/hls/hls-video-resize.html
2320                media/video-resize.html
2321
2322         Move resize javascript event from DOMWindow.idl to GlobalEventHandlers.idl
2323         per https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers
2324
2325         Post resize event from video element when metadata loads and when content size changes.
2326
2327         * dom/GlobalEventHandlers.idl: Add onresize.
2328         * html/HTMLElement.cpp:
2329         (WebCore::HTMLElement::createEventHandlerNameMap): Add onresizeAttr.
2330         * html/HTMLMediaElement.cpp:
2331         (WebCore::HTMLMediaElement::setReadyState):
2332         (WebCore::HTMLMediaElement::mediaPlayerSizeChanged):
2333         * html/HTMLMediaElement.h:
2334         (WebCore::HTMLMediaElement::scheduleResizeEvent):
2335         (WebCore::HTMLMediaElement::scheduleResizeEventIfSizeChanged):
2336         * html/HTMLVideoElement.cpp:
2337         (WebCore::HTMLVideoElement::scheduleResizeEvent): Sechedule event.
2338         (WebCore::HTMLVideoElement::scheduleResizeEventIfSizeChanged): Schedule event if size has changed.
2339         * html/HTMLVideoElement.h: Add declarations.
2340         * page/DOMWindow.idl: Remove onresize.
2341
2342 2016-01-31  Darin Adler  <darin@apple.com>
2343
2344         Revert accidental behavior change from previous patch.
2345
2346         * platform/URL.cpp:
2347         (WebCore::mimeTypeFromDataURL): Restore behavior where an empty MIME type would
2348         be turned into "text/plain".
2349
2350 2016-01-31  Darin Adler  <darin@apple.com>
2351
2352         Cut down on calls to String::lower; mostly replace with convertToASCIILowercase
2353         https://bugs.webkit.org/show_bug.cgi?id=153732
2354
2355         Reviewed by Dean Jackson.
2356
2357         * Modules/mediasource/MediaSource.cpp:
2358         (WebCore::MediaSource::isTypeSupported): Added comment about mysterious call
2359         to lower(); should probably return here and remove it.
2360
2361         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2362         (WebCore::initProtocolHandlerWhitelist): Deleted. Moved into isProtocolWhitelisted.
2363         (WebCore::isProtocolWhitelisted): Changed set to be ASCIICaseInsensitiveHash and
2364         initialized it using a lambda instead of a separate function.
2365         (WebCore::verifyProtocolHandlerScheme): Added a FIXME about some case sensitive
2366         checking of the protocol prefix here.
2367
2368         * Modules/plugins/QuickTimePluginReplacement.mm:
2369         (WebCore::QuickTimePluginReplacement::supportsMimeType): Changed set to be
2370         ASCIICaseInsensitiveHash and initialized it using a lambda instead of using
2371         an explict check for empty.
2372         (WebCore::QuickTimePluginReplacement::supportsFileExtension): Ditto.
2373
2374         * Modules/plugins/YouTubePluginReplacement.cpp:
2375         (WebCore::queryKeysAndValues): Use convertToASCIILowercase. The keys here are
2376         going to be all ASCII.
2377         (WebCore::isYouTubeURL): Use equalLettersIgnoringASCIICase instead of lowercasing
2378         the string.
2379         (WebCore::processAndCreateYouTubeURL): Use url.protocolIsInHTTPFamily instead of
2380         listing "http" and then "https" explicitly. Use equalLettersIgnoringASCIICase
2381         instead of lowercasing a string.
2382         (WebCore::YouTubePluginReplacement::youTubeURL): Ditto.
2383
2384         * Modules/websockets/WebSocketHandshake.cpp:
2385         (WebCore::hostName): Use convertToASCIILowercase on host name.
2386         (WebCore::WebSocketHandshake::host): Ditto.
2387
2388         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2389         (webkitAccessibleGetAttributes): Call convertToASCIILowercase instead of lower
2390         to lowercase an element's tag name. This is a strange way to do things; typically
2391         would be better to use some other function on Element, since tagName goes out of
2392         its way to be capitalized, but some ATK expert can improve this later.
2393
2394         * css/CSSGrammar.y.in: Use the new convertToASCIILowercaseInPlace function rather
2395         than the old lower function. We only need to lowercase the ASCII letters, and it's
2396         also better to have the function have a clearer name.
2397
2398         * css/CSSParser.cpp:
2399         (WebCore::convertToASCIILowercaseInPlace): Renamed from makeLower and made it deal
2400         with only ASCII lowercasing.
2401         (WebCore::CSSParserString::convertToASCIILowercaseInPlace): Renamed from lower.
2402         (WebCore::isUniversalKeyword): Added. Helper for the function below that uses
2403         equalLettersIgnoringASCIICase rather than lowercasing the string.
2404         (WebCore::parseKeywordValue): Use isUniversalKeyword. Also clarified a comment.
2405         (WebCore::CSSParser::parseAttr): Use convertToASCIILowercaseInPlace and delay
2406         String creation until later in the function, using CSSParserString operations more.
2407
2408         * css/CSSParserValues.cpp:
2409         (WebCore::CSSParserSelector::parsePseudoElementSelector): Use
2410         convertToASCIILowercaseInPlace by its new name, with its new behavior.
2411
2412         * css/CSSParserValues.h: Tweaked comment and formatting a bit. Replaced the lower
2413         function with the convertToASCIILowercaseInPlace function.
2414
2415         * css/CSSSelector.cpp:
2416         (WebCore::CSSSelector::RareData::parseNth): Rewrote this to avoid the need to
2417         make a lowercased copy of m_argument. Use equalLettersIgnoringASCIICase, and two
2418         calls to find. Also use String::toIntStrict so we don't have to create String
2419         objects for substrings.
2420
2421         * css/MediaQuery.cpp:
2422         (WebCore::MediaQuery::MediaQuery): Use convertToASCIILowercase for media type name.
2423         * css/MediaQueryExp.cpp:
2424         (WebCore::MediaQueryExp::serialize): Use convertToASCIILowercase for media feature name.
2425
2426         * dom/Document.cpp:
2427         (WebCore::isSeparator): Tweaked formatting and removed non-helpful comment.
2428         (WebCore::processArguments): Changed this from a static member function to a non-member
2429         file internal function. Use a std::function instead of a function pointer with a void*
2430         pointer. Rewrote algorithm to simplify it and use StringView instead of String for the
2431         keys and values.
2432         (WebCore::Document::processViewport): Use a lambda instead of a function pointer to
2433         call setViewportFeature, so that function's interface is no longer dictated by
2434         the exact type of the function pointer argument to processArguments.
2435         (WebCore::Document::processFormatDetection): Use a lambda instead of the
2436         setParserFeature function above; use equalLettersIgnoringASCIICase for both the
2437         key and the value, since processArguments no longer lowercases the string.
2438         (WebCore::Document::processArguments): Deleted.
2439
2440         * dom/Document.h: Removed unnecessary declaration of processArguments and
2441         ArgumentsCallback. Both are now private to the cpp file.
2442
2443         * dom/Element.cpp:
2444         (WebCore::makeIdForStyleResolution): Use convertToASCIILowercase. When in quirks mode,
2445         we want to match IDs in an ASCII case-insensitive way not match compatibility caseless.
2446
2447         * dom/ScriptElement.cpp:
2448         (WebCore::ScriptElement::isScriptTypeSupported): Remove the use of lower here since
2449         the MIME type registry is now itself ASCII case-insensitive.
2450
2451         * dom/ViewportArguments.cpp:
2452         (WebCore::numericPrefix): Changed to use StringView and take a Document&, rearranged
2453         argument order so Document& comes first.
2454         (WebCore::findSizeValue): Ditto.
2455         (WebCore::findScaleValue): Ditto.
2456         (WebCore::findBooleanValue): Ditto. Also use std::abs instead of fabs, possibly
2457         avoiding a conversion from float to double (not sure it was happening before but it's
2458         definitely not happening now).
2459         (WebCore::setViewportFeature): Changed to put arguments in a more logical order, to take
2460         the ViewportArguments as a reference, not a void*, and to use StringView to avoid forcing
2461         the caller to allocate strings. Also changed to use equalLettersIgnoringASCIICase so we
2462         don't rely on the caller to make the key lowercase for us.
2463         (WebCore::reportViewportWarning): Changed argument types. Added a couple comments about
2464         mistakes in the function.
2465
2466         * dom/ViewportArguments.h: Removed unnecessary declaration of reportViewportWarning,
2467         which is now private to the cpp file. Updated for new arguments to setViewportFeature.
2468
2469         * editing/EditorCommand.cpp:
2470         (WebCore::executeFormatBlock): Use convertToASCIILowercase on the argument, which is
2471         specifying a tag name.
2472
2473         * fileapi/Blob.cpp:
2474         (WebCore::Blob::isValidContentType): Removed unnecessary separate loops for
2475         8-bit and 16-bit strings. Content types are short strings and this small optimization is
2476         not worth the additional code complexity.
2477         (WebCore::Blob::normalizedContentType): Use convertToASCIILowercase since valid
2478         content types are guaranteed to be all ASCII.
2479         (WebCore::Blob::isNormalizedContentType): Removed unnecessary separate loops for
2480         8-bit and 16-bit strings. Content types are short strings and this small optimization is
2481         not worth the additional code complexity.
2482
2483         * html/parser/HTMLParserIdioms.cpp: Added now-needed include of QualifiedName.h.
2484
2485         * html/parser/HTMLParserIdioms.h: Removed unneeded include of QualifiedName.h and
2486         WTFString.h. Made sure every function is declared first, even if it's also defined
2487         later in the header in the section for functions templates and inline functions.
2488
2489         * loader/archive/ArchiveFactory.cpp:
2490         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): Use auto& for the type of
2491         the set of MIME types here, since it's now using ASCIICaseInsensitiveHash.
2492
2493         * platform/MIMETypeRegistry.cpp: Changed the MIME type sets to use
2494         ASCIICaseInsensitiveHash since MIME type are not case sensitive.
2495         (WebCore::initializeSupportedImageMIMETypes): Use a modern for loop.
2496         (WebCore::initializeSupportedImageMIMETypesForEncoding): Updated for HashSet type change.
2497         (WebCore::initializePDFMIMETypes): Use a modern for loop.
2498         (WebCore::initializeSupportedNonImageMimeTypes): Use a modern for loop.
2499         (WebCore::initializeSupportedMediaMIMETypes): Updated for HashSet type change.
2500         (WebCore::initializeUnsupportedTextMIMETypes): Use a modern for loop.
2501         (WebCore::initializeMIMETypeRegistry): Updated for HashSet type change.
2502         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Ditto.
2503         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Ditto.
2504         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding): Ditto.
2505         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Ditto.
2506         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Ditto.
2507         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Ditto.
2508         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Ditto.
2509         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Ditto.
2510         (WebCore::mimeTypeAssociationMap): Use ASCIICaseInsensitiveHash.
2511         (WebCore::MIMETypeRegistry::getNormalizedMIMEType): Use auto to make code tighter.
2512
2513         * platform/MIMETypeRegistry.h: Changed return types of the getMIMETypes functions
2514         to use ASCIICaseInsensitiveHash.
2515
2516         * platform/SchemeRegistry.cpp:
2517         (WebCore::schemesForbiddenFromDomainRelaxation): Changed type to
2518         use ASCIICaseInsensitiveHash.
2519
2520         * platform/URL.cpp:
2521         (WebCore::mimeTypeFromDataURL): Use convertToASCIILowercase instead of lower.
2522         Also removed some dead code that tried to handle the case where the data URL
2523         has a comma as one of the first 5 characters: That can't happen since it's a
2524         precondition of this function that the first five characters are "data:".
2525
2526         * platform/graphics/MediaPlayer.cpp:
2527         (WebCore::MediaPlayer::getSupportedTypes): Change type of argument to
2528         a HashSet with ASCIICaseInsensitiveHash.
2529         * platform/graphics/MediaPlayer.h: Ditto.
2530
2531         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2532         (WebCore::MediaPlayerPrivateAVFoundation::staticMIMETypeList):
2533         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2534         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Ditto.
2535
2536         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2537         (WebCore::avfMIMETypes):
2538         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2539         (WebCore::MediaPlayerPrivateAVFoundationCF::getSupportedTypes): Ditto.
2540         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: Ditto.
2541
2542         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2543         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2544         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2545         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithImageGenerator): Removed
2546         an unnecessary line of code to set a local variable to 0 just before it falls
2547         out of scope.
2548         (WebCore::avfMIMETypes): Ditto. Also tightened up the code a bit.
2549         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Ditto.
2550
2551         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2552         Changed type of HashSet to use ASCIICaseInsensitiveHash.
2553         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2554         (WebCore::mimeTypeCache): Ditto.
2555         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
2556
2557         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Ditto.
2558         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2559         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes): Ditto.
2560
2561         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2562         (WebCore::mimeTypeCache): Ditto.
2563         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): Ditto.
2564         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
2565
2566         * platform/graphics/mac/MediaPlayerPrivateQTKit.h: Ditto.
2567         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2568         (WebCore::shouldRejectMIMEType): Made this non-case-sensitive by using startsWith
2569         and the "false" argument. Later change this to startsWithIgnoringASCIICase or
2570         startsWithLettersIgnoringASCIICase.
2571         (WebCore::addFileTypesToCache): Use ASCIICaseInsensitiveHash. ALso rewrote to
2572         tighten up the code a bit and use modern Objective-C for loops.
2573         (WebCore::mimeCommonTypesCache): Use ASCIICaseInsensitiveHash.
2574         (WebCore::mimeModernTypesCache): Ditto.
2575         (WebCore::concatenateHashSets): Ditto.
2576         (WebCore::MediaPlayerPrivateQTKit::getSupportedTypes): Ditto.
2577         (WebCore::MediaPlayerPrivateQTKit::disableUnsupportedTracks): Initialied
2578         track type set using lambda, but left it case sensitive.
2579
2580         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2581         (WebCore::mimeTypeCache): Changed type of HashSet to use ASCIICaseInsensitiveHash.
2582         (WebCore::MediaPlayerPrivateMediaFoundation::getSupportedTypes): Ditto.
2583         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2584
2585         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2586         (WebCore::mimeTypeCache): Ditto.
2587         (WebCore::MockMediaPlayerMediaSource::getSupportedTypes): Ditto.
2588         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Ditto.
2589
2590 2016-01-31  Brent Fulgham  <bfulgham@apple.com>
2591
2592         Add "WebKit built-in PDF" Plugin to set of publicly visible plugins
2593         https://bugs.webkit.org/show_bug.cgi?id=153657
2594         <rdar://problem/24413107>
2595
2596         Reviewed by Darin Adler.
2597
2598         Tested by http/tests/plugins/visible_plugins.html.
2599
2600         A number of poorly-coded sites break when WebKit reports that it understands PDF mime types,
2601         but does not have a list of plugins that the site can iterate through.
2602
2603         To avoid this compatibility problem, we should also expose the "WebKit built-in PDF" plugin
2604         to avoid this edge case.
2605
2606         * plugins/PluginData.cpp:
2607         (WebCore::shouldBePubliclyVisible): Add "WebKit built-in PDF" plugin.
2608
2609 2016-01-31  Doug Russell  <d_russell@apple.com>
2610
2611         AX: Add a boundary value to AXTextStateChangeType
2612         https://bugs.webkit.org/show_bug.cgi?id=153085
2613
2614         Reviewed by Darin Adler.
2615
2616         Post an AT notification when navigation is attempted past
2617         an editable element's boundaries.
2618
2619         Test: accessibility/mac/selection-boundary-userinfo.html
2620
2621         * accessibility/AXObjectCache.cpp:
2622         (WebCore::AXObjectCache::showIntent):
2623         * accessibility/AXTextStateChangeIntent.h:
2624         * accessibility/mac/AXObjectCacheMac.mm:
2625         (platformChangeTypeForWebCoreChangeType):
2626         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
2627         * editing/FrameSelection.cpp:
2628         (WebCore::FrameSelection::modifyMovingRight):
2629         (WebCore::FrameSelection::modifyMovingForward):
2630         (WebCore::FrameSelection::modifyMovingLeft):
2631         (WebCore::FrameSelection::modifyMovingBackward):
2632         (WebCore::textSelectionWithDirectionAndGranularity):
2633         (WebCore::FrameSelection::modify):
2634         (WebCore::FrameSelection::modifyExtendingBackward): Deleted.
2635         (WebCore::FrameSelection::textSelectionIntent): Deleted.
2636         * editing/FrameSelection.h:
2637         * editing/VisiblePosition.cpp:
2638         (WebCore::VisiblePosition::next):
2639         (WebCore::VisiblePosition::previous):
2640         (WebCore::VisiblePosition::left):
2641         (WebCore::VisiblePosition::right):
2642         (WebCore::VisiblePosition::honorEditingBoundaryAtOrBefore):
2643         (WebCore::VisiblePosition::honorEditingBoundaryAtOrAfter):
2644         (WebCore::VisiblePosition::leftVisuallyDistinctCandidate): Deleted.
2645         (WebCore::VisiblePosition::rightVisuallyDistinctCandidate): Deleted.
2646         * editing/VisiblePosition.h:
2647         * editing/VisibleUnits.cpp:
2648         (WebCore::startOfLine):
2649         (WebCore::logicalStartOfLine):
2650         (WebCore::endOfLine):
2651         (WebCore::logicalEndOfLine):
2652         (WebCore::leftBoundaryOfLine):
2653         (WebCore::rightBoundaryOfLine):
2654         (WebCore::inSameLogicalLine): Deleted.
2655         (WebCore::endOfEditableContent): Deleted.
2656         (WebCore::isEndOfEditableOrNonEditableContent): Deleted.
2657         * editing/VisibleUnits.h:
2658
2659 2016-01-31  Daniel Bates  <dabates@apple.com>
2660
2661         CSP: Use the served CSP header for dedicated workers
2662         https://bugs.webkit.org/show_bug.cgi?id=153157
2663         <rdar://problem/24383254>
2664         And
2665         https://bugs.webkit.org/show_bug.cgi?id=153156
2666         <rdar://problem/24383246>
2667
2668         Reviewed by Brent Fulgham.
2669
2670         Inspired by Blink commit:
2671         <https://src.chromium.org/viewvc/blink?revision=194143&view=revision>
2672
2673         Implement support for respecting Content Security Policy (CSP) HTTP headers included in the
2674         HTTP response for a Web Worker's script as per section Workers of the CSP 2.0 spec,
2675         <https://w3c.github.io/webappsec-csp/2/#processing-model-workers> (29 August 2015).
2676
2677         Currently a Web Worker always inherits the CSP of its owner document. Instead a web worker
2678         will inherit the CSP of its owner document only if its script is incapable of defining a
2679         content security policy (i.e. its origin is a globally unique identifier). Otherwise, the
2680         CSP HTTP headers delivered with the script will be used to define the CSP for the worker.
2681
2682         Tests: fast/workers/worker-inherits-csp-blocks-eval.html
2683                fast/workers/worker-inherits-csp-blocks-xhr.html
2684                http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-blocks-eval.html
2685
2686         * CMakeLists.txt: Add file ContentSecurityPolicyResponseHeaders.cpp.
2687         * WebCore.vcxproj/WebCore.vcxproj: Add files ContentSecurityPolicyResponseHeaders.{cpp, h}.
2688         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2689         * WebCore.xcodeproj/project.pbxproj: Ditto.
2690         * dom/Document.cpp:
2691         (WebCore::Document::processHttpEquiv): Update code to use enum class ContentSecurityPolicyHeaderType.
2692         * loader/FrameLoader.cpp:
2693         (WebCore::FrameLoader::didBeginDocument): Extract logic to collect Content Security Policy HTTP headers
2694         into class ContentSecurityPolicyResponseHeaders and make use of it here.
2695         * page/csp/ContentSecurityPolicy.cpp:
2696         (WebCore::CSPDirectiveList::headerType): Modified to use enum class ContentSecurityPolicyHeaderType.
2697         (WebCore::CSPDirectiveList::CSPDirectiveList): Ditto.
2698         (WebCore::CSPDirectiveList::create): Ditto.
2699         (WebCore::ContentSecurityPolicy::responseHeaders): Creates and returns a ContentSecurityPolicyResponseHeaders
2700         object with the parsed CSP policy headers.
2701         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Processed the CSP policy headers represented by the
2702         specified ContentSecurityPolicyResponseHeaders object.
2703         (WebCore::ContentSecurityPolicy::deprecatedHeader): Deleted.
2704         (WebCore::ContentSecurityPolicy::deprecatedHeaderType): Deleted.
2705         * page/csp/ContentSecurityPolicy.h: Defines a class that represents a collection of CSP policy headers.
2706         This class has two purposes:
2707             - It extracts the CSP policy headers from a HTTP response (ResourceResponse object). We make use of
2708             this functionality in both FrameLoader::didBeginDocument() and Worker::didReceiveResponse().
2709             - It serves as a memento that externalizes the internal CSP policy details of an instance of
2710             ContentSecurityPolicy. We make use of this memento functionality to support inheriting the
2711             CSP policy of the worker's owner document in a thread-safe manner. You can create and restore
2712             a memento using ContentSecurityPolicy::responseHeaders() and ContentSecurityPolicy::didReceiveHeaders(), respectively.
2713         * page/csp/ContentSecurityPolicyResponseHeaders.cpp: Added.
2714         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders): Extracts the
2715         CSP HTTP headers from a ResourceResponse object.
2716         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy): Make a copy of this object that is
2717         safe to pass to another thread.
2718         * page/csp/ContentSecurityPolicyResponseHeaders.h: Added.
2719         * workers/DedicatedWorkerGlobalScope.cpp:
2720         (WebCore::DedicatedWorkerGlobalScope::create): Modified to use class ContentSecurityPolicyResponseHeaders.
2721         * workers/DedicatedWorkerGlobalScope.h:
2722         * workers/DedicatedWorkerThread.cpp:
2723         (WebCore::DedicatedWorkerThread::create): Ditto.
2724         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread): Ditto.
2725         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope): Ditto.
2726         * workers/DedicatedWorkerThread.h:
2727         * workers/Worker.cpp:
2728         (WebCore::Worker::didReceiveResponse): Create a ContentSecurityPolicyResponseHeaders if the origin of
2729         the worker's script is capable of providing a CSP. Otherwise, we will inherit the CSP of the worker's owner
2730         document in Worker::notifyFinished().
2731         (WebCore::Worker::notifyFinished): Pass the appropriate CSP response headers to WorkerMessagingProxy::startWorkerGlobalScope().
2732         * workers/Worker.h:
2733         * workers/WorkerGlobalScope.cpp:
2734         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Renamed; formerly named applyContentSecurityPolicyFromString().
2735         Modified to take a ContentSecurityPolicyResponseHeaders and apply it to the ContentSecurityPolicy object associated with the worker.
2736         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString): Deleted.
2737         * workers/WorkerGlobalScope.h:
2738         * workers/WorkerMessagingProxy.cpp:
2739         (WebCore::WorkerMessagingProxy::startWorkerGlobalScope): Pass the worker's ContentSecurityPolicyResponseHeaders object.
2740         * workers/WorkerThread.cpp:
2741         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData): Added field m_contentSecurityPolicyResponseHeaders to store
2742         the CSP response headers to be applied to the worker's ContentSecurityPolicy object.
2743         (WebCore::WorkerThread::WorkerThread): Modified to use ContentSecurityPolicyResponseHeaders.
2744         (WebCore::WorkerThread::workerThread): Pass the ContentSecurityPolicyResponseHeaders object from the start up data struct
2745         to DedicatedWorkerThread::createWorkerGlobalScope().
2746         * workers/WorkerThread.h:
2747
2748 2016-01-31  Darin Adler  <darin@apple.com>
2749
2750         Get rid of most calls to String::upper; mostly replace them with convertToASCIIUppercase
2751         https://bugs.webkit.org/show_bug.cgi?id=153715
2752
2753         Reviewed by Gyuyoung Kim.
2754
2755         * editing/cocoa/HTMLConverter.mm:
2756         (HTMLConverter::computedAttributesForElement): Use convertToASCIILowercase to fold
2757         ASCII case when searching for fonts by name.
2758
2759         * platform/network/cf/ResourceResponseCFNet.cpp:
2760         (WebCore::ResourceResponse::platformLazyInit): Use convertToASCIIUppercase to make
2761         the HTTP version string canonical. Not sure why it's needed at all, but the letters
2762         we might be uppercasing are "HTTP", so no need to handle non-ASCII.
2763         * platform/network/cocoa/ResourceResponseCocoa.mm:
2764         (WebCore::ResourceResponse::platformLazyInit): Ditto.
2765
2766         * rendering/svg/SVGRenderTreeAsText.cpp:
2767         (WebCore::operator<<): Use convertToASCIIUppercase when writing the spread
2768         method type into a text stream. The method types are all ASCII.
2769
2770 2016-01-31  Dan Bernstein  <mitz@apple.com>
2771
2772         [Cocoa] Remove __has_include guards around use of WebKitAdditions
2773         https://bugs.webkit.org/show_bug.cgi?id=153728
2774
2775         Reviewed by Andy Estes.
2776
2777         Guard WebKitAdditions includes with #if USE(APPLE_INTERNAL_SDK) rather than with __has_include.
2778
2779         * dom/EventNames.h:
2780         * loader/EmptyClients.cpp:
2781         (WebCore::fillWithEmptyClients):
2782         * page/MainFrame.cpp:
2783         (WebCore::MainFrame::MainFrame):
2784         * page/MainFrame.h:
2785         * page/PageConfiguration.h:
2786         * platform/cocoa/WebKitAdditions.mm:
2787         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2788         * platform/ios/LegacyTileGridTile.mm:
2789
2790 2016-01-31  Darin Adler  <darin@apple.com>
2791
2792         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
2793         https://bugs.webkit.org/show_bug.cgi?id=153639
2794
2795         Reviewed by Filip Pizlo.
2796
2797         * Modules/webdatabase/DatabaseAuthorizer.h: Use ASCIICaseInsensitiveHash
2798         for whitelisted functions. Function names are all ASCII.
2799
2800         * accessibility/AccessibilityObject.cpp: Use ASCIICaseInsensitiveHash
2801         for ARIA roles. ARIA roles are all ASCII.
2802
2803         * crypto/CryptoAlgorithmRegistry.h: Use ASCIICaseInsensitiveHash for
2804         crypto algorithm names. Algorithm names are all ASCII.
2805
2806         * css/CSSFontSelector.cpp:
2807         (WebCore::registerLocalFontFacesForFamily): Use ASCIICaseInsensitiveHash
2808         for font faces. Face names should use ASCII case insensitive matching;
2809         there is no need for non-ASCII case folding.
2810         * css/CSSFontSelector.h: Ditto.
2811
2812         * dom/DOMImplementation.cpp: Use ASCIICaseInsensitiveHash for the
2813         FeatureSet. The features are all ASCII.
2814
2815         * dom/Document.h: Use ASCIICaseInsensitiveHash for the access key
2816         map. Access keys are all ASCII.
2817
2818         * dom/ScriptElement.cpp:
2819         (WebCore::isLegacySupportedJavaScriptLanguage): Use ASCIICaseInsensitiveHash
2820         for the language set. These strings are all ASCII.
2821
2822         * editing/EditorCommand.cpp: Use ASCIICaseInsensitiveHash for editor
2823         command names. These names are all ASCII.
2824
2825         * html/HTMLObjectElement.cpp:
2826         (WebCore::HTMLObjectElement::parametersForPlugin): Use ASCIICaseInsensitiveHash
2827         for parameter names. These names are all ASCII.
2828
2829         * html/InputType.cpp: Use ASCIICaseInsensitiveHash for the input types.
2830         The input types are all ASCII.
2831
2832         * loader/CrossOriginAccessControl.h: Use ASCIICaseInsensitiveHash for
2833         HTTP header field names. These names are all ASCII.
2834         * loader/CrossOriginPreflightResultCache.h: Ditto.
2835
2836         * loader/archive/ArchiveFactory.cpp: Use ASCIICaseInsensitiveHash for
2837         MIME types. MIME types are all ASCII.
2838         * platform/MIMETypeRegistry.cpp:
2839         (WebCore::initializeSupportedImageMIMETypes): Ditto.
2840
2841         * platform/SchemeRegistry.h: Use ASCIICaseInsensitiveHas for URL schemes.
2842         URL schemes are all ASCII.
2843         * platform/URL.cpp: Ditto.
2844
2845         * platform/graphics/FontCache.cpp:
2846         (WebCore::FontPlatformDataCacheKey::operator==): Use ASCIICaseInsensitiveHash.
2847         (WebCore::FontPlatformDataCacheKeyHash::hash): Use ASCIICaseInsensitiveHash.
2848
2849         * platform/graphics/FontCascade.cpp:
2850         (WebCore::keysMatch): Rename from operator== since this operation is not
2851         equality. Changed to equalIgnoringASCIICase and did a little streamlining.
2852         (WebCore::makeFontCascadeCacheKey): Use reserveInitialCapacity for slightly
2853         better memory use.
2854         (WebCore::computeFontCascadeCacheHash): Use IntegerHasher to make computing
2855         a hash more efficient by eliminating the overhead of building a vector and
2856         even possible heap allocation and deallocation.
2857         (WebCore::retrieveOrAddCachedFonts): Use keysMatch instead of ==.
2858
2859         * platform/graphics/cocoa/FontCacheCoreText.cpp: Use ASCIICaseInsensitiveHash
2860         for font family names. These names should use ASCII case insensitive matching;
2861         there is no need for non-ASCII case folding.
2862
2863         * platform/network/HTTPHeaderMap.h: Use ASCIICaseInsensitiveHash for
2864         HTTP header field names. These names are all ASCII.
2865
2866         * rendering/style/RenderStyle.cpp:
2867         (WebCore::computeFontHash): Use IntegerHasher to avoid allocating memory just
2868         to compute a hash. Use ASCIICaseInsensitiveHash.
2869
2870 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2871
2872         Reduce PassRefPtr uses in dom - 5
2873         https://bugs.webkit.org/show_bug.cgi?id=153470
2874
2875         Reviewed by Darin Adler.
2876
2877         As a step to remove PassRefPtr, this patch reduces uses of PassRefPtr in WebCore/dom. 
2878
2879         * dom/Document.cpp:
2880         (WebCore::Document::adoptNode):
2881         (WebCore::Document::implicitClose):
2882         (WebCore::Document::enqueuePopstateEvent):
2883         (WebCore::Document::setInputCursor):
2884         * dom/Document.h:
2885         * dom/DocumentMarker.cpp:
2886         (WebCore::DocumentMarkerTextMatch::instanceFor):
2887         * dom/Event.cpp:
2888         (WebCore::Event::setUnderlyingEvent):
2889         * dom/Event.h:
2890         * dom/EventDispatcher.h:
2891         * dom/GenericEventQueue.cpp:
2892         (WebCore::GenericEventQueue::enqueueEvent):
2893         * dom/GenericEventQueue.h:
2894         * dom/MouseEvent.cpp:
2895         (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
2896         * dom/Node.cpp:
2897         (WebCore::Node::dispatchDOMActivateEvent):
2898         * dom/NodeIterator.h:
2899         * dom/PendingScript.h:
2900         * dom/PopStateEvent.cpp:
2901         (WebCore::PopStateEvent::create):
2902         * dom/PopStateEvent.h:
2903         * dom/ProcessingInstruction.cpp:
2904         (WebCore::ProcessingInstruction::setCSSStyleSheet): Deleted. Nobody calls this function.
2905         * dom/ProcessingInstruction.h:
2906         * dom/RangeBoundaryPoint.h:
2907         (WebCore::RangeBoundaryPoint::RangeBoundaryPoint):
2908         * dom/TextEvent.cpp:
2909         (WebCore::TextEvent::createForFragmentPaste):
2910         (WebCore::TextEvent::TextEvent):
2911         * dom/TextEvent.h:
2912         * editing/Editor.cpp:
2913         (WebCore::Editor::pasteAsFragment):
2914         * editing/Editor.h:
2915         * editing/mac/EditorMac.mm:
2916         (WebCore::Editor::replaceNodeFromPasteboard):
2917
2918 2016-01-31  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2919
2920         Use std::make_unique<> when creating an unique_ptr object.
2921         https://bugs.webkit.org/show_bug.cgi?id=153705
2922
2923         Reviewed by Darin Adler.
2924
2925         Some factory functions have used std::unique_ptr<> for creating an unique_ptr object.
2926         It is wrong. We have to use std::make_unique<>.
2927
2928         * Modules/mediasession/WebMediaSessionManager.cpp:
2929         (WebCore::WebMediaSessionManager::mockPicker):
2930         * inspector/InspectorTimelineAgent.cpp:
2931         (WebCore::InspectorTimelineAgent::internalStart):
2932         * platform/cf/RunLoopObserver.cpp:
2933         (WebCore::RunLoopObserver::create): Deleted.
2934         * platform/cf/RunLoopObserver.h:
2935         (WebCore::RunLoopObserver::RunLoopObserver):
2936         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
2937         (WebCore::WebMediaSessionManagerMac::platformPicker):
2938         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2939         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2940         (WebCore::MediaPlaybackTargetPickerMac::create): Deleted.
2941         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
2942         (WebCore::LayerFlushScheduler::LayerFlushScheduler):
2943         * platform/mock/MediaPlaybackTargetPickerMock.cpp:
2944         (WebCore::MediaPlaybackTargetPickerMock::create): Deleted.
2945         * platform/mock/MediaPlaybackTargetPickerMock.h:
2946         * rendering/FloatingObjects.cpp:
2947         (WebCore::FloatingObject::copyToNewContainer):
2948
2949 2016-01-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2950
2951         Unreviewed, fix GTK debug build after r195899
2952
2953         * dom/EventContext.h:
2954         (isType):
2955
2956 2016-01-30  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2957
2958         Add missing include to fix building debug configuration
2959         https://bugs.webkit.org/show_bug.cgi?id=153719
2960
2961         Reviewed by Darin Adler.
2962
2963         No new tests.
2964
2965         * rendering/RenderObject.cpp:
2966
2967 2016-01-30  Commit Queue  <commit-queue@webkit.org>
2968
2969         Unreviewed, rolling out r195911.
2970         https://bugs.webkit.org/show_bug.cgi?id=153723
2971
2972         Caused frequent assertion failures on bots (Requested by ap on
2973         #webkit).
2974
2975         Reverted changeset:
2976
2977         "Replace CaseFoldingHash with ASCIICaseInsensitiveHash"
2978         https://bugs.webkit.org/show_bug.cgi?id=153639
2979         http://trac.webkit.org/changeset/195911
2980
2981 2016-01-30  Commit Queue  <commit-queue@webkit.org>
2982
2983         Unreviewed, rolling out r195799 and r195828.
2984         https://bugs.webkit.org/show_bug.cgi?id=153722
2985
2986         Caused assertion failures, severely affecting EWS (Requested
2987         by ap on #webkit).
2988
2989         Reverted changesets:
2990
2991         "Web Inspector: InspectorTimelineAgent doesn't need to
2992         recompile functions because it now uses the sampling profiler"
2993         https://bugs.webkit.org/show_bug.cgi?id=153500
2994         http://trac.webkit.org/changeset/195799
2995
2996         "Attempt to fix the Windows build after r195799"
2997         http://trac.webkit.org/changeset/195828
2998
2999 2016-01-30  Brady Eidson  <beidson@apple.com>
3000
3001         Modern IDB: Some tests crash with specific odd database names.
3002         https://bugs.webkit.org/show_bug.cgi?id=153688
3003
3004         Reviewed by Darin Adler.
3005
3006         No new tests (2 existing tests now pass).
3007
3008         * platform/FileSystem.cpp:
3009         (WebCore::shouldEscapeUChar): Return true for some surrogate-pair situations.
3010         (WebCore::encodeForFileName): Pass along the previous and next characters, as well,
3011           and do a two byte escaping for some characters.
3012
3013 2016-01-30  Eric Carlson  <eric.carlson@apple.com>
3014
3015         More than one audio and/or text track sometimes selected in media controls menu
3016         https://bugs.webkit.org/show_bug.cgi?id=153664
3017
3018         Use an <img> element for the track menu item checkmark instead of a background image and
3019         the ::before selector.
3020
3021         Reviewed by Jer Noble.
3022
3023         Test: media/controls/track-menu.html
3024
3025         * Modules/mediacontrols/mediaControlsApple.css:
3026         (audio::-webkit-media-controls-closed-captions-container li:hover):
3027         (audio::-webkit-media-controls-closed-captions-container li .checkmark-container):
3028         (audio::-webkit-media-controls-closed-captions-container li.selected .checkmark-container):
3029         (audio::-webkit-media-controls-closed-captions-container li.selected:hover .checkmark-container):
3030         (audio::-webkit-media-controls-closed-captions-container li.selected::before): Deleted.
3031         (audio::-webkit-media-controls-closed-captions-container li.selected:hover::before): Deleted.
3032         * Modules/mediacontrols/mediaControlsApple.js:
3033         (Controller.prototype.buildCaptionMenu):
3034         (Controller.prototype.):
3035         (Controller.prototype.getCurrentControlsStatus):
3036
3037 2016-01-30  Darin Adler  <darin@apple.com>
3038
3039         Replace CaseFoldingHash with ASCIICaseInsensitiveHash
3040         https://bugs.webkit.org/show_bug.cgi?id=153639
3041
3042         Reviewed by Filip Pizlo.
3043
3044         * Modules/webdatabase/DatabaseAuthorizer.h: Use ASCIICaseInsensitiveHash
3045         for whitelisted functions. Function names are all ASCII.
3046
3047         * accessibility/AccessibilityObject.cpp: Use ASCIICaseInsensitiveHash
3048         for ARIA roles. ARIA roles are all ASCII.
3049
3050         * crypto/CryptoAlgorithmRegistry.h: Use ASCIICaseInsensitiveHash for
3051         crypto algorithm names. Algorithm names are all ASCII.
3052
3053         * css/CSSFontSelector.cpp:
3054         (WebCore::registerLocalFontFacesForFamily): Use ASCIICaseInsensitiveHash
3055         for font faces. Face names should use ASCII case insensitive matching;
3056         there is no need for non-ASCII case folding.
3057         * css/CSSFontSelector.h: Ditto.
3058
3059         * dom/DOMImplementation.cpp: Use ASCIICaseInsensitiveHash for the
3060         FeatureSet. The features are all ASCII.
3061
3062         * dom/Document.h: Use ASCIICaseInsensitiveHash for the access key
3063         map. Access keys are all ASCII.
3064
3065         * dom/ScriptElement.cpp:
3066         (WebCore::isLegacySupportedJavaScriptLanguage): Use ASCIICaseInsensitiveHash
3067         for the language set. These strings are all ASCII.
3068
3069         * editing/EditorCommand.cpp: Use ASCIICaseInsensitiveHash for editor
3070         command names. These names are all ASCII.
3071
3072         * html/HTMLObjectElement.cpp:
3073         (WebCore::HTMLObjectElement::parametersForPlugin): Use ASCIICaseInsensitiveHash
3074         for parameter names. These names are all ASCII.
3075
3076         * html/InputType.cpp: Use ASCIICaseInsensitiveHash for the input types.
3077         The input types are all ASCII.
3078
3079         * loader/CrossOriginAccessControl.h: Use ASCIICaseInsensitiveHash for
3080         HTTP header field names. These names are all ASCII.
3081         * loader/CrossOriginPreflightResultCache.h: Ditto.
3082
3083         * loader/archive/ArchiveFactory.cpp: Use ASCIICaseInsensitiveHash for
3084         MIME types. MIME types are all ASCII.
3085         * platform/MIMETypeRegistry.cpp:
3086         (WebCore::initializeSupportedImageMIMETypes): Ditto.
3087
3088         * platform/SchemeRegistry.h: Use ASCIICaseInsensitiveHas for URL schemes.
3089         URL schemes are all ASCII.
3090         * platform/URL.cpp: Ditto.
3091
3092         * platform/graphics/FontCache.cpp: Reworked FontPlatformDataCacheKey struct:
3093         Made it a conventional struct with non-prefixed data members names. Removed
3094         the "==" operator since it was appropriate for hash table lookup but wasn't
3095         a true equality operator. Tightened the implementations of the constructors.
3096         (WebCore::FontPlatformDataCacheKeyHash::hash): Use ASCIICaseInsensitiveHash.
3097         (WebCore::FontPlatformDataCacheKeyHash::equal): Do the equality check here,
3098         not using the == operator. And use equalIgnoringASCIICase.
3099         (WebCore::FontPlatformDataCacheKeyTraits::isEmptyValue): Added this entire
3100         traits struct so we check empty values in a more efficient way.
3101         (WebCore::FontCache::getCachedFontPlatformData): Added comments and tweaked
3102         style in this function.
3103
3104         * platform/graphics/FontCascade.cpp:
3105         (WebCore::keysMatch): Rename from operator== since this operation is not
3106         equality. Changed to equalIgnoringASCIICase and did a little streamlining.
3107         (WebCore::makeFontCascadeCacheKey): Use reserveInitialCapacity for slightly
3108         better memory use.
3109         (WebCore::computeFontCascadeCacheHash): Use IntegerHasher to make computing
3110         a hash more efficient by eliminating the overhead of building a vector and
3111         even possible heap allocation and deallocation.
3112         (WebCore::retrieveOrAddCachedFonts): Use keysMatch instead of ==.
3113
3114         * platform/graphics/cocoa/FontCacheCoreText.cpp: Use ASCIICaseInsensitiveHash
3115         for font family names. These names should use ASCII case insensitive matching;
3116         there is no need for non-ASCII case folding.
3117
3118         * platform/network/HTTPHeaderMap.h: Use ASCIICaseInsensitiveHash for
3119         HTTP header field names. These names are all ASCII.
3120
3121         * rendering/style/RenderStyle.cpp:
3122         (WebCore::computeFontHash): Use IntegerHasher to avoid allocating memory just
3123         to compute a hash. Use ASCIICaseInsensitiveHash.
3124
3125 2016-01-30  Chris Dumez  <cdumez@apple.com>
3126
3127         Unreviewed, rolling out r195871.
3128
3129         Caused several layout tests to time out
3130
3131         Reverted changeset:
3132
3133         "Tab suspension code shouldn't use page cache cacheability
3134         logic"
3135         https://bugs.webkit.org/show_bug.cgi?id=153680
3136         http://trac.webkit.org/changeset/195871
3137
3138 2016-01-30  Chris Dumez  <cdumez@apple.com>
3139
3140         Unreviewed, rebaseline bindings tests after r195904.
3141
3142         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3143         (WebCore::JSTestCustomNamedGetter::getOwnPropertySlot):
3144         (WebCore::jsTestCustomNamedGetterConstructor):
3145         (WebCore::setJSTestCustomNamedGetterConstructor):
3146         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3147         (WebCore::JSTestEventTarget::getOwnPropertySlot):
3148         (WebCore::jsTestEventTargetConstructor):
3149         (WebCore::setJSTestEventTargetConstructor):
3150         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3151         (WebCore::JSTestOverrideBuiltins::getOwnPropertySlot):
3152         (WebCore::jsTestOverrideBuiltinsConstructor):
3153         (WebCore::setJSTestOverrideBuiltinsConstructor):
3154
3155 2016-01-30  Chris Dumez  <cdumez@apple.com>
3156
3157         [JS Bindings] prototype.constructor should be writable
3158         https://bugs.webkit.org/show_bug.cgi?id=149412
3159         <rdar://problem/22545096>
3160
3161         Reviewed by Darin Adler.
3162
3163         prototype.constructor should have the following properties:
3164         { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }
3165
3166         as per the Web IDL specification:
3167         https://heycam.github.io/webidl/#interface-prototype-object
3168
3169         In WebKit, it is currently not writable. It is writable in Firefox.
3170
3171         This patch was first landed in r190085 but was rolled out for causing
3172         crashes: <rdar://problem/22825602>. The issue was that even though we
3173         marked constructor as writable, we failed to generate a setter for it.
3174         This patch addresses the issue and the crash in <rdar://problem/22825602>
3175         no longer occurs after this change. A regression test is also added for
3176         this crash.
3177
3178         Tests:
3179         fast/dom/HTMLDocument/constructor-setter-crash.html
3180         fast/dom/prototype-constructor-setter.html
3181
3182         * bindings/scripts/CodeGeneratorJS.pm:
3183         (GenerateAttributesHashTable):
3184         (GenerateImplementation):
3185         * bindings/scripts/IDLAttributes.txt:
3186         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3187         (WebCore::setJSTestActiveDOMObjectConstructor):
3188         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3189         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
3190         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3191         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
3192         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3193         (WebCore::setJSTestCustomNamedGetterConstructor):
3194         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3195         (WebCore::setJSTestEventConstructorConstructor):
3196         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3197         (WebCore::setJSTestEventTargetConstructor):
3198         * bindings/scripts/test/JS/JSTestException.cpp:
3199         (WebCore::setJSTestExceptionConstructor):
3200         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3201         (WebCore::setJSTestGenerateIsReachableConstructor):
3202         * bindings/scripts/test/JS/JSTestInterface.cpp:
3203         (WebCore::setJSTestInterfaceConstructor):
3204         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3205         (WebCore::setJSTestJSBuiltinConstructorConstructor):
3206         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3207         (WebCore::setJSTestMediaQueryListListenerConstructor):
3208         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3209         (WebCore::setJSTestNamedConstructorConstructor):
3210         * bindings/scripts/test/JS/JSTestNode.cpp:
3211         (WebCore::setJSTestNodeConstructor):
3212         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3213         (WebCore::setJSTestNondeterministicConstructor):
3214         * bindings/scripts/test/JS/JSTestObj.cpp:
3215         (WebCore::setJSTestObjConstructor):
3216         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3217         (WebCore::setJSTestOverloadedConstructorsConstructor):
3218         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3219         (WebCore::setJSTestOverrideBuiltinsConstructor):
3220         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3221         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
3222         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3223         (WebCore::setJSTestTypedefsConstructor):
3224         * bindings/scripts/test/JS/JSattribute.cpp:
3225         (WebCore::setJSattributeConstructor):
3226         * bindings/scripts/test/JS/JSreadonly.cpp:
3227         (WebCore::setJSreadonlyConstructor):
3228         * page/DOMWindow.idl:
3229
3230 2016-01-30  Chris Dumez  <cdumez@apple.com>
3231
3232         Move more 'constructor' properties to the prototype
3233         https://bugs.webkit.org/show_bug.cgi?id=153667
3234
3235         Reviewed by Darin Adler.
3236
3237         Move more 'constructor' properties to the prototype. In particular, we
3238         used to keep the 'constructor' on the instance for interfaces that have
3239         an indexed / named property getter because our getOwnPropertySlot()
3240         implementation used to be wrong for such interfaces.
3241
3242         However, getOwnPropertySlot() should be correct after r188590 so we
3243         should now be able to move the 'constructor' up to the prototype for
3244         these interfaces, as per the specification:
3245         http://heycam.github.io/webidl/#interface-prototype-object
3246
3247         No new tests, already covered by existing tests.
3248
3249         * bindings/js/JSPluginElementFunctions.h:
3250         (WebCore::pluginElementCustomGetOwnPropertySlot):
3251         Add a null check for staticPropHashTable. It is now null because this
3252         type no longer has any property on the instance now that 'constructor'
3253         is on the prototype.
3254
3255         * bindings/scripts/CodeGeneratorJS.pm:
3256         (ConstructorShouldBeOnInstance):
3257
3258 2016-01-29  Ada Chan  <adachan@apple.com>
3259
3260         Enable VIDEO_PRESENTATION_MODE only in Debug and Release builds on Mac
3261         https://bugs.webkit.org/show_bug.cgi?id=153665
3262
3263         Reviewed by Dan Bernstein.
3264
3265         * Configurations/FeatureDefines.xcconfig:
3266
3267 2016-01-30  David Kilzer  <ddkilzer@apple.com>
3268
3269         [iOS] WebKit1 apps crash in ___ZN7WebCore16DiskCacheMonitorC2ERKNS_15ResourceRequestENS_9SessionIDEPK20_CFCachedURLResponse_block_invoke1
3270         <http://webkit.org/b/153710>
3271         <rdar://problem/23116706>
3272
3273         Reviewed by Darin Adler.
3274
3275         * loader/cocoa/DiskCacheMonitorCocoa.mm:
3276         (WebCore::DiskCacheMonitor::DiskCacheMonitor):
3277         - Fix race condition on iOS WebKit1 clients by calling the block
3278           to cancel the DiskCacheMonitor on the WebThread, which is the
3279           same thread where the CFCachedURLResponseCallBackBlock is
3280           called.
3281         - Removed whitespace to adhere to style.
3282
3283 2016-01-30  Ryosuke Niwa  <rniwa@webkit.org>
3284
3285         TouchList should be retargeted
3286         https://bugs.webkit.org/show_bug.cgi?id=149592
3287
3288         Reviewed by Antti Koivisto.
3289
3290         Retarget touch target's using the same algorithm as the one used for related targets instead of
3291         EventRelatedNodeResolver which is removed in this patch.
3292
3293         Also enable the retargeting on iOS.
3294
3295         Test: fast/shadow-dom/touch-event-ios.html
3296
3297         * dom/EventContext.cpp:
3298         (WebCore::TouchEventContext::TouchEventContext):
3299         (WebCore::TouchEventContext::handleLocalEvents):
3300         (WebCore::TouchEventContext::checkReachability):
3301         * dom/EventContext.h:
3302         (WebCore::toTouchEventContext):
3303         (WebCore::EventContext::isUnreachableNode):
3304         * dom/EventDispatcher.cpp:
3305         (WebCore::EventRelatedNodeResolver): Deleted.
3306         (WebCore::EventPath::EventPath):
3307         (WebCore::EventDispatcher::dispatchEvent): 
3308         (WebCore::addRelatedNodeResolversForTouchList): Deleted.
3309         (WebCore::EventPath::updateTouchLists): Deleted.
3310         (WebCore::EventPath::setRelatedTarget): Removed superfluous UNUSED_PARAM since the argument is always used.
3311         (WebCore::EventPath::retargetTouch): Extracted from updateTouchLists/setRelatedTarget. Clones Touch object
3312         with the new target for each event context just like related targets.
3313         (WebCore::EventPath::retargetTouchLists): Renamed from updateTouchLists. Calls retargetTouch on each Touch
3314         object in each TouchList.
3315         * dom/TouchEvent.h:
3316
3317 2016-01-30 Dave Hyatt  <hyatt@apple.com>
3318
3319         Support break-after, break-before and break-inside.
3320         https://bugs.webkit.org/show_bug.cgi?id=148814
3321
3322         Reviewed by Dean Jackson.
3323
3324         New tests added in printing/, fast/multicol/, and fast/regions.
3325
3326         * css/CSSComputedStyleDeclaration.cpp:
3327         (WebCore::convertToPageBreak):
3328         (WebCore::convertToColumnBreak):
3329         (WebCore::convertToRegionBreak):
3330         For backwards compatibility, keep support for all the old properties in
3331         computed style. This means we have to convert the break-* property values
3332         into keywords that make sense for the legacy properties. This mainly
3333         involves mapping "page", "column", "region" to "always" (similar rule for
3334         the avoid-* versions as well).
3335
3336         (WebCore::ComputedStyleExtractor::propertyValue):
3337         Add support for the three new break-* properties.
3338
3339         * css/CSSParser.cpp:
3340         (WebCore::isValidKeywordPropertyAndValue):
3341         (WebCore::isKeywordPropertyID):
3342         (WebCore::CSSParser::parseValue):
3343         Add support for the new break properties.
3344
3345         * css/CSSPrimitiveValueMappings.h:
3346         (WebCore::CSSPrimitiveValue::operator BreakBetween):
3347         (WebCore::CSSPrimitiveValue::operator BreakInside):
3348         Add converters for the new BreakBetween and BreakInside enums. Remove
3349         the EPageBreak enum, since it is no longer used.
3350
3351         * css/CSSPropertyNames.in:
3352         * css/CSSValueKeywords.in:
3353         Add the new properties and the new values supported by the properties
3354         to the keywords lists.
3355
3356         * css/StyleBuilderConverter.h:
3357         (WebCore::StyleBuilderConverter::convertFontSynthesis):
3358         (WebCore::StyleBuilderConverter::convertPageBreakBetween):
3359         (WebCore::StyleBuilderConverter::convertPageBreakInside):
3360         (WebCore::StyleBuilderConverter::convertColumnBreakBetween):
3361         (WebCore::StyleBuilderConverter::convertColumnBreakInside):
3362         (WebCore::StyleBuilderConverter::convertRegionBreakBetween):
3363         (WebCore::StyleBuilderConverter::convertRegionBreakInside):
3364         In order to map the legacy properties into the new break-* values
3365         we have custom converter functions.
3366
3367         * rendering/RenderBlock.cpp:
3368         (WebCore::RenderBlock::paintChild):
3369         (WebCore::RenderBlock::childBoxIsUnsplittableForFragmentation):
3370         (WebCore::RenderBlock::computeRegionRangeForBoxChild):
3371         * rendering/RenderBlockFlow.cpp:
3372         (WebCore::RenderBlockFlow::applyBeforeBreak):
3373         (WebCore::RenderBlockFlow::applyAfterBreak):
3374         Patch the block code to check the correct new break-* constants. For
3375         avoidance, this means checking both the general avoid value and the
3376         specific value (e.g., avoid-page). In place of "always", we check
3377         the specific value (e.g., column) and then for page specifically, we
3378         also treat "left", "right", "recto" and "verso" as "always break" for now.
3379
3380         * rendering/style/RenderStyle.cpp:
3381         (WebCore::RenderStyle::changeRequiresLayout):
3382         Make sure changes to the break properties trigger relayout.
3383
3384         * rendering/style/RenderStyle.h:
3385         Add getters and setters for the break-* properties and remove all
3386         occurrences of the legacy page, column and region values from the RenderStyle.
3387
3388         * rendering/style/RenderStyleConstants.cpp:
3389         (WebCore::alwaysPageBreak):
3390         We have a helper function here for mapping several constant values to "page".
3391
3392         * rendering/style/RenderStyleConstants.h:
3393         Definitions of the new BreakBetween and BreakInside enums.
3394
3395         * rendering/style/StyleMultiColData.cpp:
3396         (WebCore::StyleMultiColData::StyleMultiColData):
3397         (WebCore::StyleMultiColData::operator==):
3398         * rendering/style/StyleMultiColData.h:
3399         Remove the column-specific break data.
3400
3401         * rendering/style/StyleRareNonInheritedData.cpp:
3402         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3403         (WebCore::StyleRareNonInheritedData::operator==):
3404         * rendering/style/StyleRareNonInheritedData.h:
3405         Remove the region-specific break data and replace it with generic break
3406         data that is now used by all three pagination models.
3407
3408 2016-01-29  Per Arne Vollan  <peavo@outlook.com>
3409
3410         [Win] Fix compile error.
3411         https://bugs.webkit.org/show_bug.cgi?id=153646
3412
3413         Reviewed by Darin Adler.
3414
3415         * platform/text/win/LocaleWin.cpp:
3416         (WebCore::LCIDFromLocaleInternal):
3417
3418 2016-01-29  Antti Koivisto  <antti@apple.com>
3419
3420         Tab suspension code shouldn't use page cache cacheability logic
3421         https://bugs.webkit.org/show_bug.cgi?id=153680
3422
3423         Reviewed by Andreas Kling.
3424
3425         Most of PageCache::canCache() is unnecessary for tab suspension.
3426
3427         Also improve robustness.
3428
3429         * page/Page.cpp:
3430         (WebCore::Page::setPageActivityState):
3431         (WebCore::Page::setIsVisible):
3432         (WebCore::Page::setIsVisibleInternal):
3433         (WebCore::Page::setIsPrerender):
3434         (WebCore::Page::canTabSuspend):
3435
3436             Include visibility test here.
3437
3438             Instead of calling PageCache::canCache() just check for each frame that
3439             - that the document is loaded
3440             - that active DOM objects allow suspension
3441
3442         (WebCore::Page::setIsTabSuspended):
3443         (WebCore::Page::setTabSuspensionEnabled):
3444         (WebCore::Page::updateTabSuspensionState):
3445
3446             Refactor for robustness.
3447
3448         (WebCore::Page::tabSuspensionTimerFired):
3449
3450             Call canTabSuspend, the result might have changed.
3451
3452         (WebCore::Page::scheduleTabSuspension): Deleted.
3453         * page/Page.h:
3454
3455 2016-01-29  Ryosuke Niwa  <rniwa@webkit.org>
3456
3457         fast/shadow-dom/Element-interface-attachShadow.html fails on iOS
3458         https://bugs.webkit.org/show_bug.cgi?id=153681
3459
3460         Reviewed by Antti Koivisto.
3461
3462         The bug was caused by canHaveUserAgentShadowRoot() returning false on a meter element since it's disabled on iOS.
3463         Override HTMLUnknownElement's canHaveUserAgentShadowRoot to return false for compatbility on iOS.
3464
3465         * html/HTMLUnknownElement.h:
3466         (WebCore::HTMLUnknownElement::canHaveUserAgentShadowRoot):
3467
3468 2016-01-29  Brady Eidson  <beidson@apple.com>
3469
3470         Modern IDB: Getting records for key ranges with null keys aren't properly handled in SQLite backend
3471         https://bugs.webkit.org/show_bug.cgi?id=153666
3472
3473         Reviewed by Tim Horton.
3474
3475         No new tests (Two failing tests now pass).
3476
3477         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3478         (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
3479
3480 2016-01-29  Simon Fraser  <simon.fraser@apple.com>
3481
3482         image-rendering: -webkit-optimize-contrast not working for background images
3483         https://bugs.webkit.org/show_bug.cgi?id=97991
3484
3485         Reviewed by Darin Adler.
3486         
3487         Don't equate "pixelated" and "crisp-edges" values for image-rendering with low
3488         quality scaling; they should map to InterpolationNone, not InterpolationLow.
3489         
3490         To support this change ImageQualityController to return a InterpolationQuality
3491         from the renamed chooseInterpolationQuality(). If the returned value is not
3492         InterpolationDefault, set the GraphicsContext image interpolation when drawing
3493         images and image buffers.
3494         
3495         Remove the redundant "useLowQualityScale" from 
3496
3497         Test: fast/images/image-rendering-interpolation.html
3498
3499         * html/HTMLCanvasElement.cpp:
3500         (WebCore::HTMLCanvasElement::paint):
3501         * html/HTMLCanvasElement.h:
3502         * page/DragController.cpp:
3503         (WebCore::DragController::doImageDrag):
3504         * platform/graphics/GraphicsContext.cpp:
3505         (WebCore::GraphicsContext::drawImage):
3506         (WebCore::GraphicsContext::drawTiledImage):
3507         (WebCore::GraphicsContext::drawImageBuffer):
3508         (WebCore::GraphicsContext::drawConsumingImageBuffer):
3509         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer): Deleted.
3510         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer): Deleted.
3511         * platform/graphics/GraphicsContext.h:
3512         (WebCore::ImagePaintingOptions::ImagePaintingOptions):
3513         (WebCore::ImagePaintingOptions::usesDefaultInterpolation):
3514         (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
3515         (WebCore::InterpolationQualityMaintainer::~InterpolationQualityMaintainer):
3516         * platform/graphics/GraphicsTypes.h:
3517         * platform/graphics/ImageBuffer.h:
3518         * platform/graphics/cg/ImageBufferCG.cpp:
3519         (WebCore::ImageBuffer::drawConsuming):
3520         (WebCore::ImageBuffer::draw):
3521         * rendering/ImageQualityController.cpp:
3522         (WebCore::ImageQualityController::interpolationQualityFromStyle):
3523         (WebCore::ImageQualityController::chooseInterpolationQuality):
3524         (WebCore::ImageQualityController::ImageQualityController): Deleted.
3525         (WebCore::ImageQualityController::shouldPaintAtLowQuality): Deleted.
3526         * rendering/ImageQualityController.h:
3527         * rendering/RenderBoxModelObject.cpp:
3528         (WebCore::RenderBoxModelObject::chooseInterpolationQuality):
3529         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3530         (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality): Deleted.
3531         * rendering/RenderBoxModelObject.h:
3532         * rendering/RenderEmbeddedObject.cpp:
3533         (WebCore::RenderEmbeddedObject::paintSnapshotImage):
3534         * rendering/RenderHTMLCanvas.cpp:
3535         (WebCore::RenderHTMLCanvas::paintReplaced):
3536         * rendering/RenderImage.cpp:
3537         (WebCore::RenderImage::paintIntoRect):
3538         * rendering/RenderSnapshottedPlugIn.cpp:
3539         (WebCore::RenderSnapshottedPlugIn::paintSnapshot):
3540         * rendering/style/RenderStyle.h:
3541
3542 2016-01-29  Brady Eidson  <beidson@apple.com>
3543
3544         Modern IDB: storage/indexeddb/modern/index-3.html fails.
3545         https://bugs.webkit.org/show_bug.cgi?id=153661
3546
3547         Reviewed by Tim Horton.
3548
3549         No new tests (1 failing test now passes, others get closer).
3550
3551         When indexing a new record fails due to uniqueness constraints, remove all traces of the record.
3552
3553         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3554         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
3555         (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
3556         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
3557
3558 2016-01-29  Brent Fulgham  <bfulgham@apple.com>
3559
3560         [WebGL] Check vertex array bounds before permitting a glDrawArrays to execute
3561         https://bugs.webkit.org/show_bug.cgi?id=153643
3562         <rdar://problem/23424456>
3563
3564         Reviewed by Dean Jackson.
3565
3566         Tested by fast/canvas/webgl/webgl-drawarrays-crash.html.
3567
3568         * html/canvas/WebGLRenderingContextBase.cpp:
3569         (WebCore::WebGLRenderingContextBase::validateDrawArrays): Make sure that we have at
3570         least one buffer bound to a program if a drawArray call with a non-zero range of
3571         requested data is being made.
3572         (WebCore::WebGLRenderingContextBase::validateDrawElements): Drive-by formatting fix.
3573
3574 2016-01-29  Brady Eidson  <beidson@apple.com>
3575
3576         Modern IDB: Fix logging that overwhelms python with strings of excessive length.
3577         https://bugs.webkit.org/show_bug.cgi?id=153652
3578
3579         Reviewed by Tim Horton.
3580
3581         No new tests (Two skipped tests now pass).
3582
3583         * Modules/indexeddb/IDBKeyData.cpp:
3584         (WebCore::IDBKeyData::loggingString): Limit the length of the string.
3585         
3586         * Modules/indexeddb/IDBKeyRangeData.cpp:
3587         (WebCore::IDBKeyRangeData::loggingString): Limit the length of the string.
3588
3589 2016-01-29  Jer Noble  <jer.noble@apple.com>
3590
3591         Unreviewed Windows build fix; one more ResourceLoaderOptions call site which needs to
3592         be updated after adding the CachingPolicy parameter.
3593
3594         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3595         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3596
3597 2016-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
3598
3599         [GTK] Implement overlay scrollbars
3600         https://bugs.webkit.org/show_bug.cgi?id=153405
3601
3602         Reviewed by Michael Catanzaro.
3603
3604         Add support for overlay scrollbars to GTK+ platform following the
3605         same style and behavior than GtkScrolledWindow. They are only
3606         available for GTK+ >= 3.19, but honoring the GTK_OVERLAY_SCROLLING
3607         environment variable, so they could be disable at run time, except
3608         when threaded compositor is enabled. A new ScrollAnimator class
3609         has been added for GTK+ to implement overlay scrollbars and still
3610         allow smooth scrolling when available.
3611
3612         * PlatformGTK.cmake: Add ScrollAnimatorGtk and stop building ScrollAnimatorSmooth.
3613         * platform/ScrollAnimator.h:
3614         (WebCore::ScrollAnimator::ScrollAnimator::mouseEnteredContentArea):
3615         Remove const to allow the ScrollAnimator to be updated.
3616         (WebCore::ScrollAnimator::ScrollAnimator::mouseExitedContentArea): Ditto.
3617         (WebCore::ScrollAnimator::ScrollAnimator::mouseMovedInContentArea): Ditto.
3618         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidShow): Ditto.
3619         (WebCore::ScrollAnimator::ScrollAnimator::contentAreaDidHide): Ditto.
3620         * platform/Scrollbar.h:
3621         (WebCore::Scrollbar::opacity): Get scrollbar opacity.
3622         (WebCore::Scrollbar::setOpacity): Set scrollbar opacity.
3623         * platform/gtk/ScrollAnimatorGtk.cpp: Added.
3624         (WebCore::ScrollAnimator::create): Create a ScrollAnimatorGtk.
3625         (WebCore::ScrollAnimatorGtk::ScrollAnimatorGtk):
3626         (WebCore::ScrollAnimatorGtk::~ScrollAnimatorGtk):
3627         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation):
3628         Initialize the ScrollAnimationSmooth if it doesn't exist.
3629         (WebCore::ScrollAnimatorGtk::scroll): Ensure we have a
3630         ScrollAnimationSmooth if smooth scrolling is enabled. This also
3631         fixes the problem of having to reload the page after changing the
3632         smooth scrolling setting.
3633         (WebCore::ScrollAnimatorGtk::scrollToOffsetWithoutAnimation):
3634         (WebCore::ScrollAnimatorGtk::willEndLiveResize):
3635         (WebCore::ScrollAnimatorGtk::didAddVerticalScrollbar): Register
3636         the scrollbar if it's an overlay scrollbar and make it visible
3637         without animating it. Start the hide animation.
3638         (WebCore::ScrollAnimatorGtk::didAddHorizontalScrollbar): Ditto.
3639         (WebCore::ScrollAnimatorGtk::willRemoveVerticalScrollbar):
3640         Unregister the scrollbar if it was registered and resrt the
3641         animation state if it was the only scrollbar.
3642         (WebCore::ScrollAnimatorGtk::willRemoveHorizontalScrollbar): Ditto.
3643         (WebCore::ScrollAnimatorGtk::updateOverlayScrollbarsOpacity): Update
3644         the scrollbars opacity and invalidate the indicator.
3645         (WebCore::easeOutCubic):
3646         (WebCore::ScrollAnimatorGtk::overlayScrollbarAnimationTimerFired):
3647         Update the scrollbars opacity and schedule a next frame if the
3648         animation didn't finish or start the hide animation otherwhise.
3649         (WebCore::ScrollAnimatorGtk::showOverlayScrollbars): Start the
3650         fade animation to show the scrollbars if needed.
3651         (WebCore::ScrollAnimatorGtk::hideOverlayScrollbars): Start the
3652         dafe animation to hide the scrollbars if needed.
3653         (WebCore::ScrollAnimatorGtk::mouseEnteredContentArea): Call
3654         showOverlayScrollbars().
3655         (WebCore::ScrollAnimatorGtk::mouseExitedContentArea): Call
3656         hideOverlayScrollbars().
3657         (WebCore::ScrollAnimatorGtk::mouseMovedInContentArea): Call
3658         showOverlayScrollbars().
3659         (WebCore::ScrollAnimatorGtk::contentAreaDidShow): Ditto.
3660         (WebCore::ScrollAnimatorGtk::contentAreaDidHide): Hide the
3661         scrollbars without animations.
3662         (WebCore::ScrollAnimatorGtk::notifyContentAreaScrolled): Call
3663         showOverlayScrollbars().
3664         (WebCore::ScrollAnimatorGtk::lockOverlayScrollbarStateToHidden):
3665         Update the lock state and hide or show the scrollbars when locked
3666         or unlocked.
3667         * platform/gtk/ScrollAnimatorGtk.h: Added.
3668         * platform/gtk/ScrollbarThemeGtk.cpp:
3669         (WebCore::ScrollbarThemeGtk::backButtonRect): Pass
3670         StyleContextMode to getOrCreateStyleContext depending on the
3671         painting parameter.
3672         (WebCore::ScrollbarThemeGtk::forwardButtonRect): Ditto.
3673         (WebCore::ScrollbarThemeGtk::trackRect): Ditto.
3674         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
3675         StyleContextMode parameter to add the hovering class
3676         unconditionally when using overlay scrollbars in layout mode. In
3677         paint mode we add the hovering clas only when the scrollbar is
3678         hovered. This way we always claim the size of the scrollbar when
3679         hovered to be able to show the full scrollbar when the mouse is
3680         close enough to the indicator.
3681         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk): Initialize
3682         m_usesOverlayScrollbars.
3683         (WebCore::ScrollbarThemeGtk::thumbRect): Pass the scrollbar to
3684         getOrCreateStyleContext().
3685         (WebCore::adjustRectAccordingToMargin): Fix the top margin.
3686         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Pass the
3687         scrollbar and paint mode to getOrCreateStyleContext().
3688         (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): Ditto.
3689         (WebCore::ScrollbarThemeGtk::paintThumb): Adjust the thumb
3690         rectangle when overlay scrollbar is not hovered to its current
3691         size, since we always claim the size of the scrollbar in hovered
3692         mode.
3693         (WebCore::ScrollbarThemeGtk::paintButton): Pass the scrollbar and
3694         paint mode to getOrCreateStyleContext().
3695         (WebCore::ScrollbarThemeGtk::paint): Take the scrollbar opacity
3696         into account when rendering overlay scrollbars as indicators. Also
3697         get the scrollbar opacity from the GTK+ theme and use a
3698         transparency group when the global opacity is not full opaque.
3699         (WebCore::ScrollbarThemeGtk::buttonSize): Pass the scrollbar to
3700         getOrCreateStyleContext().
3701         * platform/gtk/ScrollbarThemeGtk.h:
3702         * platform/mac/ScrollAnimatorMac.h:
3703         * platform/mac/ScrollAnimatorMac.mm:
3704         (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
3705         (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
3706         (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
3707         (WebCore::ScrollAnimatorMac::contentAreaDidShow):
3708         (WebCore::ScrollAnimatorMac::contentAreaDidHide):
3709
3710 2016-01-29  ChangSeok Oh  <changseok.oh@collabora.com>
3711
3712         [GStreamer] built-in media player doesn't update
3713         https://bugs.webkit.org/show_bug.cgi?id=151816
3714
3715         Reviewed by Xabier Rodriguez-Calvar.
3716
3717         The timeline of audio controls in media document is not properly updated since it is assumed
3718         that the controls are hidden as soon as playing. However, such full page audio always has
3719         opacity : 1 declared by video:-webkit-full-page-media::-webkit-media-controls-panel.no-video.
3720         i.e. it is not actually hidden. We can fix this by simply returning false for no-video media
3721         in controlsAreHidden();
3722
3723         Test: media/audio-controls-timeline-in-media-document.html
3724
3725         * Modules/mediacontrols/mediaControlsBase.js:
3726         (Controller.prototype.controlsAreAlwaysVisible):
3727         (Controller.prototype.controlsAreHidden):
3728
3729 2016-01-29  Manuel Rego Casasnovas  <rego@igalia.com>
3730
3731         [css-grid] Store lines instead of tracks in GridResolvedPosition
3732         https://bugs.webkit.org/show_bug.cgi?id=153592
3733
3734         Reviewed by Sergio Villar Senin.
3735
3736         Due to the new feature that allows to create implicit tracks before the
3737         explicit ones, we will need to use lines instead of tracks in the
3738         code to be able to implement it properly.
3739
3740         This is just a first simple patch using lines instead of tracks in
3741         GridResolvedPosition. It modifies the code that was using it, as it was
3742         considering that the resolvedFinalPosition was a track index and
3743         not a line index.
3744
3745         So if we've an item positioned like:
3746           grid-column: 2 / 5;
3747           grid-row: 1 / span 2;
3748
3749         Before we were storing this information on the GridSpan:
3750         * columns:
3751           * resolvedInitialPosition: 1
3752           * resolvedFinalPosition:  3
3753         * rows:
3754           * resolvedInitialPosition: 0
3755           * resolvedFinalPosition:  1
3756
3757         And now we're storing:
3758         * columns:
3759           * resolvedInitialPosition: 1
3760           * resolvedFinalPosition:  4
3761         * rows:
3762           * resolvedInitialPosition: 0
3763           * resolvedFinalPosition:  2
3764
3765         No new tests, no change of behavior.
3766
3767         * css/CSSGridTemplateAreasValue.cpp:
3768         (WebCore::stringForPosition):
3769         * css/CSSParser.cpp:
3770         (WebCore::CSSParser::parseGridTemplateAreasRow):
3771         * css/StyleBuilderConverter.h:
3772         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
3773         * rendering/RenderGrid.cpp:
3774         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
3775         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3776         (WebCore::RenderGrid::ensureGridSize):
3777         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
3778         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
3779         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3780         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
3781         (WebCore::RenderGrid::columnAxisOffsetForChild):
3782         (WebCore::RenderGrid::rowAxisOffsetForChild):
3783         * rendering/RenderGrid.h:
3784         * rendering/style/GridCoordinate.h:
3785         (WebCore::GridSpan::GridSpan):
3786         (WebCore::GridSpan::integerSpan):
3787         (WebCore::GridSpan::end):
3788         (WebCore::GridCoordinate::GridCoordinate):
3789         * rendering/style/GridResolvedPosition.cpp:
3790         (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
3791         (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
3792         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
3793         (WebCore::resolveGridPositionAgainstOppositePosition):
3794         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
3795         (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
3796         (WebCore::resolveNamedGridLinePositionFromStyle): Deleted.
3797         * rendering/style/GridResolvedPosition.h:
3798
3799 2016-01-28  Brady Eidson  <beidson@apple.com>
3800
3801         Modern IDB: SQLite backend mismanages key generator values.
3802         https://bugs.webkit.org/show_bug.cgi?id=153625
3803
3804         Reviewed by Andy Estes.
3805
3806         No new tests (Many failing tests pass, a few get closer).
3807
3808         There's mixed assumptions about whether the value stored is the current value or the next value.
3809
3810         Fixing those assumptions fixes tests.
3811         
3812         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3813         (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): Store/retrieve the correct value.
3814         (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber): Ditto.
3815         (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): Ditto.
3816
3817 2016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
3818
3819         Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
3820         https://bugs.webkit.org/show_bug.cgi?id=153500
3821         <rdar://problem/24352458>
3822
3823         Reviewed by Timothy Hatcher.
3824
3825         * bindings/js/JSDOMWindowBase.cpp:
3826         (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
3827         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
3828         (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
3829         * bindings/js/JSDOMWindowBase.h:
3830         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3831         (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
3832         (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
3833         * bindings/js/JSWorkerGlobalScopeBase.h:
3834         * inspector/InspectorController.h:
3835         * inspector/InspectorController.cpp:
3836         (WebCore::InspectorController::legacyProfilerEnabled):
3837         (WebCore::InspectorController::setLegacyProfilerEnabled):
3838         Be more explicit about enabling legacy profiling.
3839
3840         * inspector/InspectorTimelineAgent.cpp:
3841         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3842         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
3843         TimelineAgent doesn't need to recompile if using the sampling profiler.
3844         This breaks console.profile, but console.profile should move to using
3845         the sampling profiler as well.
3846
3847         (WebCore::InspectorTimelineAgent::startFromConsole):
3848         (WebCore::InspectorTimelineAgent::stopFromConsole):
3849         (WebCore::startProfiling): Deleted.
3850         (WebCore::stopProfiling): Deleted.
3851         Inlined the use once static functions.
3852
3853         * page/PageConsoleClient.cpp:
3854         (WebCore::PageConsoleClient::profile):
3855         (WebCore::PageConsoleClient::profileEnd):
3856         Added FIXMEs for improving console.profile and profileEnd.
3857
3858         * testing/Internals.cpp:
3859         (WebCore::Internals::resetToConsistentState):
3860         (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
3861         (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
3862         * testing/Internals.h:
3863         * testing/Internals.idl:
3864         Be more explicit about enabling legacy profiling.
3865
3866 2016-01-28  Chris Dumez  <cdumez@apple.com>
3867
3868         Move attributes to the prototype for List types / and types with indexed/named property getters
3869         https://bugs.webkit.org/show_bug.cgi?id=153599
3870
3871         Reviewed by Darin Adler.
3872
3873         Move attributes to the prototype for List types / and types with indexed/named property getters.
3874
3875         We used to keep them on the instance because:
3876         1. Our GetOwnProperty lookup used to be in incorrect order for interfaces with indexed/named property getters.
3877         -> This was fixed recently and we now match the specification and other browsers.
3878         2. This used to regress performance when iterating over those list types
3879         -> Local testing seems to show that this is no longer a regression (tested Speedometer and various related Bindings PerformanceTests).
3880
3881         No new tests, already covered by existing tests.
3882
3883         * bindings/scripts/CodeGeneratorJS.pm:
3884         (InterfaceRequiresAttributesOnInstance): Deleted.
3885         (AttributeShouldBeOnInstanceForCompatibility): Deleted.
3886
3887 2016-01-28  Antti Koivisto  <antti@apple.com>
3888
3889         Tab suspension code hits asserts
3890              
3891
3892         Reviewed by Chris Dumez.
3893
3894         Enabling tab suspension and navigating around in a few tabs hits an assert in
3895         ScriptExecutionContext::suspendActiveDOMObject. This is because suspend/resume reasons don't pair properly
3896
3897         * dom/Document.cpp:
3898         (WebCore::Document::documentWillBecomeInactive):
3899         (WebCore::Document::suspend):
3900         (WebCore::Document::resume):
3901
3902             Provide the reason as argument.
3903
3904         * dom/Document.h:
3905         * history/CachedFrame.cpp:
3906         (WebCore::CachedFrameBase::restore):
3907
3908             No need to call resumeActiveDOMObjects/resumeScriptedAnimationControllerCallbacks explicitly as Document::resume does that.
3909
3910         (WebCore::CachedFrame::CachedFrame):
3911         * loader/FrameLoader.cpp:
3912         (WebCore::FrameLoader::commitProvisionalLoad):
3913         * page/Page.cpp:
3914         (WebCore::Page::canTabSuspend):
3915         (WebCore::Page::setIsTabSuspended):
3916
3917 2016-01-28  Brady Eidson  <beidson@apple.com>
3918
3919         Modern IDB: Fix several more problems with object store changes during cursor iteration in SQLite backend.
3920         https://bugs.webkit.org/show_bug.cgi?id=153616
3921
3922         Reviewed by Alex Christensen.
3923
3924         No new tests (A few failing tests pass, a few get closer).
3925
3926         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3927         (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
3928         
3929         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
3930         (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
3931         (WebCore::IDBServer::SQLiteIDBCursor::bindArguments):
3932         
3933         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
3934         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
3935
3936 2016-01-28  Daniel Bates  <dabates@apple.com>
3937
3938         Cleanup: Make DedicatedWorkerThread::create() an inline template method
3939         https://bugs.webkit.org/show_bug.cgi?id=153612
3940
3941         Reviewed by Andy Estes.
3942
3943         Make use of variadic template arguments and std::forward() to forward the arguments passed
3944         from DedicatedWorkerThread::create() to DedicatedWorkerThread::DedicatedWorkerThread(). This
3945         removes the need to duplicate code whenever we modify the parameter types or number of
3946         parameters taken by DedicatedWorkerThread::DedicatedWorkerThread().
3947
3948         * workers/DedicatedWorkerThread.cpp:
3949         (WebCore::DedicatedWorkerThread::create): Deleted.
3950         * workers/DedicatedWorkerThread.h: Reorganized listing of member functions such that we
3951         group the creation/constructor and destructor functions.
3952         (WebCore::DedicatedWorkerThread::create): Modified to be an inline template with variadic
3953         parameters that std::forward()s its arguments to DedicatedWorkerThread::DedicatedWorkerThread().