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