d302195ef4f8497d7e03dcb2587420c884ac7f4c
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
2
3         [ES6] Arrow function syntax. Feature flag for arrow function
4         https://bugs.webkit.org/show_bug.cgi?id=145108
5
6         Reviewed by Ryosuke Niwa.
7
8         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
9
10         * Configurations/FeatureDefines.xcconfig:
11
12 2015-05-18  Brent Fulgham  <bfulgham@apple.com>
13
14         REGRESSION(142590): Scroll-snap points are improperly snapping to earlier index values
15         https://bugs.webkit.org/show_bug.cgi?id=145140
16         <rdar://problem/21006738>
17
18         Reviewed by Beth Dakin.
19
20         The new "nearestActiveSnapPoint" logic is firing while scroll snap animations are running. We need
21         to add an "isScrollSnapInProgress" predicate, much like the existing "isRubberBandInProgress" to avoid
22         certain "fix-up" logic that we don't want running while we are in the process of moving to a new position.
23
24         * platform/ScrollAnimator.h:
25         (WebCore::ScrollAnimator::ScrollAnimator::isScrollSnapInProgress): Added.
26         * platform/ScrollableArea.cpp:
27         (WebCore::ScrollableArea::updateScrollSnapState): If we are in the midst of a scroll snap operation,
28         do not attempt to reset position to the current active snap point.
29         * platform/cocoa/ScrollController.h:
30         * platform/cocoa/ScrollController.mm:
31         (WebCore::ScrollController::isScrollSnapInProgress): Added.
32         * platform/mac/ScrollAnimatorMac.h:
33         * platform/mac/ScrollAnimatorMac.mm:
34         (WebCore::ScrollAnimatorMac::isScrollSnapInProgress): Added.
35
36 2015-05-17  Manuel Rego Casasnovas  <rego@igalia.com>
37
38         [CSS Grid Layout] Add scrollbar width in intrinsic logical widths computation
39         https://bugs.webkit.org/show_bug.cgi?id=145021
40
41         Like for flexboxes we've to take into account the scrollbar logical
42         width while computing the intrinsic min and max logical widths.
43
44         Reviewed by Sergio Villar Senin.
45
46         Test: fast/css-grid-layout/compute-intrinsic-widths-scrollbar.html
47
48         * rendering/RenderGrid.cpp:
49         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Add scrollbar
50         logical width.
51
52 2015-05-17  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
53
54         [Streams API] Delegate ReadableStreamReader reference counting to ReadableStream
55         https://bugs.webkit.org/show_bug.cgi?id=144907
56
57         Reviewed by Darin Adler.
58
59         Changed the link between readadable stream and reader.
60         Controller ref()/deref() now increments/decrements its stream ref counter, similarly to ReadableStreamController.
61         This ensures that even if JS scripts do not keep track of the readable stream,
62         the readable stream will not be disposed as long as the JS script has access to its reader.
63
64         All readers of a given stream are kept by the stream, either in an array (for released readers) 
65         or and in ReadableStream::m_reader for the active reader.
66         This removes the need for the code synchronizing stream and reader.
67
68         As a reader can now already count on its stream, the reader no longer needs to store the error in errored state.
69         Removal of ReadableJSStream::Reader as closed promise rejection error is directly retrieved from the ReadableStream.
70         Moved the creation of reader directly in ReadableStream.
71
72         Next step should be to remove ReadableStreamReader::m_state and to delegate the handling of ReadableStreamReader closed promise callbacks to ReadableStream.
73
74         No change in behavior.
75
76         * Modules/streams/ReadableStream.cpp:
77         (WebCore::ReadableStream::changeStateToClosed):
78         (WebCore::ReadableStream::changeStateToErrored):
79         (WebCore::ReadableStream::getReader):
80         * Modules/streams/ReadableStream.h:
81         (WebCore::ReadableStream::reader):
82         * Modules/streams/ReadableStreamReader.cpp:
83         (WebCore::ReadableStreamReader::clean):
84         (WebCore::ReadableStreamReader::ref):
85         (WebCore::ReadableStreamReader::deref):
86         (WebCore::ReadableStreamReader::closed):
87         (WebCore::ReadableStreamReader::changeStateToClosed):
88         (WebCore::ReadableStreamReader::changeStateToErrored):
89         * Modules/streams/ReadableStreamReader.h:
90         (WebCore::ReadableStreamReader::ReadableStreamReader):
91         * Modules/streams/ReadableStreamReader.idl:
92         * bindings/js/JSReadableStreamCustom.cpp:
93         (WebCore::JSReadableStream::getReader):
94         * bindings/js/JSReadableStreamReaderCustom.cpp:
95         (WebCore::JSReadableStreamReader::closed):
96         (WebCore::constructJSReadableStreamReader):
97         * bindings/js/ReadableJSStream.cpp:
98         (WebCore::ReadableJSStream::storeError):
99         (WebCore::ReadableJSStream::ReadableJSStream): Deleted.
100         * bindings/js/ReadableJSStream.h:
101
102 2015-05-17  Alexey Proskuryakov  <ap@apple.com>
103
104         Crash when uploading huge files to YouTube or Google Drive
105         https://bugs.webkit.org/show_bug.cgi?id=145083
106         rdar://problem/15468529
107
108         Reviewed by Darin Adler.
109
110         This fixes the crash, but uploading will fail.
111
112         * fileapi/FileReaderLoader.cpp:
113         (WebCore::FileReaderLoader::start): Tell SubresourceLoader to not store a copy of
114         all received data, FileReaderLoader has its own buffer.
115         (WebCore::FileReaderLoader::didReceiveResponse): Fixed a bounds check - not every
116         64-bit value that doesn't fit into 32 bits is negative. With this, FileReader fails
117         on huge files right away, as intended.
118         (WebCore::FileReaderLoader::didReceiveData): Fixed multiple bugs in code that's
119         executed when size is not available upfront. This is the code that used to crash,
120         but with the above fix, it's not executed by YouTube.
121         Not only overflow was handled incorrectly, but even simply growing a buffer for
122         append was buggy.
123
124 2015-05-16  Zalan Bujtas  <zalan@apple.com>
125
126         REGRESSION (Subpixel): Dashed underline is missing when box is positioned at subpixels.
127         https://bugs.webkit.org/show_bug.cgi?id=145097
128         rdar://problem/18588415
129
130         Reviewed by Simon Fraser.
131
132         Dashed and dotted border painting needs clipping in order to properly display corners.
133         Similarly to solid border's quad calculation, we pixelsnap the border positions before computing the clipping quad values.
134
135         Test: fast/borders/dashed-border-on-subpixel-position.html
136               fast/borders/dotted-border-on-subpixel-position.html
137
138         * rendering/RenderBoxModelObject.cpp:
139         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
140
141 2015-05-16  Sungmann Cho  <sungmann.cho@navercorp.com>
142
143         Remove styleText() and applyStyleText() from InspectorStyle.
144         https://bugs.webkit.org/show_bug.cgi?id=145093
145
146         Reviewed by Darin Adler.
147
148         styleText() and applyStyleText() in InspectorStyle are private aliases for the public
149         accessors in the same class but are rarely used. I think it would be better off removing
150         these aliases and updating all the current call sites to use the public accessors directly
151         as noted in InspectorStyleSheet.h.
152
153         No new tests, no behavior change.
154
155         * inspector/InspectorStyleSheet.cpp:
156         (WebCore::InspectorStyle::populateAllProperties):
157         * inspector/InspectorStyleSheet.h:
158
159 2015-05-16  Sungmann Cho  <sungmann.cho@navercorp.com>
160
161         Remove MessageType variant of addMessageToConsole() from ChromeClient.
162         https://bugs.webkit.org/show_bug.cgi?id=145095
163
164         Reviewed by Darin Adler.
165
166         All addMessageToConsole() in ChromeClient are exactly the same thing.
167         So there is no reason to keep all this methods.
168
169         No new tests, no behavior change.
170
171         * page/ChromeClient.h:
172         * page/PageConsoleClient.cpp:
173         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
174
175 2015-05-15  Sam Weinig  <sam@webkit.org>
176
177         Add getElementById to DocumentFragment
178         https://bugs.webkit.org/show_bug.cgi?id=145094
179
180         Reviewed by Alexey Proskuryakov.
181
182         Match the latest DOM standard and other browsers by adding getElementById
183         to DocumentFragment in addition to Document and SVGSVGElement. Add NonElementParentNode
184         interface that the DOM standard defines.
185
186         Test: fast/dom/DocumentFragment/getElementById.html
187
188         * DerivedSources.make:
189         * WebCore.xcodeproj/project.pbxproj:
190         Add NonElementParentNode.idl
191
192         * dom/Document.idl:
193         Mark Document as implementing NonElementParentNode and remove now redundant getElementById
194         declaration.
195
196         * dom/DocumentFragment.cpp:
197         (WebCore::DocumentFragment::getElementById):
198         * dom/DocumentFragment.h:
199         Add implementation of getElementById for DocumentFragments. Add a fast path for ShadowRoots
200         which can take advantage of the fact that they are TreeScopes to use the elements by id cache
201         in TreeScrope.
202
203         * dom/DocumentFragment.idl:
204         Mark DocumentFragment as implementing NonElementParentNode.
205
206         * dom/NonElementParentNode.idl: Copied from Source/WebCore/dom/NonDocumentTypeChildNode.idl.
207         Added.
208
209         * svg/SVGSVGElement.cpp:
210         (WebCore::SVGSVGElement::getElementById):
211         * svg/SVGSVGElement.h:
212         * svg/SVGSVGElement.idl:
213         Convert to taking an AtomicString to match other getElementByIds.
214
215 2015-05-15  Antti Koivisto  <antti@apple.com>
216
217         When redirecting to data URL use HTTP response for same origin policy checks
218         https://bugs.webkit.org/show_bug.cgi?id=145054
219         rdar://problem/20299050
220
221         Reviewed by Alexey Proskuryakov.
222
223         Test: http/tests/security/canvas-remote-read-data-url-image-redirect.html
224
225         * dom/ScriptElement.cpp:
226         (WebCore::ScriptElement::notifyFinished):
227         * dom/ScriptExecutionContext.cpp:
228         (WebCore::ScriptExecutionContext::sanitizeScriptError):
229         * html/canvas/CanvasRenderingContext.cpp:
230         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
231         * loader/ImageLoader.cpp:
232         (WebCore::ImageLoader::notifyFinished):
233         * loader/MediaResourceLoader.cpp:
234         (WebCore::MediaResourceLoader::responseReceived):
235         * loader/TextTrackLoader.cpp:
236         (WebCore::TextTrackLoader::notifyFinished):
237         * loader/cache/CachedImage.cpp:
238         (WebCore::CachedImage::isOriginClean):
239         * loader/cache/CachedResource.cpp:
240         (WebCore::CachedResource::passesAccessControlCheck):
241         (WebCore::CachedResource::passesSameOriginPolicyCheck):
242
243             Factor repeatedly used same origin policy test into a function.
244
245         (WebCore::CachedResource::redirectReceived):
246
247             When redirecting to a data URL save the redirect response.
248
249         (WebCore::CachedResource::responseForSameOriginPolicyChecks):
250
251             In case we got redirected to data use that response instead of the final data response for policy checks.
252
253         * loader/cache/CachedResource.h:
254
255 2015-05-16  Jon Lee  <jonlee@apple.com>
256
257         [iOS] wireless playback picker button is drawn incorrectly
258         https://bugs.webkit.org/show_bug.cgi?id=145057
259         rdar://problem/20877518
260
261         Reviewed by Jer Noble.
262
263         * Modules/mediacontrols/mediaControlsiOS.js:
264         (ControllerIOS.prototype.updateWirelessTargetPickerButton): This method is
265         defined in Controller, but is only meant to run on Macs. Override it with
266         an empty function for iOS.
267
268 2015-05-15  Simon Fraser  <simon.fraser@apple.com>
269
270         REGRESSION (r183300): Background missing on top links on apple.com
271         https://bugs.webkit.org/show_bug.cgi?id=145079
272         rdar://problem/20914252
273
274         Reviewed by Tim Horton.
275         
276         Re-land r184421 with a fix to check against rects.coverageRect
277         rather than the stale m_coverageRect.
278
279         Test: compositing/visible-rect/backing-change-height-from-zero.html
280
281         * platform/graphics/ca/GraphicsLayerCA.cpp:
282         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
283         * rendering/RenderLayerBacking.cpp:
284         (WebCore::RenderLayerBacking::shouldSkipLayerInDump):
285
286 2015-05-15  Matt Baker  <mattbaker@apple.com>
287
288         Web Inspector: REGRESSION (r181625): Timeline recording started from console.profile is always empty
289         https://bugs.webkit.org/show_bug.cgi?id=144882
290
291         Reviewed by Joseph Pecoraro.
292
293         A timeline recording will always be stopped before the end of the current run loop is observed. Before
294         dispatching the recording stopped event, any events that are currently in progress should be considered
295         complete and sent to the frontend.
296
297         * inspector/InspectorTimelineAgent.cpp:
298         (WebCore::InspectorTimelineAgent::internalStop):
299
300 2015-05-15  Commit Queue  <commit-queue@webkit.org>
301
302         Unreviewed, rolling out r184421.
303         https://bugs.webkit.org/show_bug.cgi?id=145087
304
305         Introduced 42 layout test failures (Requested by rniwa on
306         #webkit).
307
308         Reverted changeset:
309
310         "REGRESSION (r183300): Background missing on top links on
311         apple.com"
312         https://bugs.webkit.org/show_bug.cgi?id=145079
313         http://trac.webkit.org/changeset/184421
314
315 2015-05-15  Simon Fraser  <simon.fraser@apple.com>
316
317         REGRESSION (r183300): Background missing on top links on apple.com
318         https://bugs.webkit.org/show_bug.cgi?id=145079
319         rdar://problem/20914252
320
321         Reviewed by Tim Horton.
322
323         GraphicsLayerCA::setVisibleAndCoverageRects() only set the m_intersectsCoverageRect
324         flag if the coverage rect changed, but it doesn't if you simply change the size of
325         the layer.
326
327         Instead, always re-evaluate the intersection, and set the CoverageRectChanged bit
328         if it changes.
329
330         Test: compositing/visible-rect/backing-change-height-from-zero.html
331
332         * platform/graphics/ca/GraphicsLayerCA.cpp:
333         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
334         * rendering/RenderLayerBacking.cpp:
335         (WebCore::RenderLayerBacking::shouldSkipLayerInDump): Don't skip any layers in a
336         debug layer dump, to assist debugging.
337
338 2015-05-15  Sam Weinig  <sam@webkit.org>
339
340         Move HTMLElement's children property to ParentNode
341         https://bugs.webkit.org/show_bug.cgi?id=145072
342
343         Reviewed by Chris Dumez.
344
345         Match the latest DOM standard and other browsers by moving the children property
346         to ParentNode, thus exposing it on Element, Document and DocumentFragment.
347
348         Test: fast/dom/ParentNode-children.html
349
350         * dom/ContainerNode.cpp:
351         (WebCore::ContainerNode::children):
352         Moved implementation from HTMLElement to here.
353
354         (WebCore::ContainerNode::ensureCachedHTMLCollection):
355         (WebCore::ContainerNode::cachedHTMLCollection):
356         Moved implementation from Element to here so that ContainerNode::children
357         can use it.
358
359         (WebCore::ContainerNode::firstElementChild):
360         (WebCore::ContainerNode::lastElementChild):
361         (WebCore::ContainerNode::childElementCount):
362         Remove unnecessary assertions.
363
364         * dom/ContainerNode.h:
365         Moved declarations from HTMLElement and Element to here.
366
367         * dom/Element.cpp:
368         (WebCore::Element::ensureCachedHTMLCollection): Deleted.
369         (WebCore::Element::cachedHTMLCollection): Deleted.
370         * dom/Element.h:
371         Moved to ContainerNode.
372
373         * dom/Node.cpp:
374         (WebCore::Node::previousElementSibling):
375         (WebCore::Node::nextElementSibling):
376         Remove unnecessary assertions.
377
378         * dom/ParentNode.idl:
379         Moved the children property here from HTMLElement.
380
381         * html/HTMLElement.cpp:
382         (WebCore::HTMLElement::children): Deleted.
383         * html/HTMLElement.h:
384         Moved to ContainerNode.
385
386         * html/HTMLElement.idl:
387         Get rid of the children property for all bindings except Objective-C which needs
388         to keep it to avoid changing the public API.
389
390 2015-05-15  Zalan Bujtas  <zalan@apple.com>
391
392         WebCore ASan debug build fails. ERROR: WebCore has a weak external symbol in it.
393         https://bugs.webkit.org/show_bug.cgi?id=145070
394
395         Reviewed by David Kilzer.
396
397         Build fix.
398
399         * Configurations/WebCore.unexp:
400
401 2015-05-15  Beth Dakin  <bdakin@apple.com>
402
403         Prefix force on MouseEvent and add constants for click and force click values
404         https://bugs.webkit.org/show_bug.cgi?id=145065
405         -and corresponding-
406         rdar://problem/20770052
407
408         Reviewed by Tim Horton.
409
410         (WebCore::MouseEvent::webkitForce):
411         * dom/MouseEvent.idl:
412
413 2015-05-15  Jer Noble  <jer.noble@apple.com>
414
415         [MediaControls] Refactor media controls & bring improvements made to iOS controls to Mac.
416         https://bugs.webkit.org/show_bug.cgi?id=144973
417
418         Reviewed by Dean Jackson.
419
420         Pull improvements made to the iOS media controls back into the Mac controls by moving
421         code from mediaControlsiOS.js into MediaControlsApple.js.
422
423         The largest refactored feature is the ability to drop individual controls from the media
424         controls when the video is too small to contain them. To allow these controls to resize
425         dynamically, a new "resize" event is fired inside the media element's shadow DOM.
426
427         * Modules/mediacontrols/mediaControlsApple.css:
428         (audio::-webkit-media-controls-panel .dropped): Added; sets "display: none".
429         * Modules/mediacontrols/mediaControlsApple.js:
430         (Controller): Set defaults for new variables.
431         (Controller.prototype.updateControls): Update the controls width; moved from iOS.js.
432         (Controller.prototype.handleReadyStateChange): Update the controls; moved from iOS.js.
433         (Controller.prototype.handleTimeUpdate): Update the progress; moved from iOS.js.
434         (Controller.prototype.handleTimelineInput): Pause if scrubbing; moved from iOS.js.
435         (Controller.prototype.handleTimelineChange): Update the progress; moved from iOS.js.
436         (Controller.prototype.showControls): Update the controls width; moved from iOS.js.
437         (Controller.prototype.hideControls): Removed _potentiallyScrubbing check; not needed due to changes
438             to controlsAlwaysVisible().
439         (Controller.prototype.scheduleUpdateLayoutForDisplayedWidth): Moved from iOS.js.
440         (Controller.prototype.isControlVisible): Added; checks whether control is parented & not hidden.
441         (Controller.prototype.updateLayoutForDisplayedWidth): Moved from iOS.js and refactored.
442         (Controller.prototype.controlsAlwaysVisible): Return true if scrubbing.
443         (Controller.prototype.updateHasAudio): Check currentPlaybackTargetIsWireless(); moved from iOS.js.
444         (Controller.prototype.get scrubbing): Simple getter for _scrubbing.
445         (Controller.prototype.set scrubbing): Check play state if scrubbing; start playback (if necessary)
446             if not scrubbing.
447         (Controller.prototype.get pageScaleFactor): Moved from iOS.js.
448         (Controller.prototype.set pageScaleFactor): Ditto.
449         (Controller.prototype.handleRootResize): Schedule an update of the contrtols width.
450
451         Remove a bunch of newly unnecessary code from the iOS media controls:
452
453         * Modules/mediacontrols/mediaControlsiOS.js:
454         (ControllerIOS):
455         (ControllerIOS.prototype.createControls): Remove ivars moved into Apple.js.
456         (ControllerIOS.prototype.configureInlineControls): Remove spacer; made unnecessary.
457         (ControllerIOS.prototype.showControls): Deleted.
458         (ControllerIOS.prototype.updateTime): Deleted.
459         (ControllerIOS.prototype.handleTimelineTouchStart): Just call "scrubbing = true", handled in Apple.js.
460         (ControllerIOS.prototype.handleTimelineTouchEnd): Just call "scrubbing = false", handled in Apple.js.
461         (ControllerIOS.prototype.handleReadyStateChange): Deleted.
462         (ControllerIOS.prototype.setPlaying): Don't check _timelineIsHidden; not needed.
463         (ControllerIOS.prototype.get pageScaleFactor): Deleted.
464         (ControllerIOS.prototype.set pageScaleFactor): Deleted.
465         (ControllerIOS.prototype.scheduleUpdateLayoutForDisplayedWidth): Deleted.
466         (ControllerIOS.prototypeupdateLayoutForDisplayedWidth): Deleted.
467
468         Fire a "resize" event at the shadow DOM root when layout results in a size change.
469
470         * html/HTMLMediaElement.cpp:
471         (WebCore::HTMLMediaElement::layoutSizeChanged): Fire the "resize" event at the shadow DOM.
472         * html/HTMLMediaElement.h:
473         * rendering/RenderMedia.cpp:
474         (WebCore::RenderMedia::layout): Trigger layoutSizeChanged()
475         * rendering/RenderMedia.h:
476
477         Drive-by fixes:
478
479         * Modules/mediacontrols/mediaControlsApple.js:
480         (Controller.prototype.createControls): aria-label text is totally wrong; removed.
481         (Controller.prototype.updateWirelessPlaybackStatus): Use class-names to hide controls, not inline styles.
482
483 2015-05-15  Alex Christensen  <achristensen@webkit.org>
484
485         [Content Extensions] Fail to load old content extension files
486         https://bugs.webkit.org/show_bug.cgi?id=145027
487
488         Reviewed by Eric Carlson.
489
490         * contentextensions/DFABytecode.h:
491
492 2015-05-15  Eric Carlson  <eric.carlson@apple.com>
493
494         Unreviewed build fix.
495
496         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Add clang pragmas to ignore
497         deprecation warnings.
498
499 2015-05-15  Jeremy Jones  <jeremyj@apple.com>
500
501         Limit alternate fullscreen with linked on or after.
502         https://bugs.webkit.org/show_bug.cgi?id=144894
503
504         Reviewed by Dean Jackson.
505
506         * platform/ios/WebCoreSystemInterfaceIOS.h: add new wkIOSSystemVersion
507
508 2015-05-15  Roger Fong  <roger_fong@apple.com>
509
510         Unreviewed. Revert part of r184361.
511
512         * Modules/mediacontrols/mediaControlsApple.js:
513         (Controller.prototype.configureInlineControls):
514         HI wants the buttons flipped.
515
516 2015-05-15  Sungmann Cho  <sungmann.cho@navercorp.com>
517
518         Fix trivial typo in TextEncodingDetectorICU.cpp.
519         https://bugs.webkit.org/show_bug.cgi?id=145055
520
521         Reviewed by Alexey Proskuryakov.
522
523         No new tests, no behavior change..
524
525         * platform/text/TextEncodingDetectorICU.cpp:
526         (WebCore::detectTextEncoding):
527
528 2015-05-15  Alexey Proskuryakov  <ap@apple.com>
529
530         Cyrillic top-level domains are displayed as punycode
531         https://bugs.webkit.org/show_bug.cgi?id=145024
532         rdar://problem/17747133
533         rdar://problem/14116594
534
535         Reviewed by Tim Horton.
536
537         Handling each TLD in code is annoying, but we can probably survive like this
538         for a few more years, and maybe we'll think of an entirely different way to deal
539         with non-ASCII domain labels in the meanwhile.
540
541         * platform/mac/WebCoreNSURLExtras.mm:
542         (WebCore::isSecondLevelDomainNameAllowedByTLDRules):
543         (WebCore::allCharactersAllowedByTLDRules):
544
545 2015-05-15  Roger Fong  <roger_fong@apple.com>
546
547         Cursor is displayed after full screen video controls fade away.
548         https://bugs.webkit.org/show_bug.cgi?id=145034.
549         <rdar://problem/20458604>
550
551         Reviewed by Jer Noble.
552
553         * Modules/mediacontrols/mediaControlsApple.css:
554         (video::-webkit-media-controls-panel):
555         Unnecessary cursor style is on the control panel while hidden but
556         the cursor will already be hidden anyways from being auto-hidden.
557         Causes style to change when controls are hidden,
558         which causes the cursor to reappear.
559
560 2015-05-15  Roger Fong  <roger_fong@apple.com>
561
562         Checkmark on OFF option of captions sometimes does not appear.
563         https://bugs.webkit.org/show_bug.cgi?id=145060.
564         <rdar://problem/19388333>
565
566         Reviewed by Eric Carlson.
567
568         * Modules/mediacontrols/mediaControlsApple.js:
569         (Controller.prototype.buildCaptionMenu):
570         Audio tracks don’t have an OFF option.
571         Remove related code to allow OFF option for subtitles to work properly.
572
573 2015-05-15  Zalan Bujtas  <zalan@apple.com>
574
575         White edge on animating panel on http://rokkosunnyvale.com
576         https://bugs.webkit.org/show_bug.cgi?id=144986
577         rdar://problem/20907683
578
579         Reviewed by Simon Fraser.
580
581         Background image geometry calculation needs to be based on the final painting size of the container
582         in order to accurately compute tile sizes, repeating positions etc.
583         The container's size is pixelsnapped at painting using absolute coordinates. This patch
584         ensures that we snap to the same size while computing background geometry.
585
586         Test: fast/images/background-image-size-changes-fractional-position.html
587
588         * rendering/InlineFlowBox.cpp:
589         (WebCore::InlineFlowBox::paintBoxDecorations):
590         * rendering/RenderBox.cpp:
591         (WebCore::RenderBox::paintBoxDecorations):
592         (WebCore::RenderBox::paintBackground):
593         (WebCore::RenderBox::getBackgroundPaintedExtent):
594         (WebCore::RenderBox::computeBackgroundIsKnownToBeObscured):
595         (WebCore::RenderBox::maskClipRect):
596         (WebCore::RenderBox::repaintLayerRectsForImage): unable to get absolute coords.
597         * rendering/RenderBox.h:
598         * rendering/RenderBoxModelObject.cpp:
599         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
600         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
601         (WebCore::RenderBoxModelObject::getGeometryForBackgroundImage):
602         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground):
603         * rendering/RenderBoxModelObject.h:
604         * rendering/RenderFieldset.cpp:
605         (WebCore::RenderFieldset::paintBoxDecorations):
606         * rendering/RenderImage.cpp:
607         (WebCore::RenderImage::boxShadowShouldBeAppliedToBackground):
608         (WebCore::RenderImage::computeBackgroundIsKnownToBeObscured):
609         * rendering/RenderImage.h:
610         * rendering/RenderLayer.cpp: unable to get absolute coords.
611         (WebCore::RenderLayer::calculateClipRects):
612         * rendering/RenderLayerBacking.cpp:
613         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage): currently not used.
614         * rendering/RenderObject.h:
615         (WebCore::RenderObject::computeBackgroundIsKnownToBeObscured):
616         (WebCore::RenderObject::backgroundIsKnownToBeObscured):
617         * rendering/RenderTable.cpp:
618         (WebCore::RenderTable::paintBoxDecorations):
619         * rendering/RenderTableCell.cpp:
620         (WebCore::RenderTableCell::boxShadowShouldBeAppliedToBackground):
621         * rendering/RenderTableCell.h:
622
623 2015-05-15  Jer Noble  <jer.noble@apple.com>
624
625         Crash in RenderFlowThread::popFlowThreadLayoutState() due to mismatched push/pop count
626         https://bugs.webkit.org/show_bug.cgi?id=145042
627
628         Reviewed by David Hyatt.
629
630         RenderFlowThread previously used a ListHashSet to store its stack of active objects. This
631         is problematic because, if the same object is pushed twice, only a single entry of that
632         object is added to the stack. After this occurs, a matching number of pushes will pop too
633         many items off the stack, causing a crash when popping a stack with zero items. This
634         specifically happens in FrameView::layout(), which will push its root renderer on the stack
635         of active items, and then ask the root to layout(), which will attempt to push itself on the
636         stack of active items.
637
638         Instead of a ListHashSet, use a Vector, which has similar memory characteristics and no 
639         uniqueness requirements.
640
641         * rendering/RenderFlowThread.cpp:
642         (WebCore::RenderFlowThread::pushFlowThreadLayoutState):
643         (WebCore::RenderFlowThread::popFlowThreadLayoutState):
644         * rendering/RenderFlowThread.h:
645
646 2015-05-15  Per Arne Vollan  <peavo@outlook.com>
647
648         [Curl] WebSocket platform part is not implemented.
649         https://bugs.webkit.org/show_bug.cgi?id=144628
650
651         Reviewed by Darin Adler.
652
653         Add Curl platform code implementation for WebSockets.
654
655         * platform/network/curl/SocketStreamHandle.h:
656         (WebCore::SocketStreamHandle::create):
657         (WebCore::SocketStreamHandle::SocketData::SocketData):
658         * platform/network/curl/SocketStreamHandleCurl.cpp:
659         (WebCore::SocketStreamHandle::SocketStreamHandle):
660         (WebCore::SocketStreamHandle::~SocketStreamHandle):
661         (WebCore::SocketStreamHandle::platformSend):
662         (WebCore::SocketStreamHandle::platformClose):
663         (WebCore::SocketStreamHandle::readData):
664         (WebCore::SocketStreamHandle::sendData):
665         (WebCore::SocketStreamHandle::waitForAvailableData):
666         (WebCore::SocketStreamHandle::startThread):
667         (WebCore::SocketStreamHandle::stopThread):
668         (WebCore::SocketStreamHandle::didReceiveData):
669         (WebCore::SocketStreamHandle::didOpenSocket):
670         (WebCore::SocketStreamHandle::createCopy):
671
672 2015-05-14  Carlos Garcia Campos  <cgarcia@igalia.com>
673
674         REGRESSION(r183861): [SOUP] Downloads are broken when using the Network Process
675         https://bugs.webkit.org/show_bug.cgi?id=144738
676
677         Reviewed by Alexey Proskuryakov.
678
679         Add ResourceHandle::releaseForDownload() that releases the current
680         handle to be used as a download.
681
682         * platform/network/ResourceHandle.h:
683         * platform/network/soup/ResourceHandleSoup.cpp:
684         (WebCore::ResourceHandle::releaseForDownload):
685
686 2015-05-15  Zan Dobersek  <zdobersek@igalia.com>
687
688         [GTK] Fix PlatformDisplayWayland construction error, implement the destructor
689         https://bugs.webkit.org/show_bug.cgi?id=144997
690
691         Reviewed by Carlos Garcia Campos.
692
693         The PlatformDisplayWayland constructor is private, so we can't use
694         std::make_unique<>() to construct an object of this class.
695
696         Implement the PlatformDisplayWayland destructor, cleaning out all
697         the Wayland resources, if present.
698
699         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
700         (WebCore::PlatformDisplayWayland::create):
701         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
702         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
703
704 2015-05-14  Zalan Bujtas  <zalan@apple.com>
705
706         Images on www.fitstylelife.com jiggle on hover.
707         https://bugs.webkit.org/show_bug.cgi?id=145020
708         rdar://problem/20885337
709
710         Reviewed by Simon Fraser.
711
712         This patch ensures that the clipping layer of a composited content is pixel snapped properly.
713
714         Tests: compositing/composited-parent-clipping-layer-on-subpixel-position.html
715                compositing/parent-clipping-layer-on-subpixel-position.html
716
717         * rendering/RenderLayerBacking.cpp:
718         (WebCore::RenderLayerBacking::updateGeometry):
719
720 2015-05-14  Chris Dumez  <cdumez@apple.com>
721
722         Have DOMWindow::createWindow() take references to frames
723         https://bugs.webkit.org/show_bug.cgi?id=145037
724
725         Reviewed by Gyuyoung Kim.
726
727         Have DOMWindow::createWindow() take references to frames instead of
728         pointers as they are expected to be non-null. Also return a RefPtr
729         instead of a PassRefPtr.
730
731         * inspector/InspectorFrontendClientLocal.cpp:
732         (WebCore::InspectorFrontendClientLocal::openInNewTab):
733         * loader/FrameLoader.cpp:
734         (WebCore::createWindow):
735         * loader/FrameLoader.h:
736         * page/DOMWindow.cpp:
737         (WebCore::DOMWindow::createWindow):
738         (WebCore::DOMWindow::open):
739         (WebCore::DOMWindow::showModalDialog):
740         * page/DOMWindow.h:
741
742 2015-05-14  Simon Fraser  <simon.fraser@apple.com>
743
744         REGRESSION (r183794): Garbage tiles when body background switches to fixed
745         https://bugs.webkit.org/show_bug.cgi?id=145032
746         rdar://problem/20963679
747
748         Reviewed by Dean Jackson.
749         
750         After r183794 (or possibly an earlier commit), we failed to dynamically update
751         the configuration of layers that handled fixed background attachment on the root.
752         
753         This would result in unpainted tiles, and non-fixed-background behavior.
754         
755         Fix by calling RenderLayerCompositor::rootOrBodyStyleChanged() whenever the
756         style changes on the root or body renderers, and triggering a compositing update
757         if the fixedness of the background changes. It calls the existing rootBackgroundTransparencyChanged()
758         if the color changes.
759
760         Test: platform/mac-wk2/tiled-drawing/toggle-to-fixed-background.html
761
762         * rendering/RenderBox.cpp:
763         (WebCore::RenderBox::styleDidChange):
764         * rendering/RenderLayerCompositor.cpp:
765         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
766         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
767         * rendering/RenderLayerCompositor.h:
768
769 2015-05-14  Commit Queue  <commit-queue@webkit.org>
770
771         Unreviewed, rolling out r184359 and r184362.
772         https://bugs.webkit.org/show_bug.cgi?id=145035
773
774         Introduced a crash in six media element tests (Requested by
775         rniwa on #webkit).
776
777         Reverted changesets:
778
779         "[MediaControls] Refactor media controls & bring improvements
780         made to iOS controls to Mac."
781         https://bugs.webkit.org/show_bug.cgi?id=144973
782         http://trac.webkit.org/changeset/184359
783
784         "Unreviewed build fix after r184359; typo."
785         http://trac.webkit.org/changeset/184362
786
787 2015-05-14  Jer Noble  <jer.noble@apple.com>
788
789         Unreviewed build fix after r184359; typo.
790
791         * html/HTMLMediaElement.cpp:
792         (WebCore::HTMLMediaElement::layoutSizeChanged):
793
794 2015-05-14  Roger Fong  <roger_fong@apple.com>
795
796         Adjust button CSS and positioning in preparation.
797         https://bugs.webkit.org/show_bug.cgi?id=144973.
798         <rdar://problem/20306227>
799
800         Reviewed by Dean Jackson.
801
802         The only visual change here is the swapping of the rewind and play button positions.
803         Also, position buttons based off of both left and right margins instead of just one of the two.
804         This allows the controls drop off to work without having to use a spacer element to take the place
805         of the timeline if the controls are too small.
806         * Modules/mediacontrols/mediaControlsApple.css:
807         (audio::-webkit-media-controls-rewind-button):
808         (audio::-webkit-media-controls-play-button):
809         (audio::-webkit-media-controls-panel .mute-box):
810         (audio::-webkit-media-controls-wireless-playback-picker-button):
811         (audio::-webkit-media-controls-toggle-closed-captions-button):
812         (audio::-webkit-media-controls-fullscreen-button):
813         (audio::-webkit-media-controls-fullscreen-button.exit):
814         (audio::-webkit-media-controls-time-remaining-display):
815         (audio:-webkit-full-screen::-webkit-media-controls-toggle-closed-captions-button):
816         (audio:-webkit-full-screen::-webkit-media-controls-wireless-playback-picker-button):
817         * Modules/mediacontrols/mediaControlsApple.js:
818         (Controller.prototype.configureInlineControls):
819
820 2015-05-14  Dean Jackson  <dino@apple.com>
821
822         MediaControls: controls are live even when invisible
823         https://bugs.webkit.org/show_bug.cgi?id=145029
824         <rdar://problem/20865442>
825
826         Reviewed by Jer Noble.
827
828         When the controls are invisible they should ignore touch/mouse
829         events.
830
831         * Modules/mediacontrols/mediaControlsiOS.css: Add pointer-events: none where appropriate.
832         (video::-webkit-media-controls-panel-container):
833         (video::-webkit-media-controls-panel-background):
834         (video::-webkit-media-controls-panel):
835         (video::-webkit-media-controls-panel.paused):
836
837 2015-05-14  Jer Noble  <jer.noble@apple.com>
838
839         [MediaControls] Refactor media controls & bring improvements made to iOS controls to Mac.
840         https://bugs.webkit.org/show_bug.cgi?id=144973
841
842         Reviewed by Dean Jackson.
843
844         Pull improvements made to the iOS media controls back into the Mac controls by moving
845         code from mediaControlsiOS.js into MediaControlsApple.js.
846
847         The largest refactored feature is the ability to drop individual controls from the media
848         controls when the video is too small to contain them. To allow these controls to resize
849         dynamically, a new "resize" event is fired inside the media element's shadow DOM.
850
851         * Modules/mediacontrols/mediaControlsApple.css:
852         (audio::-webkit-media-controls-panel .dropped): Added; sets "display: none".
853         * Modules/mediacontrols/mediaControlsApple.js:
854         (Controller): Set defaults for new variables.
855         (Controller.prototype.updateControls): Update the controls width; moved from iOS.js.
856         (Controller.prototype.handleReadyStateChange): Update the controls; moved from iOS.js.
857         (Controller.prototype.handleTimeUpdate): Update the progress; moved from iOS.js.
858         (Controller.prototype.handleTimelineInput): Pause if scrubbing; moved from iOS.js.
859         (Controller.prototype.handleTimelineChange): Update the progress; moved from iOS.js.
860         (Controller.prototype.showControls): Update the controls width; moved from iOS.js.
861         (Controller.prototype.hideControls): Removed _potentiallyScrubbing check; not needed due to changes
862             to controlsAlwaysVisible().
863         (Controller.prototype.scheduleUpdateLayoutForDisplayedWidth): Moved from iOS.js.
864         (Controller.prototype.isControlVisible): Added; checks whether control is parented & not hidden.
865         (Controller.prototype.updateLayoutForDisplayedWidth): Moved from iOS.js and refactored.
866         (Controller.prototype.controlsAlwaysVisible): Return true if scrubbing.
867         (Controller.prototype.updateHasAudio): Check currentPlaybackTargetIsWireless(); moved from iOS.js.
868         (Controller.prototype.get scrubbing): Simple getter for _scrubbing.
869         (Controller.prototype.set scrubbing): Check play state if scrubbing; start playback (if necessary)
870             if not scrubbing.
871         (Controller.prototype.get pageScaleFactor): Moved from iOS.js.
872         (Controller.prototype.set pageScaleFactor): Ditto.
873         (Controller.prototype.handleRootResize): Schedule an update of the contrtols width.
874
875         Remove a bunch of newly unnecessary code from the iOS media controls:
876
877         * Modules/mediacontrols/mediaControlsiOS.js:
878         (ControllerIOS):
879         (ControllerIOS.prototype.createControls): Remove ivars moved into Apple.js.
880         (ControllerIOS.prototype.configureInlineControls): Remove spacer; made unnecessary.
881         (ControllerIOS.prototype.showControls): Deleted.
882         (ControllerIOS.prototype.updateTime): Deleted.
883         (ControllerIOS.prototype.handleTimelineTouchStart): Just call "scrubbing = true", handled in Apple.js.
884         (ControllerIOS.prototype.handleTimelineTouchEnd): Just call "scrubbing = false", handled in Apple.js.
885         (ControllerIOS.prototype.handleReadyStateChange): Deleted.
886         (ControllerIOS.prototype.setPlaying): Don't check _timelineIsHidden; not needed.
887         (ControllerIOS.prototype.get pageScaleFactor): Deleted.
888         (ControllerIOS.prototype.set pageScaleFactor): Deleted.
889         (ControllerIOS.prototype.scheduleUpdateLayoutForDisplayedWidth): Deleted.
890         (ControllerIOS.prototypeupdateLayoutForDisplayedWidth): Deleted.
891
892         Fire a "resize" event at the shadow DOM root when layout results in a size change.
893
894         * html/HTMLMediaElement.cpp:
895         (WebCore::HTMLMediaElement::layoutSizeChanged): Fire the "resize" event at the shadow DOM.
896         * html/HTMLMediaElement.h:
897         * rendering/RenderMedia.cpp:
898         (WebCore::RenderMedia::layout): Trigger layoutSizeChanged()
899         * rendering/RenderMedia.h:
900
901         Drive-by fixes:
902
903         * Modules/mediacontrols/mediaControlsApple.js:
904         (Controller.prototype.createControls): aria-label text is totally wrong; removed.
905         (Controller.prototype.updateWirelessPlaybackStatus): Use class-names to hide controls, not inline styles.
906
907 2015-05-13  Ryosuke Niwa  <rniwa@webkit.org>
908
909         Crash in ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline
910         https://bugs.webkit.org/show_bug.cgi?id=119068
911
912         Reviewed by Enrica Casucci.
913
914         The bug was caused by makeInsertedContentRoundTrippableWithHTMLTreeBuilder not updating
915         nodes kept tracked by insertedNodes and moveNodeOutOfAncestor stumbling upon it.
916
917         Fixed the bug by updating insertedNodes in makeInsertedContentRoundTrippableWithHTMLTreeBuilder.
918
919         Test: editing/inserting/insert-table-in-paragraph-crash.html
920
921         * editing/ReplaceSelectionCommand.cpp:
922         (WebCore::ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuilder):
923         (WebCore::ReplaceSelectionCommand::moveNodeOutOfAncestor):
924         * editing/ReplaceSelectionCommand.h:
925
926 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
927
928         [Mac] Expose more font weights for -apple-system
929         https://bugs.webkit.org/show_bug.cgi?id=144707
930
931         Reviewed by Simon Fraser.
932
933         Previously, when we parsed a CSS declaration of the form font: keyword; where keyword
934         is one of caption, icon, menu, message-box, small-caption, -webkit-mini-control, -webkit-small-control,
935         or -webkit-control (which html.css does for form controls), we would ask the system what the appropriate
936         system font is, get that font's family name, and synthesize a font-family CSS property for the element.
937         Then, later when we actually go to look up the font, we would look up the font by family name using this
938         information. However, this round-tripping of a font through a family name is actually lossy, and is not
939         guaranteed to preserve system-font-ness (which we use for various things including metrics calculations).
940
941         This patch modifies this logic to specify a token family name instead, which the font lookup code special
942         cases (and reacts by making the appropriate system-font lookup call). This approach is currently how iOS
943         handles these system fonts; this patch simply brings this approach to OS X.
944
945         There is also an added progression here. We used to simply call [NSFont fontWithName:size:] on the system
946         font family name (which the parser found for us) which entirely disregards weight. This means that we
947         used to be getting synthesized bold in form controls which ask for a heavy weight. Migrating to this
948         system-font aware call means that we get the real bold font instead of synthesized bold.
949
950         Once this system-font-ness is guaranteed to be preserved between parsing time and font lookup time, we
951         can safely migrate to using [NSFont systemFontOfSize:weight] instead of [NSFont systemFontOfSize:] on
952         platforms which support it.
953
954         Tests: fast/text/systemFont.html
955                fast/css/css2-system-fonts.html
956                fast/forms/select/optgroup-rendering.html
957                fast/forms/validation-message-appearance.html
958
959         * css/CSSParser.cpp:
960         (WebCore::CSSParser::parseSystemFont): Add a comment regarding why we are bothering with expanding out
961         the font property in the first place.
962         * platform/graphics/cocoa/FontCascadeCocoa.mm:
963         (WebCore::FontCascade::primaryFontIsSystemFont): Update to use new system font tokens.
964         * platform/graphics/mac/FontCacheMac.mm:
965         (WebCore::toNSFontWeight): New static method to map font weights to NSFontWeight constants available on
966         Yosemite and later.
967         (WebCore::fontWithFamilySpecialCase): Pull all these special-case font token name handling into a
968         separate function, which returns an Optional.
969         (WebCore::fontWithFamily):
970         * platform/mac/ThemeMac.mm:
971         (WebCore::ThemeMac::controlFont): Use the font token name instead of the generated system font family
972         name.
973         * platform/spi/mac/NSFontSPI.h: Add [NSFont systemFontWithSize:weight:] and the proper NSFontWeight
974         constants.
975         * rendering/RenderThemeMac.mm:
976         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Use the font token names instead of the
977         generated system font family name.
978         (WebCore::RenderThemeMac::setFontFromControlSize): Ditto.
979
980 2015-05-14  Roger Fong  <roger_fong@apple.com>
981
982         Add internals setting to disable wireless playback availability for layout tests
983         https://bugs.webkit.org/show_bug.cgi?id=145012.
984         <rdar://problem/20946504>
985
986         Reviewed by Eric Carlson.
987
988         * testing/InternalSettings.cpp:
989         (WebCore::InternalSettings::resetToConsistentState):
990         (WebCore::InternalSettings::setWirelessPlaybackDisabled):
991         * testing/InternalSettings.idl:
992
993 2015-05-14  Beth Dakin  <bdakin@apple.com>
994
995         Change range of possible forces for mouseforcechanged DOM event
996         https://bugs.webkit.org/show_bug.cgi?id=144987
997         -and corresponding-
998         rdar://problem/20472802
999
1000         Reviewed by Tim Horton.
1001
1002         Change to a 0-3 range.
1003         * platform/PlatformMouseEvent.h:
1004         * platform/mac/PlatformEventFactoryMac.mm:
1005         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
1006
1007 2015-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
1008
1009         Fix typo in RenderBox::instrinsicScrollbarLogicalWidth()
1010         https://bugs.webkit.org/show_bug.cgi?id=144999
1011
1012         Reviewed by Sergio Villar Senin.
1013
1014         Rename RenderBox::instrinsicScrollbarLogicalWidth() to
1015         RenderBox::intrinsicScrollbarLogicalWidth().
1016
1017         No new tests, no behavior changes.
1018
1019         * rendering/RenderBlock.cpp:
1020         (WebCore::RenderBlock::computeIntrinsicLogicalWidths):
1021         * rendering/RenderBlockFlow.cpp:
1022         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
1023         * rendering/RenderBox.cpp:
1024         (WebCore::RenderBox::intrinsicScrollbarLogicalWidth):
1025         (WebCore::RenderBox::instrinsicScrollbarLogicalWidth): Deleted.
1026         * rendering/RenderBox.h:
1027         * rendering/RenderDeprecatedFlexibleBox.cpp:
1028         (WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths):
1029         * rendering/RenderFlexibleBox.cpp:
1030         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
1031
1032 2015-05-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1033
1034         SharedBuffer::createWithContentsOfFile should use map file routines
1035         https://bugs.webkit.org/show_bug.cgi?id=144192
1036
1037         Reviewed by Darin Adler.
1038
1039         Made use of mmap routines within SharedBuffer::createWithContentsOfFile for EFL, GTK and Mac ports.
1040         If mapping is failing, it falls back to the previous version of SharedBuffer::createWithContentsOfFile renamed as
1041         SharedBuffer::createFromReadingFile (using open/read method).
1042         File content is mapped until SharedBuffer is cleared, destroyed or additional content is appended to the SharedBuffer.
1043
1044         A helper class, MappedFileData, is introduced to handle mapped files through calls to open/mmap/munmap/close.
1045
1046         Patch covered by existing layout tests and added unit tests.
1047
1048         * platform/FileSystem.cpp:
1049         (WebCore::MappedFileData::MappedFileData):
1050         (WebCore::MappedFileData::operator=):
1051         (WebCore::MappedFileData::~MappedFileData):
1052         * platform/FileSystem.h:
1053         (WebCore::MappedFileData::MappedFileData):
1054         (WebCore::MappedFileData::operator bool):
1055         (WebCore::MappedFileData::data):
1056         (WebCore::MappedFileData::size):
1057         * platform/SharedBuffer.cpp:
1058         (WebCore::SharedBuffer::SharedBuffer):
1059         (WebCore::SharedBuffer::createWithContentsOfFile): Making use of MappedFileData before using createFromReadingFile.
1060         (WebCore::SharedBuffer::size): Checking whether data is coming from a MappedFileData.
1061         (WebCore::SharedBuffer::data): Ditto.
1062         (WebCore::SharedBuffer::append): Ditto.
1063         (WebCore::SharedBuffer::clear): Clearing MappedFileData if needed.
1064         (WebCore::SharedBuffer::copy): Transferring mapped data to buffer if needed.
1065         (WebCore::SharedBuffer::getSomeData):
1066         (WebCore::SharedBuffer::maybeTransferMappedFileData):
1067         * platform/SharedBuffer.h:
1068         * platform/gtk/SharedBufferGtk.cpp:
1069         (WebCore::SharedBuffer::createFromReadingFile): renamed from createWithContentsOfFile.
1070         * platform/mac/SharedBufferMac.mm:
1071         (WebCore::SharedBuffer::createFromReadingFile): Dito.
1072         * platform/posix/SharedBufferPOSIX.cpp:
1073         (WebCore::SharedBuffer::createFromReadingFile): Ditto.
1074         * platform/win/SharedBufferWin.cpp:
1075         (WebCore::SharedBuffer::createFromReadingFile): Ditto.
1076
1077 2015-05-13  Simon Fraser  <simon.fraser@apple.com>
1078
1079         Get the ScriptController from the correct frame for media elements and plug-ins
1080         https://bugs.webkit.org/show_bug.cgi?id=144983
1081         rdar://problem/20692642&19943135
1082
1083         Reviewed by Sam Weinig.
1084
1085         HTMLMediaElement, QuickTimePluginReplacement and HTMLPlugInImageElement were
1086         getting the main frame's ScriptController instead of the one for their frame.
1087         This caused media controls JS to be running in the context of the main frame,
1088         which broke media controls which use getCSSCanvasContext() and -webkit-canvas.
1089         
1090         Fix by getting the frame via the element's document.
1091         
1092         Also undo r180584 which was working around this bug.
1093
1094         * Modules/mediacontrols/mediaControlsiOS.js:
1095         (ControllerIOS.prototype.drawTimelineBackground):
1096         * Modules/plugins/QuickTimePluginReplacement.mm:
1097         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
1098         (WebCore::QuickTimePluginReplacement::installReplacement):
1099         * html/HTMLMediaElement.cpp:
1100         (WebCore::HTMLMediaElement::updateCaptionContainer):
1101         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
1102         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1103         (WebCore::HTMLMediaElement::pageScaleFactorChanged):
1104         * html/HTMLPlugInImageElement.cpp:
1105         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
1106
1107 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
1108
1109         Fix trivial typos in ApplyBlockElementCommand
1110         https://bugs.webkit.org/show_bug.cgi?id=144984
1111
1112         Reviewed by Alexey Proskuryakov.
1113
1114         No new tests, no behavior change.
1115
1116         * editing/ApplyBlockElementCommand.cpp:
1117         (WebCore::ApplyBlockElementCommand::formatSelection):
1118         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
1119         (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded): Deleted.
1120         * editing/ApplyBlockElementCommand.h:
1121
1122 2015-05-13  David Kilzer  <ddkilzer@apple.com>
1123
1124         REGRESION (r179958): Crash in WebCore::DocumentLoader::detachFromFrame when -[id<WebPolicyDelegate> decidePolicyForMIMEType:request:frame:decisionListener:] fails to call -[id<WebPolicyDecisionListener> download|ignore|use]
1125         <http://webkit.org/b/144975>
1126
1127         Reviewed by Andy Estes.
1128
1129         This change reverts r179958.  It changes RELEASE_ASSERT*()
1130         statements back to Debug-only ASSERT*() statements.
1131
1132         * loader/DocumentLoader.cpp:
1133         (WebCore::DocumentLoader::~DocumentLoader):
1134         (WebCore::DocumentLoader::continueAfterContentPolicy):
1135         (WebCore::DocumentLoader::detachFromFrame):
1136
1137 2015-05-13  Antti Koivisto  <antti@apple.com>
1138
1139         Cached CSS image resources don't show up after reloading <http://nightly.webkit.org/start/>
1140         https://bugs.webkit.org/show_bug.cgi?id=144952
1141         rdar://problem/13387307
1142
1143         Reviewed by Oliver Hunt.
1144
1145         This is a symptom of a general problem that we don't revalidate subresources of cached parsed stylesheets.
1146
1147         Fix by tightening the check we perform when choosing to used the cached sheet. If there are expired subresources
1148         we reparse the sheet.
1149
1150         Test: http/tests/cache/stylesheet-sharing.html
1151
1152         * css/CSSCrossfadeValue.cpp:
1153         (WebCore::CSSCrossfadeValue::traverseSubresources):
1154         (WebCore::CSSCrossfadeValue::hasFailedOrCanceledSubresources): Deleted.
1155
1156             Replace hasFailedOrCanceledSubresources with general purpose subresource traversal functions.
1157
1158         * css/CSSCrossfadeValue.h:
1159         * css/CSSFilterImageValue.cpp:
1160         (WebCore::CSSFilterImageValue::traverseSubresources):
1161         (WebCore::CSSFilterImageValue::hasFailedOrCanceledSubresources): Deleted.
1162         * css/CSSFilterImageValue.h:
1163         * css/CSSFontFaceSrcValue.cpp:
1164         (WebCore::CSSFontFaceSrcValue::traverseSubresources):
1165         (WebCore::CSSFontFaceSrcValue::hasFailedOrCanceledSubresources): Deleted.
1166         * css/CSSFontFaceSrcValue.h:
1167         * css/CSSImageSetValue.cpp:
1168         (WebCore::CSSImageSetValue::traverseSubresources):
1169         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources): Deleted.
1170         * css/CSSImageSetValue.h:
1171         * css/CSSImageValue.cpp:
1172         (WebCore::CSSImageValue::traverseSubresources):
1173         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources): Deleted.
1174         * css/CSSImageValue.h:
1175         * css/CSSValue.cpp:
1176         (WebCore::CSSValue::traverseSubresources):
1177         (WebCore::CSSValue::hasFailedOrCanceledSubresources): Deleted.
1178         * css/CSSValue.h:
1179         * css/CSSValueList.cpp:
1180         (WebCore::CSSValueList::traverseSubresources):
1181         (WebCore::CSSValueList::hasFailedOrCanceledSubresources): Deleted.
1182         * css/CSSValueList.h:
1183         * css/StyleProperties.cpp:
1184         (WebCore::StyleProperties::traverseSubresources):
1185         (WebCore::StyleProperties::hasFailedOrCanceledSubresources): Deleted.
1186         * css/StyleProperties.h:
1187         * css/StyleSheetContents.cpp:
1188         (WebCore::traverseSubresourcesInRules):
1189         (WebCore::StyleSheetContents::traverseSubresources):
1190         (WebCore::StyleSheetContents::subresourcesAllowReuse):
1191
1192             Disallow reuse if there are expired subresources.
1193
1194         (WebCore::StyleSheetContents::isLoadingSubresources):
1195
1196             Testing support.
1197
1198         (WebCore::childRulesHaveFailedOrCanceledSubresources): Deleted.
1199         (WebCore::StyleSheetContents::hasFailedOrCanceledSubresources): Deleted.
1200         * css/StyleSheetContents.h:
1201         (WebCore::StyleSheetContents::loadCompleted):
1202         * html/HTMLLinkElement.cpp:
1203         (WebCore::HTMLLinkElement::setCSSStyleSheet):
1204         * loader/cache/CachedCSSStyleSheet.cpp:
1205         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
1206         * loader/cache/CachedCSSStyleSheet.h:
1207         * loader/cache/CachedImage.cpp:
1208         (WebCore::CachedImage::makeRevalidationDecision):
1209         (WebCore::CachedImage::mustRevalidateDueToCacheHeaders): Deleted.
1210
1211             Move the logging code out from this function (it requires frame access this function doesn't otherwise need)
1212             and refactor to return a decision enum.
1213
1214         * loader/cache/CachedImage.h:
1215         * loader/cache/CachedResource.cpp:
1216         (WebCore::CachedResource::makeRevalidationDecision):
1217         (WebCore::logResourceRevalidationReason): Deleted.
1218         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders): Deleted.
1219         * loader/cache/CachedResource.h:
1220         (WebCore::CachedResource::loadFailedOrCanceled):
1221         * loader/cache/CachedResourceLoader.cpp:
1222         (WebCore::logRevalidation):
1223         (WebCore::logResourceRevalidationDecision):
1224         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1225
1226             Move logging here.
1227
1228         * testing/Internals.cpp:
1229         (WebCore::Internals::isSharingStyleSheetContents):
1230         (WebCore::Internals::isStyleSheetLoadingSubresources):
1231         * testing/Internals.h:
1232         * testing/Internals.idl:
1233
1234 2015-05-13  Ryuan Choi  <ryuan.choi@navercorp.com>
1235
1236         [CoordinatedGraphics] Remove scaleFactor from SurfaceUpdateInfo
1237         https://bugs.webkit.org/show_bug.cgi?id=144935
1238
1239         Reviewed by Darin Adler.
1240
1241         The members of SurfaceUpdateInfo are only used to update tile except scaleFactor.
1242         So, this patch removes scaleFactor from SurfaceUpdateInfo.
1243         In addition, removes unnecessary parameters in createTile() 
1244
1245         No new tests because there is no behavior change.
1246
1247         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1248         (WebCore::CoordinatedGraphicsLayer::createTile):
1249         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1250         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
1251         (WebCore::CoordinatedTile::updateBackBuffer):
1252         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
1253         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
1254
1255 2015-05-13  Sam Weinig  <sam@webkit.org>
1256
1257         Modernize ContainerNode::childElementCount
1258         https://bugs.webkit.org/show_bug.cgi?id=144930
1259
1260         Reviewed by Darin Adler.
1261
1262         * dom/ContainerNode.cpp:
1263         (WebCore::ContainerNode::childElementCount):
1264         Use std::distance to compute the number of child elements.
1265
1266         * dom/ElementChildIterator.h:
1267         Add typedefs to make the child element iterators conform STL standards.
1268
1269 2015-05-13  Ryosuke Niwa  <rniwa@webkit.org>
1270
1271         REGRESSION(r183770): Crash inside WebEditorClient::shouldApplyStyle when applying underline
1272         https://bugs.webkit.org/show_bug.cgi?id=144949
1273         <rdar://problem/20895753>
1274
1275         Reviewed by Darin Adler.
1276
1277         The crash was caused by the variant of applyStyleToSelection that takes EditingStyle passing
1278         a null pointer to shouldApplyStyle when we're only applying text decoration changes so that
1279         m_mutableStyle in the editing style is null. This didn't reproduce in execCommand since we
1280         wouldn't call shouldApplyStyle in that case. It didn't reproduce in my manual testing because
1281         font panel also sets text shadow, which ends up filling up m_mutableStyle.
1282
1283         Fixed the bug by creating a mutable style properties when one is not provided by EditingStyle.
1284         Also fixed the "FIXME" in the function by converting text decoration changes to a corresponding
1285         text decoration value. The values passed to shouldApplyStyle now matches the old behavior prior
1286         to r183770.
1287
1288         Test: editing/style/underline-by-user.html
1289
1290         * editing/EditingStyle.cpp:
1291         (WebCore::EditingStyle::styleWithResolvedTextDecorations): Added.
1292         * editing/EditingStyle.h:
1293         * editing/Editor.cpp:
1294         (WebCore::Editor::applyStyleToSelection): Use styleWithResolvedTextDecorations to avoid the crash.
1295
1296 2015-05-13  Eric Carlson  <eric.carlson@apple.com>
1297
1298         Work around HTMLMediaElement::documentDidResumeFromPageCache being called twice
1299         https://bugs.webkit.org/show_bug.cgi?id=144969
1300
1301         Reviewed by Alexey Proskuryakov.
1302
1303         * dom/Document.cpp:
1304         (WebCore::Document::addPlaybackTargetPickerClient): Replace ASSERT with early 
1305         return to work around https://webkit.org/b/144970.
1306
1307 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
1308
1309         Going back after resizing causes scroll knob to appear in the middle of the page
1310         https://bugs.webkit.org/show_bug.cgi?id=144968
1311         <rdar://problem/18299827>
1312
1313         Reviewed by Beth Dakin.
1314
1315         * history/CachedPage.cpp:
1316         (WebCore::CachedPage::restore):
1317         (WebCore::CachedPage::clear):
1318         * history/CachedPage.h:
1319         (WebCore::CachedPage::markForContentsSizeChanged):
1320         * history/PageCache.cpp:
1321         (WebCore::PageCache::markPagesForContentsSizeChanged):
1322         * history/PageCache.h:
1323         Add a flag that will cause us to call updateContentsSize() after a page
1324         comes out of the page cache, if necessary.
1325
1326         * page/FrameView.cpp:
1327         (WebCore::FrameView::setContentsSize):
1328         * page/FrameView.h:
1329         Mark all cached pages for this frame as needing updateContentsSize()
1330         when setContentsSize happens. This will ensure that scrollbar layers
1331         are repositioned when coming out of the page cache.
1332
1333 2015-05-13  Beth Dakin  <bdakin@apple.com>
1334
1335         Need SPI to set the overlay scroll bar style
1336         https://bugs.webkit.org/show_bug.cgi?id=144928
1337         -and corresponding-
1338         rdar://problem/20143614
1339
1340         Reviewed by Anders Carlsson.
1341
1342         New ChromeClient function preferredScrollbarOverlayStyle() will fetch the 
1343         scrollbar style that was set via the new SPI.
1344         * page/ChromeClient.h:
1345
1346         If the preferredScrollbarOverlayStyle() is anything but None, then use it. None is 
1347         used to indicate that the normal heuristic should compute the appropriate color.
1348         * page/FrameView.cpp:
1349         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
1350         * page/FrameView.h:
1351
1352 2015-05-13  Brent Fulgham  <bfulgham@apple.com>
1353
1354         Scrollbars in overflow regions are not vanishing after scrolling with scroll snap points
1355         https://bugs.webkit.org/show_bug.cgi?id=142521
1356         <rdar://problem/20100706>
1357
1358         Reviewed by Darin Adler.
1359
1360         The scrollbars were not being dismissed because they were not being notified that the wheel
1361         gesture was finished. This was happening because the wheel event 'ended' state has zero
1362         deltaX and deltaY. If the region did not allow stretching, it would exit early, never passing
1363         through the 'handleWheelEventPhase' code that would notify the scrollbar controller that
1364         the gesture had ended.
1365
1366         * platform/ScrollableArea.cpp:
1367         (WebCore::ScrollableArea::mouseExitedContentArea): The wrong ScrollAnimator method was being
1368         called when the mouse exited the content area.
1369         * platform/mac/ScrollAnimatorMac.mm:
1370         (WebCore::ScrollAnimatorMac::handleWheelEvent): Do not early return when the wheel event has
1371         no change in X or Y coordinate.
1372
1373 2015-05-12  David Hyatt  <hyatt@apple.com>
1374
1375         Don't compute selection painting info when we don't have selection.
1376         https://bugs.webkit.org/show_bug.cgi?id=144920
1377         <rdar://problem/20919920>
1378
1379         Reviewed by Simon Fraser.
1380
1381         * rendering/InlineTextBox.cpp:
1382         (WebCore::InlineTextBox::paint):
1383
1384         Just set the selection paint style to the text paint style when we don't have a selection
1385         at all. Computing the selection style takes time in the case where a ::selection pseudo is
1386         used on the page, so we don't want to waste time computing that info unless it's actually
1387         needed.
1388
1389 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
1390
1391         Pass String as reference in more places
1392         https://bugs.webkit.org/show_bug.cgi?id=144769
1393
1394         Reviewed by Daniel Bates.
1395
1396         * bindings/js/SerializedScriptValue.cpp:
1397         (WebCore::CloneSerializer::dumpString):
1398         (WebCore::CloneSerializer::dumpStringObject):
1399         * dom/DocumentMarkerController.cpp:
1400         (WebCore::DocumentMarkerController::addMarker):
1401         * dom/DocumentMarkerController.h:
1402         * inspector/InspectorApplicationCacheAgent.cpp:
1403         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
1404         * inspector/InspectorApplicationCacheAgent.h:
1405         * inspector/InspectorNodeFinder.cpp:
1406         (WebCore::stripCharacters):
1407         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
1408         * inspector/InspectorNodeFinder.h:
1409
1410 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
1411
1412         View scale changes are temporarily lost after restoring a page from the page cache
1413         https://bugs.webkit.org/show_bug.cgi?id=144934
1414
1415         Reviewed by Brady Eidson.
1416
1417         * history/CachedPage.cpp:
1418         (WebCore::CachedPage::CachedPage):
1419         (WebCore::CachedPage::restore):
1420         (WebCore::CachedPage::clear):
1421         * history/CachedPage.h:
1422         (WebCore::CachedPage::markForDeviceOrPageScaleChanged): Renamed.
1423         * history/PageCache.cpp:
1424         (WebCore::PageCache::markPagesForDeviceOrPageScaleChanged): Renamed.
1425         * history/PageCache.h:
1426         Rename PageCache/CachedPage methods to make it more clear that they
1427         will eventually result in calling deviceOrPageScaleFactorChanged().
1428         Also, use modern initialization for CachedPage members.
1429
1430         * loader/HistoryController.cpp:
1431         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
1432         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1433         Store the pageScaleFactor on HistoryItem with the view scale factored out,
1434         because the view scale can change while the page is in the page cache, and
1435         WebCore needs a way - without consulting with WebKit2 - to apply the changed
1436         view scale to the cached page scale.
1437
1438         * page/Page.cpp:
1439         (WebCore::Page::setViewScaleFactor):
1440         (WebCore::Page::setDeviceScaleFactor):
1441         * page/Page.h:
1442         (WebCore::Page::viewScaleFactor):
1443         Keep track of the viewScaleFactor, and mark all pages in the page cache
1444         as needing to call deviceOrPageScaleFactorChanged and do a full style recalc
1445         when they come back from the page cache.
1446
1447         For now, we expect all callers of setPageScaleFactor (including WebKit2 and
1448         HistoryController) to multiply the viewScale in manually, to avoid the
1449         significant amount of change in WebCore that would be required to keep them
1450         totally separately.
1451
1452 2015-05-12  Zan Dobersek  <zdobersek@igalia.com>
1453
1454         Reduce TransformationMatrix copies in MatrixTransformOperation, Matrix3DTransformOperation
1455         https://bugs.webkit.org/show_bug.cgi?id=144797
1456
1457         Reviewed by Darin Adler.
1458
1459         Using std::swap() on TransformationMatrix objects which don't
1460         provide move constructors will result in copies.
1461
1462         Instead, use a helper function in both MatrixTransformOperation
1463         and Matrix3DTransformOperation that calls TransformationMatrix::blend()
1464         and returns the new Matrix(3D)TransformOperation object, and call it
1465         with fromT and toT arguments switched when blending to identity.
1466
1467         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1468         (WebCore::createOperation):
1469         (WebCore::Matrix3DTransformOperation::blend):
1470         * platform/graphics/transforms/Matrix3DTransformOperation.h: No need
1471         to copy the m_matrix member, it won't change when passed to
1472         TransformationMatrix::multiply().
1473         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1474         (WebCore::createOperation):
1475         (WebCore::MatrixTransformOperation::blend):
1476
1477 2015-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1478
1479         [EGL][X11] XPixmap created in GLContextEGL::createPixmapContext() is leaked
1480         https://bugs.webkit.org/show_bug.cgi?id=144909
1481
1482         Reviewed by Sergio Villar Senin and Žan Doberšek.
1483
1484         The pixmap is created and passed to eglCreatePixmapSurface(), but
1485         never released. eglCreatePixmapSurface() doesn't take the
1486         ownership of the pixmap, so we should explicitly free it when the
1487         GLContextEGL is destroyed.
1488
1489         * platform/graphics/egl/GLContextEGL.cpp:
1490         (WebCore::GLContextEGL::createPixmapContext): Use XUniquePixmap
1491         and transfer the ownership to the context by using the new
1492         constructor that receives a XUniquePixmap&&.
1493         (WebCore::GLContextEGL::createContext): createPixmapContext() is
1494         now only defined for X11.
1495         (WebCore::GLContextEGL::GLContextEGL): New constructor that
1496         receives a XUniquePixmap&&.
1497         * platform/graphics/egl/GLContextEGL.h: Add new constructor and
1498         initialize the cairo device when defined to simplify constructors.
1499
1500 2015-05-12  Sungmann Cho  <sungmann.cho@navercorp.com>
1501
1502         Reindent DIBPixelData.h for consistency.
1503         https://bugs.webkit.org/show_bug.cgi?id=144942
1504
1505         Reviewed by Darin Adler.
1506
1507         No new tests, no behavior change.
1508
1509         * platform/graphics/win/DIBPixelData.h:
1510         (WebCore::DIBPixelData::DIBPixelData):
1511         (WebCore::DIBPixelData::buffer):
1512         (WebCore::DIBPixelData::bufferLength):
1513         (WebCore::DIBPixelData::size):
1514         (WebCore::DIBPixelData::bytesPerRow):
1515         (WebCore::DIBPixelData::bitsPerPixel):
1516
1517 2015-05-12  Commit Queue  <commit-queue@webkit.org>
1518
1519         Unreviewed, rolling out r184224.
1520         https://bugs.webkit.org/show_bug.cgi?id=144946
1521
1522         Made inspector/page/main-frame-resource.html assert every time
1523         (Requested by ap on #webkit).
1524
1525         Reverted changeset:
1526
1527         "Web Inspector: REGRESSION (r181625): Timeline recording
1528         started from console.profile is always empty"
1529         https://bugs.webkit.org/show_bug.cgi?id=144882
1530         http://trac.webkit.org/changeset/184224
1531
1532 2015-05-12  Jer Noble  <jer.noble@apple.com>
1533
1534         [Mac] Hang in MediaPlayerPrivateAVFoundationObjC::audioSourceProvider() - 'tracks' property not yet loaded
1535         https://bugs.webkit.org/show_bug.cgi?id=144937
1536
1537         Reviewed by Eric Carlson.
1538
1539         Querying for the -[AVAsset tracks] property blocks for network loading; and could
1540         block forever if the asset in question is not reachable. Add a "safe" mechanism for
1541         querying the list of audible tracks, and use that when providing the audioSourceProvider()
1542         with an audible track.
1543
1544         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1545         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1546         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
1547         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
1548         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider):
1549         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
1550         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeAVAssetTracksForAudibleMedia):
1551
1552 2015-05-12  Ryosuke Niwa  <rniwa@webkit.org>
1553
1554         Mac build fix after r184228.
1555
1556         * bindings/scripts/CodeGeneratorJS.pm:
1557
1558 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
1559
1560         Turn antialiased font dilation off by default
1561         https://bugs.webkit.org/show_bug.cgi?id=144940
1562         rdar://problem/20923031
1563
1564         Reviewed by Sam Weinig.
1565
1566         Turn antialised font dilation off by default.
1567
1568         * page/Settings.cpp:
1569         (WebCore::Settings::Settings):
1570         * platform/graphics/FontCascade.cpp:
1571
1572 2015-05-12  Alex Christensen  <achristensen@webkit.org>
1573
1574         Don't export all JS bindings classes.
1575         https://bugs.webkit.org/show_bug.cgi?id=144932
1576
1577         Reviewed by Dan Bernstein.
1578
1579         This change is good if it compiles and links successfully.
1580
1581         * bindings/scripts/CodeGeneratorJS.pm:
1582         (ExportLabelForClass):
1583         Add a list of the JS bindings classes that need WEBCORE_EXPORT to prevent exporting too many symbols from WebCore.
1584         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1585         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1586         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1587         * bindings/scripts/test/JS/JSTestEventTarget.h:
1588         * bindings/scripts/test/JS/JSTestException.h:
1589         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1590         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1591         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1592         * bindings/scripts/test/JS/JSTestNode.h:
1593         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1594         * bindings/scripts/test/JS/JSTestObj.h:
1595         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1596         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1597         * bindings/scripts/test/JS/JSTestTypedefs.h:
1598         * bindings/scripts/test/JS/JSattribute.h:
1599         * bindings/scripts/test/JS/JSreadonly.h:
1600         Update bindings tests to remove WEBCORE_EXPORT from most of the tests,
1601         but keep one test with WEBCORE_EXPORT and one test with WEBCORE_TESTSUPPORT_EXPORT.
1602
1603 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
1604
1605         [Win] Update DXSDK_DIR settings for build system.
1606
1607         Unreviewed build fix.
1608
1609         * WebCore.vcxproj/WebCore.proj: Add DXSDK_DIR definition for builder.
1610
1611 2015-05-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1612
1613         Return Ref instead of PassRefPtr in create() factory functions of WebCore/dom
1614         https://bugs.webkit.org/show_bug.cgi?id=144904
1615
1616         Reviewed by Andreas Kling.
1617
1618         We return Ref when we're sure if pointer can't be null. If not, we use RefPtr instead PassRefPtr.
1619
1620         No new tests, no behavior changes.
1621
1622         * dom/AutocompleteErrorEvent.h:
1623         * dom/DOMNamedFlowCollection.h:
1624         (WebCore::DOMNamedFlowCollection::create):
1625         * dom/MessageChannel.h:
1626         (WebCore::MessageChannel::create):
1627         * dom/MessagePort.h:
1628         * dom/MutationObserver.cpp:
1629         (WebCore::MutationObserver::create):
1630         * dom/MutationObserver.h:
1631         * dom/NamedFlowCollection.h:
1632         * dom/NodeFilter.h:
1633         (WebCore::NodeFilter::create):
1634         * dom/NodeIterator.h:
1635         (WebCore::NodeIterator::create):
1636         * dom/ProcessingInstruction.cpp:
1637         (WebCore::ProcessingInstruction::create):
1638         * dom/ProcessingInstruction.h:
1639         * dom/ScriptedAnimationController.h:
1640         (WebCore::ScriptedAnimationController::create):
1641         * dom/SecurityPolicyViolationEvent.h:
1642         * dom/StaticNodeList.h:
1643         * dom/TemplateContentDocumentFragment.h:
1644         * dom/Touch.cpp:
1645         (WebCore::Touch::cloneWithNewTarget):
1646         * dom/Touch.h:
1647         (WebCore::Touch::create):
1648         * dom/TouchEvent.h:
1649         * dom/TouchList.h:
1650         (WebCore::TouchList::create):
1651         * dom/TreeWalker.h:
1652         (WebCore::TreeWalker::create):
1653         * dom/WebKitNamedFlow.cpp:
1654         (WebCore::WebKitNamedFlow::create):
1655         * dom/WebKitNamedFlow.h:
1656         * dom/default/PlatformMessagePortChannel.cpp:
1657         (WebCore::PlatformMessagePortChannel::create):
1658         * dom/default/PlatformMessagePortChannel.h:
1659         (WebCore::PlatformMessagePortChannel::MessagePortQueue::create):
1660
1661 2015-05-12  Matt Baker  <mattbaker@apple.com>
1662
1663         Web Inspector: REGRESSION (r181625): Timeline recording started from console.profile is always empty
1664         https://bugs.webkit.org/show_bug.cgi?id=144882
1665
1666         Reviewed by Brian Burg.
1667
1668         A timeline recording will always be stopped before the end of the current run loop is observed. Before
1669         dispatching the recording stopped event, the last run loop record must be completed and sent to the frontend
1670         to prevent it from being discarded.
1671
1672         * inspector/InspectorTimelineAgent.cpp:
1673         (WebCore::InspectorTimelineAgent::internalStop):
1674
1675 2015-05-12  Zalan Bujtas  <zalan@apple.com>
1676
1677         REGRESSION(r175617): Some text doesn't render on internationalculinarycenter.com
1678         https://bugs.webkit.org/show_bug.cgi?id=144917
1679         rdar://problem/20545878
1680
1681         Reviewed by Andreas Kling.
1682
1683         This patch ensures that text stroke width value is taken into account while
1684         calculating visual overflow for simple line layout.
1685         Ceiling the text stroke width value matches the normal text layout behaviour.
1686
1687         Test: fast/text/simple-line-layout-text-stroke-width.html
1688
1689         * rendering/SimpleLineLayoutFunctions.cpp:
1690         (WebCore::SimpleLineLayout::paintFlow):
1691         (WebCore::SimpleLineLayout::collectFlowOverflow):
1692
1693 2015-05-12  Alexey Proskuryakov  <ap@apple.com>
1694
1695         Build fix.
1696
1697         * platform/spi/cf/CFNetworkSPI.h:
1698
1699 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
1700
1701         ROLLOUT [Win] Unreviewed build fix for older DirectX build environments.
1702
1703         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1704
1705 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
1706
1707         AX: [ATK] ARIA menu items should not have anonymous block children
1708         https://bugs.webkit.org/show_bug.cgi?id=144653
1709
1710         Reviewed by Chris Fleizach.
1711
1712         Exclude anonymous block children of menu items from the accessible tree
1713         for ATK. Exclude list markers from the accessibility tree if the parent
1714         is not being exposed as an accessible list item.
1715
1716         No new tests. Instead, modified the existing tests to reflect the correct
1717         behavior.
1718
1719         * accessibility/AccessibilityRenderObject.cpp:
1720         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1721         * accessibility/atk/AccessibilityObjectAtk.cpp:
1722         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1723
1724 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
1725
1726         [Mac] Share cookie storage between UI process and secondary processes
1727         https://bugs.webkit.org/show_bug.cgi?id=144820
1728         rdar://problem/20572830
1729
1730         Reviewed by Darin Adler.
1731
1732         * platform/network/mac/CookieJarMac.mm:
1733         * platform/spi/cf/CFNetworkSPI.h:
1734         Moved SPIs into an SPI header, so that WebKit2 could use them too without duplication.
1735
1736 2015-05-12  Chris Dumez  <cdumez@apple.com>
1737
1738         [WK2] Log using diagnostic logging how far back in history we navigate
1739         https://bugs.webkit.org/show_bug.cgi?id=144919
1740         <rdar://problem/20920043>
1741
1742         Reviewed by Gavin Barraclough.
1743
1744         Add diagnostic logging keys for logging back history navigation delta.
1745
1746         * page/DiagnosticLoggingKeys.cpp:
1747         (WebCore::DiagnosticLoggingKeys::deltaKey):
1748         (WebCore::DiagnosticLoggingKeys::backNavigationKey):
1749         * page/DiagnosticLoggingKeys.h:
1750
1751 2015-05-12  Yoav Weiss  <yoav@yoav.ws>
1752
1753         Avoid CSSPrimitiveValue allocation when parsing sizes
1754         https://bugs.webkit.org/show_bug.cgi?id=144910
1755
1756         Reviewed by Darin Adler.
1757
1758         Turn non-calc length calculation logic into a static method,
1759         so that it can be called without a CSSPrimitiveValue object.
1760         Then, call that method to calculate the default source-size length.
1761
1762         No new tests, since no functionality change.
1763
1764         * css/CSSPrimitiveValue.cpp:
1765         (WebCore::CSSPrimitiveValue::computeLengthDouble): Split out the logic for everything that's not calc into a static method.
1766         (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): Static length computation logic for everything that is not calc.
1767         * css/CSSPrimitiveValue.h:
1768         (WebCore::CSSPrimitiveValue::isFontRelativeLength): Turn into static.
1769         * css/SourceSizeList.cpp:
1770         (WebCore::defaultLength): Use the new static method to compute the length.
1771         (WebCore::computeLength): Use the calc length computation methods directly.
1772
1773 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
1774
1775         [Win] Unreviewed build fix for older DirectX build environments.
1776
1777         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Switch back to our
1778         d3d stub header to avoid build failures on July 2004 DXSDK build environments.
1779
1780 2015-05-12  Eric Carlson  <eric.carlson@apple.com>
1781
1782         [Mac] Refine media playback target client configuration
1783         https://bugs.webkit.org/show_bug.cgi?id=144892
1784
1785         Reviewed by Brent Fulgham.
1786
1787         Client and target picker state changes fequently happen several times in quick succession, so
1788         don't react to immediately so we can batch callbacks to the web process. 
1789         * Modules/mediasession/WebMediaSessionManager.cpp:
1790         (WebCore::ClientState::ClientState): Store the client as a reference rather than a pointer
1791         because it can never be NULL.
1792         (WebCore::ClientState::operator == ): New.
1793         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): Schedule the initial client 
1794         configuration and a target configuration check.
1795         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): Schedule a target monitoring
1796         update, and a target configuration check.
1797         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Ditto.
1798         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Schedule a target monitoring update.
1799         (WebCore::WebMediaSessionManager::clientStateDidChange): If the client whose state has changed
1800         can play to a target, tell it to start using the target even if it isn't playing as long as
1801         no other client is actively using a target.
1802         (WebCore::WebMediaSessionManager::setPlaybackTarget): Configure clients after a pause.
1803         (WebCore::WebMediaSessionManager::configureNewClients): New, do new client configuration.
1804         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): New, configure target clients.
1805         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Schedule the timer.
1806         (WebCore::WebMediaSessionManager::taskTimerFired): Execute delayed tasks.
1807         (WebCore::WebMediaSessionManager::find): 
1808         * Modules/mediasession/WebMediaSessionManager.h:
1809
1810         * html/HTMLMediaElement.cpp:
1811         (WebCore::HTMLMediaElement::setMuted): Call updateMediaState.
1812         (WebCore::HTMLMediaElement::setPlaying): Ditto.
1813         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
1814         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Expand logging.
1815         (WebCore::HTMLMediaElement::updateMediaState): New, don't broadcast a media state change
1816         unless something actually changed.
1817         * html/HTMLMediaElement.h:
1818
1819         * html/HTMLMediaSession.cpp:
1820         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Update logging.
1821         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget): Ditto.
1822         (WebCore::HTMLMediaSession::mediaEngineUpdated): Cleanup.
1823
1824         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1825         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove the call to
1826         deprecated API and the "-Wdeprecated-declarations".
1827
1828 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
1829
1830         AX: [GTK] Defer to WebCore Accessibility for table exposure
1831         https://bugs.webkit.org/show_bug.cgi?id=144896
1832
1833         Reviewed by Chris Fleizach.
1834
1835         Stop unconditionally exposing all HTMLTableElement nodes as AccessibilityTables
1836         for WebKitGtk.
1837
1838         No new tests. Several existing tests already cover table exposure. They have
1839         been updated accordingly.
1840
1841         * accessibility/AccessibilityTable.cpp:
1842         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
1843
1844 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
1845
1846         [GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
1847         https://bugs.webkit.org/show_bug.cgi?id=116971
1848
1849         Reviewed by Chris Fleizach.
1850
1851         Because ATK lacks API to directly get an accessible row via its index,
1852         the implementation of rowAtIndex gets a cell in the indexed row and
1853         returns the parent row. The failing test continued to fail because
1854         AccessibilityARIAGridCell::parentTable called parentObjectUnignored at
1855         most twice, the second call in place to handle rows which are included
1856         in the tree. However, given a well-formed ARIA grid with a rowgroup that
1857         is interactive, that rowgroup also needs to be in the tree necessitating
1858         parentObjectUnignored be called a third time to get to the grid. Given a
1859         poorly-formed ARIA grid, there may additional objects which pass the test
1860         for inclusion standing in between the cell and grid necessitating more
1861         calls still. Therefore, ascend the hierarchy to find the parent grid.
1862
1863         No new tests. The failing test now passes.
1864
1865         * accessibility/AccessibilityARIAGridCell.cpp:
1866         (WebCore::AccessibilityARIAGridCell::parentTable):
1867
1868 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1869
1870         [X11] Add XUniquePtr and XUniqueResource to automatically free X resources
1871         https://bugs.webkit.org/show_bug.cgi?id=144521
1872
1873         Reviewed by Darin Adler.
1874
1875         Add XUniquePtr as a template alias of std:unique_ptr to handle X
1876         resources using pointers and XUniqueResource as a new class to
1877         handle X resources using a long unsigned identifier. This
1878         simplifies the code and makes it more difficult to leak X resources.
1879
1880         * PlatformEfl.cmake: Add new files to compilation.
1881         * PlatformGTK.cmake: Ditto.
1882         * platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:
1883         (WebCore::BackingStoreBackendCairoX11::BackingStoreBackendCairoX11):
1884         Remove the display member, and use XUnique for Pixmap and GC.
1885         (WebCore::BackingStoreBackendCairoX11::~BackingStoreBackendCairoX11):
1886         Remove code to explicitly free Pixmap and GC.
1887         (WebCore::BackingStoreBackendCairoX11::scroll):
1888         * platform/graphics/cairo/BackingStoreBackendCairoX11.h:
1889         * platform/graphics/glx/GLContextGLX.cpp:
1890         (WebCore::GLContextGLX::createWindowContext): Use XUnique and the
1891         new constructor that receives a XID, since there's no longer
1892         conflict with the one receiving a Pbuffer.
1893         (WebCore::GLContextGLX::createPbufferContext): Use XUnique and the
1894         new constructor that receives a XUniqueGLXPbuffer&&.
1895         (WebCore::GLContextGLX::createPixmapContext):
1896         (WebCore::GLContextGLX::createContext):
1897         (WebCore::GLContextGLX::GLContextGLX):
1898         (WebCore::GLContextGLX::~GLContextGLX): Remove code to explicitly
1899         free X resources.
1900         (WebCore::GLContextGLX::makeContextCurrent):
1901         (WebCore::GLContextGLX::cairoDevice):
1902         (WebCore::GLContextGLX::platformContext):
1903         * platform/graphics/glx/GLContextGLX.h:
1904         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
1905         (WebCore::EGLXTransportSurfaceClient::EGLXTransportSurfaceClient):
1906         (WebCore::EGLXTransportSurfaceClient::destroy):
1907         (WebCore::EGLXTransportSurfaceClient::prepareTexture):
1908         * platform/graphics/surfaces/egl/EGLXSurface.h:
1909         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
1910         (WebCore::GLXConfigSelector::findMatchingConfig): Use XUnique
1911         instead of the custom std::unique X11Deleter.
1912         (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
1913         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1914         (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
1915         (WebCore::GLXOffScreenSurface::initialize):
1916         * platform/graphics/surfaces/glx/X11Helper.cpp:
1917         (WebCore::X11Helper::createOffScreenWindow): Ditto.
1918         (WebCore::X11Helper::createPixmap): Ditto.
1919         * platform/graphics/surfaces/glx/X11Helper.h:
1920         * platform/graphics/x11/XUniquePtr.h: Remove X11Deleter.
1921         (WebCore::XPtrDeleter::operator()):
1922         * platform/graphics/x11/XUniqueResource.cpp: Added.
1923         (WebCore::XUniqueResource<XResource::Colormap>::deleteXResource):
1924         (WebCore::XUniqueResource<XResource::Damage>::deleteXResource):
1925         (WebCore::XUniqueResource<XResource::Pixmap>::deleteXResource):
1926         (WebCore::XUniqueResource<XResource::Window>::deleteXResource):
1927         (WebCore::XUniqueResource<XResource::GLXPbuffer>::deleteXResource):
1928         (WebCore::XUniqueResource<XResource::GLXPixmap>::deleteXResource):
1929         * platform/graphics/x11/XUniqueResource.h: Added.
1930         (WebCore::XUniqueResource::XUniqueResource):
1931         (WebCore::XUniqueResource::operator=):
1932         (WebCore::XUniqueResource::~XUniqueResource):
1933         (WebCore::XUniqueResource::get):
1934         (WebCore::XUniqueResource::release):
1935         (WebCore::XUniqueResource::reset):
1936         (WebCore::XUniqueResource::operator!):
1937         (WebCore::XUniqueResource::operator UnspecifiedBoolType*):
1938
1939 2015-05-12  Zan Dobersek  <zdobersek@igalia.com>
1940
1941         Move TransformOperation-based classes off of PassRefPtr
1942         https://bugs.webkit.org/show_bug.cgi?id=144876
1943
1944         Reviewed by Darin Adler.
1945
1946         Remove uses of PassRefPtr from the TransformOperation class and its
1947         derivatives, operating on Ref and RefPtr objects instead.
1948
1949         * platform/graphics/transforms/IdentityTransformOperation.h:
1950         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1951         (WebCore::Matrix3DTransformOperation::blend):
1952         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1953         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1954         (WebCore::MatrixTransformOperation::blend):
1955         * platform/graphics/transforms/MatrixTransformOperation.h:
1956         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1957         (WebCore::PerspectiveTransformOperation::blend):
1958         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1959         * platform/graphics/transforms/RotateTransformOperation.cpp:
1960         (WebCore::RotateTransformOperation::blend):
1961         * platform/graphics/transforms/RotateTransformOperation.h:
1962         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1963         (WebCore::ScaleTransformOperation::blend):
1964         * platform/graphics/transforms/ScaleTransformOperation.h:
1965         * platform/graphics/transforms/SkewTransformOperation.cpp:
1966         (WebCore::SkewTransformOperation::blend):
1967         * platform/graphics/transforms/SkewTransformOperation.h:
1968         * platform/graphics/transforms/TransformOperation.h:
1969         * platform/graphics/transforms/TransformOperations.cpp:
1970         (WebCore::TransformOperations::blendByMatchingOperations):
1971         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1972         (WebCore::TranslateTransformOperation::blend):
1973         * platform/graphics/transforms/TranslateTransformOperation.h:
1974
1975 2015-05-12  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1976
1977         [Streams API] ReadableStream reader should not be disposable when having pending promises
1978         https://bugs.webkit.org/show_bug.cgi?id=144869
1979
1980         Reviewed by Darin Adler.
1981
1982         Made error promise callback to take a ref to the reader so that the reader is not disposed as long as the promise callback is not resolved.
1983
1984         Covered by tests added to streams/readable-stream-gc.html.
1985
1986         * Modules/streams/ReadableStreamReader.cpp:
1987         (WebCore::ReadableStreamReader::ReadableStreamReader): Moved initialize() call outside constructor as it can ref/unref.
1988         (WebCore::ReadableStreamReader::releaseStreamAndClean): Added protector.
1989         * Modules/streams/ReadableStreamReader.h:
1990         * bindings/js/JSReadableStreamReaderCustom.cpp:
1991         (WebCore::JSReadableStreamReader::closed): Lambda for error now takes a ref to the reader.
1992         * bindings/js/ReadableJSStream.cpp:
1993         (WebCore::ReadableJSStream::Reader::create): Calling initialize() after adoptRef().
1994
1995 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
1996
1997         Clean up redundant resources in case of failure in GLContextEGL context creation methods
1998         https://bugs.webkit.org/show_bug.cgi?id=144878
1999
2000         Reviewed by Martin Robinson.
2001
2002         GLContextEGL::createWindowContext() and GLContextEGL::createPixmapContext() methods
2003         should clean up the freshly-created resources when prematurely returning due to a
2004         failure.
2005
2006         * platform/graphics/egl/GLContextEGL.cpp:
2007         (WebCore::GLContextEGL::createWindowContext):
2008         (WebCore::GLContextEGL::createPixmapContext):
2009
2010 2015-05-11  Dan Bernstein  <mitz@apple.com>
2011
2012         WebCore part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
2013
2014         Reviewed by Alexey Proskuryakov.
2015
2016         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm
2017
2018         In some cases, trying to navigate to an invalid URL results in navigation to about:blank.
2019         When the about:blank load is committed, the UI process still thinks that the provisional
2020         URL is the original, invalid URL, and updates its state to reflect that that’s the URL that
2021         has been committed.
2022
2023         The provisional URL changes (1) when a provisional load begins, (2) when a server redirect
2024         happens, (3) when the client changes the request in willSendRequest, and (4) in this
2025         about:blank case. For (1) and (2), there are frame loader client callbacks. (3) is client-
2026         initiated. So this patch addresses (4).
2027
2028         * loader/DocumentLoader.cpp:
2029         (WebCore::DocumentLoader::maybeLoadEmpty): If our request URL is changing to about:blank and
2030         while loading the main resource, call FrameLoaderClient::dispatchDidChangeProvisionalURL.
2031         * loader/FrameLoaderClient.h: Added dispatchDidChangeProvisionalURL with an empty
2032         implementation.
2033
2034 2015-05-11  Zalan Bujtas  <zalan@apple.com>
2035
2036         Text is misplaced when custom font does not have space glyph.
2037         https://bugs.webkit.org/show_bug.cgi?id=144879
2038
2039         Reviewed by Myles C. Maxfield
2040
2041         This patch ensures that we use fallback font for the missing space glyph only when the rendered text has space in it.
2042
2043         If a font does not provide all the glyphs required to render the associated text, we initiate fallback fonts. It is done while
2044         measuring the text at layout time. However due to the fact that we always pre-measure space, a font with no space glyph in it is never sufficient.
2045         (even when the text does not require space at all)
2046         Fallback fonts impact line positions through ascent/descent calculation.
2047
2048         Test: fast/text/font-with-no-space-glyph.html
2049
2050         * rendering/RenderText.cpp:
2051         (WebCore::RenderText::computePreferredLogicalWidths):
2052         * rendering/line/BreakingContext.h:
2053         (WebCore::WordTrailingSpace::WordTrailingSpace):
2054         (WebCore::WordTrailingSpace::width):
2055         (WebCore::BreakingContext::handleText):
2056
2057 2015-05-11  Simon Fraser  <simon.fraser@apple.com>
2058
2059         Small tidyup in animations code
2060         https://bugs.webkit.org/show_bug.cgi?id=144893
2061
2062         Reviewed by Eric Carlson.
2063
2064         Reading progress(1, 0, 0) in callers of AnimationBase::progress() was confusing,
2065         particularly as the last parameter is a TimingFunction*. Put default values 
2066         in the header (with nullptr) and fix the callers. Also fix variable names in
2067         the implementation.
2068
2069         * page/animation/AnimationBase.cpp:
2070         (WebCore::AnimationBase::progress):
2071         * page/animation/AnimationBase.h:
2072         * page/animation/ImplicitAnimation.cpp:
2073         (WebCore::ImplicitAnimation::animate):
2074         (WebCore::ImplicitAnimation::getAnimatedStyle):
2075         (WebCore::ImplicitAnimation::blendPropertyValueInStyle):
2076
2077 2015-05-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2078
2079         Purge PassRefPtr in WebCore/rendering
2080         https://bugs.webkit.org/show_bug.cgi?id=144872
2081
2082         Reviewed by Darin Adler.
2083
2084         As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref in WebCore/rendering.
2085
2086         No new tests, no behavior changes.
2087
2088         * rendering/HitTestingTransformState.h:
2089         (WebCore::HitTestingTransformState::create):
2090         * rendering/RenderLayer.cpp:
2091         (WebCore::ClipRects::create):
2092         * rendering/RenderThemeGtk.cpp:
2093         (WebCore::RenderThemeGtk::create):
2094         (WebCore::RenderTheme::themeForPage):
2095         * rendering/RenderThemeGtk.h:
2096         * rendering/RenderThemeIOS.h:
2097         * rendering/RenderThemeIOS.mm:
2098         (WebCore::RenderTheme::themeForPage):
2099         (WebCore::RenderThemeIOS::create):
2100         * rendering/RenderThemeMac.h:
2101         * rendering/RenderThemeMac.mm:
2102         (WebCore::RenderTheme::themeForPage):
2103         (WebCore::RenderThemeMac::create):
2104         * rendering/RenderThemeSafari.cpp:
2105         (WebCore::RenderThemeSafari::create):
2106         (WebCore::RenderTheme::themeForPage):
2107         * rendering/RenderThemeSafari.h:
2108         * rendering/RenderThemeWin.cpp:
2109         (WebCore::RenderThemeWin::create):
2110         (WebCore::RenderTheme::themeForPage):
2111         * rendering/RenderThemeWin.h:
2112         * rendering/TextAutoSizing.h:
2113         (WebCore::TextAutoSizingValue::create):
2114         * rendering/style/ShapeValue.h:
2115         (WebCore::ShapeValue::createShapeValue):
2116         (WebCore::ShapeValue::createBoxShapeValue):
2117         (WebCore::ShapeValue::createImageValue):
2118         * rendering/style/StyleCachedImage.h:
2119         * rendering/style/StyleCachedImageSet.h:
2120         * rendering/style/StyleGeneratedImage.h:
2121         * rendering/style/StylePendingImage.h:
2122         * rendering/style/StyleReflection.h:
2123         (WebCore::StyleReflection::create):
2124
2125 2015-05-11  Eric Carlson  <eric.carlson@apple.com>
2126
2127         [Mac] Update device picker icon when video tracks change
2128         https://bugs.webkit.org/show_bug.cgi?id=144889
2129         <rdar://problem/20907253>
2130
2131         Reviewed by Brent Fulgham.
2132
2133         * Modules/mediacontrols/mediaControlsApple.js:
2134         (Controller.prototype.updateHasVideo):
2135
2136 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
2137
2138         Scroll snap logic should be triggered when resizing the WebView
2139         https://bugs.webkit.org/show_bug.cgi?id=142590
2140         <rdar://problem/20125088>
2141
2142         Reviewed by Simon Fraser.
2143
2144         Tests coming in a second patch.
2145
2146         Resizing of the main frame or overflow regions was properly recalculating the scroll snap points,
2147         but there was no code to honor these values when window resizing was occurring. The correction was
2148         handled in two ways:
2149         1. Scrolling thread operations that moved to new snap points needed to notify the main thread that
2150            it had shifted to a new snap point, so that the resize code (which happens on the main thread)
2151            could ensure that we stayed clamped to the correct 'tile' in the snap region.
2152         2. Main thread (overflow) resizes were likewise missing code to honor the current snap position
2153            after resizing calculations were complete.
2154
2155         This change also required the addition of two indices to the scrollable area to track which scroll
2156         snap point was currently being used. We don't bother with a 'none' case because you cannot have a
2157         'none' state when you have an active set of scroll snap points, and we do not execute this code
2158         if the scroll snap points are null.
2159
2160         The FrameView code was computing updated snap offsets after it had dispatched frame view layout
2161         information to the scrolling thread, which was wrong. This was also corrected.
2162
2163         I think it might be possible to track all of this state inside the ScrollController, but the current
2164         scroll snap architecture destroys and recreates the state each time a new set of interactions starts.
2165         This should be fixed in the future, which would allow us to remove some of this local state.
2166
2167         * page/FrameView.cpp:
2168         (WebCore::FrameView::performPostLayoutTasks): Make sure 'updateSnapOffsets' is called prior to
2169         calling 'frameViewLayoutUpdated' so the scrolling thread gets correct updated points. Add a new
2170         call to 'scrollToNearestActiveSnapPoint', which will keep us on our current snap point during
2171         resize (if appropriate).
2172         * page/scrolling/AsyncScrollingCoordinator.cpp:
2173         (WebCore::AsyncScrollingCoordinator::updateScrollSnapOffsetIndices): Added. This finds and notifies
2174         the correct scroll region when a new snap position (index) has been selected by user interaction on
2175         the scrolling thread.
2176         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added an assertion for 'isMainThread'.
2177         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
2178         * page/scrolling/AsyncScrollingCoordinator.h:
2179         * page/scrolling/AxisScrollSnapOffsets.h:
2180         (WebCore::closestSnapOffset): Modified to also return the selected snap point index so we can track
2181         it to handle resize operations.
2182         * page/scrolling/ScrollingTree.h:
2183         (WebCore::ScrollingTree::updateScrollSnapOffsetIndices):
2184         * page/scrolling/ThreadedScrollingTree.cpp:
2185         (WebCore::ThreadedScrollingTree::updateScrollSnapOffsetIndices): Added method to dispatch the active
2186         horizontal and vertical scroll snap indices back to the main thread.
2187         * page/scrolling/ThreadedScrollingTree.h:
2188         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2189         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): After the scroll controller processes
2190         the current event, notify the main thread of any change in the active scroll snap index.
2191         * platform/ScrollAnimator.cpp:
2192         (WebCore::ScrollAnimator::activeScrollSnapOffsetIndexDidChange): Added method to allow ScrollAnimator
2193         clients to find out about the current scroll snap state, which is only known by the ScrollController.
2194         (WebCore::ScrollAnimator::activeScrollSnapOffsetIndexForAxis): Ditto.
2195         * platform/ScrollAnimator.h:
2196         * platform/ScrollView.cpp:
2197         (WebCore::ScrollView::scrollToNearestActiveSnapPoint): Added method that allows us to set scroll position
2198         to one of our active scroll snap offsets.
2199         * platform/ScrollView.h:
2200         * platform/ScrollableArea.cpp:
2201         (WebCore::ScrollableArea::handleWheelEvent): If the active scroll snap offset has changed, make sure we
2202         keep track of the new values for potential resize operations.
2203         (WebCore::ScrollableArea::clearHorizontalSnapOffsets): Make sure to also clear out the current snap index.
2204         (WebCore::ScrollableArea::clearVerticalSnapOffsets): Ditto.
2205         (WebCore::ScrollableArea::nearestActiveSnapPoint): New method that returns an updated IntPoint reflecting
2206         the proper scroll position based on the active scroll snap offset.
2207         * platform/ScrollableArea.h:
2208         (WebCore::ScrollableArea::currentHorizontalSnapPointIndex): Added.
2209         (WebCore::ScrollableArea::setCurrentHorizontalSnapPointIndex): Added.
2210         (WebCore::ScrollableArea::currentVerticalSnapPointIndex): Added.
2211         (WebCore::ScrollableArea::setCurrentVerticalSnapPointIndex): Added.
2212         (WebCore::ScrollableArea::scrollToNearestActiveSnapPoint): Added.
2213         * platform/cocoa/ScrollController.h:
2214         (WebCore::ScrollControllerClient::activeScrollOffsetIndex): Added new method for clients to implement.
2215         (WebCore::ScrollController::activeScrollSnapOffsetIndexDidChange): Added.
2216         (WebCore::ScrollController::setScrollSnapOffsetIndexDidChange): Added.
2217         * platform/cocoa/ScrollController.mm:
2218         (WebCore::ScrollController::activeScrollSnapOffsetIndexForAxis): Helper method to return current active
2219         index (if applicable).
2220         (WebCore::ScrollController::setActiveScrollSnapOffsetIndexForAxis): Helper function to safely set
2221         the current active index.
2222         (WebCore::ScrollController::beginScrollSnapAnimation): Updated to keep track of the new active scroll snap
2223         index, as well as whether the current animation actually changed the active snap point offset.
2224         * platform/cocoa/ScrollSnapAnimatorState.h: Revise to use modern C++ initializers, and to track a new index
2225         that represents the current scroll snap offset.
2226         * platform/cocoa/ScrollSnapAnimatorState.mm:
2227         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState): Update for modern C++ syntax.
2228         * rendering/RenderLayer.cpp:
2229         (WebCore::RenderLayer::scrollToNearestActiveSnapPoint): New method to set scroll position to be one of our
2230         active scroll snap points.
2231         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Add a new call to 'scrollToNearestActiveSnapPoint' so that
2232         we stay on the current scroll snap offset during resizing.
2233         * rendering/RenderLayer.h:
2234
2235 2015-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
2236
2237         Addressing post-review comments after r184037.
2238
2239         Unreviewed.
2240
2241         No new tests because there is no behavior change.
2242
2243         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2244         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2245
2246 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
2247
2248         [Win] Move Windows build target to Windows 7 (or newer)
2249         https://bugs.webkit.org/show_bug.cgi?id=144890
2250         <rdar://problem/20707307>
2251
2252         Reviewed by Anders Carlsson.
2253
2254         Update linked SDK and minimal Windows level to be compatible with
2255         Windows 7 or newer.
2256
2257         * WebCore.vcxproj/WebCore.vcxproj:
2258         * WebCore.vcxproj/WebCoreGenerated.vcxproj:
2259         * WebCore.vcxproj/WebCoreTestSupport.vcxproj:
2260         * WebCorePrefix.h:
2261         * config.h:
2262         * testing/js/WebCoreTestSupportPrefix.h:
2263
2264 2015-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
2265
2266         AX: [ATK] Always include rows in the tree of accessible tables
2267         https://bugs.webkit.org/show_bug.cgi?id=144885
2268
2269         Reviewed by Chris Fleizach.
2270
2271         Remove the code that excluded rows from the tree of accessible tables for
2272         Gtk and Efl, the latter of which inherited the exclusion from the former.
2273
2274         No new tests. We already have several tests which cover table hierarchy.
2275         The associated expectations have been updated as part of this fix.
2276
2277         * accessibility/AccessibilityTable.cpp:
2278         (WebCore::AccessibilityTable::addChildrenFromSection):
2279         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2280         (webkitAccessibleGetParent):
2281
2282 2015-05-11  Matt Baker  <mattbaker@apple.com>
2283
2284         Web Inspector: REGRESSION (r175203): No profile information is shown in Inspector
2285         https://bugs.webkit.org/show_bug.cgi?id=144808
2286
2287         Reviewed by Darin Adler.
2288
2289         Profiles started from the console should always use the Inspector environment's shared stopwatch.
2290
2291         * inspector/InspectorTimelineAgent.cpp:
2292         (WebCore::InspectorTimelineAgent::startFromConsole):
2293
2294 2015-05-11  Alex Christensen  <achristensen@webkit.org>
2295
2296         [Content Extensions] Support domain-specific rules and exceptions.
2297         https://bugs.webkit.org/show_bug.cgi?id=144833
2298
2299         Reviewed by Darin Adler.
2300
2301         Test: http/tests/contentextensions/domain-rules.html
2302         (And lots of API tests)
2303
2304         This patch adds if-domain and unless-domain to the trigger in the JSON format.
2305         if-domain makes the rule apply only to domains in the list.
2306         unless-domain makes the rule apply to domains that are not in the list.
2307         
2308         All rules without if-domain or unless-domain are compiled into a set of DFAs.  This behavior is unchanged.
2309         All rules with if-domain or unless-domain are compiled into a separate set of DFAs.
2310         The domains are also compiled into another set of DFAs.  This makes 3 arrays of DFA bytecode instead of 1.
2311         
2312         If there are no domain specific rules, there is no change in behavior.
2313         If there are domain specific rules, the URL will be checked for matches in both
2314         filtersWithoutDomainsBytecode and filtersWithDomainsBytecode.  If there are matches from 
2315         filtersWithDomainsBytecode then the domain of the main document will be checked with 
2316         domainFiltersBytecode to see which of the matches applies to this domain.
2317
2318         * contentextensions/CombinedURLFilters.cpp:
2319         (WebCore::ContentExtensions::CombinedURLFilters::isEmpty):
2320         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
2321         * contentextensions/CombinedURLFilters.h:
2322         Added addDomain, which adds characters from a domain to the prefix tree directly without using YARR.
2323         * contentextensions/CompiledContentExtension.cpp:
2324         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
2325         * contentextensions/CompiledContentExtension.h:
2326         * contentextensions/ContentExtensionCompiler.cpp:
2327         (WebCore::ContentExtensions::serializeActions):
2328         (WebCore::ContentExtensions::compileRuleList):
2329         Separate the rules into rules with domains and rules without domains and compile to bytecode.
2330         * contentextensions/ContentExtensionCompiler.h:
2331         Updated compiler interface to reflect the slightly more complicated structure.
2332         * contentextensions/ContentExtensionError.cpp:
2333         (WebCore::ContentExtensions::contentExtensionErrorCategory):
2334         * contentextensions/ContentExtensionError.h:
2335         Added new parsing errors.
2336         * contentextensions/ContentExtensionParser.cpp:
2337         (WebCore::ContentExtensions::getDomainList):
2338         (WebCore::ContentExtensions::loadTrigger):
2339         (WebCore::ContentExtensions::loadEncodedRules):
2340         * contentextensions/ContentExtensionRule.h:
2341         (WebCore::ContentExtensions::Trigger::operator==):
2342         Parse the new domain structures from JSON into the Trigger structure.
2343         * contentextensions/ContentExtensionsBackend.cpp:
2344         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2345         Interpret as much bytecode as necessary to determine which rules apply to this URL and domain.
2346         * contentextensions/DFABytecode.h:
2347         (WebCore::ContentExtensions::instructionSizeWithArguments):
2348         * contentextensions/DFABytecodeCompiler.cpp:
2349         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
2350         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTestFlagsAndAppendAction):
2351         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2352         * contentextensions/DFABytecodeCompiler.h:
2353         * contentextensions/DFABytecodeInterpreter.cpp:
2354         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2355         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2356         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2357         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2358         * contentextensions/DFABytecodeInterpreter.h:
2359         * loader/ResourceLoadInfo.h:
2360         Keep track of which actions have an if-domain trigger.  If an action is in the 
2361         filtersWithDomainsBytecode, then it either has an if-domain or an unless-domain in its trigger.
2362         This requires additional information in the bytecode, so there are two new bytecode types.
2363
2364 2015-05-11  Yoav Weiss  <yoav@yoav.ws>
2365
2366         Add srcset, sizes and picture to the features json
2367         https://bugs.webkit.org/show_bug.cgi?id=144862
2368
2369         Reviewed by Benjamin Poulain.
2370
2371         Add the srcset w descriptor and sizes attribute as a new feature in the JSON file,
2372         as well as adding the picture element and srcset's x descriptor as seperate features.
2373
2374         No new tests, since no new functionality added.
2375
2376         * features.json:
2377
2378 2015-05-11  Chris Dumez  <cdumez@apple.com>
2379
2380         Fix checkingLogicalHeight initialization in Document::updateLayoutIfDimensionsOutOfDate()
2381         https://bugs.webkit.org/show_bug.cgi?id=144873
2382
2383         Reviewed by Simon Fraser.
2384
2385         Fix checkingLogicalHeight initialization in Document::updateLayoutIfDimensionsOutOfDate().
2386         checkingLogicalHeight should only be initialized to true when
2387         "dimensionsCheck & WidthDimensionsCheck" if isVertical is true.
2388
2389         * dom/Document.cpp:
2390         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
2391
2392 2015-05-11  Daniel Bates  <dabates@apple.com>
2393
2394         [iOS] Close all open databases in expiration handler of process assertion
2395         https://bugs.webkit.org/show_bug.cgi?id=144661
2396         <rdar://problem/20845052>
2397
2398         Reviewed by Darin Adler.
2399
2400         Expose functionality in WebCore to close all open databases. Closing a SQLite database
2401         will interrupt any in-progress database transactions.
2402
2403         * Modules/webdatabase/AbstractDatabaseServer.h:
2404         * Modules/webdatabase/DatabaseManager.cpp:
2405         (WebCore::DatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseServer::closeAllDatabases().
2406         * Modules/webdatabase/DatabaseManager.h: Export DatabaseManager::closeAllDatabases() so that
2407         we can call in from WebKit2.
2408         * Modules/webdatabase/DatabaseServer.cpp:
2409         (WebCore::DatabaseServer::closeAllDatabases): Added; turns around and calls DatabaseTracker::closeAllDatabases().
2410         * Modules/webdatabase/DatabaseServer.h:
2411         * Modules/webdatabase/DatabaseTracker.cpp:
2412         (WebCore::DatabaseTracker::closeAllDatabases): Added; closes all open databases.
2413         * Modules/webdatabase/DatabaseTracker.h: Export DatabaseTracker::closeAllDatabases() so that
2414         we can call in from Legacy WebKit.
2415
2416 2015-05-11  Antti Koivisto  <antti@apple.com>
2417
2418         WebContent crash under com.apple.WebCore: WebCore::WebKitCSSResourceValue::isCSSValueNone const + 6
2419         https://bugs.webkit.org/show_bug.cgi?id=144870
2420         rdar://problem/20727702
2421
2422         Reviewed by Simon Fraser.
2423
2424         No repro but we are seeing null pointer crashes like this:
2425
2426         Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
2427         0   com.apple.WebCore   0x00007fff92da5706 WebCore::WebKitCSSResourceValue::isCSSValueNone() const + 6
2428         1   com.apple.WebCore   0x00007fff93382b48 WebCore::MaskImageOperation::isCSSValueNone() const + 24
2429         2   com.apple.WebCore   0x00007fff92e0475e WebCore::FillLayer::hasNonEmptyMaskImage() const + 30
2430
2431         * platform/graphics/MaskImageOperation.cpp:
2432         (WebCore::MaskImageOperation::MaskImageOperation):
2433         (WebCore::MaskImageOperation::isCSSValueNone):
2434
2435             This would crash like this if both m_styleImage and m_cssMaskImageValue are null.
2436             There are no obvious guarantees that this doesn't happen. Two of the constructor variants allow it
2437             and there is setImage which may turn m_styleImage null later too.
2438
2439             Fix by making null m_cssMaskImageValue always signify CSSValueNone.
2440
2441         (WebCore::MaskImageOperation::cssValue):
2442
2443 2015-05-11  Chris Fleizach  <cfleizach@apple.com>
2444
2445         AX: Crash at WebCore::AccessibilityMenuList::addChildren()
2446         https://bugs.webkit.org/show_bug.cgi?id=144860
2447
2448         Reviewed by Mario Sanchez Prada.
2449
2450         There were some unsafe pointer accesses in AccessibilityMenuList code that needed to be cleaned up.
2451
2452         Test: accessibility/menu-list-crash2.html
2453
2454         * accessibility/AccessibilityMenuList.cpp:
2455         (WebCore::AccessibilityMenuList::addChildren):
2456
2457 2015-05-11  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
2458
2459         [WebGL] Unnecessary condition check in the while loop
2460         https://bugs.webkit.org/show_bug.cgi?id=125001
2461
2462         Reviewed by Csaba Osztrogonác.
2463
2464         While loop in this case needs to be optimized a little.
2465         For now a conditional statement in while will execute two
2466         times at begin. do-while loop avoids to check first statement.
2467
2468         No new tests. No behaviour changed.
2469
2470         * html/canvas/WebGLFramebuffer.cpp:
2471         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
2472
2473 2015-05-11  Joonghun Park  <jh718.park@samsung.com>
2474
2475         [GTK] Reorder Performance class's member initialization sequence
2476         https://bugs.webkit.org/show_bug.cgi?id=144858
2477
2478         Reviewed by Csaba Osztrogonác.
2479
2480         No new tests, no new behaviors.
2481
2482         * page/Performance.cpp:
2483         (WebCore::Performance::Performance):
2484
2485 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2486
2487         Reduce TransformationMatrix copies in WebKitCSSMatrix operations
2488         https://bugs.webkit.org/show_bug.cgi?id=144795
2489
2490         Reviewed by Darin Adler.
2491
2492         Instead of copying the TransformationMatrix member, performing
2493         the operation on it and then copying it again when creating
2494         the new WebKitCSSMatrix object, copy it just once by first
2495         creating the new WebKitCSSMatrix object and then performing
2496         the operation on that object's TransformationMatrix directly.
2497
2498         * css/WebKitCSSMatrix.cpp:
2499         (WebCore::WebKitCSSMatrix::multiply):
2500         (WebCore::WebKitCSSMatrix::translate):
2501         (WebCore::WebKitCSSMatrix::scale):
2502         (WebCore::WebKitCSSMatrix::rotate):
2503         (WebCore::WebKitCSSMatrix::rotateAxisAngle):
2504         (WebCore::WebKitCSSMatrix::skewX):
2505         (WebCore::WebKitCSSMatrix::skewY):
2506
2507 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2508
2509         Add missing vtable override specifiers under Source/WebCore/loader, Source/WebCore/xml
2510         https://bugs.webkit.org/show_bug.cgi?id=144793
2511
2512         Reviewed by Darin Adler.
2513
2514         Update virtual method overrides under Source/WebCore/loader
2515         and Source/WebCore/dom which are missing the override specifier.
2516
2517         * loader/DocumentThreadableLoader.h:
2518         (WebCore::DocumentThreadableLoader::refThreadableLoader):
2519         (WebCore::DocumentThreadableLoader::derefThreadableLoader):
2520         * loader/cache/CachedRawResource.h:
2521         * xml/parser/XMLDocumentParser.h:
2522
2523 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
2524
2525         Add missing vtable override specifiers under Source/WebCore/accessibility, Source/WebCore/dom
2526         https://bugs.webkit.org/show_bug.cgi?id=144792
2527
2528         Reviewed by Darin Adler.
2529
2530         Update virtual method overrides under Source/WebCore/accessibility
2531         and Source/WebCore/dom which are missing the override specifier.
2532
2533         * accessibility/AccessibilityMockObject.h:
2534         (WebCore::AccessibilityMockObject::isDetachedFromParent): Deleted.
2535         * accessibility/AccessibilityRenderObject.h:
2536         * dom/DecodedDataDocumentParser.h:
2537         * dom/TouchEvent.h:
2538
2539 2015-05-10  Zan Dobersek  <zdobersek@igalia.com>
2540
2541         Have MediaStream::getAudioTracks(), MediaStream::getVideoTracks() return const references
2542         https://bugs.webkit.org/show_bug.cgi?id=144794
2543
2544         Reviewed by Philippe Normand.
2545
2546         * Modules/mediastream/MediaStream.h: getAudioTracks() and getVideoTracks()
2547         should return a const reference to the member variables, instead of
2548         copying the objects on every call.
2549
2550 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2551
2552         Use Ref instead of PassRefPtr in WebCore/page
2553         https://bugs.webkit.org/show_bug.cgi?id=144841
2554
2555         Reviewed by Darin Adler.
2556
2557         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
2558         in WebCore/page.
2559
2560         No new tests, no behavior changes.
2561
2562         * page/DebugPageOverlays.cpp:
2563         * page/EventSource.cpp:
2564         (WebCore::EventSource::create):
2565         * page/EventSource.h:
2566         * page/History.h:
2567         (WebCore::History::create):
2568         * page/Location.h:
2569         (WebCore::Location::create):
2570         * page/MainFrame.cpp:
2571         (WebCore::MainFrame::create):
2572         * page/MainFrame.h:
2573         * page/Navigator.h:
2574         (WebCore::Navigator::create):
2575         * page/PageOverlay.cpp:
2576         (WebCore::PageOverlay::create):
2577         * page/PageOverlay.h:
2578         * page/Performance.h:
2579         * page/PerformanceEntryList.h:
2580         (WebCore::PerformanceEntryList::create):
2581         * page/PerformanceMark.h:
2582         (WebCore::PerformanceMark::create):
2583         * page/PerformanceMeasure.h:
2584         (WebCore::PerformanceMeasure::create):
2585         * page/PerformanceNavigation.h:
2586         (WebCore::PerformanceNavigation::create):
2587         * page/PerformanceResourceTiming.h:
2588         (WebCore::PerformanceResourceTiming::create):
2589         * page/PerformanceTiming.h:
2590         (WebCore::PerformanceTiming::create):
2591         * page/PerformanceUserTiming.h:
2592         (WebCore::UserTiming::create):
2593         * page/Screen.h:
2594         * page/Settings.cpp:
2595         (WebCore::Settings::create):
2596         * page/Settings.h:
2597         * page/TextIndicator.cpp:
2598         (WebCore::TextIndicator::create):
2599         * page/TextIndicator.h:
2600         * page/UserContentController.cpp:
2601         (WebCore::UserContentController::create):
2602         * page/UserContentController.h:
2603         * page/UserMessageHandlerDescriptor.h:
2604         (WebCore::UserMessageHandlerDescriptor::create):
2605         * page/UserMessageHandlersNamespace.h:
2606         * page/VisitedLinkStore.h:
2607         * page/WebKitNamespace.h:
2608         (WebCore::WebKitNamespace::create):
2609         * page/WebKitPoint.h:
2610         (WebCore::WebKitPoint::create):
2611         * page/WorkerNavigator.h:
2612         (WebCore::WorkerNavigator::create):
2613         * page/animation/ImplicitAnimation.h:
2614         (WebCore::ImplicitAnimation::create):
2615         * page/animation/KeyframeAnimation.h:
2616         * page/mac/ServicesOverlayController.h:
2617         * page/mac/ServicesOverlayController.mm:
2618         (WebCore::ServicesOverlayController::Highlight::createForSelection):
2619         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
2620         * page/scrolling/ScrollingCoordinator.cpp:
2621         (WebCore::ScrollingCoordinator::create):
2622         * page/scrolling/ScrollingCoordinator.h:
2623         * page/scrolling/ScrollingStateFixedNode.cpp:
2624         (WebCore::ScrollingStateFixedNode::create):
2625         (WebCore::ScrollingStateFixedNode::clone):
2626         * page/scrolling/ScrollingStateFixedNode.h:
2627         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2628         (WebCore::ScrollingStateFrameScrollingNode::create):
2629         (WebCore::ScrollingStateFrameScrollingNode::clone):
2630         * page/scrolling/ScrollingStateFrameScrollingNode.h:
2631         * page/scrolling/ScrollingStateNode.h:
2632         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
2633         (WebCore::ScrollingStateOverflowScrollingNode::create):
2634         (WebCore::ScrollingStateOverflowScrollingNode::clone):
2635         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
2636         * page/scrolling/ScrollingStateStickyNode.cpp:
2637         (WebCore::ScrollingStateStickyNode::create):
2638         (WebCore::ScrollingStateStickyNode::clone):
2639         * page/scrolling/ScrollingStateStickyNode.h:
2640         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
2641         (WebCore::ScrollingCoordinator::create):
2642         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
2643         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
2644         (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
2645         * page/scrolling/ios/ScrollingTreeIOS.cpp:
2646         (WebCore::ScrollingTreeIOS::create):
2647         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2648         (WebCore::ScrollingCoordinator::create):
2649         * page/scrolling/mac/ScrollingTreeFixedNode.h:
2650         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
2651         (WebCore::ScrollingTreeFixedNode::create):
2652         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
2653         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2654         (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
2655         * page/scrolling/mac/ScrollingTreeMac.cpp:
2656         (ScrollingTreeMac::create):
2657         * page/scrolling/mac/ScrollingTreeMac.h:
2658         * page/scrolling/mac/ScrollingTreeStickyNode.h:
2659         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
2660         (WebCore::ScrollingTreeStickyNode::create):
2661
2662 2015-05-10  Simon Fraser  <simon.fraser@apple.com>
2663
2664         background-position sometimes doesn't work properly with background-attachment: fixed
2665         https://bugs.webkit.org/show_bug.cgi?id=103757
2666         rdar://problem/18749925
2667
2668         Reviewed by Darin Adler.
2669         
2670         Fix sizing issues with fixed backgrounds when top content inset (blurred toolbar) is in
2671         effect.
2672         
2673         The primary issue was that positioningAreaSize was including the top content inset
2674         height, and should not have been, but there were also issues with the "fixedBackgroundPaintsInLocalCoordinates"
2675         code path, which kicks in when the root background is fixed.
2676
2677         Tests: platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-cover-local.html
2678                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-cover.html
2679                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-local.html
2680                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-positioned.html
2681
2682         * rendering/RenderBoxModelObject.cpp:
2683         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2684
2685 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
2686
2687         Get rid of the public item accessors in BackForwardClient
2688         https://bugs.webkit.org/show_bug.cgi?id=144827
2689
2690         Reviewed by Darin Adler.
2691
2692         Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
2693         We can still use these functionalities through BackForwardController.
2694
2695         No new tests, no behavior change.
2696
2697         * history/BackForwardClient.h:
2698         (WebCore::BackForwardClient::backItem): Deleted.
2699         (WebCore::BackForwardClient::currentItem): Deleted.
2700         (WebCore::BackForwardClient::forwardItem): Deleted.
2701
2702 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
2703
2704         Rename Length::isPercent() and Length::isPercentNotCalculated().
2705         https://bugs.webkit.org/show_bug.cgi?id=144791
2706
2707         Reviewed by Darin Adler.
2708
2709         1. Rename these methods as below for consistency and clarity.
2710
2711         Length::isPercentNotCalculated() => Length::isPercent()
2712         Length::isPercent() => Length::isPercentOrCalculated()
2713
2714         2. Simplify the condition check of length type in SVGLengthContext::valueForLength().
2715
2716         "length.isPercent() && !length.isCalculated()" => "length.isPercent()"
2717
2718         No new tests, no behavior change.
2719
2720         * css/CSSComputedStyleDeclaration.cpp:
2721         (WebCore::valueForImageSliceSide):
2722         (WebCore::valueForReflection):
2723         (WebCore::percentageOrZoomAdjustedValue):
2724         (WebCore::lineHeightFromStyle):
2725         (WebCore::ComputedStyleExtractor::propertyValue):
2726         * html/HTMLPlugInImageElement.cpp:
2727         (WebCore::is100Percent):
2728         * page/animation/AnimationBase.cpp:
2729         (WebCore::AnimationBase::computeTransformedExtentViaTransformList):
2730         * platform/Length.h:
2731         (WebCore::Length::percent):
2732         (WebCore::Length::isPercent):
2733         (WebCore::Length::isPercentOrCalculated):
2734         (WebCore::Length::isSpecified):
2735         (WebCore::Length::isPercentNotCalculated): Deleted.
2736         * platform/graphics/transforms/TranslateTransformOperation.h:
2737         * rendering/AutoTableLayout.cpp:
2738         (WebCore::AutoTableLayout::recalcColumn):
2739         (WebCore::AutoTableLayout::fullRecalc):
2740         (WebCore::shouldScaleColumns):
2741         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
2742         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
2743         (WebCore::AutoTableLayout::layout):
2744         * rendering/FixedTableLayout.cpp:
2745         (WebCore::FixedTableLayout::calcWidthArray):
2746         (WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
2747         (WebCore::FixedTableLayout::layout):
2748         * rendering/RenderBlock.cpp:
2749         (WebCore::RenderBlock::isSelfCollapsingBlock):
2750         (WebCore::RenderBlock::textIndentOffset):
2751         * rendering/RenderBox.cpp:
2752         (WebCore::RenderBox::needsPreferredWidthsRecalculation):
2753         (WebCore::RenderBox::computeLogicalHeight):
2754         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2755         (WebCore::RenderBox::computePercentageLogicalHeight):
2756         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
2757         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2758         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2759         (WebCore::RenderBox::availableLogicalHeightUsing):
2760         (WebCore::logicalWidthIsResolvable):
2761         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
2762         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
2763         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2764         * rendering/RenderBoxModelObject.cpp:
2765         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
2766         (WebCore::RenderBoxModelObject::relativePositionOffset):
2767         (WebCore::RenderBoxModelObject::computedCSSPadding):
2768         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
2769         (WebCore::RenderBoxModelObject::calculateFillTileSize):
2770         * rendering/RenderDeprecatedFlexibleBox.cpp:
2771         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
2772         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
2773         * rendering/RenderElement.cpp:
2774         (WebCore::mustRepaintFillLayers):
2775         * rendering/RenderFileUploadControl.cpp:
2776         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
2777         * rendering/RenderFrameSet.cpp:
2778         (WebCore::RenderFrameSet::layOutAxis):
2779         * rendering/RenderImage.cpp:
2780         (WebCore::RenderImage::repaintOrMarkForLayout):
2781         * rendering/RenderInline.cpp:
2782         (WebCore::computeMargin):
2783         * rendering/RenderListBox.cpp:
2784         (WebCore::RenderListBox::computeIntrinsicLogicalWidths):
2785         * rendering/RenderMenuList.cpp:
2786         (RenderMenuList::computeIntrinsicLogicalWidths):
2787         * rendering/RenderObject.cpp:
2788         (WebCore::objectIsRelayoutBoundary):
2789         * rendering/RenderReplaced.cpp:
2790         (WebCore::RenderReplaced::computePreferredLogicalWidths):
2791         * rendering/RenderSlider.cpp:
2792         (WebCore::RenderSlider::computeIntrinsicLogicalWidths):
2793         * rendering/RenderTable.cpp:
2794         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
2795         * rendering/RenderTableSection.cpp:
2796         (WebCore::RenderTableSection::layoutRows):
2797         * rendering/RenderTextControl.cpp:
2798         (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
2799         * rendering/RenderView.cpp:
2800         (WebCore::RenderView::layout):
2801         * rendering/RootInlineBox.cpp:
2802         (WebCore::RootInlineBox::verticalPositionForBox):
2803         * rendering/style/GridLength.h:
2804         (WebCore::GridLength::isPercentage):
2805         * rendering/style/GridTrackSize.h:
2806         (WebCore::GridTrackSize::isPercentage):
2807         * rendering/style/RenderStyle.cpp:
2808         (WebCore::RenderStyle::computedLineHeight):
2809         * rendering/svg/RenderSVGRoot.cpp:
2810         (WebCore::RenderSVGRoot::hasRelativeDimensions):
2811         * svg/SVGLengthContext.cpp:
2812         (WebCore::SVGLengthContext::valueForLength):
2813         * svg/graphics/SVGImage.cpp:
2814         (WebCore::SVGImage::hasRelativeWidth):
2815         (WebCore::SVGImage::hasRelativeHeight):
2816
2817 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
2818
2819         Remove unnecessary semicolons.
2820         https://bugs.webkit.org/show_bug.cgi?id=144844
2821
2822         Reviewed by Darin Adler.
2823
2824         No new tests, no behavior change.
2825
2826         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2827         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2828         * platform/ios/PasteboardIOS.mm:
2829         (WebCore::Pasteboard::readString):
2830         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
2831         (WebCore::RealtimeMediaSourceCapabilities::setHasVideoSource):
2832         * platform/network/mac/ResourceErrorMac.mm:
2833         (WebCore::ResourceError::nsError):
2834         * rendering/RenderThemeIOS.mm:
2835         (WebCore::getSharedFunctionRef):
2836
2837 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
2838
2839         Remove unnecessary forward declarations in StyleProperties.h
2840         https://bugs.webkit.org/show_bug.cgi?id=144843
2841
2842         Reviewed by Darin Adler.
2843
2844         No new tests, no behavior change.        
2845
2846         * css/StyleProperties.h:
2847
2848 2015-05-10  Darin Adler  <darin@apple.com>
2849
2850         [Cocoa] Fix paths and resort WebCore project file
2851         https://bugs.webkit.org/show_bug.cgi?id=144838
2852
2853         Reviewed by Dan Bernstein.
2854
2855         * WebCore.xcodeproj/project.pbxproj: Re-sorted this file with the
2856         sort-Xcode-project-file script and fixed the paths in the platform/ios directory.
2857
2858 2015-05-10  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2859
2860         [Streams API] Refactor ReadableStreamReader close promise callback cleaning
2861         https://bugs.webkit.org/show_bug.cgi?id=144799
2862
2863         Reviewed by Darin Adler.
2864
2865         Moved close callback cleaning to releaseStream, which is now releaseStreamAndClean.
2866         Moved that method to private as it is no longer needed by subclasses.
2867
2868         No behavior changes.
2869
2870         * Modules/streams/ReadableStreamReader.cpp:
2871         (WebCore::ReadableStreamReader::releaseStreamAndClean):
2872         (WebCore::ReadableStreamReader::changeStateToClosed):
2873         (WebCore::ReadableStreamReader::changeStateToErrored):
2874         * Modules/streams/ReadableStreamReader.h:
2875
2876 2015-05-10  Darin Adler  <darin@apple.com>
2877
2878         [Cocoa] Don't soft link DataDetectorsCore
2879         https://bugs.webkit.org/show_bug.cgi?id=144837
2880
2881         Reviewed by Dan Bernstein.
2882
2883         Linking this in the normal way should slightly speed up the web process
2884         startup time. We don't need to soft link it: It's present in the
2885         OS X base system and there is no reference cycle with WebKit.
2886
2887         * Configurations/WebCore.xcconfig: Added PrivateFrameworks to
2888         FRAMEWORK_SEARCH_PATHS for Mac and added DataDetectorsCore to
2889         OTHER_LDFLAGS_PLATFORM for Mac. We may want to do this later for iOS too.
2890
2891         * WebCore.xcodeproj/project.pbxproj: Added DataDetectorsCoreSPI.h.
2892
2893         * editing/mac/DataDetection.mm:
2894         (WebCore::DataDetection::detectItemAroundHitTestResult): Removed check to see
2895         if DataDetectorsCore is available.
2896
2897         * page/mac/ServicesOverlayController.h: Simplified a forward declaration to
2898         only declare what we actually use.
2899         * page/mac/ServicesOverlayController.mm: Moved SOFT_LINK from here to the
2900         DataDetectorsSPI.h header.
2901
2902         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Added. This is the low level
2903         DataDetectorsCore framework, which has no reference cycle with WebKit, and
2904         which we can link to normally. Moved the content here from DataDetectorsSPI.h,
2905         added a USE(APPLE_INTERNAL_SDK) path that uses the system headers, and fixed
2906         the incorrect return type on DDScannerScanQuery, which was detected when
2907         using the system headers in conjunction with this file.
2908
2909         * platform/spi/mac/DataDetectorsSPI.h: Removed the content of this file that
2910         was actually about DataDetectorsCore. Also added a USE(APPLE_INTERNAL_SDK)
2911         path that uses the system headers and moved a few stray DataDetectors SPI
2912         definitions from elsewhere into this header.
2913
2914 2015-05-10  Chris Fleizach  <cfleizach@apple.com>
2915
2916         AX: Don't expose elements as data tables just because they use display: table
2917         https://bugs.webkit.org/show_bug.cgi?id=144804
2918
2919         Reviewed by Mario Sanchez Prada.
2920
2921         Elements will create RenderTable objects if they have display:table. We shouldn't assume these are accessibility tables.
2922
2923         Test: accessibility/css-table-ignored.html
2924
2925         * accessibility/AccessibilityTable.cpp:
2926         (WebCore::AccessibilityTable::isDataTable):
2927
2928 2015-05-09  Chris Dumez  <cdumez@apple.com>
2929
2930         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl
2931         https://bugs.webkit.org/show_bug.cgi?id=144825
2932
2933         Reviewed by Sam Weinig.
2934
2935         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl as per DOM
2936         specification and to avoid IDL code duplication:
2937         - https://dom.spec.whatwg.org/#interface-parentnode
2938         - https://dom.spec.whatwg.org/#interface-nondocumenttypechildnode
2939
2940         No Web-Exposed behavior change.
2941
2942         * CMakeLists.txt:
2943         * DerivedSources.make:
2944         * WebCore.xcodeproj/project.pbxproj:
2945         * dom/CharacterData.idl:
2946         * dom/Document.idl:
2947         * dom/DocumentFragment.idl:
2948         * dom/Element.idl:
2949         * dom/NonDocumentTypeChildNode.idl: Copied from Source/WebCore/dom/DocumentFragment.idl.
2950         * dom/ParentNode.idl: Copied from Source/WebCore/dom/DocumentFragment.idl.
2951
2952 2015-05-09  Chris Dumez  <cdumez@apple.com>
2953
2954         Invalidate the FontCache on WebProcess suspension / critical memory pressure
2955         https://bugs.webkit.org/show_bug.cgi?id=144821
2956
2957         Reviewed by Antti Koivisto.
2958
2959         Invalidate the FontCache on WebProcess suspension / critical memory
2960         pressure to free a bit more memory (an extra 4-16Kb per WebProcess on
2961         the pages I tested). We already purge inactive font data on
2962         non-critical memory warning but invalidating the whole FontCache takes
2963         care of clearing the FontCascade cache and the fontPlatformData cache
2964         as well.
2965
2966         * platform/MemoryPressureHandler.cpp:
2967         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2968
2969 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
2970
2971         Remove the PICTURE_SIZES build flag
2972         https://bugs.webkit.org/show_bug.cgi?id=144679
2973
2974         Reviewed by Benjamin Poulain.
2975
2976         Removed the PICTURE_SIZES build time flag.
2977
2978         No new tests, since there's no functionality change.
2979
2980         * Configurations/FeatureDefines.xcconfig:
2981         * css/CSSGrammar.y.in:
2982         * css/CSSParser.cpp:
2983         (WebCore::CSSParser::detectAtToken):
2984         * css/CSSParser.h:
2985         * css/SourceSizeList.cpp:
2986         (WebCore::parseSizesAttribute): Deleted.
2987         * html/HTMLImageElement.cpp:
2988         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
2989         * html/HTMLImageElement.h:
2990         (WebCore::HTMLImageElement::currentSrc):
2991         * html/HTMLImageElement.idl:
2992         * html/parser/HTMLPreloadScanner.cpp:
2993         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2994         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2995         * html/parser/HTMLSrcsetParser.cpp:
2996         (WebCore::parseDescriptors):
2997         (WebCore::pickBestImageCandidate):
2998
2999 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
3000
3001         Remove convenience constructors for TextRun
3002         https://bugs.webkit.org/show_bug.cgi?id=144752
3003
3004         These convenience constructors are unnecessary. Moving the code that makes the StringView
3005         back to the call site will also help us make things more elegant in future refactoring.
3006
3007         Reviewed by Darin Adler.
3008
3009         No new tests because there is no behavior change.
3010
3011         * css/CSSPrimitiveValue.cpp:
3012         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
3013         * platform/graphics/StringTruncator.cpp:
3014         (WebCore::stringWidth):
3015         * platform/graphics/TextRun.h:
3016         (WebCore::TextRun::TextRun):
3017         * platform/mac/DragImageMac.mm:
3018         (WebCore::widthWithFont):
3019         (WebCore::drawAtPoint):
3020         * rendering/SimpleLineLayout.cpp:
3021         (WebCore::SimpleLineLayout::canUseFor):
3022         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3023         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3024         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
3025         * rendering/TextPainter.cpp:
3026         (WebCore::TextPainter::paintText):
3027
3028 2015-05-08  Sam Weinig  <sam@webkit.org>
3029
3030         Element Traversal is not just Elements anymore
3031         https://bugs.webkit.org/show_bug.cgi?id=144822
3032
3033         Reviewed by Simon Fraser.
3034
3035         Match other browsers and the new DOM spec at https://dom.spec.whatwg.org by
3036         exposing the element traversal methods on non-Elements.
3037
3038         - Makes firstElementChild, lastElementChild and childElementCount available on
3039           Document and DocumentFragment in addition to Element.
3040         - Makes nextElementSibling and previousElementSibling available on CharacterData
3041           in addition to Element.
3042
3043         Tests: fast/dom/element-traversal-on-character-data.html
3044                fast/dom/element-traversal-on-document-fragment.html
3045                fast/dom/element-traversal-on-document.html
3046
3047         * dom/CharacterData.idl:
3048         Expose nextElementSibling and previousElementSibling.
3049
3050         * dom/ContainerNode.cpp:
3051         (WebCore::ContainerNode::firstElementChild):
3052         (WebCore::ContainerNode::lastElementChild):
3053         (WebCore::ContainerNode::childElementCount):
3054         * dom/ContainerNode.h:
3055         Move implementations of firstElementChild, lastElementChild and childElementCount here
3056         from Element to make them shareable.
3057
3058         * dom/Document.idl:
3059         * dom/DocumentFragment.idl:
3060         Expose firstElementChild, lastElementChild and childElementCount.
3061
3062         * dom/Element.cpp:
3063         (WebCore::Element::firstElementChild): Deleted.
3064         (WebCore::Element::lastElementChild): Deleted.
3065         (WebCore::Element::previousElementSibling): Deleted.
3066         (WebCore::Element::nextElementSibling): Deleted.
3067         (WebCore::Element::childElementCount): Deleted.
3068         * dom/Element.h:
3069         Move element traversal functions down to Node and ContainerNode.
3070
3071         * dom/Element.idl:
3072         Update comments to indicate where these functions are defined now.
3073
3074         * dom/Node.cpp:
3075         (WebCore::Node::previousElementSibling):
3076         (WebCore::Node::nextElementSibling):
3077         * dom/Node.h:
3078         Move implementations of nextElementSibling and previousElementSibling here
3079         from Element to make them shareable.
3080
3081 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
3082
3083         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
3084         https://bugs.webkit.org/show_bug.cgi?id=144746
3085
3086         Reviewed by Carlos Garcia Campos.
3087
3088         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
3089
3090         * platform/gtk/GtkUtilities.cpp:
3091         * platform/gtk/GtkUtilities.h:
3092         * platform/text/gtk/HyphenationLibHyphen.cpp:
3093         (WebCore::availableLocales):
3094
3095 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
3096
3097         Crashes in SocketStreamHandleBase::close
3098         https://bugs.webkit.org/show_bug.cgi?id=144767
3099         rdar://problem/20486538
3100
3101         Reviewed by Brady Eidson.
3102
3103         This is a speculative fix, I could not reproduce the crash.
3104
3105         * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::processFrame):
3106         Normally, processOutgoingFrameQueue() closes the handle in the end when called in
3107         OutgoingFrameQueueClosing state. But there is no definitive protection against
3108         processing two CLOSE frames, in which case we'd try to close the handle twice.
3109
3110         * platform/network/cf/SocketStreamHandleCFNet.cpp:
3111         (WebCore::SocketStreamHandle::readStreamCallback): Passing empty data to the client
3112         results in the socket being closed, which makes no sense here.
3113
3114 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3115
3116         Unreviewed, rolling out r183996.
3117         https://bugs.webkit.org/show_bug.cgi?id=144806
3118
3119         ASan detected use-after free (Requested by ap on #webkit).
3120
3121         Reverted changeset:
3122
3123         "Remove convenience constructors for TextRun"
3124         https://bugs.webkit.org/show_bug.cgi?id=144752
3125         http://trac.webkit.org/changeset/183996
3126
3127 2015-05-08  Eric Carlson  <eric.carlson@apple.com>
3128
3129         [Mac] Playback target clients do not unregister on page reload
3130         https://bugs.webkit.org/show_bug.cgi?id=144761
3131
3132         Reviewed by Brady Eidson.
3133
3134         * dom/Document.cpp:
3135         (WebCore::Document::prepareForDestruction): Unregister all target picker clients.
3136
3137         * html/HTMLMediaElement.cpp:
3138         (WebCore::HTMLMediaElement::registerWithDocument): Register for page cache callback.
3139         (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for page cache callback.
3140         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): New.
3141         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): New.
3142
3143 2015-05-08  Chris Dumez  <cdumez@apple.com>
3144
3145         Throttle RequestAnimationFrame in subframes that are outside the viewport
3146         https://bugs.webkit.org/show_bug.cgi?id=144718
3147         <rdar://problem/20688782>
3148
3149         Reviewed by Simon Fraser.
3150
3151         Throttle RequestAnimationFrame in subframes that are outside the
3152         viewport or have "display: none" for performance and power.
3153
3154         Tests: fast/animation/request-animation-frame-throttle-subframe-display-none.html
3155                fast/animation/request-animation-frame-throttle-subframe.html
3156
3157         * dom/Document.h:
3158         (WebCore::Document::scriptedAnimationController):
3159         * dom/ScriptedAnimationController.cpp:
3160         (WebCore::ScriptedAnimationController::setThrottled):
3161         (WebCore::ScriptedAnimationController::isThrottled):
3162         * dom/ScriptedAnimationController.h:
3163         * loader/FrameLoader.cpp:
3164         (WebCore::FrameLoader::open):
3165         Call FrameView::setFrameRect() only *after* the view has been
3166         set on the Frame. Otherwise, setFrameRect() ends up calling
3167         viewportContentsChanged() and we hit the
3168         ASSERT(frame().view() == this) assertion in windowClipRect()
3169         because the Frame still has its old FrameView. This is covered
3170         by loader/go-back-to-different-window-size.html layout test.
3171
3172         * page/FrameView.cpp:
3173         (WebCore::FrameView::viewportContentsChanged):
3174         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
3175         (WebCore::FrameView::resumeVisibleImageAnimations):
3176         (WebCore::FrameView::updateScriptedAnimationsThrottlingState):
3177         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
3178         (WebCore::FrameView::updateThrottledDOMTimersState):
3179         (WebCore::FrameView::scrollPositionChanged): Deleted.
3180         (WebCore::FrameView::sendResizeEventIfNeeded): Deleted.
3181         * page/FrameView.h:
3182         * testing/Internals.cpp:
3183         (WebCore::Internals::isRequestAnimationFrameThrottled):
3184         (WebCore::Internals::isTimerThrottled): Deleted.
3185         * testing/Internals.h:
3186         * testing/Internals.idl:
3187
3188 2015-05-08  Daniel Bates  <dabates@apple.com>
3189
3190         Fix the iOS Simulator external SDK build following <http://trac.webkit.org/changeset/181918>
3191
3192         Remove unused iOS Simulator-variant of CARenderServerRenderLayerWithTransform(). Also guard
3193         IOSurfaceRef-variant of CARenderServerRenderLayerWithTransform() with USE(IOSURFACE)
3194         since it is only applicable on platforms that use IOSurface.
3195
3196         * platform/spi/cocoa/QuartzCoreSPI.h:
3197
3198 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
3199
3200         Remove convenience constructors for TextRun
3201         https://bugs.webkit.org/show_bug.cgi?id=144752
3202
3203         These convenience constructors are unnecessary. Moving the code that makes the StringView
3204         back to the call site will also help us make things more elegant in future refactoring.
3205
3206         Reviewed by Darin Adler.
3207
3208         No new tests because there is no behavior change.
3209
3210         * css/CSSPrimitiveValue.cpp:
3211         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
3212         * platform/graphics/StringTruncator.cpp:
3213         (WebCore::stringWidth):
3214         * platform/graphics/TextRun.h:
3215         (WebCore::TextRun::TextRun):
3216         * platform/mac/DragImageMac.mm:
3217         (WebCore::widthWithFont):
3218         (WebCore::drawAtPoint):
3219         * rendering/SimpleLineLayout.cpp:
3220         (WebCore::SimpleLineLayout::canUseFor):
3221         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3222         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3223         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
3224         * rendering/TextPainter.cpp:
3225         (WebCore::TextPainter::paintText):
3226
3227 2015-05-08  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3228
3229         [Streams API] ReadableStream constructor start function should be able to error the stream
3230         https://bugs.webkit.org/show_bug.cgi?id=141162
3231
3232         Reviewed by Darin Adler.
3233
3234         This patch implements the functionality of the ReadableStreamController error function.
3235         It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise.
3236         Adding support to reject promise with any JSValue.
3237
3238         Support for storing the error is added to both reader and stream.
3239
3240         Test: streams/readable-stream-controller-error.html and rebased tests
3241
3242         * Modules/streams/ReadableStream.cpp:
3243         (WebCore::ReadableStream::changeStateToErrored):
3244         * Modules/streams/ReadableStream.h:
3245         * Modules/streams/ReadableStreamReader.cpp:
3246         (WebCore::ReadableStreamReader::initialize):
3247         (WebCore::ReadableStreamReader::closed):
3248         (WebCore::ReadableStreamReader::changeStateToClosed):
3249         (WebCore::ReadableStreamReader::changeStateToErrored):
3250         * Modules/streams/ReadableStreamReader.h:
3251         * bindings/js/JSDOMPromise.h:
3252         (WebCore::DeferredWrapper::reject):
3253         * bindings/js/JSReadableStreamControllerCustom.cpp:
3254         (WebCore::JSReadableStreamController::error):
3255         * bindings/js/JSReadableStreamReaderCustom.cpp:
3256         (WebCore::JSReadableStreamReader::closed):
3257         * bindings/js/ReadableJSStream.cpp:
3258         (WebCore::ReadableJSStream::createReader):
3259         (WebCore::ReadableJSStream::storeError):
3260         (WebCore::ReadableJSStream::Reader::storeError):
3261         (WebCore::ReadableJSStream::jsController): Deleted.
3262         * bindings/js/ReadableJSStream.h:
3263
3264 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3265
3266         Unreviewed, rolling out r183985.
3267         https://bugs.webkit.org/show_bug.cgi?id=144796
3268
3269         broke loader/go-back-to-different-window-size.html (Requested
3270         by kling on #webkit).
3271
3272         Reverted changeset:
3273
3274         "Throttle RequestAnimationFrame in subframes that are outside
3275         the viewport"
3276         https://bugs.webkit.org/show_bug.cgi?id=144718
3277         http://trac.webkit.org/changeset/183985
3278
3279 2015-05-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3280
3281         SharedBuffer::m_size should be initialized to 0 when defining it
3282         https://bugs.webkit.org/show_bug.cgi?id=144740
3283
3284         Reviewed by Darin Adler.
3285
3286         Setting m_size to 0 when declaring it and updating constructor definitions.
3287
3288         No change in behaviour.
3289
3290         * platform/SharedBuffer.cpp:
3291         (WebCore::SharedBuffer::SharedBuffer):
3292         * platform/SharedBuffer.h:
3293         * platform/cf/SharedBufferCF.cpp:
3294         (WebCore::SharedBuffer::SharedBuffer):
3295         * platform/soup/SharedBufferSoup.cpp:
3296         (WebCore::SharedBuffer::SharedBuffer):
3297
3298 2015-05-08  Commit Queue  <commit-queue@webkit.org>
3299
3300         Unreviewed, rolling out r183945.
3301         https://bugs.webkit.org/show_bug.cgi?id=144789
3302
3303         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
3304
3305         Reverted changeset:
3306
3307         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
3308         https://bugs.webkit.org/show_bug.cgi?id=144746
3309         http://trac.webkit.org/changeset/183945
3310
3311 2015-05-07  Chris Dumez  <cdumez@apple.com>
3312
3313         Throttle RequestAnimationFrame in subframes that are outside the viewport
3314         https://bugs.webkit.org/show_bug.cgi?id=144718
3315         <rdar://problem/20688782>
3316
3317         Reviewed by Simon Fraser.
3318
3319         Throttle RequestAnimationFrame in subframes that are outside the
3320         viewport or have "display: none" for performance and power.
3321
3322         Tests: fast/animation/request-animation-frame-throttle-subframe-display-none.html
3323                fast/animation/request-animation-frame-throttle-subframe.html
3324
3325         * dom/Document.h:
3326         (WebCore::Document::scriptedAnimationController):
3327         * dom/ScriptedAnimationController.cpp:
3328         (WebCore::ScriptedAnimationController::setThrottled):
3329         (WebCore::ScriptedAnimationController::isThrottled):
3330         * dom/ScriptedAnimationController.h:
3331         * page/FrameView.cpp:
3332         (WebCore::FrameView::viewportContentsChanged):
3333         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
3334         (WebCore::FrameView::resumeVisibleImageAnimations):
3335         (WebCore::FrameView::updateScriptedAnimationsThrottlingState):
3336         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
3337         (WebCore::FrameView::updateThrottledDOMTimersState):
3338         (WebCore::FrameView::scrollPositionChanged): Deleted.
3339         (WebCore::FrameView::sendResizeEventIfNeeded): Deleted.
3340         * page/FrameView.h:
3341         * testing/Internals.cpp:
3342         (WebCore::Internals::isRequestAnimationFrameThrottled):
3343         (WebCore::Internals::isTimerThrottled): Deleted.
3344         * testing/Internals.h:
3345         * testing/Internals.idl:
3346
3347 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
3348
3349         Calculate source-size length as a float
3350         https://bugs.webkit.org/show_bug.cgi?id=144766
3351
3352         Reviewed by Dean Jackson.
3353
3354         Make sure that the source-size length is calculated as a float,
3355         to align with the spec.
3356
3357         Test: fast/dom/HTMLImageElement/sizes/image-sizes-1x.html
3358               fast/dom/HTMLImageElement/sizes/image-sizes-2x.html
3359
3360         * css/SourceSizeList.cpp:
3361         (WebCore::parseSizesAttribute):
3362         (WebCore::defaultLength):
3363         (WebCore::computeLength):
3364         * css/SourceSizeList.h:
3365         * html/HTMLImageElement.cpp:
3366         (WebCore::HTMLImageElement::parseAttribute):
3367         * html/parser/HTMLPreloadScanner.cpp:
3368         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3369         * html/parser/HTMLSrcsetParser.cpp:
3370         (WebCore::pickBestImageCandidate):
3371         (WebCore::bestFitSourceForImageAttributes):
3372         * html/parser/HTMLSrcsetParser.h:
3373
3374 2015-05-07  Commit Queue  <commit-queue@webkit.org>
3375
3376         Unreviewed, rolling out r183895.
3377         https://bugs.webkit.org/show_bug.cgi?id=144786
3378
3379         Many tests became flaky (Requested by ap on #webkit).
3380
3381         Reverted changeset:
3382
3383         "Expose more font weights for -apple-system"
3384         https://bugs.webkit.org/show_bug.cgi?id=144707
3385         http://trac.webkit.org/changeset/183895
3386
3387 2015-05-07  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3388
3389         Add first-letter assert exception in RenderButton::setupInnerStyle().
3390         https://bugs.webkit.org/show_bug.cgi?id=140517OB
3391
3392         Reviewed by Darin Adler.
3393
3394         StyleResolver references inner block's render style temporary in
3395         RenderBlock::styleDidChange() when we have first-letter css pseudo
3396         element.
3397
3398         * rendering/RenderButton.cpp:
3399         (WebCore::RenderButton::setupInnerStyle):
3400
3401 2015-05-07  Chris Dumez  <cdumez@apple.com>
3402
3403         Unreviewed, fix build after r183970.
3404
3405         WEBCORE_EXPORT should not be used on inlined functions.
3406
3407         * platform/graphics/ca/GraphicsLayerCA.h:
3408
3409 2015-05-07  Anders Carlsson  <andersca@apple.com>
3410
3411         Build fixes.
3412
3413         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3414         (-[WebAccessibilityObjectWrapper doAXRTFForRange:]):
3415         * editing/cocoa/HTMLConverter.mm:
3416         (HTMLConverter::_addMarkersToList):
3417         * platform/mac/PasteboardMac.mm:
3418         (WebCore::writeFileWrapperAsRTFDAttachment):
3419         * platform/mac/PlatformPasteboardMac.mm:
3420         (WebCore::PlatformPasteboard::setTypes):
3421         Pass empty arrays and dictionaries instead of nil.
3422
3423         * rendering/RenderThemeMac.mm:
3424         (WebCore::RenderThemeMac::paintSliderThumb):
3425         Pass the document view to the AppKit paint method.
3426
3427 2015-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3428
3429         Purge PassRefPtr in WebCore/html - 3
3430         https://bugs.webkit.org/show_bug.cgi?id=144686
3431
3432         Reviewed by Andreas Kling.
3433
3434         Replace PassRefPtr with Ref in create() factory functions, because
3435         it doesn't have to change to be null.
3436
3437         No new tests, no behavior changes.
3438
3439         * html/FTPDirectoryDocument.h:
3440         * html/HTMLDetailsElement.cpp:
3441         (WebCore::DetailsContentElement::create):
3442         * html/HTMLKeygenElement.cpp:
3443         * html/HTMLSummaryElement.cpp:
3444         (WebCore::SummaryContentElement::create):
3445         * html/TimeRanges.cpp:
3446         (WebCore::TimeRanges::create):
3447         * html/shadow/SliderThumbElement.cpp:
3448         (WebCore::SliderContainerElement::create):
3449         * html/shadow/SliderThumbElement.h:
3450         (WebCore::SliderThumbElement::create):
3451         * html/shadow/SpinButtonElement.cpp:
3452         (WebCore::SpinButtonElement::create):
3453         * html/shadow/SpinButtonElement.h:
3454         * html/shadow/TextControlInnerElements.cpp:
3455         (WebCore::TextControlInnerContainer::create):
3456         (WebCore::TextControlInnerElement::create):
3457         (WebCore::TextControlInnerTextElement::create):
3458         (WebCore::SearchFieldResultsButtonElement::create):
3459         (WebCore::SearchFieldCancelButtonElement::create):
3460         * html/shadow/TextControlInnerElements.h:
3461         * html/shadow/YouTubeEmbedShadowElement.cpp:
3462         (WebCore::YouTubeEmbedShadowElement::create):
3463         * html/track/InbandDataTextTrack.cpp:
3464         (WebCore::InbandDataTextTrack::create):
3465         * html/track/InbandDataTextTrack.h:
3466         * html/track/InbandGenericTextTrack.cpp:
3467         (WebCore::InbandGenericTextTrack::create):
3468         * html/track/InbandGenericTextTrack.h:
3469         * html/track/InbandWebVTTTextTrack.cpp:
3470         (WebCore::InbandWebVTTTextTrack::create):
3471         * html/track/InbandWebVTTTextTrack.h:
3472         * html/track/LoadableTextTrack.h:
3473         * html/track/TextTrack.h:
3474         (WebCore::TextTrack::create):
3475         * html/track/TextTrackCueGeneric.cpp:
3476         * html/track/TextTrackCueGeneric.h:
3477         * html/track/TextTrackList.h:
3478         * html/track/VTTRegionList.h:
3479         (WebCore::VTTRegionList::create):
3480
3481 2015-05-07  Dean Jackson  <dino@apple.com>
3482
3483         [iOS] MediaControls: disappear while scrubbing
3484         https://bugs.webkit.org/show_bug.cgi?id=144777
3485         <rdar://problem/20065572>
3486
3487         Reviewed by Eric Carlson.
3488
3489         If we are scrubbing we shouldn't hide the controls.
3490
3491         * Modules/mediacontrols/mediaControlsApple.js:
3492         (Controller.prototype.hideControls): Return early if we are scrubbing.
3493         * Modules/mediacontrols/mediaControlsiOS.js:
3494         (ControllerIOS.prototype): Add initial value for _potentiallyScrubbing and
3495         rename from non-underscored value throughout the file.
3496         (ControllerIOS.prototype.handleTimelineTouchEnd): When we finish scrubbing, reset
3497         the timer to hide the controls.
3498
3499 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
3500
3501         REGRESSION (r183300): Fixed elements flash when scrolling
3502         https://bugs.webkit.org/show_bug.cgi?id=144778
3503         rdar://problem/20769741
3504
3505         Reviewed by Dean Jackson.
3506
3507         After r183300 we can detached layer backing store when outside the coverage region.
3508         However, position:fixed layers are moved around by the ScrollingCoordinator behind
3509         GraphicsLayer's back, so we can do layer flushes with stale information about layer
3510         geometry.
3511         
3512         To avoid dropping backing store for layers in this situation, prevent backing
3513         store detachment on layers registered with the ScrollingCoordinator as viewport-constrained
3514         layers. Preventing detachment on a layer also prevents detachment on all descendant
3515         layers.
3516
3517         * platform/graphics/GraphicsLayer.h:
3518         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment):
3519         (WebCore::GraphicsLayer::allowsBackingStoreDetachment):
3520         * platform/graphics/ca/GraphicsLayerCA.cpp:
3521         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
3522         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Set m_intersectsCoverageRect to true
3523         if backing store detachment is prevented.
3524         (WebCore::GraphicsLayerCA::recursiveCommitChanges): Set a bit in the CommitState to 
3525         communicate to descendants that detachment is prevented.
3526         * platform/graphics/ca/GraphicsLayerCA.h:
3527         (WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
3528         * rendering/RenderLayerBacking.cpp:
3529         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
3530         * rendering/RenderLayerBacking.h:
3531         (WebCore::RenderLayerBacking::setScrollingNodeIDForRole): If registering with a non-zero
3532         nodeID for the ViewportConstrained role, turn off backing store detachment.
3533
3534 2015-05-07  Sam Weinig  <sam@webkit.org>
3535
3536         Consider implementing Document.scrollingElement
3537         <rdar://problem/20845213>
3538         https://bugs.webkit.org/show_bug.cgi?id=143609
3539
3540         Reviewed by Simon Fraser.
3541
3542         Add the non-compliant implementation of Document.scrollingElement that the spec,
3543         found at http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement, 
3544         says we should have while we have non-compliant implementations of Element.scrollTop
3545         and Element.scrollLeft (fixing that is tracked by https://bugs.webkit.org/show_bug.cgi?id=106133).
3546
3547         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
3548                fast/dom/Document/scrollingElement-standards-mode.html
3549
3550         * dom/Document.cpp:
3551         (WebCore::Document::scrollingElement):
3552         * dom/Document.h:
3553         * dom/Document.idl:
3554
3555 2015-05-07  Dean Jackson  <dino@apple.com>
3556
3557         [iOS] While scrubbing and holding down, video continues to play
3558         https://bugs.webkit.org/show_bug.cgi?id=144776
3559         <rdar://problem/20863757>
3560
3561         Reviewed by Simon Fraser.
3562
3563         When we are scrubbing a video, we should pause playback. As we
3564         let go of the scrubber playback can resume (but only if it was
3565         playing originally).
3566
3567         * Modules/mediacontrols/mediaControlsiOS.js:
3568         (ControllerIOS.prototype.createControls): Listen for touchstart on the scrubber.
3569         (ControllerIOS.prototype.handleTimelineInput): Call the prototype, but pause if necessary.
3570         (ControllerIOS.prototype.handleTimelineChange): Just moved this to be with the other timeline functions.
3571         (ControllerIOS.prototype.handleTimelineTouchStart): Add the listeners for end and cancel. Remember that we are
3572         potentially about to scrub.
3573         (ControllerIOS.prototype.handleTimelineTouchEnd): Remove the listeners.
3574
3575 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
3576
3577         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
3578         https://bugs.webkit.org/show_bug.cgi?id=144335
3579
3580         Reviewed by Daniel Bates.
3581
3582         Address comments raised by Darin Adler in review.
3583
3584         * platform/graphics/ImageBuffer.cpp:
3585         (WebCore::ImageBuffer::sizeNeedsClamping):
3586         (WebCore::ImageBuffer::clampedSize):
3587         (WebCore::ImageBuffer::isSizeClamped): Deleted.
3588         * platform/graphics/ImageBuffer.h:
3589         The condition for the negative width/height in isSizeClamped() was wrong. Use
3590         FloatSize::isEmpty() instead and rename the function to sizeNeedsClamping().
3591         The new function should return the opposite of the old function return value.
3592         
3593         * platform/graphics/filters/FilterEffect.cpp:
3594         (WebCore::FilterEffect::apply):
3595         (WebCore::FilterEffect::asUnmultipliedImage):
3596         (WebCore::FilterEffect::asPremultipliedImage):
3597         (WebCore::FilterEffect::copyUnmultipliedImage):
3598         (WebCore::FilterEffect::copyPremultipliedImage):
3599         (WebCore::FilterEffect::createUnmultipliedImageResult):
3600         (WebCore::FilterEffect::createPremultipliedImageResult):
3601         * rendering/FilterEffectRenderer.cpp:
3602         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
3603         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
3604         * rendering/svg/RenderSVGResourceFilter.cpp:
3605         (WebCore::RenderSVGResourceFilter::applyResource):
3606         Call the new function and negate the condition for the return value.
3607
3608 2015-05-07  Anders Carlsson  <andersca@apple.com>
3609
3610         Build fix.
3611
3612         * editing/mac/EditorMac.mm:
3613         (WebCore::dataInRTFDFormat):
3614         (WebCore::dataInRTFFormat):
3615
3616 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
3617
3618         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
3619         https://bugs.webkit.org/show_bug.cgi?id=144335
3620
3621         Reviewed by Darin Adler.
3622
3623         When the SVG element is larger than 4096x4096 pixels and it has a filter,
3624         a clipper or a masker, the ImageBuffer which is created for drawing the
3625         sourceGraphicBuffer has to be clamped to this size. The reason for this
3626         clamping is the FilterEffect simply ignores processing any ImageBuffer
3627         larger than this size.
3628         
3629         The bug was happening because we did not propagate the clamping logic to
3630         the FilterEffect. The FilterEffect result ImageBuffer was not clamped as
3631         what we do for drawing the sourceGraphicBuffer. If only the destination
3632         point is specified, the GraphicsContext::drawImageBuffer() assumes the
3633         source and the destination images have the same size which is not true
3634         with the clamping.
3635         
3636         The fix is to add the clamping logic to the FilterEffect. Two places we
3637         need to change. (1) FilterEffect::createImageBufferResult() has to apply
3638         the same clamping we do in SVGRenderingContext::createImageBuffer(). (2)
3639         FilterEffect::drawingRegionOfInputImage() has to consider the clamping 
3640         when mapping from absolute coordinates to the ImageBuffer coordinates.
3641         
3642         Tests: svg/filters/big-sized-off-viewport-filter.svg
3643
3644         * platform/graphics/ImageBuffer.cpp:
3645         (WebCore::ImageBuffer::isSizeClamped):
3646         (WebCore::ImageBuffer::clampedSize):
3647         (WebCore::ImageBuffer::clampedRect):
3648         * platform/graphics/ImageBuffer.h:
3649         (WebCore::ImageBuffer::setSpaceSize): Move all the clamping helper methods
3650         from SVGRenderingContext and RenderSVGResourceFilter to the ImageBuffer.
3651
3652         * platform/graphics/filters/FEColorMatrix.cpp:
3653         (WebCore::FEColorMatrix::platformApplySoftware): Use logicalSize() of the
3654         result image instead of using absolutePaintRect(). The later returns the
3655         rectangle of the element without clamping.
3656         
3657         * platform/graphics/filters/FETile.cpp:
3658         (WebCore::FETile::platformApplySoftware):
3659         * rendering/svg/RenderSVGResourceClipper.cpp:
3660         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
3661         * rendering/svg/RenderSVGResourceFilter.cpp:
3662         (WebCore::RenderSVGResourceFilter::applyResource):
3663         (WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize): Deleted.
3664         * rendering/svg/RenderSVGResourceFilter.h:
3665         * rendering/svg/RenderSVGResourceGradient.cpp:
3666         (WebCore::createMaskAndSwapContextForTextGradient):
3667         (WebCore::clipToTextMask):
3668         * rendering/svg/RenderSVGResourceMasker.cpp:
3669         (WebCore::RenderSVGResourceMasker::applySVGMask):
3670         * rendering/svg/RenderSVGResourcePattern.cpp:
3671         (WebCore::RenderSVGResourcePattern::buildPattern):
3672         (WebCore::RenderSVGResourcePattern::createTileImage): Make the modifications
3673         which are needed because of moving the clamping helper methods to ImageBuffer
3674         and because of changing the prototype of SVGRenderingContext methods.
3675
3676         * platform/graphics/filters/FilterEffect.cpp:
3677         (WebCore::FilterEffect::drawingRegionOfInputImage): Consider the clamping
3678         when mapping from absolute coordinates to the ImageBuffer coordinates.
3679
3680         (WebCore::FilterEffect::createImageBufferResult): Apply the same clamping
3681         we do in SVGRenderingContext::createImageBuffer() when creating the 
3682         FilterEffect result ImageBuffer.
3683         
3684         (WebCore::FilterEffect::apply):
3685         (WebCore::FilterEffect::asUnmultipliedImage):
3686         (WebCore::FilterEffect::asPremultipliedImage):
3687         (WebCore::FilterEffect::copyUnmultipliedImage):
3688         (WebCore::FilterEffect::copyPremultipliedImage):
3689         (WebCore::FilterEffect::createUnmultipliedImageResult):
3690         (WebCore::FilterEffect::createPremultipliedImageResult):
3691         (WebCore::FilterEffect::maxFilterArea): Deleted.
3692         (WebCore::FilterEffect::isFilterSizeValid): Deleted.
3693         * platform/graphics/filters/FilterEffect.h: Use the new ImageBuffer clamping
3694         helper methods and delete the local ones.
3695
3696         * platform/graphics/transforms/AffineTransform.cpp:
3697         (WebCore::AffineTransform::scaleNonUniform):
3698         (WebCore::AffineTransform::scale):
3699         (WebCore::AffineTransform::translate):
3700         * platform/graphics/transforms/AffineTransform.h: Add new scale and translate
3701         overloads to AffineTransform.
3702         
3703         * rendering/FilterEffectRenderer.cpp:
3704         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
3705         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Code clean up.
3706         
3707         * rendering/svg/SVGRenderingContext.cpp:
3708         (WebCore::SVGRenderingContext::calculateScreenFontSizeScalingFactor):
3709         (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
3710         Return the AffineTransform instead of passing it through the reference of
3711         an argument.
3712         
3713         (WebCore::SVGRenderingContext::createImageBuffer):
3714         (WebCore::SVGRenderingContext::createImageBufferForPattern): Deleted.
3715         Code clean up and method rename.
3716         
3717         (WebCore::SVGRenderingContext::clampedAbsoluteTargetRect): Deleted.
3718         (WebCore::SVGRenderingContext::clampedAbsoluteSize): Deleted.
3719         * rendering/svg/SVGRenderingContext.h: Move the clamping helper methods to
3720         the ImageBuffer class.
3721     
3722 2015-05-07  Beth Dakin  <bdakin@apple.com>
3723
3724         New force-related DOM events should fire in WK1 views
3725         https://bugs.webkit.org/show_bug.cgi?id=144663
3726         -and corresponding-
3727         rdar://problem/20281886
3728
3729         Reviewed by Sam Weinig.
3730
3731         All of the WK1 mouse events need to take the correspondingPressureEvent.
3732         * page/EventHandler.h:
3733
3734         Make correspondingPressureEvent a part of CurrentEventScope. This is needed to 
3735         have accurate pressure information for all of the mouse events in subframes.
3736         * page/mac/EventHandlerMac.mm:
3737         (WebCore::correspondingPressureEventSlot):
3738         (WebCore::EventHandler::correspondingPressureEvent):
3739         (WebCore::CurrentEventScope::CurrentEventScope):
3740         (WebCore::CurrentEventScope::~CurrentEventScope):
3741
3742         These events don’t have an associated pressure, so send nil for the 
3743         correspondingPressureEvent.
3744         (WebCore::EventHandler::wheelEvent):
3745         (WebCore::EventHandler::keyEvent):
3746
3747         Pipe through correspondingPressureEvent.
3748         (WebCore::EventHandler::mouseDown):
3749         (WebCore::EventHandler::mouseDragged):
3750         (WebCore::EventHandler::mouseUp):
3751         (WebCore::EventHandler::mouseMoved):
3752
3753         New function to handle pressure change events.
3754         (WebCore::EventHandler::pressureChange):
3755
3756         Pipe through correspondingPressureEvent.
3757         (WebCore::EventHandler::passMouseMovedEventToScrollbars):
3758         (WebCore::EventHandler::currentPlatformMouseEvent):
3759
3760         Take the correspondingPressureEvent in order to build a PlatformMouseEvent with 
3761         the correct pressure information.
3762         * platform/mac/PlatformEventFactoryMac.h:
3763         * platform/mac/PlatformEventFactoryMac.mm:
3764         (WebCore::globalPointForEvent):
3765         (WebCore::pointForEvent):
3766         (WebCore::mouseButtonForEvent):
3767         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
3768         (WebCore::PlatformEventFactory::createPlatformMouseEvent):
3769
3770 2015-05-06  Roger Fong  <roger_fong@apple.com>
3771
3772         Media Controls: Scrubber should be independent of actual video time, causes scrubber to be jumpy.
3773         https://bugs.webkit.org/show_bug.cgi?id=144700.
3774         <rdar://problem/19997548>
3775
3776         Reviewed by Jer Noble.
3777
3778         Update time and timeline during the timeline input event instead of the wrapper's mousemove.
3779         (Controller.prototype.handleWrapperMouseMove):
3780         (Controller.prototype.handleTimelineMouseMove):
3781         (Controller.prototype.drawTimelineBackground): 
3782
3783         (Controller.prototype.updateControlsWhileScrubbing): 
3784         Updates time and scrubber to reflect timeline user input.
3785
3786 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
3787
3788         Handle meta viewport in HTMLPreloadScanner
3789         https://bugs.webkit.org/show_bug.cgi?id=144640
3790
3791         Reviewed by Dean Jackson.
3792
3793         Add support for the <meta> tag to the HTMLPreloadScanner
3794         and when the meta tag's name is viewport, get the document
3795         to process the tag's attribute value, and set its ViewportArgument.
3796
3797         Tests: fast/dom/HTMLMetaElement/meta-preloader.html
3798
3799         * html/parser/HTMLPreloadScanner.cpp:
3800         (WebCore::TokenPreloadScanner::tagIdFor): Added meta.
3801         (WebCore::TokenPreloadScanner::initiatorFor): Added meta.
3802         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Call document.processViewport is meta viewport encountered.
3803         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3804         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Keep track of meta viewport tags.
3805         (WebCore::testPreloadScannerViewportSupport): Testing function that makes sure this functionality is working.
3806         * html/parser/HTMLPreloadScanner.h:
3807         * testing/Internals.cpp:
3808         (WebCore::Internals::testPreloaderSettingViewport): Calls the testing function.
3809         * testing/Internals.h:
3810         * testing/Internals.idl:
3811
3812 2015-05-07  Zalan Bujtas  <zalan@apple.com>
3813
3814         REGRESSION (r164449): Subpixel rendering: http://www.apple.com/iphone-6/ "Faster wireless." image displays vertical black line on 1x displays at specific window width.
3815         https://bugs.webkit.org/show_bug.cgi?id=144723
3816         rdar://problem/18307094
3817
3818         Reviewed by Simon Fraser.
3819
3820         This patch ensures that the backing store's graphics layer is always positioned on a device pixel boundary.
3821
3822         While calculating the backing store's graphics layer location, its ancestor layer's compositing bounds is taken into account.
3823         However the compositing bounds is an unsnapped value, so in order to place the graphics layer properly,
3824         we need to pixel align the ancestor compositing bounds before using it to adjust the child's graphics layer position.
3825
3826         Test: compositing/ancestor-compositing-layer-is-on-subpixel-position.html
3827
3828         * rendering/RenderLayerBacking.cpp:
3829         (WebCore::RenderLayerBacking::updateGeometry):
3830
3831 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
3832
3833         Fix sizes crash and add invalid value tests.
3834         https://bugs.webkit.org/show_bug.cgi?id=144739
3835
3836         Reviewed by Darin Adler.
3837
3838         Make sure that only CSS length are allowed when the sizes parser is calling computeLength.
3839         Also make sure that for invalid lengths, the 100vw default is used instead.
3840
3841         Test: fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html
3842
3843         * css/SourceSizeList.cpp:
3844         (WebCore::computeLength):
3845         (WebCore::defaultLength):
3846         (WebCore::parseSizesAttribute):
3847
3848 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
3849
3850         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
3851         https://bugs.webkit.org/show_bug.cgi?id=144746
3852
3853         Reviewed by Martin Robinson.
3854
3855         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
3856
3857         * platform/gtk/GtkUtilities.cpp:
3858         * platform/gtk/GtkUtilities.h:
3859         * platform/text/gtk/HyphenationLibHyphen.cpp:
3860         (WebCore::availableLocales):
3861
3862 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
3863
3864         Remove the WK1-only code path for independently composited iframes
3865         https://bugs.webkit.org/show_bug.cgi?id=144722
3866
3867         Reviewed by Dean Jackson.
3868
3869         In WebKit1 on Mac, we allowed iframes to be composited independently of their
3870         parent document, relying on the fact that the frame's platform view can host
3871         a layer-backed view. However, this ran into bugs (rdar://problem/18862298),
3872         and triggers the assertion at the end of FrameView::updateLayoutAndStyleIfNeededRecursive(),
3873         because the compositing update after a layout can dirty style in notifyIFramesOfCompositingChange().
3874         
3875         Removing the WK1-only code path solves these problems. It also eliminates the need
3876         to do compositing-specific frame overlap testing.
3877
3878         * page/FrameView.cpp:
3879         (WebCore::FrameView::setIsOverlapped): No need to do compositing-related things here.
3880         Any iframe that gets composited will participate in the normal compositing overlap
3881         testing in its parent frame.
3882         (WebCore::FrameView::hasCompositedContentIncludingDescendants): Deleted.
3883         (WebCore::FrameView::hasCompositingAncestor): Deleted.
3884         * page/FrameView.h:
3885         * rendering/RenderLayerCompositor.cpp: Replace ownerElement() checks in this file
3886         with an isMainFrameCompositor() for readability. Some 0->nullptr.
3887         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
3888         (WebCore::RenderLayerCompositor::chromeClient):
3889         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
3890         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3891         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
3892         (WebCore::RenderLayerCompositor::updateBacking):
3893         (WebCore::RenderLayerCompositor::layerTreeAsText):
3894         (WebCore::RenderLayerCompositor::frameContentsCompositor):
3895         (WebCore::RenderLayerCompositor::setIsInWindow):
3896         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):
3897         (WebCore::RenderLayerCompositor::requiresCompositingForFrame): frameRenderer.requiresAcceleratedCompositing()
3898         already bails on no content RenderView, so the shouldPropagateCompositingToEnclosingFrame() check does
3899         nothing and is removed.
3900         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer):
3901         (WebCore::RenderLayerCompositor::requiresScrollLayer):
3902         (WebCore::RenderLayerCompositor::documentUsesTiledBacking):
3903         (WebCore::RenderLayerCompositor::isMainFrameCompositor):
3904         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls):
3905         (WebCore::RenderLayerCompositor::requiresOverhangAreasLayer):
3906         (WebCore::RenderLayerCompositor::requiresContentShadowLayer):
3907         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
3908         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
3909         (WebCore::RenderLayerCompositor::updateLayerForHeader):
3910         (WebCore::RenderLayerCompositor::updateLayerForFooter):
3911         (WebCore::RenderLayerCompositor::ensureRootLayer): Main frame attaches via ChromeClient,
3912         all other frames attach via parent frame.
3913         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This call to
3914         scheduleSetNeedsStyleRecalc(SyntheticStyleChange) was the source of dirtying style after
3915         layout, but is no longer needed so remove it.
3916         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
3917         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers):
3918         (WebCore::RenderLayerCompositor::scrollingCoordinator):
3919         (WebCore::RenderLayerCompositor::graphicsLayerFactory):
3920         (WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): Deleted.
3921         (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame): Deleted.
3922         (WebCore::RenderLayerCompositor::mainFrameBackingIsTiled): Deleted. This was mis-named;
3923         it really asks whether the document uses tiled backing, but does not check for main frame.
3924         * rendering/RenderLayerCompositor.h:
3925         * rendering/RenderWidget.cpp:
3926         (WebCore::RenderWidget::paintContents): No need to do frame overlap testing for
3927         compositing now.
3928
3929 2015-05-06  Dean Jackson  <dino@apple.com>
3930
3931         Handle backdrop views that have to tile
3932         https://bugs.webkit.org/show_bug.cgi?id=142317
3933         <rdar://problem/20049088>
3934
3935         Reviewed by Simon Fraser.
3936
3937         Take 2 - this was rolled out because Mavericks was crashing.
3938
3939         Make sure backdrop layers don't tile. If they are big
3940         enough, we'll leave it to the platform compositor to handle.
3941
3942         This also fixes a bug where if a layer changed from a backdrop
3943         type to a tiled type, it would still retain its custom appearance
3944         and we'd try to add children to the wrong layer.
3945
3946         Test: compositing/media-controls-bar-appearance-big.html
3947
3948         * platform/graphics/ca/GraphicsLayerCA.cpp:
3949         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
3950         a layer needs a backdrop before checking if it needs to tile.
3951
3952 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
3953
3954         Revert "Introducing the Platform Abstraction Layer (PAL)"
3955         https://bugs.webkit.org/show_bug.cgi?id=144751
3956
3957         Unreviewed.
3958
3959         PAL should be a new target inside WebCore, rather than a top-level folder.
3960
3961         * WebCore.xcodeproj/project.pbxproj:
3962         * Configurations/FeatureDefines.xcconfig:
3963
3964 2015-05-07  Dan Bernstein  <mitz@apple.com>
3965
3966         Tried to fix the build.
3967
3968         * Configurations/WebCoreTestSupport.xcconfig:
3969
3970 2015-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
3971
3972         AX: [ATK] The pre element should be mapped to ATK_ROLE_SECTION; not ATK_ROLE_PANEL
3973         https://bugs.webkit.org/show_bug.cgi?id=144702
3974
3975         Reviewed by Chris Fleizach.
3976
3977         Add a new PreRole AccessibilityRole so that per-platform mapping is possible.
3978         Map PreRole to ATK_ROLE_SECTION for Efl and Gtk; to NSAccessibilityGroupRole
3979         for the Mac. Add PreRole to the list of "text type" ATK roles.
3980
3981         No new tests. Existing tests were updated to reflect the corrected mapping.
3982
3983         * accessibility/AccessibilityObject.h:
3984         * accessibility/AccessibilityRenderObject.cpp:
3985         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3986         * accessibility/atk/AccessibilityObjectAtk.cpp:
3987         (WebCore::AccessibilityObject::allowsTextRanges):
3988         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3989         (atkRole):
3990         (roleIsTextType):
3991         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3992         (createAccessibilityRoleMap):
3993
3994 2015-05-07  Dan Bernstein  <mitz@apple.com>
3995
3996         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
3997         https://bugs.webkit.org/show_bug.cgi?id=144727
3998
3999         Reviewed by Darin Adler.
4000
4001         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig.
4002         * Configurations/WebCore.xcconfig: For iOS, define INSTALL_PATH in terms of
4003         INSTALL_PATH_PREFIX, and set INSTALL_PATH_PREFIX for the iOS 8.x Simulator.
4004         * Configurations/WebCoreTestSupport.xcconfig: Define INSTALL_PATH in terms of
4005         INSTALL_PATH_PREFIX and INSTALL_PATH_ACTUAL, and define INSTALL_PATH_PREFIX for the iOS 8.x
4006         Simulator.
4007
4008 2015-05-07  Eric Carlson  <eric.carlson@apple.com>
4009
4010         [Mac] Playback target isn't set on new element
4011         https://bugs.webkit.org/show_bug.cgi?id=144724
4012
4013         Reviewed by Jer Noble.
4014
4015         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
4016         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
4017         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setShouldPlayToPlaybackTarget
4018         if n