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