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