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