60894feb9f26a4865f99289bd036da3bbf7254e1
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
2
3         [Mac][cmake] Unreviewed speculative buildfix after r197956. Just for fun.
4
5         * PlatformMac.cmake:
6
7 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
8
9         [Mac][cmake] Unreviewed speculative buildfix after r197628. Just for fun.
10
11         * PlatformMac.cmake:
12
13 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
14
15         [Mac][cmake] One more attempt to try to fix the build after r197633.
16
17         * PlatformMac.cmake:
18
19 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
20
21         [Mac][cmake] One more attempt to try to fix the build after r197633.
22
23         * PlatformMac.cmake:
24
25 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
26
27         [Mac][cmake] One more attempt to try to fix the build after r197633.
28
29         * PlatformMac.cmake: Revert r198398, which was incorrect.
30
31 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
32
33         [Mac][cmake] Last attempt to try to fix the build after r197633.
34
35         * PlatformMac.cmake:
36
37 2016-03-18  Manuel Rego Casasnovas  <rego@igalia.com>
38
39         [css-grid] Rename GridSpan properties
40         https://bugs.webkit.org/show_bug.cgi?id=155636
41
42         Reviewed by Sergio Villar Senin.
43
44         GridSpan was using old names initialResolvedPosition and
45         finalResolvedPosition.
46         This patch rename them to startLine and endLine.
47
48         Some reasons for this refactoring:
49         - "position" is a vague term not defined in the spec.
50         - GridSpan is currently storing grid lines. A grid "line" is defined
51           in the spec: https://drafts.csswg.org/css-grid/#grid-line-concept
52         - The spec uses the concepts "start" and "end" lines too.
53
54         No new tests, no change of behavior.
55
56         * css/CSSGridTemplateAreasValue.cpp:
57         (WebCore::stringForPosition):
58         * css/CSSParser.cpp:
59         (WebCore::CSSParser::parseGridTemplateAreasRow):
60         * css/StyleBuilderConverter.h:
61         (WebCore::StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea):
62         * rendering/RenderGrid.cpp:
63         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
64         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
65         (WebCore::RenderGrid::insertItemIntoGrid):
66         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
67         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
68         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
69         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
70         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
71         (WebCore::RenderGrid::columnAxisOffsetForChild):
72         (WebCore::RenderGrid::rowAxisOffsetForChild):
73         * rendering/style/GridArea.h:
74         (WebCore::GridSpan::untranslatedDefiniteGridSpan):
75         (WebCore::GridSpan::translatedDefiniteGridSpan):
76         (WebCore::GridSpan::operator==):
77         (WebCore::GridSpan::integerSpan):
78         (WebCore::GridSpan::untranslatedStartLine):
79         (WebCore::GridSpan::untranslatedEndLine):
80         (WebCore::GridSpan::startLine):
81         (WebCore::GridSpan::endLine):
82         (WebCore::GridSpan::begin):
83         (WebCore::GridSpan::end):
84         (WebCore::GridSpan::translate):
85         (WebCore::GridSpan::GridSpan):
86         (WebCore::GridSpan::untranslatedResolvedInitialPosition): Deleted.
87         (WebCore::GridSpan::untranslatedResolvedFinalPosition): Deleted.
88         (WebCore::GridSpan::resolvedInitialPosition): Deleted.
89         (WebCore::GridSpan::resolvedFinalPosition): Deleted.
90         * rendering/style/GridPositionsResolver.cpp:
91         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
92         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
93         (WebCore::resolveGridPositionAgainstOppositePosition):
94         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
95
96 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
97
98         [Mac][cmake] One more unreviewed speculative buildfix after r197633. Just for fun.
99
100         * PlatformMac.cmake:
101
102 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
103
104         [Mac][cmake] Unreviewed speculative buildfix after r197633. Just for fun.
105
106         * PlatformMac.cmake:
107
108 2016-03-18  Youenn Fablet  <youenn.fablet@crf.canon.fr>
109
110         crossorigin element resource loading should check HTTP redirection
111         https://bugs.webkit.org/show_bug.cgi?id=130578
112
113         Reviewed by Daniel Bates and Brent Fulgham.
114
115         Moved part of DocumentThreadableLoader redirection cross origin control code
116         into functions in CrossOriginAccessControl.cpp. Added cross origin control for
117         redirections in SubResourceLoader when policy is set to PotentiallyCrossOriginEnabled 
118         using CrossOriginAccessControl.cpp new functions. Added a new test that checks that 
119         cross-origin redirections are checked against CORS.
120
121         Test: http/tests/security/shape-image-cors-redirect.html
122
123         * loader/CrossOriginAccessControl.cpp:
124         (WebCore::isValidCrossOriginRedirectionURL): Returns true if the redirected URL is a valid URL for cross-origin requests.
125         (WebCore::cleanRedirectedRequestForAccessControl): Removes all headers added by the network backend that may cause the response CORS validation to fail.
126         * loader/CrossOriginAccessControl.h: Added above function prototypes.
127         * loader/DocumentThreadableLoader.cpp:
128         (WebCore::DocumentThreadableLoader::redirectReceived): Used new CORS redirection methods of CrossOriginAccessControl.cpp.
129         * loader/SubresourceLoader.cpp:
130         (WebCore::SubresourceLoader::init): Initialize the SecurityOrigin to be used for loading the resource.
131         (WebCore::SubresourceLoader::willSendRequest): Added cross-origin redirection response check.
132         (WebCore::SubresourceLoader::checkCrossOriginAccessControl): Checks CORS and update request if needed. Returns true if control checks passed.
133         * loader/SubresourceLoader.h: Added checkCrossOriginAccessControl declaration and m_origin declaration.
134
135 2016-03-18  Darin Adler  <darin@apple.com>
136
137         Disable Caches in Safari's Develop menu does not disable caches.
138         https://bugs.webkit.org/show_bug.cgi?id=64483
139
140         Reviewed by Antti Koivisto.
141
142         Add a new setting, ResourceCachingDisabled, for use in future versions of Safari.
143
144         * history/PageCache.cpp:
145         (WebCore::canCachePage): Check resourceCachingDisabled and return false.
146         (WebCore::PageCache::take): Check resourceCachingDisabled, and return null.
147         (WebCore::PageCache::get): Ditto.
148
149         * loader/FrameLoader.cpp:
150         (WebCore::FrameLoader::subresourceCachePolicy): Check resourceCachingDisabled, and
151         request a reload.
152         (WebCore::FrameLoader::addExtraFieldsToRequest): Check resourceCachingDisabled, and
153         set the cache policy to trigger a reload.
154         * loader/cache/CachedResourceLoader.cpp:
155         (WebCore::CachedResourceLoader::cachePolicy): Check resourceCachingDisabled, and
156         request a reload.
157
158         * page/Settings.in: Added resourceCachingDisabled.
159
160 2016-03-18  Csaba Osztrogonác  <ossy@webkit.org>
161
162         [Mac][cmake] Unreviewed speculative buildfix. Just for fun.
163
164         * loader/EmptyClients.cpp:
165
166 2016-03-17  Antti Koivisto  <antti@apple.com>
167
168         Data URL DecodeTask may get deleted outside main thread
169         https://bugs.webkit.org/show_bug.cgi?id=155584
170         rdar://problem/24492104
171
172         Reviewed by Darin Adler.
173
174         This is unsafe as it owns strings and other types that are only safe to delete in the main thread.
175
176         There is a race between deref in dispatch() and deref in timerFired(). If the timer fires before dispatch()
177         exits the implicit deref will trigger deletion of DecodingResultDispatcher in the dispatching thread.
178
179         (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
180
181             Fix by clearing m_decodeTask when the timer fires.
182
183 2016-03-17  Carlos Garcia Campos  <cgarcia@igalia.com>
184
185         REGRESSION(r195661): [GTK] very slow scrolling
186         https://bugs.webkit.org/show_bug.cgi?id=155334
187
188         Reviewed by Michael Catanzaro.
189
190         We need to also restore the PerAxisData visible length when it's
191         reset because of a non animated scroll. To prevent making the same
192         mistake in the future, the current position and visible lengths
193         members are now required to construct PerAxisData. This also
194         simplifies the code and ensures that when the ScrollAnimatorSmooth
195         is created, it's updated to the current position.
196
197         * platform/ScrollAnimationSmooth.cpp:
198         (WebCore::ScrollAnimationSmooth::ScrollAnimationSmooth):
199         Initialize PerAxisData members.
200         (WebCore::ScrollAnimationSmooth::setCurrentPosition): Pass the
201         current position and visible length as parameters to the
202         PerAxisData constructor.
203         (WebCore::ScrollAnimationSmooth::animateScroll): Ditto.
204         * platform/ScrollAnimationSmooth.h: Add a PerAxisData constructor
205         that receives current position and visible length and disallow to
206         use the default constructor.
207         * platform/ScrollAnimatorSmooth.cpp:
208         (WebCore::ScrollAnimatorSmooth::ScrollAnimatorSmooth): Pass the
209         current position to the ScrollAnimationSmooth constructor.
210         * platform/gtk/ScrollAnimatorGtk.cpp:
211         (WebCore::ScrollAnimatorGtk::ensureSmoothScrollingAnimation): Ditto.
212
213 2016-03-17  Chris Fleizach  <cfleizach@apple.com>
214
215         AX: WEB: VoiceOver does not announce some WAI-ARIA document structures
216         https://bugs.webkit.org/show_bug.cgi?id=155603
217         <rdar://problem/25227385>
218
219         Reviewed by Darin Adler.
220
221         Expose more ARIA landmark type roles on iOS for accessibility.
222
223         Updated test: accessibility/ios-simulator/landmark-type.html
224
225         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
226         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
227         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
228         * platform/LocalizedStrings.cpp:
229         (WebCore::searchMenuClearRecentSearchesText):
230         (WebCore::AXWebAreaText):
231         (WebCore::AXListItemActionVerb):
232         (WebCore::AXAutoFillCredentialsLabel):
233         * platform/LocalizedStrings.h:
234
235 2016-03-17  Daniel Bates  <dabates@apple.com>
236
237         Cleanup: Remove the need to pass reporting status to ContentSecurityPolicy functions
238         https://bugs.webkit.org/show_bug.cgi?id=155623
239
240         Reviewed by Andy Estes and Alex Christensen.
241
242         ScriptController::initScript() is the only function that passes ContentSecurityPolicy::ReportingStatus::SuppressReport
243         following the removal of the SecurityPolicy script interface in <http://trac.webkit.org/changeset/197142>. It
244         passes this reporting status to prevent sending a violation report when determining whether the CSP policy allows
245         use of the JavaScript eval()/operator eval so that it enable or disable this capability as appropriate. We
246         should teach ScriptController::initScript() to delegate the responsibility of enabling/disabling this capability
247         to the ContentSecurityPolicy. Then we can remove the need to expose ContentSecurityPolicy::ReportingStatus as
248         part of the ContentSecurityPolicy interface.
249
250         No functionality changed. So, no new tests.
251
252         * bindings/js/ScriptController.cpp:
253         (WebCore::ScriptController::createWindowShell): Return a reference to a JSDOMWindowShell object
254         instead of a pointer as the pointer is always non-null.
255         (WebCore::ScriptController::initScript): Updated as needed now that ScriptController::createWindowShell()
256         returns a reference. Moved logic to enable/disable JavaScript eval() and operator eval from here into
257         ContentSecurityPolicy::didCreateWindowShell() and make use of this member function.
258         * bindings/js/ScriptController.h:
259         * page/csp/ContentSecurityPolicy.cpp:
260         (WebCore::ContentSecurityPolicy::didCreateWindowShell): Added. Moved logic from to enable/disable JavaScript
261         eval() and operator eval from ScriptController::initScript() to here.
262         (WebCore::ContentSecurityPolicy::didReceiveHeader): Substitute ContentSecurityPolicyDirectiveList::ReportingStatus::SuppressReport
263         for ContentSecurityPolicy::ReportingStatus::SuppressReport as the enum has moved from class ContentSecurityPolicy
264         to ContentSecurityPolicyDirectiveList. Fix minor code style nit; substitute nullptr for 0 in the first argument
265         to ContentSecurityPolicyDirectiveList::allowEval().
266         (WebCore::isAllowedByAllWithFrame): Substitute ContentSecurityPolicyDirectiveList::ReportingStatus::SuppressReport
267         for ContentSecurityPolicy::ReportingStatus::SuppressReport as the enum has moved from class ContentSecurityPolicy
268         to ContentSecurityPolicyDirectiveList.
269         (WebCore::isAllowedByAll): Substitute ContentSecurityPolicyDirectiveList::ReportingStatus::SuppressReport
270         for ContentSecurityPolicy::ReportingStatus::SuppressReport as the enum has moved from class ContentSecurityPolicy
271         to ContentSecurityPolicyDirectiveList. Also make this function static so that it has internal linkage.
272         (WebCore::isAllowedByAllWithState): Ditto.
273         (WebCore::isAllowedByAllWithContext): Ditto.
274         (WebCore::isAllowedByAllWithHashFromContent): Ditto.
275         (WebCore::isAllowedByAllWithURL): Ditto.
276         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs): Remove argument reportingStatus and always pass
277         ContentSecurityPolicyDirectiveList::ReportingStatus::SendReport to the directive list member function. In a
278         subsequent patch we will remove the need to pass the reporting status to the directive list member function.
279         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers): Ditto.
280         (WebCore::ContentSecurityPolicy::allowInlineScript): Ditto.
281         (WebCore::ContentSecurityPolicy::allowInlineStyle): Ditto.
282         (WebCore::ContentSecurityPolicy::allowEval): Ditto.
283         (WebCore::ContentSecurityPolicy::allowFrameAncestors): Ditto.
284         (WebCore::ContentSecurityPolicy::allowPluginType): Ditto.
285         (WebCore::ContentSecurityPolicy::allowScriptFromSource): Ditto.
286         (WebCore::ContentSecurityPolicy::allowObjectFromSource): Ditto.
287         (WebCore::ContentSecurityPolicy::allowChildFrameFromSource): Ditto.
288         (WebCore::ContentSecurityPolicy::allowChildContextFromSource): Ditto.
289         (WebCore::ContentSecurityPolicy::allowImageFromSource): Ditto.
290         (WebCore::ContentSecurityPolicy::allowStyleFromSource): Ditto.
291         (WebCore::ContentSecurityPolicy::allowFontFromSource): Ditto.
292         (WebCore::ContentSecurityPolicy::allowMediaFromSource): Ditto.
293         (WebCore::ContentSecurityPolicy::allowConnectToSource): Ditto.
294         (WebCore::ContentSecurityPolicy::allowFormAction): Ditto.
295         (WebCore::ContentSecurityPolicy::allowBaseURI): Ditto.
296         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage): Deleted.
297         * page/csp/ContentSecurityPolicy.h:
298         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
299         (WebCore::ContentSecurityPolicyDirectiveList::allowJavaScriptURLs): Substitute ReportingStatus for
300         ContentSecurityPolicy::ReportingStatus as the enum has moved from class ContentSecurityPolicy to this class.
301         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineEventHandlers): Ditto.
302         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineScript): Ditto.
303         (WebCore::ContentSecurityPolicyDirectiveList::allowInlineStyle): Ditto.
304         (WebCore::ContentSecurityPolicyDirectiveList::allowEval): Ditto.
305         (WebCore::ContentSecurityPolicyDirectiveList::allowPluginType): Ditto.
306         (WebCore::ContentSecurityPolicyDirectiveList::allowScriptFromSource): Ditto.
307         (WebCore::ContentSecurityPolicyDirectiveList::allowObjectFromSource): Ditto.
308         (WebCore::ContentSecurityPolicyDirectiveList::allowChildContextFromSource): Ditto.
309         (WebCore::ContentSecurityPolicyDirectiveList::allowChildFrameFromSource): Ditto.
310         (WebCore::ContentSecurityPolicyDirectiveList::allowImageFromSource): Ditto.
311         (WebCore::ContentSecurityPolicyDirectiveList::allowStyleFromSource): Ditto.
312         (WebCore::ContentSecurityPolicyDirectiveList::allowFontFromSource): Ditto.
313         (WebCore::ContentSecurityPolicyDirectiveList::allowMediaFromSource): Ditto.
314         (WebCore::ContentSecurityPolicyDirectiveList::allowConnectToSource): Ditto.
315         (WebCore::ContentSecurityPolicyDirectiveList::allowFormAction): Ditto.
316         (WebCore::ContentSecurityPolicyDirectiveList::allowBaseURI): Ditto.
317         (WebCore::ContentSecurityPolicyDirectiveList::allowFrameAncestors): Ditto.
318         * page/csp/ContentSecurityPolicyDirectiveList.h:
319
320 2016-03-17  Brent Fulgham  <bfulgham@apple.com>
321
322         [XSS Auditor] Off by one in XSSAuditor::canonicalizedSnippetForJavaScript()
323         https://bugs.webkit.org/show_bug.cgi?id=155624
324         <rdar://problem/25219962>
325
326         Unreviewed merge from Blink (patch by Tom Sepez <tsepez@chromium.org>):
327         <https://src.chromium.org/viewvc/blink?revision=201803&view=revision>
328
329         Test: http/tests/security/xssAuditor/script-tag-with-trailing-script-and-urlencode.html
330
331         * html/parser/XSSAuditor.cpp:
332         (WebCore::XSSAuditor::canonicalizedSnippetForJavaScript): Correct off-by-one error.
333
334 2016-03-17  Zalan Bujtas  <zalan@apple.com>
335
336         Images in feed on ebay.com jiggle when one is hovered
337         https://bugs.webkit.org/show_bug.cgi?id=155608
338         <rdar://problem/25160681>
339
340         The content offset in compositing layer = subpixel gap between the graphics layer and the layer bounds + layer bounds top left.
341
342         Reviewed by Simon Fraser.
343
344         Test: compositing/hidpi-viewport-clipping-on-composited-content.html
345
346         * rendering/RenderLayerBacking.cpp:
347         (WebCore::RenderLayerBacking::updateGeometry):
348         (WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
349         * rendering/RenderLayerBacking.h:
350
351 2016-03-17  Zalan Bujtas  <zalan@apple.com>
352
353         Don't initiate a style recall while drawing text 
354         https://bugs.webkit.org/show_bug.cgi?id=155618
355
356         Reviewed by Simon Fraser.
357
358         This patch ensures that we don't initiate a style recalc while in the middle of text drawing.
359
360         Test: fast/canvas/crash-while-resizing-canvas.html
361
362         * html/canvas/CanvasRenderingContext2D.cpp:
363         (WebCore::CanvasRenderingContext2D::drawTextInternal):
364
365 2016-03-17  Commit Queue  <commit-queue@webkit.org>
366
367         Unreviewed, rolling out r198335.
368         https://bugs.webkit.org/show_bug.cgi?id=155617
369
370         This change caused existing LayoutTests to crash
371         intermittently (Requested by ryan|afk on #webkit).
372
373         Reverted changeset:
374
375         "DataURLDecoder::DecodingResultDispatcher may get deleted
376         outside main thread"
377         https://bugs.webkit.org/show_bug.cgi?id=155584
378         http://trac.webkit.org/changeset/198335
379
380 2016-03-17  Eric Carlson  <eric.carlson@apple.com>
381
382         Improve some metadata tests
383         https://bugs.webkit.org/show_bug.cgi?id=155616
384
385         Reviewed by Saam Barati.
386
387         * html/track/DataCue.cpp:
388         (WebCore::DataCue::DataCue):
389         (WebCore::DataCue::setData):
390
391 2016-03-17  Myles C. Maxfield  <mmaxfield@apple.com>
392
393         [RTL Scrollbars] Position: absolute divs are covered by vertical scrollbar
394         https://bugs.webkit.org/show_bug.cgi?id=155531
395
396         Reviewed by Darin Adler.
397
398         This patch updates ScrollView::documentScrollPositionRelativeToViewOrigin(), which is
399         a helper function primarily used by WebCore::ScrollView::viewToContents() and
400         WebCore::ScrollView::contentsToView().
401
402         Tests: fast/scrolling/rtl-scrollbars-elementFromPoint-static.html
403                fast/scrolling/rtl-scrollbars-elementFromPoint.html
404                fast/scrolling/rtl-scrollbars-iframe-offset.html
405                fast/scrolling/rtl-scrollbars-iframe-position-absolute.html
406                fast/scrolling/rtl-scrollbars-iframe-scrolled.html
407                fast/scrolling/rtl-scrollbars-iframe.html
408                fast/scrolling/rtl-scrollbars-overflow-elementFromPoint.html
409                fast/scrolling/rtl-scrollbars-overflow-position-absolute.html
410                fast/scrolling/rtl-scrollbars-overflow-text-selection-scrolled.html
411                fast/scrolling/rtl-scrollbars-position-absolute.html
412                fast/scrolling/rtl-scrollbars-position-fixed.html
413                fast/scrolling/rtl-scrollbars-text-selection-scrolled.html
414                fast/scrolling/rtl-scrollbars-text-selection.html
415
416         * platform/ScrollView.cpp:
417         (WebCore::ScrollView::documentScrollPositionRelativeToViewOrigin):
418
419 2016-03-17  Filip Pizlo  <fpizlo@apple.com>
420
421         Replace all of the various non-working and non-compiling sampling profiler hacks with a single super hack
422         https://bugs.webkit.org/show_bug.cgi?id=155561
423
424         Reviewed by Saam Barati.
425
426         No new tests because no new behavior.
427
428         * platform/audio/ios/MediaSessionManagerIOS.mm:
429         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
430
431 2016-03-17  Brent Fulgham  <bfulgham@apple.com>
432
433         Some media tests are flaky.
434         https://bugs.webkit.org/show_bug.cgi?id=155614
435
436         Reviewed by Eric Carlson.
437
438         * html/track/TextTrack.cpp:
439         (WebCore::TextTrack::~TextTrack):
440
441 2016-03-17  Brady Eidson  <beidson@apple.com>
442
443         Don't try to restore deleted MemoryIndexes if their owning object store is not restored.
444         https://bugs.webkit.org/show_bug.cgi?id=155068
445
446         Reviewed by Alex Christensen.
447
448         Test: storage/indexeddb/modern/deleteindex-4-private.html
449
450         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
451         (WebCore::IDBServer::MemoryBackingStoreTransaction::indexDeleted):
452
453 2016-03-17  Doug Russell  <d_russell@apple.com>
454
455         AX: attributes to retrieve focusable and editable ancestors
456         https://bugs.webkit.org/show_bug.cgi?id=155554
457
458         Reviewed by Chris Fleizach.
459
460         Add attributes to help give context to focus changes:
461         AXFocusableAncestor - nearest accessibility ancestor that returns true for
462         canSetFocusAttribute().
463         AXEditableAncestor - nearest accessibility ancestor that returns true for
464         isTextControl().
465         AXHighestEditableAncestor - highest element in accessibility that returns true
466         for isTextControl().
467
468         Test: accessibility/mac/ancestor-attributes.html
469
470         * accessibility/AccessibilityNodeObject.cpp:
471         * accessibility/AccessibilityObject.cpp:
472         (WebCore::AccessibilityObject::focusableAncestor):
473         (WebCore::AccessibilityObject::editableAncestor):
474         (WebCore::AccessibilityObject::highestEditableAncestor):
475         * accessibility/AccessibilityObject.h:
476         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
477         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
478         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
479
480 2016-03-17  Sam Weinig  <sam@webkit.org>
481
482         Implement document.queryCommandSupported("copy")
483         https://bugs.webkit.org/show_bug.cgi?id=155548
484         <rdar://problem/25195295>
485
486         Reviewed by Enrica Casucci.
487
488         - document.queryCommandSupported("copy") and document.queryCommandSupported("cut") need
489           to return true if the ClipboardAccessPolicy is either Allow or RequiresUserGesture.
490           But, document.queryCommandEnabled("copy") and document.queryCommandEnabled("cut")
491           should still return false when there is no user gesture. I also had to maintain a weird
492           quirk that copy and cut should be allowed to execute, and thus fire the oncopy and oncut
493           events, even when disabled, if coming from a "MenuOrKeyBinding" source. To do this, I
494           upgraded the allowExecutionWhenDisabled bit to a function taking a source, and return true
495           only when the correct source is specified.
496
497         * editing/Editor.h:
498         * editing/EditorCommand.cpp:
499         (WebCore::defaultValueForSupportedCopyCut):
500         (WebCore::allowCopyCutFromDOM):
501         (WebCore::enabledCopy):
502         (WebCore::enabledCut):
503         (WebCore::allowExecutionWhenDisabled):
504         (WebCore::doNotAllowExecutionWhenDisabled):
505         (WebCore::allowExecutionWhenDisabledCopyCut):
506         (WebCore::Editor::Command::execute):
507         (WebCore::Editor::Command::allowExecutionWhenDisabled):
508
509 2016-03-17  Antti Koivisto  <antti@apple.com>
510
511         DataURLDecoder::DecodingResultDispatcher may get deleted outside main thread
512         https://bugs.webkit.org/show_bug.cgi?id=155584
513         rdar://problem/24492104
514
515         Reviewed by Chris Dumez.
516
517         This is unsafe as it owns strings and other types that are only safe to delete in the main thread.
518
519         * platform/network/DataURLDecoder.cpp:
520         (WebCore::DataURLDecoder::DecodingResultDispatcher::dispatch):
521
522             The problem is that this was a refcounted type. This created a race. If the timer fired before dispatch()
523             was exited the implicit deref here would trigger the deletion in the dispatching thread.
524
525             Fix by getting rid of the unnecessary refcounting. Timer firing will now delete the instance explicitly.
526
527         (WebCore::DataURLDecoder::DecodingResultDispatcher::startTimer):
528         (WebCore::DataURLDecoder::DecodingResultDispatcher::timerFired):
529
530 2016-03-17  Commit Queue  <commit-queue@webkit.org>
531
532         Unreviewed, rolling out r198201.
533         https://bugs.webkit.org/show_bug.cgi?id=155585
534
535         That was not the proper solution (Requested by KaL on
536         #webkit).
537
538         Reverted changeset:
539
540         "REGRESSION (r197724): [GTK] Web Inspector: Images being
541         blocked by CSP 2.0"
542         https://bugs.webkit.org/show_bug.cgi?id=155432
543         http://trac.webkit.org/changeset/198201
544
545 2016-03-16  Chris Fleizach  <cfleizach@apple.com>
546
547         AX: Implement AutoFill Available attribute for a text field
548         https://bugs.webkit.org/show_bug.cgi?id=155567
549
550         Reviewed by Darin Adler.
551
552         Expose the auto fill buttons to the AX hierarchy.
553         Add an attribute for the textfield to inform when the auto fill button is available.
554
555         Test: accessibility/auto-fill-types.html
556
557         * English.lproj/Localizable.strings:
558         * accessibility/AccessibilityObject.cpp:
559         (WebCore::AccessibilityObject::element):
560         (WebCore::AccessibilityObject::isValueAutofillAvailable):
561         (WebCore::AccessibilityObject::isValueAutofilled):
562         * accessibility/AccessibilityObject.h:
563         (WebCore::AccessibilityObject::passwordFieldValue):
564         * accessibility/AccessibilityRenderObject.cpp:
565         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
566         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
567         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
568         * html/TextFieldInputType.cpp:
569         (WebCore::limitLength):
570         (WebCore::autoFillButtonTypeToAccessibilityLabel):
571         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
572         (WebCore::TextFieldInputType::createAutoFillButton):
573         (WebCore::TextFieldInputType::updateAutoFillButton):
574         * platform/LocalizedStrings.cpp:
575         (WebCore::AXListItemActionVerb):
576         (WebCore::AXAutoFillCredentialsLabel):
577         (WebCore::AXAutoFillContactsLabel):
578         (WebCore::AXARIAContentGroupText):
579         * platform/LocalizedStrings.h:
580
581 2016-03-17  Csaba Osztrogonác  <ossy@webkit.org>
582
583         [Mac][cmake] Unreviewed speculative buildfix after r198179. Just for fun.
584
585         * PlatformMac.cmake:
586
587 2016-03-17  Youenn Fablet  <youenn.fablet@crf.canon.fr>
588
589         [Fetch API] response-consume.html is crashing on Mac WK1 Debug builds
590         https://bugs.webkit.org/show_bug.cgi?id=155490
591
592         Reviewed by Darin Adler.
593
594         Covered by existing tests.
595
596         Ensured to lock state before calling JSC:JSONParse.
597         Adding fulfillPromiseWithJSON routine to handle it.
598         Applied it to FetchBody.
599
600         * Modules/fetch/FetchBody.cpp:
601         (WebCore::FetchBody::json):
602         (WebCore::FetchBody::loadedAsText):
603         (WebCore::FetchBody::resolveAsJSON): Deleted.
604         * Modules/fetch/FetchBody.h:
605         * Modules/fetch/FetchBodyOwner.cpp:
606         (WebCore::FetchBodyOwner::loadedBlobAsText):
607         * bindings/js/JSDOMPromise.cpp:
608         (WebCore::parseAsJSON):
609         (WebCore::fulfillPromiseWithJSON):
610         * bindings/js/JSDOMPromise.h:
611
612 2016-03-17  Adam Bergkvist  <adam.bergkvist@ericsson.com>
613
614         WebRTC: Update RTCIceCandidate
615         https://bugs.webkit.org/show_bug.cgi?id=155535
616
617         Reviewed by Eric Carlson.
618
619         Update the RTCIceCandidate constructor procedure to match the WebRTC 1.0 specification [1].
620         In short: The "candidate" init dictionary member is required. At least one of the dictionary
621         members "sdpMid" and "sdpMLine" needs to be present; the corresponding attribute of the
622         other, is initialized to null.
623
624         [1] https://w3c.github.io/webrtc-pc/archives/20160215/webrtc.html
625
626         Tests: Updated fast/mediastream/RTCIceCandidate.htm
627
628         * Modules/mediastream/RTCIceCandidate.cpp:
629         (WebCore::RTCIceCandidate::create):
630         (WebCore::RTCIceCandidate::RTCIceCandidate):
631         * Modules/mediastream/RTCIceCandidate.h:
632         (WebCore::RTCIceCandidate::sdpMLineIndex):
633         (WebCore::RTCIceCandidate::setSdpMLineIndex):
634         * Modules/mediastream/RTCIceCandidate.idl:
635         * bindings/js/JSRTCIceCandidateCustom.cpp:
636         (WebCore::JSRTCIceCandidate::sdpMid):
637         (WebCore::JSRTCIceCandidate::sdpMLineIndex):
638
639 2016-03-16  Nikos Andronikos  <nikos.andronikos-webkit@cisra.canon.com.au>
640
641         SVG tear offs should return a const reference if possible
642         https://bugs.webkit.org/show_bug.cgi?id=153214
643
644         Reviewed by Alex Christensen.
645
646         A smaller change than expected because the returned reference is being copied into a value in additional locations that baseVal and animVal are used.
647
648         No new tests as there is no change in behaviour.
649
650         * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
651         * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
652         (WebCore::SVGAnimatedStaticPropertyTearOff::baseVal):
653         (WebCore::SVGAnimatedStaticPropertyTearOff::animVal):
654
655 2016-03-16  Chris Dumez  <cdumez@apple.com>
656
657         Unreviewed, partial roll out of r197254.
658         <rdar://problem/25078552>
659
660         It caused a ~1.1% PLT regression on iOS.
661
662         * loader/FrameLoader.cpp:
663         (WebCore::FrameLoader::commitProvisionalLoad): Deleted.
664
665 2016-03-16  Enrica Casucci  <enrica@apple.com>
666
667         Recognize mailto and tel url as data detector links.
668         https://bugs.webkit.org/show_bug.cgi?id=155569
669         rdar://problem/24836185
670
671         Reviewed by Sam Weinig.
672
673         When we check if the element is a data detector link,
674         we should return true also for URLs with mailto: and tel: scheme.
675
676         * editing/cocoa/DataDetection.mm:
677         (WebCore::DataDetection::isDataDetectorLink):
678
679 2016-03-16  Zalan Bujtas  <zalan@apple.com>
680
681         Subpixel rendering: Directly composited image layers need pixelsnapping.
682         https://bugs.webkit.org/show_bug.cgi?id=155558
683
684         Reviewed by Simon Fraser.
685
686         In order to match non-composited image size/position, we need to pixelsnap both the contents and the clipping
687         layer bounds for directly composited images.
688
689         Test: fast/images/hidpi-directly-composited-image-on-subpixel-position.html
690
691         * rendering/RenderLayerBacking.cpp:
692         (WebCore::RenderLayerBacking::resetContentsRect):
693         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
694         (WebCore::RenderLayerBacking::updateImageContents):
695
696 2016-03-16  Beth Dakin  <bdakin@apple.com>
697
698         Provide NSSpellChecker spellChecking methods with the current insertion point
699         https://bugs.webkit.org/show_bug.cgi?id=155532
700         -and corresponding-
701         rdar://problem/24066952
702
703         Reviewed by Simon Fraser.
704
705         Pass the Frame’s selection to a handful of spelling checking methods that 
706         call into WebKit/WebKit2 to ultimately call into NSSpellChecker.
707         * accessibility/AccessibilityObject.cpp:
708         (WebCore::AccessibilityObject::hasMisspelling):
709         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
710         (AXAttributeStringSetSpelling):
711         * editing/AlternativeTextController.cpp:
712         (WebCore::AlternativeTextController::timerFired):
713         * editing/Editor.cpp:
714         (WebCore::Editor::guessesForMisspelledWord):
715         (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
716         * editing/SpellChecker.cpp:
717         (WebCore::SpellChecker::invokeRequest):
718         (WebCore::SpellChecker::enqueueRequest):
719         * editing/TextCheckingHelper.cpp:
720         (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
721         (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange):
722         (WebCore::TextCheckingHelper::unifiedTextCheckerEnabled):
723         (WebCore::checkTextOfParagraph):
724         * editing/TextCheckingHelper.h:
725         * loader/EmptyClients.cpp:
726         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
727         (WebCore::EmptyTextCheckerClient::requestCheckingOfString):
728         * loader/EmptyClients.h:
729         * platform/text/TextCheckerClient.h:
730         (WebCore::TextCheckerClient::~TextCheckerClient):
731
732         The key needed to include the insertion point.
733         * platform/spi/mac/NSSpellCheckerSPI.h:
734
735 2016-03-16  Alex Christensen  <achristensen@webkit.org>
736
737         Fix assertion failure on drive.google.com after r196052
738         https://bugs.webkit.org/show_bug.cgi?id=155562
739
740         Reviewed by Jer Noble.
741
742         * rendering/RenderGeometryMap.cpp:
743         (WebCore::RenderGeometryMap::mapToContainer):
744         Change float equality check to areEssentiallyEqual.
745         This assertion was failing because rendererMappedResult was (944.335693, 232.047409)
746         but result was (944.335693, 232.047394).  They differ by (0, 0.000015).
747
748 2016-03-16  Nan Wang  <n_wang@apple.com>
749
750         AX: Expose aria-current status to children
751         https://bugs.webkit.org/show_bug.cgi?id=155469
752
753         Reviewed by Chris Fleizach.
754
755         Added aria-current to the global ARIA attributes list.
756
757         Test: accessibility/aria-current-global-attribute.html
758
759         * accessibility/AccessibilityObject.cpp:
760         (WebCore::AccessibilityObject::supportsARIAAttributes):
761
762 2016-03-16  Tim Horton  <timothy_horton@apple.com>
763
764         [mac] Printing test snapshots are upside-down after r198242
765         https://bugs.webkit.org/show_bug.cgi?id=155543
766
767         Reviewed by Simon Fraser.
768
769         * page/PrintContext.cpp:
770         (WebCore::PrintContext::spoolAllPagesWithBoundaries):
771         Stop PLATFORM(COCOA)-conditionally flipping here. Just paint.
772         This function is only used by the test runners so this doesn't have a
773         huge impact on anything else.
774
775 2016-03-16  Daniel Bates  <dabates@apple.com>
776
777         Update WebKit Feature Status page to include the status of Content Security Policy Level 2 and Level 3
778
779         * features.json:
780
781 2016-03-16  Daniel Bates  <dabates@apple.com>
782
783         <video> and <audio> elements do not obey Content Security Policy on redirect
784         https://bugs.webkit.org/show_bug.cgi?id=155509
785         <rdar://problem/10234844>
786
787         Reviewed by Alex Christensen.
788
789         Fixes an issue where the Content Security Policy of the page was not enforced
790         on redirects when loading a media subresource via an HTML video or HTML audio
791         element.
792
793         Tests: http/tests/security/contentSecurityPolicy/audio-redirect-allowed.html
794                http/tests/security/contentSecurityPolicy/audio-redirect-blocked.html
795                http/tests/security/contentSecurityPolicy/font-redirect-allowed.html
796                http/tests/security/contentSecurityPolicy/font-redirect-blocked.html
797                http/tests/security/contentSecurityPolicy/image-redirect-allowed.html
798                http/tests/security/contentSecurityPolicy/image-redirect-blocked.html
799                http/tests/security/contentSecurityPolicy/script-redirect-allowed.html
800                http/tests/security/contentSecurityPolicy/script-redirect-blocked.html
801                http/tests/security/contentSecurityPolicy/stylesheet-redirect-allowed.html
802                http/tests/security/contentSecurityPolicy/stylesheet-redirect-blocked.html
803                http/tests/security/contentSecurityPolicy/svg-font-redirect-allowed.html
804                http/tests/security/contentSecurityPolicy/svg-font-redirect-blocked.html
805                http/tests/security/contentSecurityPolicy/svg-image-redirect-allowed.html
806                http/tests/security/contentSecurityPolicy/svg-image-redirect-blocked.html
807                http/tests/security/contentSecurityPolicy/track-redirect-allowed.html
808                http/tests/security/contentSecurityPolicy/track-redirect-blocked.html
809                http/tests/security/contentSecurityPolicy/video-redirect-allowed.html
810                http/tests/security/contentSecurityPolicy/video-redirect-blocked.html
811                http/tests/security/contentSecurityPolicy/xsl-redirect-allowed.html
812                http/tests/security/contentSecurityPolicy/xsl-redirect-blocked.html
813
814         * inspector/InspectorPageAgent.cpp:
815         (WebCore::InspectorPageAgent::cachedResourceContent): Treat media resources as raw resources just as we do currently.
816         (WebCore::InspectorPageAgent::cachedResourceType): Ditto.
817         * loader/MediaResourceLoader.cpp:
818         (WebCore::MediaResourceLoader::requestResource): Modified to use CachedResourceLoader::requestMedia() instead
819         of CachedResourceLoader::requestRawResource() so that we can differentiate between a media resource and a raw
820         resource in CachedResourceLoader. Added FIXME comment to skip checking the Content Security Policy for loads
821         initiated by an element in a user agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505> for
822         more details.
823         * loader/ResourceLoadInfo.cpp:
824         (WebCore::toResourceType): Treat media resources as raw resources just as we do currently. Also, add cases for
825         CachedResource::LinkPrefetch and CachedResource::LinkSubresource (when ENABLE(LINK_PREFETCH) is enabled) and
826         remove the default statement to force a compile-time error when a new CachedResource enumerator is added and
827         the switch block in this function is not updated.
828         * loader/SubresourceLoader.cpp:
829         (WebCore::logResourceLoaded): Ditto.
830         * loader/cache/CachedRawResource.cpp:
831         (WebCore::CachedRawResource::CachedRawResource): Substitute CachedResource::isMainOrMediaOrRawResource() for
832         CachedResource::isMainOrRawResource() as the latter was renamed to the former.
833         * loader/cache/CachedRawResource.h:
834         (isType): Ditto.
835         * loader/cache/CachedResource.cpp:
836         (WebCore::defaultPriorityForResourceType): Use priority ResourceLoadPriority::Medium for media resources just as
837         we do currently.
838         * loader/cache/CachedResource.h:
839         (WebCore::CachedResource::isMainOrMediaOrRawResource): Formerly named isMainOrRawResource. Returns true if the type
840         of this resource is a main resource, media resource, or raw resource.
841         (WebCore::CachedResource::isMainOrRawResource): Deleted.
842         * loader/cache/CachedResourceLoader.cpp:
843         (WebCore::createResource): Treat media resources as raw resources just as we do currently.
844         (WebCore::CachedResourceLoader::requestMedia): Added.
845         (WebCore::contentTypeFromResourceType): Consider media resources as MixedContentChecker::ContentType::Active
846         just as we do currently.
847         (WebCore::CachedResourceLoader::checkInsecureContent): Apply the mixed content policy to media resources
848         just as we do currently.
849         (WebCore::CachedResourceLoader::canRequest): Apply the Same Origin Policy to media resources just as we
850         do currently. Query the Content Security Policy of the page to determine if the media resource can be
851         requested.
852         (WebCore::CachedResourceLoader::determineRevalidationPolicy): Substitute CachedResource::isMainOrMediaOrRawResource()
853         for CachedResource::isMainOrRawResource() as the latter was renamed to the former.
854         * loader/cache/CachedResourceLoader.h:
855         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
856         (WebCore::WebCoreAVFResourceLoader::startLoading): Modified to use CachedResourceLoader::requestMedia() instead
857         of CachedResourceLoader::requestRawResource() so that we can differentiate between a media resource and a raw
858         resource in CachedResourceLoader. Added FIXME comment to skip checking the Content Security Policy for loads
859         initiated by an element in a user agent shadow tree. See <https://bugs.webkit.org/show_bug.cgi?id=155505> for
860         more details. Additionally, simplified code that determined whether to request the media resource or error out
861         by coalescing two conditional expressions into one conditional on whether we have a loader and substituted
862         nullptr for 0.
863
864 2016-03-16  Chris Dumez  <cdumez@apple.com>
865
866         Unreviewed, rolling out r198235, r198240, r198241, and
867         r198252.
868
869         Causing crashes on ARM
870
871         Reverted changesets:
872
873         "Remove compile time define for SEPARATED_HEAP"
874         https://bugs.webkit.org/show_bug.cgi?id=155508
875         http://trac.webkit.org/changeset/198235
876
877         "Gardening: build fix after r198235."
878         http://trac.webkit.org/changeset/198240
879
880         "Build fix."
881         http://trac.webkit.org/changeset/198241
882
883         "Rename performJITMemcpy to something more inline with our
884         normal webkit function names"
885         https://bugs.webkit.org/show_bug.cgi?id=155525
886         http://trac.webkit.org/changeset/198252
887
888 2016-03-16  Jiewen Tan  <jiewen_tan@apple.com>
889
890         URL Parsing should signal failure for illegal IDN
891         https://bugs.webkit.org/show_bug.cgi?id=154945
892         <rdar://problem/8014795>
893
894         Reviewed by Brent Fulgham.
895
896         WebCore::URL will now invalidate URLs with illegal IDN. And functions inside WebCoreNSURLExtras.h
897         that deal with IDN mapping will now return nil to signal error.
898
899         Test: fast/url/invalid-idn.html
900
901         * platform/URL.cpp:
902         (WebCore::isSchemeFirstChar):
903         (WebCore::URL::init):
904         (WebCore::appendEncodedHostname):
905         (WebCore::encodeHostnames):
906         (WebCore::encodeRelativeString):
907         * platform/mac/WebCoreNSURLExtras.h:
908         * platform/mac/WebCoreNSURLExtras.mm:
909         (WebCore::mapHostNameWithRange):
910         (WebCore::hostNameNeedsDecodingWithRange):
911         (WebCore::hostNameNeedsEncodingWithRange):
912         (WebCore::decodeHostNameWithRange):
913         (WebCore::encodeHostNameWithRange):
914         (WebCore::decodeHostName):
915         (WebCore::encodeHostName):
916         (WebCore::collectRangesThatNeedMapping):
917         (WebCore::mapHostNames):
918         (WebCore::URLWithData):
919         (WebCore::dataWithUserTypedString):
920         (WebCore::URLWithUserTypedString):
921         (WebCore::URLWithUserTypedStringDeprecated):
922         (WebCore::userVisibleString):
923
924 2016-03-16  Antti Koivisto  <antti@apple.com>
925
926         Don't invalidate style unnecessarily when setting inline style cssText
927         https://bugs.webkit.org/show_bug.cgi?id=155541
928         rdar://problem/23318893
929
930         Reviewed by Simon Fraser.
931
932         We currently invalidate style when cssText is set whether the style declaration changed or not.
933
934         Based on a patch by Simon.
935
936         Test: fast/css/style-invalidation-inline-csstext.html
937
938         * css/PropertySetCSSStyleDeclaration.cpp:
939         (WebCore::PropertySetCSSStyleDeclaration::cssText):
940         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
941
942             Invalidate only if the parsed style changed.
943
944         * css/StyleProperties.cpp:
945         (WebCore::MutableStyleProperties::parseDeclaration):
946
947             Compare the original and new style after parsing, return result.
948
949         * css/StyleProperties.h:
950
951 2016-03-16  Carlos Garcia Campos  <cgarcia@igalia.com>
952
953         REGRESSION(r195661): [GTK] very slow scrolling
954         https://bugs.webkit.org/show_bug.cgi?id=155334
955
956         Reviewed by Sergio Villar Senin.
957
958         Fix smooth scrolling behaviour change after r195661.
959
960         * platform/ScrollAnimationSmooth.cpp:
961         (WebCore::getAnimationParametersForGranularity): Fix a typo,
962         animationTime for pixel granularity should be 11 * tickTime.
963         (WebCore::ScrollAnimationSmooth::animateScroll): Previous code
964         reset all the data except the visibleLenght, so keep it in the
965         PerAxisData after the reset.
966
967 2016-03-16  Commit Queue  <commit-queue@webkit.org>
968
969         Unreviewed, rolling out r196803.
970         https://bugs.webkit.org/show_bug.cgi?id=155534
971
972         Introduced several rendering issues in popular websites
973         (Requested by KaL on #webkit).
974
975         Reverted changeset:
976
977         "[GTK] Limit the number of tiles according to the visible
978         area"
979         https://bugs.webkit.org/show_bug.cgi?id=126122
980         http://trac.webkit.org/changeset/196803
981
982 2016-03-15  Zalan Bujtas  <zalan@apple.com>
983
984         Remove overflow: -webkit-marquee
985         https://bugs.webkit.org/show_bug.cgi?id=155517
986         <rdar://problem/25028481>
987
988         Reviewed by Simon Fraser.
989
990         This patch is based on Blink patch from jchaffraix@chromium.org (https://src.chromium.org/viewvc/blink?revision=151756&view=revision)
991
992         * css/CSSParser.cpp:
993         (WebCore::isValidKeywordPropertyAndValue):
994         * css/CSSPrimitiveValueMappings.h:
995         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Deleted.
996         (WebCore::CSSPrimitiveValue::operator EOverflow): Deleted.
997         * css/CSSValueKeywords.in:
998         * css/StyleResolver.cpp:
999         (WebCore::StyleResolver::adjustRenderStyle):
1000         * css/html.css:
1001         (marquee): Deleted.
1002         * rendering/RenderBox.cpp:
1003         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1004         * rendering/RenderLayer.cpp:
1005         (WebCore::RenderLayer::scrollTo):
1006         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1007         (WebCore::RenderLayer::calculateClipRects):
1008         * rendering/RenderLayer.h:
1009         * rendering/RenderMarquee.h:
1010         * rendering/style/RenderStyleConstants.h:
1011
1012 2016-03-15  Joanmarie Diggs  <jdiggs@igalia.com>
1013
1014         AX: Expose pointers to SVG elements referenced by aria-labelledby
1015         https://bugs.webkit.org/show_bug.cgi?id=155481
1016
1017         Reviewed by Chris Fleizach.
1018
1019         Expose elements referenced by aria-labelledby via ATK_RELATION_LABELLED_BY.
1020         Stop calling the supportsARIA* methods before getting the elements referred
1021         to by the associated ARIA property in the accessible wrapper for ATK and
1022         the inspector: Getting the elements will be just as fast when there are no
1023         such elements, and faster when there are.
1024
1025         Modified the w3c-svg-name-calculation.html test to include AXTitleUIElement
1026         in its output.
1027
1028         * accessibility/AccessibilityObject.cpp:
1029         (WebCore::AccessibilityObject::supportsARIAAttributes):
1030         (WebCore::AccessibilityObject::ariaElementsFromAttribute): Added.
1031         (WebCore::AccessibilityObject::ariaControlsElements): Added.
1032         (WebCore::AccessibilityObject::ariaDescribedByElements): Added.
1033         (WebCore::AccessibilityObject::ariaFlowToElements): Added.
1034         (WebCore::AccessibilityObject::ariaLabelledByElements): Added.
1035         (WebCore::AccessibilityObject::ariaOwnsElements): Added.
1036         * accessibility/AccessibilityObject.h:
1037         (WebCore::AccessibilityObject::ariaOwnsElements): No longer virtual.
1038         (WebCore::AccessibilityObject::supportsARIAFlowTo): Deleted.
1039         (WebCore::AccessibilityObject::ariaFlowToElements): No longer virtual.
1040         (WebCore::AccessibilityObject::supportsARIADescribedBy): Deleted.
1041         (WebCore::AccessibilityObject::ariaDescribedByElements): No longer virtual.
1042         (WebCore::AccessibilityObject::supportsARIAControls): Deleted.
1043         (WebCore::AccessibilityObject::ariaControlsElements): No longer virtual.
1044         * accessibility/AccessibilityRenderObject.cpp:
1045         (WebCore::AccessibilityRenderObject::ariaElementsFromAttribute): Moved to AccessibilityObject.
1046         (WebCore::AccessibilityRenderObject::supportsARIAFlowTo): Deleted.
1047         (WebCore::AccessibilityRenderObject::ariaFlowToElements): Moved to AccessibilityObject.
1048         (WebCore::AccessibilityRenderObject::supportsARIADescribedBy): Deleted.
1049         (WebCore::AccessibilityRenderObject::ariaDescribedByElements): Moved to AccessibilityObject.
1050         (WebCore::AccessibilityRenderObject::supportsARIAControls): Deleted.
1051         (WebCore::AccessibilityRenderObject::ariaControlsElements): Moved to AccessibilityObject.
1052         (WebCore::AccessibilityRenderObject::ariaOwnsElements): Moved to AccessibilityObject.
1053         * accessibility/AccessibilityRenderObject.h:
1054         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1055         (setAtkRelationSetFromCoreObject):
1056         * inspector/InspectorDOMAgent.cpp:
1057         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1058
1059 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
1060
1061         Occasional crash under GraphicsContext::platformContext when dragging Google maps
1062         https://bugs.webkit.org/show_bug.cgi?id=155521
1063         rdar://problem/24357307
1064
1065         Reviewed by Tim Horton.
1066
1067         It's possible for createDragImageForSelection() to return a null image, if the bounds
1068         of the selection are an empty rect. That would cause a crash under convertImageToBitmap()
1069         because a zero-sized ShareableBitmap will return a null GraphicsContext.
1070         
1071         To avoid this, early return from DragController::startDrag() if the dragImage is null.
1072         
1073         I wasn't able to come up with a test for this.
1074
1075         * page/DragController.cpp:
1076         (WebCore::DragController::startDrag):
1077
1078 2016-03-15  Tim Horton  <timothy_horton@apple.com>
1079
1080         iOS <attachment> element should allow customization of action text color
1081         https://bugs.webkit.org/show_bug.cgi?id=155513
1082         <rdar://problem/24805991>
1083
1084         Reviewed by Simon Fraser.
1085
1086         Test: fast/attachment/attachment-action.html
1087
1088         * css/html.css:
1089         (attachment):
1090         On iOS (the only place it is used), <attachment> color should default to system blue.
1091
1092         * rendering/RenderThemeIOS.mm:
1093         (WebCore::attachmentActionColor):
1094         (WebCore::AttachmentInfo::AttachmentInfo):
1095         Make use of the <attachment>'s CSS color for the action text.
1096         This is a little weird because there are multiple bits of text in an
1097         <attachment>, but only the action text ever changes color.
1098
1099 2016-03-15  Zalan Bujtas  <zalan@apple.com>
1100
1101         Delay HTMLFormControlElement::focus() call until after layout is finished.
1102         https://bugs.webkit.org/show_bug.cgi?id=155503
1103         <rdar://problem/24046635>
1104
1105         Reviewed by Simon Fraser.
1106
1107         Calling focus on a form element can trigger arbitrary JS code which could interfere with
1108         the ongoing layout. 
1109         This patch delays HTMLFormControlElement::focus() call until after layout is finished.
1110         If we are currently not in the middle of a layout, HTMLFormControlElement::focus() is delayed until
1111         after style resolution is done. 
1112
1113         Covered by LayoutTests/fast/dom/adopt-node-crash-2.html
1114
1115         * accessibility/AccessibilityObject.cpp:
1116         (WebCore::AccessibilityObject::updateBackingStore):
1117         * dom/Document.cpp:
1118         (WebCore::Document::updateStyleIfNeeded):
1119         (WebCore::Document::updateLayout):
1120         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1121         * html/HTMLEmbedElement.cpp:
1122         (WebCore::HTMLEmbedElement::renderWidgetLoadingPlugin):
1123         * html/HTMLFormControlElement.cpp:
1124         (WebCore::HTMLFormControlElement::didAttachRenderers):
1125         * page/FrameView.cpp:
1126         (WebCore::FrameView::layout):
1127         (WebCore::FrameView::queuePostLayoutCallback):
1128         (WebCore::FrameView::flushPostLayoutTasksQueue):
1129         (WebCore::FrameView::performPostLayoutTasks):
1130         (WebCore::FrameView::sendResizeEventIfNeeded):
1131         * page/FrameView.h:
1132         * rendering/RenderBox.cpp:
1133         (WebCore::RenderBox::imageChanged):
1134         * rendering/RenderLayer.cpp:
1135         (WebCore::RenderLayer::scrollTo):
1136
1137 2016-03-15  Oliver Hunt  <oliver@apple.com>
1138
1139         Remove compile time define for SEPARATED_HEAP
1140         https://bugs.webkit.org/show_bug.cgi?id=155508
1141
1142         Reviewed by Mark Lam.
1143
1144         Remove the feature define.
1145
1146         * Configurations/FeatureDefines.xcconfig:
1147
1148 2016-03-15  Chris Dumez  <cdumez@apple.com>
1149
1150         Restore pre-r197244 behavior on Mac
1151         https://bugs.webkit.org/show_bug.cgi?id=155507
1152         <rdar://problem/25174132>
1153
1154         Reviewed by Gavin Barraclough.
1155
1156         <http://trac.webkit.org/changeset/197244> changed the session restore
1157         behavior to disallow stale content on all platforms except iOS.
1158         We would also like to maintain the behavior on Mac for performance
1159         reasons and consistency between iOS and Mac.
1160
1161         * loader/FrameLoader.cpp:
1162         (WebCore::FrameLoader::loadDifferentDocumentItem):
1163
1164 2016-03-15  Tim Horton  <timothy_horton@apple.com>
1165
1166         <attachment> on iOS isn't quite vertically centered
1167         https://bugs.webkit.org/show_bug.cgi?id=155502
1168         <rdar://problem/24805991>
1169
1170         Reviewed by Beth Dakin.
1171
1172         No new tests; there are existing tests that will be enabled shortly.
1173
1174         * rendering/RenderThemeIOS.mm:
1175         (WebCore::AttachmentInfo::AttachmentInfo):
1176         We were overcounting the total height of the attachment content by one margin, because each item
1177         would add in its margin, including the last one. Remove one margin.
1178
1179 2016-03-15  Chris Fleizach  <cfleizach@apple.com>
1180
1181         AX: certain elements not included in accessibility tree
1182         https://bugs.webkit.org/show_bug.cgi?id=155480
1183
1184         Reviewed by Beth Dakin.
1185
1186         This test case exposed a hole in the nextSibling logic where you can get into a state where we skip content.
1187         The fix is to check if an inline element continuation has no sibling, to fall back on to the parent case to see if that has a sibling.
1188
1189         Test: accessibility/double-nested-inline-element-missing-from-tree.html
1190
1191         * accessibility/AccessibilityRenderObject.cpp:
1192         (WebCore::AccessibilityRenderObject::nextSibling):
1193
1194 2016-03-15  Chris Dumez  <cdumez@apple.com>
1195
1196         Unreviewed, rolling out r198203.
1197
1198         Favorites view is no longer loading on iOS
1199
1200         Reverted changeset:
1201
1202         "URL Parsing should signal failure for illegal IDN"
1203         https://bugs.webkit.org/show_bug.cgi?id=154945
1204         http://trac.webkit.org/changeset/198203
1205
1206 2016-03-15  Tim Horton  <timothy_horton@apple.com>
1207
1208         <attachment> on iOS should use short and emphasized fonts
1209         https://bugs.webkit.org/show_bug.cgi?id=155485
1210         <rdar://problem/24805991>
1211
1212         Reviewed by Simon Fraser.
1213
1214         No new tests; there are existing tests that will be enabled shortly.
1215
1216         * rendering/RenderThemeIOS.mm:
1217         (WebCore::attachmentActionFont):
1218         (WebCore::attachmentTitleFont):
1219         (WebCore::attachmentSubtitleFont):
1220         (WebCore::AttachmentInfo::buildTitleLines):
1221         (WebCore::AttachmentInfo::buildSingleLine):
1222         (WebCore::AttachmentInfo::AttachmentInfo):
1223         No need for UIFonts, we can use CoreText, and that allows us to ask for the
1224         correct Short and Emphasized variants that we need.
1225
1226 2016-03-15  Antti Koivisto  <antti@apple.com>
1227
1228         REGRESSION (196383): Class change invalidation does not handle :not correctly
1229         https://bugs.webkit.org/show_bug.cgi?id=155493
1230         <rdar://problem/24846762>
1231
1232         Reviewed by Andreas Kling.
1233
1234         We fail to invalidate bar style in
1235
1236             :not(.foo) bar { }
1237
1238         when class foo is added or removed.
1239
1240         There is a logic error in the invalidation code. It assumes that class addition can only make new selectors match
1241         and removal make them not match. This is not true when :not is present.
1242
1243         * style/AttributeChangeInvalidation.h:
1244         (WebCore::Style::AttributeChangeInvalidation::AttributeChangeInvalidation):
1245         * style/ClassChangeInvalidation.cpp:
1246         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
1247
1248             Invalidate style and collect full set of rules that may affect descendant style.
1249
1250         (WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle):
1251
1252             Invalidate with this set both before and after committing the changes.
1253
1254         (WebCore::Style::ClassChangeInvalidation::computeClassChange): Deleted.
1255         * style/ClassChangeInvalidation.h:
1256         (WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
1257         (WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
1258
1259 2016-03-14  Jer Noble  <jer.noble@apple.com>
1260
1261         Video elements with autoplay do not begin playing when scrolling into view if InvisibleAutoplayNotPermitted is set.
1262         https://bugs.webkit.org/show_bug.cgi?id=155468
1263
1264         Reviewed by Eric Carlson.
1265
1266         Test: media/video-restricted-invisible-autoplay-allowed-when-visible.html
1267
1268         A few bugs came together to cause this behavior. We were not telling the media session that we were going to begin
1269         the autoplaying state, we were not restoring the correct state when the interruption ended, and we were not checking
1270         to see if we could actually play correctly when the interruption ended.
1271
1272         * html/HTMLMediaElement.cpp:
1273         (WebCore::HTMLMediaElement::prepareForLoad):
1274         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
1275         (WebCore::HTMLMediaElement::setReadyState):
1276         (WebCore::HTMLMediaElement::resumeAutoplaying):
1277         (WebCore::HTMLMediaElement::updateShouldPlay):
1278         (WebCore::elementCanTransitionFromAutoplayToPlay): Deleted.
1279         * html/HTMLMediaElement.h:
1280         * platform/audio/PlatformMediaSession.cpp:
1281         (WebCore::PlatformMediaSession::endInterruption):
1282
1283 2016-03-15  Manuel Rego Casasnovas  <rego@igalia.com>
1284
1285         [css-grid] Rename GridCoordinate to GridArea
1286         https://bugs.webkit.org/show_bug.cgi?id=155489
1287
1288         Reviewed by Sergio Villar Senin.
1289
1290         As the comment in GridCoordinate states,
1291         it actually represents a grid area as it stores
1292         the initial and final positions in both axis (columns and rows).
1293
1294         Someone can think about a grid coordinate just like a single cell.
1295         However this class was representing an area of several cells.
1296
1297         On top of that the "grid area" concept is defined in the spec:
1298         https://drafts.csswg.org/css-grid/#grid-area-concept
1299
1300         No new tests, no change of behavior.
1301
1302         * WebCore.xcodeproj/project.pbxproj:
1303         * css/CSSGridTemplateAreasValue.cpp:
1304         (WebCore::stringForPosition):
1305         * css/CSSGridTemplateAreasValue.h:
1306         * css/CSSParser.cpp:
1307         (WebCore::CSSParser::parseGridTemplateAreasRow):
1308         * css/CSSParser.h:
1309         * rendering/RenderGrid.cpp:
1310         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
1311         (WebCore::RenderGrid::insertItemIntoGrid):
1312         (WebCore::RenderGrid::placeItemsOnGrid):
1313         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1314         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
1315         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1316         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1317         (WebCore::RenderGrid::clearGrid):
1318         (WebCore::RenderGrid::cachedGridArea):
1319         (WebCore::RenderGrid::cachedGridSpan):
1320         * rendering/RenderGrid.h:
1321         * rendering/style/GridArea.h: Renamed from Source/WebCore/rendering/style/GridCoordinate.h.
1322         (WebCore::GridSpan::untranslatedDefiniteGridSpan):
1323         (WebCore::GridSpan::translatedDefiniteGridSpan):
1324         (WebCore::GridSpan::indefiniteGridSpan):
1325         (WebCore::GridSpan::operator==):
1326         (WebCore::GridSpan::integerSpan):
1327         (WebCore::GridSpan::untranslatedResolvedInitialPosition):
1328         (WebCore::GridSpan::untranslatedResolvedFinalPosition):
1329         (WebCore::GridSpan::resolvedInitialPosition):
1330         (WebCore::GridSpan::resolvedFinalPosition):
1331         (WebCore::GridSpan::GridSpanIterator::GridSpanIterator):
1332         (WebCore::GridSpan::GridSpanIterator::operator unsigned&):
1333         (WebCore::GridSpan::GridSpanIterator::operator*):
1334         (WebCore::GridSpan::begin):
1335         (WebCore::GridSpan::end):
1336         (WebCore::GridSpan::isTranslatedDefinite):
1337         (WebCore::GridSpan::isIndefinite):
1338         (WebCore::GridSpan::translate):
1339         (WebCore::GridSpan::GridSpan):
1340         (WebCore::GridArea::GridArea):
1341         (WebCore::GridArea::operator==):
1342         (WebCore::GridArea::operator!=):
1343         * rendering/style/GridPositionsResolver.cpp:
1344         * rendering/style/StyleGridData.h:
1345
1346 2016-03-15  Joonghun Park  <jh718.park@samsung.com>
1347
1348         [GTK] Remove duplicate HashMap traversal and unneeded reference count churn in DataObjectGtk::forClipboard
1349         https://bugs.webkit.org/show_bug.cgi?id=155470
1350
1351         Reviewed by Carlos Garcia Campos.
1352
1353         No new tests, no new behaviours.
1354
1355         * platform/gtk/DataObjectGtk.cpp:
1356         (WebCore::DataObjectGtk::forClipboard):
1357
1358 2016-03-15  Manuel Rego Casasnovas  <rego@igalia.com>
1359
1360         [css-grid] Rename GridResolvedPosition to GridPositionsResolver
1361         https://bugs.webkit.org/show_bug.cgi?id=155486
1362
1363         Reviewed by Sergio Villar Senin.
1364
1365         GridResolvedPosition is not storing a position (track or line) anymore.
1366         Currently it's just a class wrapping the methods to resolve
1367         grid positions from style.
1368         Renamed the class to avoid confusions.
1369
1370         No new tests, no change of behavior.
1371
1372         * CMakeLists.txt:
1373         * WebCore.xcodeproj/project.pbxproj:
1374         * rendering/RenderGrid.cpp:
1375         (WebCore::RenderGrid::placeItemsOnGrid):
1376         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1377         (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid):
1378         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
1379         (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
1380         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1381         * rendering/RenderGrid.h:
1382         * rendering/style/GridCoordinate.h:
1383         * rendering/style/GridPositionsResolver.cpp: Renamed from Source/WebCore/rendering/style/GridResolvedPosition.cpp.
1384         (WebCore::isColumnSide):
1385         (WebCore::isStartSide):
1386         (WebCore::initialPositionSide):
1387         (WebCore::finalPositionSide):
1388         (WebCore::gridLinesForSide):
1389         (WebCore::implicitNamedGridLineForSide):
1390         (WebCore::GridPositionsResolver::isNonExistentNamedLineOrArea):
1391         (WebCore::adjustGridPositionsFromStyle):
1392         (WebCore::GridPositionsResolver::explicitGridColumnCount):
1393         (WebCore::GridPositionsResolver::explicitGridRowCount):
1394         (WebCore::explicitGridSizeForSide):
1395         (WebCore::lookAheadForNamedGridLine):
1396         (WebCore::lookBackForNamedGridLine):
1397         (WebCore::resolveNamedGridLinePositionFromStyle):
1398         (WebCore::definiteGridSpanWithNamedLineSpanAgainstOpposite):
1399         (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
1400         (WebCore::resolveGridPositionAgainstOppositePosition):
1401         (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
1402         (WebCore::resolveGridPositionFromStyle):
1403         (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
1404         * rendering/style/GridPositionsResolver.h: Renamed from Source/WebCore/rendering/style/GridResolvedPosition.h.
1405         * rendering/style/StyleAllInOne.cpp:
1406
1407 2016-03-15  Miguel Gomez  <magomez@igalia.com>
1408
1409         Leak: Accelerated ImageBufferCairo doesn't destroy the used textures
1410         https://bugs.webkit.org/show_bug.cgi?id=155431
1411
1412         Reviewed by Žan Doberšek.
1413
1414         When using the Cairo backend, add a destructor to ImageBufferData and use it to destroy the
1415         textures created if the buffer is being accelerated.
1416
1417         No new tests, already covered by existing ones.
1418
1419         * platform/graphics/cairo/ImageBufferCairo.cpp:
1420         (WebCore::ImageBufferData::ImageBufferData):
1421         Store the renderingMode flag.
1422         (WebCore::ImageBufferData::~ImageBufferData):
1423         Destroy gl resources if renderingMode is accelerated.
1424         (WebCore::ImageBuffer::ImageBuffer):
1425         Pass renderingMode to the data class and use it fro checks instead of the function parameter.
1426         * platform/graphics/cairo/ImageBufferDataCairo.h:
1427         Add destructor and a renderingMode flag.
1428
1429 2016-03-15  Jiewen Tan  <jiewen_tan@apple.com>
1430
1431         URL Parsing should signal failure for illegal IDN
1432         https://bugs.webkit.org/show_bug.cgi?id=154945
1433         <rdar://problem/8014795>
1434
1435         Reviewed by Brent Fulgham.
1436
1437         WebCore::URL will now invalidate URLs with illegal IDN. And functions inside WebCoreNSURLExtras.h
1438         that deal with IDN mapping will now return nil to signal error.
1439
1440         Test: fast/url/invalid-idn.html
1441
1442         * platform/URL.cpp:
1443         (WebCore::isSchemeFirstChar):
1444         (WebCore::URL::init):
1445         (WebCore::appendEncodedHostname):
1446         (WebCore::encodeHostnames):
1447         (WebCore::encodeRelativeString):
1448         * platform/mac/WebCoreNSURLExtras.h:
1449         * platform/mac/WebCoreNSURLExtras.mm:
1450         (WebCore::mapHostNameWithRange):
1451         (WebCore::hostNameNeedsDecodingWithRange):
1452         (WebCore::hostNameNeedsEncodingWithRange):
1453         (WebCore::decodeHostNameWithRange):
1454         (WebCore::encodeHostNameWithRange):
1455         (WebCore::decodeHostName):
1456         (WebCore::encodeHostName):
1457         (WebCore::collectRangesThatNeedMapping):
1458         (WebCore::mapHostNames):
1459         (WebCore::URLWithData):
1460         (WebCore::dataWithUserTypedString):
1461         (WebCore::URLWithUserTypedString):
1462         (WebCore::URLWithUserTypedStringDeprecated):
1463         (WebCore::userVisibleString):
1464
1465 2016-03-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1466
1467         REGRESSION (r197724): [GTK] Web Inspector: Images being blocked by CSP 2.0
1468         https://bugs.webkit.org/show_bug.cgi?id=155432
1469
1470         Reviewed by Darin Adler.
1471
1472         The GTK+ port Web Inspector uses GResources for all internal
1473         resources (images, fonts, scripts, etc.) that are now blocked by
1474         the CSP. GResouces are like data URLs in practice, so we should
1475         always allow them.
1476
1477         * page/csp/ContentSecurityPolicySourceList.cpp:
1478         (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
1479
1480 2016-03-14  Alex Christensen  <achristensen@webkit.org>
1481
1482         Fix WinCairo build after r198195.
1483
1484         * platform/network/NetworkingContext.h:
1485         curl networking now uses NetworkingContext::storageSession.  That's everybody!
1486
1487 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
1488
1489         [WinCairo] Compile fix.
1490         https://bugs.webkit.org/show_bug.cgi?id=155463
1491
1492         Reviewed by Alex Christensen.
1493
1494         Get the NetworkStorageSession object from the document in the same way as other platforms do.
1495
1496         * loader/CookieJar.cpp:
1497         (WebCore::storageSession):
1498
1499 2016-03-14  Tim Horton  <timothy_horton@apple.com>
1500
1501         <attachment> on iOS should paint its progress indicator instead of a green square
1502         https://bugs.webkit.org/show_bug.cgi?id=155482
1503         <rdar://problem/24805991>
1504
1505         Reviewed by Simon Fraser.
1506
1507         No new tests; there are existing tests that will be enabled shortly.
1508
1509         * rendering/RenderThemeIOS.mm:
1510         (WebCore::getAttachmentProgress):
1511         Clamp progress to 0-1.
1512
1513         (WebCore::paintAttachmentProgress):
1514         Paint a pie.
1515
1516 2016-03-14  Chris Dumez  <cdumez@apple.com>
1517
1518         Unreviewed, rolling out r197981.
1519
1520         Caused a massive PLT regression on Mac.
1521
1522         Reverted changeset:
1523
1524         "Font antialiasing (smoothing) changes when elements are
1525         rendered into compositing layers"
1526         https://bugs.webkit.org/show_bug.cgi?id=23364
1527         http://trac.webkit.org/changeset/197981
1528
1529 2016-03-14  Chris Dumez  <cdumez@apple.com>
1530
1531         Unreviewed, rolling out r198145.
1532
1533         This attempt to disable the feature did not fix the PLT
1534         regression
1535
1536         Reverted changeset:
1537
1538         "Regression(r197981): Huge regression on Mac PLT"
1539         https://bugs.webkit.org/show_bug.cgi?id=155443
1540         http://trac.webkit.org/changeset/198145
1541
1542 2016-03-14  Sam Weinig  <sam@webkit.org>
1543
1544         Remove errant space.
1545
1546         * page/UserContentController.cpp:
1547
1548 2016-03-14  Sam Weinig  <sam@webkit.org>
1549
1550         Fix the windows build.
1551
1552         * page/UserContentController.cpp:
1553
1554 2016-03-14  Sam Weinig  <sam@webkit.org>
1555
1556         Add a baseURL parameter to _WKUserStyleSheet
1557         https://bugs.webkit.org/show_bug.cgi?id=155219
1558
1559         Reviewed by Tim Horton.
1560
1561         - Moves to a model for user content where instead of each page having a WebCore::UserContentController
1562           object, we have an abstract WebCore::UserContentProvider interface that can be implemented at the WebKit
1563           level. For now, legacy WebKit continues to use the old UserContentController, which implements 
1564           WebCore::UserContentProvider, and WebKit2 implements its own implementation so it can store additional
1565           state.
1566
1567         * WebCore.xcodeproj/project.pbxproj:
1568         Add new files.
1569
1570         * dom/ExtensionStyleSheets.cpp:
1571         (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
1572         Switch to using forEachUserStyleSheet on the UserContentProvider.
1573
1574         * html/HTMLMediaElement.cpp:
1575         (WebCore::HTMLMediaElement::loadResource):
1576         Remove null check now that we always have a UserContentProvider.
1577
1578         * loader/EmptyClients.cpp:
1579         (WebCore::fillWithEmptyClients):
1580         * loader/EmptyClients.h:
1581         Add new EmptyClients.
1582
1583         * loader/FrameLoader.cpp:
1584         (WebCore::FrameLoader::loadResourceSynchronously):
1585         Remove null check now that we always have a UserContentProvider.
1586
1587         * loader/PingLoader.cpp:
1588         (WebCore::processContentExtensionRulesForLoad):
1589         Remove null check now that we always have a UserContentProvider.
1590
1591         * loader/ResourceLoader.cpp:
1592         (WebCore::ResourceLoader::willSendRequestInternal):
1593         Remove null check now that we always have a UserContentProvider.
1594
1595         * loader/cache/CachedResourceLoader.cpp:
1596         (WebCore::CachedResourceLoader::requestResource):
1597         Remove null check now that we always have a UserContentProvider.
1598
1599         * page/DOMWindow.cpp:
1600         (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
1601         Remove null checks now that we always have a UserContentProvider, and userMessageHandlerDescriptors
1602         returns a reference.
1603
1604         (WebCore::DOMWindow::open):
1605         Remove null check now that we always have a UserContentProvider.
1606
1607         * page/Frame.cpp:
1608         (WebCore::Frame::injectUserScripts):
1609         Simplify by lifting document check out of the main loop and using forEachUserScript.
1610
1611         * page/Page.cpp:
1612         (WebCore::Page::Page):
1613         (WebCore::Page::~Page):
1614         (WebCore::Page::userContentProvider):
1615         (WebCore::Page::setUserContentProvider):
1616         (WebCore::Page::setUserContentController): Deleted.
1617         * page/Page.h:
1618         (WebCore::Page::userContentController): Deleted.
1619         * page/PageConfiguration.h:
1620         Store the UserContentProvider in a Ref, and require PageConfigurations to provide one. This
1621         removes a bunch of null checks and simplifies the code.
1622
1623         * page/UserContentController.cpp:
1624         (WebCore::UserContentController::~UserContentController):
1625         (WebCore::UserContentController::forEachUserScript):
1626         (WebCore::UserContentController::forEachUserStyleSheet):
1627         (WebCore::UserContentController::addUserScript):
1628         (WebCore::UserContentController::removeUserScript):
1629         (WebCore::UserContentController::removeUserScripts):
1630         (WebCore::UserContentController::addUserStyleSheet):
1631         (WebCore::UserContentController::removeUserStyleSheet):
1632         (WebCore::UserContentController::removeUserStyleSheets):
1633         (WebCore::UserContentController::addUserMessageHandlerDescriptor):
1634         (WebCore::UserContentController::removeUserMessageHandlerDescriptor):
1635         (WebCore::UserContentController::addUserContentExtension):
1636         (WebCore::UserContentController::removeUserContentExtension):
1637         (WebCore::UserContentController::removeAllUserContentExtensions):
1638         (WebCore::UserContentController::removeAllUserContent):
1639         (WebCore::UserContentController::addPage): Deleted.
1640         (WebCore::UserContentController::removePage): Deleted.
1641         (WebCore::contentExtensionsEnabled): Deleted.
1642         (WebCore::UserContentController::processContentExtensionRulesForLoad): Deleted.
1643         (WebCore::UserContentController::actionsForResourceLoad): Deleted.
1644         * page/UserContentController.h:
1645         (WebCore::UserContentController::userScripts): Deleted.
1646         (WebCore::UserContentController::userStyleSheets): Deleted.
1647         (WebCore::UserContentController::userMessageHandlerDescriptors): Deleted.
1648         Add inheritance from UserContentProvider and simplify things by removing unique_ptrs
1649         that were holding the member variables. There is usually only one UserContentController
1650         so having these in unique_ptrs doesn't make much sense.
1651         
1652         * page/UserContentProvider.cpp: Added.
1653         (WebCore::UserContentProvider::UserContentProvider):
1654         (WebCore::UserContentProvider::~UserContentProvider):
1655         (WebCore::UserContentProvider::addPage):
1656         (WebCore::UserContentProvider::removePage):
1657         (WebCore::UserContentProvider::invalidateInjectedStyleSheetCacheInAllFramesInAllPages):
1658         (WebCore::contentExtensionsEnabled):
1659         (WebCore::UserContentProvider::processContentExtensionRulesForLoad):
1660         (WebCore::UserContentProvider::actionsForResourceLoad):
1661         * page/UserContentProvider.h: Added.
1662         Add abstract class for providing user content and add some helpers on it.
1663
1664         * page/UserMessageHandlerDescriptor.h:
1665         (WebCore::UserMessageHandlerDescriptor::create):
1666         (WebCore::UserMessageHandlerDescriptor::client):
1667         (WebCore::UserMessageHandlerDescriptor::invalidateClient):
1668         * page/UserMessageHandlersNamespace.cpp:
1669         (WebCore::UserMessageHandlersNamespace::handler):
1670         Simplify now that userContentProvider() and userMessageHandlerDescriptors() are references.
1671
1672 2016-03-14  Enrica Casucci  <enrica@apple.com>
1673
1674         iOS: RTFD format is not available in the pasteboard after copy/cut.
1675         https://bugs.webkit.org/show_bug.cgi?id=155477
1676         rdar://problem/23500600
1677
1678         Reviewed by Tim Horton.
1679
1680         WebKit is using UTTypeRTFD instead of UTTypeFlatRTFD that is the
1681         proper RTFD format for pastedboard. I also discovered that, when
1682         we create the NSTextAttachment in the NSAttributedString we produce
1683         from the DOM range, we are not generating a file name with the
1684         appropriate extension for the MIME type. The iOS specific implementation
1685         of the MIMETypeRegistry functions were empty.
1686         There is no need to have a differentiation between OS X and iOS, so
1687         we now have only one file called MIMETypeRegistryCocoa.mm.
1688
1689         * WebCore.xcodeproj/project.pbxproj:
1690         * platform/cocoa/MIMETypeRegistryCocoa.mm: Added.
1691         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1692         (WebCore::MIMETypeRegistry::getExtensionsForMIMEType):
1693         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
1694         (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
1695         * platform/ios/MIMETypeRegistryIOS.mm: Removed.
1696         * platform/ios/PasteboardIOS.mm:
1697         (WebCore::Pasteboard::read):
1698         (WebCore::Pasteboard::supportedPasteboardTypes):
1699         (WebCore::Pasteboard::hasData):
1700         * platform/ios/PlatformPasteboardIOS.mm:
1701         (WebCore::PlatformPasteboard::write):
1702         * platform/mac/MIMETypeRegistryMac.mm: Removed.
1703
1704 2016-03-14  Daniel Bates  <dabates@apple.com>
1705
1706         Web Inspector: Display Content Security Policy hash in details sidebar for script and style elements
1707         https://bugs.webkit.org/show_bug.cgi?id=155466
1708         <rdar://problem/25152480>
1709
1710         Reviewed by Joseph Pecoraro and Timothy Hatcher.
1711
1712         For convenience, display the SHA-256 Content Security Policy (CSP) hash in the node details
1713         sidebar for the selected HTML script element or HTML style element. A CSP script hash is
1714         only applicable to inline JavaScript scripts. Therefore, we will display a hash for HTML
1715         script elements only if they do not have a src attribute.
1716
1717         Tests: inspector/dom/csp-big5-hash.html
1718                inspector/dom/csp-hash.html
1719
1720         * inspector/InspectorDOMAgent.cpp:
1721         (WebCore::computeContentSecurityPolicySHA256Hash): Added.
1722         (WebCore::InspectorDOMAgent::buildObjectForNode): For an applicable HTML script- or style-
1723         element, pass the computed SHA-256 CSP hash to the Inspector front end.
1724
1725 2016-03-14  Joonghun Park  <jh718.park@samsung.com>
1726
1727         Purge PassRefPtr from ArrayBuffer, ArchiveResource, Pasteboard, LegacyWebArchive and DataObjectGtk
1728         https://bugs.webkit.org/show_bug.cgi?id=150497
1729
1730         Reviewed by Darin Adler.
1731
1732         No new tests, no new behaviours.
1733
1734         * Modules/indexeddb/IDBGetResult.h:
1735         (WebCore::IDBGetResult::IDBGetResult):
1736         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1737         (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1738         * Modules/mediastream/RTCDataChannel.cpp:
1739         (WebCore::RTCDataChannel::didReceiveRawData):
1740         * dom/MessageEvent.cpp:
1741         (WebCore::MessageEvent::MessageEvent):
1742         * dom/MessageEvent.h:
1743         * editing/Editor.cpp:
1744         (WebCore::Editor::selectedRange):
1745         * editing/Editor.h:
1746         * editing/FrameSelection.h:
1747         (WebCore::FrameSelection::toNormalizedRange):
1748         * editing/VisiblePosition.cpp:
1749         (WebCore::makeRange):
1750         * editing/VisiblePosition.h:
1751         * editing/VisibleSelection.cpp:
1752         (WebCore::VisibleSelection::toNormalizedRange):
1753         * editing/VisibleSelection.h:
1754         * editing/VisibleUnits.cpp:
1755         (WebCore::enclosingTextUnitOfGranularity):
1756         (WebCore::wordRangeFromPosition):
1757         (WebCore::rangeExpandedByCharactersInDirectionAtWordBoundary):
1758         (WebCore::rangeExpandedAroundPositionByCharacters):
1759         * editing/VisibleUnits.h:
1760         * editing/cocoa/HTMLConverter.mm:
1761         (HTMLConverter::_addAttachmentForElement):
1762         (fileWrapperForURL):
1763         * editing/efl/EditorEfl.cpp:
1764         (WebCore::Editor::webContentFromPasteboard):
1765         * editing/gtk/EditorGtk.cpp:
1766         (WebCore::createFragmentFromPasteboardData):
1767         (WebCore::Editor::webContentFromPasteboard):
1768         * editing/ios/EditorIOS.mm:
1769         (WebCore::dataInRTFDFormat):
1770         (WebCore::dataInRTFFormat):
1771         (WebCore::Editor::selectionInWebArchiveFormat):
1772         (WebCore::Editor::WebContentReader::addFragment):
1773         (WebCore::Editor::WebContentReader::readWebArchive):
1774         (WebCore::Editor::WebContentReader::readRTFD):
1775         (WebCore::Editor::WebContentReader::readRTF):
1776         (WebCore::Editor::WebContentReader::readImage):
1777         (WebCore::Editor::WebContentReader::readURL):
1778         (WebCore::Editor::webContentFromPasteboard):
1779         (WebCore::Editor::pasteWithPasteboard):
1780         (WebCore::Editor::createFragmentAndAddResources):
1781         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
1782         * editing/mac/EditorMac.mm:
1783         (WebCore::Editor::selectionInWebArchiveFormat):
1784         (WebCore::Editor::adjustedSelectionRange):
1785         (WebCore::dataInRTFDFormat):
1786         (WebCore::dataInRTFFormat):
1787         (WebCore::Editor::dataSelectionForPasteboard):
1788         (WebCore::Editor::WebContentReader::readWebArchive):
1789         (WebCore::Editor::WebContentReader::readRTFD):
1790         (WebCore::Editor::WebContentReader::readRTF):
1791         (WebCore::Editor::WebContentReader::readImage):
1792         (WebCore::Editor::WebContentReader::readURL):
1793         (WebCore::Editor::webContentFromPasteboard):
1794         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
1795         (WebCore::Editor::createFragmentAndAddResources):
1796         * editing/win/EditorWin.cpp:
1797         (WebCore::createFragmentFromPlatformData):
1798         (WebCore::Editor::webContentFromPasteboard):
1799         * inspector/InspectorPageAgent.cpp:
1800         (WebCore::InspectorPageAgent::archive):
1801         * loader/DocumentLoader.cpp:
1802         (WebCore::DocumentLoader::mainResourceData):
1803         (WebCore::DocumentLoader::maybeCreateArchive):
1804         (WebCore::DocumentLoader::addArchiveResource):
1805         (WebCore::DocumentLoader::mainResource):
1806         * loader/DocumentLoader.h:
1807         * loader/FrameLoader.cpp:
1808         (WebCore::FrameLoader::loadArchive):
1809         * loader/SubstituteData.h:
1810         (WebCore::SubstituteData::SubstituteData):
1811         (WebCore::SubstituteData::isValid):
1812         * loader/SubstituteResource.h:
1813         (WebCore::SubstituteResource::data):
1814         (WebCore::SubstituteResource::SubstituteResource):
1815         * loader/appcache/ApplicationCacheGroup.cpp:
1816         (WebCore::ApplicationCacheGroup::didReceiveResponse):
1817         (WebCore::ApplicationCacheGroup::didReceiveData):
1818         (WebCore::ApplicationCacheGroup::didFail):
1819         (WebCore::ApplicationCacheGroup::didReceiveManifestData):
1820         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
1821         * loader/appcache/ApplicationCacheHost.cpp:
1822         (WebCore::ApplicationCacheHost::maybeLoadMainResource):
1823         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
1824         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
1825         * loader/appcache/ApplicationCacheResource.cpp:
1826         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
1827         (WebCore::ApplicationCacheResource::deliver):
1828         (WebCore::ApplicationCacheResource::estimatedSizeInStorage):
1829         * loader/appcache/ApplicationCacheResource.h:
1830         (WebCore::ApplicationCacheResource::create):
1831         * loader/appcache/ApplicationCacheStorage.cpp:
1832         (WebCore::ApplicationCacheStorage::store):
1833         (WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
1834         * loader/appcache/ApplicationCacheStorage.h:
1835         * loader/archive/ArchiveFactory.cpp:
1836         (WebCore::archiveFactoryCreate):
1837         (WebCore::ArchiveFactory::create):
1838         * loader/archive/ArchiveFactory.h:
1839         * loader/archive/ArchiveResource.cpp:
1840         (WebCore::ArchiveResource::ArchiveResource):
1841         (WebCore::ArchiveResource::create):
1842         * loader/archive/ArchiveResource.h:
1843         * loader/archive/ArchiveResourceCollection.cpp:
1844         (WebCore::ArchiveResourceCollection::addResource):
1845         * loader/archive/ArchiveResourceCollection.h:
1846         * loader/archive/cf/LegacyWebArchive.cpp:
1847         (WebCore::LegacyWebArchive::createPropertyListRepresentation):
1848         (WebCore::LegacyWebArchive::createResource):
1849         (WebCore::LegacyWebArchive::create):
1850         (WebCore::LegacyWebArchive::createFromSelection):
1851         * loader/archive/cf/LegacyWebArchive.h:
1852         * loader/archive/mhtml/MHTMLArchive.cpp:
1853         (WebCore::MHTMLArchive::create):
1854         * loader/archive/mhtml/MHTMLArchive.h:
1855         * loader/archive/mhtml/MHTMLParser.cpp:
1856         (WebCore::MHTMLParser::parseArchive):
1857         (WebCore::MHTMLParser::parseArchiveWithHeader):
1858         (WebCore::MHTMLParser::parseNextPart):
1859         * loader/archive/mhtml/MHTMLParser.h:
1860         * loader/cache/CachedImage.cpp:
1861         (WebCore::CachedImage::didAddClient):
1862         * loader/icon/IconDatabase.cpp:
1863         (WebCore::loadDefaultIconRecord):
1864         * loader/icon/IconRecord.cpp:
1865         (WebCore::IconRecord::setImageData):
1866         * loader/icon/IconRecord.h:
1867         * platform/Pasteboard.h:
1868         * platform/PasteboardStrategy.h:
1869         * platform/PlatformPasteboard.h:
1870         * platform/SharedBuffer.cpp:
1871         (WebCore::SharedBuffer::createArrayBuffer):
1872         (WebCore::utf8Buffer):
1873         * platform/SharedBuffer.h:
1874         (WebCore::SharedBuffer::create):
1875         * platform/cf/SharedBufferCF.cpp:
1876         (WebCore::SharedBuffer::wrapCFData):
1877         * platform/cocoa/NetworkExtensionContentFilter.mm:
1878         (WebCore::NetworkExtensionContentFilter::replacementData):
1879         * platform/cocoa/ParentalControlsContentFilter.mm:
1880         (WebCore::ParentalControlsContentFilter::replacementData):
1881         * platform/graphics/Image.cpp:
1882         (WebCore::Image::setData):
1883         * platform/graphics/Image.h:
1884         * platform/gtk/DataObjectGtk.cpp:
1885         (WebCore::DataObjectGtk::forClipboard):
1886         * platform/gtk/DataObjectGtk.h:
1887         (WebCore::DataObjectGtk::create):
1888         * platform/gtk/PasteboardGtk.cpp:
1889         (WebCore::Pasteboard::Pasteboard):
1890         (WebCore::Pasteboard::dataObject):
1891         * platform/ios/PasteboardIOS.mm:
1892         (WebCore::Pasteboard::read):
1893         * platform/ios/PlatformPasteboardIOS.mm:
1894         (WebCore::PlatformPasteboard::bufferForType):
1895         (WebCore::PlatformPasteboard::readBuffer):
1896         * platform/mac/PasteboardMac.mm:
1897         (WebCore::writeFileWrapperAsRTFDAttachment):
1898         (WebCore::Pasteboard::read):
1899         * platform/mac/PlatformPasteboardMac.mm:
1900         (WebCore::PlatformPasteboard::bufferForType):
1901         * platform/mac/SharedBufferMac.mm:
1902         (WebCore::SharedBuffer::wrapNSData):
1903         (WebCore::SharedBuffer::createFromReadingFile):
1904         * platform/network/MIMEHeader.cpp:
1905         (WebCore::retrieveKeyValuePairs):
1906         (WebCore::MIMEHeader::parseHeader):
1907         * platform/network/MIMEHeader.h:
1908         * platform/soup/SharedBufferSoup.cpp:
1909         (WebCore::SharedBuffer::wrapSoupBuffer):
1910         * platform/win/ClipboardUtilitiesWin.cpp:
1911         (WebCore::fragmentFromFilenames):
1912         (WebCore::fragmentFromCFHTML):
1913         (WebCore::fragmentFromHTML):
1914         * platform/win/ClipboardUtilitiesWin.h:
1915         * platform/win/PasteboardWin.cpp:
1916         (WebCore::Pasteboard::documentFragment):
1917
1918 2016-03-14  Oliver Hunt  <oliver@apple.com>
1919
1920         Temporarily disable the separated heap.
1921         https://bugs.webkit.org/show_bug.cgi?id=155472
1922
1923         Reviewed by Geoffrey Garen.
1924
1925         Temporarily disable this.
1926
1927         * Configurations/FeatureDefines.xcconfig:
1928
1929 2016-03-10  Antonio Gomes  <tonikitoo@webkit.org>
1930
1931         Selecting with shift+drag results in unexpected drag-n-drop
1932         https://bugs.webkit.org/show_bug.cgi?id=155314
1933
1934         Reviewed by Darin Adler.
1935
1936         Test: editing/selection/shift-drag-selection-no-drag-n-drop.html
1937
1938         Whenever user tries to extend an existing text selection by dragging the mouse
1939         (left button hold) with shift key pressed, WebKit enters drag-n-drop mode.
1940         This behavior does not match common editing behavior out there, including other
1941         browsers' (Firefox, Opera/Presto and IE).
1942
1943         Patch changes WebKit so that whenever one extends a selection with mouse
1944         and shift key pressed off of a #text node, it does not enter drag-n-drop mode.
1945
1946         Additionally, patch also adds some further tests to ensure that when
1947         selection is extended off of either a link or an image, drag-n-drop does
1948         get triggered, no matter if shift key is pressed.
1949
1950         * page/EventHandler.cpp:
1951         (WebCore::EventHandler::handleMousePressEvent):
1952
1953 2016-03-14  Brent Fulgham  <bfulgham@apple.com>
1954
1955         REGRESSION (r197114): Crash in WebCore::MediaDevicesRequest::didCompletePermissionCheck
1956         https://bugs.webkit.org/show_bug.cgi?id=155453
1957         <rdar://problem/24879447>
1958
1959         Reviewed by Daniel Bates.
1960
1961         Tested by fast/mediastream/enumerating-crash.html.
1962
1963         * Modules/mediastream/MediaDevicesRequest.cpp:
1964         (WebCore::MediaDevicesRequest::didCompletePermissionCheck): Prevent UserMediaPermissionCheck object from being
1965         destroyed before the method completes.
1966
1967 2016-03-14  Simon Fraser  <simon.fraser@apple.com>
1968
1969         Fix crash when reloading a page using requestAnimationFrame on iOS
1970         https://bugs.webkit.org/show_bug.cgi?id=155465
1971         rdar://problem/25100202
1972
1973         Reviewed by Tim Horton.
1974
1975         On iOS, it's possible for all clients for a DisplayRefreshMonitor
1976         to be unregistered, but still get a subsequent displayDidRefresh() for that monitor.
1977         In this case, we would remove(notFound) which release-asserts.
1978         
1979         Fix by just checking for notFound.
1980         
1981         Unable to test because requestAnimationFrame doesn't work in the simulator.
1982
1983         * platform/graphics/DisplayRefreshMonitorManager.cpp:
1984         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
1985
1986 2016-03-14  Per Arne Vollan  <peavo@outlook.com>
1987
1988         [WinCairo][MediaFoundation] Implement float versions of MediaPlayer methods.
1989         https://bugs.webkit.org/show_bug.cgi?id=155357
1990
1991         Reviewed by Brent Fulgham.
1992
1993         It is better to implement the float versions of some of the MediaPlayer methods,
1994         since the default implementation of the double versions is to call the float version.
1995         Also added override keyword to overridden methods.
1996
1997         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1998         (WebCore::MediaPlayerPrivateMediaFoundation::seeking):
1999         (WebCore::MediaPlayerPrivateMediaFoundation::seek):
2000         (WebCore::MediaPlayerPrivateMediaFoundation::setRate):
2001         (WebCore::MediaPlayerPrivateMediaFoundation::duration):
2002         (WebCore::MediaPlayerPrivateMediaFoundation::currentTime):
2003         (WebCore::MediaPlayerPrivateMediaFoundation::seekDouble): Deleted.
2004         (WebCore::MediaPlayerPrivateMediaFoundation::setRateDouble): Deleted.
2005         (WebCore::MediaPlayerPrivateMediaFoundation::durationDouble): Deleted.
2006         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2007
2008 2016-03-14  Tim Horton  <timothy_horton@apple.com>
2009
2010         Revert r194125 and r194186: We're going to fix this a different way.
2011
2012         * page/EventHandler.cpp:
2013         (WebCore::EventHandler::clear):
2014         * page/EventHandler.h:
2015
2016 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2017
2018         [Fetch API] FetchLoader should check for empty bodies
2019         https://bugs.webkit.org/show_bug.cgi?id=155440
2020
2021         Reviewed by Darin Adler.
2022
2023         Covered by added tests.
2024
2025         * Modules/fetch/FetchLoader.cpp:
2026         (WebCore::FetchLoader::didFinishLoading): returning empty array buffer/empty string if no data received during loading.
2027
2028 2016-03-14  Chris Dumez  <cdumez@apple.com>
2029
2030         Regression(r197981): Huge regression on Mac PLT
2031         https://bugs.webkit.org/show_bug.cgi?id=155443
2032         <rdar://problem/25113391>
2033
2034         Reviewed by Gavin Barraclough.
2035
2036         We have experience a huge regression on Mac PLT after r197981, so
2037         disable the feature until the performance issue is resolved.
2038
2039         * platform/graphics/ca/GraphicsLayerCA.cpp:
2040         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
2041
2042 2016-03-14  Chris Vienneau  <chris.vno@outlook.com>
2043
2044         PingHandle delete's itself but pointer is still used by handleDataURL
2045         https://bugs.webkit.org/show_bug.cgi?id=154752
2046         <rdar://problem/24872347>
2047
2048         Reviewed by Alex Christensen.
2049
2050         When a PingHandle is destroyed, we should tell its client so that the client can clear the pointer it
2051         holds to the element to avoid accidentally attempting to use deallocated memory.
2052
2053         The ResourceHandle's client member may be null after "didReceiveResponse" is called. We should confirm
2054         the client is still valid after these calls.
2055
2056         * platform/network/DataURL.cpp:
2057         (WebCore::handleDataURL): Check the client pointer before using it.
2058         * platform/network/PingHandle.h:
2059         (WebCore::PingHandle::~PingHandle): Notify the client we are being destroyed.
2060         * platform/platform/network/ResourceHandle.h:
2061
2062 2016-03-14  Zalan Bujtas  <zalan@apple.com>
2063
2064         Negative outline offset could break curved outline-style: auto
2065         https://bugs.webkit.org/show_bug.cgi?id=155416
2066
2067         Reviewed by Tim Horton.
2068
2069         When radius becomes negative the rounded rect could end up being un-renderable -> no rounded corners at all.
2070
2071         Test: fast/inline/hidpi-outline-auto-negative-offset-with-border-radius.html
2072
2073         * platform/graphics/PathUtilities.cpp:
2074         (WebCore::adjustedtRadiiForHuggingCurve):
2075
2076 2016-03-14  Zalan Bujtas  <zalan@apple.com>
2077
2078         [Outline: auto] Fractional radius value could result in non-renderable rounded border.
2079         https://bugs.webkit.org/show_bug.cgi?id=155420
2080
2081         Reviewed by Tim Horton.
2082
2083         RoundedRect::pixelSnappedRoundedRectForPainting ensures that the rounded rect is always renderable.
2084
2085         Test: fast/inline/hidpi-outline-auto-with-fractional-radius.html
2086
2087         * platform/graphics/PathUtilities.cpp:
2088         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
2089         * platform/graphics/PathUtilities.h:
2090         * rendering/RenderElement.cpp:
2091         (WebCore::RenderElement::paintFocusRing):
2092
2093 2016-03-14  Zalan Bujtas  <zalan@apple.com>
2094
2095         Outline: auto has sharp corners with single line contenteditable.
2096         https://bugs.webkit.org/show_bug.cgi?id=155418
2097
2098         Reviewed by Tim Horton.
2099
2100         Multiple rectangles assumed multiline content and it broke bottomLeft and bottomRight corner check.
2101         This patch adds fast path for polygons with 4 corners.
2102
2103         Test: fast/inline/hidpi-outline-auto-with-one-focusring-rect.html
2104
2105         * platform/graphics/PathUtilities.cpp:
2106         (WebCore::cornerType):
2107         (WebCore::cornerTypeForMultiline):
2108         (WebCore::rectFromPolygon):
2109         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
2110
2111 2016-03-14  Joanmarie Diggs  <jdiggs@igalia.com>
2112
2113         [AX] SVG element with child desc not exposed
2114         https://bugs.webkit.org/show_bug.cgi?id=155374
2115
2116         Reviewed by Darin Adler.
2117
2118         Covered by the accessibility/w3c-svg-roles.html test, which was updated.
2119
2120         AccessibilitySVGRoot is now a subclass of AccessibilitySVGElement, which
2121         exposes SVG elements with a child desc element as per the specification.
2122         Also made existing protected methods private.
2123
2124         * accessibility/AccessibilitySVGElement.h:
2125         * accessibility/AccessibilitySVGRoot.cpp:
2126         (WebCore::AccessibilitySVGRoot::AccessibilitySVGRoot):
2127         (WebCore::AccessibilitySVGRoot::parentObject):
2128         * accessibility/AccessibilitySVGRoot.h:
2129
2130 2016-03-14  Alexey Proskuryakov  <ap@apple.com>
2131
2132         Build fix.
2133
2134         * Modules/fetch/FetchBodyOwner.cpp:
2135         (WebCore::FetchBodyOwner::loadedBlobAsText):
2136
2137 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2138
2139         [Fetch API] Implement data resolution for blob stored in Body
2140         https://bugs.webkit.org/show_bug.cgi?id=155359
2141
2142         Reviewed by Darin Adler.
2143
2144         Introducing FetchLoader as a wrapper around ThreadableLoader to load resources.
2145         FetchLoader can retrieve data as text or array buffer. It only supports blob currently.
2146
2147         Introducing FetchLoaderClient interface and FetchBodyOwner::BlobLoader as specifc blob loader client.
2148
2149         Covered by existing rebased tests.
2150
2151         * CMakeLists.txt:
2152         * Modules/fetch/FetchBody.cpp:
2153         (WebCore::FetchBody::loadingType):
2154         (WebCore::FetchBody::loadedAsArrayBuffer):
2155         (WebCore::FetchBody::loadedAsText):
2156         * Modules/fetch/FetchBody.h:
2157         * Modules/fetch/FetchBodyOwner.cpp: Added.
2158         (WebCore::FetchBodyOwner::FetchBodyOwner):
2159         (WebCore::FetchBodyOwner::loadBlob):
2160         (WebCore::FetchBodyOwner::finishBlobLoading):
2161         (WebCore::FetchBodyOwner::blobLoadingFailed):
2162         (WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
2163         * Modules/fetch/FetchBodyOwner.h:
2164         (WebCore::FetchBodyOwner::loadedBlobAsText):
2165         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer):
2166         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2167         * Modules/fetch/FetchLoader.cpp: Added.
2168         (WebCore::FetchLoader::start):
2169         (WebCore::FetchLoader::FetchLoader):
2170         (WebCore::FetchLoader::stop):
2171         (WebCore::FetchLoader::didReceiveResponse):
2172         (WebCore::FetchLoader::didReceiveData):
2173         (WebCore::FetchLoader::didFinishLoading):
2174         (WebCore::FetchLoader::didFail):
2175         * Modules/fetch/FetchLoader.h: Added.
2176         * Modules/fetch/FetchLoaderClient.h: Added.
2177         (WebCore::FetchLoaderClient::~FetchLoaderClient):
2178         (WebCore::FetchLoaderClient::didReceiveResponse):
2179         (WebCore::FetchLoaderClient::didFinishLoadingAsText):
2180         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer):
2181         * WebCore.xcodeproj/project.pbxproj:
2182
2183 2016-03-14  Frederic Wang  <fwang@igalia.com>
2184
2185         Make MathML colspan/rowspan consistent with HTML table cells.
2186         https://bugs.webkit.org/show_bug.cgi?id=150253
2187
2188         Reviewed by Martin Robinson.
2189
2190         Test: mathml/rowspan-crash.xhtml
2191
2192         We make MathMLElement::colSpan and MathMLElement::rowSpan consistent with the corresponding functions in HTMLTableCellElement.cpp.
2193         These functions now return unsigned integers, use the same parsing functions and set a maximum for rowspan.
2194         This latter change fixes crash/timeout with large values of rowspan.
2195
2196         * mathml/MathMLElement.cpp: Include HTMLParserIdioms to use limitToOnlyHTMLNonNegative.
2197         (WebCore::MathMLElement::colSpan): Use unsigned integer and limitToOnlyHTMLNonNegative.
2198         (WebCore::MathMLElement::rowSpan): ditto. We also use the same maximum limit as HTMLTableCellElement.
2199         * mathml/MathMLElement.h: Make colSpan and rowSpan return unsigned integers.
2200
2201 2016-03-14  Tomas Popela  <tpopela@redhat.com>
2202
2203         Enable GSS-Negotiate support in libsoup
2204         https://bugs.webkit.org/show_bug.cgi?id=155354
2205
2206         Reviewed by Carlos Garcia Campos.
2207
2208         Enable the SOUP_TYPE_AUTH_NEGOTIATE feature if libsoup was compiled
2209         with the GSS-Negotiate support.
2210
2211         * platform/network/soup/SoupNetworkSession.cpp:
2212         (WebCore::SoupNetworkSession::SoupNetworkSession):
2213
2214 2016-03-14  Ryosuke Niwa  <rniwa@webkit.org>
2215
2216         Add slotchange event
2217         https://bugs.webkit.org/show_bug.cgi?id=155424
2218         <rdar://problem/24997534>
2219
2220         Reviewed by Antti Koivisto.
2221
2222         Added `slotchange` event as discussed on https://github.com/w3c/webcomponents/issues/288.
2223
2224         While the exact semantics of it could still evolve over time, this patch implements as
2225         an asynchronous event that fires on a slot element whenever its distributed nodes change
2226         (flattened assigned nodes):
2227         http://w3c.github.io/webcomponents/spec/shadow/#dfn-distributed-nodes
2228
2229         Since inserting or removing an element from a shadow host could needs to enqueue this event
2230         on the right slot element, this patch moves the invalidation point of element removals and
2231         insertions from Element::childrenChanged to Element::insertedInto and Element::removedFrom.
2232         Text nodes are still invalidated at Element::childrenChanged for performance reasons
2233         since it could only appear within a default slot element.
2234
2235         Because this more fine-grained invalidation needs to be overridden by HTMLDetailsElement,
2236         we now subclass SlotAssignment in HTMLDetailsElement instead of passing in a std::function.
2237
2238         Test: fast/shadow-dom/slotchange-event.html
2239
2240         * dom/Document.cpp:
2241         (WebCore::Document::enqueueSlotchangeEvent): Added.
2242         * dom/Document.h:
2243         * dom/Element.cpp:
2244         (WebCore::Element::attributeChanged): Call hostChildElementDidChangeSlotAttr.
2245         (WebCore::Element::insertedInto): Call hostChildElementDidChange.
2246         (WebCore::Element::removedFrom): Ditto.
2247         (WebCore::Element::childrenChanged): Don't invalidate the slots on ElementInserted and
2248         ElementRemoved since they're now done in Element::insertedInto and Element::removedFrom.
2249         * dom/Event.cpp:
2250         (WebCore::Event::scoped): slotchange event is scoped.
2251         * dom/EventNames.h: Added eventNames().slotchange.
2252         * dom/ShadowRoot.cpp:
2253         (WebCore::ShadowRoot::invalidateSlotAssignments): Deleted.
2254         (WebCore::ShadowRoot::invalidateDefaultSlotAssignments): Deleted.
2255         * dom/ShadowRoot.h:
2256         (ShadowRoot): Added more fine-grained invalidators, mirroring changes to SlotAssignment.
2257         * dom/SlotAssignment.cpp:
2258         (WebCore::SlotAssignment::SlotAssignment): Removed a variant that takes SlotNameFunction
2259         since HTMLDetailsElement now subclasses SlotAssignment.
2260         (WebCore::SlotAssignment::~SlotAssignment): Added now that the class is virtual.
2261         (WebCore::recursivelyFireSlotChangeEvent): Added.
2262         (WebCore::SlotAssignment::didChangeSlot): Added. Invalidates the style tree only if there
2263         is a corresponding slot element, and fires slotchange event. When the slot element we found
2264         in this shadow tree is assigned to a slot element inside an inner shadow tree, recursively
2265         fire slotchange event on each such inner slots.
2266         (WebCore::SlotAssignment::hostChildElementDidChange): Added. Update the matching slot when
2267         an element is inserted or removed under a shadow host.
2268         (WebCore::SlotAssignment::assignedNodesForSlot): Removed the superfluous early exit to an
2269         release assert since addSlotElementByName should always create a SlotInfo for each element.
2270         (WebCore::SlotAssignment::slotNameForHostChild): Added. This is the equivalent of old
2271         m_slotNameFunction which DetailsSlotAssignment overrides.
2272         (WebCore::SlotAssignment::invalidateDefaultSlot): Deleted.
2273         (WebCore::SlotAssignment::findFirstSlotElement): Added an assertion. slotInfo.element must
2274         be nullptr if elementCount is 0, and elementCount must be 0 if slotInfo.element is nullptr
2275         after calling resolveAllSlotElements, which traverses the entire shadow tree to find all
2276         slot elements.
2277         (WebCore::SlotAssignment::assignSlots):
2278         * dom/SlotAssignment.h: Implemented inline functions of ShadowRoot here to avoid including
2279         SlotAssignment.h in ShadowRoot.h. Not inlining them results in extra function calls for all
2280         builtin elements with shadow root without slot elements, which impacts performance.
2281         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost): Added.
2282         (WebCore::ShadowRoot::didChangeDefaultSlot): Added.
2283         (WebCore::ShadowRoot::hostChildElementDidChange): Added.
2284         (WebCore::ShadowRoot::hostChildElementDidChangeSlotAttribute): Added.
2285         (WebCore::ShadowRoot::innerSlotDidChange):
2286         * html/HTMLDetailsElement.cpp:
2287         (WebCore::DetailsSlotAssignment): Added. Subclasses SlotAssignment to override
2288         hostChildElementDidChange and slotNameForHostChild.
2289         (WebCore::DetailsSlotAssignment::hostChildElementDidChange): Added. We don't check if this
2290         is the first summary element since we don't know the answer when this function is called
2291         inside Element::removedFrom.
2292         (WebCore::DetailsSlotAssignment::slotNameForHostChild): Renamed from slotNameFunction. Also
2293         removed the code to return nullAtom when details element is not open as that messes up new
2294         fine-grained invalidation. Insert/remove the slot element in parseAttribute instead.
2295         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot): Don't insert the slot element for
2296         the summary since the details element is not open now.
2297         (WebCore::HTMLDetailsElement::parseAttribute): Remove and insert the slot element for the
2298         summary here instead of changing the behavior of slotNameForHostChild.
2299         * html/HTMLDetailsElement.h:
2300         * html/HTMLSlotElement.cpp:
2301         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Added. Enqueues a new slotchange event
2302         if we haven't done so for this element yet.
2303         (WebCore::HTMLSlotElement::dispatchEvent): Added. Clear m_hasEnqueuedSlotChangeEvent when
2304         dispatching a slotchange event so that a subsequent call to enqueueSlotChangeEvent would
2305         enqueue a new event. Note scripts call EventTarget::dispatchEventForBindings instead.
2306         * html/HTMLSlotElement.h:
2307
2308 2016-03-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2309
2310         Introduce CallWith=Document in binding generator
2311         https://bugs.webkit.org/show_bug.cgi?id=155358
2312
2313         Reviewed by Darin Adler.
2314
2315         Covered by existing tests and binding test.
2316
2317         * Modules/notifications/Notification.cpp:
2318         (WebCore::Notification::permission): Taking a Document& instead of ScriptExecutionContext&.
2319         (WebCore::Notification::requestPermission): Ditto.
2320         * Modules/notifications/Notification.h:
2321         * Modules/notifications/Notification.idl: Using CallWith=Document.
2322         * bindings/scripts/CodeGeneratorJS.pm: Adding support for CallWith=Document and changed name from scriptContext to context.
2323         (GenerateCallWith):
2324         (GenerateConstructorDefinition):
2325         * bindings/scripts/IDLAttributes.txt: Adding support for CallWith=Document.
2326         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2327         (webkit_dom_test_obj_with_document_argument):
2328         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2329         * bindings/scripts/test/JS/JSTestInterface.cpp:
2330         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
2331         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
2332         * bindings/scripts/test/JS/JSTestObj.cpp:
2333         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
2334         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
2335         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
2336         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2337         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2338         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
2339         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
2340         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
2341         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
2342         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
2343         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
2344         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
2345         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
2346         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
2347         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
2348         * bindings/scripts/test/ObjC/DOMTestObj.h:
2349         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2350         (-[DOMTestObj withDocumentArgument]):
2351         * bindings/scripts/test/TestObj.idl: Adding binding test.
2352         * page/DOMWindow.cpp:
2353         (WebCore::DOMWindow::focus): Taking a Document& instead of ScriptExecutionContext&.
2354         (WebCore::DOMWindow::close): Ditto.
2355         * page/DOMWindow.h:
2356         * page/DOMWindow.idl:
2357         * page/History.cpp:
2358         (WebCore::History::back): Ditto.
2359         (WebCore::History::forward): Ditto.
2360         (WebCore::History::go): Ditto.
2361         * page/History.h:
2362         * page/History.idl:
2363         * testing/Internals.cpp:
2364         (WebCore::InspectorStubFrontend::closeWindow): Calling DOMWindow::close() directly.
2365
2366 2016-03-13  Joseph Pecoraro  <pecoraro@apple.com>
2367
2368         Remove ENABLE(ES6_TEMPLATE_LITERAL_SYNTAX) guards
2369         https://bugs.webkit.org/show_bug.cgi?id=155417
2370
2371         Reviewed by Yusuke Suzuki.
2372
2373         * Configurations/FeatureDefines.xcconfig:
2374
2375 2016-03-13  Sam Weinig  <sam@webkit.org>
2376
2377         Implement unprivileged execCommand("copy") and execCommand("cut")
2378         <rdar://problem/24354406>
2379         https://bugs.webkit.org/show_bug.cgi?id=146336
2380
2381         Reviewed by Dean Jackson.
2382
2383         Test: editing/execCommand/clipboard-access-with-user-gesture.html
2384
2385         * WebCore.xcodeproj/project.pbxproj:
2386         Add new files.
2387
2388         * editing/ClipboardAccessPolicy.h:
2389         Added.
2390
2391         * editing/EditorCommand.cpp:
2392         (WebCore::defaultValueForSupportedCopyCut):
2393         (WebCore::supportedCopyCut):
2394         Match other browsers and allow the copy and cut commands
2395         to be executed when there is a user gesture.
2396
2397         * page/Settings.h:
2398         Add include of ClipboardAccessPolicy.h.
2399
2400         * page/Settings.in:
2401         Add new setting for ClipboardAccessPolicy
2402
2403 2016-03-13  Ryosuke Niwa  <rniwa@webkit.org>
2404
2405         REGRESSION (r190840): crash inside details element's slotNameFunction
2406         https://bugs.webkit.org/show_bug.cgi?id=155388
2407
2408         Reviewed by Antti Koivisto.
2409
2410         The bug was caused by HTMLDetailsElement::isActiveSummary calling findAssignedSlot with a summary element
2411         inside the shadow tree of the detials element. Fixed it by existing early when the summary element passed
2412         to isActiveSummary is not a direct child of the details element.
2413
2414         Test: fast/html/details-summary-tabindex-crash.html
2415
2416         * dom/ShadowRoot.cpp:
2417         (WebCore::ShadowRoot::findAssignedSlot): Added an assertion for regression testing.
2418         * dom/SlotAssignment.cpp:
2419         (WebCore::SlotAssignment::findAssignedSlot): Removed the superfluous call to assignSlots added in r190840.
2420         There is no need to update the slot assignments here (entires in m_slots are added or removed by
2421         addSlotElementByName or removeSlotElementByName and assignSlots only updates assignedNodes in each SlotInfo
2422         which is never used in this function or findFirstSlotElement.
2423         * html/HTMLDetailsElement.cpp:
2424         (WebCore::HTMLDetailsElement::isActiveSummary): Fixed the bug.
2425
2426 2016-03-13  Antti Koivisto  <antti@apple.com>
2427
2428         ComposedTreeIterator fails to traverse slots if root is shadow host
2429         https://bugs.webkit.org/show_bug.cgi?id=155407
2430
2431         Reviewed by Darin Adler.
2432
2433         Test: fast/shadow-dom/composed-tree-shadow-subtree.html
2434
2435         * dom/ComposedTreeIterator.cpp:
2436         (WebCore::ComposedTreeIterator::ComposedTreeIterator):
2437
2438             Traversal functions assume m_contextStack is deeper than 1 before they need to enter slot traversal code paths.
2439             Call initializeContextStack in case of shadow host which does the right thing.
2440
2441         (WebCore::ComposedTreeIterator::traverseSiblingInSlot):
2442         (WebCore::composedTreeAsText):
2443
2444             Add option to include pointers as debugging aid.
2445
2446         * dom/ComposedTreeIterator.h:
2447         (WebCore::composedTreeChildren):
2448
2449 2016-03-12  Sam Weinig  <sam@webkit.org>
2450
2451         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
2452         <rdar://problem/25129946>
2453         https://bugs.webkit.org/show_bug.cgi?id=155401
2454
2455         Reviewed by Alex Christensen.
2456
2457         Add a SessionID as a member of NetworkStorageSession. This allows us to avoid having HashMaps
2458         to map between the two types.
2459
2460         * platform/network/NetworkStorageSession.h:
2461         (WebCore::NetworkStorageSession::sessionID):
2462         (WebCore::NetworkStorageSession::credentialStorage):
2463         (WebCore::NetworkStorageSession::platformSession):
2464         * platform/network/NetworkStorageSessionStub.cpp:
2465         (WebCore::NetworkStorageSession::NetworkStorageSession):
2466         (WebCore::NetworkStorageSession::context):
2467         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
2468         (WebCore::defaultSession):
2469         (WebCore::NetworkStorageSession::defaultStorageSession):
2470         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2471         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2472         (WebCore::NetworkStorageSession::NetworkStorageSession):
2473         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2474         (WebCore::NetworkStorageSession::defaultStorageSession):
2475         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
2476         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2477         (WebCore::NetworkStorageSession::NetworkStorageSession):
2478         (WebCore::NetworkStorageSession::defaultStorageSession):
2479         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
2480         (WebCore::NetworkStorageSession::switchToNewTestingSession):
2481         (WebCore::NetworkStorageSession::soupNetworkSession):
2482
2483 2016-03-13  Jon Lee  <jonlee@apple.com>
2484
2485         getUserMedia requests from the main frame should be treated the same as requests from an iframe with the same origin
2486         https://bugs.webkit.org/show_bug.cgi?id=155405
2487         <rdar://problem/25131007>
2488
2489         Reviewed by Eric Carlson.
2490
2491         When gUM is called from the main frame, or from a subframe with the same origin, the
2492         top level document origin should be the same.
2493
2494         * Modules/mediastream/UserMediaRequest.cpp:
2495         (WebCore::UserMediaRequest::userMediaDocumentOrigin): Reverse the logic so that it is similar
2496         to topLevelDocumentOrigin.
2497         (WebCore::UserMediaRequest::topLevelDocumentOrigin): Return the top origin always.
2498
2499 2016-03-13  David Kilzer  <ddkilzer@apple.com>
2500
2501         REGRESSION (r198079): Windows build broke because of "%PRId64" format specifier
2502
2503         * platform/network/ParsedContentRange.cpp: Add #include
2504         <wtf/StdLibExtras.h> and remove local definition of "PRId64".
2505
2506 2016-03-13  Joonghun Park  <jh718.park@samsung.com>
2507
2508         [EFL] Fix debug build error since r197690. Unreviewed.
2509         https://bugs.webkit.org/show_bug.cgi?id=155408
2510
2511         Unreviewed. Change %lld to %PRId instead to correct the error below.
2512         error: format ‘%lld’ expects argument of type ‘long long int’,
2513         but argument 5 has type ‘std::chrono::duration<long int, std::ratio<1l, 1000l> >::rep
2514         {aka long int}’ [-Werror=format=]
2515
2516         * page/DOMTimer.cpp:
2517         (WebCore::DOMTimer::updateTimerIntervalIfNecessary):
2518
2519 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
2520
2521         [Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
2522         https://bugs.webkit.org/show_bug.cgi?id=155379
2523
2524         Reviewed by Beth Dakin.
2525
2526         There's no reason to not call them what they are.
2527
2528         No new tests because there is no behavior change.
2529
2530         * page/scrolling/AsyncScrollingCoordinator.cpp:
2531         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2532         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2533         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2534         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
2535         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
2536         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2537         * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
2538         (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
2539         (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
2540         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2541         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2542         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
2543         (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
2544         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
2545         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2546         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
2547         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2548         (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
2549         * platform/ScrollbarThemeComposite.h:
2550         * platform/mac/ScrollAnimatorMac.h:
2551         * platform/mac/ScrollAnimatorMac.mm:
2552         (scrollbarPainterForScrollbar):
2553         (-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
2554         (-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
2555         (-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
2556         (-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
2557         (-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
2558         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
2559         (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
2560         (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
2561         (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
2562         (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
2563         (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
2564         (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
2565         (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
2566         (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
2567         (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
2568         (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
2569         (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
2570         (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
2571         (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
2572         (WebCore::ScrollAnimatorMac::cancelAnimations):
2573         (WebCore::ScrollAnimatorMac::updateScrollerStyle):
2574         (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
2575         (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
2576         (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
2577         (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
2578         (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
2579         (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
2580         * platform/mac/ScrollbarThemeMac.h:
2581         * platform/mac/ScrollbarThemeMac.mm:
2582         (WebCore::scrollbarMap):
2583         (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
2584         (WebCore::ScrollbarThemeMac::registerScrollbar):
2585         (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
2586         (WebCore::ScrollbarThemeMac::painterForScrollbar):
2587         (WebCore::ScrollbarThemeMac::scrollbarThickness):
2588         (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
2589         (WebCore::ScrollbarThemeMac::hasThumb):
2590         (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
2591         (WebCore::scrollbarPainterPaint):
2592
2593 2016-03-12  Dean Jackson  <dino@apple.com>
2594
2595         REGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
2596         https://bugs.webkit.org/show_bug.cgi?id=155400
2597         <rdar://problem/24818602>
2598
2599         Reviewed by Anders Carlsson.
2600
2601         When we unprefixed CSS filters we accidentally
2602         stopped SVG elements that use the CSS filter shorthands
2603         from rendering. We still don't actually support
2604         the shorthands in this case, but we should render
2605         the element without the filter.
2606
2607         Tests: css3/filters/filters-on-svg-element.html
2608                css3/filters/filters-on-svg-root.html
2609
2610         * rendering/style/RenderStyle.cpp:
2611         (WebCore::RenderStyle::hasReferenceFilterOnly): Add
2612         this new function that tells us if we have the
2613         style of filter that we can handle in SVG content.
2614         * rendering/style/RenderStyle.h:
2615         * rendering/svg/SVGRenderingContext.cpp:
2616         (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
2617         We can mark an element as ready to render if it
2618         has a shorthand filter.
2619
2620 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
2621
2622         Delete dead SVG Font code
2623         https://bugs.webkit.org/show_bug.cgi?id=154718
2624
2625         Reviewed by Antti Koivisto.
2626
2627         All the ports have adopted the SVG -> OTF Font Converter, so there will never
2628         be an instantiation of a font backed by a DOM subtree. We can remove all the
2629         infrastructure used to support that.
2630
2631         No new tests because there is no behavior change.
2632
2633         * CMakeLists.txt:
2634         * Configurations/FeatureDefines.xcconfig:
2635         * WebCore.order:
2636         * WebCore.xcodeproj/project.pbxproj:
2637         * css/CSSFontFaceSource.cpp:
2638         (WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
2639         (WebCore::CSSFontFaceSource::font): Deleted.
2640         * css/CSSFontFaceSource.h:
2641         * loader/cache/CachedFont.cpp:
2642         * loader/cache/CachedSVGFont.cpp:
2643         (WebCore::CachedSVGFont::createFont): Deleted.
2644         (WebCore::CachedSVGFont::ensureCustomFontData): Deleted.
2645         * loader/cache/CachedSVGFont.h:
2646         * platform/graphics/Font.cpp:
2647         (WebCore::Font::Font):
2648         (WebCore::fillGlyphPage):
2649         (WebCore::Font::description): Deleted.
2650         (WebCore::Font::createScaledFont): Deleted.
2651         (WebCore::Font::applyTransforms): Deleted.
2652         * platform/graphics/Font.h:
2653         (WebCore::Font::widthForGlyph):
2654         (WebCore::Font::SVGData::~SVGData): Deleted.
2655         (WebCore::Font::create): Deleted.
2656         (WebCore::Font::svgData): Deleted.
2657         (WebCore::Font::isSVGFont): Deleted.
2658         * platform/graphics/win/FontWin.cpp:
2659         * platform/graphics/FontCascade.cpp:
2660         (WebCore::FontCascade::drawText):
2661         (WebCore::FontCascade::drawEmphasisMarks):
2662         (WebCore::FontCascade::glyphDataForCharacter):
2663         (WebCore::FontCascade::adjustSelectionRectForText):
2664         (WebCore::FontCascade::offsetForPosition):
2665         (WebCore::FontCascade::drawEmphasisMarksForSimpleText):
2666         (WebCore::FontCascade::drawGlyphBuffer):
2667         (WebCore::isDrawnWithSVGFont): Deleted.
2668         (WebCore::FontCascade::width): Deleted.
2669         (WebCore::FontCascade::codePath): Deleted.
2670         * platform/graphics/FontCascade.h:
2671         * platform/graphics/GraphicsContext.h:
2672         * platform/graphics/SVGGlyph.cpp: Removed.
2673         (WebCore::processArabicFormDetection): Deleted.
2674         (WebCore::charactersWithArabicForm): Deleted.
2675         (WebCore::isCompatibleArabicForm): Deleted.
2676         (WebCore::isCompatibleGlyph): Deleted.
2677         * platform/graphics/SVGGlyph.h: Removed.
2678         (WebCore::SVGGlyph::SVGGlyph): Deleted.
2679         (WebCore::SVGGlyph::inheritedValue): Deleted.
2680         (WebCore::SVGGlyph::operator==): Deleted.
2681         * platform/graphics/TextRun.cpp:
2682         * platform/graphics/TextRun.h:
2683         (WebCore::TextRun::RenderingContext::~RenderingContext): Deleted.
2684         (WebCore::TextRun::renderingContext): Deleted.
2685         (WebCore::TextRun::setRenderingContext): Deleted.
2686         * platform/graphics/WidthIterator.cpp:
2687         (WebCore::WidthIterator::applyFontTransforms):
2688         (WebCore::WidthIterator::advanceInternal):
2689         (WebCore::WidthIterator::glyphDataForCharacter): Deleted.
2690         * platform/graphics/WidthIterator.h:
2691         (WebCore::WidthIterator::lastGlyphName): Deleted.
2692         (WebCore::WidthIterator::setLastGlyphName): Deleted.
2693         (WebCore::WidthIterator::arabicForms): Deleted.
2694         * platform/graphics/cairo/FontCairo.cpp:
2695         (WebCore::CairoGlyphToPathTranslator::advance):
2696         (WebCore::FontCascade::dashesForIntersectionsWithRect):
2697         (WebCore::CairoGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
2698         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2699         (WebCore::MacGlyphToPathTranslator::advance):
2700         (WebCore::FontCascade::dashesForIntersectionsWithRect):
2701         (WebCore::FontCascade::primaryFontIsSystemFont):
2702         (WebCore::FontCascade::drawEmphasisMarksForComplexText):
2703         (WebCore::MacGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
2704         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2705         (WebCore::HarfBuzzShaper::shapeHarfBuzzRuns): Deleted.
2706         * platform/graphics/mac/ComplexTextController.cpp:
2707         (WebCore::TextLayout::isNeeded):
2708         (WebCore::TextLayout::TextLayout):
2709         (WebCore::TextLayout::constructTextRun):
2710         * rendering/EllipsisBox.cpp:
2711         (WebCore::EllipsisBox::paint):
2712         (WebCore::EllipsisBox::selectionRect):
2713         (WebCore::EllipsisBox::paintSelection):
2714         * rendering/InlineTextBox.cpp:
2715         (WebCore::InlineTextBox::localSelectionRect):
2716         (WebCore::InlineTextBox::paint):
2717         (WebCore::InlineTextBox::paintSelection):
2718         (WebCore::InlineTextBox::paintCompositionBackground):
2719         (WebCore::InlineTextBox::paintDocumentMarker):
2720         (WebCore::InlineTextBox::paintTextMatchMarker):
2721         (WebCore::InlineTextBox::offsetForPosition):
2722         (WebCore::InlineTextBox::positionForOffset):
2723         (WebCore::InlineTextBox::constructTextRun):
2724         * rendering/InlineTextBox.h:
2725         * rendering/RenderBlock.cpp:
2726         (WebCore::RenderBlock::constructTextRun):
2727         * rendering/RenderBlock.h:
2728         * rendering/RenderBlockFlow.cpp:
2729         (WebCore::stripTrailingSpace):
2730         * rendering/RenderBlockLineLayout.cpp:
2731         (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
2732         * rendering/RenderDeprecatedFlexibleBox.cpp:
2733         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2734         * rendering/RenderFileUploadControl.cpp:
2735         (WebCore::RenderFileUploadControl::paintObject):
2736         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
2737         * rendering/RenderImage.cpp:
2738         (WebCore::RenderImage::setImageSizeForAltText):
2739         (WebCore::RenderImage::paintReplaced):
2740         * rendering/RenderListBox.cpp:
2741         (WebCore::RenderListBox::updateFromElement):
2742         * rendering/RenderListMarker.cpp:
2743         (WebCore::RenderListMarker::paint):
2744         (WebCore::RenderListMarker::computePreferredLogicalWidths):
2745         (WebCore::RenderListMarker::getRelativeMarkerRect):
2746         * rendering/RenderMenuList.cpp:
2747         (RenderMenuList::updateOptionsWidth):
2748         * rendering/RenderText.cpp:
2749         (WebCore::RenderText::widthFromCache):
2750         (WebCore::RenderText::trimmedPrefWidths):
2751         (WebCore::hyphenWidth):
2752         (WebCore::maxWordFragmentWidth):
2753         (WebCore::RenderText::computePreferredLogicalWidths):
2754         (WebCore::RenderText::width):
2755         * rendering/RenderTextControl.cpp:
2756         (WebCore::RenderTextControl::getAverageCharWidth):
2757         * rendering/RenderThemeIOS.mm:
2758         (WebCore::RenderThemeMeasureTextClient::RenderThemeMeasureTextClient):
2759         (WebCore::adjustInputElementButtonStyle):
2760         * rendering/SimpleLineLayout.cpp:
2761         (WebCore::SimpleLineLayout::canUseForFontAndText): Deleted.
2762         * rendering/line/BreakingContext.h:
2763         (WebCore::WordTrailingSpace::WordTrailingSpace):
2764         (WebCore::WordTrailingSpace::width):
2765         (WebCore::measureHyphenWidth):
2766         (WebCore::textWidth):
2767         (WebCore::tryHyphenating):
2768         (WebCore::BreakingContext::handleText):
2769         * rendering/svg/RenderSVGAllInOne.cpp:
2770         * rendering/svg/RenderSVGText.cpp:
2771         * rendering/svg/SVGInlineTextBox.cpp:
2772         (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting):
2773         (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
2774         (WebCore::SVGInlineTextBox::paintTextWithShadows):
2775         (WebCore::SVGInlineTextBox::constructTextRun): Deleted.
2776         * rendering/svg/SVGInlineTextBox.h:
2777         * rendering/svg/SVGTextLayoutEngine.cpp:
2778         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath):
2779         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
2780         (WebCore::SVGTextLayoutEngineSpacing::calculateSVGKerning): Deleted.
2781         * rendering/svg/SVGTextLayoutEngineSpacing.h:
2782         * rendering/svg/SVGTextMetrics.cpp:
2783         (WebCore::SVGTextMetrics::SVGTextMetrics):
2784         (WebCore::SVGTextMetrics::constructTextRun): Deleted.
2785         * rendering/svg/SVGTextMetrics.h:
2786         * rendering/svg/SVGTextMetricsBuilder.cpp:
2787         (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
2788         * rendering/svg/SVGTextRunRenderingContext.cpp: Removed.
2789         (WebCore::svgFontAndFontFaceElementForFontData): Deleted.
2790         (WebCore::SVGTextRunRenderingContext::floatWidthUsingSVGFont): Deleted.
2791         (WebCore::SVGTextRunRenderingContext::applySVGKerning): Deleted.
2792         (WebCore::SVGGlyphToPathTranslator::SVGGlyphToPathTranslator): Deleted.
2793         (WebCore::SVGGlyphToPathTranslator::transform): Deleted.
2794         (WebCore::SVGGlyphToPathTranslator::path): Deleted.
2795         (WebCore::SVGGlyphToPathTranslator::extents): Deleted.
2796         (WebCore::SVGGlyphToPathTranslator::moveToNextValidGlyph): Deleted.
2797         (WebCore::SVGGlyphToPathTranslator::advance): Deleted.
2798         (WebCore::SVGTextRunRenderingContext::createGlyphToPathTranslator): Deleted.
2799         (WebCore::SVGTextRunRenderingContext::drawSVGGlyphs): Deleted.
2800         (WebCore::missingGlyphForFont): Deleted.
2801         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter): Deleted.
2802         * rendering/svg/SVGTextRunRenderingContext.h: Removed.
2803         * svg/SVGAllInOne.cpp:
2804         * svg/SVGFontData.cpp: Removed.
2805         (WebCore::SVGFontData::SVGFontData): Deleted.
2806         (WebCore::SVGFontData::initializeFont): Deleted.
2807         (WebCore::SVGFontData::widthForSVGGlyph): Deleted.
2808         (WebCore::SVGFontData::applySVGGlyphSelection): Deleted.
2809         (WebCore::SVGFontData::fillSVGGlyphPage): Deleted.
2810         (WebCore::SVGFontData::fillBMPGlyphs): Deleted.
2811         (WebCore::SVGFontData::fillNonBMPGlyphs): Deleted.
2812         (WebCore::computeNormalizedSpaces): Deleted.
2813         (WebCore::createStringWithMirroredCharacters): Deleted.
2814         * svg/SVGFontData.h: Removed.
2815         (WebCore::SVGFontData::~SVGFontData): Deleted.
2816         (WebCore::SVGFontData::svgFontFaceElement): Deleted.
2817         (WebCore::SVGFontData::horizontalOriginX): Deleted.
2818         (WebCore::SVGFontData::horizontalOriginY): Deleted.
2819         (WebCore::SVGFontData::horizontalAdvanceX): Deleted.
2820         (WebCore::SVGFontData::verticalOriginX): Deleted.
2821         (WebCore::SVGFontData::verticalOriginY): Deleted.
2822         (WebCore::SVGFontData::verticalAdvanceY): Deleted.
2823         * svg/SVGFontElement.cpp:
2824         (WebCore::SVGFontElement::SVGFontElement): Deleted.
2825         (WebCore::SVGFontElement::invalidateGlyphCache): Deleted.
2826         (WebCore::SVGFontElement::firstMissingGlyphElement): Deleted.
2827         (WebCore::SVGFontElement::registerLigaturesInGlyphCache): Deleted.
2828         (WebCore::SVGFontElement::ensureGlyphCache): Deleted.
2829         (WebCore::SVGKerningMap::clear): Deleted.
2830         (WebCore::SVGKerningMap::insert): Deleted.
2831         (WebCore::stringMatchesUnicodeRange): Deleted.
2832         (WebCore::stringMatchesGlyphName): Deleted.
2833         (WebCore::stringMatchesUnicodeName): Deleted.
2834         (WebCore::matches): Deleted.
2835         (WebCore::kerningForPairOfStringsAndGlyphs): Deleted.
2836         (WebCore::SVGFontElement::horizontalKerningForPairOfStringsAndGlyphs): Deleted.
2837         (WebCore::SVGFontElement::verticalKerningForPairOfStringsAndGlyphs): Deleted.
2838         (WebCore::SVGFontElement::collectGlyphsForString): Deleted.
2839         (WebCore::SVGFontElement::collectGlyphsForGlyphName): Deleted.
2840         (WebCore::SVGFontElement::svgGlyphForGlyph): Deleted.
2841         (WebCore::SVGFontElement::missingGlyph): Deleted.
2842         * svg/SVGFontElement.h:
2843         (WebCore::SVGKerning::SVGKerning): Deleted.
2844         (WebCore::SVGKerningMap::isEmpty): Deleted.
2845         * svg/SVGGlyphElement.cpp:
2846         (WebCore::SVGGlyphElement::invalidateGlyphCache): Deleted.
2847         (WebCore::SVGGlyphElement::parseAttribute): Deleted.
2848         (WebCore::SVGGlyphElement::insertedInto): Deleted.
2849         (WebCore::SVGGlyphElement::removedFrom): Deleted.
2850         (WebCore::parseArabicForm): Deleted.
2851         (WebCore::parseOrientation): Deleted.
2852         (WebCore::SVGGlyphElement::inheritUnspecifiedAttributes): Deleted.
2853         (WebCore::parseSVGGlyphAttribute): Deleted.
2854         (WebCore::SVGGlyphElement::buildGenericGlyphIdentifier): Deleted.
2855         (WebCore::SVGGlyphElement::buildGlyphIdentifier): Deleted.
2856         * svg/SVGGlyphElement.h:
2857         * svg/SVGGlyphMap.h: Removed.
2858         (WebCore::GlyphMapNode::GlyphMapNode): Deleted.
2859         (WebCore::GlyphMapNode::create): Deleted.
2860         (WebCore::SVGGlyphMap::SVGGlyphMap): Deleted.
2861         (WebCore::SVGGlyphMap::addGlyph): Deleted.
2862         (WebCore::SVGGlyphMap::appendToGlyphTable): Deleted.
2863         (WebCore::SVGGlyphMap::compareGlyphPriority): Deleted.
2864         (WebCore::SVGGlyphMap::collectGlyphsForString): Deleted.
2865         (WebCore::SVGGlyphMap::clear): Deleted.
2866         (WebCore::SVGGlyphMap::svgGlyphForGlyph): Deleted.
2867         (WebCore::SVGGlyphMap::glyphIdentifierForGlyphName): Deleted.
2868         * svg/SVGHKernElement.cpp:
2869         (WebCore::SVGHKernElement::insertedInto): Deleted.
2870         (WebCore::SVGHKernElement::removedFrom): Deleted.
2871         * svg/SVGHKernElement.h:
2872         * svg/SVGToOTFFontConversion.cpp:
2873         * svg/SVGToOTFFontConversion.h:
2874         * svg/SVGVKernElement.cpp:
2875         (WebCore::SVGVKernElement::insertedInto): Deleted.
2876         (WebCore::SVGVKernElement::removedFrom): Deleted.
2877         * svg/SVGVKernElement.h:
2878
2879 2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
2880
2881         [OS X] Scrollbars of overflow:scroll divs should appear on the left on RTL systems
2882         https://bugs.webkit.org/show_bug.cgi?id=155385
2883
2884         Reviewed by Simon Fraser.
2885
2886         There is already some existing setup for RTL scrollbars. This patch hooks up this
2887         existing support to the OS X triggering mechanism introduced in r197956. It also
2888         fixes up the existing support to function even when the direction of the
2889         RTL-scrollbar div is LTR (this means the contents of the div must be pushed
2890         over by the width of the scrollbar).
2891
2892         Tests: fast/scrolling/rtl-scrollbars-overflow-contents.html
2893                fast/scrolling/rtl-scrollbars-overflow-dir-rtl.html
2894                fast/scrolling/rtl-scrollbars-overflow-padding.html
2895                fast/scrolling/rtl-scrollbars-overflow-simple.html
2896                fast/scrolling/rtl-scrollbars-overflow.html
2897
2898         * rendering/RenderBlock.cpp:
2899         (WebCore::RenderBlock::addOverflowFromPositionedObjects):
2900         (WebCore::RenderBlock::logicalLeftOffsetForContent):
2901         (WebCore::RenderBlock::logicalRightOffsetForContent):
2902         * rendering/RenderBlockFlow.cpp:
2903         (WebCore::RenderBlockFlow::determineLogicalLeftPositionForChild):
2904         * rendering/RenderBox.cpp:
2905         (WebCore::RenderBox::overflowClipRect):
2906         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2907         * rendering/RenderLayer.cpp:
2908         (WebCore::RenderLayer::computeScrollDimensions):
2909         * rendering/style/RenderStyle.cpp:
2910         (WebCore::RenderStyle::shouldPlaceBlockDirectionScrollbarOnLogicalLeft):
2911         * rendering/style/RenderStyle.h:
2912
2913 2016-03-12  Zalan Bujtas  <zalan@apple.com>
2914
2915         [Forms: focus] focus rings around text fields do not follow contour (border-radius)
2916         https://bugs.webkit.org/show_bug.cgi?id=154099
2917         rdar://problem/9988429
2918
2919         Reviewed by Tim Horton.
2920
2921         This patch enables outline-style: auto to follow the curve of border-radius.
2922         When both border-radius and outline-style: auto are set, the native focusring painting will take the border-radius values
2923         into account. This is only for outline-style: auto, other non-auto outline styles paint as if there
2924         was no border-radius set.
2925         It supports both single and multiline content with joint rectangles.
2926         However in case of disjoint rectangles, we fallback to the non-radius drawing.
2927
2928         Tests: fast/inline/hidpi-outline-auto-with-border-radius-horizontal-ltr.html
2929                fast/inline/hidpi-outline-auto-with-border-radius-horizontal-rtl.html
2930                fast/inline/hidpi-outline-auto-with-border-radius-vertical-ltr.html
2931                fast/inline/hidpi-outline-auto-with-border-radius-vertical-rtl.html
2932
2933         * platform/graphics/GraphicsContext.h:
2934         * platform/graphics/Path.cpp:
2935         (WebCore::Path::addBeziersForRoundedRect):
2936         * platform/graphics/Path.h:
2937         (WebCore::Path::circleControlPoint):
2938         * platform/graphics/PathUtilities.cpp:
2939         (WebCore::polygonsForRect):
2940         (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
2941         (WebCore::startAndEndPointsForCorner):
2942         (WebCore::cornerType):
2943         (WebCore::controlPointsForBezierCurve):
2944         (WebCore::adjustedtRadiiForHuggingCurve):
2945         (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
2946         * platform/graphics/PathUtilities.h:
2947         * platform/graphics/mac/GraphicsContextMac.mm:
2948         (WebCore::GraphicsContext::drawFocusRing):
2949         * rendering/RenderElement.cpp:
2950         (WebCore::RenderElement::paintFocusRing):
2951
2952 2016-03-11  Ryosuke Niwa  <rniwa@webkit.org>
2953
2954         Add Event.deepPath() and Event.scoped
2955         https://bugs.webkit.org/show_bug.cgi?id=153538
2956         <rdar://problem/24363836>
2957
2958         Reviewed by Darin Adler.
2959
2960         Added the support for deepPath(), scoped, and relatedTargetScoped on Event.prototype for shadow DOM:
2961         http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-event-interface
2962         and updated the EventPath class to respect scoped and relatedTargetScoped flags as specified at:
2963         http://w3c.github.io/webcomponents/spec/shadow/#get-the-parent
2964
2965         Tests: fast/shadow-dom/Extensions-to-Event-Interface.html
2966                fast/shadow-dom/trusted-event-scoped-flags.html
2967
2968         * bindings/scripts/CodeGeneratorJS.pm:
2969         (GenerateConstructorDefinition): Added the support for Conditional for InitializedByEventConstructor.
2970         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
2971         * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.h:
2972         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2973         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
2974         * bindings/scripts/test/ObjC/DOMTestEventConstructor.mm:
2975         * bindings/scripts/test/TestEventConstructor.idl: Added a test case for using InitializedByEventConstructor
2976         with Conditional.
2977         * dom/Event.cpp:
2978         (WebCore::Event::Event): Initialize m_scoped and m_relatedTargetScoped from EventInit dictionary.
2979         (WebCore::Event::scoped): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#scoped-flag
2980         (WebCore::Event::deepPath): Added.
2981         * dom/Event.h:
2982         (WebCore::Event::relatedTargetScoped): Added. Overridden by FocusEvent and MouseEvent to implement
2983         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
2984         (WebCore::Event::setEventPath): Added.
2985         (WebCore::Event::clearEventPath): Added.
2986         * dom/Event.idl: Added scoped, relatedTargetScoped, and deepPath() conditionally enabled for shadow DOM.
2987         * dom/EventContext.h:
2988         (WebCore::EventContext::currentTarget):
2989         * dom/EventDispatcher.cpp:
2990         (WebCore::EventDispatcher::dispatchEvent): Set the event path while the event is being dispatched.
2991         * dom/EventPath.cpp:
2992         (WebCore::shouldEventCrossShadowBoundary): Check event.scoped flag instead of hard-coding a list of events here
2993         which has been moved to Event::scoped. See above.
2994         (WebCore::EventPath::setRelatedTarget): Check m_event.relatedTargetScoped() instead of hard-coding a list of
2995         events here. relatedTargetScoped is overridden by FocusEvent and MouseEvent.
2996         (WebCore::EventPath::hasEventListeners): Fixed the misleading variable name.
2997         (WebCore::isUnclosedNodeOf): Added. Implements http://w3c.github.io/webcomponents/spec/shadow/#dfn-unclosed-node
2998         (WebCore::EventPath::computePathDisclosedToTarget): Added. Implements the algorithm to filter event targets:
2999         http://w3c.github.io/webcomponents/spec/shadow/#widl-Event-deepPath-sequence-EventTarget
3000         * dom/EventPath.h:
3001         * dom/FocusEvent.cpp:
3002         (WebCore::FocusEvent::relatedTargetScoped): Returns true when this is a trusted event per:
3003         http://w3c.github.io/webcomponents/spec/shadow/#relatedtargetscoped-flag
3004         * dom/FocusEvent.h:
3005         * dom/MouseEvent.cpp:
3006         (WebCore::MouseEvent::relatedTargetScoped): Ditto.
3007         * dom/MouseEvent.h:
3008
3009 2016-03-11  John Wilander  <wilander@apple.com>
3010
3011         Move prevalent resource classifier from WebCore to WebKit.
3012         https://bugs.webkit.org/show_bug.cgi?id=155242
3013         <rdar://problem/24913272>
3014
3015         Reviewed by Andy Estes.
3016
3017         No new tests since we have yet to decide how to set up tests for prevalent resources.
3018
3019         * loader/ResourceLoadObserver.cpp:
3020         (WebCore::ResourceLoadObserver::logFrameNavigation):
3021         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3022             - Removed calls to old classifier in WebCore.
3023         * loader/ResourceLoadStatistics.cpp:
3024         (WebCore::encodeHashCountedSet):
3025         (WebCore::ResourceLoadStatistics::checkAndSetAsPrevalentResourceIfNecessary): Deleted.
3026         (WebCore::ResourceLoadStatistics::hasPrevalentResourceCharacteristics): Deleted.
3027         * loader/ResourceLoadStatistics.h:
3028             - Deleted old classification functions.
3029         * loader/ResourceLoadStatisticsStore.cpp:
3030         (WebCore::ResourceLoadStatisticsStore::create):
3031         (WebCore::ResourceLoadStatisticsStore::fireDataModificationHandler):
3032         (WebCore::ResourceLoadStatisticsStore::hasEnoughDataForStatisticsProcessing):
3033             - New function to allow for checks before calls to processStatistics.
3034         (WebCore::ResourceLoadStatisticsStore::processStatistics):
3035             - New function that receives a lamda and executes it on every entry in its statistics map.
3036         * loader/ResourceLoadStatisticsStore.h:
3037
3038 2016-03-11  Jiewen Tan  <jiewen_tan@apple.com>
3039
3040         WebKit should not be redirected to an invalid URL
3041         https://bugs.webkit.org/show_bug.cgi?id=155263
3042         <rdar://problem/22820172>
3043
3044         Reviewed by Brent Fulgham.
3045
3046         Test: http/tests/navigation/redirect-to-invalid-url.html
3047
3048         * loader/SubresourceLoader.cpp:
3049         (WebCore::SubresourceLoader::willSendRequestInternal):
3050
3051 2016-03-10  Maksim Kisilev <mkisilev@yandex-team.ru>
3052
3053         Fix typo in StyleTreeResolver.cpp
3054         https://bugs.webkit.org/show_bug.cgi?id=139946
3055
3056         Reviewed by Andy Estes.
3057
3058         The constructor for CheckForVisibilityChangeOnRecalcStyle was improperly comparing the
3059         result of WKContentChange() (which is not a function) to WKContentVisibilityChange. I
3060         believe the above cast would implicitly resolve to WKContentNoChange in all cases,
3061         whether a visibility change had been observed or not.
3062         
3063         This patch corrects this problem. I would expect that this might affect some content
3064         visibility change behavior, but I'm not sure what the appropriate test case would be
3065         since this was apparently found through code inspection.
3066
3067         * style/StyleTreeResolver.cpp:
3068         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle):
3069
3070 2016-03-11  Chris Dumez  <cdumez@apple.com>
3071
3072         iOS-sim debug: WebCoreNSURLSessionTest.BasicOperation and WebCoreNSURLSessionTest.InvalidateEmpty asserting
3073         https://bugs.webkit.org/show_bug.cgi?id=155256
3074
3075         Reviewed by Alexey Proskuryakov.
3076
3077         r197628 consolidated the runtime application checking code for iOS and
3078         Mac. However, while the new code works fine for WebKit2, it is unsafe
3079         on WebKit1 / iOS and hits assertion in debug. The reason is that
3080         applicationBundleIdentifier() for getting called from several threads
3081         (WebThread, UIThread).
3082
3083         To address the problem, this patch renames applicationBundleIdentifier()
3084         to applicationBundleIdentifierOverride() and only initializes the
3085         override upon WebProcess and Network process initialization. We therefore
3086         do not initialize the override in WebKit1 or in the WebKit2 UIProcess.
3087         When the override is not set, we fall back to using the main bundle
3088         identifier (which does the right thing for WebKit1 / WebKit2 UIProcess)
3089         but without caching it to avoid thread safety issues.
3090
3091         No new tests, already covered by API tests currently crashing.
3092
3093         * platform/RuntimeApplicationChecks.mm:
3094         (WebCore::applicationBundleIdentifierOverride):
3095         - Renamed applicationBundleIdentifier() to applicationBundleIdentifierOverride()
3096           and only initialize upon initialization of the WebProcess or the Network
3097           process.
3098         - In debug, set a flag to indicate that the override was already queried.
3099
3100         (WebCore::applicationBundleIdentifier):
3101         New utility function that is returns the application bundle override if it is
3102         set and fallback to calling [[NSBundle mainBundle] bundleIdentifier] otherwise.
3103
3104         (WebCore::setApplicationBundleIdentifier):
3105         Add assertions to make sure that:
3106         1. This is always called from the main thread.
3107         2. The application bundle identifier has not been queried *before* getting
3108            overriden as this would indicate a bug in our code and we would have wrongly
3109            returned the main bundle identifier in such case.
3110
3111         (WebCore::MacApplication::isAppleMail):
3112         (WebCore::MacApplication::isIBooks):
3113         (WebCore::MacApplication::isITunes):
3114         (WebCore::MacApplication::isMicrosoftMessenger):
3115         (WebCore::MacApplication::isAdobeInstaller):
3116         (WebCore::MacApplication::isMicrosoftOutlook):
3117         (WebCore::MacApplication::isQuickenEssentials):
3118         (WebCore::MacApplication::isAperture):
3119         (WebCore::MacApplication::isVersions):
3120         (WebCore::MacApplication::isHRBlock):
3121         (WebCore::MacApplication::isHipChat):
3122         (WebCore::IOSApplication::isMobileSafari):
3123         (WebCore::IOSApplication::isDumpRenderTree):
3124         (WebCore::IOSApplication::isMobileStore):
3125         (WebCore::IOSApplication::isFacebook):
3126         (WebCore::IOSApplication::isDaijisenDictionary):
3127         (WebCore::IOSApplication::isNASAHD):
3128         (WebCore::IOSApplication::isTheEconomistOnIphone):
3129         (WebCore::IOSApplication::isWebProcess):
3130         (WebCore::IOSApplication::isIBooks):
3131         Drop assertions making sure the cached flag is correct. We now have
3132         an assertion to detect this earlier in setApplicationBundleIdentifier().
3133
3134 2016-03-10  Jer Noble  <jer.noble@apple.com>
3135
3136         Web Audio becomes distorted after sample rate changes
3137         https://bugs.webkit.org/show_bug.cgi?id=154538
3138         <rdar://problem/24771292>
3139
3140         Reviewed by Darin Adler.
3141
3142         When the underlying audio hardware sample rate changes, the AudioUnit render callback will begin asking
3143         for fewer or more frames. For example, when the sample rate goes from 44.1kHz to 48kHz, it will ask for
3144         118 samples instead of 128. (And vice-versa, 140 samples instead of 128.) But the Web Audio engine can only
3145         really handle requests in multiples of 128 samples. In the case where there are requests for < 128 samples,
3146         actually render 128, but save off the unrequested samples in a separate bus. Then fill that bus during the
3147         next request.
3148
3149         * platform/audio/AudioBus.cpp:
3150         (WebCore::AudioBus::copyFromRange): Added utility method.
3151         * platform/audio/AudioBus.h:
3152         * platform/audio/ios/AudioDestinationIOS.cpp:
3153         (WebCore::AudioDestinationIOS::AudioDestinationIOS): Create a "spare" bus.
3154         (WebCore::assignAudioBuffersToBus): Moved from inside render.
3155         (WebCore::AudioDestinationIOS::render): Save off extra samples to the "spare" bus.
3156         * platform/audio/ios/AudioDestinationIOS.h:
3157
3158 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3159
3160         Unreviewed build fix after r198023.
3161         https://bugs.webkit.org/show_bug.cgi?id=155024
3162
3163         Reviewed by Geoffrey Garen.
3164
3165         Update binding test results.
3166
3167         * bindings/scripts/test/JS/JSTestObj.cpp:
3168         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3169         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3170         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3171         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3172         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3173
3174 2016-03-11  Ryan Haddad  <ryanhaddad@apple.com>
3175
3176         Unreviewed, rolling out r197984.
3177
3178         This change caused an existing LayoutTest to fail
3179
3180         Reverted changeset:
3181
3182         "WebKit should not be redirected to an invalid URL"
3183         https://bugs.webkit.org/show_bug.cgi?id=155263
3184         http://trac.webkit.org/changeset/197984
3185
3186 2016-03-11  Yusuke Suzuki  <utatane.tea@gmail.com>
3187
3188         [ES6] Implement Reflect.set without receiver support
3189         https://bugs.webkit.org/show_bug.cgi?id=155024
3190
3191         Reviewed by Geoffrey Garen.
3192
3193         CustomSetter returns boolean value that indicates the result of [[Set]].
3194         According to this change, this patch modifies the CodeGeneratorJS and test results.
3195
3196         Currently, DOM elements' [[Set]] return true when the setter is found.
3197         This is good for the first step.
3198
3199         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3200         (WebCore::JSCSSStyleDeclaration::putDelegate):
3201         * bindings/js/JSDOMBinding.cpp:
3202         (WebCore::throwSetterTypeError):
3203         * bindings/js/JSDOMBinding.h:
3204         * bindings/js/JSDOMStringMapCustom.cpp:
3205         (WebCore::JSDOMStringMap::putDelegate):
3206         * bindings/js/JSDOMWindowBase.cpp:
3207         (WebCore::JSDOMWindowBase::updateDocument):
3208         * bindings/js/JSDOMWindowCustom.cpp:
3209         (WebCore::JSDOMWindow::put):
3210         (WebCore::JSDOMWindow::putByIndex):
3211         * bindings/js/JSHTMLAppletElementCustom.cpp:
3212         (WebCore::JSHTMLAppletElement::putDelegate):
3213         * bindings/js/JSHTMLEmbedElementCustom.cpp:
3214         (WebCore::JSHTMLEmbedElement::putDelegate):
3215         * bindings/js/JSHTMLObjectElementCustom.cpp:
3216         (WebCore::JSHTMLObjectElement::putDelegate):
3217         * bindings/js/JSLocationCustom.cpp:
3218         (WebCore::JSLocation::putDelegate):
3219         (WebCore::JSLocationPrototype::putDelegate):
3220         * bindings/js/JSPluginElementFunctions.cpp:
3221         (WebCore::pluginElementCustomPut):
3222         * bindings/js/JSPluginElementFunctions.h:
3223         * bindings/js/JSStorageCustom.cpp:
3224         (WebCore::JSStorage::putDelegate):
3225         * bindings/scripts/CodeGeneratorJS.pm:
3226         (GenerateHeader):
3227         (GenerateImplementation):
3228         (GeneratePrototypeDeclaration):
3229         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3230         (WebCore::setJSTestActiveDOMObjectConstructor):
3231         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3232         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
3233         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3234         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
3235         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3236         (WebCore::setJSTestCustomNamedGetterConstructor):
3237         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3238         (WebCore::setJSTestEventConstructorConstructor):
3239         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3240         (WebCore::setJSTestEventTargetConstructor):
3241         * bindings/scripts/test/JS/JSTestException.cpp:
3242         (WebCore::setJSTestExceptionConstructor):
3243         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3244         (WebCore::setJSTestGenerateIsReachableConstructor):
3245         * bindings/scripts/test/JS/JSTestInterface.cpp:
3246         (WebCore::setJSTestInterfaceConstructor):
3247         (WebCore::JSTestInterface::put):
3248         (WebCore::JSTestInterface::putByIndex):
3249         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
3250         (WebCore::setJSTestInterfaceImplementsStr2):
3251         (WebCore::setJSTestInterfaceImplementsStr3):
3252         (WebCore::setJSTestInterfaceImplementsNode):
3253         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
3254         (WebCore::setJSTestInterfaceSupplementalStr2):
3255         (WebCore::setJSTestInterfaceSupplementalStr3):
3256         (WebCore::setJSTestInterfaceSupplementalNode):
3257         * bindings/scripts/test/JS/JSTestInterface.h:
3258         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3259         (WebCore::setJSTestJSBuiltinConstructorConstructor):
3260         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
3261         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3262         (WebCore::setJSTestMediaQueryListListenerConstructor):
3263         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3264         (WebCore::setJSTestNamedConstructorConstructor):
3265         * bindings/scripts/test/JS/JSTestNode.cpp:
3266         (WebCore::setJSTestNodeConstructor):
3267         (WebCore::setJSTestNodeName):
3268         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3269         (WebCore::setJSTestNondeterministicConstructor):
3270         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
3271         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
3272         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
3273         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
3274         * bindings/scripts/test/JS/JSTestObj.cpp:
3275         (WebCore::setJSTestObjConstructor):
3276         (WebCore::setJSTestObjConstructorStaticStringAttr):
3277         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3278         (WebCore::setJSTestObjEnumAttr):
3279         (WebCore::setJSTestObjByteAttr):
3280         (WebCore::setJSTestObjOctetAttr):
3281         (WebCore::setJSTestObjShortAttr):
3282         (WebCore::setJSTestObjUnsignedShortAttr):
3283         (WebCore::setJSTestObjLongAttr):
3284         (WebCore::setJSTestObjLongLongAttr):
3285         (WebCore::setJSTestObjUnsignedLongLongAttr):
3286         (WebCore::setJSTestObjStringAttr):
3287         (WebCore::setJSTestObjTestObjAttr):
3288         (WebCore::setJSTestObjLenientTestObjAttr):
3289         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
3290         (WebCore::setJSTestObjXMLObjAttr):
3291         (WebCore::setJSTestObjCreate):
3292         (WebCore::setJSTestObjReflectedStringAttr):
3293         (WebCore::setJSTestObjReflectedIntegralAttr):
3294         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
3295         (WebCore::setJSTestObjReflectedBooleanAttr):
3296         (WebCore::setJSTestObjReflectedURLAttr):
3297         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
3298         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
3299         (WebCore::setJSTestObjReflectedCustomURLAttr):
3300         (WebCore::setJSTestObjTypedArrayAttr):
3301         (WebCore::setJSTestObjAttrWithGetterException):
3302         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
3303         (WebCore::setJSTestObjAttrWithSetterException):
3304         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
3305         (WebCore::setJSTestObjStringAttrWithGetterException):
3306         (WebCore::setJSTestObjStringAttrWithSetterException):
3307         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
3308         (WebCore::setJSTestObjCustomAttr):
3309         (WebCore::setJSTestObjOnfoo):
3310         (WebCore::setJSTestObjWithScriptStateAttribute):
3311         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
3312         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3313         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
3314         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3315         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3316         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3317         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3318         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
3319         (WebCore::setJSTestObjConditionalAttr1):
3320         (WebCore::setJSTestObjConditionalAttr2):
3321         (WebCore::setJSTestObjConditionalAttr3):
3322         (WebCore::setJSTestObjConditionalAttr4Constructor):
3323         (WebCore::setJSTestObjConditionalAttr5Constructor):
3324         (WebCore::setJSTestObjConditionalAttr6Constructor):
3325         (WebCore::setJSTestObjAnyAttribute):
3326         (WebCore::setJSTestObjMutablePoint):
3327         (WebCore::setJSTestObjImmutablePoint):
3328         (WebCore::setJSTestObjStrawberry):
3329         (WebCore::setJSTestObjStrictFloat):
3330         (WebCore::setJSTestObjId):
3331         (WebCore::setJSTestObjReplaceableAttribute):
3332         (WebCore::setJSTestObjNullableLongSettableAttribute):
3333         (WebCore::setJSTestObjNullableStringSettableAttribute):
3334         (WebCore::setJSTestObjNullableStringValue):
3335         (WebCore::setJSTestObjAttributeWithReservedEnumType):
3336         (WebCore::setJSTestObjPutForwardsAttribute):
3337         (WebCore::setJSTestObjPutForwardsNullableAttribute):
3338         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3339         (WebCore::setJSTestOverloadedConstructorsConstructor):
3340         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3341         (WebCore::setJSTestOverrideBuiltinsConstructor):
3342         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3343         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
3344         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
3345         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
3346         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3347         (WebCore::setJSTestTypedefsConstructor):
3348         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
3349         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
3350         (WebCore::setJSTestTypedefsAttrWithGetterException):
3351         (WebCore::setJSTestTypedefsAttrWithSetterException):
3352         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
3353         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
3354         * bindings/scripts/test/JS/JSattribute.cpp:
3355         (WebCore::setJSattributeConstructor):
3356         * bindings/scripts/test/JS/JSreadonly.cpp:
3357         (WebCore::setJSreadonlyConstructor):
3358         * bridge/c/c_runtime.cpp:
3359         (JSC::Bindings::CField::setValueToInstance):
3360         * bridge/c/c_runtime.h:
3361         * bridge/jsc/BridgeJSC.h:
3362         (JSC::Bindings::Instance::put):
3363         * bridge/objc/objc_runtime.h:
3364         * bridge/objc/objc_runtime.mm:
3365         (JSC::Bindings::ObjcField::setValueToInstance):
3366         (JSC::Bindings::ObjcArray::setValueAt):
3367         (JSC::Bindings::ObjcFallbackObjectImp::put):
3368         * bridge/runtime_array.cpp:
3369         (JSC::RuntimeArray::put):
3370         (JSC::RuntimeArray::putByIndex):
3371         * bridge/runtime_array.h:
3372         * bridge/runtime_object.cpp:
3373         (JSC::Bindings::RuntimeObject::put):
3374         * bridge/runtime_object.h:
3375
3376 2016-03-11  David Kilzer  <ddkilzer@apple.com>
3377
3378         REGRESSION (r197956): WebContent process crashes on launch due to unrecognized selector
3379         <http://webkit.org/b/155356>
3380
3381         Reviewed by Alexey Proskuryakov.
3382
3383         * platform/mac/ScrollableAreaMac.mm:
3384         (WebCore::ScrollableArea::systemLanguageIsRTL): Add
3385         -respondsToSelector: check.
3386
3387 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3388
3389         WTF should have a similar function as equalLettersIgnoringASCIICase to match beginning of strings
3390         https://bugs.webkit.org/show_bug.cgi?id=153419
3391
3392         Reviewed by Darin Adler.
3393
3394         Covered by added unint tests.
3395
3396         * Modules/fetch/FetchHeaders.cpp:
3397         (WebCore::isForbiddenHeaderName): Using startsWithLettersIgnoringASCIICase.
3398
3399 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3400
3401         [Fetch API] Use DeferredWrapper directly in FetchBody promise handling
3402         https://bugs.webkit.org/show_bug.cgi?id=155291
3403
3404         Reviewed by Darin Adler.
3405
3406         Moved from typed DOMPromise to DeferredWrapper as there can only be one promise resolved.
3407         Started preparing the handling of blobs translation to other resolved types.
3408
3409         Fixed the case of empty body, in which case promises should resolve with empty objects (strings, buffers...) and not null.
3410
3411         Added Consumer structure to handle asynchronous resolution/rejection of promises.
3412         Added preliminary API to resolve promises based on data stored as a Blob.
3413         FetchBodyOwner will be responsible to do/stop blob loading.
3414
3415         Tests: imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty.html
3416                imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty.html
3417
3418         * Modules/fetch/FetchBody.cpp:
3419         (WebCore::FetchBody::processIfEmptyOrDisturbed): Fixed empty body case.
3420         (WebCore::FetchBody::arrayBuffer):
3421         (WebCore::FetchBody::blob):
3422         (WebCore::FetchBody::json):
3423         (WebCore::FetchBody::text):
3424         (WebCore::FetchBody::consume):
3425         (WebCore::FetchBody::consumeText):
3426         (WebCore::FetchBody::loadingType):
3427         (WebCore::FetchBody::consumeBlob):
3428         (WebCore::FetchBody::resolveAsJSON):
3429         (WebCore::FetchBody::loadingFailed):
3430         (WebCore::FetchBody::loadedAsBlob):
3431         * Modules/fetch/FetchBody.h:
3432         (WebCore::FetchBody::formData):
3433         (WebCore::FetchBody::Consumer::Consumer):
3434         * Modules/fetch/FetchBody.idl:
3435         * Modules/fetch/FetchBodyOwner.h:
3436         (WebCore::FetchBodyOwner::arrayBuffer):
3437         (WebCore::FetchBodyOwner::blob):
3438         (WebCore::FetchBodyOwner::formData):
3439         (WebCore::FetchBodyOwner::json):
3440         (WebCore::FetchBodyOwner::text):
3441         (WebCore::FetchBodyOwner::loadBlob):
3442
3443 2016-03-11  Yoav Weiss  <yoav@yoav.ws>
3444
3445         Avoid applying link tags with an invalid media attribute
3446         https://bugs.webkit.org/show_bug.cgi?id=143262
3447
3448         Reviewed by Brent Fulgham.
3449
3450         In current HTML spec, unlike HTML4, the UA must not apply <link> based resources
3451         when the media attribute does not match:
3452         https://html.spec.whatwg.org/multipage/semantics.html#attr-link-media
3453
3454         An invalid media attribute parsing creates a non-empty MediaQuerySet
3455         containing a single query with no expressions and no media type.
3456         (and with its m_ignored flag off)
3457
3458         In order to ignore such MediaQueries, I added an extra check that makes sure
3459         that the queries handled by MediaQueryEvaluator::eval have either expressions
3460         or a media type, and if not, they are ignored.
3461
3462         Test: fast/dom/HTMLLinkElement/link-stylesheet-invalid-media.html
3463
3464         * css/MediaQueryEvaluator.cpp:
3465         (WebCore::MediaQueryEvaluator::eval):
3466
3467 2016-03-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3468
3469         [CallWith=ScriptExecutionContext] should pass ScriptExecutionContext to the implementation by reference
3470         https://bugs.webkit.org/show_bug.cgi?id=155297
3471
3472         Reviewed by Darin Adler.
3473
3474         Changing the binding generator to pass ScriptExecutionContext by reference.
3475         Updating DOM classes accordingly.
3476
3477         Covered by existing tests.
3478
3479         * Modules/encryptedmedia/MediaKeySession.cpp:
3480         (WebCore::MediaKeySession::create):
3481         (WebCore::MediaKeySession::MediaKeySession):
3482         * Modules/encryptedmedia/MediaKeySession.h:
3483         * Modules/encryptedmedia/MediaKeys.cpp:
3484         (WebCore::MediaKeys::createSession):
3485         * Modules/encryptedmedia/MediaKeys.h:
3486         * Modules/fetch/FetchRequest.cpp:
3487         (WebCore::FetchRequest::clone):
3488         * Modules/fetch/FetchRequest.h:
3489         * Modules/fetch/FetchResponse.cpp:
3490         (WebCore::FetchResponse::error):
3491         (WebCore::FetchResponse::redirect):
3492         (WebCore::FetchResponse::clone):
3493         * Modules/fetch/FetchResponse.h:
3494         * Modules/indexeddb/IDBCursor.h:
3495         (WebCore::IDBCursor::continueFunction):
3496         * Modules/indexeddb/IDBFactory.h:
3497         * Modules/indexeddb/IDBIndex.h:
3498         * Modules/indexeddb/IDBKeyRange.cpp:
3499         (WebCore::IDBKeyRange::lowerValue):
3500         (WebCore::IDBKeyRange::upperValue):
3501         (WebCore::IDBKeyRange::only):
3502         (WebCore::IDBKeyRange::lowerBound):
3503         (WebCore::IDBKeyRange::upperBound):
3504         (WebCore::IDBKeyRange::bound):
3505         * Modules/indexeddb/IDBKeyRange.h:
3506         (WebCore::IDBKeyRange::lowerBound):
3507         (WebCore::IDBKeyRange::upperBound):
3508         (WebCore::IDBKeyRange::bound):
3509         * Modules/indexeddb/IDBObjectStore.h:
3510         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3511         (WebCore::IDBOpenDBRequest::IDBOpenDBRequest):
3512         * Modules/indexeddb/IDBOpenDBRequest.h:
3513         * Modules/indexeddb/IDBRequest.cpp:
3514         (WebCore::IDBRequest::IDBRequest):
3515         * Modules/indexeddb/IDBRequest.h:
3516         * Modules/indexeddb/client/IDBCursorImpl.cpp:
3517         (WebCore::IDBClient::IDBCursor::continueFunction):
3518         (WebCore::IDBClient::IDBCursor::deleteFunction):
3519         * Modules/indexeddb/client/IDBCursorImpl.h:
3520         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
3521         (WebCore::IDBClient::shouldThrowSecurityException):
3522         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
3523         (WebCore::IDBClient::IDBFactory::open):
3524         (WebCore::IDBClient::IDBFactory::openInternal):
3525         (WebCore::IDBClient::IDBFactory::deleteDatabase):
3526         (WebCore::IDBClient::IDBFactory::cmp):
3527         * Modules/indexeddb/client/IDBFactoryImpl.h:
3528         * Modules/indexeddb/client/IDBIndexImpl.cpp:
3529         (WebCore::IDBClient::IDBIndex::IDBIndex):
3530         (WebCore::IDBClient::IDBIndex::openCursor):
3531         (WebCore::IDBClient::IDBIndex::count):
3532         (WebCore::IDBClient::IDBIndex::openKeyCursor):
3533         (WebCore::IDBClient::IDBIndex::get):
3534         (WebCore::IDBClient::IDBIndex::getKey):
3535         * Modules/indexeddb/client/IDBIndexImpl.h:
3536         * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
3537         (WebCore::IDBClient::IDBObjectStore::create):
3538         (WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
3539         (WebCore::IDBClient::IDBObjectStore::openCursor):
3540         (WebCore::IDBClient::IDBObjectStore::get):
3541         (WebCore::IDBClient::IDBObjectStore::deleteFunction):
3542         (WebCore::IDBClient::IDBObjectStore::doDelete):
3543         (WebCore::IDBClient::IDBObjectStore::modernDelete):
3544         (WebCore::IDBClient::IDBObjectStore::clear):
3545         (WebCore::IDBClient::IDBObjectStore::createIndex):
3546         (WebCore::IDBClient::IDBObjectStore::index):
3547         (WebCore::IDBClient::IDBObjectStore::count):
3548         * Modules/indexeddb/client/IDBObjectStoreImpl.h:
3549         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
3550         (WebCore::IDBClient::IDBOpenDBRequest::createDeleteRequest):
3551         (WebCore::IDBClient::IDBOpenDBRequest::createOpenRequest):
3552         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
3553         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
3554         * Modules/indexeddb/client/IDBRequestImpl.cpp:
3555         (WebCore::IDBClient::IDBRequest::IDBRequest):
3556         * Modules/indexeddb/client/IDBRequestImpl.h:
3557         * Modules/indexeddb/client/IDBTransactionImpl.cpp:
3558         (WebCore::IDBClient::IDBTransaction::objectStore):
3559         (WebCore::IDBClient::IDBTransaction::createObjectStore):
3560         (WebCore::IDBClient::IDBTransaction::createIndex):
3561         * Modules/mediasource/DOMURLMediaSource.cpp:
3562         (WebCore::DOMURLMediaSource::createObjectURL):
3563         * Modules/mediasource/DOMURLMediaSource.h:
3564         * Modules/mediastream/DOMURLMediaStream.cpp:
3565         (WebCore::DOMURLMediaStream::createObjectURL):
3566         * Modules/mediastream/DOMURLMediaStream.h:
3567         * Modules/mediastream/HTMLMediaElementMediaStream.cpp:
3568         (WebCore::HTMLMediaElementMediaStream::setSrcObject):
3569         * Modules/mediastream/HTMLMediaElementMediaStream.h:
3570         * Modules/mediastream/HTMLMediaElementMediaStream.idl:
3571         * Modules/notifications/Notification.cpp:
3572         (WebCore::Notification::Notification):
3573         (WebCore::Notification::create):
3574         (WebCore::Notification::permission):
3575         (WebCore::Notification::requestPermission):
3576         * Modules/notifications/Notification.h:
3577         * Modules/notifications/NotificationCenter.cpp:
3578         (WebCore::NotificationCenter::createNotification):
3579         * Modules/notifications/NotificationClient.h:
3580         * Modules/quota/StorageInfo.cpp:
3581         (WebCore::StorageInfo::queryUsageAndQuota):
3582         (WebCore::StorageInfo::requestQuota):
3583         * Modules/quota/StorageInfo.h:
3584         * Modules/quota/StorageQuota.h:
3585         * bindings/js/JSIDBObjectStoreCustom.cpp:
3586         (WebCore::JSIDBObjectStore::createIndex):
3587         * bindings/scripts/CodeGeneratorJS.pm:
3588         (GenerateCallWith):
3589         * bindings/scripts/test/JS/JSTestInterface.cpp:
3590         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
3591         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
3592         * bindings/scripts/test/JS/JSTestObj.cpp:
3593         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
3594         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
3595         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
3596         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3597         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3598         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
3599         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
3600         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
3601         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
3602         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
3603         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
3604         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
3605         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
3606         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
3607         * fileapi/FileReaderSync.cpp:
3608         (WebCore::FileReaderSync::readAsArrayBuffer):
3609         (WebCore::FileReaderSync::readAsBinaryString):
3610         (WebCore::FileReaderSync::readAsText):
3611         (WebCore::FileReaderSync::readAsDataURL):
3612         (WebCore::FileReaderSync::startLoading):
3613         * fileapi/FileReaderSync.h:
3614         (WebCore::FileReaderSync::readAsText):
3615         * html/DOMURL.cpp:
3616         (WebCore::DOMURL::createObjectURL):
3617         (WebCore::DOMURL::createPublicURL):
3618         (WebCore::DOMURL::revokeObjectURL):
3619         * html/DOMURL.h:
3620         * html/HTMLMediaElement.cpp:
3621         (WebCore::HTMLMediaElement::setSrcObject):
3622         * html/HTMLMediaElement.h:
3623         * inspector/InspectorIndexedDBAgent.cpp:
3624         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
3625         * page/DOMWindow.h:
3626         * page/History.h:
3627         (WebCore::History::back):
3628         (WebCore::History::forward):
3629         (WebCore::History::go):
3630
3631 2016-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3632
3633         [GTK] Fix rendering of slider input elements
3634         https://bugs.webkit.org/show_bug.cgi?id=155296
3635
3636         Reviewed by Michael Catanzaro.
3637
3638         Use the new gadgets for newer GTK+ and improve a bit the rendering
3639         for previous versions to better match GTK+.
3640
3641         * rendering/RenderThemeGtk.cpp:
3642         (WebCore::createStyleContext): Add ScaleContents and
3643         ScaleHighlight parts that are only used with GTK+ 3.19.
3644         (WebCore::RenderThemeGtk::paintSliderTrack): Use a smaller trough,
3645         centered in the given rectangle to better match GTK+. Also render
3646         the hightlight gadget with GTK+ 3.19.
3647         (WebCore::RenderThemeGtk::paintSliderThumb): Also create the style
3648         context for contents gadget.
3649         (WebCore::RenderThemeGtk::adjustSliderThumbSize): Take into
3650         account the slider border when calculating the slider thumb size.
3651
3652 2016-03-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3653
3654         [GTK] Scrollbars are broken once again with current GTK+ master
3655         https://bugs.webkit.org/show_bug.cgi?id=155292
3656
3657         Reviewed by Michael Catanzaro.
3658
3659         Most of the trough theming properties have been moved to the
3660         scrollbar, and a new gadget "contents" has been added between the
3661         scrollbar and its children.
3662
3663         * platform/gtk/ScrollbarThemeGtk.cpp:
3664         (WebCore::ScrollbarThemeGtk::getOrCreateStyleContext): Add
3665         left/bottom style classes to ensure the scrollbars border is taken
3666         into account and rendered.
3667         (WebCore::ScrollbarThemeGtk::paintTrackBackground): Also create
3668         style context for contents gadget.
3669         (WebCore::ScrollbarThemeGtk::paintThumb): Ditto.
3670         (WebCore::ScrollbarThemeGtk::paintButton): Ditto.
3671         (WebCore::ScrollbarThemeGtk::scrollbarThickness): Take the
3672         scrollbar border into account.
3673         (WebCore::ScrollbarThemeGtk::buttonSize): Also create style
3674         context for contents gadget.
3675         (WebCore::ScrollbarThemeGtk::getStepperSpacing): Ditto.
3676         (WebCore::ScrollbarThemeGtk::minimumThumbLength): Ditto.
3677         (WebCore::ScrollbarThemeGtk::thumbFatness): Ditto.
3678         (WebCore::ScrollbarThemeGtk::getTroughBorder): Take the scrollbar
3679         border into account.
3680
3681 2016-03-10  David Kilzer  <ddkilzer@apple.com>
3682
3683         REGRESSION (r197983): Build fails due to missing inline method
3684
3685         Attempt to fix the following build failure:
3686
3687             Undefined symbols for architecture arm64:
3688               "JSC::GenericTypedArrayView<JSC::Uint8ClampedAdaptor>::createUninitialized(unsigned int)", referenced from:
3689                   WebCore::ImageBufferData::getData(WebCore::IntRect const&, WebCore::IntSize const&, bool, bool, float) const in ImageBufferDataCG.o
3690
3691         * platform/graphics/cg/ImageBufferDataCG.cpp: Include some
3692         headers to match FEGaussianBlur.cpp and FilterEffect.cpp.
3693
3694 2016-03-10  Tim Horton  <timothy_horton@apple.com>
3695
3696         Try to fix the iOS 9 build.
3697
3698         * editing/cocoa/DataDetection.mm:
3699         (WebCore::DataDetection::detectContentInRange):
3700         * platform/cocoa/DataDetectorsCoreSoftLink.h:
3701         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
3702         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
3703
3704 2016-03-10  David Kilzer  <ddkilzer@apple.com>
3705
3706         REGRESSION (r197976): Build failure due to missing DDOptionalSource.h header
3707
3708         Follow-up fix for:
3709             Expose additional WKDataDetectorTypes.
3710             <https://bugs.webkit.org/show_bug.cgi?id=155331>
3711
3712         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Protect
3713         DDOptionalSource.h with version check.
3714
3715 2016-03-10  Alex Christensen  <achristensen@webkit.org>
3716
3717         Fix Windows build after r197986.
3718
3719         * accessibility/AccessibilityObject.h:
3720
3721 2016-03-10  Jeremy Jones  <jeremyj@apple.com>
3722
3723         Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
3724         https://bugs.webkit.org/show_bug.cgi?id=155117
3725         rdar://problem/6802240
3726
3727         Reviewed by Simon Fraser.
3728
3729         No new tests because no new functionality was added.
3730
3731         This will prevent persistent media caches when webkit is using in memory caching.
3732
3733         * html/HTMLMediaElement.cpp:
3734         (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache): Added.
3735         * html/HTMLMediaElement.h: Declare mediaPlayerShouldUsePersistentCache().
3736         * page/ChromeClient.h: Declare mediaPlayerShouldUsePersistentCache().
3737         * platform/graphics/MediaPlayer.h:
3738         (WebCore::MediaPlayerClient::mediaPlayerShouldUsePersistentCache): Added.
3739         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3740         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Set property on AVAssetOptions.
3741
3742 2016-03-10  Jer Noble  <jer.noble@apple.com>
3743
3744         CRASH at WebCore::RenderView::updateVisibleViewportRect
3745         https://bugs.webkit.org/show_bug.cgi?id=155209
3746         <rdar://problem/23997530>
3747
3748         Reviewed by Simon Fraser.
3749
3750         Test: media/video-crash-invisible-autoplay-display-none.html
3751
3752         Between the time when the video element's renderer is created and destroyed, we may have unset the
3753         InvisibleAutoplayNotPermitted restriction. So rather than check for that restriction before
3754         unregistering for the "visible in viewport" notification, unregister only if the renderer
3755         was previously registered.
3756
3757         * html/HTMLMediaElement.cpp:
3758         (WebCore::HTMLMediaElement::willDetachRenderers):
3759
3760 2016-03-10  Zalan Bujtas  <zalan@apple.com>
3761
3762         Simple line layout: Add text-align: justify support.
3763         https://bugs.webkit.org/show_bug.cgi?id=155006
3764
3765         Reviewed by Antti Koivisto.
3766
3767         This patch enables text-align: justify; for simple line layout (only latin text for now).
3768         It speeds up/reduced memory consumption for justified text.
3769
3770         PerformanceTests/Layout/line-layout-simple.html
3771         before text-align: justify support -> mean: 86.20513022288704 runs/s
3772         after -> mean: 96.73972475626084 runs/s
3773
3774         Covered by existing text-align: justify tests.
3775
3776         * rendering/SimpleLineLayout.cpp:
3777         (WebCore::SimpleLineLayout::canUseForFontAndText):
3778         (WebCore::SimpleLineLayout::LineState::expansionOpportunityCount):
3779         (WebCore::SimpleLineLayout::LineState::expansionOportunity):
3780         (WebCore::SimpleLineLayout::expansionBehavior):
3781         (WebCore::SimpleLineLayout::justifyRuns):
3782         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
3783         (WebCore::SimpleLineLayout::createTextRuns):
3784         (WebCore::SimpleLineLayout::printReason):
3785         (WebCore::SimpleLineLayout::canUseForStyle): Deleted.
3786         * rendering/SimpleLineLayout.h:
3787         * rendering/SimpleLineLayoutFunctions.cpp:
3788         (WebCore::SimpleLineLayout::paintFlow):
3789         * rendering/SimpleLineLayoutResolver.h:
3790         (WebCore::SimpleLineLayout::RunResolver::Run::expansion):
3791         (WebCore::SimpleLineLayout::RunResolver::Run::expansionBehavior):
3792
3793 2016-03-10  Nan Wang  <n_wang@apple.com>
3794
3795         AX: Force allow user zoom
3796         https://bugs.webkit.org/show_bug.cgi?id=155056
3797
3798         Reviewed by Simon Fraser.
3799
3800         Override the maximum/minimum scale factor when forceAlwaysUserScalable is true.
3801
3802         Test: fast/viewport/ios/force-always-user-scalable.html
3803
3804         * Configurations/WebCoreTestSupport.xcconfig:
3805         * page/ViewportConfiguration.cpp:
3806         (WebCore::ViewportConfiguration::minimumScale):
3807         * page/ViewportConfiguration.h:
3808         (WebCore::ViewportConfiguration::maximumScale):
3809         * testing/Internals.cpp:
3810         (WebCore::Internals::resetToConsistentState):
3811         (WebCore::Internals::Internals):
3812         (WebCore::Internals::composedTreeAsText):
3813         (WebCore::Internals::setViewportForceAlwaysUserScalable):
3814         * testing/Internals.h:
3815         * testing/Internals.idl:
3816
3817 2016-03-10  Jiewen Tan  <jiewen_tan@apple.com>
3818
3819         WebKit should not be redirected to an invalid URL
3820         https://bugs.webkit.org/show_bug.cgi?id=155263
3821         <rdar://problem/22820172>
3822
3823         Reviewed by Brent Fulgham.
3824
3825         Test: http/tests/navigation/redirect-to-invalid-url.html
3826
3827         * loader/SubresourceLoader.cpp:
3828         (WebCore::SubresourceLoader::willSendRequestInternal):
3829
3830 2016-03-10  Nan Wang  <n_wang@apple.com>
3831
3832         AX: Implement bounds/position and index related text marker functions using TextIterator
3833         https://bugs.webkit.org/show_bug.cgi?id=154976
3834
3835         Reviewed by Chris Fleizach.
3836
3837         Implemented position and index related text marker calls with TextIterator. Also fixed some
3838         VoiceOver navigation issues.
3839
3840         Test: accessibility/mac/text-marker-for-index.html
3841
3842         * accessibility/AXObjectCache.cpp:
3843         (WebCore::AXObjectCache::traverseToOffsetInRange):
3844         (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
3845         (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
3846         (WebCore::AXObjectCache::shouldSkipBoundary):
3847         (WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
3848         (WebCore::AXObjectCache::startCharacterOffsetOfWord):
3849         (WebCore::AXObjectCache::nextBoundary):
3850         (WebCore::AXObjectCache::previousBoundary):
3851         (WebCore::AXObjectCache::previousSentenceStartCharacterOffset):
3852         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
3853         (WebCore::AXObjectCache::absoluteCaretBoundsForCharacterOffset):
3854         (WebCore::AXObjectCache::characterOffsetForPoint):
3855         (WebCore::AXObjectCache::characterOffsetForBounds):
3856         (WebCore::AXObjectCache::endCharacterOffsetOfLine):
3857         (WebCore::AXObjectCache::startCharacterOffsetOfLine):
3858         (WebCore::AXObjectCache::characterOffsetForIndex):
3859         (WebCore::AXObjectCache::indexForCharacterOffset):
3860         (WebCore::AXObjectCache::rootAXEditableElement):
3861         * accessibility/AXObjectCache.h:
3862         * accessibility/AccessibilityObject.cpp:
3863         (WebCore::AccessibilityObject::visiblePositionRangeForRange):
3864         (WebCore::AccessibilityObject::rangeForPlainTextRange):
3865         (WebCore::AccessibilityObject::lineRangeForPosition):
3866         * accessibility/AccessibilityObject.h:
3867         (WebCore::AccessibilityObject::boundsForVisiblePositionRange):
3868         (WebCore::AccessibilityObject::boundsForRange):
3869         (WebCore::AccessibilityObject::setSelectedVisiblePositionRange):
3870         (WebCore::AccessibilityObject::doAXStringForRange):
3871         (WebCore::AccessibilityObject::doAXBoundsForRange):
3872         (WebCore::AccessibilityObject::doAXBoundsForRangeUsingCharacterOffset):
3873         * accessibility/AccessibilityRenderObject.cpp:
3874         (WebCore::AccessibilityRenderObject::nodeIsTextControl):
3875         (WebCore::AccessibilityRenderObject::boundsForRects):
3876         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
3877         (WebCore::AccessibilityRenderObject::boundsForRange):
3878         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
3879         (WebCore::AccessibilityRenderObject::doAXBoundsForRange):
3880         (WebCore::AccessibilityRenderObject::doAXBoundsForRangeUsingCharacterOffset):
3881         (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest):
3882         * accessibility/AccessibilityRenderObject.h:
3883         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3884         (-[WebAccessibilityObjectWrapper positionForTextMarker:]):
3885         (-[WebAccessibilityObjectWrapper textMarkerRange]):
3886         (-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
3887         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
3888         (-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
3889         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
3890         (-[WebAccessibilityObjectWrapper textMarkerForPoint:]):
3891         (-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
3892         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3893         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
3894         (-[WebAccessibilityObjectWrapper _convertToNSRange:]):
3895         (-[WebAccessibilityObjectWrapper _indexForTextMarker:]):
3896         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
3897         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
3898         * editing/htmlediting.cpp:
3899         (WebCore::localCaretRectInRendererForCaretPainting):
3900         (WebCore::localCaretRectInRendererForRect):
3901         * editing/htmlediting.h:
3902
3903 2016-03-10  Simon Fraser  <simon.fraser@apple.com>
3904
3905         Font antialiasing (smoothing) changes when elements are rendered into compositing layers
3906         https://bugs.webkit.org/show_bug.cgi?id=23364
3907
3908         Reviewed by Tim Horton.
3909
3910         Improve the appearance of subpixel-antialiased ("smoothed") text in non-opaque layers
3911         by opting in to a new CALayer backing store format.
3912
3913         GraphicsLayer now has setSupportsSmoothedFonts(), which is called by RenderLayerBacking
3914         when the platform has support for the new feature. Ideally this would only be set when
3915         we know a layer has smoothed text drawn into it, but, for now, enable this for all
3916         layers. The right thing happens with opaque layers under the hood.
3917
3918         setSupportsSmoothedFonts() is turned into a PlatformCALayer contentsFormat flag, which
3919         is ultimately passed to setBackingStoreFormat().
3920
3921         We also need to propagate this flag to TileController tiles.
3922
3923         * platform/graphics/GraphicsLayer.cpp:
3924         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
3925         (WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
3926         (WebCore::GraphicsLayer::smoothedLayerTextEnabled):
3927         (WebCore::GraphicsLayer::GraphicsLayer):
3928         * platform/graphics/GraphicsLayer.h:
3929         (WebCore::GraphicsLayer::supportsSmoothedFonts):
3930         (WebCore::GraphicsLayer::setSupportsSmoothedFonts):
3931         * platform/graphics/TiledBacking.h:
3932         * platform/graphics/ca/GraphicsLayerCA.cpp:
3933         (WebCore::GraphicsLayer::supportsSmoothedLayerText):
3934         (WebCore::GraphicsLayer::setSmoothedLayerTextEnabled):
3935         (WebCore::GraphicsLayer::smoothedLayerTextEnabled):
3936         (WebCore::GraphicsLayerCA::setSupportsSmoothedFonts):
3937         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3938         (WebCore::GraphicsLayerCA::updateContentsFormat):
3939         * platform/graphics/ca/GraphicsLayerCA.h:
3940         * platform/graphics/ca/PlatformCALayer.cpp:
3941         (WebCore::PlatformCALayer::drawRepaintIndicator): Give the number a "shadow" when
3942         the contents format says we support smoothed fonts.
3943         * platform/graphics/ca/PlatformCALayer.h:
3944         * platform/graphics/ca/TileController.cpp:
3945         (WebCore::TileController::setTileContentsFormatFlags):
3946         (WebCore::TileController::createTileLayer):
3947         * platform/graphics/ca/TileController.h:
3948         * platform/graphics/ca/TileGrid.cpp:
3949         (WebCore::TileGrid::updateTileLayerProperties):
3950         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
3951         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3952         (WebCore::setBackingStoreFormat):
3953         (PlatformCALayerCocoa::commonInit):
3954         (PlatformCALayerCocoa::setContentsFormat):
3955         (PlatformCALayer::drawLayerContents): Previously, we turned off font smoothing in
3956         non-opaque layers to improve text appearance. We no longer need to do that when
3957         the contents format has "SmoothedFonts".
3958         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3959         (PlatformCALayerWin::setContentsFormat):
3960         (PlatformCALayerWin::contentsFormat):
3961         * platform/graphics/ca/win/PlatformCALayerWin.h:
3962         * platform/ios/LegacyTileGridTile.mm:
3963         (WebCore::setBackingStoreFormat):
3964         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
3965         * rendering/RenderLayerBacking.cpp:
3966         (WebCore::RenderLayerBacking::createGraphicsLayer):
3967
3968 2016-03-10  Commit Queue  <commit-queue@webkit.org>
3969
3970         Unreviewed, rolling out r197922.
3971         https://bugs.webkit.org/show_bug.cgi?id=155340
3972
3973         This change broke storage/websql tests on ios-simulator.
3974         (Requested by ryanhaddad on #webkit).
3975
3976         Reverted changeset:
3977
3978         "WebKit should adopt journal_mode=wal for all SQLite
3979         databases."
3980         https://bugs.webkit.org/show_bug.cgi?id=133496
3981         http://trac.webkit.org/changeset/197922
3982
3983 2016-03-10  Tim Horton  <timothy_horton@apple.com>
3984
3985         Fix the build again.
3986
3987         * editing/cocoa/DataDetection.mm:
3988         (WebCore::constructURLStringForResult):
3989
3990 2016-03-10  Tim Horton  <timothy_horton@apple.com>
3991
3992         Fix the build.
3993
3994         * editing/cocoa/DataDetection.mm:
3995
3996 2016-03-10  Enrica Casucci  <enrica@apple.com>
3997
3998         Expose additional WKDataDetectorTypes.
3999         https://bugs.webkit.org/show_bug.cgi?id=155331
4000         rdar://problem/24175813
4001
4002         Reviewed by Tim Horton.
4003
4004         Ad