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