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