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