Fix the windows build.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-14  Sam Weinig  <sam@webkit.org>
2
3         Fix the windows build.
4
5         * page/UserContentController.cpp:
6
7 2016-03-14  Sam Weinig  <sam@webkit.org>
8
9         Add a baseURL parameter to _WKUserStyleSheet
10         https://bugs.webkit.org/show_bug.cgi?id=155219
11
12         Reviewed by Tim Horton.
13
14         - Moves to a model for user content where instead of each page having a WebCore::UserContentController
15           object, we have an abstract WebCore::UserContentProvider interface that can be implemented at the WebKit
16           level. For now, legacy WebKit continues to use the old UserContentController, which implements 
17           WebCore::UserContentProvider, and WebKit2 implements its own implementation so it can store additional
18           state.
19
20         * WebCore.xcodeproj/project.pbxproj:
21         Add new files.
22
23         * dom/ExtensionStyleSheets.cpp:
24         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
25         Switch to using forEachUserStyleSheet on the UserContentProvider.
26
27         * html/HTMLMediaElement.cpp:
28         (WebCore::HTMLMediaElement::loadResource):
29         Remove null check now that we always have a UserContentProvider.
30
31         * loader/EmptyClients.cpp:
32         (WebCore::fillWithEmptyClients):
33         * loader/EmptyClients.h:
34         Add new EmptyClients.
35
36         * loader/FrameLoader.cpp:
37         (WebCore::FrameLoader::loadResourceSynchronously):
38         Remove null check now that we always have a UserContentProvider.
39
40         * loader/PingLoader.cpp:
41         (WebCore::processContentExtensionRulesForLoad):
42         Remove null check now that we always have a UserContentProvider.
43
44         * loader/ResourceLoader.cpp:
45         (WebCore::ResourceLoader::willSendRequestInternal):
46         Remove null check now that we always have a UserContentProvider.
47
48         * loader/cache/CachedResourceLoader.cpp:
49         (WebCore::CachedResourceLoader::requestResource):
50         Remove null check now that we always have a UserContentProvider.
51
52         * page/DOMWindow.cpp:
53         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
54         Remove null checks now that we always have a UserContentProvider, and userMessageHandlerDescriptors
55         returns a reference.
56
57         (WebCore::DOMWindow::open):
58         Remove null check now that we always have a UserContentProvider.
59
60         * page/Frame.cpp:
61         (WebCore::Frame::injectUserScripts):
62         Simplify by lifting document check out of the main loop and using forEachUserScript.
63
64         * page/Page.cpp:
65         (WebCore::Page::Page):
66         (WebCore::Page::~Page):
67         (WebCore::Page::userContentProvider):
68         (WebCore::Page::setUserContentProvider):
69         (WebCore::Page::setUserContentController): Deleted.
70         * page/Page.h:
71         (WebCore::Page::userContentController): Deleted.
72         * page/PageConfiguration.h:
73         Store the UserContentProvider in a Ref, and require PageConfigurations to provide one. This
74         removes a bunch of null checks and simplifies the code.
75
76         * page/UserContentController.cpp:
77         (WebCore::UserContentController::~UserContentController):
78         (WebCore::UserContentController::forEachUserScript):
79         (WebCore::UserContentController::forEachUserStyleSheet):
80         (WebCore::UserContentController::addUserScript):
81         (WebCore::UserContentController::removeUserScript):
82         (WebCore::UserContentController::removeUserScripts):
83         (WebCore::UserContentController::addUserStyleSheet):
84         (WebCore::UserContentController::removeUserStyleSheet):
85         (WebCore::UserContentController::removeUserStyleSheets):
86         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
87         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
88         (WebCore::UserContentController::addUserContentExtension):
89         (WebCore::UserContentController::removeUserContentExtension):
90         (WebCore::UserContentController::removeAllUserContentExtensions):
91         (WebCore::UserContentController::removeAllUserContent):
92         (WebCore::UserContentController::addPage): Deleted.
93         (WebCore::UserContentController::removePage): Deleted.
94         (WebCore::contentExtensionsEnabled): Deleted.
95         (WebCore::UserContentController::processContentExtensionRulesForLoad): Deleted.
96         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
97         * page/UserContentController.h:
98         (WebCore::UserContentController::userScripts): Deleted.
99         (WebCore::UserContentController::userStyleSheets): Deleted.
100         (WebCore::UserContentController::userMessageHandlerDescriptors): Deleted.
101         Add inheritance from UserContentProvider and simplify things by removing unique_ptrs
102         that were holding the member variables. There is usually only one UserContentController
103         so having these in unique_ptrs doesn't make much sense.
104         
105         * page/UserContentProvider.cpp: Added.
106         (WebCore::UserContentProvider::UserContentProvider):
107         (WebCore::UserContentProvider::~UserContentProvider):
108         (WebCore::UserContentProvider::addPage):
109         (WebCore::UserContentProvider::removePage):
110         (WebCore::UserContentProvider::invalidateInjectedStyleSheetCacheInAllFramesInAllPages):
111         (WebCore::contentExtensionsEnabled):
112         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
113         (WebCore::UserContentProvider::actionsForResourceLoad):
114         * page/UserContentProvider.h: Added.
115         Add abstract class for providing user content and add some helpers on it.
116
117         * page/UserMessageHandlerDescriptor.h:
118         (WebCore::UserMessageHandlerDescriptor::create):
119         (WebCore::UserMessageHandlerDescriptor::client):
120         (WebCore::UserMessageHandlerDescriptor::invalidateClient):
121         * page/UserMessageHandlersNamespace.cpp:
122         (WebCore::UserMessageHandlersNamespace::handler):
123         Simplify now that userContentProvider() and userMessageHandlerDescriptors() are references.
124
125 2016-03-14  Enrica Casucci  <enrica@apple.com>
126
127         iOS: RTFD format is not available in the pasteboard after copy/cut.
128         https://bugs.webkit.org/show_bug.cgi?id=155477
129         rdar://problem/23500600
130
131         Reviewed by Tim Horton.
132
133         WebKit is using UTTypeRTFD instead of UTTypeFlatRTFD that is the
134         proper RTFD format for pastedboard. I also discovered that, when
135         we create the NSTextAttachment in the NSAttributedString we produce
136         from the DOM range, we are not generating a file name with the
137         appropriate extension for the MIME type. The iOS specific implementation
138         of the MIMETypeRegistry functions were empty.
139         There is no need to have a differentiation between OS X and iOS, so
140         we now have only one file called MIMETypeRegistryCocoa.mm.
141
142         * WebCore.xcodeproj/project.pbxproj:
143         * platform/cocoa/MIMETypeRegistryCocoa.mm: Added.
144         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
145         (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
146         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
147         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
148         * platform/ios/MIMETypeRegistryIOS.mm: Removed.
149         * platform/ios/PasteboardIOS.mm:
150         (WebCore::Pasteboard::read):
151         (WebCore::Pasteboard::supportedPasteboardTypes):
152         (WebCore::Pasteboard::hasData):
153         * platform/ios/PlatformPasteboardIOS.mm:
154         (WebCore::PlatformPasteboard::write):
155         * platform/mac/MIMETypeRegistryMac.mm: Removed.
156
157 2016-03-14  Daniel Bates  <dabates@apple.com>
158
159         Web Inspector: Display Content Security Policy hash in details sidebar for script and style elements
160         https://bugs.webkit.org/show_bug.cgi?id=155466
161         <rdar://problem/25152480>
162
163         Reviewed by Joseph Pecoraro and Timothy Hatcher.
164
165         For convenience, display the SHA-256 Content Security Policy (CSP) hash in the node details
166         sidebar for the selected HTML script element or HTML style element. A CSP script hash is
167         only applicable to inline JavaScript scripts. Therefore, we will display a hash for HTML
168         script elements only if they do not have a src attribute.
169
170         Tests: inspector/dom/csp-big5-hash.html
171                inspector/dom/csp-hash.html
172
173         * inspector/InspectorDOMAgent.cpp:
174         (WebCore::computeContentSecurityPolicySHA256Hash): Added.
175         (WebCore::InspectorDOMAgent::buildObjectForNode): For an applicable HTML script- or style-
176         element, pass the computed SHA-256 CSP hash to the Inspector front end.
177
178 2016-03-14  Joonghun Park  <jh718.park@samsung.com>
179
180         Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
181         https://bugs.webkit.org/show_bug.cgi?id=150497
182
183         Reviewed by Darin Adler.
184
185         No new tests, no new behaviours.
186
187         * Modules/indexeddb/IDBGetResult.h:
188         (WebCore::IDBGetResult::IDBGetResult):
189         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
190         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
191         * Modules/mediastream/RTCDataChannel.cpp:
192         (WebCore::RTCDataChannel::didReceiveRawData):
193         * dom/MessageEvent.cpp:
194         (WebCore::MessageEvent::MessageEvent):
195         * dom/MessageEvent.h:
196         * editing/Editor.cpp:
197         (WebCore::Editor::selectedRange):
198         * editing/Editor.h:
199         * editing/FrameSelection.h:
200         (WebCore::FrameSelection::toNormalizedRange):
201         * editing/VisiblePosition.cpp:
202         (WebCore::makeRange):
203         * editing/VisiblePosition.h:
204         * editing/VisibleSelection.cpp:
205         (WebCore::VisibleSelection::toNormalizedRange):
206         * editing/VisibleSelection.h:
207         * editing/VisibleUnits.cpp:
208         (WebCore::enclosingTextUnitOfGranularity):
209         (WebCore::wordRangeFromPosition):
210         (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
211         (WebCore::rangeExpandedAroundPositionByCharacters):
212         * editing/VisibleUnits.h:
213         * editing/cocoa/HTMLConverter.mm:
214         (HTMLConverter::_addAttachmentForElement):
215         (fileWrapperForURL):
216         * editing/efl/EditorEfl.cpp:
217         (WebCore::Editor::webContentFromPasteboard):
218         * editing/gtk/EditorGtk.cpp:
219         (WebCore::createFragmentFromPasteboardData):
220         (WebCore::Editor::webContentFromPasteboard):
221         * editing/ios/EditorIOS.mm:
222         (WebCore::dataInRTFDFormat):
223         (WebCore::dataInRTFFormat):
224         (WebCore::Editor::selectionInWebArchiveFormat):
225         (WebCore::Editor::WebContentReader::addFragment):
226         (WebCore::Editor::WebContentReader::readWebArchive):
227         (WebCore::Editor::WebContentReader::readRTFD):
228         (WebCore::Editor::WebContentReader::readRTF):
229         (WebCore::Editor::WebContentReader::readImage):
230         (WebCore::Editor::WebContentReader::readURL):
231         (WebCore::Editor::webContentFromPasteboard):
232         (WebCore::Editor::pasteWithPasteboard):
233         (WebCore::Editor::createFragmentAndAddResources):
234         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
235         * editing/mac/EditorMac.mm:
236         (WebCore::Editor::selectionInWebArchiveFormat):
237         (WebCore::Editor::adjustedSelectionRange):
238         (WebCore::dataInRTFDFormat):
239         (WebCore::dataInRTFFormat):
240         (WebCore::Editor::dataSelectionForPasteboard):
241         (WebCore::Editor::WebContentReader::readWebArchive):
242         (WebCore::Editor::WebContentReader::readRTFD):
243         (WebCore::Editor::WebContentReader::readRTF):
244         (WebCore::Editor::WebContentReader::readImage):
245         (WebCore::Editor::WebContentReader::readURL):
246         (WebCore::Editor::webContentFromPasteboard):
247         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
248         (WebCore::Editor::createFragmentAndAddResources):
249         * editing/win/EditorWin.cpp:
250         (WebCore::createFragmentFromPlatformData):
251         (WebCore::Editor::webContentFromPasteboard):
252         * inspector/InspectorPageAgent.cpp:
253         (WebCore::InspectorPageAgent::archive):
254         * loader/DocumentLoader.cpp:
255         (WebCore::DocumentLoader::mainResourceData):
256         (WebCore::DocumentLoader::maybeCreateArchive):
257         (WebCore::DocumentLoader::addArchiveResource):
258         (WebCore::DocumentLoader::mainResource):
259         * loader/DocumentLoader.h:
260         * loader/FrameLoader.cpp:
261         (WebCore::FrameLoader::loadArchive):
262         * loader/SubstituteData.h:
263         (WebCore::SubstituteData::SubstituteData):
264         (WebCore::SubstituteData::isValid):
265         * loader/SubstituteResource.h:
266         (WebCore::SubstituteResource::data):
267         (WebCore::SubstituteResource::SubstituteResource):
268         * loader/appcache/ApplicationCacheGroup.cpp:
269         (WebCore::ApplicationCacheGroup::didReceiveResponse):
270         (WebCore::ApplicationCacheGroup::didReceiveData):
271         (WebCore::ApplicationCacheGroup::didFail):
272         (WebCore::ApplicationCacheGroup::didReceiveManifestData):
273         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
274         * loader/appcache/ApplicationCacheHost.cpp:
275         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
276         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
277         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
278         * loader/appcache/ApplicationCacheResource.cpp:
279         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
280         (WebCore::ApplicationCacheResource::deliver):
281         (WebCore::ApplicationCacheResource::estimatedSizeInStorage):
282         * loader/appcache/ApplicationCacheResource.h:
283         (WebCore::ApplicationCacheResource::create):
284         * loader/appcache/ApplicationCacheStorage.cpp:
285         (WebCore::ApplicationCacheStorage::store):
286         (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
287         * loader/appcache/ApplicationCacheStorage.h:
288         * loader/archive/ArchiveFactory.cpp:
289         (WebCore::archiveFactoryCreate):
290         (WebCore::ArchiveFactory::create):
291         * loader/archive/ArchiveFactory.h:
292         * loader/archive/ArchiveResource.cpp:
293         (WebCore::ArchiveResource::ArchiveResource):
294         (WebCore::ArchiveResource::create):
295         * loader/archive/ArchiveResource.h:
296         * loader/archive/ArchiveResourceCollection.cpp:
297         (WebCore::ArchiveResourceCollection::addResource):
298         * loader/archive/ArchiveResourceCollection.h:
299         * loader/archive/cf/LegacyWebArchive.cpp:
300         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
301         (WebCore::LegacyWebArchive::createResource):
302         (WebCore::LegacyWebArchive::create):
303         (WebCore::LegacyWebArchive::createFromSelection):
304         * loader/archive/cf/LegacyWebArchive.h:
305         * loader/archive/mhtml/MHTMLArchive.cpp:
306         (WebCore::MHTMLArchive::create):
307         * loader/archive/mhtml/MHTMLArchive.h:
308         * loader/archive/mhtml/MHTMLParser.cpp:
309         (WebCore::MHTMLParser::parseArchive):
310         (WebCore::MHTMLParser::parseArchiveWithHeader):
311         (WebCore::MHTMLParser::parseNextPart):
312         * loader/archive/mhtml/MHTMLParser.h:
313         * loader/cache/CachedImage.cpp:
314         (WebCore::CachedImage::didAddClient):
315         * loader/icon/IconDatabase.cpp:
316         (WebCore::loadDefaultIconRecord):
317         * loader/icon/IconRecord.cpp:
318         (WebCore::IconRecord::setImageData):
319         * loader/icon/IconRecord.h:
320         * platform/Pasteboard.h:
321         * platform/PasteboardStrategy.h:
322         * platform/PlatformPasteboard.h:
323         * platform/SharedBuffer.cpp:
324         (WebCore::SharedBuffer::createArrayBuffer):
325         (WebCore::utf8Buffer):
326         * platform/SharedBuffer.h:
327         (WebCore::SharedBuffer::create):
328         * platform/cf/SharedBufferCF.cpp:
329         (WebCore::SharedBuffer::wrapCFData):
330         * platform/cocoa/NetworkExtensionContentFilter.mm:
331         (WebCore::NetworkExtensionContentFilter::replacementData):
332         * platform/cocoa/ParentalControlsContentFilter.mm:
333         (WebCore::ParentalControlsContentFilter::replacementData):
334         * platform/graphics/Image.cpp:
335         (WebCore::Image::setData):
336         * platform/graphics/Image.h:
337         * platform/gtk/DataObjectGtk.cpp:
338         (WebCore::DataObjectGtk::forClipboard):
339         * platform/gtk/DataObjectGtk.h:
340         (WebCore::DataObjectGtk::create):
341         * platform/gtk/PasteboardGtk.cpp:
342         (WebCore::Pasteboard::Pasteboard):
343         (WebCore::Pasteboard::dataObject):
344         * platform/ios/PasteboardIOS.mm:
345         (WebCore::Pasteboard::read):
346         * platform/ios/PlatformPasteboardIOS.mm:
347         (WebCore::PlatformPasteboard::bufferForType):
348         (WebCore::PlatformPasteboard::readBuffer):
349         * platform/mac/PasteboardMac.mm:
350         (WebCore::writeFileWrapperAsRTFDAttachment):
351         (WebCore::Pasteboard::read):
352         * platform/mac/PlatformPasteboardMac.mm:
353         (WebCore::PlatformPasteboard::bufferForType):
354         * platform/mac/SharedBufferMac.mm:
355         (WebCore::SharedBuffer::wrapNSData):
356         (WebCore::SharedBuffer::createFromReadingFile):
357         * platform/network/MIMEHeader.cpp:
358         (WebCore::retrieveKeyValuePairs):
359         (WebCore::MIMEHeader::parseHeader):
360         * platform/network/MIMEHeader.h:
361         * platform/soup/SharedBufferSoup.cpp:
362         (WebCore::SharedBuffer::wrapSoupBuffer):
363         * platform/win/ClipboardUtilitiesWin.cpp:
364         (WebCore::fragmentFromFilenames):
365         (WebCore::fragmentFromCFHTML):
366         (WebCore::fragmentFromHTML):
367         * platform/win/ClipboardUtilitiesWin.h:
368         * platform/win/PasteboardWin.cpp:
369         (WebCore::Pasteboard::documentFragment):
370
371 2016-03-14  Oliver Hunt  <oliver@apple.com>
372
373         Temporarily disable the separated heap.
374         https://bugs.webkit.org/show_bug.cgi?id=155472
375
376         Reviewed by Geoffrey Garen.
377
378         Temporarily disable this.
379
380         * Configurations/FeatureDefines.xcconfig:
381
382 2016-03-10  Antonio Gomes  <tonikitoo@webkit.org>
383
384         Selecting with shift+drag results in unexpected drag-n-drop
385         https://bugs.webkit.org/show_bug.cgi?id=155314
386
387         Reviewed by Darin Adler.
388
389         Test: editing/selection/shift-drag-selection-no-drag-n-drop.html
390
391         Whenever user tries to extend an existing text selection by dragging the mouse
392         (left button hold) with shift key pressed, WebKit enters drag-n-drop mode.
393         This behavior does not match common editing behavior out there, including other
394         browsers' (Firefox, Opera/Presto and IE).
395
396         Patch changes WebKit so that whenever one extends a selection with mouse
397         and shift key pressed off of a #text node, it does not enter drag-n-drop mode.
398
399         Additionally, patch also adds some further tests to ensure that when
400         selection is extended off of either a link or an image, drag-n-drop does
401         get triggered, no matter if shift key is pressed.
402
403         * page/EventHandler.cpp:
404         (WebCore::EventHandler::handleMousePressEvent):
405
406 2016-03-14  Brent Fulgham  <bfulgham@apple.com>
407
408         REGRESSION (r197114): Crash in WebCore::MediaDevicesRequest::didCompletePermissionCheck
409         https://bugs.webkit.org/show_bug.cgi?id=155453
410         <rdar://problem/24879447>
411
412         Reviewed by Daniel Bates.
413
414         Tested by fast/mediastream/enumerating-crash.html.
415
416         * Modules/mediastream/MediaDevicesRequest.cpp:
417         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Prevent UserMediaPermissionCheck object from being
418         destroyed before the method completes.
419
420 2016-03-14  Simon Fraser  <simon.fraser@apple.com>
421
422         Fix crash when reloading a page using requestAnimationFrame on iOS
423         https://bugs.webkit.org/show_bug.cgi?id=155465
424         rdar://problem/25100202
425
426         Reviewed by Tim Horton.
427
428         On iOS, it's possible for all clients for a DisplayRefreshMonitor
429         to be unregistered, but still get a subsequent displayDidRefresh() for that monitor.
430         In this case, we would remove(notFound) which release-asserts.
431         
432         Fix by just checking for notFound.
433         
434         Unable to test because requestAnimationFrame doesn't work in the simulator.
435
436         * platform/graphics/DisplayRefreshMonitorManager.cpp:
437         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
438
439 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
440
441         [WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
442         https://bugs.webkit.org/show_bug.cgi?id=155357
443
444         Reviewed by Brent Fulgham.
445
446         It is better to implement the float versions of some of the MediaPlayer methods,
447         since the default implementation of the double versions is to call the float version.
448         Also added override keyword to overridden methods.
449
450         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
451         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
452         (WebCore::MediaPlayerPrivateMediaFoundation::seek):
453         (WebCore::MediaPlayerPrivateMediaFoundation::setRate):
454         (WebCore::MediaPlayerPrivateMediaFoundation::duration):
455         (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
456         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble): Deleted.
457         (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble): Deleted.
458         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): Deleted.
459         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
460
461 2016-03-14  Tim Horton  <timothy_horton@apple.com>
462
463         Revert r194125 and r194186: We're going to fix this a different way.
464
465         * page/EventHandler.cpp:
466         (WebCore::EventHandler::clear):
467         * page/EventHandler.h:
468
469 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
470
471         [Fetch API] FetchLoader should check for empty bodies
472         https://bugs.webkit.org/show_bug.cgi?id=155440
473
474         Reviewed by Darin Adler.
475
476         Covered by added tests.
477
478         * Modules/fetch/FetchLoader.cpp:
479         (WebCore::FetchLoader::didFinishLoading): returning empty array buffer/empty string if no data received during loading.
480
481 2016-03-14  Chris Dumez  <cdumez@apple.com>
482
483         Regression(r197981): Huge regression on Mac PLT
484         https://bugs.webkit.org/show_bug.cgi?id=155443
485         <rdar://problem/25113391>
486
487         Reviewed by Gavin Barraclough.
488
489         We have experience a huge regression on Mac PLT after r197981, so
490         disable the feature until the performance issue is resolved.
491
492         * platform/graphics/ca/GraphicsLayerCA.cpp:
493         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
494
495 2016-03-14  Chris Vienneau  <chris.vno@outlook.com>
496
497         PingHandle delete's itself but pointer is still used by handleDataURL
498         https://bugs.webkit.org/show_bug.cgi?id=154752
499         <rdar://problem/24872347>
500
501         Reviewed by Alex Christensen.
502
503         When a PingHandle is destroyed, we should tell its client so that the client can clear the pointer it
504         holds to the element to avoid accidentally attempting to use deallocated memory.
505
506         The ResourceHandle's client member may be null after "didReceiveResponse" is called. We should confirm
507         the client is still valid after these calls.
508
509         * platform/network/DataURL.cpp:
510         (WebCore::handleDataURL): Check the client pointer before using it.
511         * platform/network/PingHandle.h:
512         (WebCore::PingHandle::~PingHandle): Notify the client we are being destroyed.
513         * platform/platform/network/ResourceHandle.h:
514
515 2016-03-14  Zalan Bujtas  <zalan@apple.com>
516
517         Negative outline offset could break curved outline-style: auto
518         https://bugs.webkit.org/show_bug.cgi?id=155416
519
520         Reviewed by Tim Horton.
521
522         When radius becomes negative the rounded rect could end up being un-renderable -> no rounded corners at all.
523
524         Test: fast/inline/hidpi-outline-auto-negative-offset-with-border-radius.html
525
526         * platform/graphics/PathUtilities.cpp:
527         (WebCore::adjustedtRadiiForHuggingCurve):
528
529 2016-03-14  Zalan Bujtas  <zalan@apple.com>
530
531         [Outline: auto] Fractional radius value could result in non-renderable rounded border.
532         https://bugs.webkit.org/show_bug.cgi?id=155420
533
534         Reviewed by Tim Horton.
535
536         RoundedRect::pixelSnappedRoundedRectForPainting ensures that the rounded rect is always renderable.
537
538         Test: fast/inline/hidpi-outline-auto-with-fractional-radius.html
539
540         * platform/graphics/PathUtilities.cpp:
541         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
542         * platform/graphics/PathUtilities.h:
543         * rendering/RenderElement.cpp:
544         (WebCore::RenderElement::paintFocusRing):
545
546 2016-03-14  Zalan Bujtas  <zalan@apple.com>
547
548         Outline: auto has sharp corners with single line contenteditable.
549         https://bugs.webkit.org/show_bug.cgi?id=155418
550
551         Reviewed by Tim Horton.
552
553         Multiple rectangles assumed multiline content and it broke bottomLeft and bottomRight corner check.
554         This patch adds fast path for polygons with 4 corners.
555
556         Test: fast/inline/hidpi-outline-auto-with-one-focusring-rect.html
557
558         * platform/graphics/PathUtilities.cpp:
559         (WebCore::cornerType):
560         (WebCore::cornerTypeForMultiline):
561         (WebCore::rectFromPolygon):
562         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
563
564 2016-03-14  Joanmarie Diggs  <jdiggs@igalia.com>
565
566         [AX] SVG element with child desc not exposed
567         https://bugs.webkit.org/show_bug.cgi?id=155374
568
569         Reviewed by Darin Adler.
570
571         Covered by the accessibility/w3c-svg-roles.html test, which was updated.
572
573         AccessibilitySVGRoot is now a subclass of AccessibilitySVGElement, which
574         exposes SVG elements with a child desc element as per the specification.
575         Also made existing protected methods private.
576
577         * accessibility/AccessibilitySVGElement.h:
578         * accessibility/AccessibilitySVGRoot.cpp:
579         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
580         (WebCore::AccessibilitySVGRoot::parentObject):
581         * accessibility/AccessibilitySVGRoot.h:
582
583 2016-03-14  Alexey Proskuryakov  <ap@apple.com>
584
585         Build fix.
586
587         * Modules/fetch/FetchBodyOwner.cpp:
588         (WebCore::FetchBodyOwner::loadedBlobAsText):
589
590 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
591
592         [Fetch API] Implement data resolution for blob stored in Body
593         https://bugs.webkit.org/show_bug.cgi?id=155359
594
595         Reviewed by Darin Adler.
596
597         Introducing FetchLoader as a wrapper around ThreadableLoader to load resources.
598         FetchLoader can retrieve data as text or array buffer. It only supports blob currently.
599
600         Introducing FetchLoaderClient interface and FetchBodyOwner::BlobLoader as specifc blob loader client.
601
602         Covered by existing rebased tests.
603
604         * CMakeLists.txt:
605         * Modules/fetch/FetchBody.cpp:
606         (WebCore::FetchBody::loadingType):
607         (WebCore::FetchBody::loadedAsArrayBuffer):
608         (WebCore::FetchBody::loadedAsText):
609         * Modules/fetch/FetchBody.h:
610         * Modules/fetch/FetchBodyOwner.cpp: Added.
611         (WebCore::FetchBodyOwner::FetchBodyOwner):
612         (WebCore::FetchBodyOwner::loadBlob):
613         (WebCore::FetchBodyOwner::finishBlobLoading):
614         (WebCore::FetchBodyOwner::blobLoadingFailed):
615         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
616         * Modules/fetch/FetchBodyOwner.h:
617         (WebCore::FetchBodyOwner::loadedBlobAsText):
618         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer):
619         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
620         * Modules/fetch/FetchLoader.cpp: Added.
621         (WebCore::FetchLoader::start):
622         (WebCore::FetchLoader::FetchLoader):
623         (WebCore::FetchLoader::stop):
624         (WebCore::FetchLoader::didReceiveResponse):
625         (WebCore::FetchLoader::didReceiveData):
626         (WebCore::FetchLoader::didFinishLoading):
627         (WebCore::FetchLoader::didFail):
628         * Modules/fetch/FetchLoader.h: Added.
629         * Modules/fetch/FetchLoaderClient.h: Added.
630         (WebCore::FetchLoaderClient::~FetchLoaderClient):
631         (WebCore::FetchLoaderClient::didReceiveResponse):
632         (WebCore::FetchLoaderClient::didFinishLoadingAsText):
633         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer):
634         * WebCore.xcodeproj/project.pbxproj:
635
636 2016-03-14  Frederic Wang  <fwang@igalia.com>
637
638         Make MathML colspan/rowspan consistent with HTML table cells.
639         https://bugs.webkit.org/show_bug.cgi?id=150253
640
641         Reviewed by Martin Robinson.
642
643         Test: mathml/rowspan-crash.xhtml
644
645         We make MathMLElement::colSpan and MathMLElement::rowSpan consistent with the corresponding functions in HTMLTableCellElement.cpp.
646         These functions now return unsigned integers, use the same parsing functions and set a maximum for rowspan.
647         This latter change fixes crash/timeout with large values of rowspan.
648
649         * mathml/MathMLElement.cpp: Include HTMLParserIdioms to use limitToOnlyHTMLNonNegative.
650         (WebCore::MathMLElement::colSpan): Use unsigned integer and limitToOnlyHTMLNonNegative.
651         (WebCore::MathMLElement::rowSpan): ditto. We also use the same maximum limit as HTMLTableCellElement.
652         * mathml/MathMLElement.h: Make colSpan and rowSpan return unsigned integers.
653
654 2016-03-14  Tomas Popela  <tpopela@redhat.com>
655
656         Enable GSS-Negotiate support in libsoup
657         https://bugs.webkit.org/show_bug.cgi?id=155354
658
659         Reviewed by Carlos Garcia Campos.
660
661         Enable the SOUP_TYPE_AUTH_NEGOTIATE feature if libsoup was compiled
662         with the GSS-Negotiate support.
663
664         * platform/network/soup/SoupNetworkSession.cpp:
665         (WebCore::SoupNetworkSession::SoupNetworkSession):
666
667 2016-03-14  Ryosuke Niwa  <rniwa@webkit.org>
668
669         Add slotchange event
670         https://bugs.webkit.org/show_bug.cgi?id=155424
671         <rdar://problem/24997534>
672
673         Reviewed by Antti Koivisto.
674
675         Added `slotchange` event as discussed on https://github.com/w3c/webcomponents/issues/288.
676
677         While the exact semantics of it could still evolve over time, this patch implements as
678         an asynchronous event that fires on a slot element whenever its distributed nodes change
679         (flattened assigned nodes):
680         http://w3c.github.io/webcomponents/spec/shadow/#dfn-distributed-nodes
681
682         Since inserting or removing an element from a shadow host could needs to enqueue this event
683         on the right slot element, this patch moves the invalidation point of element removals and
684         insertions from Element::childrenChanged to Element::insertedInto and Element::removedFrom.
685         Text nodes are still invalidated at Element::childrenChanged for performance reasons
686         since it could only appear within a default slot element.
687
688         Because this more fine-grained invalidation needs to be overridden by HTMLDetailsElement,
689         we now subclass SlotAssignment in HTMLDetailsElement instead of passing in a std::function.
690
691         Test: fast/shadow-dom/slotchange-event.html
692
693         * dom/Document.cpp:
694         (WebCore::Document::enqueueSlotchangeEvent): Added.
695         * dom/Document.h:
696         * dom/Element.cpp:
697         (WebCore::Element::attributeChanged): Call hostChildElementDidChangeSlotAttr.
698         (WebCore::Element::insertedInto): Call hostChildElementDidChange.
699         (WebCore::Element::removedFrom): Ditto.
700         (WebCore::Element::childrenChanged): Don't invalidate the slots on ElementInserted and
701         ElementRemoved since they're now done in Element::insertedInto and Element::removedFrom.
702         * dom/Event.cpp:
703         (WebCore::Event::scoped): slotchange event is scoped.
704         * dom/EventNames.h: Added eventNames().slotchange.
705         * dom/ShadowRoot.cpp:
706         (WebCore::ShadowRoot::invalidateSlotAssignments): Deleted.
707         (WebCore::ShadowRoot::invalidateDefaultSlotAssignments): Deleted.
708         * dom/ShadowRoot.h:
709         (ShadowRoot): Added more fine-grained invalidators, mirroring changes to SlotAssignment.
710         * dom/SlotAssignment.cpp:
711         (WebCore::SlotAssignment::SlotAssignment): Removed a variant that takes SlotNameFunction
712         since HTMLDetailsElement now subclasses SlotAssignment.
713         (WebCore::SlotAssignment::~SlotAssignment): Added now that the class is virtual.
714         (WebCore::recursivelyFireSlotChangeEvent): Added.
715         (WebCore::SlotAssignment::didChangeSlot): Added. Invalidates the style tree only if there
716         is a corresponding slot element, and fires slotchange event. When the slot element we found
717         in this shadow tree is assigned to a slot element inside an inner shadow tree, recursively
718         fire slotchange event on each such inner slots.
719         (WebCore::SlotAssignment::hostChildElementDidChange): Added. Update the matching slot when
720         an element is inserted or removed under a shadow host.
721         (WebCore::SlotAssignment::assignedNodesForSlot): Removed the superfluous early exit to an
722         release assert since addSlotElementByName should always create a SlotInfo for each element.
723         (WebCore::SlotAssignment::slotNameForHostChild): Added. This is the equivalent of old
724         m_slotNameFunction which DetailsSlotAssignment overrides.
725         (WebCore::SlotAssignment::invalidateDefaultSlot): Deleted.
726         (WebCore::SlotAssignment::findFirstSlotElement): Added an assertion. slotInfo.element must
727         be nullptr if elementCount is 0, and elementCount must be 0 if slotInfo.element is nullptr
728         after calling resolveAllSlotElements, which traverses the entire shadow tree to find all
729         slot elements.
730         (WebCore::SlotAssignment::assignSlots):
731         * dom/SlotAssignment.h: Implemented inline functions of ShadowRoot here to avoid including
732         SlotAssignment.h in ShadowRoot.h. Not inlining them results in extra function calls for all
733         builtin elements with shadow root without slot elements, which impacts performance.
734         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost): Added.
735         (WebCore::ShadowRoot::didChangeDefaultSlot): Added.
736         (WebCore::ShadowRoot::hostChildElementDidChange): Added.
737         (WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute): Added.
738         (WebCore::ShadowRoot::innerSlotDidChange):
739         * html/HTMLDetailsElement.cpp:
740         (WebCore::DetailsSlotAssignment): Added. Subclasses SlotAssignment to override
741         hostChildElementDidChange and slotNameForHostChild.
742         (WebCore::DetailsSlotAssignment::hostChildElementDidChange): Added. We don't check if this
743         is the first summary element since we don't know the answer when this function is called
744         inside Element::removedFrom.
745         (WebCore::DetailsSlotAssignment::slotNameForHostChild): Renamed from slotNameFunction. Also
746         removed the code to return nullAtom when details element is not open as that messes up new
747         fine-grained invalidation. Insert/remove the slot element in parseAttribute instead.
748         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Don't insert the slot element for
749         the summary since the details element is not open now.
750         (WebCore::HTMLDetailsElement::parseAttribute): Remove and insert the slot element for the
751         summary here instead of changing the behavior of slotNameForHostChild.
752         * html/HTMLDetailsElement.h:
753         * html/HTMLSlotElement.cpp:
754         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Added. Enqueues a new slotchange event
755         if we haven't done so for this element yet.
756         (WebCore::HTMLSlotElement::dispatchEvent): Added. Clear m_hasEnqueuedSlotChangeEvent when
757         dispatching a slotchange event so that a subsequent call to enqueueSlotChangeEvent would
758         enqueue a new event. Note scripts call EventTarget::dispatchEventForBindings instead.
759         * html/HTMLSlotElement.h:
760
761 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
762
763         Introduce CallWith=Document in binding generator
764         https://bugs.webkit.org/show_bug.cgi?id=155358
765
766         Reviewed by Darin Adler.
767
768         Covered by existing tests and binding test.
769
770         * Modules/notifications/Notification.cpp:
771         (WebCore::Notification::permission): Taking a Document& instead of ScriptExecutionContext&.
772         (WebCore::Notification::requestPermission): Ditto.
773         * Modules/notifications/Notification.h:
774         * Modules/notifications/Notification.idl: Using CallWith=Document.
775         * bindings/scripts/CodeGeneratorJS.pm: Adding support for CallWith=Document and changed name from scriptContext to context.
776         (GenerateCallWith):
777         (GenerateConstructorDefinition):
778         * bindings/scripts/IDLAttributes.txt: Adding support for CallWith=Document.
779         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
780         (webkit_dom_test_obj_with_document_argument):
781         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
782         * bindings/scripts/test/JS/JSTestInterface.cpp:
783         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
784         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
785         * bindings/scripts/test/JS/JSTestObj.cpp:
786         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
787         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
788         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
789         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
790         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
791         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
792         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
793         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
794         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
795         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
796         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
797         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
798         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
799         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
800         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
801         * bindings/scripts/test/ObjC/DOMTestObj.h:
802         * bindings/scripts/test/ObjC/DOMTestObj.mm:
803         (-[DOMTestObj withDocumentArgument]):
804         * bindings/scripts/test/TestObj.idl: Adding binding test.
805         * page/DOMWindow.cpp:
806         (WebCore::DOMWindow::focus): Taking a Document& instead of ScriptExecutionContext&.
807         (WebCore::DOMWindow::close): Ditto.
808         * page/DOMWindow.h:
809         * page/DOMWindow.idl:
810         * page/History.cpp:
811         (WebCore::History::back): Ditto.
812         (WebCore::History::forward): Ditto.
813         (WebCore::History::go): Ditto.
814         * page/History.h:
815         * page/History.idl:
816         * testing/Internals.cpp:
817         (WebCore::InspectorStubFrontend::closeWindow): Calling DOMWindow::close() directly.
818
819 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
820
821         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
822         https://bugs.webkit.org/show_bug.cgi?id=155417
823
824         Reviewed by Yusuke Suzuki.
825
826         * Configurations/FeatureDefines.xcconfig:
827
828 2016-03-13  Sam Weinig  <sam@webkit.org>
829
830         Implement unprivileged execCommand("copy") and execCommand("cut")
831         <rdar://problem/24354406>
832         https://bugs.webkit.org/show_bug.cgi?id=146336
833
834         Reviewed by Dean Jackson.
835
836         Test: editing/execCommand/clipboard-access-with-user-gesture.html
837
838         * WebCore.xcodeproj/project.pbxproj:
839         Add new files.
840
841         * editing/ClipboardAccessPolicy.h:
842         Added.
843
844         * editing/EditorCommand.cpp:
845         (WebCore::defaultValueForSupportedCopyCut):
846         (WebCore::supportedCopyCut):
847         Match other browsers and allow the copy and cut commands
848         to be executed when there is a user gesture.
849
850         * page/Settings.h:
851         Add include of ClipboardAccessPolicy.h.
852
853         * page/Settings.in:
854         Add new setting for ClipboardAccessPolicy
855
856 2016-03-13  Ryosuke Niwa  <rniwa@webkit.org>
857
858         REGRESSION (r190840): crash inside details element's slotNameFunction
859         https://bugs.webkit.org/show_bug.cgi?id=155388
860
861         Reviewed by Antti Koivisto.
862
863         The bug was caused by HTMLDetailsElement::isActiveSummary calling findAssignedSlot with a summary element
864         inside the shadow tree of the detials element. Fixed it by existing early when the summary element passed
865         to isActiveSummary is not a direct child of the details element.
866
867         Test: fast/html/details-summary-tabindex-crash.html
868
869         * dom/ShadowRoot.cpp:
870         (WebCore::ShadowRoot::findAssignedSlot): Added an assertion for regression testing.
871         * dom/SlotAssignment.cpp:
872         (WebCore::SlotAssignment::findAssignedSlot): Removed the superfluous call to assignSlots added in r190840.
873         There is no need to update the slot assignments here (entires in m_slots are added or removed by
874         addSlotElementByName or removeSlotElementByName and assignSlots only updates assignedNodes in each SlotInfo
875         which is never used in this function or findFirstSlotElement.
876         * html/HTMLDetailsElement.cpp:
877         (WebCore::HTMLDetailsElement::isActiveSummary): Fixed the bug.
878
879 2016-03-13  Antti Koivisto  <antti@apple.com>
880
881         ComposedTreeIterator fails to traverse slots if root is shadow host
882         https://bugs.webkit.org/show_bug.cgi?id=155407
883
884         Reviewed by Darin Adler.
885
886         Test: fast/shadow-dom/composed-tree-shadow-subtree.html
887
888         * dom/ComposedTreeIterator.cpp:
889         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
890
891             Traversal functions assume m_contextStack is deeper than 1 before they need to enter slot traversal code paths.
892             Call initializeContextStack in case of shadow host which does the right thing.
893
894         (WebCore::ComposedTreeIterator::traverseSiblingInSlot):
895         (WebCore::composedTreeAsText):
896
897             Add option to include pointers as debugging aid.
898
899         * dom/ComposedTreeIterator.h:
900         (WebCore::composedTreeChildren):
901
902 2016-03-12  Sam Weinig  <sam@webkit.org>
903
904         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
905         <rdar://problem/25129946>
906         https://bugs.webkit.org/show_bug.cgi?id=155401
907
908         Reviewed by Alex Christensen.
909
910         Add a SessionID as a member of NetworkStorageSession. This allows us to avoid having HashMaps
911         to map between the two types.
912
913         * platform/network/NetworkStorageSession.h:
914         (WebCore::NetworkStorageSession::sessionID):
915         (WebCore::NetworkStorageSession::credentialStorage):
916         (WebCore::NetworkStorageSession::platformSession):
917         * platform/network/NetworkStorageSessionStub.cpp:
918         (WebCore::NetworkStorageSession::NetworkStorageSession):
919         (WebCore::NetworkStorageSession::context):
920         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
921         (WebCore::defaultSession):
922         (WebCore::NetworkStorageSession::defaultStorageSession):
923         (WebCore::NetworkStorageSession::switchToNewTestingSession):
924         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
925         (WebCore::NetworkStorageSession::NetworkStorageSession):
926         (WebCore::NetworkStorageSession::switchToNewTestingSession):
927         (WebCore::NetworkStorageSession::defaultStorageSession):
928         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
929         * platform/network/soup/NetworkStorageSessionSoup.cpp:
930         (WebCore::NetworkStorageSession::NetworkStorageSession):
931         (WebCore::NetworkStorageSession::defaultStorageSession):
932         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
933         (WebCore::NetworkStorageSession::switchToNewTestingSession):
934         (WebCore::NetworkStorageSession::soupNetworkSession):
935
936 2016-03-13  Jon Lee  <jonlee@apple.com>
937
938         getUserMedia requests from the main frame should be treated the same as requests from an iframe with the same origin
939         https://bugs.webkit.org/show_bug.cgi?id=155405
940         <rdar://problem/25131007>
941
942         Reviewed by Eric Carlson.
943
944         When gUM is called from the main frame, or from a subframe with the same origin, the
945         top level document origin should be the same.
946
947         * Modules/mediastream/UserMediaRequest.cpp:
948         (WebCore::UserMediaRequest::userMediaDocumentOrigin): Reverse the logic so that it is similar
949         to topLevelDocumentOrigin.
950         (WebCore::UserMediaRequest::topLevelDocumentOrigin): Return the top origin always.
951
952 2016-03-13  David Kilzer  <ddkilzer@apple.com>
953
954         REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
955
956         * platform/network/ParsedContentRange.cpp: Add #include
957         <wtf/StdLibExtras.h> and remove local definition of "PRId64".
958
959 2016-03-13  Joonghun Park  <jh718.park@samsung.com>
960
961         [EFL] Fix debug build error since r197690. Unreviewed.
962         https://bugs.webkit.org/show_bug.cgi?id=155408
963
964         Unreviewed. Change %lld to %PRId instead to correct the error below.
965         error: format ‘%lld’ expects argument of type ‘long long int’,
966         but argument 5 has type ‘std::chrono::duration<long int, std::ratio<1l, 1000l> >::rep
967         {aka long int}’ [-Werror=format=]
968
969         * page/DOMTimer.cpp:
970         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
971
972 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
973
974         [Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
975         https://bugs.webkit.org/show_bug.cgi?id=155379
976
977         Reviewed by Beth Dakin.
978
979         There's no reason to not call them what they are.
980
981         No new tests because there is no behavior change.
982
983         * page/scrolling/AsyncScrollingCoordinator.cpp:
984         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
985         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
986         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
987         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
988         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
989         * page/scrolling/ScrollingStateFrameScrollingNode.h:
990         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
991         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
992         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
993         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
994         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
995         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
996         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
997         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
998         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
999         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
1000         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1001         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
1002         * platform/ScrollbarThemeComposite.h:
1003         * platform/mac/ScrollAnimatorMac.h:
1004         * platform/mac/ScrollAnimatorMac.mm:
1005         (scrollbarPainterForScrollbar):
1006         (-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
1007         (-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
1008         (-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
1009         (-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
1010         (-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
1011         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
1012         (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
1013         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
1014         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
1015         (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
1016         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
1017         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
1018         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
1019         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
1020         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
1021         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
1022         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
1023         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
1024         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
1025         (WebCore::ScrollAnimatorMac::cancelAnimations):
1026         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
1027         (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
1028         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
1029         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
1030         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
1031         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
1032         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
1033         * platform/mac/ScrollbarThemeMac.h:
1034         * platform/mac/ScrollbarThemeMac.mm:
1035         (WebCore::scrollbarMap):
1036         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
1037         (WebCore::ScrollbarThemeMac::registerScrollbar):
1038         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
1039         (WebCore::ScrollbarThemeMac::painterForScrollbar):
1040         (WebCore::ScrollbarThemeMac::scrollbarThickness):
1041         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
1042         (WebCore::ScrollbarThemeMac::hasThumb):
1043         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
1044         (WebCore::scrollbarPainterPaint):
1045
1046 2016-03-12  Dean Jackson  <dino@apple.com>
1047
1048         REGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
1049         https://bugs.webkit.org/show_bug.cgi?id=155400
1050         <rdar://problem/24818602>
1051
1052         Reviewed by Anders Carlsson.
1053
1054         When we unprefixed CSS filters we accidentally
1055         stopped SVG elements that use the CSS filter shorthands
1056         from rendering. We still don't actually support
1057         the shorthands in this case, but we should render
1058         the element without the filter.
1059
1060         Tests: css3/filters/filters-on-svg-element.html
1061                css3/filters/filters-on-svg-root.html
1062
1063         * rendering/style/RenderStyle.cpp:
1064         (WebCore::RenderStyle::hasReferenceFilterOnly): Add
1065         this new function that tells us if we have the
1066         style of filter that we can handle in SVG content.
1067         * rendering/style/RenderStyle.h:
1068         * rendering/svg/SVGRenderingContext.cpp:
1069         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
1070         We can mark an element as ready to render if it
1071         has a shorthand filter.
1072
1073 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
1074
1075         Delete dead SVG Font code
1076         https://bugs.webkit.org/show_bug.cgi?id=154718
1077
1078         Reviewed by Antti Koivisto.
1079
1080         All the ports have adopted the SVG -> OTF Font Converter, so there will never
1081         be an instantiation of a font backed by a DOM subtree. We can remove all the
1082         infrastructure used to support that.
1083
1084         No new tests because there is no behavior change.
1085
1086         * CMakeLists.txt:
1087         * Configurations/FeatureDefines.xcconfig:
1088         * WebCore.order:
1089         * WebCore.xcodeproj/project.pbxproj:
1090         * css/CSSFontFaceSource.cpp:
1091         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
1092         (WebCore::CSSFontFaceSource::font): Deleted.
1093         * css/CSSFontFaceSource.h:
1094         * loader/cache/CachedFont.cpp:
1095         * loader/cache/CachedSVGFont.cpp:
1096         (WebCore::CachedSVGFont::createFont): Deleted.
1097         (WebCore::CachedSVGFont::ensureCustomFontData): Deleted.
1098         * loader/cache/CachedSVGFont.h:
1099         * platform/graphics/Font.cpp:
1100         (WebCore::Font::Font):
1101         (WebCore::fillGlyphPage):
1102         (WebCore::Font::description): Deleted.
1103         (WebCore::Font::createScaledFont): Deleted.
1104         (WebCore::Font::applyTransforms): Deleted.
1105         * platform/graphics/Font.h:
1106         (WebCore::Font::widthForGlyph):
1107         (WebCore::Font::SVGData::~SVGData): Deleted.
1108         (WebCore::Font::create): Deleted.
1109         (WebCore::Font::svgData): Deleted.
1110         (WebCore::Font::isSVGFont): Deleted.
1111         * platform/graphics/win/FontWin.cpp:
1112         * platform/graphics/FontCascade.cpp:
1113         (WebCore::FontCascade::drawText):
1114         (WebCore::FontCascade::drawEmphasisMarks):
1115         (WebCore::FontCascade::glyphDataForCharacter):
1116         (WebCore::FontCascade::adjustSelectionRectForText):
1117         (WebCore::FontCascade::offsetForPosition):
1118         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
1119         (WebCore::FontCascade::drawGlyphBuffer):
1120         (WebCore::isDrawnWithSVGFont): Deleted.
1121         (WebCore::FontCascade::width): Deleted.
1122         (WebCore::FontCascade::codePath): Deleted.
1123         * platform/graphics/FontCascade.h:
1124         * platform/graphics/GraphicsContext.h:
1125         * platform/graphics/SVGGlyph.cpp: Removed.
1126         (WebCore::processArabicFormDetection): Deleted.
1127         (WebCore::charactersWithArabicForm): Deleted.
1128         (WebCore::isCompatibleArabicForm): Deleted.
1129         (WebCore::isCompatibleGlyph): Deleted.
1130         * platform/graphics/SVGGlyph.h: Removed.
1131         (WebCore::SVGGlyph::SVGGlyph): Deleted.
1132         (WebCore::SVGGlyph::inheritedValue): Deleted.
1133         (WebCore::SVGGlyph::operator==): Deleted.
1134         * platform/graphics/TextRun.cpp:
1135         * platform/graphics/TextRun.h:
1136         (WebCore::TextRun::RenderingContext::~RenderingContext): Deleted.
1137         (WebCore::TextRun::renderingContext): Deleted.
1138         (WebCore::TextRun::setRenderingContext): Deleted.
1139         * platform/graphics/WidthIterator.cpp:
1140         (WebCore::WidthIterator::applyFontTransforms):
1141         (WebCore::WidthIterator::advanceInternal):
1142         (WebCore::WidthIterator::glyphDataForCharacter): Deleted.
1143         * platform/graphics/WidthIterator.h:
1144         (WebCore::WidthIterator::lastGlyphName): Deleted.
1145         (WebCore::WidthIterator::setLastGlyphName): Deleted.
1146         (WebCore::WidthIterator::arabicForms): Deleted.
1147         * platform/graphics/cairo/FontCairo.cpp:
1148         (WebCore::CairoGlyphToPathTranslator::advance):
1149         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1150         (WebCore::CairoGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
1151         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1152         (WebCore::MacGlyphToPathTranslator::advance):
1153         (WebCore::FontCascade::dashesForIntersectionsWithRect):
1154         (WebCore::FontCascade::primaryFontIsSystemFont):
1155         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
1156         (WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
1157         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
1158         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Deleted.
1159         * platform/graphics/mac/ComplexTextController.cpp:
1160         (WebCore::TextLayout::isNeeded):
1161         (WebCore::TextLayout::TextLayout):
1162         (WebCore::TextLayout::constructTextRun):
1163         * rendering/EllipsisBox.cpp:
1164         (WebCore::EllipsisBox::paint):
1165         (WebCore::EllipsisBox::selectionRect):
1166         (WebCore::EllipsisBox::paintSelection):
1167         * rendering/InlineTextBox.cpp:
1168         (WebCore::InlineTextBox::localSelectionRect):
1169         (WebCore::InlineTextBox::paint):
1170         (WebCore::InlineTextBox::paintSelection):
1171         (WebCore::InlineTextBox::paintCompositionBackground):
1172         (WebCore::InlineTextBox::paintDocumentMarker):
1173         (WebCore::InlineTextBox::paintTextMatchMarker):
1174         (WebCore::InlineTextBox::offsetForPosition):
1175         (WebCore::InlineTextBox::positionForOffset):
1176         (WebCore::InlineTextBox::constructTextRun):
1177         * rendering/InlineTextBox.h:
1178         * rendering/RenderBlock.cpp:
1179         (WebCore::RenderBlock::constructTextRun):
1180         * rendering/RenderBlock.h:
1181         * rendering/RenderBlockFlow.cpp:
1182         (WebCore::stripTrailingSpace):
1183         * rendering/RenderBlockLineLayout.cpp:
1184         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
1185         * rendering/RenderDeprecatedFlexibleBox.cpp:
1186         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1187         * rendering/RenderFileUploadControl.cpp:
1188         (WebCore::RenderFileUploadControl::paintObject):
1189         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
1190         * rendering/RenderImage.cpp:
1191         (WebCore::RenderImage::setImageSizeForAltText):
1192         (WebCore::RenderImage::paintReplaced):
1193         * rendering/RenderListBox.cpp:
1194         (WebCore::RenderListBox::updateFromElement):
1195         * rendering/RenderListMarker.cpp:
1196         (WebCore::RenderListMarker::paint):
1197         (WebCore::RenderListMarker::computePreferredLogicalWidths):
1198         (WebCore::RenderListMarker::getRelativeMarkerRect):
1199         * rendering/RenderMenuList.cpp:
1200         (RenderMenuList::updateOptionsWidth):
1201         * rendering/RenderText.cpp:
1202         (WebCore::RenderText::widthFromCache):
1203         (WebCore::RenderText::trimmedPrefWidths):
1204         (WebCore::hyphenWidth):
1205         (WebCore::maxWordFragmentWidth):
1206         (WebCore::RenderText::computePreferredLogicalWidths):
1207         (WebCore::RenderText::width):
1208         * rendering/RenderTextControl.cpp:
1209         (WebCore::RenderTextControl::getAverageCharWidth):
1210         * rendering/RenderThemeIOS.mm:
1211         (WebCore::RenderThemeMeasureTextClient::RenderThemeMeasureTextClient):
1212         (WebCore::adjustInputElementButtonStyle):
1213         * rendering/SimpleLineLayout.cpp:
1214         (WebCore::SimpleLineLayout::canUseForFontAndText): Deleted.
1215         * rendering/line/BreakingContext.h:
1216         (WebCore::WordTrailingSpace::WordTrailingSpace):
1217         (WebCore::WordTrailingSpace::width):
1218         (WebCore::measureHyphenWidth):
1219         (WebCore::textWidth):
1220         (WebCore::tryHyphenating):
1221         (WebCore::BreakingContext::handleText):
1222         * rendering/svg/RenderSVGAllInOne.cpp:
1223         * rendering/svg/RenderSVGText.cpp:
1224         * rendering/svg/SVGInlineTextBox.cpp:
1225         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
1226         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
1227         (WebCore::SVGInlineTextBox::paintTextWithShadows):
1228         (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
1229         * rendering/svg/SVGInlineTextBox.h:
1230         * rendering/svg/SVGTextLayoutEngine.cpp:
1231         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
1232         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
1233         (WebCore::SVGTextLayoutEngineSpacing::calculateSVGKerning): Deleted.
1234         * rendering/svg/SVGTextLayoutEngineSpacing.h:
1235         * rendering/svg/SVGTextMetrics.cpp:
1236         (WebCore::SVGTextMetrics::SVGTextMetrics):
1237         (WebCore::SVGTextMetrics::constructTextRun): Deleted.
1238         * rendering/svg/SVGTextMetrics.h:
1239         * rendering/svg/SVGTextMetricsBuilder.cpp:
1240         (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
1241         * rendering/svg/SVGTextRunRenderingContext.cpp: Removed.
1242         (WebCore::svgFontAndFontFaceElementForFontData): Deleted.
1243         (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Deleted.
1244         (WebCore::SVGTextRunRenderingContext::applySVGKerning): Deleted.
1245         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator): Deleted.
1246         (WebCore::SVGGlyphToPathTranslator::transform): Deleted.
1247         (WebCore::SVGGlyphToPathTranslator::path): Deleted.
1248         (WebCore::SVGGlyphToPathTranslator::extents): Deleted.
1249         (WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
1250         (WebCore::SVGGlyphToPathTranslator::advance): Deleted.
1251         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator): Deleted.
1252         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Deleted.
1253         (WebCore::missingGlyphForFont): Deleted.
1254         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Deleted.
1255         * rendering/svg/SVGTextRunRenderingContext.h: Removed.
1256         * svg/SVGAllInOne.cpp:
1257         * svg/SVGFontData.cpp: Removed.
1258         (WebCore::SVGFontData::SVGFontData): Deleted.
1259         (WebCore::SVGFontData::initializeFont): Deleted.
1260         (WebCore::SVGFontData::widthForSVGGlyph): Deleted.
1261         (WebCore::SVGFontData::applySVGGlyphSelection): Deleted.
1262         (WebCore::SVGFontData::fillSVGGlyphPage): Deleted.
1263         (WebCore::SVGFontData::fillBMPGlyphs): Deleted.
1264         (WebCore::SVGFontData::fillNonBMPGlyphs): Deleted.
1265         (WebCore::computeNormalizedSpaces): Deleted.
1266         (WebCore::createStringWithMirroredCharacters): Deleted.
1267         * svg/SVGFontData.h: Removed.
1268         (WebCore::SVGFontData::~SVGFontData): Deleted.
1269         (WebCore::SVGFontData::svgFontFaceElement): Deleted.
1270         (WebCore::SVGFontData::horizontalOriginX): Deleted.
1271         (WebCore::SVGFontData::horizontalOriginY): Deleted.
1272         (WebCore::SVGFontData::horizontalAdvanceX): Deleted.
1273         (WebCore::SVGFontData::verticalOriginX): Deleted.
1274         (WebCore::SVGFontData::verticalOriginY): Deleted.
1275         (WebCore::SVGFontData::verticalAdvanceY): Deleted.
1276         * svg/SVGFontElement.cpp:
1277         (WebCore::SVGFontElement::SVGFontElement): Deleted.
1278         (WebCore::SVGFontElement::invalidateGlyphCache): Deleted.
1279         (WebCore::SVGFontElement::firstMissingGlyphElement): Deleted.
1280         (WebCore::SVGFontElement::registerLigaturesInGlyphCache): Deleted.
1281         (WebCore::SVGFontElement::ensureGlyphCache): Deleted.
1282         (WebCore::SVGKerningMap::clear): Deleted.
1283         (WebCore::SVGKerningMap::insert): Deleted.
1284         (WebCore::stringMatchesUnicodeRange): Deleted.
1285         (WebCore::stringMatchesGlyphName): Deleted.
1286         (WebCore::stringMatchesUnicodeName): Deleted.
1287         (WebCore::matches): Deleted.
1288         (WebCore::kerningForPairOfStringsAndGlyphs): Deleted.
1289         (WebCore::SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs): Deleted.
1290         (WebCore::SVGFontElement::verticalKerningForPairOfStringsAndGlyphs): Deleted.
1291         (WebCore::SVGFontElement::collectGlyphsForString): Deleted.
1292         (WebCore::SVGFontElement::collectGlyphsForGlyphName): Deleted.
1293         (WebCore::SVGFontElement::svgGlyphForGlyph): Deleted.
1294         (WebCore::SVGFontElement::missingGlyph): Deleted.
1295         * svg/SVGFontElement.h:
1296         (WebCore::SVGKerning::SVGKerning): Deleted.
1297         (WebCore::SVGKerningMap::isEmpty): Deleted.
1298         * svg/SVGGlyphElement.cpp:
1299         (WebCore::SVGGlyphElement::invalidateGlyphCache): Deleted.
1300         (WebCore::SVGGlyphElement::parseAttribute): Deleted.
1301         (WebCore::SVGGlyphElement::insertedInto): Deleted.
1302         (WebCore::SVGGlyphElement::removedFrom): Deleted.
1303         (WebCore::parseArabicForm): Deleted.
1304         (WebCore::parseOrientation): Deleted.
1305         (WebCore::SVGGlyphElement::inheritUnspecifiedAttributes): Deleted.
1306         (WebCore::parseSVGGlyphAttribute): Deleted.
1307         (WebCore::SVGGlyphElement::buildGenericGlyphIdentifier): Deleted.
1308         (WebCore::SVGGlyphElement::buildGlyphIdentifier): Deleted.
1309         * svg/SVGGlyphElement.h:
1310         * svg/SVGGlyphMap.h: Removed.
1311         (WebCore::GlyphMapNode::GlyphMapNode): Deleted.
1312         (WebCore::GlyphMapNode::create): Deleted.
1313         (WebCore::SVGGlyphMap::SVGGlyphMap): Deleted.
1314         (WebCore::SVGGlyphMap::addGlyph): Deleted.
1315         (WebCore::SVGGlyphMap::appendToGlyphTable): Deleted.
1316         (WebCore::SVGGlyphMap::compareGlyphPriority): Deleted.
1317         (WebCore::SVGGlyphMap::collectGlyphsForString): Deleted.
1318         (WebCore::SVGGlyphMap::clear): Deleted.
1319         (WebCore::SVGGlyphMap::svgGlyphForGlyph): Deleted.
1320         (WebCore::SVGGlyphMap::glyphIdentifierForGlyphName): Deleted.
1321         * svg/SVGHKernElement.cpp:
1322         (WebCore::SVGHKernElement::insertedInto): Deleted.
1323         (WebCore::SVGHKernElement::removedFrom): Deleted.
1324         * svg/SVGHKernElement.h:
1325         * svg/SVGToOTFFontConversion.cpp:
1326         * svg/SVGToOTFFontConversion.h:
1327         * svg/SVGVKernElement.cpp:
1328         (WebCore::SVGVKernElement::insertedInto): Deleted.
1329         (WebCore::SVGVKernElement::removedFrom): Deleted.
1330         * svg/SVGVKernElement.h:
1331
1332 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
1333
1334         [OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems
1335         https://bugs.webkit.org/show_bug.cgi?id=155385
1336
1337         Reviewed by Simon Fraser.
1338
1339         There is already some existing setup for RTL scrollbars. This patch hooks up this
1340         existing support to the OS X triggering mechanism introduced in r197956. It also
1341         fixes up the existing support to function even when the direction of the
1342         RTL-scrollbar div is LTR (this means the contents of the div must be pushed
1343         over by the width of the scrollbar).
1344
1345         Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html
1346                fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html
1347                fast/scrolling/rtl-scrollbars-overflow-padding.html
1348                fast/scrolling/rtl-scrollbars-overflow-simple.html
1349                fast/scrolling/rtl-scrollbars-overflow.html
1350
1351         * rendering/RenderBlock.cpp:
1352         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
1353         (WebCore::RenderBlock::logicalLeftOffsetForContent):
1354         (WebCore::RenderBlock::logicalRightOffsetForContent):
1355         * rendering/RenderBlockFlow.cpp:
1356         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
1357         * rendering/RenderBox.cpp:
1358         (WebCore::RenderBox::overflowClipRect):
1359         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1360         * rendering/RenderLayer.cpp:
1361         (WebCore::RenderLayer::computeScrollDimensions):
1362         * rendering/style/RenderStyle.cpp:
1363         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft):
1364         * rendering/style/RenderStyle.h:
1365
1366 2016-03-12  Zalan Bujtas  <zalan@apple.com>
1367
1368         [Forms: focus] focus rings around text fields do not follow contour (border-radius)
1369         https://bugs.webkit.org/show_bug.cgi?id=154099
1370         rdar://problem/9988429
1371
1372         Reviewed by Tim Horton.
1373
1374         This patch enables outline-style: auto to follow the curve of border-radius.
1375         When both border-radius and outline-style: auto are set, the native focusring painting will take the border-radius values
1376         into account. This is only for outline-style: auto, other non-auto outline styles paint as if there
1377         was no border-radius set.
1378         It supports both single and multiline content with joint rectangles.
1379         However in case of disjoint rectangles, we fallback to the non-radius drawing.
1380
1381         Tests: fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr.html
1382                fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl.html
1383                fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr.html
1384                fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl.html
1385
1386         * platform/graphics/GraphicsContext.h:
1387         * platform/graphics/Path.cpp:
1388         (WebCore::Path::addBeziersForRoundedRect):
1389         * platform/graphics/Path.h:
1390         (WebCore::Path::circleControlPoint):
1391         * platform/graphics/PathUtilities.cpp:
1392         (WebCore::polygonsForRect):
1393         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
1394         (WebCore::startAndEndPointsForCorner):
1395         (WebCore::cornerType):
1396         (WebCore::controlPointsForBezierCurve):
1397         (WebCore::adjustedtRadiiForHuggingCurve):
1398         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
1399         * platform/graphics/PathUtilities.h:
1400         * platform/graphics/mac/GraphicsContextMac.mm:
1401         (WebCore::GraphicsContext::drawFocusRing):
1402         * rendering/RenderElement.cpp:
1403         (WebCore::RenderElement::paintFocusRing):
1404
1405 2016-03-11  Ryosuke Niwa  <rniwa@webkit.org>
1406
1407         Add Event.deepPath() and Event.scoped
1408         https://bugs.webkit.org/show_bug.cgi?id=153538
1409         <rdar://problem/24363836>
1410
1411         Reviewed by Darin Adler.
1412
1413         Added the support for deepPath(), scoped, and relatedTargetScoped on Event.prototype for shadow DOM:
1414         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface
1415         and updated the EventPath class to respect scoped and relatedTargetScoped flags as specified at:
1416         http://w3c.github.io/webcomponents/spec/shadow/#get-the-parent
1417
1418         Tests: fast/shadow-dom/Extensions-to-Event-Interface.html
1419                fast/shadow-dom/trusted-event-scoped-flags.html
1420
1421         * bindings/scripts/CodeGeneratorJS.pm:
1422         (GenerateConstructorDefinition): Added the support for Conditional for InitializedByEventConstructor.
1423         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
1424         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
1425         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1426         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
1427         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
1428         * bindings/scripts/test/TestEventConstructor.idl: Added a test case for using InitializedByEventConstructor
1429         with Conditional.
1430         * dom/Event.cpp:
1431         (WebCore::Event::Event): Initialize m_scoped and m_relatedTargetScoped from EventInit dictionary.
1432         (WebCore::Event::scoped): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#scoped-flag
1433         (WebCore::Event::deepPath): Added.
1434         * dom/Event.h:
1435         (WebCore::Event::relatedTargetScoped): Added. Overridden by FocusEvent and MouseEvent to implement
1436         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
1437         (WebCore::Event::setEventPath): Added.
1438         (WebCore::Event::clearEventPath): Added.
1439         * dom/Event.idl: Added scoped, relatedTargetScoped, and deepPath() conditionally enabled for shadow DOM.
1440         * dom/EventContext.h:
1441         (WebCore::EventContext::currentTarget):
1442         * dom/EventDispatcher.cpp:
1443         (WebCore::EventDispatcher::dispatchEvent): Set the event path while the event is being dispatched.
1444         * dom/EventPath.cpp:
1445         (WebCore::shouldEventCrossShadowBoundary): Check event.scoped flag instead of hard-coding a list of events here
1446         which has been moved to Event::scoped. See above.
1447         (WebCore::EventPath::setRelatedTarget): Check m_event.relatedTargetScoped() instead of hard-coding a list of
1448         events here. relatedTargetScoped is overridden by FocusEvent and MouseEvent.
1449         (WebCore::EventPath::hasEventListeners): Fixed the misleading variable name.
1450         (WebCore::isUnclosedNodeOf): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#dfn-unclosed-node
1451         (WebCore::EventPath::computePathDisclosedToTarget): Added. Implements the algorithm to filter event targets:
1452         http://w3c.github.io/webcomponents/spec/shadow/#widl-Event-deepPath-sequence-EventTarget
1453         * dom/EventPath.h:
1454         * dom/FocusEvent.cpp:
1455         (WebCore::FocusEvent::relatedTargetScoped): Returns true when this is a trusted event per:
1456         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
1457         * dom/FocusEvent.h:
1458         * dom/MouseEvent.cpp:
1459         (WebCore::MouseEvent::relatedTargetScoped): Ditto.
1460         * dom/MouseEvent.h:
1461
1462 2016-03-11  John Wilander  <wilander@apple.com>
1463
1464         Move prevalent resource classifier from WebCore to WebKit.
1465         https://bugs.webkit.org/show_bug.cgi?id=155242
1466         <rdar://problem/24913272>
1467
1468         Reviewed by Andy Estes.
1469
1470         No new tests since we have yet to decide how to set up tests for prevalent resources.
1471
1472         * loader/ResourceLoadObserver.cpp:
1473         (WebCore::ResourceLoadObserver::logFrameNavigation):
1474         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1475             - Removed calls to old classifier in WebCore.
1476         * loader/ResourceLoadStatistics.cpp:
1477         (WebCore::encodeHashCountedSet):
1478         (WebCore::ResourceLoadStatistics::checkAndSetAsPrevalentResourceIfNecessary): Deleted.
1479         (WebCore::ResourceLoadStatistics::hasPrevalentResourceCharacteristics): Deleted.
1480         * loader/ResourceLoadStatistics.h:
1481             - Deleted old classification functions.
1482         * loader/ResourceLoadStatisticsStore.cpp:
1483         (WebCore::ResourceLoadStatisticsStore::create):
1484         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
1485         (WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing):
1486             - New function to allow for checks before calls to processStatistics.
1487         (WebCore::ResourceLoadStatisticsStore::processStatistics):
1488             - New function that receives a lamda and executes it on every entry in its statistics map.
1489         * loader/ResourceLoadStatisticsStore.h:
1490
1491 2016-03-11  Jiewen Tan  <jiewen_tan@apple.com>
1492
1493         WebKit should not be redirected to an invalid URL
1494         https://bugs.webkit.org/show_bug.cgi?id=155263
1495         <rdar://problem/22820172>
1496
1497         Reviewed by Brent Fulgham.
1498
1499         Test: http/tests/navigation/redirect-to-invalid-url.html
1500
1501         * loader/SubresourceLoader.cpp:
1502         (WebCore::SubresourceLoader::willSendRequestInternal):
1503
1504 2016-03-10  Maksim Kisilev <mkisilev@yandex-team.ru>
1505
1506         Fix typo in StyleTreeResolver.cpp
1507         https://bugs.webkit.org/show_bug.cgi?id=139946
1508
1509         Reviewed by Andy Estes.
1510
1511         The constructor for CheckForVisibilityChangeOnRecalcStyle was improperly comparing the
1512         result of WKContentChange() (which is not a function) to WKContentVisibilityChange. I
1513         believe the above cast would implicitly resolve to WKContentNoChange in all cases,
1514         whether a visibility change had been observed or not.
1515         
1516         This patch corrects this problem. I would expect that this might affect some content
1517         visibility change behavior, but I'm not sure what the appropriate test case would be
1518         since this was apparently found through code inspection.
1519
1520         * style/StyleTreeResolver.cpp:
1521         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle):
1522
1523 2016-03-11  Chris Dumez  <cdumez@apple.com>
1524
1525         iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
1526         https://bugs.webkit.org/show_bug.cgi?id=155256
1527
1528         Reviewed by Alexey Proskuryakov.
1529
1530         r197628 consolidated the runtime application checking code for iOS and
1531         Mac. However, while the new code works fine for WebKit2, it is unsafe
1532         on WebKit1 / iOS and hits assertion in debug. The reason is that
1533         applicationBundleIdentifier() for getting called from several threads
1534         (WebThread, UIThread).
1535
1536         To address the problem, this patch renames applicationBundleIdentifier()
1537         to applicationBundleIdentifierOverride() and only initializes the
1538         override upon WebProcess and Network process initialization. We therefore
1539         do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
1540         When the override is not set, we fall back to using the main bundle
1541         identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
1542         but without caching it to avoid thread safety issues.
1543
1544         No new tests, already covered by API tests currently crashing.
1545
1546         * platform/RuntimeApplicationChecks.mm:
1547         (WebCore::applicationBundleIdentifierOverride):
1548         - Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
1549           and only initialize upon initialization of the WebProcess or the Network
1550           process.
1551         - In debug, set a flag to indicate that the override was already queried.
1552
1553         (WebCore::applicationBundleIdentifier):
1554         New utility function that is returns the application bundle override if it is
1555         set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.
1556
1557         (WebCore::setApplicationBundleIdentifier):
1558         Add assertions to make sure that:
1559         1. This is always called from the main thread.
1560         2. The application bundle identifier has not been queried *before* getting
1561            overriden as this would indicate a bug in our code and we would have wrongly
1562            returned the main bundle identifier in such case.
1563
1564         (WebCore::MacApplication::isAppleMail):
1565         (WebCore::MacApplication::isIBooks):
1566         (WebCore::MacApplication::isITunes):
1567         (WebCore::MacApplication::isMicrosoftMessenger):
1568         (WebCore::MacApplication::isAdobeInstaller):
1569         (WebCore::MacApplication::isMicrosoftOutlook):
1570         (WebCore::MacApplication::isQuickenEssentials):
1571         (WebCore::MacApplication::isAperture):
1572         (WebCore::MacApplication::isVersions):
1573         (WebCore::MacApplication::isHRBlock):
1574         (WebCore::MacApplication::isHipChat):
1575         (WebCore::IOSApplication::isMobileSafari):
1576         (WebCore::IOSApplication::isDumpRenderTree):
1577         (WebCore::IOSApplication::isMobileStore):
1578         (WebCore::IOSApplication::isFacebook):
1579         (WebCore::IOSApplication::isDaijisenDictionary):
1580         (WebCore::IOSApplication::isNASAHD):
1581         (WebCore::IOSApplication::isTheEconomistOnIphone):
1582         (WebCore::IOSApplication::isWebProcess):
1583         (WebCore::IOSApplication::isIBooks):
1584         Drop assertions making sure the cached flag is correct. We now have
1585         an assertion to detect this earlier in setApplicationBundleIdentifier().
1586
1587 2016-03-10  Jer Noble  <jer.noble@apple.com>
1588
1589         Web Audio becomes distorted after sample rate changes
1590         https://bugs.webkit.org/show_bug.cgi?id=154538
1591         <rdar://problem/24771292>
1592
1593         Reviewed by Darin Adler.
1594
1595         When the underlying audio hardware sample rate changes, the AudioUnit render callback will begin asking
1596         for fewer or more frames. For example, when the sample rate goes from 44.1kHz to 48kHz, it will ask for
1597         118 samples instead of 128. (And vice-versa, 140 samples instead of 128.) But the Web Audio engine can only
1598         really handle requests in multiples of 128 samples. In the case where there are requests for < 128 samples,
1599         actually render 128, but save off the unrequested samples in a separate bus. Then fill that bus during the
1600         next request.
1601
1602         * platform/audio/AudioBus.cpp:
1603         (WebCore::AudioBus::copyFromRange): Added utility method.
1604         * platform/audio/AudioBus.h:
1605         * platform/audio/ios/AudioDestinationIOS.cpp:
1606         (WebCore::AudioDestinationIOS::AudioDestinationIOS): Create a "spare" bus.
1607         (WebCore::assignAudioBuffersToBus): Moved from inside render.
1608         (WebCore::AudioDestinationIOS::render): Save off extra samples to the "spare" bus.
1609         * platform/audio/ios/AudioDestinationIOS.h:
1610
1611 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1612
1613         Unreviewed build fix after r198023.
1614         https://bugs.webkit.org/show_bug.cgi?id=155024
1615
1616         Reviewed by Geoffrey Garen.
1617
1618         Update binding test results.
1619
1620         * bindings/scripts/test/JS/JSTestObj.cpp:
1621         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
1622         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
1623         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
1624         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1625         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1626
1627 2016-03-11  Ryan Haddad  <ryanhaddad@apple.com>
1628
1629         Unreviewed, rolling out r197984.
1630
1631         This change caused an existing LayoutTest to fail
1632
1633         Reverted changeset:
1634
1635         "WebKit should not be redirected to an invalid URL"
1636         https://bugs.webkit.org/show_bug.cgi?id=155263
1637         http://trac.webkit.org/changeset/197984
1638
1639 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1640
1641         [ES6] Implement Reflect.set without receiver support
1642         https://bugs.webkit.org/show_bug.cgi?id=155024
1643
1644         Reviewed by Geoffrey Garen.
1645
1646         CustomSetter returns boolean value that indicates the result of [[Set]].
1647         According to this change, this patch modifies the CodeGeneratorJS and test results.
1648
1649         Currently, DOM elements' [[Set]] return true when the setter is found.
1650         This is good for the first step.
1651
1652         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1653         (WebCore::JSCSSStyleDeclaration::putDelegate):
1654         * bindings/js/JSDOMBinding.cpp:
1655         (WebCore::throwSetterTypeError):
1656         * bindings/js/JSDOMBinding.h:
1657         * bindings/js/JSDOMStringMapCustom.cpp:
1658         (WebCore::JSDOMStringMap::putDelegate):
1659         * bindings/js/JSDOMWindowBase.cpp:
1660         (WebCore::JSDOMWindowBase::updateDocument):
1661         * bindings/js/JSDOMWindowCustom.cpp:
1662         (WebCore::JSDOMWindow::put):
1663         (WebCore::JSDOMWindow::putByIndex):
1664         * bindings/js/JSHTMLAppletElementCustom.cpp:
1665         (WebCore::JSHTMLAppletElement::putDelegate):
1666         * bindings/js/JSHTMLEmbedElementCustom.cpp:
1667         (WebCore::JSHTMLEmbedElement::putDelegate):
1668         * bindings/js/JSHTMLObjectElementCustom.cpp:
1669         (WebCore::JSHTMLObjectElement::putDelegate):
1670         * bindings/js/JSLocationCustom.cpp:
1671         (WebCore::JSLocation::putDelegate):
1672         (WebCore::JSLocationPrototype::putDelegate):
1673         * bindings/js/JSPluginElementFunctions.cpp:
1674         (WebCore::pluginElementCustomPut):
1675         * bindings/js/JSPluginElementFunctions.h:
1676         * bindings/js/JSStorageCustom.cpp:
1677         (WebCore::JSStorage::putDelegate):
1678         * bindings/scripts/CodeGeneratorJS.pm:
1679         (GenerateHeader):
1680         (GenerateImplementation):
1681         (GeneratePrototypeDeclaration):
1682         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1683         (WebCore::setJSTestActiveDOMObjectConstructor):
1684         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1685         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
1686         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1687         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
1688         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1689         (WebCore::setJSTestCustomNamedGetterConstructor):
1690         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1691         (WebCore::setJSTestEventConstructorConstructor):
1692         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1693         (WebCore::setJSTestEventTargetConstructor):
1694         * bindings/scripts/test/JS/JSTestException.cpp:
1695         (WebCore::setJSTestExceptionConstructor):
1696         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1697         (WebCore::setJSTestGenerateIsReachableConstructor):
1698         * bindings/scripts/test/JS/JSTestInterface.cpp:
1699         (WebCore::setJSTestInterfaceConstructor):
1700         (WebCore::JSTestInterface::put):
1701         (WebCore::JSTestInterface::putByIndex):
1702         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
1703         (WebCore::setJSTestInterfaceImplementsStr2):
1704         (WebCore::setJSTestInterfaceImplementsStr3):
1705         (WebCore::setJSTestInterfaceImplementsNode):
1706         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
1707         (WebCore::setJSTestInterfaceSupplementalStr2):
1708         (WebCore::setJSTestInterfaceSupplementalStr3):
1709         (WebCore::setJSTestInterfaceSupplementalNode):
1710         * bindings/scripts/test/JS/JSTestInterface.h:
1711         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1712         (WebCore::setJSTestJSBuiltinConstructorConstructor):
1713         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
1714         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1715         (WebCore::setJSTestMediaQueryListListenerConstructor):
1716         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1717         (WebCore::setJSTestNamedConstructorConstructor):
1718         * bindings/scripts/test/JS/JSTestNode.cpp:
1719         (WebCore::setJSTestNodeConstructor):
1720         (WebCore::setJSTestNodeName):
1721         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1722         (WebCore::setJSTestNondeterministicConstructor):
1723         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
1724         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
1725         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
1726         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
1727         * bindings/scripts/test/JS/JSTestObj.cpp:
1728         (WebCore::setJSTestObjConstructor):
1729         (WebCore::setJSTestObjConstructorStaticStringAttr):
1730         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
1731         (WebCore::setJSTestObjEnumAttr):
1732         (WebCore::setJSTestObjByteAttr):
1733         (WebCore::setJSTestObjOctetAttr):
1734         (WebCore::setJSTestObjShortAttr):
1735         (WebCore::setJSTestObjUnsignedShortAttr):
1736         (WebCore::setJSTestObjLongAttr):
1737         (WebCore::setJSTestObjLongLongAttr):
1738         (WebCore::setJSTestObjUnsignedLongLongAttr):
1739         (WebCore::setJSTestObjStringAttr):
1740         (WebCore::setJSTestObjTestObjAttr):
1741         (WebCore::setJSTestObjLenientTestObjAttr):
1742         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
1743         (WebCore::setJSTestObjXMLObjAttr):
1744         (WebCore::setJSTestObjCreate):
1745         (WebCore::setJSTestObjReflectedStringAttr):
1746         (WebCore::setJSTestObjReflectedIntegralAttr):
1747         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
1748         (WebCore::setJSTestObjReflectedBooleanAttr):
1749         (WebCore::setJSTestObjReflectedURLAttr):
1750         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
1751         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
1752         (WebCore::setJSTestObjReflectedCustomURLAttr):
1753         (WebCore::setJSTestObjTypedArrayAttr):
1754         (WebCore::setJSTestObjAttrWithGetterException):
1755         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
1756         (WebCore::setJSTestObjAttrWithSetterException):
1757         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
1758         (WebCore::setJSTestObjStringAttrWithGetterException):
1759         (WebCore::setJSTestObjStringAttrWithSetterException):
1760         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
1761         (WebCore::setJSTestObjCustomAttr):
1762         (WebCore::setJSTestObjOnfoo):
1763         (WebCore::setJSTestObjWithScriptStateAttribute):
1764         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
1765         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
1766         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
1767         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
1768         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
1769         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1770         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1771         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
1772         (WebCore::setJSTestObjConditionalAttr1):
1773         (WebCore::setJSTestObjConditionalAttr2):
1774         (WebCore::setJSTestObjConditionalAttr3):
1775         (WebCore::setJSTestObjConditionalAttr4Constructor):
1776         (WebCore::setJSTestObjConditionalAttr5Constructor):
1777         (WebCore::setJSTestObjConditionalAttr6Constructor):
1778         (WebCore::setJSTestObjAnyAttribute):
1779         (WebCore::setJSTestObjMutablePoint):
1780         (WebCore::setJSTestObjImmutablePoint):
1781         (WebCore::setJSTestObjStrawberry):
1782         (WebCore::setJSTestObjStrictFloat):
1783         (WebCore::setJSTestObjId):
1784         (WebCore::setJSTestObjReplaceableAttribute):
1785         (WebCore::setJSTestObjNullableLongSettableAttribute):
1786         (WebCore::setJSTestObjNullableStringSettableAttribute):
1787         (WebCore::setJSTestObjNullableStringValue):
1788         (WebCore::setJSTestObjAttributeWithReservedEnumType):
1789         (WebCore::setJSTestObjPutForwardsAttribute):
1790         (WebCore::setJSTestObjPutForwardsNullableAttribute):
1791         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1792         (WebCore::setJSTestOverloadedConstructorsConstructor):
1793         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1794         (WebCore::setJSTestOverrideBuiltinsConstructor):
1795         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1796         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1797         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
1798         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
1799         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1800         (WebCore::setJSTestTypedefsConstructor):
1801         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
1802         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
1803         (WebCore::setJSTestTypedefsAttrWithGetterException):
1804         (WebCore::setJSTestTypedefsAttrWithSetterException):
1805         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
1806         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
1807         * bindings/scripts/test/JS/JSattribute.cpp:
1808         (WebCore::setJSattributeConstructor):
1809         * bindings/scripts/test/JS/JSreadonly.cpp:
1810         (WebCore::setJSreadonlyConstructor):
1811         * bridge/c/c_runtime.cpp:
1812         (JSC::Bindings::CField::setValueToInstance):
1813         * bridge/c/c_runtime.h:
1814         * bridge/jsc/BridgeJSC.h:
1815         (JSC::Bindings::Instance::put):
1816         * bridge/objc/objc_runtime.h:
1817         * bridge/objc/objc_runtime.mm:
1818         (JSC::Bindings::ObjcField::setValueToInstance):
1819         (JSC::Bindings::ObjcArray::setValueAt):
1820         (JSC::Bindings::ObjcFallbackObjectImp::put):
1821         * bridge/runtime_array.cpp:
1822         (JSC::RuntimeArray::put):
1823         (JSC::RuntimeArray::putByIndex):
1824         * bridge/runtime_array.h:
1825         * bridge/runtime_object.cpp:
1826         (JSC::Bindings::RuntimeObject::put):
1827         * bridge/runtime_object.h:
1828
1829 2016-03-11  David Kilzer  <ddkilzer@apple.com>
1830
1831         REGRESSION (r197956): WebContent process crashes on launch due to unrecognized selector
1832         <http://webkit.org/b/155356>
1833
1834         Reviewed by Alexey Proskuryakov.
1835
1836         * platform/mac/ScrollableAreaMac.mm:
1837         (WebCore::ScrollableArea::systemLanguageIsRTL): Add
1838         -respondsToSelector: check.
1839
1840 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1841
1842         WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
1843         https://bugs.webkit.org/show_bug.cgi?id=153419
1844
1845         Reviewed by Darin Adler.
1846
1847         Covered by added unint tests.
1848
1849         * Modules/fetch/FetchHeaders.cpp:
1850         (WebCore::isForbiddenHeaderName): Using startsWithLettersIgnoringASCIICase.
1851
1852 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1853
1854         [Fetch API] Use DeferredWrapper directly in FetchBody promise handling
1855         https://bugs.webkit.org/show_bug.cgi?id=155291
1856
1857         Reviewed by Darin Adler.
1858
1859         Moved from typed DOMPromise to DeferredWrapper as there can only be one promise resolved.
1860         Started preparing the handling of blobs translation to other resolved types.
1861
1862         Fixed the case of empty body, in which case promises should resolve with empty objects (strings, buffers...) and not null.
1863
1864         Added Consumer structure to handle asynchronous resolution/rejection of promises.
1865         Added preliminary API to resolve promises based on data stored as a Blob.
1866         FetchBodyOwner will be responsible to do/stop blob loading.
1867
1868         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty.html
1869                imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty.html
1870
1871         * Modules/fetch/FetchBody.cpp:
1872         (WebCore::FetchBody::processIfEmptyOrDisturbed): Fixed empty body case.
1873         (WebCore::FetchBody::arrayBuffer):
1874         (WebCore::FetchBody::blob):
1875         (WebCore::FetchBody::json):
1876         (WebCore::FetchBody::text):
1877         (WebCore::FetchBody::consume):
1878         (WebCore::FetchBody::consumeText):
1879         (WebCore::FetchBody::loadingType):
1880         (WebCore::FetchBody::consumeBlob):
1881         (WebCore::FetchBody::resolveAsJSON):
1882         (WebCore::FetchBody::loadingFailed):
1883         (WebCore::FetchBody::loadedAsBlob):
1884         * Modules/fetch/FetchBody.h:
1885         (WebCore::FetchBody::formData):
1886         (WebCore::FetchBody::Consumer::Consumer):
1887         * Modules/fetch/FetchBody.idl:
1888         * Modules/fetch/FetchBodyOwner.h:
1889         (WebCore::FetchBodyOwner::arrayBuffer):
1890         (WebCore::FetchBodyOwner::blob):
1891         (WebCore::FetchBodyOwner::formData):
1892         (WebCore::FetchBodyOwner::json):
1893         (WebCore::FetchBodyOwner::text):
1894         (WebCore::FetchBodyOwner::loadBlob):
1895
1896 2016-03-11  Yoav Weiss  <yoav@yoav.ws>
1897
1898         Avoid applying link tags with an invalid media attribute
1899         https://bugs.webkit.org/show_bug.cgi?id=143262
1900
1901         Reviewed by Brent Fulgham.
1902
1903         In current HTML spec, unlike HTML4, the UA must not apply <link> based resources
1904         when the media attribute does not match:
1905         https://html.spec.whatwg.org/multipage/semantics.html#attr-link-media
1906
1907         An invalid media attribute parsing creates a non-empty MediaQuerySet
1908         containing a single query with no expressions and no media type.
1909         (and with its m_ignored flag off)
1910
1911         In order to ignore such MediaQueries, I added an extra check that makes sure
1912         that the queries handled by MediaQueryEvaluator::eval have either expressions
1913         or a media type, and if not, they are ignored.
1914
1915         Test: fast/dom/HTMLLinkElement/link-stylesheet-invalid-media.html
1916
1917         * css/MediaQueryEvaluator.cpp:
1918         (WebCore::MediaQueryEvaluator::eval):
1919
1920 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1921
1922         [CallWith=ScriptExecutionContext] should pass ScriptExecutionContext to the implementation by reference
1923         https://bugs.webkit.org/show_bug.cgi?id=155297
1924
1925         Reviewed by Darin Adler.
1926
1927         Changing the binding generator to pass ScriptExecutionContext by reference.
1928         Updating DOM classes accordingly.
1929
1930         Covered by existing tests.
1931
1932         * Modules/encryptedmedia/MediaKeySession.cpp:
1933         (WebCore::MediaKeySession::create):
1934         (WebCore::MediaKeySession::MediaKeySession):
1935         * Modules/encryptedmedia/MediaKeySession.h:
1936         * Modules/encryptedmedia/MediaKeys.cpp:
1937         (WebCore::MediaKeys::createSession):
1938         * Modules/encryptedmedia/MediaKeys.h:
1939         * Modules/fetch/FetchRequest.cpp:
1940         (WebCore::FetchRequest::clone):
1941         * Modules/fetch/FetchRequest.h:
1942         * Modules/fetch/FetchResponse.cpp:
1943         (WebCore::FetchResponse::error):
1944         (WebCore::FetchResponse::redirect):
1945         (WebCore::FetchResponse::clone):
1946         * Modules/fetch/FetchResponse.h:
1947         * Modules/indexeddb/IDBCursor.h:
1948         (WebCore::IDBCursor::continueFunction):
1949         * Modules/indexeddb/IDBFactory.h:
1950         * Modules/indexeddb/IDBIndex.h:
1951         * Modules/indexeddb/IDBKeyRange.cpp:
1952         (WebCore::IDBKeyRange::lowerValue):
1953         (WebCore::IDBKeyRange::upperValue):
1954         (WebCore::IDBKeyRange::only):
1955         (WebCore::IDBKeyRange::lowerBound):
1956         (WebCore::IDBKeyRange::upperBound):
1957         (WebCore::IDBKeyRange::bound):
1958         * Modules/indexeddb/IDBKeyRange.h:
1959         (WebCore::IDBKeyRange::lowerBound):
1960         (WebCore::IDBKeyRange::upperBound):
1961         (WebCore::IDBKeyRange::bound):
1962         * Modules/indexeddb/IDBObjectStore.h:
1963         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1964         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
1965         * Modules/indexeddb/IDBOpenDBRequest.h:
1966         * Modules/indexeddb/IDBRequest.cpp:
1967         (WebCore::IDBRequest::IDBRequest):
1968         * Modules/indexeddb/IDBRequest.h:
1969         * Modules/indexeddb/client/IDBCursorImpl.cpp:
1970         (WebCore::IDBClient::IDBCursor::continueFunction):
1971         (WebCore::IDBClient::IDBCursor::deleteFunction):
1972         * Modules/indexeddb/client/IDBCursorImpl.h:
1973         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1974         (WebCore::IDBClient::shouldThrowSecurityException):
1975         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
1976         (WebCore::IDBClient::IDBFactory::open):
1977         (WebCore::IDBClient::IDBFactory::openInternal):
1978         (WebCore::IDBClient::IDBFactory::deleteDatabase):
1979         (WebCore::IDBClient::IDBFactory::cmp):
1980         * Modules/indexeddb/client/IDBFactoryImpl.h:
1981         * Modules/indexeddb/client/IDBIndexImpl.cpp:
1982         (WebCore::IDBClient::IDBIndex::IDBIndex):
1983         (WebCore::IDBClient::IDBIndex::openCursor):
1984         (WebCore::IDBClient::IDBIndex::count):
1985         (WebCore::IDBClient::IDBIndex::openKeyCursor):
1986         (WebCore::IDBClient::IDBIndex::get):
1987         (WebCore::IDBClient::IDBIndex::getKey):
1988         * Modules/indexeddb/client/IDBIndexImpl.h:
1989         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
1990         (WebCore::IDBClient::IDBObjectStore::create):
1991         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
1992         (WebCore::IDBClient::IDBObjectStore::openCursor):
1993         (WebCore::IDBClient::IDBObjectStore::get):
1994         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
1995         (WebCore::IDBClient::IDBObjectStore::doDelete):
1996         (WebCore::IDBClient::IDBObjectStore::modernDelete):
1997         (WebCore::IDBClient::IDBObjectStore::clear):
1998         (WebCore::IDBClient::IDBObjectStore::createIndex):
1999         (WebCore::IDBClient::IDBObjectStore::index):
2000         (WebCore::IDBClient::IDBObjectStore::count):
2001         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
2002         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
2003         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
2004         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
2005         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
2006         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
2007         * Modules/indexeddb/client/IDBRequestImpl.cpp:
2008         (WebCore::IDBClient::IDBRequest::IDBRequest):
2009         * Modules/indexeddb/client/IDBRequestImpl.h:
2010         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
2011         (WebCore::IDBClient::IDBTransaction::objectStore):
2012         (WebCore::IDBClient::IDBTransaction::createObjectStore):
2013         (WebCore::IDBClient::IDBTransaction::createIndex):
2014         * Modules/mediasource/DOMURLMediaSource.cpp:
2015         (WebCore::DOMURLMediaSource::createObjectURL):
2016         * Modules/mediasource/DOMURLMediaSource.h:
2017         * Modules/mediastream/DOMURLMediaStream.cpp:
2018         (WebCore::DOMURLMediaStream::createObjectURL):
2019         * Modules/mediastream/DOMURLMediaStream.h:
2020         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
2021         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
2022         * Modules/mediastream/HTMLMediaElementMediaStream.h:
2023         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
2024         * Modules/notifications/Notification.cpp:
2025         (WebCore::Notification::Notification):
2026         (WebCore::Notification::create):
2027         (WebCore::Notification::permission):
2028         (WebCore::Notification::requestPermission):
2029         * Modules/notifications/Notification.h:
2030         * Modules/notifications/NotificationCenter.cpp:
2031         (WebCore::NotificationCenter::createNotification):
2032         * Modules/notifications/NotificationClient.h:
2033         * Modules/quota/StorageInfo.cpp:
2034         (WebCore::StorageInfo::queryUsageAndQuota):
2035         (WebCore::StorageInfo::requestQuota):
2036         * Modules/quota/StorageInfo.h:
2037         * Modules/quota/StorageQuota.h:
2038         * bindings/js/JSIDBObjectStoreCustom.cpp:
2039         (WebCore::JSIDBObjectStore::createIndex):
2040         * bindings/scripts/CodeGeneratorJS.pm:
2041         (GenerateCallWith):
2042         * bindings/scripts/test/JS/JSTestInterface.cpp:
2043         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
2044         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2045         * bindings/scripts/test/JS/JSTestObj.cpp:
2046         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2047         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2048         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2049         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2050         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2051         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
2052         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
2053         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
2054         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2055         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2056         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
2057         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
2058         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
2059         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
2060         * fileapi/FileReaderSync.cpp:
2061         (WebCore::FileReaderSync::readAsArrayBuffer):
2062         (WebCore::FileReaderSync::readAsBinaryString):
2063         (WebCore::FileReaderSync::readAsText):
2064         (WebCore::FileReaderSync::readAsDataURL):
2065         (WebCore::FileReaderSync::startLoading):
2066         * fileapi/FileReaderSync.h:
2067         (WebCore::FileReaderSync::readAsText):
2068         * html/DOMURL.cpp:
2069         (WebCore::DOMURL::createObjectURL):
2070         (WebCore::DOMURL::createPublicURL):
2071         (WebCore::DOMURL::revokeObjectURL):
2072         * html/DOMURL.h:
2073         * html/HTMLMediaElement.cpp:
2074         (WebCore::HTMLMediaElement::setSrcObject):
2075         * html/HTMLMediaElement.h:
2076         * inspector/InspectorIndexedDBAgent.cpp:
2077         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2078         * page/DOMWindow.h:
2079         * page/History.h:
2080         (WebCore::History::back):
2081         (WebCore::History::forward):
2082         (WebCore::History::go):
2083
2084 2016-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2085
2086         [GTK] Fix rendering of slider input elements
2087         https://bugs.webkit.org/show_bug.cgi?id=155296
2088
2089         Reviewed by Michael Catanzaro.
2090
2091         Use the new gadgets for newer GTK+ and improve a bit the rendering
2092         for previous versions to better match GTK+.
2093
2094         * rendering/RenderThemeGtk.cpp:
2095         (WebCore::createStyleContext): Add ScaleContents and
2096         ScaleHighlight parts that are only used with GTK+ 3.19.
2097         (WebCore::RenderThemeGtk::paintSliderTrack): Use a smaller trough,
2098         centered in the given rectangle to better match GTK+. Also render
2099         the hightlight gadget with GTK+ 3.19.
2100         (WebCore::RenderThemeGtk::paintSliderThumb): Also create the style
2101         context for contents gadget.
2102         (WebCore::RenderThemeGtk::adjustSliderThumbSize): Take into
2103         account the slider border when calculating the slider thumb size.
2104
2105 2016-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2106
2107         [GTK] Scrollbars are broken once again with current GTK+ master
2108         https://bugs.webkit.org/show_bug.cgi?id=155292
2109
2110         Reviewed by Michael Catanzaro.
2111
2112         Most of the trough theming properties have been moved to the
2113         scrollbar, and a new gadget "contents" has been added between the
2114         scrollbar and its children.
2115
2116         * platform/gtk/ScrollbarThemeGtk.cpp:
2117         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
2118         left/bottom style classes to ensure the scrollbars border is taken
2119         into account and rendered.
2120         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Also create
2121         style context for contents gadget.
2122         (WebCore::ScrollbarThemeGtk::paintThumb): Ditto.
2123         (WebCore::ScrollbarThemeGtk::paintButton): Ditto.
2124         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Take the
2125         scrollbar border into account.
2126         (WebCore::ScrollbarThemeGtk::buttonSize): Also create style
2127         context for contents gadget.
2128         (WebCore::ScrollbarThemeGtk::getStepperSpacing): Ditto.
2129         (WebCore::ScrollbarThemeGtk::minimumThumbLength): Ditto.
2130         (WebCore::ScrollbarThemeGtk::thumbFatness): Ditto.
2131         (WebCore::ScrollbarThemeGtk::getTroughBorder): Take the scrollbar
2132         border into account.
2133
2134 2016-03-10  David Kilzer  <ddkilzer@apple.com>
2135
2136         REGRESSION (r197983): Build fails due to missing inline method
2137
2138         Attempt to fix the following build failure:
2139
2140             Undefined symbols for architecture arm64:
2141               "JSC::GenericTypedArrayView<JSC::Uint8ClampedAdaptor>::createUninitialized(unsigned int)", referenced from:
2142                   WebCore::ImageBufferData::getData(WebCore::IntRect const&, WebCore::IntSize const&, bool, bool, float) const in ImageBufferDataCG.o
2143
2144         * platform/graphics/cg/ImageBufferDataCG.cpp: Include some
2145         headers to match FEGaussianBlur.cpp and FilterEffect.cpp.
2146
2147 2016-03-10  Tim Horton  <timothy_horton@apple.com>
2148
2149         Try to fix the iOS 9 build.
2150
2151         * editing/cocoa/DataDetection.mm:
2152         (WebCore::DataDetection::detectContentInRange):
2153         * platform/cocoa/DataDetectorsCoreSoftLink.h:
2154         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
2155         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
2156
2157 2016-03-10  David Kilzer  <ddkilzer@apple.com>
2158
2159         REGRESSION (r197976): Build failure due to missing DDOptionalSource.h header
2160
2161         Follow-up fix for:
2162             Expose additional WKDataDetectorTypes.
2163             <https://bugs.webkit.org/show_bug.cgi?id=155331>
2164
2165         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Protect
2166         DDOptionalSource.h with version check.
2167
2168 2016-03-10  Alex Christensen  <achristensen@webkit.org>
2169
2170         Fix Windows build after r197986.
2171
2172         * accessibility/AccessibilityObject.h:
2173
2174 2016-03-10  Jeremy Jones  <jeremyj@apple.com>
2175
2176         Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
2177         https://bugs.webkit.org/show_bug.cgi?id=155117
2178         rdar://problem/6802240
2179
2180         Reviewed by Simon Fraser.
2181
2182         No new tests because no new functionality was added.
2183
2184         This will prevent persistent media caches when webkit is using in memory caching.
2185
2186         * html/HTMLMediaElement.cpp:
2187         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache): Added.
2188         * html/HTMLMediaElement.h: Declare mediaPlayerShouldUsePersistentCache().
2189         * page/ChromeClient.h: Declare mediaPlayerShouldUsePersistentCache().
2190         * platform/graphics/MediaPlayer.h:
2191         (WebCore::MediaPlayerClient::mediaPlayerShouldUsePersistentCache): Added.
2192         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2193         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Set property on AVAssetOptions.
2194
2195 2016-03-10  Jer Noble  <jer.noble@apple.com>
2196
2197         CRASH at WebCore::RenderView::updateVisibleViewportRect
2198         https://bugs.webkit.org/show_bug.cgi?id=155209
2199         <rdar://problem/23997530>
2200
2201         Reviewed by Simon Fraser.
2202
2203         Test: media/video-crash-invisible-autoplay-display-none.html
2204
2205         Between the time when the video element's renderer is created and destroyed, we may have unset the
2206         InvisibleAutoplayNotPermitted restriction. So rather than check for that restriction before
2207         unregistering for the "visible in viewport" notification, unregister only if the renderer
2208         was previously registered.
2209
2210         * html/HTMLMediaElement.cpp:
2211         (WebCore::HTMLMediaElement::willDetachRenderers):
2212
2213 2016-03-10  Zalan Bujtas  <zalan@apple.com>
2214
2215         Simple line layout: Add text-align: justify support.
2216         https://bugs.webkit.org/show_bug.cgi?id=155006
2217
2218         Reviewed by Antti Koivisto.
2219
2220         This patch enables text-align: justify; for simple line layout (only latin text for now).
2221         It speeds up/reduced memory consumption for justified text.
2222
2223         PerformanceTests/Layout/line-layout-simple.html
2224         before text-align: justify support -> mean: 86.20513022288704 runs/s
2225         after -> mean: 96.73972475626084 runs/s
2226
2227         Covered by existing text-align: justify tests.
2228
2229         * rendering/SimpleLineLayout.cpp:
2230         (WebCore::SimpleLineLayout::canUseForFontAndText):
2231         (WebCore::SimpleLineLayout::LineState::expansionOpportunityCount):
2232         (WebCore::SimpleLineLayout::LineState::expansionOportunity):
2233         (WebCore::SimpleLineLayout::expansionBehavior):
2234         (WebCore::SimpleLineLayout::justifyRuns):
2235         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2236         (WebCore::SimpleLineLayout::createTextRuns):
2237         (WebCore::SimpleLineLayout::printReason):
2238         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
2239         * rendering/SimpleLineLayout.h:
2240         * rendering/SimpleLineLayoutFunctions.cpp:
2241         (WebCore::SimpleLineLayout::paintFlow):
2242         * rendering/SimpleLineLayoutResolver.h:
2243         (WebCore::SimpleLineLayout::RunResolver::Run::expansion):
2244         (WebCore::SimpleLineLayout::RunResolver::Run::expansionBehavior):
2245
2246 2016-03-10  Nan Wang  <n_wang@apple.com>
2247
2248         AX: Force allow user zoom
2249         https://bugs.webkit.org/show_bug.cgi?id=155056
2250
2251         Reviewed by Simon Fraser.
2252
2253         Override the maximum/minimum scale factor when forceAlwaysUserScalable is true.
2254
2255         Test: fast/viewport/ios/force-always-user-scalable.html
2256
2257         * Configurations/WebCoreTestSupport.xcconfig:
2258         * page/ViewportConfiguration.cpp:
2259         (WebCore::ViewportConfiguration::minimumScale):
2260         * page/ViewportConfiguration.h:
2261         (WebCore::ViewportConfiguration::maximumScale):
2262         * testing/Internals.cpp:
2263         (WebCore::Internals::resetToConsistentState):
2264         (WebCore::Internals::Internals):
2265         (WebCore::Internals::composedTreeAsText):
2266         (WebCore::Internals::setViewportForceAlwaysUserScalable):
2267         * testing/Internals.h:
2268         * testing/Internals.idl:
2269
2270 2016-03-10  Jiewen Tan  <jiewen_tan@apple.com>
2271
2272         WebKit should not be redirected to an invalid URL
2273         https://bugs.webkit.org/show_bug.cgi?id=155263
2274         <rdar://problem/22820172>
2275
2276         Reviewed by Brent Fulgham.
2277
2278         Test: http/tests/navigation/redirect-to-invalid-url.html
2279
2280         * loader/SubresourceLoader.cpp:
2281         (WebCore::SubresourceLoader::willSendRequestInternal):
2282
2283 2016-03-10  Nan Wang  <n_wang@apple.com>
2284
2285         AX: Implement bounds/position and index related text marker functions using TextIterator
2286         https://bugs.webkit.org/show_bug.cgi?id=154976
2287
2288         Reviewed by Chris Fleizach.
2289
2290         Implemented position and index related text marker calls with TextIterator. Also fixed some
2291         VoiceOver navigation issues.
2292
2293         Test: accessibility/mac/text-marker-for-index.html
2294
2295         * accessibility/AXObjectCache.cpp:
2296         (WebCore::AXObjectCache::traverseToOffsetInRange):
2297         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
2298         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
2299         (WebCore::AXObjectCache::shouldSkipBoundary):
2300         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
2301         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
2302         (WebCore::AXObjectCache::nextBoundary):
2303         (WebCore::AXObjectCache::previousBoundary):
2304         (WebCore::AXObjectCache::previousSentenceStartCharacterOffset):
2305         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
2306         (WebCore::AXObjectCache::absoluteCaretBoundsForCharacterOffset):
2307         (WebCore::AXObjectCache::characterOffsetForPoint):
2308         (WebCore::AXObjectCache::characterOffsetForBounds):
2309         (WebCore::AXObjectCache::endCharacterOffsetOfLine):
2310         (WebCore::AXObjectCache::startCharacterOffsetOfLine):
2311         (WebCore::AXObjectCache::characterOffsetForIndex):
2312         (WebCore::AXObjectCache::indexForCharacterOffset):
2313         (WebCore::AXObjectCache::rootAXEditableElement):
2314         * accessibility/AXObjectCache.h:
2315         * accessibility/AccessibilityObject.cpp:
2316         (WebCore::AccessibilityObject::visiblePositionRangeForRange):
2317         (WebCore::AccessibilityObject::rangeForPlainTextRange):
2318         (WebCore::AccessibilityObject::lineRangeForPosition):
2319         * accessibility/AccessibilityObject.h:
2320         (WebCore::AccessibilityObject::boundsForVisiblePositionRange):
2321         (WebCore::AccessibilityObject::boundsForRange):
2322         (WebCore::AccessibilityObject::setSelectedVisiblePositionRange):
2323         (WebCore::AccessibilityObject::doAXStringForRange):
2324         (WebCore::AccessibilityObject::doAXBoundsForRange):
2325         (WebCore::AccessibilityObject::doAXBoundsForRangeUsingCharacterOffset):
2326         * accessibility/AccessibilityRenderObject.cpp:
2327         (WebCore::AccessibilityRenderObject::nodeIsTextControl):
2328         (WebCore::AccessibilityRenderObject::boundsForRects):
2329         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
2330         (WebCore::AccessibilityRenderObject::boundsForRange):
2331         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
2332         (WebCore::AccessibilityRenderObject::doAXBoundsForRange):
2333         (WebCore::AccessibilityRenderObject::doAXBoundsForRangeUsingCharacterOffset):
2334         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
2335         * accessibility/AccessibilityRenderObject.h:
2336         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2337         (-[WebAccessibilityObjectWrapper positionForTextMarker:]):
2338         (-[WebAccessibilityObjectWrapper textMarkerRange]):
2339         (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
2340         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
2341         (-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
2342         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
2343         (-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
2344         (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
2345         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2346         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
2347         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
2348         (-[WebAccessibilityObjectWrapper _indexForTextMarker:]):
2349         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
2350         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2351         * editing/htmlediting.cpp:
2352         (WebCore::localCaretRectInRendererForCaretPainting):
2353         (WebCore::localCaretRectInRendererForRect):
2354         * editing/htmlediting.h:
2355
2356 2016-03-10  Simon Fraser  <simon.fraser@apple.com>
2357
2358         Font antialiasing (smoothing) changes when elements are rendered into compositing layers
2359         https://bugs.webkit.org/show_bug.cgi?id=23364
2360
2361         Reviewed by Tim Horton.
2362
2363         Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
2364         by opting in to a new CALayer backing store format.
2365
2366         GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
2367         when the platform has support for the new feature. Ideally this would only be set when
2368         we know a layer has smoothed text drawn into it, but, for now, enable this for all
2369         layers. The right thing happens with opaque layers under the hood.
2370
2371         setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
2372         is ultimately passed to setBackingStoreFormat().
2373
2374         We also need to propagate this flag to TileController tiles.
2375
2376         * platform/graphics/GraphicsLayer.cpp:
2377         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
2378         (WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
2379         (WebCore::GraphicsLayer::smoothedLayerTextEnabled):
2380         (WebCore::GraphicsLayer::GraphicsLayer):
2381         * platform/graphics/GraphicsLayer.h:
2382         (WebCore::GraphicsLayer::supportsSmoothedFonts):
2383         (WebCore::GraphicsLayer::setSupportsSmoothedFonts):
2384         * platform/graphics/TiledBacking.h:
2385         * platform/graphics/ca/GraphicsLayerCA.cpp:
2386         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
2387         (WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
2388         (WebCore::GraphicsLayer::smoothedLayerTextEnabled):
2389         (WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
2390         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2391         (WebCore::GraphicsLayerCA::updateContentsFormat):
2392         * platform/graphics/ca/GraphicsLayerCA.h:
2393         * platform/graphics/ca/PlatformCALayer.cpp:
2394         (WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
2395         the contents format says we support smoothed fonts.
2396         * platform/graphics/ca/PlatformCALayer.h:
2397         * platform/graphics/ca/TileController.cpp:
2398         (WebCore::TileController::setTileContentsFormatFlags):
2399         (WebCore::TileController::createTileLayer):
2400         * platform/graphics/ca/TileController.h:
2401         * platform/graphics/ca/TileGrid.cpp:
2402         (WebCore::TileGrid::updateTileLayerProperties):
2403         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2404         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2405         (WebCore::setBackingStoreFormat):
2406         (PlatformCALayerCocoa::commonInit):
2407         (PlatformCALayerCocoa::setContentsFormat):
2408         (PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
2409         non-opaque layers to improve text appearance. We no longer need to do that when
2410         the contents format has "SmoothedFonts".
2411         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2412         (PlatformCALayerWin::setContentsFormat):
2413         (PlatformCALayerWin::contentsFormat):
2414         * platform/graphics/ca/win/PlatformCALayerWin.h:
2415         * platform/ios/LegacyTileGridTile.mm:
2416         (WebCore::setBackingStoreFormat):
2417         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
2418         * rendering/RenderLayerBacking.cpp:
2419         (WebCore::RenderLayerBacking::createGraphicsLayer):
2420
2421 2016-03-10  Commit Queue  <commit-queue@webkit.org>
2422
2423         Unreviewed, rolling out r197922.
2424         https://bugs.webkit.org/show_bug.cgi?id=155340
2425
2426         This change broke storage/websql tests on ios-simulator.
2427         (Requested by ryanhaddad on #webkit).
2428
2429         Reverted changeset:
2430
2431         "WebKit should adopt journal_mode=wal for all SQLite
2432         databases."
2433         https://bugs.webkit.org/show_bug.cgi?id=133496
2434         http://trac.webkit.org/changeset/197922
2435
2436 2016-03-10  Tim Horton  <timothy_horton@apple.com>
2437
2438         Fix the build again.
2439
2440         * editing/cocoa/DataDetection.mm:
2441         (WebCore::constructURLStringForResult):
2442
2443 2016-03-10  Tim Horton  <timothy_horton@apple.com>
2444
2445         Fix the build.
2446
2447         * editing/cocoa/DataDetection.mm:
2448
2449 2016-03-10  Enrica Casucci  <enrica@apple.com>
2450
2451         Expose additional WKDataDetectorTypes.
2452         https://bugs.webkit.org/show_bug.cgi?id=155331
2453         rdar://problem/24175813
2454
2455         Reviewed by Tim Horton.
2456
2457         Adding support for additional data detector types (tracking
2458         numbers, flight information and spotlight suggestions).
2459
2460         * editing/cocoa/DataDetection.h:
2461         * editing/cocoa/DataDetection.mm:
2462         (WebCore::constructURLStringForResult):
2463         (WebCore::DataDetection::detectContentInRange):
2464         * platform/cocoa/DataDetectorsCoreSoftLink.h:
2465         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
2466         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
2467
2468 2016-03-10  Daniel Bates  <dabates@apple.com>
2469
2470         CSP: Implement frame-ancestors directive
2471         https://bugs.webkit.org/show_bug.cgi?id=154345
2472         <rdar://problem/24702161>
2473
2474         Reviewed by Brent Fulgham.
2475
2476         Add support for the Content Security Policy directive frame-ancestors per the Content Security
2477         Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2478
2479         Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-meta-element-ignored.html
2480                http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-in-report-only-ignored.html
2481                http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin-https.html
2482                http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-cross-origin.html
2483                http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin-https.html
2484                http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/report-frame-ancestors-same-origin.html
2485
2486         * loader/DocumentLoader.cpp:
2487         (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied): Extracted from DocumentLoader::responseReceived().
2488         (WebCore::DocumentLoader::responseReceived): Extracted logic to cancel a load and dispatch a DOM Load
2489         event at the frame owner into DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied().
2490         Make use of this function when loading of the frame is blocked by either the Content Security Policy or
2491         the X-Frame-Option policy. We explicitly instantiate a ContentSecurityPolicy object with a SecurityOrigin
2492         and Frame instead of using ScriptExecutionContext m_frame->document() because m_frame->document() is not
2493         in a stable state (for instance, Document::m_url has not been initialized) as we are in the process of
2494         loading the underlying document data for it.
2495         * loader/DocumentLoader.h:
2496         * loader/FrameLoader.cpp:
2497         (WebCore::FrameLoader::didBeginDocument): Pass ContentSecurityPolicy::ReportParsingErrors::No to silence
2498         errors raised when parsing the Content Security Policy headers to avoid duplicate error messages. Any
2499         parsing errors would have been raised when we parsed the Content Security Policy in DocumentLoader.
2500         * page/csp/ContentSecurityPolicy.cpp:
2501         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Modified to take an optional pointer to a Frame (defaults
2502         to nullptr). The specified Frame is used to support emitting console messages for violations/syntax errors and
2503         send violation reports. We make use of this constructor variant in DocumentLoader to support emitting console
2504         message and sending violation reports in the context of DocumentLoader where its associated Document is not in a
2505         stable state and making use of a Frame seems less error prone.
2506         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Modified to take argument reportParsingErrors as
2507         to whether to silence parsing errors when parsing the specified headers.
2508         (WebCore::isAllowedByAllWithFrame): Helper function to query a ContentSecurityPolicyDirectiveList function
2509         passing a Frame and URL for each Content Security Policy.
2510         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Calls WebCore::isAllowedByAllWithFrame().
2511         (WebCore::ContentSecurityPolicy::reportViolation): Modified to support sending a violation report when
2512         we have a Frame and no ScriptExecutionContext (such as when we are instantiated in DocumentLoader).
2513         Additionally, we only will send a report if reporting is enabled (i.e. ContentSecurityPolicy::m_isReportingEnabled == true).
2514         (WebCore::ContentSecurityPolicy::logToConsole): Modified to support logging a message to the console
2515         we have a Frame and no ScriptExecutionContext. We also only allow logging if reporting is enabled.
2516         * page/csp/ContentSecurityPolicy.h:
2517         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2518         (WebCore::checkFrameAncestors): Added.
2519         (WebCore::ContentSecurityPolicyDirectiveList::checkFrameAncestorsAndReportViolation): Added.
2520         (WebCore::ContentSecurityPolicyDirectiveList::allowFrameAncestors): Added.
2521         (WebCore::ContentSecurityPolicyDirectiveList::parse): Ignore the directive frame-ancestors when defined
2522         in a policy given in an HTML meta element and report such use as invalid.
2523         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the directive frame-ancestors.
2524         * page/csp/ContentSecurityPolicyDirectiveList.h:
2525         * page/csp/ContentSecurityPolicyResponseHeaders.h: Mark constructor "explicit".
2526
2527 2016-03-10  Jer Noble  <jer.noble@apple.com>
2528
2529         Add WebCore, WebKit, & WebKit2 preference/setting to enable Main Content heuristic.
2530         https://bugs.webkit.org/show_bug.cgi?id=155326
2531         <rdar://problem/25095408>
2532
2533         Reviewed by Beth Dakin.
2534
2535         * html/HTMLMediaElement.cpp:
2536         (WebCore::HTMLMediaElement::HTMLMediaElement): Set the OverrideUserGestureRequirementForMainContent if the new setting is enabled.
2537         * page/Settings.in:
2538
2539 2016-03-10  Said Abou-Hallawa  <sabouhallawa@apple.com>
2540
2541         REGRESSION: GuardMallloc crash in SVGListPropertyTearOff<SVGPointList>::processIncomingListItemWrapper
2542         https://bugs.webkit.org/show_bug.cgi?id=154969
2543
2544         Reviewed by Darin Adler.
2545
2546         The life cycle of the SVGAnimatedPropertyTearOff::m_baseVal and m_animVal
2547         was not correct. Like what was done in SVGAnimatedListPropertyTearOff,
2548         m_baseVal and m_animVal have to be raw RefCounted pointers. When requested
2549         through, SVGAnimatedPropertyTearOff::baseVal() and animVal() they are
2550         encapsulated in a RefPtr to ensure they existence as long as they are
2551         referenced. When the animated property object (which is stored in either
2552         m_baseVal or m_animVal) is not referenced by anyone, it is going to be
2553         deleted. In the destructor of their class, SVGAnimatedPropertyTearOff
2554         will be notified of this deletion through propertyWillBeDeleted() to clean
2555         its member m_baseVal or m_animVal.
2556
2557         * bindings/scripts/CodeGeneratorJS.pm:
2558         (NativeToJSValue): Now all the SVG animated property return RefPtrs. In
2559         addition to that, SVGViewSpec.transform also returns
2560         RefPtr<SVGTransformListPropertyTearOff>.
2561         
2562         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2563         (WebCore::SVGAnimatedListPropertyTearOff::animVal):
2564         (WebCore::SVGAnimatedListPropertyTearOff::currentAnimatedValue):
2565         (WebCore::SVGAnimatedListPropertyTearOff::animationStarted):
2566         (WebCore::SVGAnimatedListPropertyTearOff::animationEnded):
2567         (WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
2568         (WebCore::SVGAnimatedListPropertyTearOff::isAnimating):
2569         (WebCore::SVGAnimatedListPropertyTearOff::propertyWillBeDeleted):
2570         Change propertyWillBeDeleted() to be virtual and make it takes an SVGProperty*.
2571         Rename m_animatingAnimVal to be m_animatedProperty. Add isAnimating() which
2572         returns true if m_animatedProperty is not null. Use isAnimating() instead of
2573         m_isAnimating because it's deleted from the base class.
2574         
2575         * svg/properties/SVGAnimatedProperty.cpp:
2576         (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
2577         (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
2578         * svg/properties/SVGAnimatedProperty.h:
2579         (WebCore::SVGAnimatedProperty::isAnimating):
2580         (WebCore::SVGAnimatedProperty::propertyWillBeDeleted):
2581         Delete m_isAnimating since its value can be deduced from the value of
2582         m_animatedProperty in the derived class. Add propertyWillBeDeleted() and
2583         isAnimating() as virtual functions with the default behavior.
2584         
2585         * svg/properties/SVGAnimatedPropertyTearOff.h:
2586         (WebCore::SVGAnimatedPropertyTearOff::baseVal):
2587         (WebCore::SVGAnimatedPropertyTearOff::animVal):
2588         Like SVGAnimatedListPropertyTearOff::baseVal() and animVal() create the
2589         value if it does not exist. Keep a raw RefCounted pointer but return a
2590         RefPtr.
2591
2592         (WebCore::SVGAnimatedPropertyTearOff::isAnimating):
2593         (WebCore::SVGAnimatedPropertyTearOff::propertyWillBeDeleted):
2594         Override virtual functions.
2595         
2596         (WebCore::SVGAnimatedPropertyTearOff::currentAnimatedValue):
2597         (WebCore::SVGAnimatedPropertyTearOff::animationStarted):
2598         (WebCore::SVGAnimatedPropertyTearOff::animationEnded):
2599         (WebCore::SVGAnimatedPropertyTearOff::animValWillChange):
2600         (WebCore::SVGAnimatedPropertyTearOff::animValDidChange):
2601         Replace m_isAnimating with isAnimating(). Ensure that we get a new animated
2602         property through animVal() and store it in a RefPtr to ensure it will not
2603         go away while animating.
2604         
2605         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
2606         (WebCore::SVGAnimatedStaticPropertyTearOff::isAnimating):
2607         (WebCore::SVGAnimatedStaticPropertyTearOff::currentAnimatedValue):
2608         (WebCore::SVGAnimatedStaticPropertyTearOff::animationStarted):
2609         (WebCore::SVGAnimatedStaticPropertyTearOff::animationEnded):
2610         (WebCore::SVGAnimatedStaticPropertyTearOff::animValWillChange):
2611         (WebCore::SVGAnimatedStaticPropertyTearOff::animValDidChange):
2612         Add isAnimating() and replace all the instances of m_isAnimating with calls
2613         to isAnimating().
2614         
2615         * svg/properties/SVGPropertyTearOff.h:
2616         (WebCore::SVGPropertyTearOff::animatedProperty):
2617         (WebCore::SVGPropertyTearOff::setAnimatedProperty):
2618         (WebCore::SVGPropertyTearOff::contextElement):
2619         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
2620         (WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
2621         SVGPropertyTearOff is what SVGAnimatedPropertyTearOff creates for its 
2622         baseVal() and animVal() values. These values can be null anytime once
2623         they are not referenced. The SVGAnimatedPropertyTearOff holds only raw
2624         RefCounted pointer for them. So (1) SVGPropertyTearOff needs to hold a
2625         RefPtr for its SVGAnimatedProperty and (2) it needs to notify its
2626         SVGAnimatedProperty when it's deleted by calling propertyWillBeDeleted()
2627         from the destructor. Also there is no need to get the contextElement()
2628         and save it in class member, m_contextElement since it can be always be
2629         retrieved from SVGAnimatedProperty::contextElement().
2630
2631 2016-03-10  Jonathan Davis  <jond@apple.com>
2632
2633         Fixed broken link for "WebGL 2" on the Feature Status page
2634         https://bugs.webkit.org/show_bug.cgi?id=155235
2635
2636         Reviewed by Alex Christensen.
2637
2638         * features.json:
2639
2640 2016-03-10  Myles C. Maxfield  <mmaxfield@apple.com>
2641
2642         [OS X] Main frame scrollbars should appear on the left on RTL systems
2643         https://bugs.webkit.org/show_bug.cgi?id=155149
2644
2645         Reviewed by Simon Fraser.
2646
2647         A helper function, ScrollableArea::systemLanguageIsRTL() is used to determine
2648         if we should be in this new mode. Once we have determined we should be in
2649         this new mode, there are some scattered places where the geometry math
2650         needed to be updated.
2651
2652         Tests: fast/scrolling/rtl-scrollbars-simple.html
2653                fast/scrolling/rtl-scrollbars.html
2654
2655         * page/scrolling/AsyncScrollingCoordinator.cpp:
2656         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2657         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
2658         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2659         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2660         * platform/mac/ScrollableAreaMac.mm:
2661         (WebCore::ScrollableArea::systemLanguageIsRTL):
2662         * platform/ScrollableArea.h:
2663         * platform/ScrollView.cpp:
2664         (WebCore::ScrollView::updateScrollbars):
2665         (WebCore::ScrollView::scrollCornerRect):
2666         * platform/mac/ScrollAnimatorMac.mm:
2667         (WebCore::ScrollAnimator::scrollbarsAreRTL):
2668         * platform/spi/mac/NSScrollerImpSPI.h:
2669         * rendering/RenderLayerCompositor.cpp:
2670         (WebCore::RenderLayerCompositor::positionForClipLayer):
2671
2672 2016-03-07  Jer Noble  <jer.noble@apple.com>
2673
2674         Add separate WK and WK2 preferences for requiring user gestures for video media, distinct from user gestures for media generally
2675         https://bugs.webkit.org/show_bug.cgi?id=155141
2676
2677         Reviewed by Beth Dakin.
2678
2679         Rename RequireUserGestureForRateChange -> RequireUserGestureForVideoRateChange.
2680         Rename Settings::requiresUserGestureForMediaPlayback -> Settings::videoPlaybackRequiresUserGesture.
2681
2682         Fix longstanding FIXME unifying our behavior restrictions between iOS and Mac.
2683
2684         * Modules/webaudio/AudioContext.cpp:
2685         (WebCore::AudioContext::constructCommon): Rename.
2686         * html/HTMLMediaElement.cpp:
2687         (WebCore::HTMLMediaElement::HTMLMediaElement): Unify behavior restriction behavior.
2688         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Rename.
2689         * html/MediaElementSession.cpp:
2690         (WebCore::restrictionName): Rename.
2691         (WebCore::MediaElementSession::playbackPermitted): Rename.
2692         * html/MediaElementSession.h:
2693         * page/Settings.cpp:
2694         * page/Settings.in:
2695         * testing/Internals.cpp:
2696         (WebCore::Internals::setMediaElementRestrictions): Rename.
2697
2698 2016-03-10  Ryosuke Niwa  <rniwa@webkit.org>
2699
2700         Add :defined support
2701         https://bugs.webkit.org/show_bug.cgi?id=155108
2702
2703         Reviewed by Antti Koivisto.
2704
2705         Added :defined pseudo class which applies to a successfully instantiated custom element or a builtin element.
2706         A new node flag, isUnresolvedCustomElement, which was added in r197917 tracks un-upgraded / unresolved custom
2707         elements for which :defined should not apply.
2708
2709         Tests: fast/custom-elements/defined-pseudo-class.html
2710                fast/custom-elements/defined-rule.html
2711
2712         * bindings/js/JSCustomElementInterface.cpp:
2713         (WebCore::JSCustomElementInterface::constructElement): Unset isUnresolvedCustomElement now that HTMLElement's
2714         constructor sets isUnresolvedCustomElement.
2715         * bindings/js/JSHTMLElementCustom.cpp:
2716         (WebCore::constructJSHTMLElement): Set isUnresolvedCustomElement to true since :defined should never apply to
2717         a custom element inside its constructor as HTMLElement constructor does not set the defined flag:
2718         https://w3c.github.io/webcomponents/spec/custom/#htmlelement-constructor
2719         * css/CSSSelector.cpp:
2720         (WebCore::CSSSelector::selectorText): Added the support for serializing :defined.
2721         * css/CSSSelector.h:
2722         (PseudoClassType): Added PseudoClassDefined for :defined.
2723         * css/SelectorChecker.cpp:
2724         (WebCore::SelectorChecker::checkOne): Added the support for :defined.
2725         * css/SelectorCheckerTestFunctions.h:
2726         (WebCore::isDefinedElement): Added. Returns true for any builtin element and a custom element after a successful
2727         construction / upgrades.
2728         * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added :defined.
2729         * cssjit/SelectorCompiler.cpp:
2730         (WebCore::SelectorCompiler::addPseudoClassType): Added the support for :defined.
2731
2732 2016-03-10  Commit Queue  <commit-queue@webkit.org>
2733
2734         Unreviewed, rolling out r197943.
2735         https://bugs.webkit.org/show_bug.cgi?id=155317
2736
2737         This change broke Windows, WinCairo, GTK and EFL builds
2738         (Requested by ryanhaddad on #webkit).
2739
2740         Reverted changeset:
2741
2742         "Add a baseURL parameter to _WKUserStyleSheet"
2743         https://bugs.webkit.org/show_bug.cgi?id=155219
2744         http://trac.webkit.org/changeset/197943
2745
2746 2016-03-10  Daniel Bates  <dabates@apple.com>
2747
2748         CSP: Implement support for script and style nonces
2749         https://bugs.webkit.org/show_bug.cgi?id=116508
2750         <rdar://problem/24963980>
2751
2752         Reviewed by Brent Fulgham.
2753
2754         Add support for script-src and style-src nonces as per sections Nonce usage for script elements
2755         and Nonce usage for style elements of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2756
2757         * dom/InlineStyleSheetOwner.cpp:
2758         (WebCore::InlineStyleSheetOwner::createSheet): Check if the nonce for an HTML style element matches a known nonce.
2759         * dom/ScriptElement.cpp:
2760         (WebCore::ScriptElement::requestScript): Check if the nonce for an HTML script element for an external JavaScript
2761         script matches a known nonce. If it does then skip subsequent checks of the Content Security Policy when loading
2762         the script.
2763         (WebCore::ScriptElement::executeScript): Check if the nonce for an HTML script element for an inline JavaScript
2764         script matches a known nonce.
2765         * html/HTMLLinkElement.cpp:
2766         (WebCore::HTMLLinkElement::process): Check if the nonce for an HTML link element matches a known nonce. If it does
2767         then skip subsequent checks of the Content Security Policy when loading the stylesheet.
2768         * html/HTMLScriptElement.idl: Unconditionally expose attribute nonce.
2769         * html/HTMLStyleElement.idl: Ditto.
2770         * page/csp/ContentSecurityPolicy.cpp:
2771         (WebCore::isAllowedByAllWithNonce):
2772         (WebCore::ContentSecurityPolicy::allowScriptWithNonce): Check if the nonce attribute value of a script element
2773         matches a known nonce. This function delegates the check to ContentSecurityPolicyDirectiveList::allowScriptWithNonce().
2774         (WebCore::ContentSecurityPolicy::allowStyleWithNonce): Check if the nonce attribute value of a style/link element
2775         matches a known nonce. This function delegates the check to ContentSecurityPolicyDirectiveList::allowStyleWithNonce().
2776         * page/csp/ContentSecurityPolicy.h:
2777         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2778         (WebCore::checkNonce): Checks if the directive allows the specified nonce.
2779         (WebCore::ContentSecurityPolicyDirectiveList::allowScriptWithNonce): Check if the specified nonce is in
2780         the source list of the script-src directive (if specified) or the source list of the default-src directive (if specified).
2781         (WebCore::ContentSecurityPolicyDirectiveList::allowStyleWithNonce): Check if the specified nonce is in
2782         the source list of the style-src directive (if specified) or the source list of the default-src directive (if specified).
2783         * page/csp/ContentSecurityPolicyDirectiveList.h:
2784         * page/csp/ContentSecurityPolicySourceList.cpp:
2785         (WebCore::ContentSecurityPolicySourceList::matches): Returns whether the specified nonce is in the HashSet of
2786         nonces for the directive.
2787         (WebCore::ContentSecurityPolicySourceList::parse): Modified to call ContentSecurityPolicySourceList::parseNonceSource()
2788         to parse a nonce source expression.
2789         (WebCore::isBase64Character): Moved function to be above function ContentSecurityPolicySourceList::parseNonceSource()
2790         so that it can referenced from both ContentSecurityPolicySourceList::parseNonceSource() and ContentSecurityPolicySourceList::parseHashSource().
2791         (WebCore::isNonceCharacter): Added. Matches Blink's definition of a valid nonce character. This definition differs
2792         from the definition in the Content Security Policy Level 3 spec., <https://w3c.github.io/webappsec-csp/> (29 February 2016).
2793         (WebCore::ContentSecurityPolicySourceList::parseNonceSource): Parses a source expression for a nonce value.
2794         * page/csp/ContentSecurityPolicySourceList.h:
2795         (WebCore::ContentSecurityPolicySourceList::allowInline): We only allow inline scripts/stylesheets if
2796         'unsafe-inline' was specified in the source list and the source list does not contain any hash sources
2797         or nonce sources.
2798         * page/csp/ContentSecurityPolicySourceListDirective.cpp:
2799         (WebCore::ContentSecurityPolicySourceListDirective::allows): Checks if the specified nonce is in the source list.
2800         * page/csp/ContentSecurityPolicySourceListDirective.h:
2801
2802 2016-03-08  Sam Weinig  <sam@webkit.org>
2803
2804         Add a baseURL parameter to _WKUserStyleSheet
2805         https://bugs.webkit.org/show_bug.cgi?id=155219
2806
2807         Reviewed by Tim Horton.
2808
2809         - Moves to a model for user content where instead of each page having a WebCore::UserContentController
2810           object, we have an abstract WebCore::UserContentProvider interface that can be implemented at the WebKit
2811           level. For now, legacy WebKit continues to use the old UserContentController, which implements 
2812           WebCore::UserContentProvider, and WebKit2 implements its own implementation so it can store additional
2813           state.
2814
2815         * WebCore.xcodeproj/project.pbxproj:
2816         Add new files.
2817
2818         * dom/ExtensionStyleSheets.cpp:
2819         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
2820         Switch to using forEachUserStyleSheet on the UserContentProvider.
2821
2822         * html/HTMLMediaElement.cpp:
2823         (WebCore::HTMLMediaElement::loadResource):
2824         Remove null check now that we always have a UserContentProvider.
2825
2826         * loader/EmptyClients.cpp:
2827         (WebCore::fillWithEmptyClients):
2828         * loader/EmptyClients.h:
2829         Add new EmptyClients.
2830
2831         * loader/FrameLoader.cpp:
2832         (WebCore::FrameLoader::loadResourceSynchronously):
2833         Remove null check now that we always have a UserContentProvider.
2834
2835         * loader/PingLoader.cpp:
2836         (WebCore::processContentExtensionRulesForLoad):
2837         Remove null check now that we always have a UserContentProvider.
2838
2839         * loader/ResourceLoader.cpp:
2840         (WebCore::ResourceLoader::willSendRequestInternal):
2841         Remove null check now that we always have a UserContentProvider.
2842
2843         * loader/cache/CachedResourceLoader.cpp:
2844         (WebCore::CachedResourceLoader::requestResource):
2845         Remove null check now that we always have a UserContentProvider.
2846
2847         * page/DOMWindow.cpp:
2848         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
2849         Remove null checks now that we always have a UserContentProvider, and userMessageHandlerDescriptors
2850         returns a reference.
2851
2852         (WebCore::DOMWindow::open):
2853         Remove null check now that we always have a UserContentProvider.
2854
2855         * page/Frame.cpp:
2856         (WebCore::Frame::injectUserScripts):
2857         Simplify by lifting document check out of the main loop and using forEachUserScript.
2858
2859         * page/Page.cpp:
2860         (WebCore::Page::Page):
2861         (WebCore::Page::~Page):
2862         (WebCore::Page::userContentProvider):
2863         (WebCore::Page::setUserContentProvider):
2864         (WebCore::Page::setUserContentController): Deleted.
2865         * page/Page.h:
2866         (WebCore::Page::userContentController): Deleted.
2867         * page/PageConfiguration.h:
2868         Store the UserContentProvider in a Ref, and require PageConfigurations to provide one. This
2869         removes a bunch of null checks and simplifies the code.
2870
2871         * page/UserContentController.cpp:
2872         (WebCore::UserContentController::~UserContentController):
2873         (WebCore::UserContentController::forEachUserScript):
2874         (WebCore::UserContentController::forEachUserStyleSheet):
2875         (WebCore::UserContentController::addUserScript):
2876         (WebCore::UserContentController::removeUserScript):
2877         (WebCore::UserContentController::removeUserScripts):
2878         (WebCore::UserContentController::addUserStyleSheet):
2879         (WebCore::UserContentController::removeUserStyleSheet):
2880         (WebCore::UserContentController::removeUserStyleSheets):
2881         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
2882         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
2883         (WebCore::UserContentController::addUserContentExtension):
2884         (WebCore::UserContentController::removeUserContentExtension):
2885         (WebCore::UserContentController::removeAllUserContentExtensions):
2886         (WebCore::UserContentController::removeAllUserContent):
2887         (WebCore::UserContentController::addPage): Deleted.
2888         (WebCore::UserContentController::removePage): Deleted.
2889         (WebCore::contentExtensionsEnabled): Deleted.
2890         (WebCore::UserContentController::processContentExtensionRulesForLoad): Deleted.
2891         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
2892         * page/UserContentController.h:
2893         (WebCore::UserContentController::userScripts): Deleted.
2894         (WebCore::UserContentController::userStyleSheets): Deleted.
2895         (WebCore::UserContentController::userMessageHandlerDescriptors): Deleted.
2896         Add inheritance from UserContentProvider and simplify things by removing unique_ptrs
2897         that were holding the member variables. There is usually only one UserContentController
2898         so having these in unique_ptrs doesn't make much sense.
2899         
2900         * page/UserContentProvider.cpp: Added.
2901         (WebCore::UserContentProvider::UserContentProvider):
2902         (WebCore::UserContentProvider::~UserContentProvider):
2903         (WebCore::UserContentProvider::addPage):
2904         (WebCore::UserContentProvider::removePage):
2905         (WebCore::UserContentProvider::invalidateInjectedStyleSheetCacheInAllFramesInAllPages):
2906         (WebCore::contentExtensionsEnabled):
2907         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
2908         (WebCore::UserContentProvider::actionsForResourceLoad):
2909         * page/UserContentProvider.h: Added.
2910         Add abstract class for providing user content and add some helpers on it.
2911
2912         * page/UserMessageHandlerDescriptor.h:
2913         (WebCore::UserMessageHandlerDescriptor::create):
2914         (WebCore::UserMessageHandlerDescriptor::client):
2915         (WebCore::UserMessageHandlerDescriptor::invalidateClient):
2916         * page/UserMessageHandlersNamespace.cpp:
2917         (WebCore::UserMessageHandlersNamespace::handler):
2918         Simplify now that userContentProvider() and userMessageHandlerDescriptors() are references.
2919
2920 2016-03-10  Commit Queue  <commit-queue@webkit.org>
2921
2922         Unreviewed, rolling out r197923.
2923         https://bugs.webkit.org/show_bug.cgi?id=155301
2924
2925         Rolling out this change due to breaking the build and
2926         LayoutTests. (Requested by ryanhaddad on #webkit).
2927
2928         Reverted changeset:
2929
2930         "Font antialiasing (smoothing) changes when elements are
2931         rendered into compositing layers"
2932         https://bugs.webkit.org/show_bug.cgi?id=23364
2933         http://trac.webkit.org/changeset/197923
2934
2935 2016-03-10  Daniel Bates  <dabates@apple.com>
2936
2937         CSP: Implement support for inline script and inline style hashes
2938         https://bugs.webkit.org/show_bug.cgi?id=155007
2939         <rdar://problem/24964098>
2940
2941         Reviewed by Brent Fulgham.
2942
2943         Inspiration taken from the analogous implementation in Blink.
2944
2945         Add support for script-src and style-src hashes as per sections Hash usage for script elements
2946         and Hash usage for style elements of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/2015/CR-CSP2-20150721/>.
2947
2948         Test: http/tests/security/contentSecurityPolicy/1.1/scripthash-tests.html
2949
2950         * WebCore.xcodeproj/project.pbxproj: Add file ContentSecurityPolicyHash.h. Also sort the list of files
2951         in the group WebCore/page/csp.
2952         * dom/InlineStyleSheetOwner.cpp:
2953         (WebCore::InlineStyleSheetOwner::createSheet): Pass the content of the stylesheet when querying whether
2954         the stylesheet is allowed by the Content Security Policy.
2955         * dom/ScriptElement.cpp:
2956         (WebCore::ScriptElement::executeScript): Pass the content of the inline JavaScript script when querying
2957         whether the script is allowed by the Content Security Policy.
2958         * dom/StyledElement.cpp:
2959         (WebCore::StyledElement::styleAttributeChanged): The Content Security Policy style-src hashes do not apply
2960         to inline styles defined in the HTML style attribute. So, pass a null string (to indicate the absence of
2961         content) when querying whether the inline style is allowed by the Content Security Policy.
2962         * page/csp/ContentSecurityPolicy.cpp:
2963         (WebCore::toCryptoDigestAlgorithm): Convenience function that maps a ContentSecurityPolicyHashAlgorithm
2964         enumerator to a CryptoDigest::Algorithm enumerator.
2965         (WebCore::isAllowedByAllWithHashFromContent): Computes the digest of the specified content for each
2966         hash algorithm and checks if digest matches a hash that was specified in a policy.
2967         (WebCore::ContentSecurityPolicy::documentEncoding): Added.
2968         (WebCore::ContentSecurityPolicy::allowInlineScript): Check if the hash of the script matches a known
2969         hash if applicable. Otherwise, fall back to checking the URL of the script.
2970         (WebCore::ContentSecurityPolicy::allowInlineStyle): Check if the hash of the stylesheet matches a
2971         known hash if applicable. Otherwise, fall back to checking the URL of the stylesheet.
2972         * page/csp/ContentSecurityPolicy.h:
2973         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts): Adds the specified set of
2974         hash algorithms to the existing set of hash algorithms we know are used for inline scripts.
2975         (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets): Adds the specified set of
2976         hash algorithms to the existing set of hash algorithms we know are used for inline stylesheets.
2977         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
2978         (WebCore::checkEval): Make this a static, non-member function because it does not depend on any
2979         instance or class variables. Mark this function as inline to give a hint to the compiler that it
2980         should consider inlining the implementation of this function into the caller.
2981         (WebCore::checkInline): Ditto.
2982         (WebCore::checkSource): Ditto.
2983         (WebCore::checkHash): Checks if the directive allows content with the specified hash.
2984         (WebCore::checkMediaType): Make this a static, non-member function because it does not depend on
2985         any instance or class variables. Mark this function as inline to give a hint to the compiler that
2986         it should consider inlining the implementation of this function into the caller.
2987         (WebCore::ContentSecurityPolicyDirectiveList::create): Modified as needed now that WebCore::checkEval()
2988         is a static, non-member function.
2989         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineScriptWithHash): Added.
2990         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineStyleWithHash): Added.
2991         (WebCore::ContentSecurityPolicyDirectiveList::addDirective): Modified to pass the hash algorithms seen
2992         from parsing the directives script-src, style-src, and default-src to the ContentSecurityPolicy object.
2993         (WebCore::ContentSecurityPolicyDirectiveList::checkEval): Deleted.
2994         (WebCore::ContentSecurityPolicyDirectiveList::checkInline): Deleted.
2995         (WebCore::ContentSecurityPolicyDirectiveList::checkSource): Deleted.
2996         (WebCore::ContentSecurityPolicyDirectiveList::checkMediaType): Deleted.
2997         * page/csp/ContentSecurityPolicyDirectiveList.h:
2998         * page/csp/ContentSecurityPolicyHash.h: Added.
2999         (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::hash): Compute the hash of a digest as
3000         we would compute the hash of a string.
3001         (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::equal): Compare digests for equality
3002         by making use of Vector's equality operator.
3003         * page/csp/ContentSecurityPolicySourceList.cpp:
3004         (WebCore::ContentSecurityPolicySourceList::matches): Checks if the hash is in the set of known hashes.
3005         (WebCore::ContentSecurityPolicySourceList::parse): Modified to call ContentSecurityPolicySourceList::parseHashSource()
3006         to try to parse the source list expression as a hash source. If this fails then we try to parse the
3007         source expression as a scheme/host/port expression.
3008         (WebCore::parseHashAlgorithmAdvancingPosition): Parses the hash algorithm from a hash source expression.
3009         (WebCore::isBase64Character): Returns whether the specified character is a valid Base64/Base64url character,
3010         excluding the padding character '='. Disregarding the omission of the padding character '=', this function
3011         conforms to the ABNF grammar defined in section Source Lists of the Content Security Policy Level 3 spec.,
3012         <https://w3c.github.io/webappsec-csp> (Editor’s Draft, 29 February 2016). We take the padding character '='
3013         into account in ContentSecurityPolicySourceList::parseHashSource().
3014         (WebCore::ContentSecurityPolicySourceList::parseHashSource): Parses a hash source expression per the ABNF
3015         grammar described in section Source Lists of the Content Security Policy Level 3 spec.
3016         * page/csp/ContentSecurityPolicySourceList.h:
3017         (WebCore::ContentSecurityPolicySourceList::hashAlgorithmsUsed): Returns the set of hash algorithms seen from
3018         parsing the source list.
3019         (WebCore::ContentSecurityPolicySourceList::allowInline): We only allow inline scripts/stylesheets if
3020         'unsafe-inline' was specified in the source list and the source list does not contain any hash sources.
3021         * page/csp/ContentSecurityPolicySourceListDirective.cpp:
3022         (WebCore::ContentSecurityPolicySourceListDirective::allows): Checks if the specified hash is in the source list.
3023         * page/csp/ContentSecurityPolicySourceListDirective.h:
3024         (WebCore::ContentSecurityPolicySourceListDirective::hashAlgorithmsUsed): Turns around and calls ContentSecurityPolicySourceList::hashAlgorithmsUsed().
3025         
3026
3027 2016-03-10  Chris Dumez  <cdumez@apple.com>
3028
3029         Speculative revalidation requests do not have their 'first party for cookies' URL set
3030         https://bugs.webkit.org/show_bug.cgi?id=155284
3031         <rdar://problem/25053203>
3032
3033         Reviewed by Antti Koivisto.
3034
3035         Export a few more symbols so they can be used in WebKit2.
3036
3037         * platform/URL.h:
3038         * platform/network/ResourceRequestBase.h:
3039
3040 2016-02-22  Jer Noble  <jer.noble@apple.com>
3041
3042         Enable AVFoundationNSURLSessionEnabled by default
3043         https://bugs.webkit.org/show_bug.cgi?id=154469
3044
3045         Reviewed by Sam Weinig.
3046
3047         * page/Settings.cpp:
3048
3049 2016-03-10  Frederic Wang  <fwang@igalia.com>
3050
3051         [GTK] Add support for WOFF2
3052         https://bugs.webkit.org/show_bug.cgi?id=152616
3053
3054         Reviewed by Carlos Garcia Campos.
3055
3056         No new tests (Covered by existing tests).
3057
3058         * CMakeLists.txt: Add woff2 source to the include directory and link WebCore against brotli and woff2.
3059         * platform/graphics/WOFFFileFormat.cpp:
3060         (WebCore::isWOFF): Recognize the signature of WOFF2 font.
3061         (WebCore::convertWOFFToSfnt): If the font has the WOFF2 signature, then try and decompress it using the woff2 library.
3062         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
3063         (WebCore::FontCustomPlatformData::supportsFormat): Add woff2 to the list of supported formats.
3064
3065 2016-03-10  Manuel Rego Casasnovas  <rego@igalia.com>
3066
3067         [css-grid] Fix placement for unknown named grid lines
3068         https://bugs.webkit.org/show_bug.cgi?id=155230
3069
3070         Reviewed by Sergio Villar Senin.
3071
3072         The spec has changed and now all the implicit lines should be considered
3073         when we're resolving named grid lines with an unknown name.
3074
3075         The relevant part of the spec is
3076         (http://dev.w3.org/csswg/css-grid/#line-placement):
3077         "If a name is given as a <custom-ident>, only lines with that name
3078          are counted. If not enough lines with that name exist,
3079          all implicit grid lines are assumed to have that name
3080          for the purpose of finding this position."
3081
3082         Modified the code to resolve named grid lines in GridResolvedPosition.
3083         We need to keep the old behavior of considering "auto" unknown named
3084         grid lines for the case of positioned grid items.
3085
3086         Test: fast/css-grid-layout/grid-item-unknown-named-grid-line-resolution.html
3087
3088         * rendering/style/GridResolvedPosition.cpp:
3089         (WebCore::adjustGridPositionsFromStyle):
3090         (WebCore::lookAheadForNamedGridLine):
3091         (WebCore::lookBackForNamedGridLine):
3092         (WebCore::resolveNamedGridLinePositionFromStyle):
3093         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
3094         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
3095         (WebCore::resolveGridPositionAgainstOppositePosition):
3096         (WebCore::resolveGridPositionFromStyle):
3097
3098 2016-03-10  Eric Carlson  <eric.carlson@apple.com>
3099
3100         [MediaStream] push media stream state to the UI process
3101         https://bugs.webkit.org/show_bug.cgi?id=155281
3102
3103         Reviewed by Darin Adler.
3104
3105         * Modules/mediastream/MediaStream.cpp:
3106         (WebCore::MediaStream::MediaStream): Register with the document as an audio producer.
3107         (WebCore::MediaStream::~MediaStream): Unregister.
3108         (WebCore::MediaStream::setIsActive): Update document status.
3109         (WebCore::MediaStream::pageMutedStateDidChange): Mute/unmute according to the page mute setting.
3110         (WebCore::MediaStream::mediaState): Return state.
3111         (WebCore::MediaStream::statusDidChange): Call document.updateIsPlayingMedia.
3112         (WebCore::MediaStream::characteristicsChanged): Track stream mute state.
3113         (WebCore::MediaStream::scheduleActiveStateChange): m_isActive -> m_active.
3114         * Modules/mediastream/MediaStream.h:
3115
3116         * page/MediaProducer.h: Add HasActiveMediaCaptureDevice.
3117
3118         * platform/mediastream/MediaStreamPrivate.cpp:
3119         (WebCore::MediaStreamPrivate::hasVideo): Make const.
3120         (WebCore::MediaStreamPrivate::hasAudio): Ditto.
3121         (WebCore::MediaStreamPrivate::muted): New.
3122         * platform/mediastream/MediaStreamPrivate.h:
3123
3124         * platform/mediastream/mac/AVMediaCaptureSource.mm:
3125         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initialize muted to true.
3126         (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange): Set muted.
3127
3128 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
3129
3130         Extract EventPath.h/cpp out of EventDispatcher.cpp
3131         https://bugs.webkit.org/show_bug.cgi?id=155285
3132
3133         Reviewed by Chris Dumez.
3134
3135         Extracted EventPath.h/cpp out of EventDispatcher.cpp to add the support for Event.deepPath()
3136         in webkit.org/b/153538. The new file defines member functions of EventPath and RelatedNodeRetargeter.
3137
3138         * CMakeLists.txt:
3139         * WebCore.xcodeproj/project.pbxproj:
3140         * dom/DOMAllInOne.cpp:
3141         * dom/EventDispatcher.cpp:
3142         (WebCore::EventDispatcher::dispatchScopedEvent):
3143         (WebCore::EventDispatcher::dispatchEvent):
3144         (WebCore::EventPath): Moved to EventPath.cpp.
3145         (WebCore::eventTargetRespectingTargetRules): Moved to EventPath.h.
3146         (WebCore::shouldEventCrossShadowBoundary): Moved to EventPath.cpp.
3147         (WebCore::nodeOrHostIfPseudoElement): Ditto.
3148         (WebCore::RelatedNodeRetargeter): Moved to EventPath.cpp.
3149         * dom/EventPath.cpp: Added.
3150         (WebCore::shouldEventCrossShadowBoundary): Moved from EventDispatcher.cpp.
3151         (WebCore::nodeOrHostIfPseudoElement): Ditto.
3152         (WebCore::EventPath::EventPath): Ditto.
3153         (WebCore::RelatedNodeRetargeter): Ditto.
3154         * dom/EventPath.h: Added.
3155         (WebCore::EventPath::isEmpty):
3156         (WebCore::EventPath::size):
3157         (WebCore::EventPath::contextAt):
3158         (WebCore::EventPath::lastContextIfExists):
3159         (WebCore::EventPath::eventTargetRespectingTargetRules): Moved from EventDispatcher.cpp.
3160
3161 2016-03-09  Simon Fraser  <simon.fraser@apple.com>
3162
3163         Font antialiasing (smoothing) changes when elements are rendered into compositing layers
3164         https://bugs.webkit.org/show_bug.cgi?id=23364
3165         rdar://problem/7288429
3166
3167         Reviewed by Tim Horton.
3168
3169         Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
3170         by opting in to a new CALayer backing store format.
3171         
3172         GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
3173         when the platform has support for the new feature. Ideally this would only be set when
3174         we know a layer has smoothed text drawn into it, but, for now, enable this for all
3175         layers. The right thing happens with opaque layers under the hood.
3176         
3177         setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
3178         is ultimately passed to setBackingStoreFormat().
3179         
3180         We also need to propagate this flag to TileController tiles.
3181
3182         * platform/graphics/GraphicsLayer.cpp:
3183         (WebCore::GraphicsLayer::supportsSmoothedFontsInNonOpaqueLayers):
3184         (WebCore::GraphicsLayer::GraphicsLayer):
3185         * platform/graphics/GraphicsLayer.h:
3186         (WebCore::GraphicsLayer::supportsSmoothedFonts):
3187         (WebCore::GraphicsLayer::setSupportsSmoothedFonts):
3188         * platform/graphics/TiledBacking.h:
3189         * platform/graphics/ca/GraphicsLayerCA.cpp:
3190         (WebCore::GraphicsLayer::supportsSmoothedFontsInNonOpaqueLayers):
3191         (WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
3192         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3193         (WebCore::GraphicsLayerCA::updateContentsFormat):
3194         * platform/graphics/ca/GraphicsLayerCA.h:
3195         * platform/graphics/ca/PlatformCALayer.cpp:
3196         (WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
3197         the contents format says we support smoothed fonts.
3198         * platform/graphics/ca/PlatformCALayer.h:
3199         * platform/graphics/ca/TileController.cpp:
3200         (WebCore::TileController::setTileContentsFormatFlags):
3201         (WebCore::TileController::createTileLayer):
3202         * platform/graphics/ca/TileController.h:
3203         * platform/graphics/ca/TileGrid.cpp:
3204         (WebCore::TileGrid::updateTileLayerProperties):
3205         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
3206         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3207         (WebCore::setBackingStoreFormat):
3208         (PlatformCALayerCocoa::commonInit):
3209         (PlatformCALayerCocoa::setContentsFormat):
3210         (PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
3211         non-opaque layers to improve text appearance. We no longer need to do that when
3212         the contents format has "SmoothedFonts".
3213         * platform/ios/LegacyTileGridTile.mm:
3214         (WebCore::setBackingStoreFormat):
3215         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
3216         * rendering/RenderLayerBacking.cpp:
3217         (WebCore::RenderLayerBacking::createGraphicsLayer):
3218
3219 2016-03-09  Gavin Barraclough  <barraclough@apple.com>
3220
3221         WebKit should adopt journal_mode=wal for all SQLite databases.
3222         https://bugs.webkit.org/show_bug.cgi?id=133496
3223
3224         Reviewed by Brady Eidson & Darin Adler.
3225
3226         The statement intended to enable WAL mode is always failing because it is missing a
3227         prepare(). Fix this. We were also previously permitting SQLITE_OK results - this
3228         was in error (we were only getting these because stepping the unprepared statement
3229         returned SQLITE_OK). Also set the SQLITE_OPEN_AUTOPROXY flag when opening the
3230         database - this will improve perfomance when the database is accessed via an AFP
3231         mount.
3232
3233         * platform/sql/SQLiteDatabase.cpp:
3234         (WebCore::SQLiteDatabase::open):
3235             - call prepareAndStep(), only check for SQLITE_ROW result.
3236         * platform/sql/SQLiteFileSystem.cpp:
3237         (WebCore::SQLiteFileSystem::openDatabase):
3238             - should set SQLITE_OPEN_AUTOPROXY flag when opening database.
3239
3240 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
3241
3242         Add runtime flags for shadow DOM and custom elements
3243         https://bugs.webkit.org/show_bug.cgi?id=155213
3244
3245         Reviewed by Dean Jackson.
3246
3247         Added new runtime flags for shadow DOM and custom elements.
3248
3249         * bindings/generic/RuntimeEnabledFeatures.h:
3250         (WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled): Added.
3251         (WebCore::RuntimeEnabledFeatures::shadowDOMEnabled): Added.
3252         (WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled): Added.
3253         (WebCore::RuntimeEnabledFeatures::customElementsEnabled): Added.
3254         * dom/Document.idl:
3255         * dom/Element.idl:
3256         * dom/Node.idl:
3257         * dom/NonDocumentTypeChildNode.idl:
3258         * dom/ShadowRoot.idl:
3259         * html/HTMLSlotElement.idl:
3260
3261 2016-03-09  Ryosuke Niwa  <rniwa@webkit.org>
3262
3263         defineElement should upgrade existing unresolved custom elements
3264         https://bugs.webkit.org/show_bug.cgi?id=155107
3265
3266         Reviewed by Darin Adler.
3267
3268         Added the support for upgrading existing unresolved custom elements when defineElement is called.
3269
3270         The current implementation upgrades elements in the order they were created and has the issue that
3271         it keeps accumulating all elements with a hyphen in its name until defineElement is called as
3272         documented in https://github.com/w3c/webcomponents/issues/419
3273
3274         This patch re-purposes IsEditingTextFlag to indicate that the node is an unresolved custom element.
3275         Since isEditingText() is only called in textRendererIsNeeded only on Text nodes, it's mutually
3276         exclusive with isUnresolvedCustomElement().
3277
3278         The list of unresolved custom elements is kept in m_upgradeCandidatesMap, a hash map of element names
3279         to the list of unresolved elements with that name.
3280
3281         In addition, added the logic to use HTMLElement as the interface for unresolved custom element instead
3282         of HTMLUnknownElement.
3283
3284         Test: fast/custom-elements/upgrading/upgrading-parser-created-element.html
3285
3286         * bindings/js/JSCustomElementInterface.cpp:
3287         (WebCore::JSCustomElementInterface::upgradeElement): Clear the flag.
3288         * bindings/js/JSDocumentCustom.cpp:
3289         (WebCore::JSDocument::defineElement): Set the unique private name to keep the interface alive before
3290         calling addElementDefinition as the call can now invoke author scripts.
3291         * dom/CustomElementDefinitions.cpp:
3292         (WebCore::CustomElementDefinitions::addElementDefinition): Upgrade existing unresolved elements kept
3293         in m_upgradeCandidatesMap.
3294         (WebCore::CustomElementDefinitions::addUpgradeCandidate): Added.
3295         * dom/CustomElementDefinitions.h:
3296         * dom/Document.cpp:
3297         (WebCore::createHTMLElementWithNameValidation): Added the code to add the unresolved custom elements
3298         to the upgrade candidates map. Also instantiate it as HTMLElement instead of HTMLUnknownElement.
3299         (WebCore::createFallbackHTMLElement): Ditto.
3300         * dom/Node.h:
3301         (WebCore::Node::setIsCustomElement):
3302         (WebCore::Node::isUnresolvedCustomElement): Added.
3303         (WebCore::Node::setIsUnresolvedCustomElement): Added.
3304         (WebCore::Node::setCustomElementIsResolved): Added. Clears IsEditingTextOrUnresolvedCustomElementFlag
3305         and sets IsCustomElement.
3306         (WebCore::Node::isEditingText): Check both IsEditingTextOrUnresolvedCustomElementFlag and IsTextFlag
3307         for safety even though it's currently only used in textRendererIsNeeded which takes Text&.
3308         * dom/make_names.pl:
3309         (defaultParametersHash): Added customElementInterfaceName as a parameter.
3310         (printWrapperFactoryCppFile): Generate the code to use customElementInterfaceName when the element
3311         for which the wrapper is created has isUnresolvedCustomElement flag set.
3312         * html/HTMLTagNames.in: Use HTMLElement for unresolved custom elements.
3313         * html/parser/HTMLConstructionSite.cpp:
3314         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Added the code to add
3315         the unresolved custom elements to the upgrade candidates map. Also instantiate it as HTMLElement instead
3316         of HTMLUnknownElement. 
3317
3318 2016-03-09  Enrica Casucci  <enrica@apple.com>
3319
3320         Retrieve additional context for some data detector link for preview and action menu.
3321         https://bugs.webkit.org/show_bug.cgi?id=155278
3322         rdar://problem/24884951
3323
3324         Reviewed by Tim Horton.
3325
3326         Adding helper function to compute a range by moving by a number of characters
3327         from a given position and direction.
3328         Adding function to check if the given data detector link element requires
3329         an extended context.
3330
3331         * editing/VisibleUnits.cpp:
3332         (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
3333         * editing/VisibleUnits.h:
3334         * editing/cocoa/DataDetection.h:
3335         * editing/cocoa/DataDetection.mm:
3336         (WebCore::DataDetection::requiresExtendedContext):
3337
3338 2016-03-09  Daniel Bates  <dabates@apple.com>
3339
3340         Fix the Windows build after <https://trac.webkit.org/changeset/197905>
3341         (https://bugs.webkit.org/show_bug.cgi?id=155247)
3342
3343         We need to call the std::unique_ptr<CryptoDigest>() constructor directly
3344         instead of using the convenience function std::make_unique<CryptoDigest>()
3345         because std::make_unique<CryptoDigest>() cannot access the private constructor
3346         CryptoDigest().
3347
3348         * platform/crypto/win/CryptoDigestWin.cpp:
3349         (WebCore::CryptoDigest::create):
3350
3351 2016-03-09  Daniel Bates  <dabates@apple.com>
3352
3353         [Win] Implement CryptoDigest
3354         https://bugs.webkit.org/show_bug.cgi?id=155247
3355         <rdar://problem/25065843>
3356
3357         Reviewed by Brent Fulgham.