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