Make shrink-wrapping test a ref-test instead of pixel-test
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-19  Tim Horton  <timothy_horton@apple.com>
2
3         Make shrink-wrapping test a ref-test instead of pixel-test
4         https://bugs.webkit.org/show_bug.cgi?id=147081
5
6         Reviewed by Sam Weinig.
7
8         Nobody runs pixel tests.
9
10         * svg/SVGPathUtilities.cpp:
11         (WebCore::pathIteratorForBuildingString):
12         (WebCore::buildStringFromPath):
13         * svg/SVGPathUtilities.h:
14         Add a helper that turns a Path into a SVG path string.
15
16         * testing/Internals.cpp:
17         (WebCore::Internals::pathStringWithShrinkWrappedRects):
18         * testing/Internals.h:
19         * testing/Internals.idl:
20         Have the internals shrink-wrap method return an SVG path instead of a DOMPath.
21
22 2015-07-19  David Kilzer  <ddkilzer@apple.com>
23
24         REGRESSION (r187008): CGPathCreateMutableCopyByTransformingPath() is not available on Windows
25         <https://bugs.webkit.org/show_bug.cgi?id=147077>
26
27         * platform/graphics/cg/PathCG.cpp:
28         (WebCore::Path::transform): Restore less efficient code path
29         for Windows.
30
31 2015-07-18  Tim Horton  <timothy_horton@apple.com>
32
33         Simplify Path(CG)::transform/translate
34         https://bugs.webkit.org/show_bug.cgi?id=147077
35
36         Reviewed by Simon Fraser.
37
38         No new tests; no behavior change.
39
40         * platform/graphics/cg/PathCG.cpp:
41         (WebCore::Path::translate):
42         (WebCore::Path::transform):
43         Use CGPathCreateMutableCopyByTransformingPath to do the copy and transform
44         in a single call instead of two.
45
46         Make use of transform() to implement translate() instead of duplicating the code.
47         Move the two functions near each other.
48
49         (WebCore::Path::boundingRect):
50         Remove irrelevant reference to Snow Leopard.
51
52 2015-07-17  Matt Rajca  <mrajca@apple.com>
53
54         Media Session: Add support for 'Content' interruption types
55         https://bugs.webkit.org/show_bug.cgi?id=147042
56
57         Reviewed by Eric Carlson.
58
59         Tests: Added media/session/content-interruptions
60
61         * Modules/mediasession/MediaSession.cpp:
62         (WebCore::MediaSession::handleIndefinitePauseInterruption): Indefinitely pause the session by pausing media
63          elements and removing them from the set of active participating elements.
64         * Modules/mediasession/MediaSession.h:
65         * Modules/mediasession/MediaSessionManager.cpp:
66         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented support for 'Content'
67          interruption types as described in 4.5.2.
68
69 2015-07-16  Matt Rajca  <mrajca@apple.com>
70
71         Media Session: add support for telephony interruptions
72         https://bugs.webkit.org/show_bug.cgi?id=147016
73
74         Reviewed by Eric Carlson.
75
76         * platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
77         (WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
78         (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
79         (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
80
81 2015-07-17  Matt Rajca  <mrajca@apple.com>
82
83         Media Session: add infrastructure for testing interruptions
84         https://bugs.webkit.org/show_bug.cgi?id=147060
85
86         Reviewed by Eric Carlson.
87
88         * Modules/mediasession/MediaSession.h: Export methods to be used with tests.
89         * Modules/mediasession/MediaSessionManager.h: Ditto.
90         * bindings/scripts/CodeGeneratorJS.pm: JSMediaSession needs to be marked with WEBCORE_EXPORT so it works with JSInternals.
91         * testing/Internals.cpp:
92         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Let tests send interruptions to MediaSessionManager.
93         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
94         (WebCore::Internals::mediaSessionCurrentState): Expose the current state of media sessions to tests.
95         * testing/Internals.h:
96         * testing/Internals.idl: Add interfaces for sending interruptions from JS tests.
97
98 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
99
100         Reduce PassRefPtr in WebKit2 - 3
101         https://bugs.webkit.org/show_bug.cgi?id=146995
102
103         Reviewed by Daniel Bates.
104
105         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
106         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
107
108         * loader/EmptyClients.cpp:
109         (WebCore::EmptyChromeClient::createPopupMenu):
110         (WebCore::EmptyChromeClient::createSearchPopupMenu):
111         (WebCore::EmptyFrameLoaderClient::createDocumentLoader):
112         (WebCore::EmptyFrameLoaderClient::createFrame):
113         (WebCore::EmptyFrameLoaderClient::createPlugin):
114         * loader/EmptyClients.h:
115         * loader/FrameLoader.cpp:
116         (WebCore::FrameLoader::init):
117         (WebCore::FrameLoader::load):
118         (WebCore::FrameLoader::loadWithNavigationAction):
119         (WebCore::FrameLoader::reloadWithOverrideEncoding):
120         (WebCore::FrameLoader::reload):
121         * loader/FrameLoaderClient.h:
122         * loader/ResourceLoadScheduler.cpp:
123         (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad):
124         (WebCore::ResourceLoadScheduler::schedulePluginStreamLoad):
125         * loader/ResourceLoadScheduler.h:
126         * loader/SubresourceLoader.cpp:
127         (WebCore::SubresourceLoader::create):
128         * loader/SubresourceLoader.h:
129         * page/ChromeClient.h:
130         * platform/graphics/texmap/TextureMapperBackingStore.h:
131         * platform/graphics/texmap/TextureMapperLayer.h:
132         (WebCore::TextureMapperLayer::texture):
133         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:
134         (WebCore::TextureMapperSurfaceBackingStore::texture):
135         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
136         * platform/graphics/texmap/TextureMapperTile.h:
137         (WebCore::TextureMapperTile::texture):
138         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
139         (WebCore::TextureMapperTiledBackingStore::texture):
140         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
141         * storage/StorageNamespace.h:
142
143 2015-07-18  David Kilzer  <ddkilzer@apple.com>
144
145         REGRESSION (r186976): Use piFloat instead of M_PI
146
147         Attempt to fix the following build failure:
148
149             PathUtilities.cpp(183): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
150
151         * platform/graphics/PathUtilities.cpp:
152         (WebCore::walkGraphAndExtractPolygon): Use piFloat since M_PI is
153         not defined on Windows.
154
155 2015-07-18  David Kilzer  <ddkilzer@apple.com>
156
157         REGRESSION (r186976): Windows build broke due to missing definition of M_PI
158
159         Attempt to fix the following build failure:
160
161             PathUtilities.cpp(182): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
162
163         * platform/graphics/PathUtilities.cpp: Include <wtf/MathExtras.h>.
164
165 2015-07-17  Zalan Bujtas  <zalan@apple.com>
166
167         REGRESSION (r169105): Do not assign a renderer to multiple selection subtrees.
168         https://bugs.webkit.org/show_bug.cgi?id=147038
169         rdar://problem/21819351
170
171         Reviewed by David Kilzer.
172
173         A renderer should never be assigned to multiple selection subtrees. (Currently RenderObject maintains the last selection state.)
174         RenderView::applySubtreeSelection() loops from the start to the end of the selection to find renderers that are inside the selection.
175         However, in case of regions (when multiple selection roots are present) traversing the renderer tree by calling RenderObject::nextInPreOrder() could
176         end up going across selection roots.
177         This patch ensures that we assign renderers to a specific selection only when the current selection root and the renderer's selection root match.
178
179         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees2.html
180
181         * rendering/RenderView.cpp:
182         (WebCore::SelectionIterator::SelectionIterator):
183         (WebCore::SelectionIterator::current):
184         (WebCore::SelectionIterator::checkForSpanner):
185         (WebCore::RenderView::applySubtreeSelection):
186
187 2015-07-17  Andy Estes  <aestes@apple.com>
188
189         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
190         https://bugs.webkit.org/show_bug.cgi?id=147044
191         rdar://problem/21567820
192
193         Reviewed by Brady Eidson.
194
195         In addition to placing resources fetched with 'Content-Disposition: attachment' in a unique origin,
196         this change does the following:
197
198         - Switches the sandbox type from SandboxOrigin to SandboxAll, which enforces the same restrictions as <iframe sandbox>.
199         - Disables processing of <meta http-equiv> elements.
200         - Disables loading of cross-origin subframes.
201
202         Tests: http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled.html
203                http/tests/contentdispositionattachmentsandbox/form-submission-disabled.html
204                http/tests/contentdispositionattachmentsandbox/http-equiv-disabled.html
205                http/tests/contentdispositionattachmentsandbox/plugins-disabled.html
206                http/tests/contentdispositionattachmentsandbox/scripts-disabled.html
207
208         * dom/Document.cpp:
209         (WebCore::Document::processHttpEquiv): Switched to calling Document::httpEquivPolicy(). Logged an error to the console for policies other than Enabled.
210         (WebCore::Document::initSecurityContext): Switched sandbox enforcement from SandboxOrigin to SandboxAll.
211         (WebCore::Document::httpEquivPolicy): Returned a HttpEquivPolicy based on shouldEnforceContentDispositionAttachmentSandbox() and Settings::httpEquivEnabled().
212         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox): Returned true if Settings::contentDispositionAttachmentSandboxEnabled()
213         and the document was fetched as an attachment.
214         * dom/Document.h:
215         * loader/cache/CachedResourceLoader.cpp: 
216         (WebCore::CachedResourceLoader::canRequest): When requesting a subframe main resource when the parent frame enforces an attachment sandbox,
217         only continue if the parent frame's SecurityOrigin allows the request.
218         * page/Settings.in: Added contentDispositionAttachmentSandboxEnabled with an initial value of false.
219
220 2015-07-17  Zalan Bujtas  <zalan@apple.com>
221
222         (display: block)input range's thumb disappears when moved.
223         https://bugs.webkit.org/show_bug.cgi?id=146896
224         <rdar://problem/21787807>
225
226         Reviewed by Simon Fraser.
227
228         Since the thumb is positioned after the layout for the input (shadow) subtree is finished, the repaint rects
229         issued during the layout will not cover the re-positioned thumb.
230         We need to issue a repaint soon after the thumb is re-positioned.
231
232         Test: fast/repaint/block-inputrange-repaint.html
233
234         * html/shadow/SliderThumbElement.cpp:
235         (WebCore::RenderSliderContainer::layout):
236
237 2015-07-17  Simon Fraser  <simon.fraser@apple.com>
238
239         Attempt to fix the build.
240
241         * html/HTMLMediaElement.cpp:
242         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
243         * html/HTMLMediaElement.h:
244
245 2015-07-17  Dean Jackson  <dino@apple.com>
246
247         Picture in Picture interacts poorly with AirPlay/HDMI
248         https://bugs.webkit.org/show_bug.cgi?id=147061
249         <rdar://problem/19192076>
250
251         Reviewed by Tim Horton.
252
253         When we are actively playing to an external target, the
254         picture in picture button should be hidden.
255
256         Also, the availability of picture in picture is also
257         dependent on AirPlay, so that we don't auto-pip when
258         we're displaying on a TV.
259
260         * Modules/mediacontrols/mediaControlsiOS.js:
261         (ControllerIOS.prototype.configureInlineControls): Call the update function.
262         (ControllerIOS.prototype.updatePictureInPictureButton): Add or remove a hidden class.
263         * html/MediaElementSession.cpp:
264         (WebCore::MediaElementSession::allowsPictureInPicture): Check Airplay status.
265
266 2015-07-17  Tim Horton  <timothy_horton@apple.com>
267
268         [iOS] TextIndicator has a large forehead when line-height > 1
269         https://bugs.webkit.org/show_bug.cgi?id=147058
270         <rdar://problem/21643094>
271
272         Reviewed by Dean Jackson.
273
274         * editing/FrameSelection.cpp:
275         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
276         * editing/FrameSelection.h:
277         Add a parameter controlling whether getClippedVisibleTextRectangles
278         returns selection-height rects (including extra line-height) or text-height
279         rects (including only the text height). Plumb it down.
280
281         * page/TextIndicator.cpp:
282         (WebCore::TextIndicator::createWithRange):
283         (WebCore::TextIndicator::createWithSelectionInFrame):
284         Use the tighter text-height rects on iOS, where there's no selection highlight to cover up.
285         Remove an assertion that is no longer always true, and which is mostly obsoleted by the
286         fact that we don't let FrameSnapshotting code arbitrarily decide the rect to snapshot anymore.
287
288 2015-07-17  Tim Horton  <timothy_horton@apple.com>
289
290         Improve rect shrink-wrapping algorithm
291         https://bugs.webkit.org/show_bug.cgi?id=147037
292         <rdar://problem/21643094>
293
294         Reviewed by Simon Fraser.
295
296         * platform/graphics/FloatPoint.h:
297         (WebCore::areEssentiallyEqual):
298         Added; implementation is the same as FloatSize's.
299
300         * platform/graphics/PathUtilities.cpp:
301         (WebCore::FloatPointGraph::FloatPointGraph):
302         (WebCore::FloatPointGraph::~FloatPointGraph):
303         (WebCore::FloatPointGraph::Node::Node):
304         (WebCore::FloatPointGraph::Node::nextPoints):
305         (WebCore::FloatPointGraph::Node::addNextPoint):
306         (WebCore::FloatPointGraph::Node::isVisited):
307         (WebCore::FloatPointGraph::Node::visit):
308         (WebCore::FloatPointGraph::Node::reset):
309         (WebCore::FloatPointGraph::reset):
310         (WebCore::FloatPointGraph::findOrCreateNode):
311         (WebCore::findLineSegmentIntersection):
312         (WebCore::addIntersectionPoints):
313         (WebCore::walkGraphAndExtractPolygon):
314         (WebCore::findUnvisitedPolygonStartPoint):
315         (WebCore::unitePolygons):
316         (WebCore::edgesForRect):
317         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
318         (WebCore::addShrinkWrapRightCorner): Deleted.
319         (WebCore::addShrinkWrapLeftCorner): Deleted.
320         (WebCore::addShrinkWrappedPathForRects): Deleted.
321         (WebCore::rectsIntersectOrTouch): Deleted.
322         (WebCore::findSetContainingRect): Deleted.
323         Add a new implementation of shrink-wrap, which is significantly more
324         generic than the old one, which assumed a top-down progression of rects.
325
326         This version uses polygon intersection to find the path around the
327         set of rects, and then follows said path and adds appropriately-sized
328         arcs for the corners.
329
330         The polygon intersection algorithm first finds all the intersection points
331         between all of the rects, then builds a graph of edges outward from one point.
332         It then traverses the graph, choosing at each point the next edge which
333         has not been visited and has the greatest interior angle, recording the polygon as it goes.
334
335         If at the end of the traversal we have not returned to the initial node,
336         we give up on shrink-wrapping and just use a bounding box around the rects.
337
338         If any of the original rects have not been visited at all, we repeat the traversal
339         starting with that rect, making an additional polygon (since we removed completely contained
340         rects before we started, having not visited the rect at all means that it's not connected
341         to the others).
342
343         Once we have a set of united polygons, we follow each one, determining the ideal (always
344         equal in width and height, never more than half the length of either edge, so that we always
345         have a smooth curve) arc radius and projecting it onto the edge, and then
346         adding an arc between the end of the previous path and beginning of the next.
347
348         Because the shrink-wrap algorithm is fairly expensive, if there are more than 20 rects,
349         we fall back to a bounding box. Given the current use cases, this is more than enough
350         rects, but can certainly be adjusted in the future if needed.
351
352         * testing/Internals.cpp:
353         (WebCore::Internals::pathWithShrinkWrappedRects):
354         * testing/Internals.h:
355         * testing/Internals.idl:
356         Add a radius parameter.
357
358 2015-07-17  Nan Wang  <n_wang@apple.com>
359
360         AX: iframe within table cell is inaccessible to VoiceOver
361         https://bugs.webkit.org/show_bug.cgi?id=147001
362         <rdar://problem/21106945>
363
364         Reviewed by Chris Fleizach.
365
366         When a table cell is created before its parent table determines if it should be ignored or not,
367         the table cell may cache the wrong role. Fix that by allowing each table cell to update its role
368         after the table makes this determination.
369
370         Test: accessibility/iframe-within-cell.html
371
372         * accessibility/AccessibilityTable.cpp:
373         (WebCore::AccessibilityTable::addChildren):
374         (WebCore::AccessibilityTable::addChildrenFromSection):
375
376 2015-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
377
378         style.fontFamily accessor crashes on unstyled node created from DOMParser().parseFromString()
379         https://bugs.webkit.org/show_bug.cgi?id=147026
380         <rdar://problem/21864487>
381
382         Reviewed by Andreas Kling.
383
384         Font CSS properties are a little special because they are used as indices into caches.
385         Normally, StyleResolver gives all nodes a default font family, so our cache works correctly.
386         However, if the document doesn't have a Settings object, StyleResolver wasn't doing this.
387         Documents created from DOMParser().parseFromString() don't have a Settings object.
388
389         Test: fast/text/crash-font-family-parsed.html
390
391         * css/StyleResolver.cpp:
392         (WebCore::StyleResolver::defaultStyleForElement):
393         (WebCore::StyleResolver::initializeFontStyle): Set a font family even if we don't have a
394         Settings object.
395
396 2015-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
397
398         Video posters disappear once media has loaded
399         https://bugs.webkit.org/show_bug.cgi?id=147045
400
401         Reviewed by Simon Fraser.
402
403         After r184932, all video elements are composited. However, there is logic in
404         RenderLayerBacking::updateConfiguration() which adds the video layer to the page
405         if the video is composited, without checking first to see if it should actually
406         do so.
407
408         Test: compositing/video/poster.html
409
410         * rendering/RenderLayerBacking.cpp:
411         (WebCore::RenderLayerBacking::updateConfiguration):
412
413 2015-07-17  Benjamin Poulain  <bpoulain@apple.com>
414
415         [Content Extensions] Term::isUniversalTransition() incorrectly expects the end-of-line assertion in character sets
416         https://bugs.webkit.org/show_bug.cgi?id=147032
417
418         Reviewed by Alex Christensen.
419
420         * contentextensions/Term.h:
421         (WebCore::ContentExtensions::Term::isUniversalTransition):
422         The universal transition is not supposed to account for the end-of-line assertion,
423         it should be a transition matching any character.
424
425         Here, we were counting 128 transitions, the 127 characters plus the
426         transition on zero we are using for EOL.
427
428         The end result is Term::isUniversalTransition() was completely useless.
429         The only code using it is the pattern simplificaton phase. That part
430         was not working correclty and was allowing useless ".*" in the patterns.
431
432 2015-07-17  Dan Bernstein  <mitz@apple.com>
433
434         WebCore part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
435         https://bugs.webkit.org/show_bug.cgi?id=147040
436
437         Reviewed by Dean Jackson.
438
439         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm
440
441         * loader/FrameLoader.cpp:
442         (WebCore::shouldOpenExternalURLsPolicyToApply): Pulled the logic out of
443         applyShouldOpenExternalURLsPolicyToNewDocumentLoader into this new helper.
444         (WebCore::FrameLoader::loadURL): When targeting a new frame, apply the external URLs policy
445         to the action passed to checkNewWindowPolicy.
446         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Call the new
447         helper function.
448         (WebCore::createWindow): Include the external URL policy in the action passed to
449         createWindow.
450
451 2015-07-17  Anders Carlsson  <andersca@apple.com>
452
453         ScrollView.h should be self-contained
454         https://bugs.webkit.org/show_bug.cgi?id=147004
455
456         Reviewed by Sam Weinig.
457
458         * platform/ScrollView.h:
459
460 2015-07-17  Brady Eidson  <beidson@apple.com>
461
462         Rolling r186895 back in, in its entirety.
463         https://bugs.webkit.org/show_bug.cgi?id=146976
464
465         Rubberstamped by Tim Horton.
466
467         * platform/network/cf/CookieJarCFNet.cpp:
468         (WebCore::createCookies): Use new CFNetwork SPI.
469
470 2015-07-17  Benjamin Poulain  <bpoulain@apple.com>
471
472         [Content Extensions] CSS-display-none rules are not working properly
473         https://bugs.webkit.org/show_bug.cgi?id=147024
474
475         Reviewed by Sam Weinig.
476
477         There were 2 bugs prevening rules with css-display-none and a url-filter from working
478         correctly.
479
480         First, ContentExtensions::serializeActions() was merging selectors regardless of their
481         trigger. All the CSS Selectors would be grouped together and applied regardless of which
482         rule apply.
483
484         That problem was fixed by grouping CSS rules by trigger. We want all the undistinguishable
485         CSS rules to be merged. The trigger makes 2 rules dinstinguishable as one rule can apply
486         on a page while the next rule does not. The simplest approach is to group by trigger.
487
488         The second problem had to do with rules added before the document is created.
489         When accumulating those rules, we were only keeping the last one. The reason was that
490         DocumentLoader::addPendingContentExtensionDisplayNoneSelector() would only keep a single
491         selector list by extension.
492
493         This is fixed by keeping a vector of all the rules that apply.
494
495         Tests: http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged.html
496                http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged.html
497                http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource.html
498
499         * contentextensions/ContentExtensionCompiler.cpp:
500         (WebCore::ContentExtensions::serializeActions):
501         * contentextensions/ContentExtensionRule.h:
502         (WebCore::ContentExtensions::Trigger::isEmpty):
503         (WebCore::ContentExtensions::TriggerHash::hash):
504         (WebCore::ContentExtensions::TriggerHash::equal):
505         (WebCore::ContentExtensions::TriggerHashTraits::constructDeletedValue):
506         (WebCore::ContentExtensions::TriggerHashTraits::isDeletedValue):
507         (WebCore::ContentExtensions::TriggerHashTraits::emptyValue):
508         (WebCore::ContentExtensions::TriggerHashTraits::isEmptyValue):
509         * contentextensions/ContentExtensionsBackend.cpp:
510         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
511         * loader/DocumentLoader.cpp:
512         (WebCore::DocumentLoader::commitData):
513         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
514         * loader/DocumentLoader.h:
515
516 2015-07-17  Tim Horton  <timothy_horton@apple.com>
517
518         iOS TextIndicators include text that is not supposed to be indicated
519         https://bugs.webkit.org/show_bug.cgi?id=147028
520         <rdar://problem/21643094>
521
522         Reviewed by Sam Weinig.
523
524         Paint the selection and background, but not other foregrounds, for iOS TextIndicators.
525
526         * page/FrameSnapshotting.cpp:
527         (WebCore::snapshotFrameRect):
528         * page/FrameSnapshotting.h:
529         Add a new snapshot option where we'll paint backgrounds and the selected
530         foreground and nothing else.
531         Pass the new snapshot option through as a paint behavior.
532
533         * page/TextIndicator.cpp:
534         (WebCore::TextIndicator::createWithRange):
535         Implement the incantations necessary to make a temporary selection
536         change not get sent to the UI process and actually have WebCore know about it
537         and accurately respond to questions about it.
538
539         (WebCore::TextIndicator::createWithSelectionInFrame):
540         Paint selection and backgrounds on iOS.
541
542         * rendering/PaintPhase.h:
543         * rendering/RenderLayer.cpp:
544         (WebCore::RenderLayer::paintLayerContents):
545         * rendering/RenderElement.cpp:
546         (WebCore::RenderElement::selectionColor):
547         Add a new paint behavior, SelectionAndBackgroundsOnly, which behaves
548         the same as selection only except it allows backgrounds to paint.
549
550 2015-07-17  Mark Lam  <mark.lam@apple.com>
551
552         Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
553         https://bugs.webkit.org/show_bug.cgi?id=118884
554
555         Reviewed by Filip Pizlo and Mark Lam.
556         Patch by Keith Miller  <keith_miller@apple.com>.
557
558         Tests: fast/events/event-leak-objects.html
559                fast/events/event-properties-gc.html
560
561         Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
562         was fixed by checking that any object passed by an event must be serializable or originate from the same
563         isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
564         cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
565         an object was deserialized in a world with elevated privileges we also check the cached value is from the same
566         world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
567         that determines whether a JSObject originated in the current world.
568
569         * CMakeLists.txt:
570         * WebCore.xcodeproj/project.pbxproj:
571         * bindings/js/DOMWrapperWorld.h:
572         (WebCore::worldForDOMObject):
573         * bindings/js/JSBindingsAllInOne.cpp:
574         * bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
575         (WebCore::JSCustomEvent::detail):
576         * bindings/js/JSMessageEventCustom.cpp:
577         (WebCore::JSMessageEvent::data):
578         * bindings/js/JSPopStateEventCustom.cpp:
579         (WebCore::JSPopStateEvent::state):
580         * dom/CustomEvent.cpp:
581         (WebCore::CustomEvent::initCustomEvent):
582         (WebCore::CustomEvent::trySerializeDetail):
583         * dom/CustomEvent.h:
584         * dom/CustomEvent.idl:
585         * dom/MessageEvent.cpp:
586         (WebCore::MessageEvent::initMessageEvent):
587         (WebCore::MessageEvent::trySerializeData):
588         * dom/MessageEvent.h:
589         * dom/PopStateEvent.cpp:
590         (WebCore::PopStateEvent::trySerializeState):
591         * dom/PopStateEvent.h:
592         * testing/Internals.cpp:
593         (WebCore::Internals::isFromCurrentWorld):
594         * testing/Internals.h:
595         * testing/Internals.idl:
596
597 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
598
599         [GTK] Cleanup PasteboardHelper
600         https://bugs.webkit.org/show_bug.cgi?id=147035
601
602         Reviewed by Žan Doberšek.
603
604         It's actually a singleton, but the API suggests you can create
605         your own or use the default one, but the default one should be the
606         only one. Rename PasteboardHelper::defaultPasteboardHelper() as
607         PasteboardHelper::singleton() and make it non-copyable and never
608         destroyed.
609
610         * platform/gtk/PasteboardGtk.cpp:
611         (WebCore::Pasteboard::writePlainText): Use PasteboardHelper::singleton().
612         (WebCore::Pasteboard::write): Ditto.
613         (WebCore::Pasteboard::writePasteboard): Ditto.
614         (WebCore::Pasteboard::clear): Ditto.
615         (WebCore::Pasteboard::canSmartReplace): Ditto.
616         (WebCore::Pasteboard::read): Ditto.
617         (WebCore::Pasteboard::hasData): Ditto.
618         (WebCore::Pasteboard::types): Ditto.
619         (WebCore::Pasteboard::readString): Ditto.
620         (WebCore::Pasteboard::readFilenames): Ditto.
621         * platform/gtk/PasteboardHelper.cpp:
622         (WebCore::PasteboardHelper::singleton): Renamed as singleton, also
623         use NeverDestroyed and return a reference instead of a pointer.
624         (WebCore::PasteboardHelper::PasteboardHelper): Do all
625         initializations here and remove the initialization static flag,
626         since this is a real singleton now. Also use
627         gdk_atom_intern_static_string() to initialize the atoms instead of
628         gdk_atom_intern().
629         (WebCore::PasteboardHelper::targetList):
630         (WebCore::PasteboardHelper::targetListForDataObject):
631         (WebCore::getClipboardContentsCallback):
632         * platform/gtk/PasteboardHelper.h:
633
634 2015-07-16  Matt Rajca  <mrajca@apple.com>
635
636         Media Session: handle 'Transient' and 'Transient Solo' interruption events
637         https://bugs.webkit.org/show_bug.cgi?id=146840
638
639         Reviewed by Eric Carlson.
640
641         * Modules/mediasession/MediaSession.cpp:
642         (WebCore::MediaSession::handleDuckInterruption): Added stub.
643         (WebCore::MediaSession::handleUnduckInterruption): Added stub.
644         (WebCore::MediaSession::handlePauseInterruption): Pause active media elements. We use our helper method to do this
645           "safely" since pausing a media element can change the collection we're iterating.
646         (WebCore::MediaSession::handleUnpauseInterruption): Unpause active media elements. We use our helper method to do this
647           "safely" since unpausing a media element can change the collection we're iterating.
648         (WebCore::MediaSession::togglePlayback): Factored out "safe" iteration into a helper method elsewhere.
649         (WebCore::MediaSession::safelyIterateActiveMediaElements): Safely iterate through the collection of active media
650           elements.
651         * Modules/mediasession/MediaSession.h:
652         * Modules/mediasession/MediaSessionManager.cpp:
653         (WebCore::MediaSessionManager::MediaSessionManager): On Mac, register for platform-specific interruptions.
654         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented section 4.5.2 of Media Session spec.
655         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
656         * Modules/mediasession/MediaSessionManager.h:
657
658 2015-07-16  Matt Rajca  <mrajca@apple.com>
659
660         Media Session: add support for platform-specific interruption providers
661         https://bugs.webkit.org/show_bug.cgi?id=147008
662
663         Reviewed by Eric Carlson.
664
665         * WebCore.xcodeproj/project.pbxproj: Include new source files.
666         * platform/mediasession/MediaSessionInterruptionProvider.cpp: Added base class to be used by MediaSessionManager
667           to listen for interruption notifications.
668         (WebCore::MediaSessionInterruptionProvider::MediaSessionInterruptionProvider): Begin listening for interruptions
669           upon construction.
670         (WebCore::MediaSessionInterruptionProvider::~MediaSessionInterruptionProvider): Stop listening for interruptions
671           before destruction.
672         (WebCore::MediaSessionInterruptionProvider::beginListeningForInterruptions): To be overridden by subclasses.
673         (WebCore::MediaSessionInterruptionProvider::stopListeningForInterruptions): To be overridden by subclasses.
674         * platform/mediasession/MediaSessionInterruptionProvider.h: Added.
675         (WebCore::MediaSessionInterruptionProviderClient::~MediaSessionInterruptionProviderClient):
676         (WebCore::MediaSessionInterruptionProvider::client):
677         * platform/mediasession/mac/MediaSessionInterruptionProviderMac.h: Added for providing Mac-specific interruptions.
678         (WebCore::MediaSessionInterruptionProviderMac::~MediaSessionInterruptionProviderMac):
679         * platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm: Added stubs.
680         (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
681         (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
682
683 2015-07-16  Tim Horton  <timothy_horton@apple.com>
684
685         Add shrink-wrapped link highlights
686         https://bugs.webkit.org/show_bug.cgi?id=147021
687         <rdar://problem/21643094>
688
689         Reviewed by Enrica Casucci.
690
691         * WebCore.xcodeproj/project.pbxproj:
692         * page/TextIndicator.cpp:
693         (WebCore::TextIndicator::createWithRange):
694         (WebCore::TextIndicator::createWithSelectionInFrame):
695         * page/TextIndicator.h:
696         Add a margin parameter to TextIndicator; this inflates each text rect
697         by the given amount.
698
699         Use snapshotFrameRect instead of snapshotSelection because we really
700         want an image that exactly fits textBoundingRectInDocumentCoordinates,
701         and snapshotSelection comes up with selection rects in different ways,
702         especially on iOS (where it comes up with nothing!).
703
704         For now, avoid forcing black text or painting only the selection on iOS.
705         Eventually, we should have TextIndicator options for these things that
706         are then respected at the presentation layer.
707
708 2015-07-16  Matt Rajca  <mrajca@apple.com>
709
710         Media Session: remove plumbing for delivering start/end-of-interruption events
711         https://bugs.webkit.org/show_bug.cgi?id=147005
712
713         Reviewed by Eric Carlson.
714
715         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
716         so the same behavior is available to all clients.
717
718         * Modules/mediasession/MediaSessionEvents.h:
719         * page/Page.cpp:
720         * page/Page.h:
721
722 2015-07-16  Alex Christensen  <achristensen@webkit.org>
723
724         [Content Extensions] Cache domain actions
725         https://bugs.webkit.org/show_bug.cgi?id=146817
726
727         Reviewed by Benjamin Poulain.
728
729         Right now we run regular expressions on the domain every time we have any rules that match with if-domain or unless-domain.  
730         This caches the results of running regular expressions on the domain of the main document's url so we only need to 
731         run those regular expressions when the main document changes domain.  We also spend less time adding unused actions into HashSets.
732
733         All behavior is covered by existing api tests, but I added some to explicitly test if-domain and unless-domain with multiple load types.
734
735         * contentextensions/ContentExtension.cpp:
736         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
737         (WebCore::ContentExtensions::ContentExtension::cachedDomainActions):
738         * contentextensions/ContentExtension.h:
739         (WebCore::ContentExtensions::ContentExtension::identifier):
740         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
741         * contentextensions/ContentExtensionsBackend.cpp:
742         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
743         * contentextensions/DFABytecodeInterpreter.cpp:
744         (WebCore::ContentExtensions::getJumpDistance):
745         (WebCore::ContentExtensions::matchesDomain):
746         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
747         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
748         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
749         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithDomains):
750         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
751         * contentextensions/DFABytecodeInterpreter.h:
752
753 2015-07-16  Simon Fraser  <simon.fraser@apple.com>
754
755         Fix disappearing position:fixed elements in fixed layout mode
756         https://bugs.webkit.org/show_bug.cgi?id=147019
757
758         Reviewed by Tim Horton.
759
760         Test: compositing/fixed-with-fixed-layout.html
761         
762         When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
763         the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
764         use the simpler document bounds (before scaling).
765         
766         In the long term,  there needs to be an equivalent of viewportConstrainedVisibleContentRect()
767         that gives an appropriate rect that can be used here.
768
769         * rendering/RenderLayerCompositor.cpp:
770         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
771
772 2015-07-16  Benjamin Poulain  <bpoulain@apple.com>
773
774         [Content extensions] Combine suffixes when generating NFAs
775         https://bugs.webkit.org/show_bug.cgi?id=146961
776
777         Reviewed by Alex Christensen.
778
779         In this patch, I add a mechanism very similar to the prefix tree
780         but for the suffix (called a reverse suffix tree here).
781
782         The idea is here is to reuse the existing NFA nodes when generating
783         a chain of suffix Term that were already generated previously.
784         When generating a disjunction ending with the same suffix, we now
785         have the same trailing NFA nodes for both sides of the disjunction.
786
787         Mixing the prefix and suffix generation can be tricky, we do not want
788         transitions from a pattern to creep into the suffix of an other.
789
790         To avoid any conflict, the rules here are very simple:
791         -Only use the reverse suffix tree for terms without actions
792          up to a leaf term with actions.
793
794          This rule ensure that no action will accidentally make its way
795          to an other rule by resuing a vertex of the reverse suffix tree.
796
797         -Only use the reverse suffix tree for chains of terms in which
798          each term only has zero or one following term.
799
800          With this condition, when taking any vertex of the reverse suffix
801          tree, there is only one edge that move out of that vertex when reading
802          from left to right.
803          For any vertex, there is only one possible string generated
804          left-to-right, a single suffix.
805
806         This is overly restrictive but it is fast, easier to verify, and it works
807         well in practice.
808         For all the more complicated cases, we can count on the Minimizer to
809         find a better solution.
810
811
812         With all the simple suffixes merged, our NFAs are smaller, which
813         let us combine more patterns.
814         The DFAs are also smaller and faster to produce since their size
815         is relative to the NFA sizes.
816
817         Overall, I get the following gains:
818         -Chris's test case:
819             compile time -40%.
820             bytecode size -14%.
821         -Armand's test case:
822             compile time -53%.
823             bytecode size -13%.
824
825         * WebCore.xcodeproj/project.pbxproj:
826         * contentextensions/CombinedURLFilters.cpp:
827         (WebCore::ContentExtensions::ActiveSubtree::ActiveSubtree):
828         (WebCore::ContentExtensions::generateInfixUnsuitableForReverseSuffixTree):
829         (WebCore::ContentExtensions::generateSuffixWithReverseSuffixTree):
830         (WebCore::ContentExtensions::clearReverseSuffixTree):
831         (WebCore::ContentExtensions::generateNFAForSubtree):
832         * contentextensions/DFA.cpp:
833         (WebCore::ContentExtensions::DFA::debugPrintDot):
834         Forgot to close a tag, dot was not happy.
835
836         * contentextensions/HashableActionList.h: Added.
837         (WebCore::ContentExtensions::HashableActionList::HashableActionList):
838         (WebCore::ContentExtensions::HashableActionList::isEmptyValue):
839         (WebCore::ContentExtensions::HashableActionList::isDeletedValue):
840         (WebCore::ContentExtensions::HashableActionList::operator==):
841         (WebCore::ContentExtensions::HashableActionList::operator!=):
842         (WebCore::ContentExtensions::HashableActionListHash::hash):
843         (WebCore::ContentExtensions::HashableActionListHash::equal):
844         We need a way to group reverse suffix tree by their terminal actions.
845         This new hash structure lets us find unique vertex for a list of actions
846         in any order.
847
848         * contentextensions/ImmutableNFANodeBuilder.h:
849         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::isValid):
850         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::nodeId):
851         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
852         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
853         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder): Deleted.
854         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder): Deleted.
855         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=): Deleted.
856         * contentextensions/Term.h:
857         (WebCore::ContentExtensions::Term::generateGraph):
858         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
859         Node building changes a bit.
860
861         Previously, it was assumed nodes are always built from left to right.
862         Getting the node on the right was done by providing the left node and the term
863         doing the transition.
864
865         Now we have both left to right and right to left generation.
866
867         The right-to-left has a specific property: no edge can be added after
868         it's initial term (rule 2 of our reverse suffix tree). This simplifies
869         things a bit since we can finalize all the nodes in the suffix tree.
870         All we need is to keep their ID to be able to link new nodes
871         to the reverse suffix tree.
872
873 2015-07-16  Brady Eidson  <beidson@apple.com>
874
875         Rolling out part of r186895 until rdar://problem/21861167 is resolved.
876         https://bugs.webkit.org/show_bug.cgi?id=146976
877
878         * platform/network/cf/CookieJarCFNet.cpp:
879         (WebCore::createCookies): Don’t use this new SPI quite yet.
880
881 2015-07-16  Filip Pizlo  <fpizlo@apple.com>
882
883         Unreviewed, roll out http://trac.webkit.org/changeset/186903. It broke the build.
884
885         * CMakeLists.txt:
886         * WebCore.xcodeproj/project.pbxproj:
887         * bindings/js/DOMWrapperWorld.h:
888         (WebCore::currentWorld):
889         (WebCore::worldForDOMObject): Deleted.
890         * bindings/js/JSBindingsAllInOne.cpp:
891         * bindings/js/JSCustomEventCustom.cpp:
892         (WebCore::JSCustomEvent::detail): Deleted.
893         * bindings/js/JSMessageEventCustom.cpp:
894         (WebCore::JSMessageEvent::data):
895         * bindings/js/JSPopStateEventCustom.cpp:
896         (WebCore::JSPopStateEvent::state):
897         * dom/CustomEvent.cpp:
898         (WebCore::CustomEvent::initCustomEvent):
899         (WebCore::CustomEvent::eventInterface):
900         (WebCore::CustomEvent::trySerializeDetail): Deleted.
901         * dom/CustomEvent.h:
902         * dom/CustomEvent.idl:
903         * dom/MessageEvent.cpp:
904         (WebCore::MessageEvent::initMessageEvent):
905         (WebCore::MessageEvent::data):
906         (WebCore::MessageEvent::trySerializeData): Deleted.
907         * dom/MessageEvent.h:
908         * dom/PopStateEvent.cpp:
909         (WebCore::PopStateEvent::create):
910         (WebCore::PopStateEvent::eventInterface):
911         (WebCore::PopStateEvent::trySerializeState): Deleted.
912         * dom/PopStateEvent.h:
913         * testing/Internals.cpp:
914         (WebCore::Internals::deserializeBuffer):
915         (WebCore::Internals::setUsesOverlayScrollbars):
916         (WebCore::Internals::isFromCurrentWorld): Deleted.
917         * testing/Internals.h:
918         * testing/Internals.idl:
919
920 2015-07-16  Keith Miller  <keith_miller@apple.com>
921
922         Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
923         https://bugs.webkit.org/show_bug.cgi?id=118884
924
925         Reviewed by Filip Pizlo.
926
927         Tests: fast/events/event-leak-objects.html
928                fast/events/event-properties-gc.html
929
930         Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
931         was fixed by checking that any object passed by an event must be serializable or originate from the same
932         isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
933         cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
934         an object was deserialized in a world with elevated privileges we also check the cached value is from the same
935         world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
936         that determines whether a JSObject originated in the current world.
937
938         * CMakeLists.txt:
939         * WebCore.xcodeproj/project.pbxproj:
940         * bindings/js/DOMWrapperWorld.h:
941         (WebCore::worldForDOMObject):
942         * bindings/js/JSBindingsAllInOne.cpp:
943         * bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
944         (WebCore::JSCustomEvent::detail):
945         * bindings/js/JSMessageEventCustom.cpp:
946         (WebCore::JSMessageEvent::data):
947         * bindings/js/JSPopStateEventCustom.cpp:
948         (WebCore::JSPopStateEvent::state):
949         * dom/CustomEvent.cpp:
950         (WebCore::CustomEvent::initCustomEvent):
951         (WebCore::CustomEvent::trySerializeDetail):
952         * dom/CustomEvent.h:
953         * dom/CustomEvent.idl:
954         * dom/MessageEvent.cpp:
955         (WebCore::MessageEvent::initMessageEvent):
956         (WebCore::MessageEvent::trySerializeData):
957         * dom/MessageEvent.h:
958         * dom/PopStateEvent.cpp:
959         (WebCore::PopStateEvent::trySerializeState):
960         * dom/PopStateEvent.h:
961         * testing/Internals.cpp:
962         (WebCore::Internals::isFromCurrentWorld):
963         * testing/Internals.h:
964         * testing/Internals.idl:
965
966 2015-07-16  Brady Eidson  <beidson@apple.com>
967
968         WebKit document.cookie mis-parsing.
969         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
970
971         Reviewed by Sam Weinig.
972
973         * platform/network/cf/CookieJarCFNet.cpp:
974         (WebCore::createCookies): Use new SPI if available.
975         (WebCore::setCookiesFromDOM):
976         * platform/spi/cf/CFNetworkSPI.h:
977
978 2015-07-15  Anders Carlsson  <andersca@apple.com>
979
980         Headers that use WEBCORE_EXPORT should include PlatformExportMacros.h
981         https://bugs.webkit.org/show_bug.cgi?id=146984
982
983         Reviewed by Daniel Bates.
984
985         * contentextensions/DFA.h:
986         * dom/ContextDestructionObserver.h:
987         * dom/DeviceOrientationData.h:
988         * dom/ExceptionCodePlaceholder.h:
989         * editing/cocoa/HTMLConverter.h:
990         * html/track/AudioTrack.h:
991         * loader/FrameLoaderStateMachine.h:
992         * loader/appcache/ApplicationCacheHost.h:
993         * loader/cache/CachedResourceHandle.h:
994         * platform/URL.h:
995         * platform/animation/Animation.h:
996         * platform/audio/AudioHardwareListener.h:
997         * platform/audio/AudioSession.h:
998         * platform/graphics/transforms/AffineTransform.h:
999         * platform/network/Credential.h:
1000         * platform/network/CredentialBase.h:
1001         * platform/network/ResourceHandleClient.h:
1002         * platform/network/mac/AuthenticationMac.h:
1003
1004 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
1005
1006         Web Inspector: update $$() to return an Array
1007         https://bugs.webkit.org/show_bug.cgi?id=146964
1008
1009         Reviewed by Brian Burg.
1010
1011         Test: inspector/console/command-line-api.html
1012
1013         * inspector/CommandLineAPIModuleSource.js:
1014         Update $$(...) to return an array.
1015         Also InjectedScriptHost.type was renamed to subtype
1016         a while ago.
1017
1018 2015-07-15  Tim Horton  <timothy_horton@apple.com>
1019
1020         Move indicator rect uniting code to TextIndicatorWindow instead of TextIndicator
1021         https://bugs.webkit.org/show_bug.cgi?id=146992
1022         <rdar://problem/21643094>
1023
1024         Reviewed by Daniel Bates.
1025
1026         Having to unite all the rects if any overlap is an implementation
1027         detail of the Mac TextIndicatorWindow presentation, not a fundamental
1028         property of TextIndicator.
1029
1030         Other TextIndicator presentations might be able to handle overlapping
1031         rects more effectively, so we shouldn't lose information unless we need to.
1032
1033         This also avoids having a second copy of some constants!
1034
1035         * page/TextIndicator.cpp:
1036         (WebCore::outsetIndicatorRectIncludingShadow): Deleted.
1037         (WebCore::textIndicatorsForTextRectsOverlap): Deleted.
1038         (WebCore::TextIndicator::TextIndicator): Deleted.
1039         * page/mac/TextIndicatorWindow.mm:
1040         (outsetIndicatorRectIncludingShadow):
1041         (textIndicatorsForTextRectsOverlap):
1042         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
1043
1044 2015-07-15  Ryuan Choi  <ryuan.choi@navercorp.com>
1045
1046         [CoordinatedGraphics] Remove setContentsScale from TiledBackingStore
1047         https://bugs.webkit.org/show_bug.cgi?id=146921
1048
1049         Reviewed by Gyuyoung Kim.
1050
1051         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1052         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
1053         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
1054         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1055         (WebCore::TiledBackingStore::TiledBackingStore):
1056         (WebCore::TiledBackingStore::setContentsScale): Deleted.
1057         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
1058
1059 2015-07-15  Sam Weinig  <sam@webkit.org>
1060
1061         Color match plug-ins
1062         <rdar://problem/21758722>
1063         https://bugs.webkit.org/show_bug.cgi?id=146987
1064
1065         Reviewed by Dean Jackson.
1066
1067         * platform/spi/cocoa/QuartzCoreSPI.h:
1068         Add colorMatchUntaggedContent property.
1069
1070 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
1071
1072         [Win] Another build fix after r186858.
1073
1074         * html/canvas/DOMPath.h: Don't use WEBCORE_EXPORT on the
1075         overall class and the destructor declaration.
1076
1077 2015-07-15  Dean Jackson  <dino@apple.com>
1078
1079         Tag WebGL layers with sRGB colorspace
1080         https://bugs.webkit.org/show_bug.cgi?id=146986
1081         <rdar://problem/21758704>
1082
1083         Fix the build on older El Capitan releases.
1084
1085         * platform/graphics/mac/WebGLLayer.mm:
1086         (-[WebGLLayer initWithGraphicsContext3D:]):
1087         * platform/spi/cocoa/QuartzCoreSPI.h:
1088
1089 2015-07-15  Dean Jackson  <dino@apple.com>
1090
1091         Tag WebGL layers with sRGB colorspace
1092         https://bugs.webkit.org/show_bug.cgi?id=146986
1093         <rdar://problem/21758704>
1094
1095         Reviewed by Simon Fraser.
1096
1097         Label a CAOpenGLLayer as using the sRGB colorspace,
1098         like the rest of our page content.
1099
1100         Test: fast/canvas/webgl/match-page-color-space.html
1101
1102         * platform/graphics/mac/WebGLLayer.mm:
1103         (-[WebGLLayer initWithGraphicsContext3D:]): Set the colorspace property on the layer.
1104         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]):
1105         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
1106         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
1107
1108 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
1109
1110         [Win] Unreviewed build fix after r186858.
1111
1112         Add missing DOMPath and PathUtilities files to project.
1113
1114         * WebCore.vcxproj/WebCore.vcxproj:
1115         * WebCore.vcxproj/WebCore.vcxproj.filters:
1116
1117 2015-07-15  Anders Carlsson  <andersca@apple.com>
1118
1119         Headers that look for NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES should import NSGeometry.h
1120         https://bugs.webkit.org/show_bug.cgi?id=146982
1121
1122         Reviewed by Tim Horton.
1123
1124         * platform/graphics/FloatPoint.h:
1125         * platform/graphics/IntPoint.h:
1126         * platform/graphics/IntSize.h:
1127
1128 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1129
1130         Scroll snapping to elements is broken for main frame scrolling
1131         https://bugs.webkit.org/show_bug.cgi?id=146957
1132
1133         Reviewed by Brent Fulgham.
1134
1135         Fixes the case of elements with scroll snap coordinates in a scroll snapping mainframe by changing
1136         RenderBox::findEnclosingScrollableContainer to return the body's RenderBox when all enclosing elements
1137         are not overflow scrollable but the mainframe can scroll.
1138
1139         Test: css3/scroll-snap/scroll-snap-coordinate-mainframe.html
1140
1141         * page/FrameView.h: Export isScrollable so that the Internals API can use it.
1142         * rendering/RenderBox.cpp: Include MainFrame.h.
1143         (WebCore::RenderBox::findEnclosingScrollableContainer): Changed to return the body's RenderBox if
1144             none of its parent elements are overflow scrolling.
1145         * testing/Internals.cpp:
1146         (WebCore::Internals::scrollSnapOffsets): Updated to return snap offsets for the body element,
1147             allowing us to call window.internals.scrollSnapOffsets(document.body).
1148
1149 2015-07-15  Brady Eidson  <beidson@apple.com>
1150
1151         WebKit document.cookie mis-parsing.
1152         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
1153
1154         Reviewed by Sam Weinig.
1155
1156         * platform/network/mac/CookieJarMac.mm:
1157         (WebCore::setCookiesFromDOM): Use new CFNetwork SPI when available.
1158
1159 2015-07-15  Jinyoung Hur  <hur.ims@navercorp.com>
1160
1161         [WinCairo] font fallback not working
1162         https://bugs.webkit.org/show_bug.cgi?id=146595
1163
1164         Reviewed by Myles C. Maxfield.
1165
1166         A Win32 API, GetGlyphIndices(), is not used properly, so any glyphs are considered existing in a font and it prevents the font fall back mechanism from working.
1167
1168         I think a specific font should be newly installed on the test machine to test this case but I have no idea how can it be done.
1169
1170         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
1171         (WebCore::GlyphPage::fill):
1172
1173 2015-07-15  Tim Horton  <timothy_horton@apple.com>
1174
1175         Factor rect shrink-wrapping code out of RenderThemeMac for future reuse
1176         https://bugs.webkit.org/show_bug.cgi?id=146973
1177         <rdar://problem/21643094>
1178
1179         Reviewed by Anders Carlsson.
1180
1181         Test: fast/shrink-wrap/rect-shrink-wrap.html
1182
1183         * WebCore.xcodeproj/project.pbxproj:
1184         Add DOMPath.cpp and PathUtilities.{h, cpp}.
1185
1186         * bindings/js/JSDOMBinding.h:
1187         (WebCore::NativeValueTraits<double>::nativeValue):
1188         Make it possible to use sequence<double> in IDL files.
1189
1190         * bindings/scripts/CodeGeneratorJS.pm:
1191         Export JSDOMPath for use in Internals.
1192
1193         * html/canvas/DOMPath.cpp: Added.
1194         (WebCore::DOMPath::~DOMPath):
1195         * html/canvas/DOMPath.h:
1196         Out-of-line the DOMPath destructor so as not to anger the bindings
1197         integrity checker (otherwise, the address of the DOMPath destructor
1198         is different in WebCoreTestSupport and WebCore, causing us to fail
1199         the vtable equality test).
1200
1201         * platform/graphics/Path.h:
1202         Forward declare FloatRect instead of including it unnecessarily.
1203         Export ensurePlatformPath().
1204
1205         * platform/graphics/PathUtilities.cpp: Added.
1206         (WebCore::addShrinkWrapRightCorner):
1207         (WebCore::addShrinkWrapLeftCorner):
1208         (WebCore::addShrinkWrappedPathForRects):
1209         These parts are extracted from RenderThemeMac, with two changes:
1210             + support for arbitrarily-aligned rects
1211               (the other version assumed they were horizontally center-aligned)
1212             + support for overlapping rects
1213               (the other version assumed they touched but did not overlap)
1214
1215         There are still things missing:
1216             + support for a fallback when the shape is too hard to shrink-wrap
1217
1218         And things broken:
1219             + if the distance between two edges is smaller than the corner radius,
1220               we'll end up with a sharp edge in the path
1221
1222         Both of these cases are covered in the layout test and can be improved.
1223
1224         (WebCore::rectsIntersectOrTouch):
1225         Rect intersection with <= instead of <.
1226
1227         (WebCore::contiguousRectGroupsFromRects):
1228         Given a set of rects, find all of the contiguous regions. We'll
1229         shrink-wrap each region independently.
1230
1231         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
1232         * platform/graphics/PathUtilities.h: Added.
1233         Add PathUtilities, where the shrink-wrapping code lives.
1234
1235         * rendering/RenderThemeMac.mm:
1236         (WebCore::paintAttachmentTitleBackground):
1237         (WebCore::addAttachmentTitleBackgroundRightCorner): Deleted.
1238         (WebCore::addAttachmentTitleBackgroundLeftCorner): Deleted.
1239         Remove shrink-wrapping implementation and make use of the one in PathUtilities.
1240
1241         * testing/Internals.cpp:
1242         (WebCore::Internals::pathWithShrinkWrappedRects):
1243         * testing/Internals.h:
1244         * testing/Internals.idl:
1245         Expose pathWithShrinkWrappedRects to tests via Internals.
1246         It takes a sequence<double> where every four values are the x, y, w, h
1247         of a rect, and returns a DOMPath which can be used with Canvas.
1248
1249 2015-07-15  Enrica Casucci  <enrica@apple.com>
1250
1251         [iOS] Should look for RTF and RTFD pasteboard types before plain text.
1252         https://bugs.webkit.org/show_bug.cgi?id=146971
1253         rdar://problem/21840845
1254
1255         Reviewed by Sam Weinig.
1256
1257         The list of pasteboard types returned by supportedPasteboardTypes
1258         determines the order in which WebKit looks for data in the pasteboard
1259         to create a fragment. The incorrect order could make plain text to
1260         be preferred over rich format.
1261
1262         * platform/ios/PasteboardIOS.mm:
1263         (WebCore::Pasteboard::supportedPasteboardTypes):
1264
1265 2015-07-15  Anders Carlsson  <andersca@apple.com>
1266
1267         Private headers that include project headers should also be project headers
1268         https://bugs.webkit.org/show_bug.cgi?id=146974
1269
1270         Reviewed by Dan Bernstein.
1271
1272         Since these headers can't be included by WebKit anyway they shouldn't be installed.
1273
1274         * WebCore.xcodeproj/project.pbxproj:
1275
1276 2015-07-15  Eric Carlson  <eric.carlson@apple.com>
1277
1278         [Mac] AirPlay route is not always set automatically
1279         https://bugs.webkit.org/show_bug.cgi?id=146969
1280
1281         Reviewed by Jer Noble.
1282
1283         * Modules/mediasession/WebMediaSessionManager.cpp:
1284         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Return early if there are
1285           no clients. Make the first client in the vector automatically play to the target if there
1286           is no other match and there is an active route.
1287         (WebCore::WebMediaSessionManager::watchdogTimerFired): Call picker.invalidatePlaybackTargets,
1288           not stopMonitoringPlaybackTargets.
1289
1290         * platform/graphics/MediaPlaybackTargetPicker.cpp:
1291         (WebCore::MediaPlaybackTargetPicker::invalidatePlaybackTargets): New.
1292         * platform/graphics/MediaPlaybackTargetPicker.h:
1293
1294         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1295         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1296         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Do nothing, AirPlay
1297           automatically stops monitoring when appropriate and release the picker also releases
1298           the output context, which drops the route.
1299         (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): New.
1300
1301 2015-07-15  Anders Carlsson  <andersca@apple.com>
1302
1303         Remove forwarding headers that no longer point to valid headers
1304         https://bugs.webkit.org/show_bug.cgi?id=146972
1305
1306         Reviewed by Tim Horton.
1307
1308         * ForwardingHeaders/heap/AllocationSpace.h: Removed.
1309         * ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Removed.
1310         * ForwardingHeaders/runtime/PrototypeFunction.h: Removed.
1311         * ForwardingHeaders/runtime/StorageBarrier.h: Removed.
1312         * ForwardingHeaders/runtime/TypedArrayBase.h: Removed.
1313
1314 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
1315
1316         Negative scroll snap repeat values cause web process to hang indefinitely
1317         https://bugs.webkit.org/show_bug.cgi?id=146953
1318         <rdar://problem/21823681>
1319
1320         Reviewed by Simon Fraser.
1321
1322         Fixed dangerous behavior caused by setting -scroll-snap-points-x or -y to negative or very small
1323         positive values. In the case of negative or 0 repeats, the web process would hang indefinitely. In
1324         the case of very small positive values, a massive amount of memory could potentially be allocated
1325         just to store snap offsets.
1326
1327         Tests: css3/scroll-snap/scroll-snap-negative-repeat.html
1328                css3/scroll-snap/scroll-snap-subpixel-repeat.html
1329
1330         * css/CSSParser.cpp:
1331         (WebCore::CSSParser::parseNonElementSnapPoints): Changed to consider negative snap repeat values as invalid CSS.
1332         * page/scrolling/AxisScrollSnapOffsets.cpp:
1333         (WebCore::updateFromStyle): Changed to threshold non-negative snap repeat values to 1px.
1334
1335 2015-07-14  Dean Jackson  <dino@apple.com>
1336
1337         Placeholder colors should be system grays
1338         https://bugs.webkit.org/show_bug.cgi?id=146955
1339         <rdar://problem/21774358>
1340
1341         Reviewed by Sam Weinig.
1342
1343         Update the PiP and Airplay placards to use the correct shades
1344         of gray.
1345
1346         * Modules/mediacontrols/mediaControlsApple.css: No need to specify the
1347         font here, nor have rules for Picture in Picture, which isn't available
1348         on OS X.
1349         (audio::-webkit-media-controls-time-remaining-display): We should specify
1350         font style here.
1351         (video:-webkit-full-screen::-webkit-media-controls-panel): Drive-by cleanup.
1352         (audio::-webkit-media-controls-wireless-playback-status): Use a gray background
1353         and system gray for text and artwork.
1354         (audio::-webkit-media-controls-wireless-playback-status.small): Ditto.
1355         (audio::-webkit-media-controls-picture-in-picture-button): Deleted (not on OS X).
1356         (audio::-webkit-media-controls-wireless-playback-text-top): Deleted use of background color.
1357         (audio::-webkit-media-controls-wireless-playback-text-bottom): Ditto..
1358
1359         * Modules/mediacontrols/mediaControlsiOS.css: Use a gray background
1360         and system gray for text and artwork.
1361         (audio::-webkit-media-controls-wireless-playback-status):
1362         (audio::-webkit-media-controls-wireless-playback-text-top):
1363         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
1364
1365 2015-07-14  Hunseop Jeong  <hs85.jeong@samsung.com>
1366
1367         [EFL] Scrollbar is not drawn on MiniBrowser.
1368         https://bugs.webkit.org/show_bug.cgi?id=143566
1369
1370         Reviewed by Gyuyoung Kim.
1371
1372         Implement the ScrollbarThemeEfl to draw the scrollbar on EFL port.
1373
1374         * PlatformEfl.cmake: Removed the ScrollbarEfl.cpp.
1375
1376         * platform/Scrollbar.cpp: Removed the !PLATFORM(EFL) guard to use the createNativeScrollbar().
1377
1378         * platform/efl/DefaultTheme/CMakeLists.txt: Replaced the image files with new ones.
1379
1380         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc:
1381         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Added.
1382         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Added.
1383         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png: Removed.
1384         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: Removed.
1385         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: Removed.
1386         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Added.
1387         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Added.
1388         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png: Removed.
1389         * platform/efl/RenderThemeEfl.cpp:
1390         (WebCore::toEdjeGroup):
1391         (WebCore::RenderThemeEfl::paintThemePart): Added the new function to draw the scrollbar
1392           using the RenderThemeEfl.
1393
1394         * platform/efl/RenderThemeEfl.h:
1395         * platform/efl/ScrollbarEfl.cpp: Removed.
1396         * platform/efl/ScrollbarEfl.h: Removed.
1397         * platform/efl/ScrollbarThemeEfl.cpp: Implemented the default functions to draw the
1398           scrollbar.
1399         (WebCore::scrollbarMap):
1400         (WebCore::ScrollbarThemeEfl::~ScrollbarThemeEfl):
1401         (WebCore::ScrollbarThemeEfl::scrollbarThickness):
1402         (WebCore::ScrollbarThemeEfl::hasThumb):
1403         (WebCore::ScrollbarThemeEfl::backButtonRect):
1404         (WebCore::ScrollbarThemeEfl::forwardButtonRect):
1405         (WebCore::ScrollbarThemeEfl::trackRect):
1406         (WebCore::ScrollbarThemeEfl::minimumThumbLength):
1407         (WebCore::ScrollbarThemeEfl::paintTrackBackground):
1408         (WebCore::ScrollbarThemeEfl::paintThumb):
1409         (WebCore::ScrollbarThemeEfl::registerScrollbar):
1410         (WebCore::ScrollbarThemeEfl::unregisterScrollbar):
1411         (WebCore::ScrollbarThemeEfl::loadThemeIfNeeded):
1412         * platform/efl/ScrollbarThemeEfl.h:
1413         (WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):
1414
1415 2015-07-14  Andreas Kling  <akling@apple.com>
1416
1417         Don't persist history item tree for subframes across reloads.
1418         <https://webkit.org/b/146937>
1419         <rdar://problem/19925709>
1420
1421         Reviewed by Brady Eidson.
1422
1423         Throw away the subframe history items when reloading a page. This ensures that we
1424         don't accumulate outdated frame metadata when subframes change name across page loads.
1425         Since the history item tree is encoded in the UA session state and gets serialized to
1426         disk, it's important that we don't let it grow unbounded.
1427
1428         * loader/HistoryController.cpp:
1429         (WebCore::HistoryController::updateForReload):
1430
1431 2015-07-14  Antti Koivisto  <antti@apple.com>
1432
1433         REGRESSION (r177876): store.apple.com profile and cart icons are missing
1434         https://bugs.webkit.org/show_bug.cgi?id=146894
1435
1436         Reviewed by Myles C. Maxfield.
1437
1438         If we had several @font-face rules for the same face covering overlapping ranges we
1439         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
1440         try the other ones.
1441
1442         Test: fast/css/font-face-multiple-missing-glyphs.html
1443
1444         * platform/graphics/FontCascadeFonts.cpp:
1445         (WebCore::FontCascadeFonts::glyphDataForVariant):
1446         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
1447
1448             Get GlyphData with one call.
1449
1450         * platform/graphics/FontRanges.cpp:
1451         (WebCore::FontRanges::~FontRanges):
1452         (WebCore::FontRanges::glyphDataForCharacter):
1453
1454             Check that we actually have a glyph in the font for the character before returning it.
1455
1456         (WebCore::FontRanges::fontForCharacter):
1457         (WebCore::FontRanges::fontForFirstRange):
1458         * platform/graphics/FontRanges.h:
1459         (WebCore::FontRanges::size):
1460         (WebCore::FontRanges::rangeAt):
1461
1462 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1463
1464         Fix the 32 bit build after r186817
1465         https://bugs.webkit.org/show_bug.cgi?id=146947
1466
1467         Changed CGRect to NSRect.
1468
1469         Reviewed by Simon Fraser.
1470
1471         * platform/mac/ThemeMac.mm:
1472         (WebCore::paintButton):
1473
1474 2015-07-14  Anders Carlsson  <andersca@apple.com>
1475
1476         Remove wkPopupMenu from WebCoreSystemInterface; it's not called from WebCore
1477         https://bugs.webkit.org/show_bug.cgi?id=146945
1478
1479         Reviewed by Tim Horton.
1480
1481         * platform/mac/WebCoreSystemInterface.h:
1482
1483 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1484
1485         Input buttons rendered at the wrong size when pinching-to-zoom
1486         https://bugs.webkit.org/show_bug.cgi?id=146916
1487
1488         Reviewed by Dean Jackson.
1489
1490         Scales buttons and their focus rects up when pinching to zoom by painting to an offscreen ImageBuffer which is
1491         then scaled and painted onto the display.
1492
1493         * platform/Theme.h: Modified signature of Theme::paint.
1494         (WebCore::Theme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
1495         * platform/mac/ThemeMac.h: Modified signature of paintButton.
1496         * platform/mac/ThemeMac.mm: Added ImageBuffer.h header.
1497         (WebCore::buttonFocusRectOutlineWidth): Represents the width of the focus rect of a button. Used by paintButton
1498             to determine the size of the ImageBuffer required to draw a focus rect.
1499         (WebCore::paintButton): Changed to paint button cells and the focus rect, if applicable, to a temporary ImageBuffer
1500             before painting the ImageBuffer onto the view. Refactored to receive a deviceScaleFactor and page scale factor,
1501             used when painting to the ImageBuffer.
1502         (WebCore::ThemeMac::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
1503         * rendering/RenderTheme.cpp: Modified signature of RenderTheme::paint.
1504         (WebCore::RenderTheme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
1505
1506 2015-07-14  Commit Queue  <commit-queue@webkit.org>
1507
1508         Unreviewed, rolling out r186809.
1509         https://bugs.webkit.org/show_bug.cgi?id=146943
1510
1511         Caused about 190 layout test failures. (Requested by mlam_ on
1512         #webkit).
1513
1514         Reverted changeset:
1515
1516         "REGRESSION (r177876): store.apple.com profile and cart icons
1517         are missing"
1518         https://bugs.webkit.org/show_bug.cgi?id=146894
1519         http://trac.webkit.org/changeset/186809
1520
1521 2015-07-14  Antti Koivisto  <antti@apple.com>
1522
1523         REGRESSION (r177876): store.apple.com profile and cart icons are missing
1524         https://bugs.webkit.org/show_bug.cgi?id=146894
1525
1526         Reviewed by Myles C. Maxfield.
1527
1528         If we had several @font-face rules for the same face covering overlapping ranges we
1529         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
1530         try the other ones.
1531
1532         Test: fast/css/font-face-multiple-missing-glyphs.html
1533
1534         * platform/graphics/FontCascadeFonts.cpp:
1535         (WebCore::FontCascadeFonts::glyphDataForVariant):
1536         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
1537
1538             Get GlyphData with one call.
1539
1540         * platform/graphics/FontRanges.cpp:
1541         (WebCore::FontRanges::~FontRanges):
1542         (WebCore::FontRanges::glyphDataForCharacter):
1543
1544             Check that we actually have a glyph in the font for the character before returning it.
1545
1546         (WebCore::FontRanges::fontForCharacter):
1547         (WebCore::FontRanges::fontForFirstRange):
1548         * platform/graphics/FontRanges.h:
1549         (WebCore::FontRanges::size):
1550         (WebCore::FontRanges::rangeAt):
1551
1552 2015-07-14  Alex Christensen  <achristensen@webkit.org>
1553
1554         [Content Extensions] Fix if-domain and unless-domain when loading main documents.
1555         https://bugs.webkit.org/show_bug.cgi?id=146868
1556
1557         Reviewed by Benjamin Poulain.
1558
1559         Tests: http/tests/contentextensions/block-everything-if-domain.html
1560                http/tests/contentextensions/block-everything-unless-domain-iframe.html
1561                http/tests/contentextensions/block-everything-unless-domain-redirect.php
1562                http/tests/contentextensions/block-everything-unless-domain.html
1563
1564         * contentextensions/ContentExtensionsBackend.cpp:
1565         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
1566         If we are loading a new main document, use that main document url as the main document url for domain comparison.
1567
1568 2015-07-05  Sam Weinig  <sam@webkit.org>
1569
1570         DOM4: prepend, append, before, after & replace
1571         https://bugs.webkit.org/show_bug.cgi?id=74648
1572
1573         Reviewed by Darin Adler.
1574
1575         - Adds support for ChildNode.before/after/replaceWith and ParentNode.prepend/append
1576           which are new functions in https://dom.spec.whatwg.org
1577         - Uses custom bindings rather than implementing support for union types in the code
1578           generator as their uses seems isolated to just this spec at the moment. If more
1579           uses come along, we should implement proper support for them in the generator and
1580           remove the custom bindings added here.
1581
1582         Tests: fast/dom/ChildNode-after.html
1583                fast/dom/ChildNode-before.html
1584                fast/dom/ChildNode-replaceWith.html
1585                fast/dom/ParentNode-append.html
1586                fast/dom/ParentNode-prepend.html
1587
1588         * CMakeLists.txt:
1589         * WebCore.vcxproj/WebCore.vcxproj:
1590         * WebCore.xcodeproj/project.pbxproj:
1591         * bindings/js/JSBindingsAllInOne.cpp:
1592         Add new files.
1593
1594         * bindings/js/JSCharacterDataCustom.cpp: Added.
1595         (WebCore::JSCharacterData::before):
1596         (WebCore::JSCharacterData::after):
1597         (WebCore::JSCharacterData::replaceWith):
1598         * bindings/js/JSDocumentCustom.cpp:
1599         (WebCore::JSDocument::prepend):
1600         (WebCore::JSDocument::append):
1601         (WebCore::JSDocument::createTouchList):
1602         * bindings/js/JSDocumentFragmentCustom.cpp: Added.
1603         (WebCore::JSDocumentFragment::prepend):
1604         (WebCore::JSDocumentFragment::append):
1605         * bindings/js/JSDocumentTypeCustom.cpp: Added.
1606         (WebCore::JSDocumentType::before):
1607         (WebCore::JSDocumentType::after):
1608         (WebCore::JSDocumentType::replaceWith):
1609         * bindings/js/JSElementCustom.cpp:
1610         (WebCore::toJSNewlyCreated):
1611         (WebCore::JSElement::before):
1612         (WebCore::JSElement::after):
1613         (WebCore::JSElement::replaceWith):
1614         (WebCore::JSElement::prepend):
1615         (WebCore::JSElement::append):
1616         Add custom bindings to implement the use of variadic union types.
1617
1618         * bindings/js/JSNodeOrString.cpp: Added.
1619         (WebCore::toNodeOrStringVector):
1620         * bindings/js/JSNodeOrString.h: Added.
1621         Adds a help function for converting an JS argument list into a Vector
1622         of NodeOrString objects.
1623
1624         * dom/ChildNode.idl:
1625         Expose before/after/replaceWith to JavaScript.
1626
1627         * dom/ContainerNode.cpp:
1628         (WebCore::ContainerNode::append):
1629         (WebCore::ContainerNode::prepend):
1630         * dom/ContainerNode.h:
1631         Add implementations of append and prepend.
1632
1633         * dom/Node.h:
1634         * dom/Node.cpp:
1635         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
1636         (WebCore::firstPrecedingSiblingNotInNodeSet):
1637         (WebCore::firstFollowingSiblingNotInNodeSet):
1638         Helper functions for before, after and removeWith.
1639
1640         (WebCore::Node::before):
1641         (WebCore::Node::after):
1642         (WebCore::Node::replaceWith):
1643         Add implementations of before, after and removeWith.
1644
1645         * dom/NodeOrString.cpp: Added.
1646         (WebCore::convertNodesOrStringsIntoNode):
1647         * dom/NodeOrString.h: Added.
1648         (WebCore::NodeOrString::NodeOrString):
1649         (WebCore::NodeOrString::~NodeOrString):
1650         (WebCore::NodeOrString::type):
1651         (WebCore::NodeOrString::node):
1652         (WebCore::NodeOrString::string):
1653         Custom union type representing the (Node or DOMString) IDL type.
1654
1655         * dom/ParentNode.idl:
1656         Expose append/prepend to JavaScript.
1657
1658 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
1659
1660         [Win] Unreviewed build fix.
1661
1662         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1663         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Don't try to build
1664         the new Legible Output API features if they aren't available in the build
1665         environment.
1666
1667 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
1668
1669         [Win] Update Media Player logic for new Legible Output API
1670         https://bugs.webkit.org/show_bug.cgi?id=146922
1671         <rdar://problem/20542574>
1672
1673         Reviewed by Eric Carlson.
1674
1675         * AVFoundationSupport.py: Check for updated AVFCF feature.
1676         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
1677         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Update to call the
1678         new 'readNativeSampleBuffer' method.
1679         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Added. This is a no-op
1680         on Windows if it has the new AVCF API. Otherwise, it contains the same implementation
1681         that has always been used in 'processNativeSamples'.
1682         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
1683         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1684         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Added. Use the new
1685         Legible Output API instead of the old CoreMedia solution if it is available.
1686         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
1687         (WebCore::InbandTextTrackPrivateAVCF::mediaSelectionOption):
1688         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
1689         (WebCore::InbandTextTrackPrivateLegacyAVCF::readNativeSampleBuffer): Add a stub implementation.
1690         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
1691         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1692         (WebCore::AVFWrapper::createPlayerItem): Use the new Legible Output API if it is available.
1693
1694 2015-07-13  Matt Rajca  <mrajca@apple.com>
1695
1696         Media Session: add plumbing for delivering start/end-of-interruption events
1697         https://bugs.webkit.org/show_bug.cgi?id=146837
1698
1699         Reviewed by Tim Horton.
1700
1701         * Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for
1702           interruption events.
1703         * WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h.
1704         * page/Page.h: Added stub.
1705         * page/Page.cpp: Added stub.
1706
1707 2015-07-13  Simon Fraser  <simon.fraser@apple.com>
1708
1709         [iOS WK2] When choosing an initial viewport scale, take overflow on the <body> into account
1710         https://bugs.webkit.org/show_bug.cgi?id=146918
1711         rdar://problem/9222837
1712
1713         Reviewed by Tim Horton.
1714
1715         Use as input to the viewport scaling algorithm a contents size from the FrameView
1716         that takes overflow on the viewport renderer into account. This prevents unexpected
1717         viewports scaling on pages that have content that overflows their expressed contents size,
1718         but apply overflow to the <body>.
1719
1720         * page/FrameView.cpp:
1721         (WebCore::FrameView::contentsSizeRespectingOverflow): Look for overflow:hidden on each axis of
1722         the m_viewportRenderer, which is computed post-layout by calculateScrollbarModesForLayout()
1723         and is used for scrollbar logic on OS X. Clip unscaledDocumentRect on each axis, and then
1724         apply page scale.
1725         * page/FrameView.h:
1726
1727 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
1728
1729         Update WebCore Features.json
1730         https://bugs.webkit.org/show_bug.cgi?id=146914
1731
1732         Reviewed by Benjamin Poulain.
1733
1734         * features.json: Update with notes for CSS Scroll Snap Points, Filter Effects,
1735         backdrop-filters, and initial-letter.
1736
1737 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
1738
1739         Change MediaPlayer Media Stream method signatures to use references
1740         https://bugs.webkit.org/show_bug.cgi?id=146839
1741         <rdar://problem/21769035>
1742
1743         Reviewed by Darin Adler.
1744
1745         * platform/graphics/MediaPlayer.cpp:
1746         (WebCore::MediaPlayer::loadWithNextMediaEngine):
1747         * platform/graphics/MediaPlayerPrivate.h: Changed to references
1748         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1749         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1750         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1751         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto
1752         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1753         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto
1754         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1755         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1756         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
1757
1758 2015-07-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1759
1760         GTK] Build race with -DENABLE_WAYLAND_TARGET=ON
1761         https://bugs.webkit.org/show_bug.cgi?id=146740
1762
1763         Reviewed by Martin Robinson.
1764
1765         No new tests, no behavior changes.
1766
1767         * PlatformGTK.cmake: platform/graphics/wayland sources should be
1768         included into WebCore source list instead of WebCorePlatformGTK.
1769         Also move the add_custom_command() block into if(ENABLE_WAYLAND_TARGET),
1770         this is not strictly needed to fix this bug, but it seems cleaner.
1771
1772 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
1773
1774         Adding MediaStream Engine building blocks to the code repo
1775         https://bugs.webkit.org/show_bug.cgi?id=146789
1776         <rdar://problem/21747025>
1777
1778         Reviewed by Brent Fulgham.
1779
1780         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Added.
1781         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setLoadingProgresssed):
1782         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setHasAvailableVideoFrame):
1783         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createWeakPtr):
1784         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Added.
1785         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
1786         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
1787         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine):
1788         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
1789         (WebCore::mimeTypeCache):
1790         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes):
1791         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
1792         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
1793         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad):
1794         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay):
1795         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformMedia):
1796         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
1797         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
1798         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal):
1799         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
1800         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal):
1801         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paused):
1802         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
1803         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsScanning):
1804         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
1805         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::naturalSize):
1806         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo):
1807         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio):
1808         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
1809         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::durationMediaTime):
1810         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seeking):
1811         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setRateDouble):
1812         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPreservesPitch):
1813         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::networkState):
1814         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::readyState):
1815         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seekable):
1816         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::maxMediaTimeSeekable):
1817         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::minMediaTimeSeekable):
1818         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::buffered):
1819         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didLoadingProgress):
1820         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setSize):
1821         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAvailableVideoFrame):
1822         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsAcceleratedRendering):
1823         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::movieLoadType):
1824         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareForRendering):
1825         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
1826         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::languageOfPrimaryAudioTrack):
1827         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldBePlaying):
1828         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::addDisplayLayer):
1829         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeDisplayLayer):
1830         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.h: Added.
1831         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.mm: Added.
1832         (WebCore::MediaStreamPrivateAVFObjC::create):
1833         (WebCore::MediaStreamPrivateAVFObjC::MediaStreamPrivateAVFObjC):
1834         (WebCore::MediaStreamPrivateAVFObjC::~MediaStreamPrivateAVFObjC):
1835         (WebCore::MediaStreamPrivateAVFObjC::duration):
1836         (WebCore::MediaStreamPrivateAVFObjC::buffered):
1837         (WebCore::MediaStreamPrivateAVFObjC::readyState):
1838         (WebCore::MediaStreamPrivateAVFObjC::hasAudio):
1839         (WebCore::MediaStreamPrivateAVFObjC::hasVideo):
1840         (WebCore::MediaStreamPrivateAVFObjC::naturalSize):
1841         * platform/mediastream/MediaStreamPrivate.h: 
1842         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Added constructor.
1843
1844 2015-07-13  Eric Carlson  <eric.carlson@apple.com>
1845
1846         [iOS] Cancel AirPlay explicitly when exiting from full screen
1847         https://bugs.webkit.org/show_bug.cgi?id=146902
1848         <rdar://problem/20923632>
1849
1850         Reviewed by Brent Fulgham.
1851
1852         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1853         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1854         (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit): Call setExternalPlayback(false)
1855           if playing to an external screen.
1856
1857 2015-07-12  Chris Fleizach  <cfleizach@apple.com>
1858
1859         AX: WEB: VoiceOver for iOS does not read <iframe> elements during linear (swipe) navigation.
1860         https://bugs.webkit.org/show_bug.cgi?id=146861
1861
1862         Reviewed by Darin Adler.
1863
1864         AttachmentViews exist only on WK1 so we need account for both platforms.
1865
1866         Test: platform/ios-simulator/accessibility/iframe-access.html
1867
1868         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1869         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
1870
1871 2015-07-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1872
1873         [Streams API] Templating ReadableJSStream
1874         https://bugs.webkit.org/show_bug.cgi?id=146802
1875
1876         Reviewed by Darin Adler.
1877
1878         Introducing ReadableStream::clearValues to clear queued values when cancelling and going into error state.
1879
1880         Introducing ReadableEnqueuingStream to handle the stream queue, as a class template.
1881         Specialized ReadableEnqueuingStream for the purpose of ReadableJSStream (storage of JSValue with variable size).
1882
1883         Updated some static functions to accept a ReadableStream in lieu of the more specialized ReadableJSStream.
1884
1885         Covered by existing tests.
1886
1887         * Modules/streams/ReadableStream.cpp:
1888         (WebCore::ReadableStream::changeStateToErrored):
1889         (WebCore::ReadableStream::cancelNoCheck):
1890         * Modules/streams/ReadableStream.h:
1891         (WebCore::ReadableEnqueuingStream::ReadableEnqueuingStream):
1892         (WebCore::ReadableEnqueuingStream::enqueueChunk):
1893         (WebCore::ReadableEnqueuingStream<ChunkType>::read):
1894         * bindings/js/ReadableJSStream.cpp:
1895         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::read):
1896         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::enqueueChunk):
1897         (WebCore::createPullResultFulfilledFunction):
1898         (WebCore::createCancelResultFulfilledFunction):
1899         (WebCore::ReadableJSStream::ReadableJSStream):
1900         (WebCore::ReadableJSStream::enqueue):
1901         * bindings/js/ReadableJSStream.h:
1902         (WebCore::ReadableJSStreamValue::create):
1903         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::desiredSize):
1904         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::ReadableEnqueuingStream):
1905
1906 2015-07-11  Babak Shafiei  <bshafiei@apple.com>
1907
1908         Unreviewed build fix.
1909
1910         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1911         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
1912         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad):
1913
1914 2015-07-11  Nikita Vasilyev  <nvasilyev@apple.com>
1915
1916         Web Inspector: Inspector should be able to be docked to the bottom of a narrow window
1917         https://bugs.webkit.org/show_bug.cgi?id=146871
1918
1919         Reviewed by Timothy Hatcher.
1920
1921         * inspector/InspectorFrontendClientLocal.cpp:
1922
1923 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
1924
1925         Update default link action sheets for app links
1926         https://bugs.webkit.org/show_bug.cgi?id=146658
1927         <rdar://problem/21221902>
1928
1929         Reviewed by Dan Bernstein.
1930
1931         * English.lproj/Localizable.strings:
1932         * platform/spi/ios/LaunchServicesSPI.h:
1933
1934 2015-07-11  Benjamin Poulain  <benjamin@webkit.org>
1935
1936         Fix CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
1937         https://bugs.webkit.org/show_bug.cgi?id=146879
1938
1939         Reviewed by Andreas Kling.
1940
1941         Some of my recent changes broke CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING :(
1942
1943         * contentextensions/CombinedURLFilters.cpp:
1944         (WebCore::ContentExtensions::prefixTreeVertexToString):
1945         (WebCore::ContentExtensions::recursivePrint):
1946         (WebCore::ContentExtensions::CombinedURLFilters::print):
1947         * contentextensions/ContentExtensionsDebugging.h:
1948         * contentextensions/DFA.cpp:
1949         (WebCore::ContentExtensions::DFA::debugPrintDot):
1950
1951 2015-07-10  Simon Fraser  <simon.fraser@apple.com>
1952
1953         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages
1954         https://bugs.webkit.org/show_bug.cgi?id=146872
1955         rdar://problem/7569416
1956
1957         Reviewed by Sam Weinig.
1958
1959         Horizontally scrollable RTL pages in WebKit2 had a variety of issues: they had
1960         a gap down the right edge, and unreachable content on the left side, focussing
1961         form fields scrolled to the wrong location, and programmatic scrolls scrolled
1962         to the wrong place.
1963         
1964         Fix by plumbing the WebCore notion of scrollOrigin through to the UI process,
1965         and using it in various places. There are three main aspects to the patch:
1966         
1967         1. scroll origin is included in RemoteLayerTreeTransaction, and plumbed through
1968            to -[WKWebView _scrollToContentOffset:] for correct programmatic scrolling,
1969            including zooming to focussed form elements.
1970         2. WebPageProxy::computeCustomFixedPositionRect() uses the actual documentRect()
1971            rather than just conjuring up a rect with a zero origin, which makes position:fixed
1972            work correctly.
1973         3. _interactionViewsContainerView (which hosts tap highlights) is positioned to 
1974            coincide with the origin of the documentRect (i.e. at the scroll origin, which
1975            may not be top-left). This allows tap highlights to show in the correct location.
1976         4. ScrollView::unobscuredContentRect() is fixed to take scroll origin into account;
1977            if the returned rect is wrong, RenderLayer::hitTest() incorrectly clips the hit
1978            testing area.
1979
1980         * platform/ios/ScrollViewIOS.mm:
1981         (WebCore::ScrollView::unobscuredContentRect):
1982
1983 2015-07-10  Chris Dumez  <cdumez@apple.com>
1984
1985         [WK2] Diagnostic logging messages are causing too much IPC
1986         https://bugs.webkit.org/show_bug.cgi?id=146873
1987         <rdar://problem/21779205>
1988
1989         Reviewed by Ryosuke Niwa.
1990
1991         Move shouldLogAfterSampling() utility function to DiagnosticLoggingClient
1992         so it can be easily reused.
1993
1994         * page/DiagnosticLoggingClient.h:
1995         (WebCore::DiagnosticLoggingClient::shouldLogAfterSampling):
1996
1997 2015-07-10  Daniel Bates  <dabates@apple.com>
1998
1999         Cleanup: Remove default constructor for WebCore::Pair()
2000         https://bugs.webkit.org/show_bug.cgi?id=146856
2001         <rdar://problem/21773212>
2002
2003         Reviewed by Darin Adler.
2004
2005         Remove default constructor for WebCore::Pair() and the setters Pair::set{First, Second}()
2006         since they are not used and it seems weird to keep the latter after the removal of the former.
2007         Should it turn out that we find a use for having a default constructor and/or setters then
2008         we can revert this change.
2009
2010         * css/Pair.h:
2011         (WebCore::Pair::create): Deleted.
2012         (WebCore::Pair::setFirst): Deleted.
2013         (WebCore::Pair::setSecond): Deleted.
2014         (WebCore::Pair::Pair): Deleted.
2015
2016 2015-07-10  Ryuan Choi  <ryuan.choi@navercorp.com>
2017
2018         [CoordinatedGraphics] Override primaryLayerID in CoordinatedGraphicsLayer
2019         https://bugs.webkit.org/show_bug.cgi?id=146826
2020
2021         Reviewed by Gyuyoung Kim.
2022
2023         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2024         (WebCore::CoordinatedGraphicsLayer::id): Moved id as inline function.
2025         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2026         (WebCore::CoordinatedGraphicsLayer::id):
2027
2028 2015-07-10  Matthew Daiter  <mdaiter@apple.com>
2029
2030         Exposing webkitMediaStream as MediaStream
2031         https://bugs.webkit.org/show_bug.cgi?id=146813
2032         <rdar://problem/21754383>
2033
2034         Reviewed by Eric Carlson.
2035
2036         * Modules/mediastream/MediaStream.idl: Changed interface
2037         name from webkitMediaStream to MediaStream
2038
2039 2015-07-10  Nan Wang  <n_wang@apple.com>
2040
2041         Added ARIA 1.1 "cell" and "table" roles.
2042         https://bugs.webkit.org/show_bug.cgi?id=146011
2043         <rdar://problem/21398946>
2044
2045         Reviewed by Chris Fleizach.
2046
2047         Created a new role called GridCellRole to match the gridcell role, 
2048         so the previous CellRole and TableRole will match to cell and table role.
2049         Made the changes to make sure that both GridRole and TableRole have same
2050         behavior, as well as the circumstance for GridCellRole and CellRole.
2051
2052         Test: accessibility/roles-table-and-cell.html
2053
2054         * accessibility/AXObjectCache.cpp:
2055         (WebCore::createFromRenderer):
2056         * accessibility/AccessibilityNodeObject.cpp:
2057         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
2058         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
2059         * accessibility/AccessibilityObject.cpp:
2060         (WebCore::initializeRoleMap):
2061         * accessibility/AccessibilityObject.h:
2062         * accessibility/AccessibilityRenderObject.cpp:
2063         (WebCore::AccessibilityRenderObject::setSelectedRows):
2064         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
2065         (WebCore::AccessibilityRenderObject::selectedChildren):
2066         * accessibility/AccessibilityTable.cpp:
2067         (WebCore::AccessibilityTable::roleValue):
2068         * accessibility/AccessibilityTableCell.cpp:
2069         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
2070         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2071         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
2072         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
2073         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2074         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2075         (createAccessibilityRoleMap):
2076
2077 2015-07-10  Daniel Bates  <dabates@apple.com>
2078
2079         Serialized declaration for background-size/-webkit-mask-size should preserve identical
2080         values instead of coalescing them
2081         https://bugs.webkit.org/show_bug.cgi?id=143191
2082         <rdar://problem/21759393>
2083
2084         Reviewed by Darin Adler.
2085
2086         Inspired by Blink r157745:
2087         <http://src.chromium.org/viewvc/blink?view=revision&revision=157745>
2088         And Blink r172548:
2089         <http://src.chromium.org/viewvc/blink?view=revision&revision=172548>
2090
2091         Fixes an issue where identical values in a CSS declaration for properties background-size
2092         and -webkit-mask-size would be coalesced when serialized.
2093
2094         * css/CSSParser.cpp:
2095         (WebCore::CSSParser::parseFillSize): Modified to create a Pair object with the appropriate
2096         identical value encoding strategy. We only coalesce identical values when serializing the
2097         declaration of property -webkit-background-size.
2098         * css/Pair.h:
2099         (WebCore::Pair::create): Added variant that takes an encoding.
2100         (WebCore::Pair::cssText): Moved implementation of Pair::generateCSSString() to here and
2101         modified to conditionally coalesce identical values during serialization.
2102         (WebCore::Pair::Pair): Added variant that takes an encoding.
2103         (WebCore::Pair::generateCSSString): Deleted; moved implementation into Pair::cssText().
2104
2105 2015-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
2106
2107         Bidi-Isolate inlines break layout with collapsed whitespace
2108         https://bugs.webkit.org/show_bug.cgi?id=109624
2109         <rdar://problem/21752834>
2110
2111         Reviewed by David Hyatt.
2112
2113         This patch changes the logic in constructBidiRunsForSegment() when it encounters an
2114         isolate. It already has logic to create a BidiResolver for the isolated text;
2115         however, that logic doesn't handle setting up the MidpointState at all.
2116         Specifically, we can set the MidpointState's cursor to point to the context which
2117         we can remember from addPlaceholderRunForIsolatedInline(). This information is
2118         remembered in a HashMap in BidiResolver.
2119
2120         This patch is a partial port of Blink patch
2121         https://src.chromium.org/viewvc/blink?view=rev&revision=159203
2122
2123         Here is some explanatory text regarding how we collapse spaces:
2124
2125         Collapsing whitespace happens in a series of phases. The first phase occurs when
2126         we perform line breaking. Here, we keep track of sequences of whitespace which
2127         should be collapsed, in the form of a vector of pairs of InlineIterators. We put
2128         this knowledge into a MidpointState object.
2129
2130         Then, once we have a line, we run the bidi algorithm on the line (including the
2131         whitespace). As output, the bidi algorithm calls the BidiResolver::appendRun()
2132         callback with two InlineIterators each time it wants to create a run. Because
2133         each renderer that we create has to be owned by exactly one DOM node,
2134         BidiResolver::appendRun() iterates between its two InlineIterator arguments,
2135         calling RenderBlockFlow::appendRunsForObject() on each interstitial DOM node.
2136
2137         This is the function where whitespace collapsing happens. The MidpointState object
2138         keeps a cursor into its remembered whitespace sequences. Here, we simply make a
2139         bidi run for each region in between adjacent whitespace pairs in the MidpointState
2140         object. These bidi runs eventually get turned into leaf InlineBoxes.
2141
2142         The problem is that the BidiResolver::appendRun() callbacks don't occur in
2143         string-order, but the Midpoint InlineIterator pairs are in string-order. In
2144         particular, within a particular isolate, appendRun() gets called in string
2145         order, but callbacks that occur for inner isolates are deferred. This means that
2146         RenderBlockFlow::appendRunsForObject() gets confused when it looks for relevant
2147         whitespace to skip.
2148
2149         Test: fast/text/bidi-isolate-whitespace-collapse.html
2150
2151         * platform/text/BidiResolver.h:
2152         (WebCore::MidpointState::numMidpoints): Returning a const unsigned& is silly.
2153         (WebCore::MidpointState::currentMidpoint): Ditto.
2154         (WebCore::MidpointState::setCurrentMidpoint): The isolated MidpointState object
2155         needs to be able to set its current midpoint to point to the first one inside
2156         the isolate.
2157         (WebCore::MidpointState::decrementNumMidpoints): Renamed from "decrease"
2158         (WebCore::MidpointState::betweenMidpoints): This function is true iff
2159         currentMidpoint() % 2. Instead of keeping a member variable, we can just compute
2160         that.
2161         (WebCore::MidpointState::reset): Deleted.
2162         (WebCore::MidpointState::decreaseNumMidpoints): Deleted.
2163         (WebCore::MidpointState::setBetweenMidpoints): Deleted.
2164         * rendering/InlineIterator.h:
2165         (WebCore::IsolateTracker::addFakeRunIfNecessary): Call
2166         RenderBlockFlow::appendRunsForObject() to keep our MidpointState object in sync
2167         when we pop out of the isolated object. However, we pass in a null run list,
2168         because we don't want to append just yet (that happens when we process the
2169         isolate).
2170         (WebCore::InlineBidiResolver::appendRun): Update for new signature of
2171         appendRunsForObject().
2172         * rendering/RenderBlock.h:
2173         (WebCore::RenderBlock::shouldSkipCreatingRunsForObject): Take a reference instead
2174         of a pointer.
2175         * rendering/RenderBlockFlow.h:
2176         * rendering/RenderBlockLineLayout.cpp:
2177         (WebCore::createRun): Ditto.
2178         (WebCore::RenderBlockFlow::appendRunsForObject): Allow someone passing us a null
2179         BidiRunList. In this case, we will keep the resolver's midpointState() up to date,
2180         but won't actually emit any runs.
2181         (WebCore::notifyResolverToResumeInIsolate): Renamed from setUp.
2182         (WebCore::isolatedResolversMidpointState): Calculate the midpoint state for the
2183         isolated resolver.
2184         (WebCore::setUpResolverToResumeInIsolate): Call isolatedResolversMidpointState().
2185         (WebCore::constructBidiRunsForSegment): Pass in the topResolver, which is
2186         necessary for isolatedResolversMidpointState().
2187         * rendering/line/BreakingContext.h:
2188         (WebCore::checkMidpoints):
2189
2190 2015-07-10  Daniel Bates  <dabates@apple.com>
2191
2192         Cleanup: WebCore::Pair class should use RefPtr&& instead of PassRefPtr
2193         https://bugs.webkit.org/show_bug.cgi?id=146852
2194
2195         Reviewed by Anders Carlsson.
2196
2197         * css/CSSParser.cpp:
2198         (WebCore::createPrimitiveValuePair): Write using a variadic template that forwards its
2199         arguments to the appropriate Pair::create constructor.
2200         (WebCore::CSSParser::parse4ValuesFillPosition): Use RefPtr&& instead of PassRefPtr. 
2201         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
2202         (WebCore::CSSParser::parseFillPosition): Use WTF::move() instead of RefPtr::release()
2203         so that we pass a rvalue reference to RefPtr.
2204         (WebCore::CSSParser::parseFillSize): Ditto.
2205         (WebCore::CSSParser::parseBorderImageRepeat): Ditto.
2206         * css/CSSParser.h:
2207         * css/Pair.h:
2208         (WebCore::Pair::create): Use RefPtr&& instead of PassRefPtr. 
2209         (WebCore::Pair::setFirst): Ditto.
2210         (WebCore::Pair::setSecond): Ditto.
2211         (WebCore::Pair::Pair): Ditto. Also substitute nullptr for 0 in the member initialization
2212         list of the default constructor.
2213
2214 2015-07-10  Zalan Bujtas  <zalan@apple.com>
2215
2216         Crash at WebCore::WebPage::innerFrameQuad.
2217         https://bugs.webkit.org/show_bug.cgi?id=146843
2218         rdar://problem/21501819
2219
2220         Reviewed by Andreas Kling.
2221
2222         We may end up with a null rootEditableElement() after calling Document::updateLayout().
2223
2224         Speculative fix. Not reproducible.
2225
2226         * page/Frame.cpp: Some const cleanup.
2227         (WebCore::Frame::visiblePositionForPoint):
2228         * page/Frame.h:
2229
2230 2015-07-10  Brady Eidson  <beidson@apple.com>
2231
2232         Crash in HistoryController::updateForCommit dereferencing a null HistoryItem.
2233         <rdar://problem/21371589> and https://bugs.webkit.org/show_bug.cgi?id=146842
2234
2235         Reviewed by Chris Dumez.
2236
2237         No new tests (Unknown how to reproduce).
2238         
2239         This patch basically rolls back part of http://trac.webkit.org/changeset/179472.
2240         
2241         r179472 changed HistoryController::setCurrentItem() to take a reference instead of a pointer.
2242         Unfortunately, we sometimes call setCurrentItem(nullptr).
2243         
2244         We'd like to *not* do that, and there are assertions in place to try to catch when we do,
2245         but in the meantime it is not valid to dereference nullptr.
2246
2247         * loader/FrameLoader.cpp:
2248         (WebCore::FrameLoader::loadSameDocumentItem):
2249         
2250         * loader/HistoryController.cpp:
2251         (WebCore::HistoryController::updateForCommit):
2252         (WebCore::HistoryController::recursiveUpdateForCommit):
2253         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
2254         (WebCore::HistoryController::setCurrentItem): Take a ptr instead of a ref.
2255         (WebCore::HistoryController::createItem):
2256         * loader/HistoryController.h:
2257
2258 2015-07-10  Javier Fernandez  <jfernandez@igalia.com>
2259
2260         [CSS Grid Layout] Grid item's auto-margins are not applied correctly
2261         https://bugs.webkit.org/show_bug.cgi?id=146581
2262
2263         Reviewed by Darin Adler.
2264
2265         Grid Layout specification states that auto-margins must prevent to apply
2266         any Box Alignment property in that dimension. Instead, auto-margin is
2267         applied as described in the spec.
2268
2269         http://dev.w3.org/csswg/css-grid/#auto-margins
2270
2271         Only Flexbox and Grid Layout implement vertical auto-margin alignment;
2272         for other layout modes, auto-margin should compute as 0.
2273
2274         Tests: fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html
2275                fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl.html
2276                fast/css-grid-layout/grid-item-auto-margins-alignment.html
2277
2278         * rendering/RenderBox.cpp:
2279         (WebCore::RenderBox::styleDidChange):
2280         (WebCore::RenderBox::updateGridAlignmentAfterStyleChange):
2281         * rendering/RenderBox.h:
2282         * rendering/RenderGrid.cpp:
2283         (WebCore::RenderGrid::layoutGridItems):
2284         (WebCore::RenderGrid::hasAutoMarginsInColumnAxis):
2285         (WebCore::RenderGrid::hasAutoMarginsInRowAxis):
2286         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
2287         (WebCore::RenderGrid::rowPositionForChild):
2288         (WebCore::RenderGrid::columnPositionForChild):
2289         * rendering/RenderGrid.h:
2290
2291 2015-07-10  Csaba Osztrogonác  <ossy@webkit.org>
2292
2293         Fix overloaded virtual function warning in ScrollbarThemeGtk.h
2294         https://bugs.webkit.org/show_bug.cgi?id=145920
2295
2296         Reviewed by Darin Adler.
2297
2298         * platform/gtk/ScrollbarThemeGtk.h:
2299
2300 2015-07-10  Chris Fleizach  <cfleizach@apple.com>
2301
2302         AX: <details> element should allow expand/close through AX API
2303         https://bugs.webkit.org/show_bug.cgi?id=146549
2304
2305         Apply review comments from Daniel Bates.
2306
2307         * accessibility/AccessibilityNodeObject.cpp:
2308         (WebCore::AccessibilityNodeObject::setIsExpanded):
2309
2310 2015-07-10  Brady Eidson  <beidson@apple.com>
2311
2312         ASSERT restoring from page cache as DocumentLoader reattaches to its Frame.
2313         <rdar://problem/21766282> and https://bugs.webkit.org/show_bug.cgi?id=146786
2314
2315         Reviewed by NOBODY (Fixing obvious boneheaded mistake in r186642)
2316
2317         No new tests (Covered by existing)
2318
2319         * loader/DocumentLoader.cpp:
2320         (WebCore::DocumentLoader::attachToFrame): Bail if reattaching to the current Frame,
2321           which happens when restoring from the page cache.
2322
2323 2015-07-09  Zalan Bujtas  <zalan@apple.com>
2324
2325         Plugin create can end up destroying its renderer.
2326         https://bugs.webkit.org/show_bug.cgi?id=146824
2327         rdar://problem/18921429
2328
2329         Reviewed by Andreas Kling.
2330
2331         Plugins can run arbitrary code during initialization. If the plugin
2332         happens to destroy the associated node, its renderer becomes invalid.
2333         This patch checks whether the renderer survived the createPlugin() call.
2334         (This WeakPtr pattern is also used in RenderWidget to avoid dangling pointers.)
2335
2336         Speculative fix. Not reproducible.
2337
2338         * loader/SubframeLoader.cpp:
2339         (WebCore::SubframeLoader::loadPlugin):
2340
2341 2015-07-09  Dan Bernstein  <mitz@apple.com>
2342
2343         WebCore part of Track and expose policies for external URL schemes and App Links separately
2344         https://bugs.webkit.org/show_bug.cgi?id=146822
2345
2346         Reviewed by Anders Carlsson.
2347
2348         * loader/FrameLoaderTypes.h: Added ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes,
2349         meaning external schemes are allowed but App Links are not. The opposite state doesn’t
2350         exist.
2351
2352         * page/ContextMenuController.cpp:
2353         (WebCore::ContextMenuController::contextMenuItemSelected): Opening a link in a new window
2354         or in the current window should never open it as an App Link.
2355
2356 2015-07-09  Daniel Bates  <dabates@apple.com>
2357
2358         Fetching Content Security Policy report URL should respect same origin policy
2359         https://bugs.webkit.org/show_bug.cgi?id=146754
2360         <rdar://problem/18860259>
2361
2362         Reviewed by Brady Eidson.
2363
2364         Inspired by Blink r149791 (by Mike West <mkwst@chromium.org>):
2365         <https://src.chromium.org/viewvc/blink?revision=149791&view=revision>
2366
2367         As per <http://www.w3.org/TR/2015/CR-CSP2-20150219/#send-violation-reports>, fetching the
2368         Content Security Policy report URL should include cookies if and only if the origin of
2369         the protected resource is equal to the origin of the report URL.
2370
2371         Tests: http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.html
2372                http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.html
2373                http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.html
2374                http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.html
2375                http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.html
2376                http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.html
2377
2378         * loader/PingLoader.cpp:
2379         (WebCore::PingLoader::sendViolationReport):
2380
2381 2015-07-09  Timothy Horton  <timothy_horton@apple.com>
2382
2383         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
2384         https://bugs.webkit.org/show_bug.cgi?id=146294
2385         <rdar://problem/21090193>
2386
2387         Reviewed by Anders Carlsson.
2388
2389         * platform/cocoa/MachSendRight.h:
2390         Export some constructors.
2391
2392         * platform/spi/cocoa/QuartzCoreSPI.h:
2393         Add some SPI.
2394
2395 2015-07-09  Brady Eidson  <beidson@apple.com>
2396
2397         Followup to r186647
2398
2399         Reviewed by NOBODY.
2400
2401         Thanks, EWS and commit-queue, for not catching this!
2402
2403         * loader/DocumentLoader.h: Add a semi-colon.
2404
2405 2015-07-09  Dean Jackson  <dino@apple.com>
2406
2407         REGRESSION: Inline media scrubbing always pauses the video
2408         https://bugs.webkit.org/show_bug.cgi?id=146819
2409         <rdar://problem/21572027>
2410
2411         Reviewed by Eric Carlson. Joseph Pecoraro also was really
2412         helpful in diagnosing the problem.
2413
2414         When we moved some code from a getter/setter in the child
2415         class to the base class, it was no longer being called due
2416         to the bad way we were implementing inheritance. The solution
2417         was to have the child class explicitly call into the base
2418         class.
2419
2420         The much better solution would have been to rewrite everything
2421         to use ES6 classes or, as a smaller change, assign the __proto__
2422         directly on the child prototype. But I felt that was a bit
2423         too risky at this point.
2424
2425         * Modules/mediacontrols/mediaControlsApple.js:
2426         (Controller.prototype.extend): Describe in a comment why the extend function
2427         is not suitable.
2428         * Modules/mediacontrols/mediaControlsiOS.js: Add a getter/setter for
2429         scrubbing that calls into the base Controller.
2430
2431 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
2432
2433         AX: <details> element should allow expand/close through AX API
2434         https://bugs.webkit.org/show_bug.cgi?id=146549
2435
2436         Reviewed by Mario Sanchez Prada.
2437
2438         Forgot this file with the original commit.
2439
2440         * html/HTMLDetailsElement.cpp:
2441         (WebCore::HTMLDetailsElement::toggleOpen):
2442
2443 2015-07-09  Alex Christensen  <achristensen@webkit.org>
2444
2445         [Content Extensions] Add 3 byte jump size.
2446         https://bugs.webkit.org/show_bug.cgi?id=146425
2447
2448         Reviewed by Darin Adler.
2449
2450         * contentextensions/DFABytecode.h:
2451         (WebCore::ContentExtensions::smallestPossibleJumpSize):
2452         * contentextensions/DFABytecodeCompiler.cpp:
2453         (WebCore::ContentExtensions::appendZeroes):
2454         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2455         * contentextensions/DFABytecodeInterpreter.cpp:
2456         (WebCore::ContentExtensions::jumpSizeInBytes):
2457         (WebCore::ContentExtensions::getJumpSize):
2458         (WebCore::ContentExtensions::getJumpDistance):
2459         Added DFABytecodeJumpSize::Int24.
2460
2461 2015-07-09  Brady Eidson  <beidson@apple.com>
2462
2463         Add better ASSERTs to learn more about what is going wrong in DocumentLoader::detachFromFrame()
2464         https://bugs.webkit.org/show_bug.cgi?id=146816
2465
2466         Reviewed by Alex Christensen.
2467
2468         * loader/DocumentLoader.cpp:
2469         (WebCore::DocumentLoader::attachToFrame): Set the "has ever been attached" flag to true.
2470         (WebCore::DocumentLoader::detachFromFrame): ASSERT m_frame is non-null, but with a message 
2471           depending on the value of the "has ever been attached" flag.
2472         * loader/DocumentLoader.h:
2473
2474 2015-07-09  Brent Fulgham  <bfulgham@apple.com>
2475
2476         [Mac, iOS] The mimeTypeCache should return a reference
2477         https://bugs.webkit.org/show_bug.cgi?id=146809
2478
2479         Reviewed by Eric Carlson.
2480
2481         No new tests: No change in functionality.
2482
2483         Don't copy the mime type cache every time someone asks it a question. Return
2484         by reference instead.
2485
2486         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2487         (WebCore::mimeTypeCache):
2488         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2489         (WebCore::mimeTypeCache):
2490         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
2491         (WebCore::mimeTypeCache):
2492
2493 2015-07-09  Wenson Hsieh  <whsieh@berkeley.edu>
2494
2495         Rubber banding is broken when using a Mighty Mouse
2496         https://bugs.webkit.org/show_bug.cgi?id=146693
2497
2498         Reviewed by Tim Horton.
2499
2500         Sets the "constrain content edge scrolling" flag to true by default, causing scrolling
2501         with a Mighty Mouse to not extend beyond the container's edges.
2502
2503         Test: platform/mac-wk2/tiled-drawing/scrolling/stateless-scrolling-no-rubber-band.html
2504
2505         * rendering/RenderLayer.cpp: Remove code that defaulted the flag to false.
2506         (WebCore::RenderLayer::RenderLayer): Deleted.
2507         * rendering/RenderMarquee.cpp: Added special case for marquees that allows content to scroll.
2508         (WebCore::RenderMarquee::RenderMarquee): See above.
2509
2510 2015-07-09  Brady Eidson  <beidson@apple.com>
2511
2512         DocumentLoader::detachFromFrame() is being called with no current Frame set.
2513         <rdar://problem/21293082> and https://bugs.webkit.org/show_bug.cgi?id=146786 
2514
2515         Reviewed by Sam Weinig.
2516
2517         No new tests (Unknown how to reproduce).
2518
2519         * loader/DocumentLoader.cpp:
2520         (WebCore::DocumentLoader::attachToFrame):
2521         (WebCore::DocumentLoader::detachFromFrame): Null check m_frame before dereferencing it.
2522         (WebCore::DocumentLoader::setFrame): Deleted, renamed to attachToFrame(), and take's
2523           a Frame& instead of a Frame*.
2524         * loader/DocumentLoader.h:
2525         
2526         * loader/FrameLoader.cpp:
2527         (WebCore::FrameLoader::initForSynthesizedDocument): setFrame is now attachToFrame.
2528         (WebCore::FrameLoader::setPolicyDocumentLoader): Ditto.
2529         (WebCore::FrameLoader::transitionToCommitted): Ditto.
2530
2531 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
2532
2533         Expose MediaStream methods to be used in the MediaStream Engine
2534         https://bugs.webkit.org/show_bug.cgi?id=146791
2535         <rdar://problem/21747589>
2536
2537         Reviewed by Brent Fulgham.
2538
2539         * Modules/mediastream/MediaStream.cpp: 
2540         (WebCore::MediaStream::getAudioTracks): Removed const
2541         (WebCore::MediaStream::getVideoTracks): Ditto
2542         * Modules/mediastream/MediaStream.h: Needed to change functions to
2543         override
2544         * platform/mediastream/MediaStreamPrivate.h: Added certain calls to
2545         PrivateClient that exposes methods to be used in the engine
2546
2547 2015-07-09  Devin Rousso  <drousso@apple.com>
2548
2549         Web Inspector: Fix shape-highlight layout tests
2550         https://bugs.webkit.org/show_bug.cgi?id=146080
2551
2552         Reviewed by Joseph Pecoraro.
2553
2554         * inspector/InspectorOverlay.cpp:
2555         (WebCore::buildObjectForShapeOutside): Now properly returns the shape margin.
2556
2557 2015-07-09  Eric Carlson  <eric.carlson@apple.com>
2558
2559         [Mac] AirPlay to password protected AppleTV fails
2560         https://bugs.webkit.org/show_bug.cgi?id=146812
2561
2562         Reviewed by Dean Jackson.
2563
2564         * Modules/mediasession/WebMediaSessionManager.cpp:
2565         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Initialize previouslyRequestedPicker.
2566         (WebCore::WebMediaSessionManager::clientStateDidChange): Cleanup the logic and add a comment
2567           to make it slightly easier to follow. Don't begin playing to a device unless playback
2568           has just started (don't switch in mid-play).
2569         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Use the last client to
2570           request the device picker as a fallback in case no other client is a canditate. Add more
2571           logging to make it possible to debug the selection logic.
2572         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Fiddle with the logging.
2573
2574 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
2575
2576         Implementing platform-specific section of enumerateDevices
2577         https://bugs.webkit.org/show_bug.cgi?id=146461
2578         <rdar://problem/21614466>
2579
2580         Reviewed by Darin Adler.
2581
2582         * Modules/mediastream/MediaDeviceInfo.cpp: Changed access methods
2583         (WebCore::MediaDeviceInfo::audioInputType): Added AtomicString
2584         permanent refs
2585         (WebCore::MediaDeviceInfo::audioOutputType): Ditto
2586         (WebCore::MediaDeviceInfo::videoInputType): Ditto
2587         * Modules/mediastream/MediaDeviceInfo.h: Changed String refs to values
2588         (WebCore::MediaDeviceInfo::label): Ditto
2589         (WebCore::MediaDeviceInfo::deviceId): Ditto
2590         (WebCore::MediaDeviceInfo::groupId): Ditto
2591         (WebCore::MediaDeviceInfo::kind): Ditto
2592         * platform/mediastream/MediaDevicesPrivate.cpp: Implemented query for
2593         available devices
2594         (WebCore::MediaDevicesPrivate::MediaDevicesPrivate):
2595         (WebCore::MediaDevicesPrivate::create):
2596         (WebCore::MediaDevicesPrivate::availableMediaDevices):
2597         * platform/mediastream/MediaDevicesPrivate.h:
2598         (WebCore::MediaDevicesPrivate::~MediaDevicesPrivate):
2599         * WebCore.xcodeproj/project.pbxproj:
2600         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Needed
2601         to tack on extra fields to hold data
2602         (WebCore::TrackSourceInfo::create):
2603         (WebCore::TrackSourceInfo::groupId):
2604         (WebCore::TrackSourceInfo::deviceId):
2605         (WebCore::TrackSourceInfo::TrackSourceInfo):
2606         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2607         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
2608
2609 2015-07-09  Per Arne Vollan  <peavo@outlook.com>
2610
2611         [Win] Add memory pressure handler.
2612         https://bugs.webkit.org/show_bug.cgi?id=146685
2613
2614         Reviewed by Brent Fulgham.
2615
2616         Add memory pressure handler implementation on Windows.
2617         We check the memory usage at regular intervals with a timer.
2618
2619         * WebCore.vcxproj/WebCore.vcxproj:
2620         * WebCore.vcxproj/WebCore.vcxproj.filters:
2621         * platform/MemoryPressureHandler.cpp:
2622         (WebCore::MemoryPressureHandler::releaseMemory):
2623         (WebCore::MemoryPressureHandler::install):
2624         (WebCore::MemoryPressureHandler::uninstall):
2625         (WebCore::MemoryPressureHandler::holdOff):
2626         * platform/win/MemoryPressureHandlerWin.cpp: Added.
2627         (WebCore::CheckMemoryTimer::CheckMemoryTimer):
2628         (WebCore::CheckMemoryTimer::fired):
2629         (WebCore::CheckMemoryTimer::handleMemoryLow):
2630         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2631         (WebCore::memCheckTimer):
2632         (WebCore::MemoryPressureHandler::install):
2633         (WebCore::MemoryPressureHandler::uninstall):
2634         (WebCore::MemoryPressureHandler::holdOff):
2635         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2636         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2637         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
2638         * platform/win/Win32Handle.h:
2639         (WebCore::Win32Handle::operator=):
2640
2641 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
2642
2643         Exposed AVVideoCaptureSource's bounds
2644         https://bugs.webkit.org/show_bug.cgi?id=146760
2645         <rdar://problem/21736772>
2646
2647         Reviewed by Brent Fulgham.
2648
2649         * platform/mediastream/mac/AVVideoCaptureSource.h:
2650         (WebCore::AVVideoCaptureSource::width): Needed access to video width
2651         (WebCore::AVVideoCaptureSource::height): Needed access to video height
2652
2653 2015-07-09  Karlen Simonyan  <szkarlen@gmail.com>
2654
2655         [WinCairo] ClearType should be enabled on Cairo port
2656         https://bugs.webkit.org/show_bug.cgi?id=145492
2657
2658         Reviewed by Brent Fulgham.
2659
2660         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
2661         (WebCore::FontPlatformData::FontPlatformData):
2662         Use CAIRO_ANTIALIAS_BEST instead of CAIRO_ANTIALIAS_GRAY.
2663
2664 2015-07-02  Chris Fleizach  <cfleizach@apple.com>
2665
2666         AX: <details> element should allow expand/close through AX API
2667         https://bugs.webkit.org/show_bug.cgi?id=146549
2668
2669         Reviewed by Mario Sanchez Prada.
2670
2671         Allow AXExpanded to be writeable for <details> element, which, when set
2672         will toggle the opening and closing of the element. 
2673         Post a notification when that happens as well.
2674
2675         Modified test: platform/mac/accessibility/details-summary.html
2676
2677         * accessibility/AccessibilityNodeObject.cpp:
2678         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
2679         (WebCore::AccessibilityNodeObject::setIsExpanded):
2680         (WebCore::shouldUseAccessibilityObjectInnerText):
2681         * accessibility/AccessibilityNodeObject.h:
2682         * accessibility/AccessibilityObject.cpp:
2683         (WebCore::AccessibilityObject::supportsPressAction):
2684         * accessibility/AccessibilityRenderObject.cpp:
2685         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute):
2686         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2687         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
2688         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2689         * html/HTMLDetailsElement.cpp:
2690         (WebCore::HTMLDetailsElement::toggleOpen):
2691
2692 2015-07-09  Alex Christensen  <achristensen@webkit.org>
2693
2694         [Content Extensions] Prevent crashes with plugins.
2695         https://bugs.webkit.org/show_bug.cgi?id=146705
2696         rdar://problem/20855444
2697
2698         Reviewed by Brady Eidson.
2699
2700         * loader/NetscapePlugInStreamLoader.cpp:
2701         (WebCore::NetscapePlugInStreamLoader::create):
2702         Call addPlugInStreamLoader in ResourceLoader::willSendRequest to always add blocked loads.
2703         * loader/NetscapePlugInStreamLoader.h:
2704         * loader/ResourceLoader.cpp:
2705         (WebCore::ResourceLoader::willSendRequest):
2706         Removed unnecessary early returns.
2707         * loader/ResourceLoader.h:
2708         (WebCore::ResourceLoader::isPlugInStreamLoader):
2709
2710 2015-07-09  Brent Fulgham  <bfulgham@apple.com>
2711
2712         [Win] Honor CACFLayer content scale factor
2713         https://bugs.webkit.org/show_bug.cgi?id=146792
2714
2715         Reviewed by Dean Jackson.
2716
2717         * AVFoundationSupport.py: Check for the CACFLayerSet/GetContentsScale
2718         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2719         (PlatformCALayerWin::PlatformCALayerWin): Use owner's scale factor (if
2720         present).
2721         (PlatformCALayerWin::contentsScale): Use CACFLayer API if present.
2722         (PlatformCALayerWin::setContentsScale): Ditto.
2723         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2724         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Use owner's scale
2725         factor (if present).
2726         (PlatformCALayerWinInternal::addTile): Use tile parent's scale factor.
2727
2728 2015-07-08  Matt Rajca  <mrajca@apple.com>
2729
2730         Media Session: report to chrome client 'hasActiveMediaElements' changes
2731         https://bugs.webkit.org/show_bug.cgi?id=146745
2732
2733         Reviewed by Eric Carlson.
2734
2735         * Modules/mediasession/MediaSession.cpp: All updates to active media elements are now funneled through a helper
2736           method that will invoke the 'hasMediaSessionWithActiveMediaElementsDidChange' callback when necessary.
2737         (WebCore::MediaSession::removeMediaElement):
2738         (WebCore::MediaSession::changeActiveMediaElements):
2739         (WebCore::MediaSession::addActiveMediaElement):
2740         (WebCore::MediaSession::releaseSession):
2741         * Modules/mediasession/MediaSession.h:
2742         * Modules/mediasession/MediaSessionManager.cpp:
2743         (WebCore::MediaSessionManager::hasActiveMediaElements):
2744         * Modules/mediasession/MediaSessionManager.h:
2745
2746 2015-07-09  Darin Adler  <darin@apple.com>
2747
2748         REGRESSION (r182866): repeated prompts for password on internal Apple website using workers
2749         https://bugs.webkit.org/show_bug.cgi?id=146769
2750
2751         Reviewed by Sam Weinig.
2752
2753         Not sure how to make a regression test for this. Sure would be nice to have one though.
2754
2755         * loader/ThreadableLoader.cpp:
2756         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added. Calls through to the
2757         base class copy constructor to copy data members of the base class (the lack of this was
2758         the bug). Also initializes all the data members of this class.
2759         (WebCore::ThreadableLoaderOptions::isolatedCopy): Changed to call the constructor above.
2760
2761         * loader/ThreadableLoader.h: Added new constructor.
2762
2763 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
2764
2765         AX: VoiceOver cannot get to any content in Yahoo Mail messages table
2766         https://bugs.webkit.org/show_bug.cgi?id=146674
2767
2768         Reviewed by Darin Adler.
2769
2770         A table row could have any number of parent elements in the render tree, but for the purposes
2771         of accessibility we only want to report the AXTable as the parent so that it looks like a sane
2772         data table.
2773
2774         Test: accessibility/aria-table-with-presentational-elements.html
2775
2776         * accessibility/AccessibilityARIAGridRow.cpp:
2777         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
2778         (WebCore::AccessibilityARIAGridRow::parentObjectUnignored):
2779         (WebCore::AccessibilityARIAGridRow::parentTable):
2780         * accessibility/AccessibilityARIAGridRow.h:
2781
2782 2015-07-08  Sungmann Cho  <sungmann.cho@navercorp.com>
2783
2784         [GTK] The "Missing Plug-in" buttons are not showing up on some flash contents.
2785         https://bugs.webkit.org/show_bug.cgi?id=146707
2786
2787         Reviewed by Martin Robinson.
2788
2789         Currently, WebKitGTK+ doesn't show the "Missing Plug-in" buttons if the plugin-related tags
2790         don't have a "type" attribute. In such a case, WebCore tries to guess the MIME type from
2791         the extensions by using MIMETypeRegistry::getMIMETypeForExtension(). For WebKitGTK+,
2792         MIMETypeRegistry::getMIMETypeForExtension() goes through |extensionMap|, which is a simple
2793         array of <extension, mime type>, looking for the mime type for the given extension.
2794         But |extensionMap| in MIMETypeRegistryGtk.cpp doesn't have the information for ".swf",
2795         so WebCore fails to guess the MIME type and regard the content type as ObjectContentFrame,
2796         not ObjectContentNetscapePlugin.
2797
2798         * platform/gtk/MIMETypeRegistryGtk.cpp:
2799
2800 2015-07-08  Brady Eidson  <beidson@apple.com>
2801
2802         Crash calling [WebView close] in didFinishLoadForFrame callback.
2803         <rdar://problem/21690765> and https://bugs.webkit.org/show_bug.cgi?id=146773
2804
2805         Reviewed by David Kilzer.
2806
2807         Added API Test "WebViewCloseInsideDidFinishLoadForFrame"
2808
2809         * loader/FrameLoader.cpp:
2810         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): After the delegate callback,
2811           don't use the local Page* variable from earlier, but instead refetch it from m_frame.
2812
2813 2015-07-08  Daniel Bates  <dabates@apple.com>
2814
2815         Cleanup: Make ContentSecurityPolicy::ReportingStatus an enum class
2816         https://bugs.webkit.org/show_bug.cgi?id=146670
2817
2818         Reviewed by Darin Adler.
2819
2820         Make calling the ContentSecurityPolicy::allow* functions less error prone by making
2821         ContentSecurityPolicy::ReportingStatus an enum class. Among other benefits this will
2822         prevent a caller from inadvertently passing an enumerator of ContentSecurityPolicy::ReportingStatus
2823         as the boolean argument overridingContentSecurityPolicy, which is taken by the various
2824         ContentSecurityPolicy::allow* functions, by causing a compile-time error (since an enum class
2825         enumerator cannot be implicitly converted to an integral type).
2826
2827         * bindings/js/ScriptController.cpp:
2828         (WebCore::ScriptController::initScript):
2829         * page/ContentSecurityPolicy.cpp:
2830         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
2831         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
2832         (WebCore::CSPDirectiveList::allowInlineScript):
2833         (WebCore::CSPDirectiveList::allowInlineStyle):
2834         (WebCore::CSPDirectiveList::allowEval):
2835         (WebCore::CSPDirectiveList::allowPluginType):
2836         (WebCore::CSPDirectiveList::allowScriptFromSource):
2837         (WebCore::CSPDirectiveList::allowObjectFromSource):
2838         (WebCore::CSPDirectiveList::allowChildFrameFromSource):
2839         (WebCore::CSPDirectiveList::allowImageFromSource):
2840         (WebCore::CSPDirectiveList::allowStyleFromSource):
2841         (WebCore::CSPDirectiveList::allowFontFromSource):
2842         (WebCore::CSPDirectiveList::allowMediaFromSource):
2843         (WebCore::CSPDirectiveList::allowConnectToSource):
2844         (WebCore::CSPDirectiveList::allowFormAction):
2845         (WebCore::CSPDirectiveList::allowBaseURI):
2846         (WebCore::ContentSecurityPolicy::didReceiveHeader):
2847         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
2848         * page/ContentSecurityPolicy.h:
2849         * page/DOMSecurityPolicy.cpp:
2850         (WebCore::DOMSecurityPolicy::allowsEval):
2851
2852 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
2853
2854         Activate DOMURLMediaStream
2855         https://bugs.webkit.org/show_bug.cgi?id=146764
2856         <rdar://problem/21738101>
2857
2858         Reviewed by Eric Carlson.
2859
2860         * DerivedSources.make: Added DOMURLMediaStream.idl to list
2861         * WebCore.xcodeproj/project.pbxproj: Added DOMURLMediaStream.cpp and
2862         DOMURLMediaStream.h to compile
2863
2864 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
2865
2866         Make sure MediaStream uses blob protocol
2867         https://bugs.webkit.org/show_bug.cgi?id=146752
2868         <rdar://problem/21736057>
2869
2870         Reviewed by Eric Carlson.
2871
2872         * html/HTMLMediaElement.cpp:
2873         (WebCore::HTMLMediaElement::selectNextSourceChild): Added MediaStream
2874         blob protocol
2875
2876 2015-07-08  Andreas Kling  <akling@apple.com>
2877
2878         Videos on apple.com don't show up when restored from page cache.
2879         <https://webkit.org/b/146766>
2880         <rdar://problem/21712311>
2881
2882         Reviewed by Darin Adler.
2883
2884         Break out most of HTMLMediaElement::stop() (override of ActiveDOMObject::stop(), to be clear)
2885         into a stopWithoutDestroyingMediaPlayer() function that both stop() and suspend() can call.
2886
2887         Before this change, suspend() would call stop() when moving into the page cache, killing the
2888         internal MediaPlayer object which caused the video to disappear from the page.
2889
2890         Test: LayoutTests/media/restore-from-page-cache.html (amended)
2891
2892         * html/HTMLMediaElement.cpp:
2893         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
2894         (WebCore::HTMLMediaElement::stop):
2895         (WebCore::HTMLMediaElement::suspend):
2896         * html/HTMLMediaElement.h:
2897
2898 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
2899
2900         Make MediaStream conform to its private client like MediaSource does
2901         https://bugs.webkit.org/show_bug.cgi?id=146756
2902         <rdar://problem/21736457>
2903
2904         Reviewed by Brent Fulgham.
2905
2906         MediaStream should be inheriting its PrivateClient's getters and
2907         setters for RefCounted, not inheriting its own.
2908
2909         * Modules/mediastream/MediaStream.h: Changed MediaStream's inherit
2910         statements
2911         * platform/mediastream/MediaStreamPrivate.h: Changed
2912         MediaStreamPrivateClient to inherit RefCounted<MediaStreamPrivateClient>
2913
2914 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
2915
2916         Made AVMediaCaptureSource's session accessor public
2917         https://bugs.webkit.org/show_bug.cgi?id=146758
2918         <rdar://problem/21736651>
2919
2920         Reviewed by Brent Fulgham.
2921
2922         * platform/mediastream/mac/AVMediaCaptureSource.h:
2923         (WebCore::AVMediaCaptureSource::session): Changed to public
2924
2925 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
2926
2927         Make sure MediaStream engine loaded for interpreting MediaStreams
2928         https://bugs.webkit.org/show_bug.cgi?id=146748
2929         <rdar://problem/21735416>
2930
2931         Reviewed by Brent Fulgham.
2932
2933         Prevent the MediaSource engine from being used to process
2934         MediaStreams, since they are not compatible
2935
2936         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: 
2937         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2938         Changed MediaStream to never be loaded
2939         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2940         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2941         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): 
2942         Changed MediaStream to never be loaded
2943
2944
2945 2015-07-08  Benjamin Poulain  <bpoulain@apple.com>
2946
2947         [Content Extensions] Fuse undistinguishable actions as much as possible
2948         https://bugs.webkit.org/show_bug.cgi?id=146762
2949
2950         Reviewed by Alex Christensen.
2951
2952         Our previous code that fused actions was based on test lists that were
2953         grouping similar actions in the input.
2954
2955         The input we get from developers is more distributed. It is very common to
2956         have trigger flags all over the place, and "css-display-none" mixed with "block".
2957
2958         This patch refines the merging code to merge those cases as much as possible.
2959
2960         The size taken by the actions is negligible, but having different actions make
2961         nodes unkillable by the Minimizer. By merging many more actions, the minimizer
2962         no longer see those subtrees as distinguishable and can do a better job.
2963
2964         On a large test list, this cuts the bytecode size by 2 megabytes.
2965
2966         Tests: http/tests/contentextensions/css-display-none-after-ignore-previous-rules.html
2967                http/tests/contentextensions/single-css-display-none.html
2968
2969         * contentextensions/ContentExtensionCompiler.cpp:
2970         (WebCore::ContentExtensions::resolvePendingDisplayNoneActions):
2971         (WebCore::ContentExtensions::serializeActions):
2972
2973 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
2974
2975         Cleared contentMIMETypes for MediaStreams
2976         https://bugs.webkit.org/show_bug.cgi?id=146750
2977         <rdar://problem/21735678>
2978
2979         Reviewed by Brent Fulgham.
2980
2981         * platform/graphics/MediaPlayer.cpp:
2982         (WebCore::MediaPlayer::load): Needed to clear contentMIMETypes
2983
2984 2015-07-08  Dean Jackson  <dino@apple.com>
2985
2986         Audio elements with controls force their enclosing stacking context to composite
2987         https://bugs.webkit.org/show_bug.cgi?id=146751
2988         <rdar://problem/21466572>
2989
2990         Reviewed by Simon Fraser.
2991
2992         There were a number of issues with audio controls, on both iOS and OS X.
2993
2994         - they used a blurry background which was not the intended design
2995         - they cause the page to composite, which causes a degradation in
2996           text rendering quality
2997         - they inserted 20px of padding above every audio element, which
2998           could break existing page designs.
2999
3000         Removing the need for compositing and blending means that the
3001         colors used for control tints need to be adjusted for the non-blended
3002         case. Wherever I could, I kept as much as possible in a shared
3003         rule and made specific changes for audio or video.
3004
3005         The controls were also unintentionally relying on the compositing
3006         to create stacking contexts and control the rendering order. Without
3007         them, I needed to add some explicit stacking.
3008
3009         I also made some drive-by whitespace clean-ups.
3010
3011         * Modules/mediacontrols/mediaControlsApple.css: Remove as much compositing
3012         as possible in audio controls.
3013
3014         * Modules/mediacontrols/mediaControlsApple.js:
3015         (Controller.prototype.drawTimelineBackground): Use specific colors for audio.
3016
3017         * Modules/mediacontrols/mediaControlsiOS.css: Remove as much need for compositing
3018         as possible.
3019
3020 2015-07-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3021
3022         Crash when appending an SVG <use> element dynamically which has animated SVG <path> element
3023         https://bugs.webkit.org/show_bug.cgi?id=146690
3024         <rdar://problem/20790376>
3025
3026         Reviewed by Dean Jackson.
3027
3028         Test: svg/animations/insert-animate-use-path-while-animation.svg
3029
3030         The crashing call stack shows that
3031         SVGAnimatedListPropertyTearOff<SVGPathSegList>::m_animVal is null when
3032         trying to access it in synchronizeWrappersIfNeeded(). This happens because
3033         animationStarted() was not called for this animatedType.
3034         
3035         SVGAnimateElementBase::resetAnimatedType() calls
3036         SVGAnimatedPathAnimator::startAnimValAnimation() at the beginning of the
3037         animation. For the target element and all its instances, this function calls
3038         SVGAnimatedPathSegListPropertyTearOff::animationStarted() which calls
3039         SVGAnimatedListPropertyTearOff<SVGPathSegList>::animationStarted(). This
3040         last function allocates the member m_animVal when calling
3041         SVGAnimatedListPropertyTearOff<SVGPathSegList>::animVal(). 
3042         
3043         When adding a new instance of the same animating target element, 
3044         SVGAnimateElementBase::resetAnimatedType() just keeps calling
3045         SVGAnimatedPathAnimator::animValDidChange() for all the instances of the
3046         targetElement without ensuring that all of them have started their
3047         animations.
3048         
3049         The fix is to make SVGAnimatedPathAnimator::resetAnimValToBaseVal() ensure
3050         that animationStarted() is called for the targetElement and all its instances.
3051
3052         * svg/SVGAnimatedPath.cpp:
3053         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Move resetting
3054         the animation value and starting the animatedTypes code to a new overriding
3055         function which is named resetAnimValToBaseVal().
3056         
3057         (WebCore::SVGAnimatedPathAnimator::resetAnimValToBaseVal): Call the overriding
3058         function which calls buildSVGPathByteStreamFromSVGPathSegList() as before
3059         and ensure that all the animatedTypes have started their animations.
3060         
3061         * svg/SVGAnimatedPath.h:
3062
3063 2015-07-08  Brady Eidson  <beidson@apple.com>
3064
3065         Move PingLoaders to the NetworkingProcess.
3066         <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710
3067
3068         Reviewed by Tim Horton.
3069
3070         No new tests.
3071         There's no current solution for communicating back to a page that a ping load has reached its target.
3072         Until we have such a solution, any attempt at a layout test will be fragile at best.
3073
3074         * WebCore.xcodeproj/project.pbxproj:
3075         
3076         * loader/LoaderStrategy.cpp:
3077         (WebCore::LoaderStrategy::createPingHandle): Default implementation is create the PingHandle directly.
3078         * loader/LoaderStrategy.h:
3079
3080         PingLoader becomes a static class for now that crafts the ResourceRequest then passes it off
3081         to the LoaderStrategy:        
3082         * loader/PingLoader.cpp:
3083         (WebCore::PingLoader::loadImage):
3084         (WebCore::PingLoader::sendPing):
3085         (WebCore::PingLoader::sendViolationReport):
3086         (WebCore::PingLoader::startPingLoad):
3087         (WebCore::PingLoader::createPingLoader): Deleted.
3088         (WebCore::PingLoader::PingLoader): Deleted.
3089         (WebCore::PingLoader::~PingLoader): Deleted.
3090         * loader/PingLoader.h:
3091         (WebCore::PingLoader::timeoutTimerFired): Deleted.
3092
3093         PingHandle does what PingLoader used to - It's a basic ResourceHandleClient that simply waits
3094         for any response/completion/failure and then deletes itself.
3095         * platform/network/PingHandle.h: Added.
3096         (WebCore::PingHandle::PingHandle):
3097         (WebCore::PingHandle::usesAsyncCallbacks):
3098         (WebCore::PingHandle::timeoutTimerFired):
3099         (WebCore::PingHandle::~PingHandle):
3100
3101 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
3102
3103         Add new sources to StyleAllInOne.cpp
3104         https://bugs.webkit.org/show_bug.cgi?id=146584
3105
3106         Reviewed by Brent Fulgham.
3107
3108         * WebCore.vcxproj/WebCore.vcxproj:
3109         * rendering/style/StyleAllInOne.cpp:
3110
3111 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
3112
3113         Add new sources to DOMAllInOne.cpp
3114         https://bugs.webkit.org/show_bug.cgi?id=146587
3115
3116         Reviewed by Brent Fulgham.
3117
3118         * WebCore.vcxproj/WebCore.vcxproj:
3119         * dom/DOMAllInOne.cpp:
3120
3121 2015-07-08  Csaba Osztrogonác  <ossy@webkit.org>
3122
3123         Add new sources to AccessibilityAllInOne.cpp
3124         https://bugs.webkit.org/show_bug.cgi?id=146582
3125
3126         Reviewed by Brent Fulgham.
3127
3128         * WebCore.vcxproj/WebCore.vcxproj:
3129         * accessibility/AccessibilityAllInOne.cpp:
3130
3131 2015-07-08  Eric Carlson  <eric.carlson@apple.com>
3132
3133         [Mac] Two clicks required to enable AirPlay at youtube.com
3134         https://bugs.webkit.org/show_bug.cgi?id=146733
3135         <rdar://problem/21556356>
3136
3137         Reviewed by Brent Fulgham.
3138
3139         * Modules/mediasession/WebMediaSessionManager.cpp:
3140         (WebCore::WebMediaSessionManager::clientStateDidChange): Only log when state has changed.
3141           Don't steal the route if another client is actively playing to the device.
3142         (WebCore::WebMediaSessionManager::setPlaybackTarget): Set m_targetChanged.
3143         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Don't consider the
3144           requestedPicker flag until after a target change.
3145         * Modules/mediasession/WebMediaSessionManager.h:
3146
3147         * html/HTMLMediaElement.cpp:
3148         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Add logging.
3149         (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.
3150
3151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3152         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Always log.
3153
3154 2015-07-08  Zalan Bujtas  <zalan@apple.com>
3155
3156         Do not waste window server memory for placeholder windows initiated by ThemeMac.
3157         https://bugs.webkit.org/show_bug.cgi?id=146730
3158         rdar://problem/20321222
3159
3160         Using defer:YES prevents us from wasting any window server resources for WebCoreThemeWindow(s).
3161
3162         Patch by Darin Adler.
3163         Reviewed by Zalan Bujtas.
3164
3165         Not testable.
3166
3167         * platform/mac/ThemeMac.mm:
3168         (-[WebCoreThemeView window]):
3169
3170 2015-07-08  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3171
3172         [GTK] Deactivate GObject bindings for static methods
3173         https://bugs.webkit.org/show_bug.cgi?id=146717
3174
3175         Reviewed by Carlos Garcia Campos.
3176
3177         Static methods are currently not supported by GObject bindings so we deactivate them from the generation.
3178
3179         Current tests suffice. Expectations updated.
3180
3181         * bindings/scripts/CodeGeneratorGObject.pm:
3182         (SkipFunction): Skip isStatic functions.
3183         * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
3184         * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
3185         (webkit_dom_test_interface_implements_method4): Deleted.
3186         (webkit_dom_test_interface_supplemental_method4): Deleted.
3187         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
3188         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
3189         (webkit_dom_test_obj_class_method): Deleted.
3190         (webkit_dom_test_obj_class_method_with_optional): Deleted.
3191         (webkit_dom_test_obj_overloaded_method1): Deleted.
3192
3193 2015-07-07  Benjamin Poulain  <bpoulain@apple.com>
3194
3195         Remove the overflow checks from the important vectors used by the content extensions machines
3196         https://bugs.webkit.org/show_bug.cgi?id=146703
3197
3198         Reviewed by Andreas Kling.
3199
3200         Most of the overflow checks cannot be eliminated by clang. Removing them
3201         explicitly removes 400 ms from the compile time of a very large test list.
3202
3203         * contentextensions/ContentExtensionsDebugging.h:
3204         * contentextensions/DFA.h:
3205         * contentextensions/DFACombiner.cpp:
3206         * contentextensions/DFAMinimizer.cpp:
3207         * contentextensions/ImmutableNFA.h:
3208         * contentextensions/MutableRangeList.h:
3209         * contentextensions/NFAToDFA.cpp:
3210         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
3211         (WebCore::ContentExtensions::resolveEpsilonClosures):
3212         (WebCore::ContentExtensions::extendSetWithClosure):
3213         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::convert):
3214         (WebCore::ContentExtensions::DataConverterWithEpsilonClosure::extend):
3215         (WebCore::ContentExtensions::createCombinedTransition):
3216         (WebCore::ContentExtensions::getOrCreateDFANode):
3217         (WebCore::ContentExtensions::NFAToDFA::convert):
3218
3219 2015-07-07  Dean Jackson  <dino@apple.com>
3220
3221         [iOS] MediaControls: Start Play and Can't Play buttons need to be cutout and blurred
3222         https://bugs.webkit.org/show_bug.cgi?id=146226
3223
3224         Reviewed by Simon Fraser.
3225
3226         This patch takes what Said Abou-Hallawa posted in an earlier revision and
3227         makes a few tweaks to workaround the bugs he's listed.
3228
3229         Replicate the iOS System blur backdrop in pure CSS, so that the large
3230         start button looks more correct. Also add artwork for a failure state.
3231
3232         * Modules/mediacontrols/mediaControlsiOS.css: New style rules for the start
3233         button, which now is a collection of elements rather than a <button>.
3234         (video::-webkit-media-controls-start-playback-button):
3235         (video::-webkit-media-controls-start-playback-background):
3236         (video::-webkit-media-controls-start-playback-tint):
3237
3238         * Modules/mediacontrols/mediaControlsiOS.js:
3239         (ControllerIOS.prototype.createBase): Replace the <button> with the hierarchy of
3240         elements to replicate the blur. Give some of them a class attribute, so they
3241         can match selectors (see the bugs Said filed in the original bugzilla).
3242         (ControllerIOS.prototype.handleStartPlaybackButtonTouchStart): Toggle classes on
3243         the hierarchy as needed.
3244         (ControllerIOS.prototype.handleStartPlaybackButtonTouchEnd): Ditto.
3245         (ControllerIOS.prototype.updateStatusDisplay): Ditto.
3246
3247 2015-07-07  Zalan Bujtas  <zalan@apple.com>
3248
3249         Crash when parent iframe is set to display none and the child frame is mutated the same time.
3250         https://bugs.webkit.org/show_bug.cgi?id=146699
3251         rdar://problem/16207881
3252
3253         Reviewed by Andreas Kling.
3254
3255         When the parent iframe is set to display: none, we destroy the associated renderer (RenderIFrame).
3256         However if the child frame is mutated the same time, during layout we try to access this RenderIFrame
3257         to check whether it needs frame flattening.
3258         This patch checks whether the parent render widget is still valid.
3259
3260         Test: fast/frames/crash-display-none-iframe-during-onbeforeload.html
3261
3262         * page/FrameView.cpp:
3263         (WebCore::FrameView::isInChildFrameWithFrameFlattening): rearrange early returns.
3264
3265 2015-07-06  Matt Rajca  <mrajca@apple.com>
3266
3267         Media Session: remove seek forward/backward attributes
3268         https://bugs.webkit.org/show_bug.cgi?id=146645
3269
3270         Reviewed by Eric Carlson.
3271
3272         * Modules/mediasession/MediaRemoteControls.h:
3273         * Modules/mediasession/MediaRemoteControls.idl:
3274
3275 2015-07-07  Brent Fulgham  <bfulgham@apple.com>
3276
3277         REGRESSION (r183133-r183138): Secondary clicking in whitespace selects preceding word
3278         https://bugs.webkit.org/show_bug.cgi?id=146695
3279         <rdar://problem/21441466>
3280
3281         Reviewed by Tim Horton.
3282
3283         When we would currently use dictionary lookup to decide on our text selection, first check if we
3284         are targeting an editable field. If we are, use the original selection behavior. Otherwise, use
3285         the new "dictionary lookup" selection.
3286
3287         * page/EventHandler.cpp:
3288         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Only use dictionary lookup
3289         when our target node is not editable.
3290         
3291
3292 2015-07-07  Brady Eidson  <beidson@apple.com>
3293
3294         Another attempt to fix CURL/Soup builds after r186476
3295
3296         Reviewed by NOBODY.
3297
3298         * platform/network/curl/SocketStreamHandle.h:
3299
3300         * platform/network/soup/SocketStreamHandle.h:
3301
3302 2015-07-07  Brady Eidson  <beidson@apple.com>
3303
3304         Attempt to fix CURL/Soup builds after r186476
3305
3306         Reviewed by NOBODY.
3307
3308         * platform/network/curl/SocketStreamHandle.h:
3309         (WebCore::SocketStreamHandle::create):
3310
3311         * platform/network/soup/SocketStreamHandle.h:
3312         (WebCore::SocketStreamHandle::create):
3313
3314 2015-07-07  Brady Eidson  <beidson@apple.com>
3315
3316         HTTP Auth cached after disabling private browsing/reset.
3317         <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
3318
3319         Reviewed by Tim Horton.
3320
3321         Test: http/tests/security/private-browsing-http-auth.html
3322
3323         - Change most static CredentialStorage methods to be instance methods instead.
3324         - Make a CredentialStorage objects be per-NetworkStorageSession.
3325
3326         * Modules/websockets/WebSocketChannel.cpp:
3327         (WebCore::WebSocketChannel::WebSocketChannel):
3328         (WebCore::WebSocketChannel::connect): Only start the web socket load if a networking
3329           context is available.
3330
3331         * platform/network/CredentialStorage.cpp:
3332         (WebCore::CredentialStorage::defaultCredentialStorage): Returns the credential storage
3333           from the default NetworkStorageSession.
3334         (WebCore::CredentialStorage::set):
3335         (WebCore::CredentialStorage::get):
3336         (WebCore::CredentialStorage::remove):
3337         (WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):
3338         (WebCore::CredentialStorage::clearCredentials):
3339         (WebCore::protectionSpaceToCredentialMap): Deleted.
3340         (WebCore::originsWithCredentials): Deleted.
3341         (WebCore::pathToDefaultProtectionSpaceMap): Deleted.
3342         (WebCore::findDefaultProtectionSpaceForURL): Deleted.
3343         (WebCore::CredentialStorage::setPrivateMode): Deleted. Was a no-op anyways.
3344         * platform/network/CredentialStorage.h:
3345         
3346         * platform/network/NetworkStorageSession.h:
3347         (WebCore::NetworkStorageSession::credentialStorage):
3348         
3349         * platform/network/cf/ResourceHandleCFNet.cpp:
3350         (WebCore::ResourceHandle::createCFURLConnection):
3351         (WebCore::ResourceHandle::willSendRequest):
3352         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3353         (WebCore::ResourceHandle::receivedCredential):
3354         
3355         * platform/network/cf/SocketStreamHandle.h:
3356         (WebCore::SocketStreamHandle::create):
3357         * platform/network/cf/SocketStreamHandleCFNet.cpp:
3358         (WebCore::SocketStreamHandle::SocketStreamHandle):
3359         (WebCore::SocketStreamHandle::getStoredCONNECTProxyCredentials):
3360         (WebCore::getStoredCONNECTProxyCredentials): Deleted.
3361         
3362         * platform/network/curl/ResourceHandleCurl.cpp:
3363         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3364         (WebCore::ResourceHandle::receivedCredential):
3365         * platform/network/curl/ResourceHandleManager.cpp:
3366         (WebCore::ResourceHandleManager::applyAuthenticationToRequest):
3367         
3368         * platform/network/mac/ResourceHandleMac.mm:
3369         (WebCore::ResourceHandle::createNSURLConnection):
3370         (WebCore::ResourceHandle::willSendRequest):
3371         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3372         (WebCore::ResourceHandle::receivedCredential):
3373         
3374         * platform/network/soup/ResourceHandleSoup.cpp:
3375         (WebCore::applyAuthenticationToRequest):
3376         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3377         (WebCore::ResourceHandle::receivedCredential):
3378         
3379 2015-07-07  Zalan Bujtas  <zalan@apple.com>
3380
3381         REGRESSION(169105): CSS Regions: renderer returns wrong selection root when it is inside a column flow.
3382         https://bugs.webkit.org/show_bug.cgi?id=146529
3383         rdar://problem/21613670
3384
3385         Reviewed by Mihnea Ovidenie and David Kilzer.
3386
3387         This patch ensures that RenderObject::selectionRoot() handles column flows properly while searching for the associated
3388         selection root.
3389         When the renderer is inside a column flow and the column flow is part of a named flow, we stop
3390         traversing the ancestor chain, searching for the selection root, when we reach the column flow.
3391         Since the column flow is not a selection root, we mistakenly fall back to the RenderView as selection root.
3392         Instead, we should check if the column is inside a named flow and return the selection root accordingly.
3393         Returning the wrong selection root confuses RenderView::splitSelectionBetweenSubtrees() logic and this particular
3394         RenderObject could end up in multiple selection trees.
3395
3396         Test: fast/regions/selection/crash-when-element-is-inside-column-and-the-containing-block-is-inside-flow.html
3397
3398         * rendering/RenderObject.cpp:
3399         (WebCore::RenderObject::selectionRoot):
3400
3401 2015-07-07  Brent Fulgham  <bfulgham@apple.com>
3402
3403         [Mac] REGRESSION (r184794): Play/Pause control doesn't update state in full screen
3404         https://bugs.webkit.org/show_bug.cgi?id=146689
3405         <rdar://problem/21393490>
3406
3407         Reviewed by Dean Jackson.
3408
3409         The changes in r184794 did not take full screen mode into account. This needed to be corrected.
3410
3411         * Modules/mediacontrols/mediaControlsApple.js:
3412         (Controller.prototype.handlePanelTransitionEnd):
3413         (Controller.prototype.setPlaying):
3414         (Controller.prototype.showControls):
3415
3416 2015-07-07  Wenson Hsieh  <whsieh@berkeley.edu>
3417         
3418         Snap point regions containing X and Y snap points should do a better job animating
3419         https://bugs.webkit.org/show_bug.cgi?id=142523
3420         <rdar://problem/20100753>
3421
3422         Reviewed by Brent Fulgham.
3423
3424         Reimplemented snap point animations to use a single timer for both horizontal and
3425         vertical axes to better support 2D snap scrolling. Instead of making velocity
3426         dependent on progress to the snap point and handling 2D snapping with different
3427         timer update functions, this implementation uses a fixed animation time to coordinate
3428         the snapping animation across both axes.
3429
3430         Test: platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html
3431
3432         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Refactored to use a single scroll snap timer.