45fc02303caa3059b29f5cea761136e7147cd84b
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-07-22  Tim Horton  <timothy_horton@apple.com>
2
3         Try to fix the build
4
5         * platform/spi/cocoa/QuartzCoreSPI.h:
6
7 2015-07-22  James Savage  <james.savage@apple.com>
8
9         Use updated CoreAnimation snapshot SPI.
10         https://bugs.webkit.org/show_bug.cgi?id=147197
11         <rdar://problem/21032083>
12
13         Reviewed by Tim Horton.
14         Patch by James Savage.
15
16         * platform/spi/cocoa/QuartzCoreSPI.h:
17
18 2015-07-22  Joseph Pecoraro  <pecoraro@apple.com>
19
20         Web Inspector: Timeline should immediately start moving play head when starting a new recording
21         https://bugs.webkit.org/show_bug.cgi?id=147210
22
23         Reviewed by Timothy Hatcher.
24
25         Test: inspector/timeline/recording-start-stop-timestamps.html
26
27         * inspector/InspectorTimelineAgent.cpp:
28         (WebCore::InspectorTimelineAgent::internalStart):
29         (WebCore::InspectorTimelineAgent::internalStop):
30         Include the current timestamp when starting / stopping a recording.
31
32 2015-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
33
34         Coordinates-based snap offsets don't update correctly when container is scrolled
35         https://bugs.webkit.org/show_bug.cgi?id=147215
36
37         Reviewed by Brent Fulgham.
38
39         Fixes the way we append the snap offsets of child elements with coordinates. We
40         now consider the scroll offset of the parent scroll snapping container, so snap
41         offset recomputations don't fail on scroll snapping containers.
42
43         Test: css3/scroll-snap/scroll-snap-coordinate-overflow-resize.html
44
45         * page/scrolling/AxisScrollSnapOffsets.cpp:
46         (WebCore::appendChildSnapOffsets): Fixed to consider the scroll offset of the
47             parent container.
48
49 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
50
51         Needed to add methods to get PreviewCaptureLayers from Video
52         https://bugs.webkit.org/show_bug.cgi?id=147011
53         <rdar://problem/21861999>
54
55         Reviewed by Jer Noble.
56
57         * platform/mediastream/mac/AVVideoCaptureSource.h: Added in preview
58         layer to class
59         (WebCore::AVVideoCaptureSource::previewLayer):
60         * platform/mediastream/mac/AVVideoCaptureSource.mm: Instantiate
61         previewLayer on load
62         (WebCore::AVVideoCaptureSource::setupCaptureSession):
63
64 2015-07-22  Sungmann Cho  <sungmann.cho@navercorp.com>
65
66         [EFL] The "Missing Plug-in" buttons are not showing up on some flash contents
67         https://bugs.webkit.org/show_bug.cgi?id=147191
68
69         Reviewed by Gyuyoung Kim.
70
71         Currently, WebKitEFL doesn't show the "Missing Plug-in" buttons if the plugin-related tags
72         don't have a "type" attribute. In such a case, WebCore tries to guess the MIME type from
73         the extensions by using MIMETypeRegistry::getMIMETypeForExtension(). For WebKitEFL,
74         MIMETypeRegistry::getMIMETypeForExtension() goes through |extensionMap|, which is a simple
75         array of <extension, mime type>, looking for the mime type for the given extension.
76         But |extensionMap| in MIMETypeRegistryEfl.cpp doesn't have the information for ".swf",
77         so WebCore fails to guess the MIME type and regard the content type as ObjectContentFrame,
78         not ObjectContentNetscapePlugin.
79
80         * platform/efl/MIMETypeRegistryEfl.cpp:
81
82 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
83
84         Rank sources for fitness for UIDs in bestSourcesForTypeAndConstraints
85         https://bugs.webkit.org/show_bug.cgi?id=147206
86         <rdar://problem/21950653>
87
88         Reviewed by Jer Noble.
89
90         * platform/mediastream/RealtimeMediaSource.cpp:
91         (WebCore::RealtimeMediaSource::RealtimeMediaSource):
92         * platform/mediastream/RealtimeMediaSource.h:
93         (WebCore::RealtimeMediaSource::fitnessScore):
94         (WebCore::RealtimeMediaSource::setFitnessScore):
95         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
96         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
97
98 2015-07-22  Dean Jackson  <dino@apple.com>
99
100         Video controls, though hidden, are still interactive when in PiP
101         https://bugs.webkit.org/show_bug.cgi?id=147216
102         <rdar://problem/21012688>
103
104         Reviewed by Simon Fraser.
105
106         Explicitly add the PiP class to the controls container so that
107         we can hang a pointer-events: none off it.
108
109         * Modules/mediacontrols/mediaControlsiOS.css:
110         (video::-webkit-media-controls-panel.picture-in-picture): Add a pointer-events: none.
111         * Modules/mediacontrols/mediaControlsiOS.js:
112         (ControllerIOS.prototype.handlePresentationModeChange): Add/remove a PiP class
113         to the controls panel when necessary.
114
115 2015-07-22  Commit Queue  <commit-queue@webkit.org>
116
117         Unreviewed, rolling out r187196.
118         https://bugs.webkit.org/show_bug.cgi?id=147213
119
120         broke all the iOS builds (Requested by thorton on #webkit).
121
122         Reverted changeset:
123
124         "Use updated CoreAnimation snapshot SPI."
125         https://bugs.webkit.org/show_bug.cgi?id=147197
126         http://trac.webkit.org/changeset/187196
127
128 2015-07-22  James Savage  <james.savage@apple.com>
129
130         Use updated CoreAnimation snapshot SPI.
131         https://bugs.webkit.org/show_bug.cgi?id=147197
132
133         Reviewed by Tim Horton.
134
135         * platform/spi/cocoa/QuartzCoreSPI.h:
136
137 2015-07-22  Dean Jackson  <dino@apple.com>
138
139         Out of bounds in WebGLRenderingContext::simulateVertexAttrib0
140         https://bugs.webkit.org/show_bug.cgi?id=147176
141         <rdar://problem/21567767>
142
143         Reviewed by Oliver Hunt.
144
145         Test: fast/canvas/webgl/out-of-bounds-simulated-vertexAttrib0-drawArrays.html
146
147         Add overflow checking for the drawing calls, specifically the way
148         they may simulate vertexAttrib0.
149
150         * html/canvas/WebGLRenderingContextBase.cpp:
151         (WebCore::WebGLRenderingContextBase::validateDrawArrays): Call new validation method.
152         (WebCore::WebGLRenderingContextBase::validateDrawElements): Ditto.
153         (WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): New method that
154         validates the parameters used to create the simulated attribute.
155         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): No need to do overflow
156         checking here now that the validation method does it for us.
157         (WebCore::WebGLRenderingContextBase::validateVertexAttributes): Deleted.
158         * html/canvas/WebGLRenderingContextBase.h: Add new validation method.
159
160 2015-07-22  Joseph Pecoraro  <pecoraro@apple.com>
161
162         Web Inspector: AppCache manifest 404 doesn't produce errors in console, manifest resource request always loading indicator
163         https://bugs.webkit.org/show_bug.cgi?id=147135
164
165         Reviewed by Alexey Proskuryakov.
166
167         * loader/appcache/ApplicationCacheGroup.cpp:
168         (WebCore::ApplicationCacheGroup::didReceiveResponse):
169         Always pass a document loader instead of passing null for the manifest request.
170
171         (WebCore::ApplicationCacheGroup::didReceiveManifestResponse):
172         Since we will be cancelling the resource handle ourselves in didReceiveResponse
173         before receiving the didFail resource handle delegates, we should update the
174         inspector about this resource load failing due to a cancel.
175
176         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
177         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
178         Update the MessageSource from "Other" to "AppCache".
179
180 2015-07-22  Jeremy Jones  <jeremyj@apple.com>
181
182         Fix fullscreen and PiP video animation and sizing regressions.
183         https://bugs.webkit.org/show_bug.cgi?id=147189
184         <rdar://problem/21930899>
185
186         Reviewed by Jer Noble.
187
188         Fixes WK1 specific regressions introduced by r187044. Flicker when entering fullscreen,
189         wrong animation and missing initial animation rects.
190
191         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
192         (elementRectInWindow): Added.
193         (WebVideoFullscreenControllerContext::didSetupFullscreen): Clear background decreases flash.
194         (WebVideoFullscreenControllerContext::fullscreenMayReturnToInline): Use consistent inline rect.
195         (WebVideoFullscreenControllerContext::setVideoLayerFrame): 
196         Clear the transform on the web thread instead of on the UI thread.
197         (WebVideoFullscreenControllerContext::setUpFullscreen): Use consistent inline rect.
198         (WebVideoFullscreenControllerContext::exitFullscreen): Use consistent inline rect.
199         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
200         (-[WebAVPlayerLayer resolveBounds]): Clear transform after setting frame.
201
202 2015-07-22  Jeremy Jones  <jeremyj@apple.com>
203
204         Adopt AVKit's AVSimplePlayerLayerView change for PiP.
205         https://bugs.webkit.org/show_bug.cgi?id=147186
206         <rdar://problem/21928170>
207
208         Reviewed by Jer Noble.
209
210         Adopt AVKit changes by inheriting from UIView instead of from AVPictureInPicturePlayerLayerView.
211
212         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
213         (WebAVPlayerLayerView_layerClass): Style.
214         (WebAVPlayerLayerView_playerController): Style.
215         (WebAVPlayerLayerView_videoView): Style.
216         (getWebAVPictureInPicturePlayerLayerViewClass): Inherit from UIView.
217
218 2015-07-22  Beth Dakin  <bdakin@apple.com>
219
220         Animated images should animate in previews
221         https://bugs.webkit.org/show_bug.cgi?id=147173
222         -and corresponding-
223         rdar://problem/21637698
224
225         Reviewed by Dan Bernstein.
226
227         New virtual function to indicate whether or not the image is animated.
228         * platform/graphics/BitmapImage.h:
229         * platform/graphics/Image.h:
230         (WebCore::Image::isAnimated):
231
232 2015-07-22  Jinyoung Hur  <hur.ims@navercorp.com>
233
234         [WinCairo] SVG path not rendered with all-zero dasharray
235         https://bugs.webkit.org/show_bug.cgi?id=146997
236
237         Reviewed by Martin Robinson.
238
239         All-zero dash array should not be passed to cairo_set_dash() as an argument, because it will cause an internal Cairo error.
240         Rather call cairo_set_dash() with num_dashes=0 to disable dash line.
241
242         Tests: fast/canvas/canvas-lineDash.html
243                svg/custom/zero-dasharray.html
244
245         * platform/graphics/cairo/GraphicsContextCairo.cpp:
246         (WebCore::GraphicsContext::setLineDash):
247
248 2015-07-22  Wenson Hsieh  <wenson_hsieh@apple.com>
249
250         Search fields render placeholder text improperly.
251         https://bugs.webkit.org/show_bug.cgi?id=147192
252         <rdar://problem/21901076>
253
254         Reviewed by Alexey Proskuryakov.
255
256         Due to changes in the way AppKit renders search inputs, we must now explicitly
257         set the placeholder text of a search input rendered using the Mac theme to be
258         an empty string when rendering the search input box (not including the actual
259         placeholder text).
260
261         * rendering/RenderThemeMac.mm:
262         (WebCore::RenderThemeMac::setSearchCellState): Force the placeholder text of
263             the NSSearchFieldCell for the Mac theme to be an empty string.
264
265 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
266
267         Need the ability to give only best source UIDs to UserMedia request
268         https://bugs.webkit.org/show_bug.cgi?id=147171
269         <rdar://problem/21931121>
270
271         Reviewed by Eric Carlson.
272
273         * Modules/mediastream/UserMediaRequest.cpp:
274         (WebCore::UserMediaRequest::constraintsValidated):
275         * Modules/mediastream/UserMediaRequest.h:
276         (WebCore::UserMediaRequest::videoDeviceUIDs):
277         (WebCore::UserMediaRequest::audioDeviceUIDs):
278         * platform/mediastream/MediaStreamCreationClient.h:
279         * platform/mediastream/mac/AVCaptureDeviceManager.h:
280         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
281         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints):
282         (WebCore::AVCaptureDeviceManager::bestSourceForTypeAndConstraints): Deleted.
283         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
284         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints):
285         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
286         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
287         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints):
288
289 2015-07-22  Mark Dittmer  <mark.s.dittmer@gmail.com>
290
291         Fix toJSDOMWindow() in the case of an object that has the actual JS DOM window in its prototype chain.
292         https://bugs.webkit.org/show_bug.cgi?id=146785
293
294         Reviewed by Mark Lam.
295
296         * bindings/js/JSDOMWindowBase.cpp: toJSDOMWindow(): Walk the prototype chain of the given JSValue until a JSDOMWindow or JSDOMWindowShell is found.
297
298 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
299
300         Remove revealing getVideoTracks() and getAudioTracks()
301         https://bugs.webkit.org/show_bug.cgi?id=147126
302         <rdar://problem/21908723>
303
304         Reviewed by Eric Carlson.
305
306         * Modules/mediastream/MediaStream.h:
307         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
308         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
309         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
310         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Modded to use
311         tracks() instead of getVideo/AudioTracks()
312         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Ditto
313         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal): Ditto
314         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal): Ditto
315         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto
316         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::naturalSize): Ditto
317         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo): Ditto
318         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio): Ditto
319         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentMediaTime):
320         Changed to a FIXME
321         * platform/mediastream/MediaStreamPrivate.h:
322
323 2015-07-22  Matthew Daiter  <mdaiter@apple.com>
324
325         Ensure MediaPlayerPrivateAVFoundation doesn't load MediaStreams
326         https://bugs.webkit.org/show_bug.cgi?id=147119
327         <rdar://problem/21904955>
328
329         Reviewed by Eric Carlson.
330
331         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: Set
332         networkstate to error when loading MediaStreams
333
334 2015-07-22  Alex Christensen  <achristensen@webkit.org>
335
336         Fix quirks in CMake build on Mac and Windows
337         https://bugs.webkit.org/show_bug.cgi?id=147174
338
339         Reviewed by Gyuyoung Kim.
340
341         * PlatformMac.cmake:
342         Removed files that don't exist any more.
343         * platform/win/WindowsTouch.h:
344         Only use definitions of touch structures when compiling with VS2012.
345
346 2015-07-22  Csaba Osztrogonác  <ossy@webkit.org>
347
348         Fix cast-align warning in NetworkStateNotifierEfl.cpp
349         https://bugs.webkit.org/show_bug.cgi?id=145915
350
351         Reviewed by Gyuyoung Kim.
352
353         * platform/network/efl/NetworkStateNotifierEfl.cpp:
354         (WebCore::NetworkStateNotifier::readSocketCallback):
355
356 2015-07-22  Ryuan Choi  <ryuan.choi@navercorp.com>
357
358         [GTK][EFL] Remove dead functions in LocalizedStrings
359         https://bugs.webkit.org/show_bug.cgi?id=147188
360
361         Reviewed by Csaba Osztrogonác.
362
363         * platform/efl/LocalizedStringsEfl.cpp:
364         (WebCore::contextMenuItemTagHideMediaControls):
365         (WebCore::contextMenuitemTagHideMediaControls): Fixed typo since r152117.
366         (WebCore::inactivePluginText): Deleted since r151530.
367         (WebCore::textTrackClosedCaptionsText): Deleted since r141864.
368         * platform/gtk/LocalizedStringsGtk.cpp:
369         (WebCore::inactivePluginText): Deleted since r151530.
370         (WebCore::textTrackClosedCaptionsText): Deleted since r141864.
371
372 2015-07-21  Benjamin Poulain  <bpoulain@apple.com>
373
374         [CSS Selectors Level 4] Add #ifdefs to the new '>>' descendant combinator
375         https://bugs.webkit.org/show_bug.cgi?id=147184
376
377         Reviewed by Anders Carlsson.
378
379         Now that '>>>' is dead, the combinator '>>' is at risk.
380
381         This patch #ifdef all that code with the other experimental
382         features from Level 4.
383
384         * css/CSSGrammar.y.in:
385         * css/CSSParserValues.cpp:
386         (WebCore::CSSParserSelector::appendTagHistory):
387         * css/CSSParserValues.h:
388         * css/CSSSelector.cpp:
389         (WebCore::CSSSelector::CSSSelector):
390         (WebCore::CSSSelector::selectorText):
391         * css/CSSSelector.h:
392         (WebCore::CSSSelector::CSSSelector):
393
394 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
395
396         Web Inspector: Node highlights are wrong when the page is zoomed
397         https://bugs.webkit.org/show_bug.cgi?id=147177
398
399         Reviewed by Simon Fraser.
400
401         * inspector/InspectorOverlay.cpp:
402         (WebCore::InspectorOverlay::update):
403         Remove scaling that appears to no longer be needed, it was double
404         scaling the overlay content and misplacing it in the process.
405
406 2015-07-21  Dean Jackson  <dino@apple.com>
407
408         Default media controls use a serif font, which seems wrong
409         https://bugs.webkit.org/show_bug.cgi?id=147179
410         <rdar://problem/21931728>
411
412         Reviewed by Simon Fraser.
413
414         The captions menu (and other text) should use a system style,
415         -webkit-small-control.
416
417         * Modules/mediacontrols/mediaControlsApple.css:
418         (::-webkit-media-controls):
419
420 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
421
422         Exposed method to query device by UID
423         https://bugs.webkit.org/show_bug.cgi?id=147117
424         <rdar://problem/21904678>
425
426         Reviewed by Eric Carlson.
427
428         * platform/mediastream/mac/AVCaptureDeviceManager.h: Added method to
429         query device by UID
430         * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto
431         (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto
432
433 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
434
435         [Content Extensions] Use a jump table when consecutive transitions have different targets
436         https://bugs.webkit.org/show_bug.cgi?id=147099
437
438         Reviewed by Alex Christensen.
439
440         When handling consecutive single transitions, merge them into
441         a jump table instead of creating many individual CheckValue.
442
443         From local testing on x86_64, it reduces the bytecode size by about 5%
444         and improve the runtime by about 10%.
445
446         * contentextensions/DFABytecode.h:
447         (WebCore::ContentExtensions::instructionSizeWithArguments):
448         * contentextensions/DFABytecodeCompiler.cpp:
449         (WebCore::ContentExtensions::DFABytecodeCompiler::extractJumpTable):
450         (WebCore::ContentExtensions::DFABytecodeCompiler::transitions):
451         (WebCore::ContentExtensions::DFABytecodeCompiler::checkForJumpTableMaxBytecodeSize):
452         (WebCore::ContentExtensions::DFABytecodeCompiler::compileJumpTable):
453         (WebCore::ContentExtensions::DFABytecodeCompiler::nodeTransitionsMaxBytecodeSize):
454         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
455         (WebCore::ContentExtensions::DFABytecodeCompiler::ranges): Deleted.
456         * contentextensions/DFABytecodeCompiler.h:
457         * contentextensions/DFABytecodeInterpreter.cpp:
458         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpetJumpTable):
459         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
460         * contentextensions/DFABytecodeInterpreter.h:
461
462 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
463
464         Add a logging channel for Layout, remove the LiveConnect channel
465         https://bugs.webkit.org/show_bug.cgi?id=147170
466
467         Reviewed by Zalan Bujtas.
468
469         Add a layout logging channel to WebCore, and remove the LiveConnect channel.
470
471         * page/FrameView.cpp:
472         (WebCore::FrameView::adjustViewSize):
473         (WebCore::FrameView::forceLayoutParentViewIfNeeded):
474         (WebCore::FrameView::layout):
475         (WebCore::FrameView::performPostLayoutTasks):
476         (WebCore::FrameView::autoSizeIfEnabled):
477         * platform/Logging.h:
478
479 2015-07-21  Benjamin Poulain  <bpoulain@apple.com>
480
481         StyleSheetContents::wrapperInsertRule() can create rules that overflow RuleData's selector index
482         https://bugs.webkit.org/show_bug.cgi?id=147144
483
484         Reviewed by Alex Christensen.
485
486         RuleData identifies selectors by the index in a large array. The index only has 13 bits
487         so rules with more than 8192 selectors should be split.
488
489         One of the paths was not splitting the rule: StyleSheetContents::wrapperInsertRule().
490         When rules with too many selectors were added, the index would overflow and
491         some RuleData would point to selectors in the middle of selector chains. The resulting
492         behavior is random based on the selectors and the DOM.
493
494         We cannot easily fix that because the CSS OM API do not expect to create
495         several rules in response to calls to the API.
496         In this patch, I don't do anything fancy and just let the calls fail
497         if we cannot use the rules safely.
498
499
500         Content Extensions were also running into this problem. Large Selector lists are
501         pretty common, and ContentExtensionStyleSheet::addDisplayNoneSelector() was
502         overflowing the RuleData, creating broken page.
503
504         Unlike CSSOM, there is no problem with splitting rules coming from Content Extensions.
505         Instead of creating new APIs for that case, I rely on the parser to extend the StyleSheetContents.
506         That code already knows how to break rules correctly.
507
508         Tests: fast/css/insert-rule-overflow-rule-data.html
509                http/tests/contentextensions/css-display-none-overflows-rule-data-1.html
510                http/tests/contentextensions/css-display-none-overflows-rule-data-2.html
511
512         * contentextensions/ContentExtensionStyleSheet.cpp:
513         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
514         * css/StyleSheetContents.cpp:
515         (WebCore::StyleSheetContents::wrapperInsertRule):
516
517 2015-07-21  Jon Honeycutt  <jhoneycutt@apple.com>
518
519         [iOS] Keyboard bold/italic/underline keys don't highlight after being
520         tapped to style a selection
521         https://bugs.webkit.org/show_bug.cgi?id=147164
522         <rdar://problem/21630806>
523
524         Reviewed by Ryosuke Niwa.
525
526         * editing/cocoa/EditorCocoa.mm:
527         (WebCore::Editor::styleForSelectionStart):
528         Use adjustedSelectionStartForStyleComputation(), which will ensure that
529         we're at the start of the selected node, not at the end of the node
530         before the selection.
531
532 2015-07-21  Tim Horton  <timothy_horton@apple.com>
533
534         Placing video in fullscreen caused WebKit crash at WebCore::Range::textQuads
535         https://bugs.webkit.org/show_bug.cgi?id=147166
536         <rdar://problem/21928558>
537
538         Reviewed by Simon Fraser.
539
540         * editing/FrameSelection.cpp:
541         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
542         Check the Range, as always.
543
544 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
545
546         Safari mis-applies "animation-fill-mode: forwards" when using fractional iteration count
547         https://bugs.webkit.org/show_bug.cgi?id=146996
548
549         Reviewed by Dean Jackson.
550
551         animation-fill-mode: forwards with fractional iteration counts always snapped to
552         1 or 0, depending on direction. Fix to compute the fill-forward state from the
553         correct keyframes.
554         
555         If filling forwards, AnimationBase::progress() sets the elapsed time to the duration,
556         then uses fractionalTime() to handle animation direction mapping. If the fractionalTime
557         is integral, we can return early, avoiding the cost of mapping through timing functions.
558
559         Tested by existing tests.
560
561         * page/animation/AnimationBase.cpp:
562         (WebCore::AnimationBase::progress):
563         (WebCore::AnimationBase::getElapsedTime):
564         * page/animation/KeyframeAnimation.cpp:
565         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): It was possible
566         to end up with prevIndex == nextIndex with reverse animations, which resulted
567         in divide-by-zero when computing scale. Fix by picking a nextIndex that is different
568         from prevIndex.
569
570 2015-07-21  David Hyatt  <hyatt@apple.com>
571
572         Fix failing WK1 layout tests. Make sure to reset the text zoom scale
573         in Internals::resetToConsistentState.
574
575         Reviewed by Anders Carlsson
576
577         * testing/Internals.cpp:
578         (WebCore::Internals::resetToConsistentState):
579
580 2015-07-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
581
582         REGRESSION (r172417, r184065): Multiple rendering issues with fixed attached background-image
583         https://bugs.webkit.org/show_bug.cgi?id=147049
584         <rdar://problem/21110936>
585
586         Reviewed by Simon Fraser.
587
588         The fixed-attached background-image rendering is special. In general, to
589         display it, the destinationSize should be set to visibleContentSize. The
590         destinationLocation should be set such that the background-image does
591         not move with scrolling. The topContentInset should be subtracted from
592         the destinationLocation such that background-image can be rendered blurred
593         in the topContentArea. However there are cases in which these rules have to
594         be changed.
595         
596         -- destinationSize: In the case of fixed layout size, the fixedLayoutSize
597         is bigger than the visibleContentSize. In this case, if the background-image
598         belongs to the root element, the destinationSize has to be set to fixedLayoutSize.
599         Otherwise it has to be set to the borderBoxSize unless the overflow is
600         hidden.
601         
602         -- destinationLocation: If the background-image belongs to the root element, no
603         scroll offset to added to destinationLocation. For non-root element case,
604         FrameView::documentScrollOffsetRelativeToViewOrigin() should be used if no page
605         scaling is applied. Otherwise FrameView::scrollOffsetForFixedPosition() should be
606         used instead.
607         
608         Tests: platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-cover.html
609                platform/mac-wk2/tiled-drawing/fixed-layout-size-fixed-attachment-local.html
610
611         * rendering/RenderBoxModelObject.cpp:
612         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry): Ensure
613         the geometry for the fixed-attached background-image is calculated correctly.
614         
615         * rendering/RenderLayerBacking.cpp:
616         (WebCore::RenderLayerBacking::updateGeometry): Ensure the background layer
617         gets the correct size for the fixedLayoutSize mode.
618
619 2015-07-21  Csaba Osztrogonác  <ossy@webkit.org>
620
621         Fix the !ENABLE(DETAILS_ELEMENT) build after r186598
622         https://bugs.webkit.org/show_bug.cgi?id=147115
623
624         Reviewed by Chris Fleizach.
625
626         * accessibility/AccessibilityNodeObject.cpp:
627         (WebCore::AccessibilityNodeObject::setIsExpanded):
628
629 2015-07-21  David Hyatt  <hyatt@apple.com>
630
631         Need a way to ignore text-zoom in a Web page.
632         https://bugs.webkit.org/show_bug.cgi?id=27092
633         rdar://problem/7037987
634
635         Reviewed by Simon Fraser.
636
637         This patch adds a new property, -webkit-text-zoom, with values of normal and reset. The reset
638         keyword, just as with the zoom property, can be used to ignore any inherited zoom from the
639         document.
640
641         Added new test in fast/text.
642
643         * Modules/mediacontrols/mediaControlsApple.css:
644         (audio::-webkit-media-controls-panel):
645         (video::-webkit-media-controls-panel):
646         * css/CSSComputedStyleDeclaration.cpp:
647         (WebCore::ComputedStyleExtractor::propertyValue):
648         * css/CSSParser.cpp:
649         (WebCore::CSSParser::parseValue):
650         * css/CSSPrimitiveValueMappings.h:
651         (WebCore::CSSPrimitiveValue::operator ContentDistributionType):
652         (WebCore::CSSPrimitiveValue::operator TextZoom):
653         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
654         * css/CSSPropertyNames.in:
655         * css/StyleBuilderConverter.h:
656         (WebCore::StyleBuilderConverter::csstoLengthConversionDataWithTextZoomFactor):
657         * css/StyleBuilderCustom.h:
658         (WebCore::StyleBuilderCustom::applyValueWebkitTextSizeAdjust):
659         (WebCore::StyleBuilderCustom::applyValueWebkitTextZoom):
660         (WebCore::StyleBuilderCustom::applyTextOrBoxShadowValue):
661         * css/StyleResolver.cpp:
662         (WebCore::StyleResolver::checkForZoomChange):
663         * rendering/style/RenderStyle.cpp:
664         (WebCore::RenderStyle::changeRequiresLayout):
665         * rendering/style/RenderStyle.h:
666         * rendering/style/RenderStyleConstants.h:
667         * rendering/style/StyleRareInheritedData.cpp:
668         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
669         (WebCore::StyleRareInheritedData::operator==):
670         * rendering/style/StyleRareInheritedData.h:
671         * style/StyleFontSizeFunctions.cpp:
672         (WebCore::Style::computedFontSizeFromSpecifiedSize):
673         * testing/Internals.cpp:
674         (WebCore::Internals::setPageZoomFactor):
675         (WebCore::Internals::setTextZoomFactor):
676         (WebCore::Internals::setUseFixedLayout):
677         * testing/Internals.h:
678         * testing/Internals.idl:
679
680 2015-07-21  Per Arne Vollan  <peavo@outlook.com>
681
682         WinLauncher does not start on WinXP.
683         https://bugs.webkit.org/show_bug.cgi?id=147147
684
685         Reviewed by Alex Christensen.
686
687         Calling GetProcessMemoryInfo() on WinXP requires that PSAPI_VERSION is set to 1,
688         see https://msdn.microsoft.com/en-us/library/windows/desktop/ms683219(v=vs.85).aspx.
689
690         * WebCore.vcxproj/WebCoreCommon.props:
691
692 2015-07-20  Michael Catanzaro  <mcatanzaro@igalia.com>
693
694         REGRESSION(r184376): [SOUP] Multiple assertions when downloading files
695         https://bugs.webkit.org/show_bug.cgi?id=147039
696
697         Reviewed by Darin Adler.
698
699         No new tests; this will be covered once we enable the network process for API tests.
700
701         * platform/network/soup/ResourceHandleSoup.cpp:
702         (WebCore::ResourceHandle::releaseForDownload): Call RefPtrBase::relaxAdoptionRequirement so
703         that we don't assert when storing the non-adopted ResourceHandle in a RefPtr. The ref will
704         be dropped in ResourceHandle::cleanupSoupOperation, which as the comment says should always
705         run. HOPEFULLY.
706         (WebCore::ResourceHandle::continueWillSendRequest): Don't assert that client() is nonnull,
707         because the code clearly expects and handles the case where it is null.
708         (WebCore::ResourceHandle::continueDidReceiveResponse): Ditto; note that here client() will
709         always be null for a download.
710
711 2015-07-20  Ada Chan  <adachan@apple.com>
712
713         Follow-up to my earlier fix for r147085
714         https://bugs.webkit.org/show_bug.cgi?id=147085
715
716         Reviewed by Eric Carlson.
717
718         * Modules/webaudio/AudioContext.cpp:
719         (WebCore::AudioContext::isPlayingAudioDidChange):
720         Null-check document() before dereferencing it in case the audio context's document is destroyed
721         by the time the code block is called on the main thread.
722
723 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
724
725         Remove RenderTheme::shouldShowPlaceholderWhenFocused()
726         https://bugs.webkit.org/show_bug.cgi?id=147104
727
728         Reviewed by Martin Robinson.
729
730         GTK+ is the only port that returns false in
731         shouldShowPlaceholderWhenFocused(). That's inconsistent with all
732         other browsers that show the placeholder text even for focused
733         entries in all platforms. We should change the GTK+ port
734         behaviour, but that would leave all implementations of
735         shouldShowPlaceholderWhenFocused returning true, so let's just
736         remove it.
737
738         * html/HTMLTextFormControlElement.cpp:
739         (WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
740         Do not consider whether the entry is focused or not.
741         * platform/efl/RenderThemeEfl.h:
742         * rendering/RenderTheme.h:
743         (WebCore::RenderTheme::shouldShowPlaceholderWhenFocused): Deleted.
744         * rendering/RenderThemeIOS.h:
745         * rendering/RenderThemeIOS.mm:
746         (WebCore::RenderThemeIOS::shouldShowPlaceholderWhenFocused): Deleted.
747         * rendering/RenderThemeMac.h:
748         * rendering/RenderThemeMac.mm:
749         (WebCore::RenderThemeMac::shouldShowPlaceholderWhenFocused): Deleted.
750         * rendering/RenderThemeSafari.h:
751         (WebCore::RenderThemeSafari::shouldShowPlaceholderWhenFocused): Deleted.
752         * rendering/RenderThemeWin.h:
753
754 2015-07-20  Zan Dobersek  <zdobersek@igalia.com>
755
756         [CoordinatedGraphics] CoordinatedGraphicsLayer::setContentsToImage() should avoid scheduling unnecessary flushes
757         https://bugs.webkit.org/show_bug.cgi?id=147118
758
759         Reviewed by Martin Robinson.
760
761         Have CoordinatedGraphicsLayer::setContentsToImage() return early if the new
762         passed-in Image and the corresponding native image pointer are equal to the
763         currently set values.
764
765         This specifically avoids scheduling unnecessary flushes when setContentsToImage()
766         is repeatedly called with a null Image pointer, which in previous code would
767         unconditionally result in a scheduled flush even if there was no Image assigned
768         as the content of this layer before. Until now the layer flush scheduling was only
769         avoided if the two non-null native image pointers were equal.
770
771         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
772         (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
773
774 2015-07-20  Nan Wang  <n_wang@apple.com>
775
776         AX: Selection change as a result of focusing an element may cause Safari to crash
777         https://bugs.webkit.org/show_bug.cgi?id=147052
778         <rdar://problem/21778212>
779
780         Reviewed by Chris Fleizach.
781
782         When focusing an element, it may trigger a deferred layout that invalidates the render 
783         element, which will cause axObjectCache() to be a nullptr, and lead to a crash. Fix that
784         by using a RefPtr to hold the object and also caching the axObjectCache().
785
786         Test: platform/mac/accessibility/focus-crash.html
787
788         * accessibility/AccessibilityRenderObject.cpp:
789         (WebCore::AccessibilityRenderObject::setFocused):
790         (WebCore::AccessibilityRenderObject::setSelectedRows):
791
792 2015-07-20  Alex Christensen  <achristensen@webkit.org>
793
794         Unreviewed build fix after r187049.
795
796         * contentextensions/ContentExtension.cpp:
797         (WebCore::ContentExtensions::ContentExtension::populateDomainCacheIfNeeded):
798         Can't shrinkToFit HashSets.
799
800 2015-07-20  Alex Christensen  <achristensen@webkit.org>
801
802         [Content Extensions] Cache actions with domains that match everything
803         https://bugs.webkit.org/show_bug.cgi?id=147050
804
805         Reviewed by Benjamin Poulain.
806
807         If you have lots of rules with triggers like {"url-filter":".*","if-domain":["*webkit.org"]}
808         we will spend a lot of time adding unnecessary actions to HashSets when you are not on webkit.org.
809         Caching all the rules and only adding them to a collection once when the domain changes saves a lot of URL interpreting time.
810
811         We already had an optimization for the css-display-none actions with triggers that matched everything using a special bytecode operation.
812         This removes the need for a special bytecode operation by caching the triggers that match everything with and without domains,
813         then from those cached actions we compile a stylesheet, and create cached actions for every new domain we visit.
814
815         All functionality is covered by existing API tests.
816
817         * contentextensions/CompiledContentExtension.cpp:
818         (WebCore::ContentExtensions::CompiledContentExtension::~CompiledContentExtension):
819         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors): Deleted.
820         * contentextensions/CompiledContentExtension.h:
821         * contentextensions/ContentExtension.cpp:
822         (WebCore::ContentExtensions::ContentExtension::ContentExtension):
823         (WebCore::ContentExtensions::ContentExtension::findFirstIgnorePreviousRules):
824         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
825         (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
826         (WebCore::ContentExtensions::ContentExtension::populateDomainCacheIfNeeded):
827         (WebCore::ContentExtensions::ContentExtension::cachedDomainActions):
828         (WebCore::ContentExtensions::ContentExtension::universalActionsWithDomains):
829         * contentextensions/ContentExtension.h:
830         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
831         (WebCore::ContentExtensions::ContentExtension::universalActionsWithoutDomains):
832         * contentextensions/ContentExtensionCompiler.cpp:
833         (WebCore::ContentExtensions::compileRuleList):
834         * contentextensions/ContentExtensionRule.cpp:
835         (WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
836         (WebCore::ContentExtensions::Action::deserialize):
837         (WebCore::ContentExtensions::Action::deserializeType):
838         (WebCore::ContentExtensions::Action::serializedLength):
839         * contentextensions/ContentExtensionRule.h:
840         (WebCore::ContentExtensions::Action::operator==):
841         (WebCore::ContentExtensions::Action::setExtensionIdentifier):
842         (WebCore::ContentExtensions::Action::extensionIdentifier):
843         * contentextensions/ContentExtensionsBackend.cpp:
844         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
845         * contentextensions/DFABytecode.h:
846         (WebCore::ContentExtensions::instructionSizeWithArguments):
847         * contentextensions/DFABytecodeCompiler.cpp:
848         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
849         * contentextensions/DFABytecodeInterpreter.cpp:
850         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
851         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
852         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsMatchingEverything):
853         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
854         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot): Deleted.
855         * contentextensions/DFABytecodeInterpreter.h:
856         * loader/ResourceLoadInfo.h:
857
858 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
859
860         Adopt AVPlayerLayerView
861         https://bugs.webkit.org/show_bug.cgi?id=146862
862
863         Reviewed by Jer Noble.
864
865         The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
866         Some animation is improved in the conversion.
867
868         WebAVPlayerLayerView and WebAVPictureInPicturePlayerLayerView derive from AVKit and UIKit respectively.
869         Because these frameworks are loaded at runtime, these classes must be generate using objc/runtime.h to
870         register them from c functions at runtime. The most important part of these UIViews is that their
871         backing layer is a WebAVPlayerLayer.
872
873         WebCALayerHostWrapper and WebAVVideoLayer are combined into WebAVPlayerLayer to simplify the hierarchy.
874         WebAVPlayerLayer is a stand-in for an AVPlayerLayer.
875
876         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
877         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer): -removeFromSuperlayer is redundant.
878         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity): syncTextTrackBounds on change.
879         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenFrame):
880         We never want animation here, since all animation will happen in UIViews. 
881         This is just for going into the final size after a transform based animation.
882
883         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
884         (WebVideoFullscreenControllerContext::didSetupFullscreen): layer -> view
885         (WebVideoFullscreenControllerContext::didCleanupFullscreen): layer -> view
886         (WebVideoFullscreenControllerContext::setUpFullscreen): layer -> view
887
888         (WebVideoFullscreenControllerContext::setVideoLayerFrame): layer -> view
889         Use fence port to synchronize between the UIThread and the WebThread,
890         the same way WebKit2 uses a fence port to synchronize between processes.
891
892         (WebVideoFullscreenControllerContext::setVideoLayerGravity):
893         No longer necessary to cache videoGravity at this level.
894
895         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
896         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
897
898         (-[WebAVPlayerLayer init]):
899         (-[WebAVPlayerLayer dealloc]):
900         (-[WebAVPlayerLayer playerController]):
901         (-[WebAVPlayerLayer setBounds:]):
902         (-[WebAVPlayerLayer resolveBounds]):
903         (-[WebAVPlayerLayer setVideoGravity:]):
904         (-[WebAVPlayerLayer videoGravity]):
905         (-[WebAVPlayerLayer videoRect]):
906         (+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]):
907         Added class WebAVPlayerLayer, replacing WebAVVideoLayer and WebCALayerHostWrapper.
908
909         (WebAVPictureInPicturePlayerLayerView_layerClass):
910         (getWebAVPictureInPicturePlayerLayerViewClass):
911         Added runtime class WebAVPictureInPicturePlayerLayerView
912
913         (WebAVPlayerLayerView_layerClass):
914         (WebAVPlayerLayerView_playerController):
915         (WebAVPlayerLayerView_setPlayerController):
916         (WebAVPlayerLayerView_videoView):
917         (WebAVPlayerLayerView_setVideoView):
918         (WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView):
919         (WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView):
920         (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
921         (getWebAVPlayerLayerViewClass):
922         Added runtime class WebAVPlayerLayerView
923
924         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
925         Dimensions are also stored in WebAVPlayerLayer so it can make decisions about
926         animating the video layer.
927
928         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
929         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): 
930         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
931         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
932         Straightforward layer to view conversion.
933
934         (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
935         Set view frame using the view hierarchy instead of assuming it is directly in a window.
936
937         (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
938         Set view frame using the view hierarchy instead of assuming it is directly in a window.
939         dispatch_async before calling didExitFullscreen() to allows CATransactions to complete.
940
941         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
942         Set view frame using the view hierarchy instead of assuming it is directly in a window.
943         dispatch_async before calling didSetupFullscreen() to allows CATransactions to complete.
944
945         (-[WebCALayerHostWrapper dealloc]): Deleted.
946         (-[WebCALayerHostWrapper setVideoSublayer:]): Deleted.
947         (-[WebCALayerHostWrapper videoSublayer]): Deleted.
948         (-[WebCALayerHostWrapper setBounds:]): Deleted.
949         (-[WebCALayerHostWrapper resolveBounds]): Deleted.
950         Class WebCALayerHostWrapper deleted. Functionality rolled into WebAVPlayerLayer.
951
952         (+[WebAVVideoLayer videoLayer]): Deleted.
953         (-[WebAVVideoLayer init]): Deleted.
954         (-[WebAVVideoLayer setPlayerViewController:]): Deleted.
955         (-[WebAVVideoLayer setVideoSublayer:]): Deleted.
956         (-[WebAVVideoLayer setBounds:]): Deleted.
957         (-[WebAVVideoLayer setVideoLayerGravity:]): Deleted.
958         (-[WebAVVideoLayer videoLayerGravity]): Deleted.
959         (-[WebAVVideoLayer enterPIPModeRedirectingVideoToLayer:]): Deleted.
960         (-[WebAVVideoLayer leavePIPMode]): Deleted.
961         Class WebAVVideoLayer deleted. Functionality rolled into WebAVPlayerLayer.
962
963         * platform/ios/WebVideoFullscreenModel.h:
964         * platform/ios/WebVideoFullscreenModelVideoElement.h:
965         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
966         No need to store frame and gravity in the model. It is stored in the UI where it is used.
967
968         (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
969         (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
970         * platform/spi/cocoa/AVKitSPI.h: Add AVPlayerLayerView.
971
972 2015-07-20  Anders Carlsson  <andersca@apple.com>
973
974         Add PLATFORM #ifdefs for Mac SPI headers
975         https://bugs.webkit.org/show_bug.cgi?id=147129
976
977         Reviewed by Tim Horton.
978
979         * Configurations/WebCore.xcconfig:
980         Skip NPAPI headers on iOS.
981
982         * platform/mac/WebVideoFullscreenController.h:
983         * platform/spi/mac/DataDetectorsSPI.h:
984         * platform/spi/mac/NSEventSPI.h:
985         * platform/spi/mac/NSFontSPI.h:
986         * platform/spi/mac/NSMenuSPI.h:
987
988 2015-07-20  Tim Horton  <timothy_horton@apple.com>
989
990         REGRESSION (r174287): Flash of black when opening a new web view or navigating to a new page
991         https://bugs.webkit.org/show_bug.cgi?id=147127
992         <rdar://problem/21474317>
993
994         Reviewed by Simon Fraser.
995
996         * rendering/RenderView.cpp:
997         (WebCore::RenderView::paintBoxDecorations):
998         Avoid using an invalid documentBackgroundColor, fall back to baseBackgroundColor
999         like we did before r174287.
1000
1001 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1002
1003         [Win] Unreviewed build fix after r187022.
1004
1005         * platform/win/WindowsTouch.h:
1006         Undid changes from r187022
1007
1008 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
1009
1010         Allow video to rotate when app doesnt allow rotation.
1011         https://bugs.webkit.org/show_bug.cgi?id=147121
1012
1013         Reviewed by Jer Noble.
1014
1015         Set an SPI bool on the fullscreen video root view controller to allow it to override app rotation restrictions. 
1016         This allows video to be played in landscape in portrait only apps.
1017
1018         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1019         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
1020
1021 2015-07-20  Andreas Kling  <akling@apple.com>
1022
1023         Unreviewed assertion fix following r187031.
1024
1025         Just have GenericEventQueue::resume() return early if the queue isn't suspended.
1026         Suspend/Resume calls are not always symmetrical in HTMLMediaElement.
1027
1028         * dom/GenericEventQueue.cpp:
1029         (WebCore::GenericEventQueue::resume):
1030
1031 2015-07-20  David Kilzer  <ddkilzer@apple.com>
1032
1033         Unexpected ABI diffference between armv7 and armv7s in WebCore::GraphicsLayerCA::~GraphicsLayerCA()
1034         <http://webkit.org/b/147101>
1035
1036         Reviewed by Michael Saboff.
1037
1038         * platform/graphics/transforms/TransformationMatrix.h: Align
1039         Matrix4 on both armv7 and armv7s.
1040
1041 2015-07-20  Anders Carlsson  <andersca@apple.com>
1042
1043         Add the necessary platform checks to iOS SPI headers
1044         https://bugs.webkit.org/show_bug.cgi?id=147120
1045
1046         Reviewed by Tim Horton.
1047
1048         * platform/spi/ios/GraphicsServicesSPI.h:
1049         * platform/spi/ios/MediaPlayerSPI.h:
1050         * platform/spi/ios/MobileGestaltSPI.h:
1051
1052 2015-07-20  Andreas Kling  <akling@apple.com>
1053
1054         Improve behavior of media elements in page cache.
1055         <https://webkit.org/b/147020>
1056         <rdar://problem/21712311>
1057
1058         Reviewed by Chris Dumez.
1059
1060         Make improvements for media elements when transitioning in/out of page cache:
1061
1062         - Events that were scheduled when going into cache will now be delivered
1063           when the page is restored from cache.
1064
1065         - Data buffering is turned off while in the cache. This reduces the memory
1066           cost of cached pages with media elements on iOS (where mediaserverd would
1067           keep upcoming video frames in memory for cached pages.)
1068
1069         Test: media/restore-from-page-cache.html (amended)
1070
1071         * dom/GenericEventQueue.h:
1072         * dom/GenericEventQueue.cpp:
1073         (WebCore::GenericEventQueue::enqueueEvent):
1074         (WebCore::GenericEventQueue::suspend):
1075         (WebCore::GenericEventQueue::resume):
1076
1077             Add a simple suspend/resume mechanism to GenericEventQueue that can
1078             be used to support page caching.
1079
1080         * html/HTMLMediaElement.cpp:
1081         (WebCore::HTMLMediaElement::stop):
1082         (WebCore::HTMLMediaElement::suspend):
1083         (WebCore::HTMLMediaElement::resume):
1084         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
1085
1086             Adapt to event queueing changes and add calls to setShouldBufferData().
1087
1088         * html/HTMLSourceElement.h:
1089         * html/HTMLSourceElement.cpp:
1090         (WebCore::HTMLSourceElement::HTMLSourceElement):
1091         (WebCore::HTMLSourceElement::create):
1092         (WebCore::HTMLSourceElement::activeDOMObjectName):
1093         (WebCore::HTMLSourceElement::canSuspendForPageCache):
1094         (WebCore::HTMLSourceElement::suspend):
1095         (WebCore::HTMLSourceElement::resume):
1096         (WebCore::HTMLSourceElement::stop):
1097
1098             Turn HTMLSourceElement into an ActiveDOMObject so it gets all the
1099             appropriate page cache notifications directly. Suspend the delayed
1100             error event delivery timer when cached.
1101
1102 2015-07-20  Mark Lam  <mark.lam@apple.com>
1103
1104         Rollout r187020 and r187021: breaks JSC API tests on debug builds.
1105         https://bugs.webkit.org/show_bug.cgi?id=147110
1106
1107         * bindings/js/JSDOMWindowBase.cpp:
1108         (WebCore::JSDOMWindowBase::commonVM):
1109
1110 2015-07-18  Ada Chan  <adachan@apple.com>
1111
1112         Fix deadlock between -[AVPlayerItem currentTime] and -[AVPlayer isExternalPlaybackActive]
1113         https://bugs.webkit.org/show_bug.cgi?id=147085
1114         <rdar://problem/21878275>
1115
1116         Reviewed by Jer Noble.
1117
1118         * Modules/webaudio/AudioContext.cpp:
1119         (WebCore::AudioContext::isPlayingAudioDidChange):
1120         Call Document::updateIsPlayingMedia() on the main thread, since we could be on the audio I/O
1121         thread here and the Document::updateIsPlayingMedia() call could block, causing a deadlock.
1122
1123 2015-07-20  Alex Christensen  <achristensen@webkit.org>
1124
1125         Resurrect CMake build on Windows.
1126         https://bugs.webkit.org/show_bug.cgi?id=147083
1127
1128         Reviewed by Gyuyoung Kim.
1129
1130         * CMakeLists.txt:
1131         * PlatformWin.cmake:
1132         * dom/Document.cpp:
1133         (WebCore::Document::~Document):
1134         * dom/Range.cpp:
1135         * dom/Text.cpp:
1136         * editing/CompositeEditCommand.cpp:
1137         * platform/graphics/texmap/BitmapTexturePool.cpp:
1138         (WebCore::BitmapTexturePool::createTexture):
1139         * platform/win/WindowsTouch.h:
1140         * rendering/RenderThemeWin.h:
1141         Fixed some including and compiling quirks needed for different configurations.
1142
1143 2015-07-20  Per Arne Vollan  <peavo@outlook.com>
1144
1145         JavaScriptCore performance is very bad on Windows
1146         https://bugs.webkit.org/show_bug.cgi?id=146448
1147
1148         Reviewed by Mark Lam.
1149
1150         * bindings/js/JSDOMWindowBase.cpp:
1151         (WebCore::JSDOMWindowBase::commonVM): Compile fix.
1152
1153 2015-07-19  Tim Horton  <timothy_horton@apple.com>
1154
1155         Make shrink-wrapping test a ref-test instead of pixel-test
1156         https://bugs.webkit.org/show_bug.cgi?id=147081
1157
1158         Reviewed by Sam Weinig.
1159
1160         Nobody runs pixel tests.
1161
1162         * svg/SVGPathUtilities.cpp:
1163         (WebCore::pathIteratorForBuildingString):
1164         (WebCore::buildStringFromPath):
1165         * svg/SVGPathUtilities.h:
1166         Add a helper that turns a Path into a SVG path string.
1167
1168         * testing/Internals.cpp:
1169         (WebCore::Internals::pathStringWithShrinkWrappedRects):
1170         * testing/Internals.h:
1171         * testing/Internals.idl:
1172         Have the internals shrink-wrap method return an SVG path instead of a DOMPath.
1173
1174 2015-07-19  David Kilzer  <ddkilzer@apple.com>
1175
1176         REGRESSION (r187008): CGPathCreateMutableCopyByTransformingPath() is not available on Windows
1177         <https://bugs.webkit.org/show_bug.cgi?id=147077>
1178
1179         * platform/graphics/cg/PathCG.cpp:
1180         (WebCore::Path::transform): Restore less efficient code path
1181         for Windows.
1182
1183 2015-07-18  Tim Horton  <timothy_horton@apple.com>
1184
1185         Simplify Path(CG)::transform/translate
1186         https://bugs.webkit.org/show_bug.cgi?id=147077
1187
1188         Reviewed by Simon Fraser.
1189
1190         No new tests; no behavior change.
1191
1192         * platform/graphics/cg/PathCG.cpp:
1193         (WebCore::Path::translate):
1194         (WebCore::Path::transform):
1195         Use CGPathCreateMutableCopyByTransformingPath to do the copy and transform
1196         in a single call instead of two.
1197
1198         Make use of transform() to implement translate() instead of duplicating the code.
1199         Move the two functions near each other.
1200
1201         (WebCore::Path::boundingRect):
1202         Remove irrelevant reference to Snow Leopard.
1203
1204 2015-07-17  Matt Rajca  <mrajca@apple.com>
1205
1206         Media Session: Add support for 'Content' interruption types
1207         https://bugs.webkit.org/show_bug.cgi?id=147042
1208
1209         Reviewed by Eric Carlson.
1210
1211         Tests: Added media/session/content-interruptions
1212
1213         * Modules/mediasession/MediaSession.cpp:
1214         (WebCore::MediaSession::handleIndefinitePauseInterruption): Indefinitely pause the session by pausing media
1215          elements and removing them from the set of active participating elements.
1216         * Modules/mediasession/MediaSession.h:
1217         * Modules/mediasession/MediaSessionManager.cpp:
1218         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented support for 'Content'
1219          interruption types as described in 4.5.2.
1220
1221 2015-07-16  Matt Rajca  <mrajca@apple.com>
1222
1223         Media Session: add support for telephony interruptions
1224         https://bugs.webkit.org/show_bug.cgi?id=147016
1225
1226         Reviewed by Eric Carlson.
1227
1228         * platform/audio/mac/MediaSessionInterruptionProviderMac.mm:
1229         (WebCore::callDidBeginRinging): Forward this event to media sessions as a 'Transient' interruption.
1230         (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
1231         (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
1232
1233 2015-07-17  Matt Rajca  <mrajca@apple.com>
1234
1235         Media Session: add infrastructure for testing interruptions
1236         https://bugs.webkit.org/show_bug.cgi?id=147060
1237
1238         Reviewed by Eric Carlson.
1239
1240         * Modules/mediasession/MediaSession.h: Export methods to be used with tests.
1241         * Modules/mediasession/MediaSessionManager.h: Ditto.
1242         * bindings/scripts/CodeGeneratorJS.pm: JSMediaSession needs to be marked with WEBCORE_EXPORT so it works with JSInternals.
1243         * testing/Internals.cpp:
1244         (WebCore::Internals::sendMediaSessionStartOfInterruptionNotification): Let tests send interruptions to MediaSessionManager.
1245         (WebCore::Internals::sendMediaSessionEndOfInterruptionNotification): Ditto.
1246         (WebCore::Internals::mediaSessionCurrentState): Expose the current state of media sessions to tests.
1247         * testing/Internals.h:
1248         * testing/Internals.idl: Add interfaces for sending interruptions from JS tests.
1249
1250 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1251
1252         Reduce PassRefPtr in WebKit2 - 3
1253         https://bugs.webkit.org/show_bug.cgi?id=146995
1254
1255         Reviewed by Daniel Bates.
1256
1257         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
1258         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
1259
1260         * loader/EmptyClients.cpp:
1261         (WebCore::EmptyChromeClient::createPopupMenu):
1262         (WebCore::EmptyChromeClient::createSearchPopupMenu):
1263         (WebCore::EmptyFrameLoaderClient::createDocumentLoader):
1264         (WebCore::EmptyFrameLoaderClient::createFrame):
1265         (WebCore::EmptyFrameLoaderClient::createPlugin):
1266         * loader/EmptyClients.h:
1267         * loader/FrameLoader.cpp:
1268         (WebCore::FrameLoader::init):
1269         (WebCore::FrameLoader::load):
1270         (WebCore::FrameLoader::loadWithNavigationAction):
1271         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1272         (WebCore::FrameLoader::reload):
1273         * loader/FrameLoaderClient.h:
1274         * loader/ResourceLoadScheduler.cpp:
1275         (WebCore::ResourceLoadScheduler::scheduleSubresourceLoad):
1276         (WebCore::ResourceLoadScheduler::schedulePluginStreamLoad):
1277         * loader/ResourceLoadScheduler.h:
1278         * loader/SubresourceLoader.cpp:
1279         (WebCore::SubresourceLoader::create):
1280         * loader/SubresourceLoader.h:
1281         * page/ChromeClient.h:
1282         * platform/graphics/texmap/TextureMapperBackingStore.h:
1283         * platform/graphics/texmap/TextureMapperLayer.h:
1284         (WebCore::TextureMapperLayer::texture):
1285         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:
1286         (WebCore::TextureMapperSurfaceBackingStore::texture):
1287         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
1288         * platform/graphics/texmap/TextureMapperTile.h:
1289         (WebCore::TextureMapperTile::texture):
1290         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1291         (WebCore::TextureMapperTiledBackingStore::texture):
1292         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
1293         * storage/StorageNamespace.h:
1294
1295 2015-07-18  David Kilzer  <ddkilzer@apple.com>
1296
1297         REGRESSION (r186976): Use piFloat instead of M_PI
1298
1299         Attempt to fix the following build failure:
1300
1301             PathUtilities.cpp(183): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
1302
1303         * platform/graphics/PathUtilities.cpp:
1304         (WebCore::walkGraphAndExtractPolygon): Use piFloat since M_PI is
1305         not defined on Windows.
1306
1307 2015-07-18  David Kilzer  <ddkilzer@apple.com>
1308
1309         REGRESSION (r186976): Windows build broke due to missing definition of M_PI
1310
1311         Attempt to fix the following build failure:
1312
1313             PathUtilities.cpp(182): error C2065: 'M_PI' : undeclared identifier [...\Source\WebCore\WebCore.vcxproj\WebCore.vcxproj]
1314
1315         * platform/graphics/PathUtilities.cpp: Include <wtf/MathExtras.h>.
1316
1317 2015-07-17  Zalan Bujtas  <zalan@apple.com>
1318
1319         REGRESSION (r169105): Do not assign a renderer to multiple selection subtrees.
1320         https://bugs.webkit.org/show_bug.cgi?id=147038
1321         rdar://problem/21819351
1322
1323         Reviewed by David Kilzer.
1324
1325         A renderer should never be assigned to multiple selection subtrees. (Currently RenderObject maintains the last selection state.)
1326         RenderView::applySubtreeSelection() loops from the start to the end of the selection to find renderers that are inside the selection.
1327         However, in case of regions (when multiple selection roots are present) traversing the renderer tree by calling RenderObject::nextInPreOrder() could
1328         end up going across selection roots.
1329         This patch ensures that we assign renderers to a specific selection only when the current selection root and the renderer's selection root match.
1330
1331         Test: fast/regions/crash-when-renderer-is-in-multiple-selection-subtrees2.html
1332
1333         * rendering/RenderView.cpp:
1334         (WebCore::SelectionIterator::SelectionIterator):
1335         (WebCore::SelectionIterator::current):
1336         (WebCore::SelectionIterator::checkForSpanner):
1337         (WebCore::RenderView::applySubtreeSelection):
1338
1339 2015-07-17  Andy Estes  <aestes@apple.com>
1340
1341         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
1342         https://bugs.webkit.org/show_bug.cgi?id=147044
1343         rdar://problem/21567820
1344
1345         Reviewed by Brady Eidson.
1346
1347         In addition to placing resources fetched with 'Content-Disposition: attachment' in a unique origin,
1348         this change does the following:
1349
1350         - Switches the sandbox type from SandboxOrigin to SandboxAll, which enforces the same restrictions as <iframe sandbox>.
1351         - Disables processing of <meta http-equiv> elements.
1352         - Disables loading of cross-origin subframes.
1353
1354         Tests: http/tests/contentdispositionattachmentsandbox/cross-origin-frames-disabled.html
1355                http/tests/contentdispositionattachmentsandbox/form-submission-disabled.html
1356                http/tests/contentdispositionattachmentsandbox/http-equiv-disabled.html
1357                http/tests/contentdispositionattachmentsandbox/plugins-disabled.html
1358                http/tests/contentdispositionattachmentsandbox/scripts-disabled.html
1359
1360         * dom/Document.cpp:
1361         (WebCore::Document::processHttpEquiv): Switched to calling Document::httpEquivPolicy(). Logged an error to the console for policies other than Enabled.
1362         (WebCore::Document::initSecurityContext): Switched sandbox enforcement from SandboxOrigin to SandboxAll.
1363         (WebCore::Document::httpEquivPolicy): Returned a HttpEquivPolicy based on shouldEnforceContentDispositionAttachmentSandbox() and Settings::httpEquivEnabled().
1364         (WebCore::Document::shouldEnforceContentDispositionAttachmentSandbox): Returned true if Settings::contentDispositionAttachmentSandboxEnabled()
1365         and the document was fetched as an attachment.
1366         * dom/Document.h:
1367         * loader/cache/CachedResourceLoader.cpp: 
1368         (WebCore::CachedResourceLoader::canRequest): When requesting a subframe main resource when the parent frame enforces an attachment sandbox,
1369         only continue if the parent frame's SecurityOrigin allows the request.
1370         * page/Settings.in: Added contentDispositionAttachmentSandboxEnabled with an initial value of false.
1371
1372 2015-07-17  Zalan Bujtas  <zalan@apple.com>
1373
1374         (display: block)input range's thumb disappears when moved.
1375         https://bugs.webkit.org/show_bug.cgi?id=146896
1376         <rdar://problem/21787807>
1377
1378         Reviewed by Simon Fraser.
1379
1380         Since the thumb is positioned after the layout for the input (shadow) subtree is finished, the repaint rects
1381         issued during the layout will not cover the re-positioned thumb.
1382         We need to issue a repaint soon after the thumb is re-positioned.
1383
1384         Test: fast/repaint/block-inputrange-repaint.html
1385
1386         * html/shadow/SliderThumbElement.cpp:
1387         (WebCore::RenderSliderContainer::layout):
1388
1389 2015-07-17  Simon Fraser  <simon.fraser@apple.com>
1390
1391         Attempt to fix the build.
1392
1393         * html/HTMLMediaElement.cpp:
1394         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
1395         * html/HTMLMediaElement.h:
1396
1397 2015-07-17  Dean Jackson  <dino@apple.com>
1398
1399         Picture in Picture interacts poorly with AirPlay/HDMI
1400         https://bugs.webkit.org/show_bug.cgi?id=147061
1401         <rdar://problem/19192076>
1402
1403         Reviewed by Tim Horton.
1404
1405         When we are actively playing to an external target, the
1406         picture in picture button should be hidden.
1407
1408         Also, the availability of picture in picture is also
1409         dependent on AirPlay, so that we don't auto-pip when
1410         we're displaying on a TV.
1411
1412         * Modules/mediacontrols/mediaControlsiOS.js:
1413         (ControllerIOS.prototype.configureInlineControls): Call the update function.
1414         (ControllerIOS.prototype.updatePictureInPictureButton): Add or remove a hidden class.
1415         * html/MediaElementSession.cpp:
1416         (WebCore::MediaElementSession::allowsPictureInPicture): Check Airplay status.
1417
1418 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1419
1420         [iOS] TextIndicator has a large forehead when line-height > 1
1421         https://bugs.webkit.org/show_bug.cgi?id=147058
1422         <rdar://problem/21643094>
1423
1424         Reviewed by Dean Jackson.
1425
1426         * editing/FrameSelection.cpp:
1427         (WebCore::FrameSelection::getClippedVisibleTextRectangles):
1428         * editing/FrameSelection.h:
1429         Add a parameter controlling whether getClippedVisibleTextRectangles
1430         returns selection-height rects (including extra line-height) or text-height
1431         rects (including only the text height). Plumb it down.
1432
1433         * page/TextIndicator.cpp:
1434         (WebCore::TextIndicator::createWithRange):
1435         (WebCore::TextIndicator::createWithSelectionInFrame):
1436         Use the tighter text-height rects on iOS, where there's no selection highlight to cover up.
1437         Remove an assertion that is no longer always true, and which is mostly obsoleted by the
1438         fact that we don't let FrameSnapshotting code arbitrarily decide the rect to snapshot anymore.
1439
1440 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1441
1442         Improve rect shrink-wrapping algorithm
1443         https://bugs.webkit.org/show_bug.cgi?id=147037
1444         <rdar://problem/21643094>
1445
1446         Reviewed by Simon Fraser.
1447
1448         * platform/graphics/FloatPoint.h:
1449         (WebCore::areEssentiallyEqual):
1450         Added; implementation is the same as FloatSize's.
1451
1452         * platform/graphics/PathUtilities.cpp:
1453         (WebCore::FloatPointGraph::FloatPointGraph):
1454         (WebCore::FloatPointGraph::~FloatPointGraph):
1455         (WebCore::FloatPointGraph::Node::Node):
1456         (WebCore::FloatPointGraph::Node::nextPoints):
1457         (WebCore::FloatPointGraph::Node::addNextPoint):
1458         (WebCore::FloatPointGraph::Node::isVisited):
1459         (WebCore::FloatPointGraph::Node::visit):
1460         (WebCore::FloatPointGraph::Node::reset):
1461         (WebCore::FloatPointGraph::reset):
1462         (WebCore::FloatPointGraph::findOrCreateNode):
1463         (WebCore::findLineSegmentIntersection):
1464         (WebCore::addIntersectionPoints):
1465         (WebCore::walkGraphAndExtractPolygon):
1466         (WebCore::findUnvisitedPolygonStartPoint):
1467         (WebCore::unitePolygons):
1468         (WebCore::edgesForRect):
1469         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
1470         (WebCore::addShrinkWrapRightCorner): Deleted.
1471         (WebCore::addShrinkWrapLeftCorner): Deleted.
1472         (WebCore::addShrinkWrappedPathForRects): Deleted.
1473         (WebCore::rectsIntersectOrTouch): Deleted.
1474         (WebCore::findSetContainingRect): Deleted.
1475         Add a new implementation of shrink-wrap, which is significantly more
1476         generic than the old one, which assumed a top-down progression of rects.
1477
1478         This version uses polygon intersection to find the path around the
1479         set of rects, and then follows said path and adds appropriately-sized
1480         arcs for the corners.
1481
1482         The polygon intersection algorithm first finds all the intersection points
1483         between all of the rects, then builds a graph of edges outward from one point.
1484         It then traverses the graph, choosing at each point the next edge which
1485         has not been visited and has the greatest interior angle, recording the polygon as it goes.
1486
1487         If at the end of the traversal we have not returned to the initial node,
1488         we give up on shrink-wrapping and just use a bounding box around the rects.
1489
1490         If any of the original rects have not been visited at all, we repeat the traversal
1491         starting with that rect, making an additional polygon (since we removed completely contained
1492         rects before we started, having not visited the rect at all means that it's not connected
1493         to the others).
1494
1495         Once we have a set of united polygons, we follow each one, determining the ideal (always
1496         equal in width and height, never more than half the length of either edge, so that we always
1497         have a smooth curve) arc radius and projecting it onto the edge, and then
1498         adding an arc between the end of the previous path and beginning of the next.
1499
1500         Because the shrink-wrap algorithm is fairly expensive, if there are more than 20 rects,
1501         we fall back to a bounding box. Given the current use cases, this is more than enough
1502         rects, but can certainly be adjusted in the future if needed.
1503
1504         * testing/Internals.cpp:
1505         (WebCore::Internals::pathWithShrinkWrappedRects):
1506         * testing/Internals.h:
1507         * testing/Internals.idl:
1508         Add a radius parameter.
1509
1510 2015-07-17  Nan Wang  <n_wang@apple.com>
1511
1512         AX: iframe within table cell is inaccessible to VoiceOver
1513         https://bugs.webkit.org/show_bug.cgi?id=147001
1514         <rdar://problem/21106945>
1515
1516         Reviewed by Chris Fleizach.
1517
1518         When a table cell is created before its parent table determines if it should be ignored or not,
1519         the table cell may cache the wrong role. Fix that by allowing each table cell to update its role
1520         after the table makes this determination.
1521
1522         Test: accessibility/iframe-within-cell.html
1523
1524         * accessibility/AccessibilityTable.cpp:
1525         (WebCore::AccessibilityTable::addChildren):
1526         (WebCore::AccessibilityTable::addChildrenFromSection):
1527
1528 2015-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
1529
1530         style.fontFamily accessor crashes on unstyled node created from DOMParser().parseFromString()
1531         https://bugs.webkit.org/show_bug.cgi?id=147026
1532         <rdar://problem/21864487>
1533
1534         Reviewed by Andreas Kling.
1535
1536         Font CSS properties are a little special because they are used as indices into caches.
1537         Normally, StyleResolver gives all nodes a default font family, so our cache works correctly.
1538         However, if the document doesn't have a Settings object, StyleResolver wasn't doing this.
1539         Documents created from DOMParser().parseFromString() don't have a Settings object.
1540
1541         Test: fast/text/crash-font-family-parsed.html
1542
1543         * css/StyleResolver.cpp:
1544         (WebCore::StyleResolver::defaultStyleForElement):
1545         (WebCore::StyleResolver::initializeFontStyle): Set a font family even if we don't have a
1546         Settings object.
1547
1548 2015-07-17  Myles C. Maxfield  <mmaxfield@apple.com>
1549
1550         Video posters disappear once media has loaded
1551         https://bugs.webkit.org/show_bug.cgi?id=147045
1552
1553         Reviewed by Simon Fraser.
1554
1555         After r184932, all video elements are composited. However, there is logic in
1556         RenderLayerBacking::updateConfiguration() which adds the video layer to the page
1557         if the video is composited, without checking first to see if it should actually
1558         do so.
1559
1560         Test: compositing/video/poster.html
1561
1562         * rendering/RenderLayerBacking.cpp:
1563         (WebCore::RenderLayerBacking::updateConfiguration):
1564
1565 2015-07-17  Benjamin Poulain  <bpoulain@apple.com>
1566
1567         [Content Extensions] Term::isUniversalTransition() incorrectly expects the end-of-line assertion in character sets
1568         https://bugs.webkit.org/show_bug.cgi?id=147032
1569
1570         Reviewed by Alex Christensen.
1571
1572         * contentextensions/Term.h:
1573         (WebCore::ContentExtensions::Term::isUniversalTransition):
1574         The universal transition is not supposed to account for the end-of-line assertion,
1575         it should be a transition matching any character.
1576
1577         Here, we were counting 128 transitions, the 127 characters plus the
1578         transition on zero we are using for EOL.
1579
1580         The end result is Term::isUniversalTransition() was completely useless.
1581         The only code using it is the pattern simplificaton phase. That part
1582         was not working correclty and was allowing useless ".*" in the patterns.
1583
1584 2015-07-17  Dan Bernstein  <mitz@apple.com>
1585
1586         WebCore part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
1587         https://bugs.webkit.org/show_bug.cgi?id=147040
1588
1589         Reviewed by Dean Jackson.
1590
1591         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm
1592
1593         * loader/FrameLoader.cpp:
1594         (WebCore::shouldOpenExternalURLsPolicyToApply): Pulled the logic out of
1595         applyShouldOpenExternalURLsPolicyToNewDocumentLoader into this new helper.
1596         (WebCore::FrameLoader::loadURL): When targeting a new frame, apply the external URLs policy
1597         to the action passed to checkNewWindowPolicy.
1598         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Call the new
1599         helper function.
1600         (WebCore::createWindow): Include the external URL policy in the action passed to
1601         createWindow.
1602
1603 2015-07-17  Anders Carlsson  <andersca@apple.com>
1604
1605         ScrollView.h should be self-contained
1606         https://bugs.webkit.org/show_bug.cgi?id=147004
1607
1608         Reviewed by Sam Weinig.
1609
1610         * platform/ScrollView.h:
1611
1612 2015-07-17  Brady Eidson  <beidson@apple.com>
1613
1614         Rolling r186895 back in, in its entirety.
1615         https://bugs.webkit.org/show_bug.cgi?id=146976
1616
1617         Rubberstamped by Tim Horton.
1618
1619         * platform/network/cf/CookieJarCFNet.cpp:
1620         (WebCore::createCookies): Use new CFNetwork SPI.
1621
1622 2015-07-17  Benjamin Poulain  <bpoulain@apple.com>
1623
1624         [Content Extensions] CSS-display-none rules are not working properly
1625         https://bugs.webkit.org/show_bug.cgi?id=147024
1626
1627         Reviewed by Sam Weinig.
1628
1629         There were 2 bugs prevening rules with css-display-none and a url-filter from working
1630         correctly.
1631
1632         First, ContentExtensions::serializeActions() was merging selectors regardless of their
1633         trigger. All the CSS Selectors would be grouped together and applied regardless of which
1634         rule apply.
1635
1636         That problem was fixed by grouping CSS rules by trigger. We want all the undistinguishable
1637         CSS rules to be merged. The trigger makes 2 rules dinstinguishable as one rule can apply
1638         on a page while the next rule does not. The simplest approach is to group by trigger.
1639
1640         The second problem had to do with rules added before the document is created.
1641         When accumulating those rules, we were only keeping the last one. The reason was that
1642         DocumentLoader::addPendingContentExtensionDisplayNoneSelector() would only keep a single
1643         selector list by extension.
1644
1645         This is fixed by keeping a vector of all the rules that apply.
1646
1647         Tests: http/tests/contentextensions/css-display-none-with-different-case-sensitivity-are-not-merged.html
1648                http/tests/contentextensions/css-display-none-with-different-triggers-are-not-merged.html
1649                http/tests/contentextensions/two-distinguishable-css-display-none-rules-on-main-resource.html
1650
1651         * contentextensions/ContentExtensionCompiler.cpp:
1652         (WebCore::ContentExtensions::serializeActions):
1653         * contentextensions/ContentExtensionRule.h:
1654         (WebCore::ContentExtensions::Trigger::isEmpty):
1655         (WebCore::ContentExtensions::TriggerHash::hash):
1656         (WebCore::ContentExtensions::TriggerHash::equal):
1657         (WebCore::ContentExtensions::TriggerHashTraits::constructDeletedValue):
1658         (WebCore::ContentExtensions::TriggerHashTraits::isDeletedValue):
1659         (WebCore::ContentExtensions::TriggerHashTraits::emptyValue):
1660         (WebCore::ContentExtensions::TriggerHashTraits::isEmptyValue):
1661         * contentextensions/ContentExtensionsBackend.cpp:
1662         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
1663         * loader/DocumentLoader.cpp:
1664         (WebCore::DocumentLoader::commitData):
1665         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
1666         * loader/DocumentLoader.h:
1667
1668 2015-07-17  Tim Horton  <timothy_horton@apple.com>
1669
1670         iOS TextIndicators include text that is not supposed to be indicated
1671         https://bugs.webkit.org/show_bug.cgi?id=147028
1672         <rdar://problem/21643094>
1673
1674         Reviewed by Sam Weinig.
1675
1676         Paint the selection and background, but not other foregrounds, for iOS TextIndicators.
1677
1678         * page/FrameSnapshotting.cpp:
1679         (WebCore::snapshotFrameRect):
1680         * page/FrameSnapshotting.h:
1681         Add a new snapshot option where we'll paint backgrounds and the selected
1682         foreground and nothing else.
1683         Pass the new snapshot option through as a paint behavior.
1684
1685         * page/TextIndicator.cpp:
1686         (WebCore::TextIndicator::createWithRange):
1687         Implement the incantations necessary to make a temporary selection
1688         change not get sent to the UI process and actually have WebCore know about it
1689         and accurately respond to questions about it.
1690
1691         (WebCore::TextIndicator::createWithSelectionInFrame):
1692         Paint selection and backgrounds on iOS.
1693
1694         * rendering/PaintPhase.h:
1695         * rendering/RenderLayer.cpp:
1696         (WebCore::RenderLayer::paintLayerContents):
1697         * rendering/RenderElement.cpp:
1698         (WebCore::RenderElement::selectionColor):
1699         Add a new paint behavior, SelectionAndBackgroundsOnly, which behaves
1700         the same as selection only except it allows backgrounds to paint.
1701
1702 2015-07-17  Mark Lam  <mark.lam@apple.com>
1703
1704         Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
1705         https://bugs.webkit.org/show_bug.cgi?id=118884
1706
1707         Reviewed by Filip Pizlo and Mark Lam.
1708         Patch by Keith Miller  <keith_miller@apple.com>.
1709
1710         Tests: fast/events/event-leak-objects.html
1711                fast/events/event-properties-gc.html
1712
1713         Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
1714         was fixed by checking that any object passed by an event must be serializable or originate from the same
1715         isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
1716         cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
1717         an object was deserialized in a world with elevated privileges we also check the cached value is from the same
1718         world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
1719         that determines whether a JSObject originated in the current world.
1720
1721         * CMakeLists.txt:
1722         * WebCore.xcodeproj/project.pbxproj:
1723         * bindings/js/DOMWrapperWorld.h:
1724         (WebCore::worldForDOMObject):
1725         * bindings/js/JSBindingsAllInOne.cpp:
1726         * bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
1727         (WebCore::JSCustomEvent::detail):
1728         * bindings/js/JSMessageEventCustom.cpp:
1729         (WebCore::JSMessageEvent::data):
1730         * bindings/js/JSPopStateEventCustom.cpp:
1731         (WebCore::JSPopStateEvent::state):
1732         * dom/CustomEvent.cpp:
1733         (WebCore::CustomEvent::initCustomEvent):
1734         (WebCore::CustomEvent::trySerializeDetail):
1735         * dom/CustomEvent.h:
1736         * dom/CustomEvent.idl:
1737         * dom/MessageEvent.cpp:
1738         (WebCore::MessageEvent::initMessageEvent):
1739         (WebCore::MessageEvent::trySerializeData):
1740         * dom/MessageEvent.h:
1741         * dom/PopStateEvent.cpp:
1742         (WebCore::PopStateEvent::trySerializeState):
1743         * dom/PopStateEvent.h:
1744         * testing/Internals.cpp:
1745         (WebCore::Internals::isFromCurrentWorld):
1746         * testing/Internals.h:
1747         * testing/Internals.idl:
1748
1749 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1750
1751         [GTK] Cleanup PasteboardHelper
1752         https://bugs.webkit.org/show_bug.cgi?id=147035
1753
1754         Reviewed by Žan Doberšek.
1755
1756         It's actually a singleton, but the API suggests you can create
1757         your own or use the default one, but the default one should be the
1758         only one. Rename PasteboardHelper::defaultPasteboardHelper() as
1759         PasteboardHelper::singleton() and make it non-copyable and never
1760         destroyed.
1761
1762         * platform/gtk/PasteboardGtk.cpp:
1763         (WebCore::Pasteboard::writePlainText): Use PasteboardHelper::singleton().
1764         (WebCore::Pasteboard::write): Ditto.
1765         (WebCore::Pasteboard::writePasteboard): Ditto.
1766         (WebCore::Pasteboard::clear): Ditto.
1767         (WebCore::Pasteboard::canSmartReplace): Ditto.
1768         (WebCore::Pasteboard::read): Ditto.
1769         (WebCore::Pasteboard::hasData): Ditto.
1770         (WebCore::Pasteboard::types): Ditto.
1771         (WebCore::Pasteboard::readString): Ditto.
1772         (WebCore::Pasteboard::readFilenames): Ditto.
1773         * platform/gtk/PasteboardHelper.cpp:
1774         (WebCore::PasteboardHelper::singleton): Renamed as singleton, also
1775         use NeverDestroyed and return a reference instead of a pointer.
1776         (WebCore::PasteboardHelper::PasteboardHelper): Do all
1777         initializations here and remove the initialization static flag,
1778         since this is a real singleton now. Also use
1779         gdk_atom_intern_static_string() to initialize the atoms instead of
1780         gdk_atom_intern().
1781         (WebCore::PasteboardHelper::targetList):
1782         (WebCore::PasteboardHelper::targetListForDataObject):
1783         (WebCore::getClipboardContentsCallback):
1784         * platform/gtk/PasteboardHelper.h:
1785
1786 2015-07-16  Matt Rajca  <mrajca@apple.com>
1787
1788         Media Session: handle 'Transient' and 'Transient Solo' interruption events
1789         https://bugs.webkit.org/show_bug.cgi?id=146840
1790
1791         Reviewed by Eric Carlson.
1792
1793         * Modules/mediasession/MediaSession.cpp:
1794         (WebCore::MediaSession::handleDuckInterruption): Added stub.
1795         (WebCore::MediaSession::handleUnduckInterruption): Added stub.
1796         (WebCore::MediaSession::handlePauseInterruption): Pause active media elements. We use our helper method to do this
1797           "safely" since pausing a media element can change the collection we're iterating.
1798         (WebCore::MediaSession::handleUnpauseInterruption): Unpause active media elements. We use our helper method to do this
1799           "safely" since unpausing a media element can change the collection we're iterating.
1800         (WebCore::MediaSession::togglePlayback): Factored out "safe" iteration into a helper method elsewhere.
1801         (WebCore::MediaSession::safelyIterateActiveMediaElements): Safely iterate through the collection of active media
1802           elements.
1803         * Modules/mediasession/MediaSession.h:
1804         * Modules/mediasession/MediaSessionManager.cpp:
1805         (WebCore::MediaSessionManager::MediaSessionManager): On Mac, register for platform-specific interruptions.
1806         (WebCore::MediaSessionManager::didReceiveStartOfInterruptionNotification): Implemented section 4.5.2 of Media Session spec.
1807         (WebCore::MediaSessionManager::didReceiveEndOfInterruptionNotification): Ditto.
1808         * Modules/mediasession/MediaSessionManager.h:
1809
1810 2015-07-16  Matt Rajca  <mrajca@apple.com>
1811
1812         Media Session: add support for platform-specific interruption providers
1813         https://bugs.webkit.org/show_bug.cgi?id=147008
1814
1815         Reviewed by Eric Carlson.
1816
1817         * WebCore.xcodeproj/project.pbxproj: Include new source files.
1818         * platform/mediasession/MediaSessionInterruptionProvider.cpp: Added base class to be used by MediaSessionManager
1819           to listen for interruption notifications.
1820         (WebCore::MediaSessionInterruptionProvider::MediaSessionInterruptionProvider): Begin listening for interruptions
1821           upon construction.
1822         (WebCore::MediaSessionInterruptionProvider::~MediaSessionInterruptionProvider): Stop listening for interruptions
1823           before destruction.
1824         (WebCore::MediaSessionInterruptionProvider::beginListeningForInterruptions): To be overridden by subclasses.
1825         (WebCore::MediaSessionInterruptionProvider::stopListeningForInterruptions): To be overridden by subclasses.
1826         * platform/mediasession/MediaSessionInterruptionProvider.h: Added.
1827         (WebCore::MediaSessionInterruptionProviderClient::~MediaSessionInterruptionProviderClient):
1828         (WebCore::MediaSessionInterruptionProvider::client):
1829         * platform/mediasession/mac/MediaSessionInterruptionProviderMac.h: Added for providing Mac-specific interruptions.
1830         (WebCore::MediaSessionInterruptionProviderMac::~MediaSessionInterruptionProviderMac):
1831         * platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm: Added stubs.
1832         (WebCore::MediaSessionInterruptionProviderMac::beginListeningForInterruptions):
1833         (WebCore::MediaSessionInterruptionProviderMac::stopListeningForInterruptions):
1834
1835 2015-07-16  Tim Horton  <timothy_horton@apple.com>
1836
1837         Add shrink-wrapped link highlights
1838         https://bugs.webkit.org/show_bug.cgi?id=147021
1839         <rdar://problem/21643094>
1840
1841         Reviewed by Enrica Casucci.
1842
1843         * WebCore.xcodeproj/project.pbxproj:
1844         * page/TextIndicator.cpp:
1845         (WebCore::TextIndicator::createWithRange):
1846         (WebCore::TextIndicator::createWithSelectionInFrame):
1847         * page/TextIndicator.h:
1848         Add a margin parameter to TextIndicator; this inflates each text rect
1849         by the given amount.
1850
1851         Use snapshotFrameRect instead of snapshotSelection because we really
1852         want an image that exactly fits textBoundingRectInDocumentCoordinates,
1853         and snapshotSelection comes up with selection rects in different ways,
1854         especially on iOS (where it comes up with nothing!).
1855
1856         For now, avoid forcing black text or painting only the selection on iOS.
1857         Eventually, we should have TextIndicator options for these things that
1858         are then respected at the presentation layer.
1859
1860 2015-07-16  Matt Rajca  <mrajca@apple.com>
1861
1862         Media Session: remove plumbing for delivering start/end-of-interruption events
1863         https://bugs.webkit.org/show_bug.cgi?id=147005
1864
1865         Reviewed by Eric Carlson.
1866
1867         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
1868         so the same behavior is available to all clients.
1869
1870         * Modules/mediasession/MediaSessionEvents.h:
1871         * page/Page.cpp:
1872         * page/Page.h:
1873
1874 2015-07-16  Alex Christensen  <achristensen@webkit.org>
1875
1876         [Content Extensions] Cache domain actions
1877         https://bugs.webkit.org/show_bug.cgi?id=146817
1878
1879         Reviewed by Benjamin Poulain.
1880
1881         Right now we run regular expressions on the domain every time we have any rules that match with if-domain or unless-domain.  
1882         This caches the results of running regular expressions on the domain of the main document's url so we only need to 
1883         run those regular expressions when the main document changes domain.  We also spend less time adding unused actions into HashSets.
1884
1885         All behavior is covered by existing api tests, but I added some to explicitly test if-domain and unless-domain with multiple load types.
1886
1887         * contentextensions/ContentExtension.cpp:
1888         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1889         (WebCore::ContentExtensions::ContentExtension::cachedDomainActions):
1890         * contentextensions/ContentExtension.h:
1891         (WebCore::ContentExtensions::ContentExtension::identifier):
1892         (WebCore::ContentExtensions::ContentExtension::compiledExtension):
1893         * contentextensions/ContentExtensionsBackend.cpp:
1894         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1895         * contentextensions/DFABytecodeInterpreter.cpp:
1896         (WebCore::ContentExtensions::getJumpDistance):
1897         (WebCore::ContentExtensions::matchesDomain):
1898         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1899         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1900         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsForDefaultStylesheetFromDFARoot):
1901         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretWithDomains):
1902         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1903         * contentextensions/DFABytecodeInterpreter.h:
1904
1905 2015-07-16  Simon Fraser  <simon.fraser@apple.com>
1906
1907         Fix disappearing position:fixed elements in fixed layout mode
1908         https://bugs.webkit.org/show_bug.cgi?id=147019
1909
1910         Reviewed by Tim Horton.
1911
1912         Test: compositing/fixed-with-fixed-layout.html
1913         
1914         When in fixed layout mode, and being scaled down, viewportConstrainedVisibleContentRect() is
1915         the wrong thing to use to determine if position:fixed elements are clipped out. In this case,
1916         use the simpler document bounds (before scaling).
1917         
1918         In the long term,  there needs to be an equivalent of viewportConstrainedVisibleContentRect()
1919         that gives an appropriate rect that can be used here.
1920
1921         * rendering/RenderLayerCompositor.cpp:
1922         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
1923
1924 2015-07-16  Benjamin Poulain  <bpoulain@apple.com>
1925
1926         [Content extensions] Combine suffixes when generating NFAs
1927         https://bugs.webkit.org/show_bug.cgi?id=146961
1928
1929         Reviewed by Alex Christensen.
1930
1931         In this patch, I add a mechanism very similar to the prefix tree
1932         but for the suffix (called a reverse suffix tree here).
1933
1934         The idea is here is to reuse the existing NFA nodes when generating
1935         a chain of suffix Term that were already generated previously.
1936         When generating a disjunction ending with the same suffix, we now
1937         have the same trailing NFA nodes for both sides of the disjunction.
1938
1939         Mixing the prefix and suffix generation can be tricky, we do not want
1940         transitions from a pattern to creep into the suffix of an other.
1941
1942         To avoid any conflict, the rules here are very simple:
1943         -Only use the reverse suffix tree for terms without actions
1944          up to a leaf term with actions.
1945
1946          This rule ensure that no action will accidentally make its way
1947          to an other rule by resuing a vertex of the reverse suffix tree.
1948
1949         -Only use the reverse suffix tree for chains of terms in which
1950          each term only has zero or one following term.
1951
1952          With this condition, when taking any vertex of the reverse suffix
1953          tree, there is only one edge that move out of that vertex when reading
1954          from left to right.
1955          For any vertex, there is only one possible string generated
1956          left-to-right, a single suffix.
1957
1958         This is overly restrictive but it is fast, easier to verify, and it works
1959         well in practice.
1960         For all the more complicated cases, we can count on the Minimizer to
1961         find a better solution.
1962
1963
1964         With all the simple suffixes merged, our NFAs are smaller, which
1965         let us combine more patterns.
1966         The DFAs are also smaller and faster to produce since their size
1967         is relative to the NFA sizes.
1968
1969         Overall, I get the following gains:
1970         -Chris's test case:
1971             compile time -40%.
1972             bytecode size -14%.
1973         -Armand's test case:
1974             compile time -53%.
1975             bytecode size -13%.
1976
1977         * WebCore.xcodeproj/project.pbxproj:
1978         * contentextensions/CombinedURLFilters.cpp:
1979         (WebCore::ContentExtensions::ActiveSubtree::ActiveSubtree):
1980         (WebCore::ContentExtensions::generateInfixUnsuitableForReverseSuffixTree):
1981         (WebCore::ContentExtensions::generateSuffixWithReverseSuffixTree):
1982         (WebCore::ContentExtensions::clearReverseSuffixTree):
1983         (WebCore::ContentExtensions::generateNFAForSubtree):
1984         * contentextensions/DFA.cpp:
1985         (WebCore::ContentExtensions::DFA::debugPrintDot):
1986         Forgot to close a tag, dot was not happy.
1987
1988         * contentextensions/HashableActionList.h: Added.
1989         (WebCore::ContentExtensions::HashableActionList::HashableActionList):
1990         (WebCore::ContentExtensions::HashableActionList::isEmptyValue):
1991         (WebCore::ContentExtensions::HashableActionList::isDeletedValue):
1992         (WebCore::ContentExtensions::HashableActionList::operator==):
1993         (WebCore::ContentExtensions::HashableActionList::operator!=):
1994         (WebCore::ContentExtensions::HashableActionListHash::hash):
1995         (WebCore::ContentExtensions::HashableActionListHash::equal):
1996         We need a way to group reverse suffix tree by their terminal actions.
1997         This new hash structure lets us find unique vertex for a list of actions
1998         in any order.
1999
2000         * contentextensions/ImmutableNFANodeBuilder.h:
2001         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::isValid):
2002         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::nodeId):
2003         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addTransition):
2004         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::addEpsilonTransition):
2005         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::ImmutableNFANodeBuilder): Deleted.
2006         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::~ImmutableNFANodeBuilder): Deleted.
2007         (WebCore::ContentExtensions::ImmutableNFANodeBuilder::operator=): Deleted.
2008         * contentextensions/Term.h:
2009         (WebCore::ContentExtensions::Term::generateGraph):
2010         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
2011         Node building changes a bit.
2012
2013         Previously, it was assumed nodes are always built from left to right.
2014         Getting the node on the right was done by providing the left node and the term
2015         doing the transition.
2016
2017         Now we have both left to right and right to left generation.
2018
2019         The right-to-left has a specific property: no edge can be added after
2020         it's initial term (rule 2 of our reverse suffix tree). This simplifies
2021         things a bit since we can finalize all the nodes in the suffix tree.
2022         All we need is to keep their ID to be able to link new nodes
2023         to the reverse suffix tree.
2024
2025 2015-07-16  Brady Eidson  <beidson@apple.com>
2026
2027         Rolling out part of r186895 until rdar://problem/21861167 is resolved.
2028         https://bugs.webkit.org/show_bug.cgi?id=146976
2029
2030         * platform/network/cf/CookieJarCFNet.cpp:
2031         (WebCore::createCookies): Don’t use this new SPI quite yet.
2032
2033 2015-07-16  Filip Pizlo  <fpizlo@apple.com>
2034
2035         Unreviewed, roll out http://trac.webkit.org/changeset/186903. It broke the build.
2036
2037         * CMakeLists.txt:
2038         * WebCore.xcodeproj/project.pbxproj:
2039         * bindings/js/DOMWrapperWorld.h:
2040         (WebCore::currentWorld):
2041         (WebCore::worldForDOMObject): Deleted.
2042         * bindings/js/JSBindingsAllInOne.cpp:
2043         * bindings/js/JSCustomEventCustom.cpp:
2044         (WebCore::JSCustomEvent::detail): Deleted.
2045         * bindings/js/JSMessageEventCustom.cpp:
2046         (WebCore::JSMessageEvent::data):
2047         * bindings/js/JSPopStateEventCustom.cpp:
2048         (WebCore::JSPopStateEvent::state):
2049         * dom/CustomEvent.cpp:
2050         (WebCore::CustomEvent::initCustomEvent):
2051         (WebCore::CustomEvent::eventInterface):
2052         (WebCore::CustomEvent::trySerializeDetail): Deleted.
2053         * dom/CustomEvent.h:
2054         * dom/CustomEvent.idl:
2055         * dom/MessageEvent.cpp:
2056         (WebCore::MessageEvent::initMessageEvent):
2057         (WebCore::MessageEvent::data):
2058         (WebCore::MessageEvent::trySerializeData): Deleted.
2059         * dom/MessageEvent.h:
2060         * dom/PopStateEvent.cpp:
2061         (WebCore::PopStateEvent::create):
2062         (WebCore::PopStateEvent::eventInterface):
2063         (WebCore::PopStateEvent::trySerializeState): Deleted.
2064         * dom/PopStateEvent.h:
2065         * testing/Internals.cpp:
2066         (WebCore::Internals::deserializeBuffer):
2067         (WebCore::Internals::setUsesOverlayScrollbars):
2068         (WebCore::Internals::isFromCurrentWorld): Deleted.
2069         * testing/Internals.h:
2070         * testing/Internals.idl:
2071
2072 2015-07-16  Keith Miller  <keith_miller@apple.com>
2073
2074         Remove leak of objects between isolated worlds on custom events, message events, and pop state events.
2075         https://bugs.webkit.org/show_bug.cgi?id=118884
2076
2077         Reviewed by Filip Pizlo.
2078
2079         Tests: fast/events/event-leak-objects.html
2080                fast/events/event-properties-gc.html
2081
2082         Fixes an issue where objects passed as certain properties of events could cross isolated worlds. This
2083         was fixed by checking that any object passed by an event must be serializable or originate from the same
2084         isolated world as the one it is currently being accessed in. In the case of MessageEvents and PopStateEvents we
2085         cache the values of the data and state properties, respectively, as they may be a deserialized object. In case
2086         an object was deserialized in a world with elevated privileges we also check the cached value is from the same
2087         world, if it is from a different world we recompute it. For testing purposes, I added a new function to Internals
2088         that determines whether a JSObject originated in the current world.
2089
2090         * CMakeLists.txt:
2091         * WebCore.xcodeproj/project.pbxproj:
2092         * bindings/js/DOMWrapperWorld.h:
2093         (WebCore::worldForDOMObject):
2094         * bindings/js/JSBindingsAllInOne.cpp:
2095         * bindings/js/JSCustomEventCustom.cpp: Copied from Source/WebCore/dom/CustomEvent.cpp.
2096         (WebCore::JSCustomEvent::detail):
2097         * bindings/js/JSMessageEventCustom.cpp:
2098         (WebCore::JSMessageEvent::data):
2099         * bindings/js/JSPopStateEventCustom.cpp:
2100         (WebCore::JSPopStateEvent::state):
2101         * dom/CustomEvent.cpp:
2102         (WebCore::CustomEvent::initCustomEvent):
2103         (WebCore::CustomEvent::trySerializeDetail):
2104         * dom/CustomEvent.h:
2105         * dom/CustomEvent.idl:
2106         * dom/MessageEvent.cpp:
2107         (WebCore::MessageEvent::initMessageEvent):
2108         (WebCore::MessageEvent::trySerializeData):
2109         * dom/MessageEvent.h:
2110         * dom/PopStateEvent.cpp:
2111         (WebCore::PopStateEvent::trySerializeState):
2112         * dom/PopStateEvent.h:
2113         * testing/Internals.cpp:
2114         (WebCore::Internals::isFromCurrentWorld):
2115         * testing/Internals.h:
2116         * testing/Internals.idl:
2117
2118 2015-07-16  Brady Eidson  <beidson@apple.com>
2119
2120         WebKit document.cookie mis-parsing.
2121         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
2122
2123         Reviewed by Sam Weinig.
2124
2125         * platform/network/cf/CookieJarCFNet.cpp:
2126         (WebCore::createCookies): Use new SPI if available.
2127         (WebCore::setCookiesFromDOM):
2128         * platform/spi/cf/CFNetworkSPI.h:
2129
2130 2015-07-15  Anders Carlsson  <andersca@apple.com>
2131
2132         Headers that use WEBCORE_EXPORT should include PlatformExportMacros.h
2133         https://bugs.webkit.org/show_bug.cgi?id=146984
2134
2135         Reviewed by Daniel Bates.
2136
2137         * contentextensions/DFA.h:
2138         * dom/ContextDestructionObserver.h:
2139         * dom/DeviceOrientationData.h:
2140         * dom/ExceptionCodePlaceholder.h:
2141         * editing/cocoa/HTMLConverter.h:
2142         * html/track/AudioTrack.h:
2143         * loader/FrameLoaderStateMachine.h:
2144         * loader/appcache/ApplicationCacheHost.h:
2145         * loader/cache/CachedResourceHandle.h:
2146         * platform/URL.h:
2147         * platform/animation/Animation.h:
2148         * platform/audio/AudioHardwareListener.h:
2149         * platform/audio/AudioSession.h:
2150         * platform/graphics/transforms/AffineTransform.h:
2151         * platform/network/Credential.h:
2152         * platform/network/CredentialBase.h:
2153         * platform/network/ResourceHandleClient.h:
2154         * platform/network/mac/AuthenticationMac.h:
2155
2156 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
2157
2158         Web Inspector: update $$() to return an Array
2159         https://bugs.webkit.org/show_bug.cgi?id=146964
2160
2161         Reviewed by Brian Burg.
2162
2163         Test: inspector/console/command-line-api.html
2164
2165         * inspector/CommandLineAPIModuleSource.js:
2166         Update $$(...) to return an array.
2167         Also InjectedScriptHost.type was renamed to subtype
2168         a while ago.
2169
2170 2015-07-15  Tim Horton  <timothy_horton@apple.com>
2171
2172         Move indicator rect uniting code to TextIndicatorWindow instead of TextIndicator
2173         https://bugs.webkit.org/show_bug.cgi?id=146992
2174         <rdar://problem/21643094>
2175
2176         Reviewed by Daniel Bates.
2177
2178         Having to unite all the rects if any overlap is an implementation
2179         detail of the Mac TextIndicatorWindow presentation, not a fundamental
2180         property of TextIndicator.
2181
2182         Other TextIndicator presentations might be able to handle overlapping
2183         rects more effectively, so we shouldn't lose information unless we need to.
2184
2185         This also avoids having a second copy of some constants!
2186
2187         * page/TextIndicator.cpp:
2188         (WebCore::outsetIndicatorRectIncludingShadow): Deleted.
2189         (WebCore::textIndicatorsForTextRectsOverlap): Deleted.
2190         (WebCore::TextIndicator::TextIndicator): Deleted.
2191         * page/mac/TextIndicatorWindow.mm:
2192         (outsetIndicatorRectIncludingShadow):
2193         (textIndicatorsForTextRectsOverlap):
2194         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
2195
2196 2015-07-15  Ryuan Choi  <ryuan.choi@navercorp.com>
2197
2198         [CoordinatedGraphics] Remove setContentsScale from TiledBackingStore
2199         https://bugs.webkit.org/show_bug.cgi?id=146921
2200
2201         Reviewed by Gyuyoung Kim.
2202
2203         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2204         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
2205         (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2206         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2207         (WebCore::TiledBackingStore::TiledBackingStore):
2208         (WebCore::TiledBackingStore::setContentsScale): Deleted.
2209         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2210
2211 2015-07-15  Sam Weinig  <sam@webkit.org>
2212
2213         Color match plug-ins
2214         <rdar://problem/21758722>
2215         https://bugs.webkit.org/show_bug.cgi?id=146987
2216
2217         Reviewed by Dean Jackson.
2218
2219         * platform/spi/cocoa/QuartzCoreSPI.h:
2220         Add colorMatchUntaggedContent property.
2221
2222 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
2223
2224         [Win] Another build fix after r186858.
2225
2226         * html/canvas/DOMPath.h: Don't use WEBCORE_EXPORT on the
2227         overall class and the destructor declaration.
2228
2229 2015-07-15  Dean Jackson  <dino@apple.com>
2230
2231         Tag WebGL layers with sRGB colorspace
2232         https://bugs.webkit.org/show_bug.cgi?id=146986
2233         <rdar://problem/21758704>
2234
2235         Fix the build on older El Capitan releases.
2236
2237         * platform/graphics/mac/WebGLLayer.mm:
2238         (-[WebGLLayer initWithGraphicsContext3D:]):
2239         * platform/spi/cocoa/QuartzCoreSPI.h:
2240
2241 2015-07-15  Dean Jackson  <dino@apple.com>
2242
2243         Tag WebGL layers with sRGB colorspace
2244         https://bugs.webkit.org/show_bug.cgi?id=146986
2245         <rdar://problem/21758704>
2246
2247         Reviewed by Simon Fraser.
2248
2249         Label a CAOpenGLLayer as using the sRGB colorspace,
2250         like the rest of our page content.
2251
2252         Test: fast/canvas/webgl/match-page-color-space.html
2253
2254         * platform/graphics/mac/WebGLLayer.mm:
2255         (-[WebGLLayer initWithGraphicsContext3D:]): Set the colorspace property on the layer.
2256         (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]):
2257         (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
2258         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
2259
2260 2015-07-15  Brent Fulgham  <bfulgham@apple.com>
2261
2262         [Win] Unreviewed build fix after r186858.
2263
2264         Add missing DOMPath and PathUtilities files to project.
2265
2266         * WebCore.vcxproj/WebCore.vcxproj:
2267         * WebCore.vcxproj/WebCore.vcxproj.filters:
2268
2269 2015-07-15  Anders Carlsson  <andersca@apple.com>
2270
2271         Headers that look for NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES should import NSGeometry.h
2272         https://bugs.webkit.org/show_bug.cgi?id=146982
2273
2274         Reviewed by Tim Horton.
2275
2276         * platform/graphics/FloatPoint.h:
2277         * platform/graphics/IntPoint.h:
2278         * platform/graphics/IntSize.h:
2279
2280 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2281
2282         Scroll snapping to elements is broken for main frame scrolling
2283         https://bugs.webkit.org/show_bug.cgi?id=146957
2284
2285         Reviewed by Brent Fulgham.
2286
2287         Fixes the case of elements with scroll snap coordinates in a scroll snapping mainframe by changing
2288         RenderBox::findEnclosingScrollableContainer to return the body's RenderBox when all enclosing elements
2289         are not overflow scrollable but the mainframe can scroll.
2290
2291         Test: css3/scroll-snap/scroll-snap-coordinate-mainframe.html
2292
2293         * page/FrameView.h: Export isScrollable so that the Internals API can use it.
2294         * rendering/RenderBox.cpp: Include MainFrame.h.
2295         (WebCore::RenderBox::findEnclosingScrollableContainer): Changed to return the body's RenderBox if
2296             none of its parent elements are overflow scrolling.
2297         * testing/Internals.cpp:
2298         (WebCore::Internals::scrollSnapOffsets): Updated to return snap offsets for the body element,
2299             allowing us to call window.internals.scrollSnapOffsets(document.body).
2300
2301 2015-07-15  Brady Eidson  <beidson@apple.com>
2302
2303         WebKit document.cookie mis-parsing.
2304         rdar://problem/21715050 and https://bugs.webkit.org/show_bug.cgi?id=146976
2305
2306         Reviewed by Sam Weinig.
2307
2308         * platform/network/mac/CookieJarMac.mm:
2309         (WebCore::setCookiesFromDOM): Use new CFNetwork SPI when available.
2310
2311 2015-07-15  Jinyoung Hur  <hur.ims@navercorp.com>
2312
2313         [WinCairo] font fallback not working
2314         https://bugs.webkit.org/show_bug.cgi?id=146595
2315
2316         Reviewed by Myles C. Maxfield.
2317
2318         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.
2319
2320         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.
2321
2322         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
2323         (WebCore::GlyphPage::fill):
2324
2325 2015-07-15  Tim Horton  <timothy_horton@apple.com>
2326
2327         Factor rect shrink-wrapping code out of RenderThemeMac for future reuse
2328         https://bugs.webkit.org/show_bug.cgi?id=146973
2329         <rdar://problem/21643094>
2330
2331         Reviewed by Anders Carlsson.
2332
2333         Test: fast/shrink-wrap/rect-shrink-wrap.html
2334
2335         * WebCore.xcodeproj/project.pbxproj:
2336         Add DOMPath.cpp and PathUtilities.{h, cpp}.
2337
2338         * bindings/js/JSDOMBinding.h:
2339         (WebCore::NativeValueTraits<double>::nativeValue):
2340         Make it possible to use sequence<double> in IDL files.
2341
2342         * bindings/scripts/CodeGeneratorJS.pm:
2343         Export JSDOMPath for use in Internals.
2344
2345         * html/canvas/DOMPath.cpp: Added.
2346         (WebCore::DOMPath::~DOMPath):
2347         * html/canvas/DOMPath.h:
2348         Out-of-line the DOMPath destructor so as not to anger the bindings
2349         integrity checker (otherwise, the address of the DOMPath destructor
2350         is different in WebCoreTestSupport and WebCore, causing us to fail
2351         the vtable equality test).
2352
2353         * platform/graphics/Path.h:
2354         Forward declare FloatRect instead of including it unnecessarily.
2355         Export ensurePlatformPath().
2356
2357         * platform/graphics/PathUtilities.cpp: Added.
2358         (WebCore::addShrinkWrapRightCorner):
2359         (WebCore::addShrinkWrapLeftCorner):
2360         (WebCore::addShrinkWrappedPathForRects):
2361         These parts are extracted from RenderThemeMac, with two changes:
2362             + support for arbitrarily-aligned rects
2363               (the other version assumed they were horizontally center-aligned)
2364             + support for overlapping rects
2365               (the other version assumed they touched but did not overlap)
2366
2367         There are still things missing:
2368             + support for a fallback when the shape is too hard to shrink-wrap
2369
2370         And things broken:
2371             + if the distance between two edges is smaller than the corner radius,
2372               we'll end up with a sharp edge in the path
2373
2374         Both of these cases are covered in the layout test and can be improved.
2375
2376         (WebCore::rectsIntersectOrTouch):
2377         Rect intersection with <= instead of <.
2378
2379         (WebCore::contiguousRectGroupsFromRects):
2380         Given a set of rects, find all of the contiguous regions. We'll
2381         shrink-wrap each region independently.
2382
2383         (WebCore::PathUtilities::pathWithShrinkWrappedRects):
2384         * platform/graphics/PathUtilities.h: Added.
2385         Add PathUtilities, where the shrink-wrapping code lives.
2386
2387         * rendering/RenderThemeMac.mm:
2388         (WebCore::paintAttachmentTitleBackground):
2389         (WebCore::addAttachmentTitleBackgroundRightCorner): Deleted.
2390         (WebCore::addAttachmentTitleBackgroundLeftCorner): Deleted.
2391         Remove shrink-wrapping implementation and make use of the one in PathUtilities.
2392
2393         * testing/Internals.cpp:
2394         (WebCore::Internals::pathWithShrinkWrappedRects):
2395         * testing/Internals.h:
2396         * testing/Internals.idl:
2397         Expose pathWithShrinkWrappedRects to tests via Internals.
2398         It takes a sequence<double> where every four values are the x, y, w, h
2399         of a rect, and returns a DOMPath which can be used with Canvas.
2400
2401 2015-07-15  Enrica Casucci  <enrica@apple.com>
2402
2403         [iOS] Should look for RTF and RTFD pasteboard types before plain text.
2404         https://bugs.webkit.org/show_bug.cgi?id=146971
2405         rdar://problem/21840845
2406
2407         Reviewed by Sam Weinig.
2408
2409         The list of pasteboard types returned by supportedPasteboardTypes
2410         determines the order in which WebKit looks for data in the pasteboard
2411         to create a fragment. The incorrect order could make plain text to
2412         be preferred over rich format.
2413
2414         * platform/ios/PasteboardIOS.mm:
2415         (WebCore::Pasteboard::supportedPasteboardTypes):
2416
2417 2015-07-15  Anders Carlsson  <andersca@apple.com>
2418
2419         Private headers that include project headers should also be project headers
2420         https://bugs.webkit.org/show_bug.cgi?id=146974
2421
2422         Reviewed by Dan Bernstein.
2423
2424         Since these headers can't be included by WebKit anyway they shouldn't be installed.
2425
2426         * WebCore.xcodeproj/project.pbxproj:
2427
2428 2015-07-15  Eric Carlson  <eric.carlson@apple.com>
2429
2430         [Mac] AirPlay route is not always set automatically
2431         https://bugs.webkit.org/show_bug.cgi?id=146969
2432
2433         Reviewed by Jer Noble.
2434
2435         * Modules/mediasession/WebMediaSessionManager.cpp:
2436         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Return early if there are
2437           no clients. Make the first client in the vector automatically play to the target if there
2438           is no other match and there is an active route.
2439         (WebCore::WebMediaSessionManager::watchdogTimerFired): Call picker.invalidatePlaybackTargets,
2440           not stopMonitoringPlaybackTargets.
2441
2442         * platform/graphics/MediaPlaybackTargetPicker.cpp:
2443         (WebCore::MediaPlaybackTargetPicker::invalidatePlaybackTargets): New.
2444         * platform/graphics/MediaPlaybackTargetPicker.h:
2445
2446         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2447         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2448         (WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets): Do nothing, AirPlay
2449           automatically stops monitoring when appropriate and release the picker also releases
2450           the output context, which drops the route.
2451         (WebCore::MediaPlaybackTargetPickerMac::invalidatePlaybackTargets): New.
2452
2453 2015-07-15  Anders Carlsson  <andersca@apple.com>
2454
2455         Remove forwarding headers that no longer point to valid headers
2456         https://bugs.webkit.org/show_bug.cgi?id=146972
2457
2458         Reviewed by Tim Horton.
2459
2460         * ForwardingHeaders/heap/AllocationSpace.h: Removed.
2461         * ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Removed.
2462         * ForwardingHeaders/runtime/PrototypeFunction.h: Removed.
2463         * ForwardingHeaders/runtime/StorageBarrier.h: Removed.
2464         * ForwardingHeaders/runtime/TypedArrayBase.h: Removed.
2465
2466 2015-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2467
2468         Negative scroll snap repeat values cause web process to hang indefinitely
2469         https://bugs.webkit.org/show_bug.cgi?id=146953
2470         <rdar://problem/21823681>
2471
2472         Reviewed by Simon Fraser.
2473
2474         Fixed dangerous behavior caused by setting -scroll-snap-points-x or -y to negative or very small
2475         positive values. In the case of negative or 0 repeats, the web process would hang indefinitely. In
2476         the case of very small positive values, a massive amount of memory could potentially be allocated
2477         just to store snap offsets.
2478
2479         Tests: css3/scroll-snap/scroll-snap-negative-repeat.html
2480                css3/scroll-snap/scroll-snap-subpixel-repeat.html
2481
2482         * css/CSSParser.cpp:
2483         (WebCore::CSSParser::parseNonElementSnapPoints): Changed to consider negative snap repeat values as invalid CSS.
2484         * page/scrolling/AxisScrollSnapOffsets.cpp:
2485         (WebCore::updateFromStyle): Changed to threshold non-negative snap repeat values to 1px.
2486
2487 2015-07-14  Dean Jackson  <dino@apple.com>
2488
2489         Placeholder colors should be system grays
2490         https://bugs.webkit.org/show_bug.cgi?id=146955
2491         <rdar://problem/21774358>
2492
2493         Reviewed by Sam Weinig.
2494
2495         Update the PiP and Airplay placards to use the correct shades
2496         of gray.
2497
2498         * Modules/mediacontrols/mediaControlsApple.css: No need to specify the
2499         font here, nor have rules for Picture in Picture, which isn't available
2500         on OS X.
2501         (audio::-webkit-media-controls-time-remaining-display): We should specify
2502         font style here.
2503         (video:-webkit-full-screen::-webkit-media-controls-panel): Drive-by cleanup.
2504         (audio::-webkit-media-controls-wireless-playback-status): Use a gray background
2505         and system gray for text and artwork.
2506         (audio::-webkit-media-controls-wireless-playback-status.small): Ditto.
2507         (audio::-webkit-media-controls-picture-in-picture-button): Deleted (not on OS X).
2508         (audio::-webkit-media-controls-wireless-playback-text-top): Deleted use of background color.
2509         (audio::-webkit-media-controls-wireless-playback-text-bottom): Ditto..
2510
2511         * Modules/mediacontrols/mediaControlsiOS.css: Use a gray background
2512         and system gray for text and artwork.
2513         (audio::-webkit-media-controls-wireless-playback-status):
2514         (audio::-webkit-media-controls-wireless-playback-text-top):
2515         (audio::-webkit-media-controls-wireless-playback-status.picture-in-picture):
2516
2517 2015-07-14  Hunseop Jeong  <hs85.jeong@samsung.com>
2518
2519         [EFL] Scrollbar is not drawn on MiniBrowser.
2520         https://bugs.webkit.org/show_bug.cgi?id=143566
2521
2522         Reviewed by Gyuyoung Kim.
2523
2524         Implement the ScrollbarThemeEfl to draw the scrollbar on EFL port.
2525
2526         * PlatformEfl.cmake: Removed the ScrollbarEfl.cpp.
2527
2528         * platform/Scrollbar.cpp: Removed the !PLATFORM(EFL) guard to use the createNativeScrollbar().
2529
2530         * platform/efl/DefaultTheme/CMakeLists.txt: Replaced the image files with new ones.
2531
2532         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc:
2533         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Added.
2534         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Added.
2535         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png: Removed.
2536         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: Removed.
2537         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: Removed.
2538         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Added.
2539         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Added.
2540         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png: Removed.
2541         * platform/efl/RenderThemeEfl.cpp:
2542         (WebCore::toEdjeGroup):
2543         (WebCore::RenderThemeEfl::paintThemePart): Added the new function to draw the scrollbar
2544           using the RenderThemeEfl.
2545
2546         * platform/efl/RenderThemeEfl.h:
2547         * platform/efl/ScrollbarEfl.cpp: Removed.
2548         * platform/efl/ScrollbarEfl.h: Removed.
2549         * platform/efl/ScrollbarThemeEfl.cpp: Implemented the default functions to draw the
2550           scrollbar.
2551         (WebCore::scrollbarMap):
2552         (WebCore::ScrollbarThemeEfl::~ScrollbarThemeEfl):
2553         (WebCore::ScrollbarThemeEfl::scrollbarThickness):
2554         (WebCore::ScrollbarThemeEfl::hasThumb):
2555         (WebCore::ScrollbarThemeEfl::backButtonRect):
2556         (WebCore::ScrollbarThemeEfl::forwardButtonRect):
2557         (WebCore::ScrollbarThemeEfl::trackRect):
2558         (WebCore::ScrollbarThemeEfl::minimumThumbLength):
2559         (WebCore::ScrollbarThemeEfl::paintTrackBackground):
2560         (WebCore::ScrollbarThemeEfl::paintThumb):
2561         (WebCore::ScrollbarThemeEfl::registerScrollbar):
2562         (WebCore::ScrollbarThemeEfl::unregisterScrollbar):
2563         (WebCore::ScrollbarThemeEfl::loadThemeIfNeeded):
2564         * platform/efl/ScrollbarThemeEfl.h:
2565         (WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):
2566
2567 2015-07-14  Andreas Kling  <akling@apple.com>
2568
2569         Don't persist history item tree for subframes across reloads.
2570         <https://webkit.org/b/146937>
2571         <rdar://problem/19925709>
2572
2573         Reviewed by Brady Eidson.
2574
2575         Throw away the subframe history items when reloading a page. This ensures that we
2576         don't accumulate outdated frame metadata when subframes change name across page loads.
2577         Since the history item tree is encoded in the UA session state and gets serialized to
2578         disk, it's important that we don't let it grow unbounded.
2579
2580         * loader/HistoryController.cpp:
2581         (WebCore::HistoryController::updateForReload):
2582
2583 2015-07-14  Antti Koivisto  <antti@apple.com>
2584
2585         REGRESSION (r177876): store.apple.com profile and cart icons are missing
2586         https://bugs.webkit.org/show_bug.cgi?id=146894
2587
2588         Reviewed by Myles C. Maxfield.
2589
2590         If we had several @font-face rules for the same face covering overlapping ranges we
2591         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
2592         try the other ones.
2593
2594         Test: fast/css/font-face-multiple-missing-glyphs.html
2595
2596         * platform/graphics/FontCascadeFonts.cpp:
2597         (WebCore::FontCascadeFonts::glyphDataForVariant):
2598         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
2599
2600             Get GlyphData with one call.
2601
2602         * platform/graphics/FontRanges.cpp:
2603         (WebCore::FontRanges::~FontRanges):
2604         (WebCore::FontRanges::glyphDataForCharacter):
2605
2606             Check that we actually have a glyph in the font for the character before returning it.
2607
2608         (WebCore::FontRanges::fontForCharacter):
2609         (WebCore::FontRanges::fontForFirstRange):
2610         * platform/graphics/FontRanges.h:
2611         (WebCore::FontRanges::size):
2612         (WebCore::FontRanges::rangeAt):
2613
2614 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2615
2616         Fix the 32 bit build after r186817
2617         https://bugs.webkit.org/show_bug.cgi?id=146947
2618
2619         Changed CGRect to NSRect.
2620
2621         Reviewed by Simon Fraser.
2622
2623         * platform/mac/ThemeMac.mm:
2624         (WebCore::paintButton):
2625
2626 2015-07-14  Anders Carlsson  <andersca@apple.com>
2627
2628         Remove wkPopupMenu from WebCoreSystemInterface; it's not called from WebCore
2629         https://bugs.webkit.org/show_bug.cgi?id=146945
2630
2631         Reviewed by Tim Horton.
2632
2633         * platform/mac/WebCoreSystemInterface.h:
2634
2635 2015-07-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2636
2637         Input buttons rendered at the wrong size when pinching-to-zoom
2638         https://bugs.webkit.org/show_bug.cgi?id=146916
2639
2640         Reviewed by Dean Jackson.
2641
2642         Scales buttons and their focus rects up when pinching to zoom by painting to an offscreen ImageBuffer which is
2643         then scaled and painted onto the display.
2644
2645         * platform/Theme.h: Modified signature of Theme::paint.
2646         (WebCore::Theme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
2647         * platform/mac/ThemeMac.h: Modified signature of paintButton.
2648         * platform/mac/ThemeMac.mm: Added ImageBuffer.h header.
2649         (WebCore::buttonFocusRectOutlineWidth): Represents the width of the focus rect of a button. Used by paintButton
2650             to determine the size of the ImageBuffer required to draw a focus rect.
2651         (WebCore::paintButton): Changed to paint button cells and the focus rect, if applicable, to a temporary ImageBuffer
2652             before painting the ImageBuffer onto the view. Refactored to receive a deviceScaleFactor and page scale factor,
2653             used when painting to the ImageBuffer.
2654         (WebCore::ThemeMac::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
2655         * rendering/RenderTheme.cpp: Modified signature of RenderTheme::paint.
2656         (WebCore::RenderTheme::paint): Added plumbing necessary to send the device and page scale factors to paintButton.
2657
2658 2015-07-14  Commit Queue  <commit-queue@webkit.org>
2659
2660         Unreviewed, rolling out r186809.
2661         https://bugs.webkit.org/show_bug.cgi?id=146943
2662
2663         Caused about 190 layout test failures. (Requested by mlam_ on
2664         #webkit).
2665
2666         Reverted changeset:
2667
2668         "REGRESSION (r177876): store.apple.com profile and cart icons
2669         are missing"
2670         https://bugs.webkit.org/show_bug.cgi?id=146894
2671         http://trac.webkit.org/changeset/186809
2672
2673 2015-07-14  Antti Koivisto  <antti@apple.com>
2674
2675         REGRESSION (r177876): store.apple.com profile and cart icons are missing
2676         https://bugs.webkit.org/show_bug.cgi?id=146894
2677
2678         Reviewed by Myles C. Maxfield.
2679
2680         If we had several @font-face rules for the same face covering overlapping ranges we
2681         would only try to get glyphs from the first one. If it didn't have the glyph we wouldn't
2682         try the other ones.
2683
2684         Test: fast/css/font-face-multiple-missing-glyphs.html
2685
2686         * platform/graphics/FontCascadeFonts.cpp:
2687         (WebCore::FontCascadeFonts::glyphDataForVariant):
2688         (WebCore::FontCascadeFonts::glyphDataForNormalVariant):
2689
2690             Get GlyphData with one call.
2691
2692         * platform/graphics/FontRanges.cpp:
2693         (WebCore::FontRanges::~FontRanges):
2694         (WebCore::FontRanges::glyphDataForCharacter):
2695
2696             Check that we actually have a glyph in the font for the character before returning it.
2697
2698         (WebCore::FontRanges::fontForCharacter):
2699         (WebCore::FontRanges::fontForFirstRange):
2700         * platform/graphics/FontRanges.h:
2701         (WebCore::FontRanges::size):
2702         (WebCore::FontRanges::rangeAt):
2703
2704 2015-07-14  Alex Christensen  <achristensen@webkit.org>
2705
2706         [Content Extensions] Fix if-domain and unless-domain when loading main documents.
2707         https://bugs.webkit.org/show_bug.cgi?id=146868
2708
2709         Reviewed by Benjamin Poulain.
2710
2711         Tests: http/tests/contentextensions/block-everything-if-domain.html
2712                http/tests/contentextensions/block-everything-unless-domain-iframe.html
2713                http/tests/contentextensions/block-everything-unless-domain-redirect.php
2714                http/tests/contentextensions/block-everything-unless-domain.html
2715
2716         * contentextensions/ContentExtensionsBackend.cpp:
2717         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2718         If we are loading a new main document, use that main document url as the main document url for domain comparison.
2719
2720 2015-07-05  Sam Weinig  <sam@webkit.org>
2721
2722         DOM4: prepend, append, before, after & replace
2723         https://bugs.webkit.org/show_bug.cgi?id=74648
2724
2725         Reviewed by Darin Adler.
2726
2727         - Adds support for ChildNode.before/after/replaceWith and ParentNode.prepend/append
2728           which are new functions in https://dom.spec.whatwg.org
2729         - Uses custom bindings rather than implementing support for union types in the code
2730           generator as their uses seems isolated to just this spec at the moment. If more
2731           uses come along, we should implement proper support for them in the generator and
2732           remove the custom bindings added here.
2733
2734         Tests: fast/dom/ChildNode-after.html
2735                fast/dom/ChildNode-before.html
2736                fast/dom/ChildNode-replaceWith.html
2737                fast/dom/ParentNode-append.html
2738                fast/dom/ParentNode-prepend.html
2739
2740         * CMakeLists.txt:
2741         * WebCore.vcxproj/WebCore.vcxproj:
2742         * WebCore.xcodeproj/project.pbxproj:
2743         * bindings/js/JSBindingsAllInOne.cpp:
2744         Add new files.
2745
2746         * bindings/js/JSCharacterDataCustom.cpp: Added.
2747         (WebCore::JSCharacterData::before):
2748         (WebCore::JSCharacterData::after):
2749         (WebCore::JSCharacterData::replaceWith):
2750         * bindings/js/JSDocumentCustom.cpp:
2751         (WebCore::JSDocument::prepend):
2752         (WebCore::JSDocument::append):
2753         (WebCore::JSDocument::createTouchList):
2754         * bindings/js/JSDocumentFragmentCustom.cpp: Added.
2755         (WebCore::JSDocumentFragment::prepend):
2756         (WebCore::JSDocumentFragment::append):
2757         * bindings/js/JSDocumentTypeCustom.cpp: Added.
2758         (WebCore::JSDocumentType::before):
2759         (WebCore::JSDocumentType::after):
2760         (WebCore::JSDocumentType::replaceWith):
2761         * bindings/js/JSElementCustom.cpp:
2762         (WebCore::toJSNewlyCreated):
2763         (WebCore::JSElement::before):
2764         (WebCore::JSElement::after):
2765         (WebCore::JSElement::replaceWith):
2766         (WebCore::JSElement::prepend):
2767         (WebCore::JSElement::append):
2768         Add custom bindings to implement the use of variadic union types.
2769
2770         * bindings/js/JSNodeOrString.cpp: Added.
2771         (WebCore::toNodeOrStringVector):
2772         * bindings/js/JSNodeOrString.h: Added.
2773         Adds a help function for converting an JS argument list into a Vector
2774         of NodeOrString objects.
2775
2776         * dom/ChildNode.idl:
2777         Expose before/after/replaceWith to JavaScript.
2778
2779         * dom/ContainerNode.cpp:
2780         (WebCore::ContainerNode::append):
2781         (WebCore::ContainerNode::prepend):
2782         * dom/ContainerNode.h:
2783         Add implementations of append and prepend.
2784
2785         * dom/Node.h:
2786         * dom/Node.cpp:
2787         (WebCore::nodeSetPreTransformedFromNodeOrStringVector):
2788         (WebCore::firstPrecedingSiblingNotInNodeSet):
2789         (WebCore::firstFollowingSiblingNotInNodeSet):
2790         Helper functions for before, after and removeWith.
2791
2792         (WebCore::Node::before):
2793         (WebCore::Node::after):
2794         (WebCore::Node::replaceWith):
2795         Add implementations of before, after and removeWith.
2796
2797         * dom/NodeOrString.cpp: Added.
2798         (WebCore::convertNodesOrStringsIntoNode):
2799         * dom/NodeOrString.h: Added.
2800         (WebCore::NodeOrString::NodeOrString):
2801         (WebCore::NodeOrString::~NodeOrString):
2802         (WebCore::NodeOrString::type):
2803         (WebCore::NodeOrString::node):
2804         (WebCore::NodeOrString::string):
2805         Custom union type representing the (Node or DOMString) IDL type.
2806
2807         * dom/ParentNode.idl:
2808         Expose append/prepend to JavaScript.
2809
2810 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
2811
2812         [Win] Unreviewed build fix.
2813
2814         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2815         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Don't try to build
2816         the new Legible Output API features if they aren't available in the build
2817         environment.
2818
2819 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
2820
2821         [Win] Update Media Player logic for new Legible Output API
2822         https://bugs.webkit.org/show_bug.cgi?id=146922
2823         <rdar://problem/20542574>
2824
2825         Reviewed by Eric Carlson.
2826
2827         * AVFoundationSupport.py: Check for updated AVFCF feature.
2828         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2829         (WebCore::InbandTextTrackPrivateAVF::processNativeSamples): Update to call the
2830         new 'readNativeSampleBuffer' method.
2831         (WebCore::InbandTextTrackPrivateAVF::readNativeSampleBuffer): Added. This is a no-op
2832         on Windows if it has the new AVCF API. Otherwise, it contains the same implementation
2833         that has always been used in 'processNativeSamples'.
2834         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
2835         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2836         (WebCore::InbandTextTrackPrivateAVCF::readNativeSampleBuffer): Added. Use the new
2837         Legible Output API instead of the old CoreMedia solution if it is available.
2838         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
2839         (WebCore::InbandTextTrackPrivateAVCF::mediaSelectionOption):
2840         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
2841         (WebCore::InbandTextTrackPrivateLegacyAVCF::readNativeSampleBuffer): Add a stub implementation.
2842         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
2843         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2844         (WebCore::AVFWrapper::createPlayerItem): Use the new Legible Output API if it is available.
2845
2846 2015-07-13  Matt Rajca  <mrajca@apple.com>
2847
2848         Media Session: add plumbing for delivering start/end-of-interruption events
2849         https://bugs.webkit.org/show_bug.cgi?id=146837
2850
2851         Reviewed by Tim Horton.
2852
2853         * Modules/mediasession/MediaSessionEvents.h: Renamed from MediaEventTypes.h and added new constants for
2854           interruption events.
2855         * WebCore.xcodeproj/project.pbxproj: Renamed MediaEventTypes.h.
2856         * page/Page.h: Added stub.
2857         * page/Page.cpp: Added stub.
2858
2859 2015-07-13  Simon Fraser  <simon.fraser@apple.com>
2860
2861         [iOS WK2] When choosing an initial viewport scale, take overflow on the <body> into account
2862         https://bugs.webkit.org/show_bug.cgi?id=146918
2863         rdar://problem/9222837
2864
2865         Reviewed by Tim Horton.
2866
2867         Use as input to the viewport scaling algorithm a contents size from the FrameView
2868         that takes overflow on the viewport renderer into account. This prevents unexpected
2869         viewports scaling on pages that have content that overflows their expressed contents size,
2870         but apply overflow to the <body>.
2871
2872         * page/FrameView.cpp:
2873         (WebCore::FrameView::contentsSizeRespectingOverflow): Look for overflow:hidden on each axis of
2874         the m_viewportRenderer, which is computed post-layout by calculateScrollbarModesForLayout()
2875         and is used for scrollbar logic on OS X. Clip unscaledDocumentRect on each axis, and then
2876         apply page scale.
2877         * page/FrameView.h:
2878
2879 2015-07-13  Brent Fulgham  <bfulgham@apple.com>
2880
2881         Update WebCore Features.json
2882         https://bugs.webkit.org/show_bug.cgi?id=146914
2883
2884         Reviewed by Benjamin Poulain.
2885
2886         * features.json: Update with notes for CSS Scroll Snap Points, Filter Effects,
2887         backdrop-filters, and initial-letter.
2888
2889 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
2890
2891         Change MediaPlayer Media Stream method signatures to use references
2892         https://bugs.webkit.org/show_bug.cgi?id=146839
2893         <rdar://problem/21769035>
2894
2895         Reviewed by Darin Adler.
2896
2897         * platform/graphics/MediaPlayer.cpp:
2898         (WebCore::MediaPlayer::loadWithNextMediaEngine):
2899         * platform/graphics/MediaPlayerPrivate.h: Changed to references
2900         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2901         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2902         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2903         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load): Ditto
2904         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2905         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto
2906         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2907         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2908         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
2909
2910 2015-07-13  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2911
2912         GTK] Build race with -DENABLE_WAYLAND_TARGET=ON
2913         https://bugs.webkit.org/show_bug.cgi?id=146740
2914
2915         Reviewed by Martin Robinson.
2916
2917         No new tests, no behavior changes.
2918
2919         * PlatformGTK.cmake: platform/graphics/wayland sources should be
2920         included into WebCore source list instead of WebCorePlatformGTK.
2921         Also move the add_custom_command() block into if(ENABLE_WAYLAND_TARGET),
2922         this is not strictly needed to fix this bug, but it seems cleaner.
2923
2924 2015-07-13  Matthew Daiter  <mdaiter@apple.com>
2925
2926         Adding MediaStream Engine building blocks to the code repo
2927         https://bugs.webkit.org/show_bug.cgi?id=146789
2928         <rdar://problem/21747025>
2929
2930         Reviewed by Brent Fulgham.
2931
2932         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Added.
2933         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setLoadingProgresssed):
2934         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setHasAvailableVideoFrame):
2935         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createWeakPtr):
2936         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Added.
2937         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC):
2938         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
2939         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine):
2940         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
2941         (WebCore::mimeTypeCache):
2942         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes):
2943         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
2944         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
2945         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad):
2946         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay):
2947         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformMedia):
2948         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer):
2949         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
2950         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::playInternal):
2951         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause):
2952         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pauseInternal):
2953         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paused):
2954         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
2955         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsScanning):
2956         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
2957         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::naturalSize):
2958         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasVideo):
2959         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAudio):
2960         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
2961         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::durationMediaTime):
2962         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seeking):
2963         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setRateDouble):
2964         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setPreservesPitch):
2965         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::networkState):
2966         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::readyState):
2967         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::seekable):
2968         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::maxMediaTimeSeekable):
2969         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::minMediaTimeSeekable):
2970         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::buffered):
2971         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::didLoadingProgress):
2972         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setSize):
2973         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::hasAvailableVideoFrame):
2974         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsAcceleratedRendering):
2975         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::movieLoadType):
2976         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareForRendering):
2977         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::engineDescription):
2978         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::languageOfPrimaryAudioTrack):
2979         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldBePlaying):
2980         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::addDisplayLayer):
2981         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeDisplayLayer):
2982         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.h: Added.
2983         * platform/graphics/avfoundation/objc/MediaStreamPrivateAVFObjC.mm: Added.
2984         (WebCore::MediaStreamPrivateAVFObjC::create):
2985         (WebCore::MediaStreamPrivateAVFObjC::MediaStreamPrivateAVFObjC):
2986         (WebCore::MediaStreamPrivateAVFObjC::~MediaStreamPrivateAVFObjC):
2987         (WebCore::MediaStreamPrivateAVFObjC::duration):
2988         (WebCore::MediaStreamPrivateAVFObjC::buffered):
2989         (WebCore::MediaStreamPrivateAVFObjC::readyState):
2990         (WebCore::MediaStreamPrivateAVFObjC::hasAudio):
2991         (WebCore::MediaStreamPrivateAVFObjC::hasVideo):
2992         (WebCore::MediaStreamPrivateAVFObjC::naturalSize):
2993         * platform/mediastream/MediaStreamPrivate.h: 
2994         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Added constructor.
2995
2996 2015-07-13  Eric Carlson  <eric.carlson@apple.com>
2997
2998         [iOS] Cancel AirPlay explicitly when exiting from full screen
2999         https://bugs.webkit.org/show_bug.cgi?id=146902
3000         <rdar://problem/20923632>
3001
3002         Reviewed by Brent Fulgham.
3003
3004         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3005         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3006         (WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit): Call setExternalPlayback(false)
3007           if playing to an external screen.
3008
3009 2015-07-12  Chris Fleizach  <cfleizach@apple.com>
3010
3011         AX: WEB: VoiceOver for iOS does not read <iframe> elements during linear (swipe) navigation.
3012         https://bugs.webkit.org/show_bug.cgi?id=146861
3013
3014         Reviewed by Darin Adler.
3015
3016         AttachmentViews exist only on WK1 so we need account for both platforms.
3017
3018         Test: platform/ios-simulator/accessibility/iframe-access.html
3019
3020         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3021         (-[WebAccessibilityObjectWrapper accessibilityElementAtIndex:]):
3022
3023 2015-07-12  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3024
3025         [Streams API] Templating ReadableJSStream
3026         https://bugs.webkit.org/show_bug.cgi?id=146802
3027
3028         Reviewed by Darin Adler.
3029
3030         Introducing ReadableStream::clearValues to clear queued values when cancelling and going into error state.
3031
3032         Introducing ReadableEnqueuingStream to handle the stream queue, as a class template.
3033         Specialized ReadableEnqueuingStream for the purpose of ReadableJSStream (storage of JSValue with variable size).
3034
3035         Updated some static functions to accept a ReadableStream in lieu of the more specialized ReadableJSStream.
3036
3037         Covered by existing tests.
3038
3039         * Modules/streams/ReadableStream.cpp:
3040         (WebCore::ReadableStream::changeStateToErrored):
3041         (WebCore::ReadableStream::cancelNoCheck):
3042         * Modules/streams/ReadableStream.h:
3043         (WebCore::ReadableEnqueuingStream::ReadableEnqueuingStream):
3044         (WebCore::ReadableEnqueuingStream::enqueueChunk):
3045         (WebCore::ReadableEnqueuingStream<ChunkType>::read):
3046         * bindings/js/ReadableJSStream.cpp:
3047         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::read):
3048         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::enqueueChunk):
3049         (WebCore::createPullResultFulfilledFunction):
3050         (WebCore::createCancelResultFulfilledFunction):
3051         (WebCore::ReadableJSStream::ReadableJSStream):
3052         (WebCore::ReadableJSStream::enqueue):
3053         * bindings/js/ReadableJSStream.h:
3054         (WebCore::ReadableJSStreamValue::create):
3055         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::desiredSize):
3056         (WebCore::ReadableEnqueuingStream<ReadableJSStreamValue>::ReadableEnqueuingStream):
3057
3058 2015-07-11  Babak Shafiei  <bshafiei@apple.com>
3059
3060         Unreviewed build fix.
3061
3062         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3063         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
3064         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cancelLoad):
3065
3066 2015-07-11  Nikita Vasilyev  <nvasilyev@apple.com>
3067
3068         Web Inspector: Inspector should be able to be docked to the bottom of a narrow window
3069         https://bugs.webkit.org/show_bug.cgi?id=146871
3070
3071         Reviewed by Timothy Hatcher.
3072
3073         * inspector/InspectorFrontendClientLocal.cpp:
3074
3075 2015-07-11  Joseph Pecoraro  <pecoraro@apple.com>
3076
3077         Update default link action sheets for app links
3078         https://bugs.webkit.org/show_bug.cgi?id=146658
3079         <rdar://problem/21221902>
3080
3081         Reviewed by Dan Bernstein.
3082
3083         * English.lproj/Localizable.strings:
3084         * platform/spi/ios/LaunchServicesSPI.h:
3085
3086 2015-07-11  Benjamin Poulain  <benjamin@webkit.org>
3087
3088         Fix CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING
3089         https://bugs.webkit.org/show_bug.cgi?id=146879
3090
3091         Reviewed by Andreas Kling.
3092
3093         Some of my recent changes broke CONTENT_EXTENSIONS_STATE_MACHINE_DEBUGGING :(
3094
3095         * contentextensions/CombinedURLFilters.cpp:
3096         (WebCore::ContentExtensions::prefixTreeVertexToString):
3097         (WebCore::ContentExtensions::recursivePrint):
3098         (WebCore::ContentExtensions::CombinedURLFilters::print):
3099         * contentextensions/ContentExtensionsDebugging.h:
3100         * contentextensions/DFA.cpp:
3101         (WebCore::ContentExtensions::DFA::debugPrintDot):
3102
3103 2015-07-10  Simon Fraser  <simon.fraser@apple.com>
3104
3105         [iOS WK2] Scrolling issues on horizontally scrollable RTL pages
3106         https://bugs.webkit.org/show_bug.cgi?id=146872
3107         rdar://problem/7569416
3108
3109         Reviewed by Sam Weinig.
3110
3111         Horizontally scrollable RTL pages in WebKit2 had a variety of issues: they had
3112         a gap down the right edge, and unreachable content on the left side, focussing
3113         form fields scrolled to the wrong location, and programmatic scrolls scrolled
3114         to the wrong place.
3115         
3116         Fix by plumbing the WebCore notion of scrollOrigin through to the UI process,
3117         and using it in various places. There are three main aspects to the patch:
3118         
3119         1. scroll origin is included in RemoteLayerTreeTransaction, and plumbed through
3120            to -[WKWebView _scrollToContentOffset:] for correct programmatic scrolling,
3121            including zooming to focussed form elements.
3122         2. WebPageProxy::computeCustomFixedPositionRect() uses the actual documentRect()
3123            rather than just conjuring up a rect with a zero origin, which makes position:fixed
3124            work correctly.
3125         3. _interactionViewsContainerView (which hosts tap highlights) is positioned to 
3126            coincide with the origin of the documentRect (i.e. at the scroll origin, which
3127            may not be top-left). This allows tap highlights to show in the correct location.
3128         4. ScrollView::unobscuredContentRect() is fixed to take scroll origin into account;
3129            if the returned rect is wrong, RenderLayer::hitTest() incorrectly clips the hit
3130            testing area.
3131
3132         * platform/ios/ScrollViewIOS.mm:
3133         (WebCore::ScrollView::unobscuredContentRect):
3134
3135 2015-07-10  Chris Dumez  <cdumez@apple.com>
3136
3137         [WK2] Diagnostic logging messages are causing too much IPC
3138         https://bugs.webkit.org/show_bug.cgi?id=146873
3139         <rdar://problem/21779205>
3140
3141         Reviewed by Ryosuke Niwa.
3142
3143         Move shouldLogAfterSampling() utility function to DiagnosticLoggingClient
3144         so it can be easily reused.
3145
3146         * page/DiagnosticLoggingClient.h:
3147         (WebCore::DiagnosticLoggingClient::shouldLogAfterSampling):
3148
3149 2015-07-10  Daniel Bates  <dabates@apple.com>
3150
3151         Cleanup: Remove default constructor for WebCore::Pair()
3152         https://bugs.webkit.org/show_bug.cgi?id=146856
3153         <rdar://problem/21773212>
3154
3155         Reviewed by Darin Adler.
3156
3157         Remove default constructor for WebCore::Pair() and the setters Pair::set{First, Second}()
3158         since they are not used and it seems weird to keep the latter after the removal of the former.
3159         Should it turn out that we find a use for having a default constructor and/or setters then
3160         we can revert this change.
3161
3162         * css/Pair.h:
3163         (WebCore::Pair::create): Deleted.
3164         (WebCore::Pair::setFirst): Deleted.
3165         (WebCore::Pair::setSecond): Deleted.
3166         (WebCore::Pair::Pair): Deleted.
3167
3168 2015-07-10  Ryuan Choi  <ryuan.choi@navercorp.com>
3169
3170         [CoordinatedGraphics] Override primaryLayerID in CoordinatedGraphicsLayer
3171         https://bugs.webkit.org/show_bug.cgi?id=146826
3172
3173         Reviewed by Gyuyoung Kim.
3174
3175         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3176         (WebCore::CoordinatedGraphicsLayer::id): Moved id as inline function.
3177         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3178         (WebCore::CoordinatedGraphicsLayer::id):
3179
3180 2015-07-10  Matthew Daiter  <mdaiter@apple.com>
3181
3182         Exposing webkitMediaStream as MediaStream
3183         https://bugs.webkit.org/show_bug.cgi?id=146813
3184         <rdar://problem/21754383>
3185
3186         Reviewed by Eric Carlson.
3187
3188         * Modules/mediastream/MediaStream.idl: Changed interface
3189         name from webkitMediaStream to MediaStream
3190
3191 2015-07-10  Nan Wang  <n_wang@apple.com>
3192
3193         Added ARIA 1.1 "cell" and "table" roles.
3194         https://bugs.webkit.org/show_bug.cgi?id=146011
3195         <rdar://problem/21398946>
3196
3197         Reviewed by Chris Fleizach.
3198
3199         Created a new role called GridCellRole to match the gridcell role, 
3200         so the previous CellRole and TableRole will match to cell and table role.
3201         Made the changes to make sure that both GridRole and TableRole have same
3202         behavior, as well as the circumstance for GridCellRole and CellRole.
3203
3204         Test: accessibility/roles-table-and-cell.html
3205
3206         * accessibility/AXObjectCache.cpp:
3207         (WebCore::createFromRenderer):
3208         * accessibility/AccessibilityNodeObject.cpp:
3209         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
3210         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute):
3211         * accessibility/AccessibilityObject.cpp:
3212         (WebCore::initializeRoleMap):
3213         * accessibility/AccessibilityObject.h:
3214         * accessibility/AccessibilityRenderObject.cpp:
3215         (WebCore::AccessibilityRenderObject::setSelectedRows):
3216         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
3217         (WebCore::AccessibilityRenderObject::selectedChildren):
3218         * accessibility/AccessibilityTable.cpp:
3219         (WebCore::AccessibilityTable::roleValue):
3220         * accessibility/AccessibilityTableCell.cpp:
3221         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
3222         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3223         (-[WebAccessibilityObjectWrapper _accessibilityTableAncestor]):
3224         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
3225         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
3226         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3227         (createAccessibilityRoleMap):
3228
3229 2015-07-10  Daniel Bates  <dabates@apple.com>
3230
3231         Serialized declaration for background-size/-webkit-mask-size should preserve identical
3232         values instead of coalescing them
3233         https://bugs.webkit.org/show_bug.cgi?id=143191
3234         <rdar://problem/21759393>
3235
3236         Reviewed by Darin Adler.
3237
3238         Inspired by Blink r157745:
3239         <http://src.chromium.org/viewvc/blink?view=revision&revision=157745>
3240         And Blink r172548:
3241         <http://src.chromium.org/viewvc/blink?view=revision&revision=172548>
3242
3243         Fixes an issue where identical values in a CSS declaration for properties background-size
3244         and -webkit-mask-size would be coalesced when serialized.
3245
3246         * css/CSSParser.cpp:
3247         (WebCore::CSSParser::parseFillSize): Modified to create a Pair object with the appropriate
3248         identical value encoding strategy. We only coalesce identical values when serializing the
3249         declaration of property -webkit-background-size.
3250         * css/Pair.h:
3251         (WebCore::Pair::create): Added variant that takes an encoding.
3252         (WebCore::Pair::cssText): Moved implementation of Pair::generateCSSString() to here and
3253         modified to conditionally coalesce identical values during serialization.
3254         (WebCore::Pair::Pair): Added variant that takes an encoding.
3255         (WebCore::Pair::generateCSSString): Deleted; moved implementation into Pair::cssText().
3256
3257 2015-07-10  Myles C. Maxfield  <mmaxfield@apple.com>
3258
3259         Bidi-Isolate inlines break layout with collapsed whitespace
3260         https://bugs.webkit.org/show_bug.cgi?id=109624
3261         <rdar://problem/21752834>
3262
3263         Reviewed by David Hyatt.
3264
3265         This patch changes the logic in constructBidiRunsForSegment() when it encounters an
3266         isolate. It already has logic to create a BidiResolver for the isolated text;
3267         however, that logic doesn't handle setting up the MidpointState at all.
3268         Specifically, we can set the MidpointState's cursor to point to the context which
3269         we can remember from addPlaceholderRunForIsolatedInline(). This information is
3270         remembered in a HashMap in BidiResolver.
3271
3272         This patch is a partial port of Blink patch
3273         https://src.chromium.org/viewvc/blink?view=rev&revision=159203
3274
3275         Here is some explanatory text regarding how we collapse spaces:
3276
3277         Collapsing whitespace happens in a series of phases. The first phase occurs when
3278         we perform line breaking. Here, we keep track of sequences of whitespace which
3279         should be collapsed, in the form of a vector of pairs of InlineIterators. We put
3280         this knowledge into a MidpointState object.
3281
3282         Then, once we have a line, we run the bidi algorithm on the line (including the
3283         whitespace). As output, the bidi algorithm calls the BidiResolver::appendRun()
3284         callback with two InlineIterators each time it wants to create a run. Because
3285         each renderer that we create has to be owned by exactly one DOM node,
3286         BidiResolver::appendRun() iterates between its two InlineIterator arguments,
3287         calling RenderBlockFlow::appendRunsForObject() on each interstitial DOM node.
3288
3289         This is the function where whitespace collapsing happens. The MidpointState object
3290         keeps a cursor into its remembered whitespace sequences. Here, we simply make a
3291         bidi run for each region in between adjacent whitespace pairs in the MidpointState
3292         object. These bidi runs eventually get turned into leaf InlineBoxes.
3293
3294         The problem is that the BidiResolver::appendRun() callbacks don't occur in
3295         string-order, but the Midpoint InlineIterator pairs are in string-order. In
3296         particular, within a particular isolate, appendRun() gets called in string
3297         order, but callbacks that occur for inner isolates are deferred. This means that
3298         RenderBlockFlow::appendRunsForObject() gets confused when it looks for relevant
3299         whitespace to skip.
3300
3301         Test: fast/text/bidi-isolate-whitespace-collapse.html
3302
3303         * platform/text/BidiResolver.h:
3304         (WebCore::MidpointState::numMidpoints): Returning a const unsigned& is silly.
3305         (WebCore::MidpointState::currentMidpoint): Ditto.
3306         (WebCore::MidpointState::setCurrentMidpoint): The isolated MidpointState object
3307         needs to be able to set its current midpoint to point to the first one inside
3308         the isolate.
3309         (WebCore::MidpointState::decrementNumMidpoints): Renamed from "decrease"
3310         (WebCore::MidpointState::betweenMidpoints): This function is true iff
3311         currentMidpoint() % 2. Instead of keeping a member variable, we can just compute
3312         that.
3313         (WebCore::MidpointState::reset): Deleted.
3314         (WebCore::MidpointState::decreaseNumMidpoints): Deleted.
3315         (WebCore::MidpointState::setBetweenMidpoints): Deleted.
3316         * rendering/InlineIterator.h:
3317         (WebCore::IsolateTracker::addFakeRunIfNecessary): Call
3318         RenderBlockFlow::appendRunsForObject() to keep our MidpointState object in sync
3319         when we pop out of the isolated object. However, we pass in a null run list,
3320         because we don't want to append just yet (that happens when we process the
3321         isolate).
3322         (WebCore::InlineBidiResolver::appendRun): Update for new signature of
3323         appendRunsForObject().
3324         * rendering/RenderBlock.h:
3325         (WebCore::RenderBlock::shouldSkipCreatingRunsForObject): Take a reference instead
3326         of a pointer.
3327         * rendering/RenderBlockFlow.h:
3328         * rendering/RenderBlockLineLayout.cpp:
3329         (WebCore::createRun): Ditto.
3330         (WebCore::RenderBlockFlow::appendRunsForObject): Allow someone passing us a null
3331         BidiRunList. In this case, we will keep the resolver's midpointState() up to date,
3332         but won't actually emit any runs.
3333         (WebCore::notifyResolverToResumeInIsolate): Renamed from setUp.
3334         (WebCore::isolatedResolversMidpointState): Calculate the midpoint state for the
3335         isolated resolver.
3336         (WebCore::setUpResolverToResumeInIsolate): Call isolatedResolversMidpointState().
3337         (WebCore::constructBidiRunsForSegment): Pass in the topResolver, which is
3338         necessary for isolatedResolversMidpointState().
3339         * rendering/line/BreakingContext.h:
3340         (WebCore::checkMidpoints):
3341
3342 2015-07-10  Daniel Bates  <dabates@apple.com>
3343
3344         Cleanup: WebCore::Pair class should use RefPtr&& instead of PassRefPtr
3345         https://bugs.webkit.org/show_bug.cgi?id=146852
3346
3347         Reviewed by Anders Carlsson.
3348
3349         * css/CSSParser.cpp:
3350         (WebCore::createPrimitiveValuePair): Write using a variadic template that forwards its
3351         arguments to the appropriate Pair::create constructor.
3352         (WebCore::CSSParser::parse4ValuesFillPosition): Use RefPtr&& instead of PassRefPtr. 
3353         (WebCore::CSSParser::parse3ValuesFillPosition): Ditto.
3354         (WebCore::CSSParser::parseFillPosition): Use WTF::move() instead of RefPtr::release()
3355         so that we pass a rvalue reference to RefPtr.
3356         (WebCore::CSSParser::parseFillSize): Ditto.
3357         (WebCore::CSSParser::parseBorderImageRepeat): Ditto.
3358         * css/CSSParser.h:
3359         * css/Pair.h:
3360         (WebCore::Pair::create): Use RefPtr&& instead of PassRefPtr. 
3361         (WebCore::Pair::setFirst): Ditto.
3362         (WebCore::Pair::setSecond): Ditto.
3363         (WebCore::Pair::Pair): Ditto. Also substitute nullptr for 0 in the member initialization
3364         list of the default constructor.
3365
3366 2015-07-10  Zalan Bujtas  <zalan@apple.com>
3367
3368         Crash at WebCore::WebPage::innerFrameQuad.
3369         https://bugs.webkit.org/show_bug.cgi?id=146843
3370         rdar://problem/21501819
3371
3372         Reviewed by Andreas Kling.
3373
3374         We may end up with a null rootEditableElement() after calling Document::updateLayout().
3375
3376         Speculative fix. Not reproducible.
3377
3378         * page/Frame.cpp: Some const cleanup.
3379         (WebCore::Frame::visiblePositionForPoint):
3380         * page/Frame.h:
3381
3382 2015-07-10  Brady Eidson  <beidson@apple.com>
3383
3384         Crash in HistoryController::updateForCommit dereferencing a null HistoryItem.
3385         <rdar://problem/21371589> and https://bugs.webkit.org/show_bug.cgi?id=146842
3386
3387         Reviewed by Chris Dumez.
3388
3389         No new tests (Unknown how to reproduce).
3390         
3391         This patch basically rolls back part of http://trac.webkit.org/changeset/179472.
3392         
3393         r179472 changed HistoryController::setCurrentItem() to take a reference instead of a pointer.
3394         Unfortunately, we sometimes call setCurrentItem(nullptr).
3395         
3396         We'd like to *not* do that, and there are assertions in place to try to catch when we do,
3397         but in the meantime it is not valid to dereference nullptr.
3398
3399         * loader/FrameLoader.cpp:
3400         (WebCore::FrameLoader::loadSameDocumentItem):
3401         
3402         * loader/HistoryController.cpp:
3403         (WebCore::HistoryController::updateForCommit):
3404         (WebCore::HistoryController::recursiveUpdateForCommit):
3405         (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
3406         (WebCore::HistoryController::setCurrentItem): Take a ptr instead of a ref.
3407         (WebCore::HistoryController::createItem):
3408         * loader/HistoryController.h:
3409
3410 2015-07-10  Javier Fernandez  <jfernandez@igalia.com>
3411
3412         [CSS Grid Layout] Grid item's auto-margins are not applied correctly
3413         https://bugs.webkit.org/show_bug.cgi?id=146581
3414
3415         Reviewed by Darin Adler.
3416
3417         Grid Layout specification states that auto-margins must prevent to apply
3418         any Box Alignment property in that dimension. Instead, auto-margin is
3419         applied as described in the spec.
3420
3421         http://dev.w3.org/csswg/css-grid/#auto-margins
3422
3423         Only Flexbox and Grid Layout implement vertical auto-margin alignment;
3424         for other layout modes, auto-margin should compute as 0.
3425
3426         Tests: fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-lr.html
3427                fast/css-grid-layout/grid-item-auto-margins-alignment-vertical-rl.html
3428                fast/css-grid-layout/grid-item-auto-margins-alignment.html
3429
3430         * rendering/RenderBox.cpp:
3431         (WebCore::RenderBox::styleDidChange):
3432         (WebCore::RenderBox::updateGridAlignmentAfterStyleChange):
3433         * rendering/RenderBox.h:
3434         * rendering/RenderGrid.cpp:
3435         (WebCore::RenderGrid::layoutGridItems):
3436         (WebCore::RenderGrid::hasAutoMarginsInColumnAxis):
3437         (WebCore::RenderGrid::hasAutoMarginsInRowAxis):
3438         (WebCore::RenderGrid::updateAutoMarginsInColumnAxisIfNeeded):
3439         (WebCore::RenderGrid::rowPositionForChild):
3440         (WebCore::RenderGrid::columnPositionForChild):
3441         * rendering/RenderGrid.h:
3442
3443 2015-07-10  Csaba Osztrogonác  <ossy@webkit.org>
3444
3445         Fix overloaded virtual function warning in ScrollbarThemeGtk.h
3446         https://bugs.webkit.org/show_bug.cgi?id=145920
3447
3448         Reviewed by Darin Adler.
3449
3450         * platform/gtk/ScrollbarThemeGtk.h:
3451
3452 2015-07-10  Chris Fleizach  <cfleizach@apple.com>
3453
3454         AX: <details> element should allow expand/close through AX API
3455         https://bugs.webkit.org/show_bug.cgi?id=146549
3456
3457         Apply review comments from Daniel Bates.
3458
3459         * accessibility/AccessibilityNodeObject.cpp:
3460         (WebCore::AccessibilityNodeObject::setIsExpanded):
3461
3462 2015-07-10  Brady Eidson  <beidson@apple.com>
3463
3464         ASSERT restoring from page cache as DocumentLoader reattaches to its Frame.
3465         <rdar://problem/21766282> and https://bugs.webkit.org/show_bug.cgi?id=146786
3466
3467         Reviewed by NOBODY (Fixing obvious boneheaded mistake in r186642)
3468
3469         No new tests (Covered by existing)
3470
3471         * loader/DocumentLoader.cpp:
3472         (WebCore::DocumentLoader::attachToFrame): Bail if reattaching to the current Frame,
3473           which happens when restoring from the page cache.
3474
3475 2015-07-09  Zalan Bujtas  <zalan@apple.com>
3476
3477         Plugin create can end up destroying its renderer.
3478         https://bugs.webkit.org/show_bug.cgi?id=146824
3479         rdar://problem/18921429
3480
3481         Reviewed by Andreas Kling.
3482
3483         Plugins can run arbitrary code during initialization. If the plugin
3484         happens to destroy the associated node, its renderer becomes invalid.
3485         This patch checks whether the renderer survived the createPlugin() call.
3486         (This WeakPtr pattern is also used in RenderWidget to avoid dangling pointers.)
3487
3488         Speculative fix. Not reproducible.
3489
3490         * loader/SubframeLoader.cpp:
3491         (WebCore::SubframeLoader::loadPlugin):
3492
3493 2015-07-09  Dan Bernstein  <mitz@apple.com>
3494
3495         WebCore part of Track and expose policies for external URL schemes and App Links separately
3496         https://bugs.webkit.org/show_bug.cgi?id=146822
3497
3498         Reviewed by Anders Carlsson.
3499
3500         * loader/FrameLoaderTypes.h: Added ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes,
3501         meaning external schemes are allowed but App Links are not. The opposite state doesn’t
3502         exist.
3503
3504         * page/ContextMenuController.cpp:
3505         (WebCore::ContextMenuController::contextMenuItemSelected): Opening a link in a new window
3506         or in the current window should never open it as an App Link.
3507
3508 2015-07-09  Daniel Bates  <dabates@apple.com>
3509
3510         Fetching Content Security Policy report URL should respect same origin policy
3511         https://bugs.webkit.org/show_bug.cgi?id=146754
3512         <rdar://problem/18860259>
3513
3514         Reviewed by Brady Eidson.
3515
3516         Inspired by Blink r149791 (by Mike West <mkwst@chromium.org>):
3517         <https://src.chromium.org/viewvc/blink?revision=149791&view=revision>
3518
3519         As per <http://www.w3.org/TR/2015/CR-CSP2-20150219/#send-violation-reports>, fetching the
3520         Content Security Policy report URL should include cookies if and only if the origin of
3521         the protected resource is equal to the origin of the report URL.
3522
3523         Tests: http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-enabled.html
3524                http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies-when-private-browsing-toggled.html
3525                http/tests/security/contentSecurityPolicy/report-cross-origin-no-cookies.html
3526                http/tests/security/contentSecurityPolicy/report-same-origin-no-cookies-when-private-browsing-toggled.html
3527                http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies-when-private-browsing-enabled.html
3528                http/tests/security/contentSecurityPolicy/report-same-origin-with-cookies.html
3529
3530         * loader/PingLoader.cpp:
3531         (WebCore::PingLoader::sendViolationReport):
3532
3533 2015-07-09  Timothy Horton  <timothy_horton@apple.com>
3534
3535         Use CoreAnimation fences instead of synchronous IPC to synchronize resize
3536         https://bugs.webkit.org/show_bug.cgi?id=146294
3537         <rdar://problem/21090193>
3538
3539         Reviewed by Anders Carlsson.
3540
3541         * platform/cocoa/MachSendRight.h:
3542         Export some constructors.
3543
3544         * platform/spi/cocoa/QuartzCoreSPI.h:
3545         Add some SPI.
3546
3547 2015-07-09  Brady Eidson  <beidson@apple.com>
3548
3549         Followup to r186647
3550
3551         Reviewed by NOBODY.
3552
3553         Thanks, EWS and commit-queue, for not catching this!
3554
3555         * loader/DocumentLoader.h: Add a semi-colon.
3556
3557 2015-07-09  Dean Jackson  <dino@apple.com>
3558
3559         REGRESSION: Inline media scrubbing always pauses the video
3560         https://bugs.webkit.org/show_bug.cgi?id=146819
3561         <rdar://problem/21572027>
3562
3563         Reviewed by Eric Carlson. Joseph Pecoraro also was really
3564         helpful in diagnosing the problem.
3565
3566         When we moved some code from a getter/setter in the child
3567         class to the base class, it was no longer being called due
3568         to the bad way we were implementing inheritance. The solution
3569         was to have the child class explicitly call into the base
3570         class.
3571
3572         The much better solution would have been to rewrite everything
3573         to use ES6 classes or, as a smaller change, assign the __proto__
3574         directly on the child prototype. But I felt that was a bit
3575         too risky at this point.
3576
3577         * Modules/mediacontrols/mediaControlsApple.js:
3578         (Controller.prototype.extend): Describe in a comment why the extend function
3579         is not suitable.
3580         * Modules/mediacontrols/mediaControlsiOS.js: Add a getter/setter for
3581         scrubbing that calls into the base Controller.
3582
3583 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
3584
3585         AX: <details> element should allow expand/close through AX API
3586         https://bugs.webkit.org/show_bug.cgi?id=146549
3587
3588         Reviewed by Mario Sanchez Prada.
3589
3590         Forgot this file with the original commit.
3591
3592         * html/HTMLDetailsElement.cpp:
3593         (WebCore::HTMLDetailsElement::toggleOpen):
3594
3595 2015-07-09  Alex Christensen  <achristensen@webkit.org>
3596
3597         [Content Extensions] Add 3 byte jump size.
3598         https://bugs.webkit.org/show_bug.cgi?id=146425
3599
3600         Reviewed by Darin Adler.
3601
3602         * contentextensions/DFABytecode.h:
3603         (WebCore::ContentExtensions::smallestPossibleJumpSize):
3604         * contentextensions/DFABytecodeCompiler.cpp:
3605         (WebCore::ContentExtensions::appendZeroes):
3606         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
3607         * contentextensions/DFABytecodeInterpreter.cpp:
3608         (WebCore::ContentExtensions::jumpSizeInBytes):
3609         (WebCore::ContentExtensions::getJumpSize):
3610         (WebCore::ContentExtensions::getJumpDistance):
3611         Added DFABytecodeJumpSize::Int24.
3612
3613 2015-07-09  Brady Eidson  <beidson@apple.com>
3614
3615         Add better ASSERTs to learn more about what is going wrong in DocumentLoader::detachFromFrame()
3616         https://bugs.webkit.org/show_bug.cgi?id=146816
3617
3618         Reviewed by Alex Christensen.
3619
3620         * loader/DocumentLoader.cpp:
3621         (WebCore::DocumentLoader::attachToFrame): Set the "has ever been attached" flag to true.
3622         (WebCore::DocumentLoader::detachFromFrame): ASSERT m_frame is non-null, but with a message 
3623           depending on the value of the "has ever been attached" flag.
3624         * loader/DocumentLoader.h:
3625
3626 2015-07-09  Brent Fulgham  <bfulgham@apple.com>
3627
3628         [Mac, iOS] The mimeTypeCache should return a reference
3629         https://bugs.webkit.org/show_bug.cgi?id=146809
3630
3631         Reviewed by Eric Carlson.
3632
3633         No new tests: No change in functionality.
3634
3635         Don't copy the mime type cache every time someone asks it a question. Return
3636         by reference instead.
3637
3638         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3639         (WebCore::mimeTypeCache):
3640         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3641         (WebCore::mimeTypeCache):
3642         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3643         (WebCore::mimeTypeCache):
3644
3645 2015-07-09  Wenson Hsieh  <whsieh@berkeley.edu>
3646
3647         Rubber banding is broken when using a Mighty Mouse
3648         https://bugs.webkit.org/show_bug.cgi?id=146693
3649
3650         Reviewed by Tim Horton.
3651
3652         Sets the "constrain content edge scrolling" flag to true by default, causing scrolling
3653         with a Mighty Mouse to not extend beyond the container's edges.
3654
3655         Test: platform/mac-wk2/tiled-drawing/scrolling/stateless-scrolling-no-rubber-band.html
3656
3657         * rendering/RenderLayer.cpp: Remove code that defaulted the flag to false.
3658         (WebCore::RenderLayer::RenderLayer): Deleted.
3659         * rendering/RenderMarquee.cpp: Added special case for marquees that allows content to scroll.
3660         (WebCore::RenderMarquee::RenderMarquee): See above.
3661
3662 2015-07-09  Brady Eidson  <beidson@apple.com>
3663
3664         DocumentLoader::detachFromFrame() is being called with no current Frame set.
3665         <rdar://problem/21293082> and https://bugs.webkit.org/show_bug.cgi?id=146786 
3666
3667         Reviewed by Sam Weinig.
3668
3669         No new tests (Unknown how to reproduce).
3670
3671         * loader/DocumentLoader.cpp:
3672         (WebCore::DocumentLoader::attachToFrame):
3673         (WebCore::DocumentLoader::detachFromFrame): Null check m_frame before dereferencing it.
3674         (WebCore::DocumentLoader::setFrame): Deleted, renamed to attachToFrame(), and take's
3675           a Frame& instead of a Frame*.
3676         * loader/DocumentLoader.h:
3677         
3678         * loader/FrameLoader.cpp:
3679         (WebCore::FrameLoader::initForSynthesizedDocument): setFrame is now attachToFrame.
3680         (WebCore::FrameLoader::setPolicyDocumentLoader): Ditto.
3681         (WebCore::FrameLoader::transitionToCommitted): Ditto.
3682
3683 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
3684
3685         Expose MediaStream methods to be used in the MediaStream Engine
3686         https://bugs.webkit.org/show_bug.cgi?id=146791
3687         <rdar://problem/21747589>
3688
3689         Reviewed by Brent Fulgham.
3690
3691         * Modules/mediastream/MediaStream.cpp: 
3692         (WebCore::MediaStream::getAudioTracks): Removed const
3693         (WebCore::MediaStream::getVideoTracks): Ditto
3694         * Modules/mediastream/MediaStream.h: Needed to change functions to
3695         override
3696         * platform/mediastream/MediaStreamPrivate.h: Added certain calls to
3697         PrivateClient that exposes methods to be used in the engine
3698
3699 2015-07-09  Devin Rousso  <drousso@apple.com>
3700
3701         Web Inspector: Fix shape-highlight layout tests
3702         https://bugs.webkit.org/show_bug.cgi?id=146080
3703
3704         Reviewed by Joseph Pecoraro.
3705
3706         * inspector/InspectorOverlay.cpp:
3707         (WebCore::buildObjectForShapeOutside): Now properly returns the shape margin.
3708
3709 2015-07-09  Eric Carlson  <eric.carlson@apple.com>
3710
3711         [Mac] AirPlay to password protected AppleTV fails
3712         https://bugs.webkit.org/show_bug.cgi?id=146812
3713
3714         Reviewed by Dean Jackson.
3715
3716         * Modules/mediasession/WebMediaSessionManager.cpp:
3717         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Initialize previouslyRequestedPicker.
3718         (WebCore::WebMediaSessionManager::clientStateDidChange): Cleanup the logic and add a comment
3719           to make it slightly easier to follow. Don't begin playing to a device unless playback
3720           has just started (don't switch in mid-play).
3721         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): Use the last client to
3722           request the device picker as a fallback in case no other client is a canditate. Add more
3723           logging to make it possible to debug the selection logic.
3724         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Fiddle with the logging.
3725
3726 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
3727
3728         Implementing platform-specific section of enumerateDevices
3729         https://bugs.webkit.org/show_bug.cgi?id=146461
3730         <rdar://problem/21614466>
3731
3732         Reviewed by Darin Adler.
3733
3734         * Modules/mediastream/MediaDeviceInfo.cpp: Changed access methods
3735         (WebCore::MediaDeviceInfo::audioInputType): Added AtomicString
3736         permanent refs
3737         (WebCore::MediaDeviceInfo::audioOutputType): Ditto
3738         (WebCore::MediaDeviceInfo::videoInputType): Ditto
3739         * Modules/mediastream/MediaDeviceInfo.h: Changed String refs to values
3740         (WebCore::MediaDeviceInfo::label): Ditto
3741         (WebCore::MediaDeviceInfo::deviceId): Ditto
3742         (WebCore::MediaDeviceInfo::groupId): Ditto
3743         (WebCore::MediaDeviceInfo::kind): Ditto
3744         * platform/mediastream/MediaDevicesPrivate.cpp: Implemented query for
3745         available devices
3746         (WebCore::MediaDevicesPrivate::MediaDevicesPrivate):
3747         (WebCore::MediaDevicesPrivate::create):
3748         (WebCore::MediaDevicesPrivate::availableMediaDevices):
3749         * platform/mediastream/MediaDevicesPrivate.h:
3750         (WebCore::MediaDevicesPrivate::~MediaDevicesPrivate):
3751         * WebCore.xcodeproj/project.pbxproj:
3752         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Needed
3753         to tack on extra fields to hold data
3754         (WebCore::TrackSourceInfo::create):
3755         (WebCore::TrackSourceInfo::groupId):
3756         (WebCore::TrackSourceInfo::deviceId):
3757         (WebCore::TrackSourceInfo::TrackSourceInfo):
3758         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
3759         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
3760
3761 2015-07-09  Per Arne Vollan  <peavo@outlook.com>
3762
3763         [Win] Add memory pressure handler.
3764         https://bugs.webkit.org/show_bug.cgi?id=146685
3765
3766         Reviewed by Brent Fulgham.
3767
3768         Add memory pressure handler implementation on Windows.
3769         We check the memory usage at regular intervals with a timer.
3770
3771         * WebCore.vcxproj/WebCore.vcxproj:
3772         * WebCore.vcxproj/WebCore.vcxproj.filters:
3773         * platform/MemoryPressureHandler.cpp:
3774         (WebCore::MemoryPressureHandler::releaseMemory):
3775         (WebCore::MemoryPressureHandler::install):
3776         (WebCore::MemoryPressureHandler::uninstall):
3777         (WebCore::MemoryPressureHandler::holdOff):
3778         * platform/win/MemoryPressureHandlerWin.cpp: Added.
3779         (WebCore::CheckMemoryTimer::CheckMemoryTimer):
3780         (WebCore::CheckMemoryTimer::fired):
3781         (WebCore::CheckMemoryTimer::handleMemoryLow):
3782         (WebCore::MemoryPressureHandler::platformReleaseMemory):
3783         (WebCore::memCheckTimer):
3784         (WebCore::MemoryPressureHandler::install):
3785         (WebCore::MemoryPressureHandler::uninstall):
3786         (WebCore::MemoryPressureHandler::holdOff):
3787         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
3788         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
3789         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
3790         * platform/win/Win32Handle.h:
3791         (WebCore::Win32Handle::operator=):
3792
3793 2015-07-09  Matthew Daiter  <mdaiter@apple.com>
3794
3795         Exposed AVVideoCaptureSource's bounds
3796         https://bugs.webkit.org/show_bug.cgi?id=146760
3797         <rdar://problem/21736772>
3798
3799         Reviewed by Brent Fulgham.
3800
3801         * platform/mediastream/mac/AVVideoCaptureSource.h:
3802         (WebCore::AVVideoCaptureSource::width): Needed access to video width
3803         (WebCore::AVVideoCaptureSource::height): Needed access to video height
3804
3805 2015-07-09  Karlen Simonyan  <szkarlen@gmail.com>
3806
3807         [WinCairo] ClearType should be enabled on Cairo port
3808         https://bugs.webkit.org/show_bug.cgi?id=145492
3809
3810         Reviewed by Brent Fulgham.
3811
3812         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
3813         (WebCore::FontPlatformData::FontPlatformData):
3814         Use CAIRO_ANTIALIAS_BEST instead of CAIRO_ANTIALIAS_GRAY.
3815
3816 2015-07-02  Chris Fleizach  <cfleizach@apple.com>
3817
3818         AX: <details> element should allow expand/close through AX API
3819         https://bugs.webkit.org/show_bug.cgi?id=146549
3820
3821         Reviewed by Mario Sanchez Prada.
3822
3823         Allow AXExpanded to be writeable for <details> element, which, when set
3824         will toggle the opening and closing of the element. 
3825         Post a notification when that happens as well.
3826
3827         Modified test: platform/mac/accessibility/details-summary.html
3828
3829         * accessibility/AccessibilityNodeObject.cpp:
3830         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
3831         (WebCore::AccessibilityNodeObject::setIsExpanded):
3832         (WebCore::shouldUseAccessibilityObjectInnerText):
3833         * accessibility/AccessibilityNodeObject.h:
3834         * accessibility/AccessibilityObject.cpp:
3835         (WebCore::AccessibilityObject::supportsPressAction):
3836         * accessibility/AccessibilityRenderObject.cpp:
3837         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute):
3838         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3839         (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
3840         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3841         * html/HTMLDetailsElement.cpp:
3842         (WebCore::HTMLDetailsElement::toggleOpen):
3843
3844 2015-07-09  Alex Christensen  <achristensen@webkit.org>
3845
3846         [Content Extensions] Prevent crashes with plugins.
3847         https://bugs.webkit.org/show_bug.cgi?id=146705
3848         rdar://problem/20855444
3849
3850         Reviewed by Brady Eidson.
3851
3852         * loader/NetscapePlugInStreamLoader.cpp:
3853         (WebCore::NetscapePlugInStreamLoader::create):
3854         Call addPlugInStreamLoader in ResourceLoader::willSendRequest to always add blocked loads.
3855         * loader/NetscapePlugInStreamLoader.h:
3856         * loader/ResourceLoader.cpp:
3857         (WebCore::ResourceLoader::willSendRequest):
3858         Removed unnecessary early returns.
3859         * loader/ResourceLoader.h:
3860         (WebCore::ResourceLoader::isPlugInStreamLoader):
3861
3862 2015-07-09  Brent Fulgham  <bfulgham@apple.com>
3863
3864         [Win] Honor CACFLayer content scale factor
3865         https://bugs.webkit.org/show_bug.cgi?id=146792
3866
3867         Reviewed by Dean Jackson.
3868
3869         * AVFoundationSupport.py: Check for the CACFLayerSet/GetContentsScale
3870         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3871         (PlatformCALayerWin::PlatformCALayerWin): Use owner's scale factor (if
3872         present).
3873         (PlatformCALayerWin::contentsScale): Use CACFLayer API if present.
3874         (PlatformCALayerWin::setContentsScale): Ditto.
3875         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
3876         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Use owner's scale
3877         factor (if present).
3878         (PlatformCALayerWinInternal::addTile): Use tile parent's scale factor.
3879
3880 2015-07-08  Matt Rajca  <mrajca@apple.com>
3881
3882         Media Session: report to chrome client 'hasActiveMediaElements' changes
3883         https://bugs.webkit.org/show_bug.cgi?id=146745
3884
3885         Reviewed by Eric Carlson.
3886
3887         * Modules/mediasession/MediaSession.cpp: All updates to active media elements are now funneled through a helper
3888           method that will invoke the 'hasMediaSessionWithActiveMediaElementsDidChange' callback when necessary.
3889         (WebCore::MediaSession::removeMediaElement):
3890         (WebCore::MediaSession::changeActiveMediaElements):
3891         (WebCore::MediaSession::addActiveMediaElement):
3892         (WebCore::MediaSession::releaseSession):
3893         * Modules/mediasession/MediaSession.h:
3894         * Modules/mediasession/MediaSessionManager.cpp:
3895         (WebCore::MediaSessionManager::hasActiveMediaElements):
3896         * Modules/mediasession/MediaSessionManager.h:
3897
3898 2015-07-09  Darin Adler  <darin@apple.com>
3899
3900         REGRESSION (r182866): repeated prompts for password on internal Apple website using workers
3901         https://bugs.webkit.org/show_bug.cgi?id=146769
3902
3903         Reviewed by Sam Weinig.
3904
3905         Not sure how to make a regression test for this. Sure would be nice to have one though.
3906
3907         * loader/ThreadableLoader.cpp:
3908         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Added. Calls through to the
3909         base class copy constructor to copy data members of the base class (the lack of this was
3910         the bug). Also initializes all the data members of this class.
3911         (WebCore::ThreadableLoaderOptions::isolatedCopy): Changed to call the constructor above.
3912
3913         * loader/ThreadableLoader.h: Added new constructor.
3914
3915 2015-07-09  Chris Fleizach  <cfleizach@apple.com>
3916
3917         AX: VoiceOver cannot get to any content in Yahoo Mail messages table
3918         https://bugs.webkit.org/show_bug.cgi?id=146674
3919
3920         Reviewed by Darin Adler.
3921
3922         A table row could have any number of parent elements in the render tree, but for the purposes
3923         of accessibility we only want to report the AXTable as the parent so that it looks like a sane
3924         data table.
3925
3926         Test: accessibility/aria-table-with-presentational-elements.html
3927
3928         * accessibility/AccessibilityARIAGridRow.cpp:
3929         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
3930         (WebCore::AccessibilityARIAGridRow::parentObjectUnignored):
3931         (WebCore::AccessibilityARIAGridRow::parentTable):
3932         * accessibility/AccessibilityARIAGridRow.h:
3933
3934 2015-07-08  Sungmann Cho  <sungmann.cho@navercorp.com>
3935
3936         [GTK] The "Missing Plug-in" buttons are not showing up on some flash contents.
3937         https://bugs.webkit.org/show_bug.cgi?id=146707
3938
3939         Reviewed by Martin Robinson.
3940
3941         Currently, WebKitGTK+ doesn't show the "Missing Plug-in" buttons if the plugin-related tags
3942         don't have a "type" attribute. In such a case, WebCore tries to guess the MIME type from
3943         the extensions by using MIMETypeRegistry::getMIMETypeForExtension(). For WebKitGTK+,
3944         MIMETypeRegistry::getMIMETypeForExtension() goes through |extensionMap|, which is a simple
3945         array of <extension, mime type>, looking for the mime type for the given extension.
3946         But |extensionMap| in MIMETypeRegistryGtk.cpp doesn't have the information for ".swf",
3947         so WebCore fails to guess the MIME type and regard the content type as ObjectContentFrame,
3948         not ObjectContentNetscapePlugin.
3949
3950         * platform/gtk/MIMETypeRegistryGtk.cpp:
3951
3952 2015-07-08  Brady Eidson  <beidson@apple.com>
3953
3954         Crash calling [WebView close] in didFinishLoadForFrame callback.
3955         <rdar://problem/21690765> and https://bugs.webkit.org/show_bug.cgi?id=146773
3956
3957         Reviewed by David Kilzer.
3958
3959         Added API Test "WebViewCloseInsideDidFinishLoadForFrame"
3960
3961         * loader/FrameLoader.cpp:
3962         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): After the delegate callback,
3963           don't use the local Page* variable from earlier, but instead refetch it from m_frame.
3964
3965 2015-07-08  Daniel Bates  <dabates@apple.com>
3966
3967         Cleanup: Make ContentSecurityPolicy::ReportingStatus an enum class
3968         https://bugs.webkit.org/show_bug.cgi?id=146670
3969
3970         Reviewed by Darin Adler.
3971
3972         Make calling the ContentSecurityPolicy::allow* functions less error prone by making
3973         ContentSecurityPolicy::ReportingStatus an enum class. Among other benefits this will
3974         prevent a caller from inadvertently passing an enumerator of ContentSecurityPolicy::ReportingStatus
3975         as the boolean argument overridingContentSecurityPolicy, which is taken by the various
3976         ContentSecurityPolicy::allow* functions, by causing a compile-time error (since an enum class
3977         enumerator cannot be implicitly converted to an integral type).
3978
3979         * bindings/js/ScriptController.cpp:
3980         (WebCore::ScriptController::initScript):
3981         * page/ContentSecurityPolicy.cpp:
3982         (WebCore::CSPDirectiveList::allowJavaScriptURLs):
3983         (WebCore::CSPDirectiveList::allowInlineEventHandlers):
3984         (WebCore::CSPDirectiveList::allowInlineScript):
3985         (WebCore::CSPDirectiveList::allowInlineStyle):
3986         (WebCore::CSPDirectiveList::allowEval):
3987         (WebCore::CSPDirectiveList::allowPluginType):
3988         (WebCore::CSPDirectiveList::allowScriptFromSource):
3989         (WebCore::CSPDirectiveList::allowObjectFromSource):
3990         (WebCore::CSPDirectiveList::allowChildFrameFromSource):
3991         (WebCore::CSPDirectiveList::allowImageFromSource):
3992         (WebCore::CSPDirectiveList::allowStyleFromSource):
3993         (WebCore::CSPDirectiveList::allowFontFromSource):
3994         (WebCore::CSPDirectiveList::allowMediaFromSource):
3995         (WebCore::CSPDirectiveList::allowConnectToSource):
3996         (WebCore::CSPDirectiveList::allowFormAction):
3997         (WebCore::CSPDirectiveList::allowBaseURI):
3998         (WebCore::ContentSecurityPolicy::didReceiveHeader):
3999         (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
4000         * page/ContentSecurityPolicy.h:
4001         * page/DOMSecurityPolicy.cpp:
4002         (WebCore::DOMSecurityPolicy::allowsEval):
4003
4004 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
4005
4006         Activate DOMURLMediaStream
4007         https://bugs.webkit.org/show_bug.cgi?id=146764
4008         <rdar://problem/21738101>
4009
4010         Reviewed by Eric Carlson.
4011
4012         * DerivedSources.make: Added DOMURLMediaStream.idl to list
4013         * WebCore.xcodeproj/project.pbxproj: Added DOMURLMediaStream.cpp and
4014         DOMURLMediaStream.h to compile
4015
4016 2015-07-08  Matthew Daiter  <mdaiter@apple.com>
4017
4018         Make sure MediaStream uses blob protocol
4019         https://bugs.webkit.org/show_bug.cgi?id=146752
4020         <rdar://problem/21736057>
4021
4022         Reviewed by Eric Carlson.
4023