347d0290e4c7e03621a6f38af1065923d6a6177a
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
2
3         Calculate source-size length as a float
4         https://bugs.webkit.org/show_bug.cgi?id=144766
5
6         Reviewed by Dean Jackson.
7
8         Make sure that the source-size length is calculated as a float,
9         to align with the spec.
10
11         Test: fast/dom/HTMLImageElement/sizes/image-sizes-1x.html
12               fast/dom/HTMLImageElement/sizes/image-sizes-2x.html
13
14         * css/SourceSizeList.cpp:
15         (WebCore::parseSizesAttribute):
16         (WebCore::defaultLength):
17         (WebCore::computeLength):
18         * css/SourceSizeList.h:
19         * html/HTMLImageElement.cpp:
20         (WebCore::HTMLImageElement::parseAttribute):
21         * html/parser/HTMLPreloadScanner.cpp:
22         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
23         * html/parser/HTMLSrcsetParser.cpp:
24         (WebCore::pickBestImageCandidate):
25         (WebCore::bestFitSourceForImageAttributes):
26         * html/parser/HTMLSrcsetParser.h:
27
28 2015-05-07  Commit Queue  <commit-queue@webkit.org>
29
30         Unreviewed, rolling out r183895.
31         https://bugs.webkit.org/show_bug.cgi?id=144786
32
33         Many tests became flaky (Requested by ap on #webkit).
34
35         Reverted changeset:
36
37         "Expose more font weights for -apple-system"
38         https://bugs.webkit.org/show_bug.cgi?id=144707
39         http://trac.webkit.org/changeset/183895
40
41 2015-05-07  Hyungwook Lee  <hyungwook.lee@navercorp.com>
42
43         Add first-letter assert exception in RenderButton::setupInnerStyle().
44         https://bugs.webkit.org/show_bug.cgi?id=140517OB
45
46         Reviewed by Darin Adler.
47
48         StyleResolver references inner block's render style temporary in
49         RenderBlock::styleDidChange() when we have first-letter css pseudo
50         element.
51
52         * rendering/RenderButton.cpp:
53         (WebCore::RenderButton::setupInnerStyle):
54
55 2015-05-07  Chris Dumez  <cdumez@apple.com>
56
57         Unreviewed, fix build after r183970.
58
59         WEBCORE_EXPORT should not be used on inlined functions.
60
61         * platform/graphics/ca/GraphicsLayerCA.h:
62
63 2015-05-07  Anders Carlsson  <andersca@apple.com>
64
65         Build fixes.
66
67         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
68         (-[WebAccessibilityObjectWrapper doAXRTFForRange:]):
69         * editing/cocoa/HTMLConverter.mm:
70         (HTMLConverter::_addMarkersToList):
71         * platform/mac/PasteboardMac.mm:
72         (WebCore::writeFileWrapperAsRTFDAttachment):
73         * platform/mac/PlatformPasteboardMac.mm:
74         (WebCore::PlatformPasteboard::setTypes):
75         Pass empty arrays and dictionaries instead of nil.
76
77         * rendering/RenderThemeMac.mm:
78         (WebCore::RenderThemeMac::paintSliderThumb):
79         Pass the document view to the AppKit paint method.
80
81 2015-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
82
83         Purge PassRefPtr in WebCore/html - 3
84         https://bugs.webkit.org/show_bug.cgi?id=144686
85
86         Reviewed by Andreas Kling.
87
88         Replace PassRefPtr with Ref in create() factory functions, because
89         it doesn't have to change to be null.
90
91         No new tests, no behavior changes.
92
93         * html/FTPDirectoryDocument.h:
94         * html/HTMLDetailsElement.cpp:
95         (WebCore::DetailsContentElement::create):
96         * html/HTMLKeygenElement.cpp:
97         * html/HTMLSummaryElement.cpp:
98         (WebCore::SummaryContentElement::create):
99         * html/TimeRanges.cpp:
100         (WebCore::TimeRanges::create):
101         * html/shadow/SliderThumbElement.cpp:
102         (WebCore::SliderContainerElement::create):
103         * html/shadow/SliderThumbElement.h:
104         (WebCore::SliderThumbElement::create):
105         * html/shadow/SpinButtonElement.cpp:
106         (WebCore::SpinButtonElement::create):
107         * html/shadow/SpinButtonElement.h:
108         * html/shadow/TextControlInnerElements.cpp:
109         (WebCore::TextControlInnerContainer::create):
110         (WebCore::TextControlInnerElement::create):
111         (WebCore::TextControlInnerTextElement::create):
112         (WebCore::SearchFieldResultsButtonElement::create):
113         (WebCore::SearchFieldCancelButtonElement::create):
114         * html/shadow/TextControlInnerElements.h:
115         * html/shadow/YouTubeEmbedShadowElement.cpp:
116         (WebCore::YouTubeEmbedShadowElement::create):
117         * html/track/InbandDataTextTrack.cpp:
118         (WebCore::InbandDataTextTrack::create):
119         * html/track/InbandDataTextTrack.h:
120         * html/track/InbandGenericTextTrack.cpp:
121         (WebCore::InbandGenericTextTrack::create):
122         * html/track/InbandGenericTextTrack.h:
123         * html/track/InbandWebVTTTextTrack.cpp:
124         (WebCore::InbandWebVTTTextTrack::create):
125         * html/track/InbandWebVTTTextTrack.h:
126         * html/track/LoadableTextTrack.h:
127         * html/track/TextTrack.h:
128         (WebCore::TextTrack::create):
129         * html/track/TextTrackCueGeneric.cpp:
130         * html/track/TextTrackCueGeneric.h:
131         * html/track/TextTrackList.h:
132         * html/track/VTTRegionList.h:
133         (WebCore::VTTRegionList::create):
134
135 2015-05-07  Dean Jackson  <dino@apple.com>
136
137         [iOS] MediaControls: disappear while scrubbing
138         https://bugs.webkit.org/show_bug.cgi?id=144777
139         <rdar://problem/20065572>
140
141         Reviewed by Eric Carlson.
142
143         If we are scrubbing we shouldn't hide the controls.
144
145         * Modules/mediacontrols/mediaControlsApple.js:
146         (Controller.prototype.hideControls): Return early if we are scrubbing.
147         * Modules/mediacontrols/mediaControlsiOS.js:
148         (ControllerIOS.prototype): Add initial value for _potentiallyScrubbing and
149         rename from non-underscored value throughout the file.
150         (ControllerIOS.prototype.handleTimelineTouchEnd): When we finish scrubbing, reset
151         the timer to hide the controls.
152
153 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
154
155         REGRESSION (r183300): Fixed elements flash when scrolling
156         https://bugs.webkit.org/show_bug.cgi?id=144778
157         rdar://problem/20769741
158
159         Reviewed by Dean Jackson.
160
161         After r183300 we can detached layer backing store when outside the coverage region.
162         However, position:fixed layers are moved around by the ScrollingCoordinator behind
163         GraphicsLayer's back, so we can do layer flushes with stale information about layer
164         geometry.
165         
166         To avoid dropping backing store for layers in this situation, prevent backing
167         store detachment on layers registered with the ScrollingCoordinator as viewport-constrained
168         layers. Preventing detachment on a layer also prevents detachment on all descendant
169         layers.
170
171         * platform/graphics/GraphicsLayer.h:
172         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment):
173         (WebCore::GraphicsLayer::allowsBackingStoreDetachment):
174         * platform/graphics/ca/GraphicsLayerCA.cpp:
175         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
176         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Set m_intersectsCoverageRect to true
177         if backing store detachment is prevented.
178         (WebCore::GraphicsLayerCA::recursiveCommitChanges): Set a bit in the CommitState to 
179         communicate to descendants that detachment is prevented.
180         * platform/graphics/ca/GraphicsLayerCA.h:
181         (WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
182         * rendering/RenderLayerBacking.cpp:
183         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
184         * rendering/RenderLayerBacking.h:
185         (WebCore::RenderLayerBacking::setScrollingNodeIDForRole): If registering with a non-zero
186         nodeID for the ViewportConstrained role, turn off backing store detachment.
187
188 2015-05-07  Sam Weinig  <sam@webkit.org>
189
190         Consider implementing Document.scrollingElement
191         <rdar://problem/20845213>
192         https://bugs.webkit.org/show_bug.cgi?id=143609
193
194         Reviewed by Simon Fraser.
195
196         Add the non-compliant implementation of Document.scrollingElement that the spec,
197         found at http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement, 
198         says we should have while we have non-compliant implementations of Element.scrollTop
199         and Element.scrollLeft (fixing that is tracked by https://bugs.webkit.org/show_bug.cgi?id=106133).
200
201         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
202                fast/dom/Document/scrollingElement-standards-mode.html
203
204         * dom/Document.cpp:
205         (WebCore::Document::scrollingElement):
206         * dom/Document.h:
207         * dom/Document.idl:
208
209 2015-05-07  Dean Jackson  <dino@apple.com>
210
211         [iOS] While scrubbing and holding down, video continues to play
212         https://bugs.webkit.org/show_bug.cgi?id=144776
213         <rdar://problem/20863757>
214
215         Reviewed by Simon Fraser.
216
217         When we are scrubbing a video, we should pause playback. As we
218         let go of the scrubber playback can resume (but only if it was
219         playing originally).
220
221         * Modules/mediacontrols/mediaControlsiOS.js:
222         (ControllerIOS.prototype.createControls): Listen for touchstart on the scrubber.
223         (ControllerIOS.prototype.handleTimelineInput): Call the prototype, but pause if necessary.
224         (ControllerIOS.prototype.handleTimelineChange): Just moved this to be with the other timeline functions.
225         (ControllerIOS.prototype.handleTimelineTouchStart): Add the listeners for end and cancel. Remember that we are
226         potentially about to scrub.
227         (ControllerIOS.prototype.handleTimelineTouchEnd): Remove the listeners.
228
229 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
230
231         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
232         https://bugs.webkit.org/show_bug.cgi?id=144335
233
234         Reviewed by Daniel Bates.
235
236         Address comments raised by Darin Adler in review.
237
238         * platform/graphics/ImageBuffer.cpp:
239         (WebCore::ImageBuffer::sizeNeedsClamping):
240         (WebCore::ImageBuffer::clampedSize):
241         (WebCore::ImageBuffer::isSizeClamped): Deleted.
242         * platform/graphics/ImageBuffer.h:
243         The condition for the negative width/height in isSizeClamped() was wrong. Use
244         FloatSize::isEmpty() instead and rename the function to sizeNeedsClamping().
245         The new function should return the opposite of the old function return value.
246         
247         * platform/graphics/filters/FilterEffect.cpp:
248         (WebCore::FilterEffect::apply):
249         (WebCore::FilterEffect::asUnmultipliedImage):
250         (WebCore::FilterEffect::asPremultipliedImage):
251         (WebCore::FilterEffect::copyUnmultipliedImage):
252         (WebCore::FilterEffect::copyPremultipliedImage):
253         (WebCore::FilterEffect::createUnmultipliedImageResult):
254         (WebCore::FilterEffect::createPremultipliedImageResult):
255         * rendering/FilterEffectRenderer.cpp:
256         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
257         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
258         * rendering/svg/RenderSVGResourceFilter.cpp:
259         (WebCore::RenderSVGResourceFilter::applyResource):
260         Call the new function and negate the condition for the return value.
261
262 2015-05-07  Anders Carlsson  <andersca@apple.com>
263
264         Build fix.
265
266         * editing/mac/EditorMac.mm:
267         (WebCore::dataInRTFDFormat):
268         (WebCore::dataInRTFFormat):
269
270 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
271
272         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
273         https://bugs.webkit.org/show_bug.cgi?id=144335
274
275         Reviewed by Darin Adler.
276
277         When the SVG element is larger than 4096x4096 pixels and it has a filter,
278         a clipper or a masker, the ImageBuffer which is created for drawing the
279         sourceGraphicBuffer has to be clamped to this size. The reason for this
280         clamping is the FilterEffect simply ignores processing any ImageBuffer
281         larger than this size.
282         
283         The bug was happening because we did not propagate the clamping logic to
284         the FilterEffect. The FilterEffect result ImageBuffer was not clamped as
285         what we do for drawing the sourceGraphicBuffer. If only the destination
286         point is specified, the GraphicsContext::drawImageBuffer() assumes the
287         source and the destination images have the same size which is not true
288         with the clamping.
289         
290         The fix is to add the clamping logic to the FilterEffect. Two places we
291         need to change. (1) FilterEffect::createImageBufferResult() has to apply
292         the same clamping we do in SVGRenderingContext::createImageBuffer(). (2)
293         FilterEffect::drawingRegionOfInputImage() has to consider the clamping 
294         when mapping from absolute coordinates to the ImageBuffer coordinates.
295         
296         Tests: svg/filters/big-sized-off-viewport-filter.svg
297
298         * platform/graphics/ImageBuffer.cpp:
299         (WebCore::ImageBuffer::isSizeClamped):
300         (WebCore::ImageBuffer::clampedSize):
301         (WebCore::ImageBuffer::clampedRect):
302         * platform/graphics/ImageBuffer.h:
303         (WebCore::ImageBuffer::setSpaceSize): Move all the clamping helper methods
304         from SVGRenderingContext and RenderSVGResourceFilter to the ImageBuffer.
305
306         * platform/graphics/filters/FEColorMatrix.cpp:
307         (WebCore::FEColorMatrix::platformApplySoftware): Use logicalSize() of the
308         result image instead of using absolutePaintRect(). The later returns the
309         rectangle of the element without clamping.
310         
311         * platform/graphics/filters/FETile.cpp:
312         (WebCore::FETile::platformApplySoftware):
313         * rendering/svg/RenderSVGResourceClipper.cpp:
314         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
315         * rendering/svg/RenderSVGResourceFilter.cpp:
316         (WebCore::RenderSVGResourceFilter::applyResource):
317         (WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize): Deleted.
318         * rendering/svg/RenderSVGResourceFilter.h:
319         * rendering/svg/RenderSVGResourceGradient.cpp:
320         (WebCore::createMaskAndSwapContextForTextGradient):
321         (WebCore::clipToTextMask):
322         * rendering/svg/RenderSVGResourceMasker.cpp:
323         (WebCore::RenderSVGResourceMasker::applySVGMask):
324         * rendering/svg/RenderSVGResourcePattern.cpp:
325         (WebCore::RenderSVGResourcePattern::buildPattern):
326         (WebCore::RenderSVGResourcePattern::createTileImage): Make the modifications
327         which are needed because of moving the clamping helper methods to ImageBuffer
328         and because of changing the prototype of SVGRenderingContext methods.
329
330         * platform/graphics/filters/FilterEffect.cpp:
331         (WebCore::FilterEffect::drawingRegionOfInputImage): Consider the clamping
332         when mapping from absolute coordinates to the ImageBuffer coordinates.
333
334         (WebCore::FilterEffect::createImageBufferResult): Apply the same clamping
335         we do in SVGRenderingContext::createImageBuffer() when creating the 
336         FilterEffect result ImageBuffer.
337         
338         (WebCore::FilterEffect::apply):
339         (WebCore::FilterEffect::asUnmultipliedImage):
340         (WebCore::FilterEffect::asPremultipliedImage):
341         (WebCore::FilterEffect::copyUnmultipliedImage):
342         (WebCore::FilterEffect::copyPremultipliedImage):
343         (WebCore::FilterEffect::createUnmultipliedImageResult):
344         (WebCore::FilterEffect::createPremultipliedImageResult):
345         (WebCore::FilterEffect::maxFilterArea): Deleted.
346         (WebCore::FilterEffect::isFilterSizeValid): Deleted.
347         * platform/graphics/filters/FilterEffect.h: Use the new ImageBuffer clamping
348         helper methods and delete the local ones.
349
350         * platform/graphics/transforms/AffineTransform.cpp:
351         (WebCore::AffineTransform::scaleNonUniform):
352         (WebCore::AffineTransform::scale):
353         (WebCore::AffineTransform::translate):
354         * platform/graphics/transforms/AffineTransform.h: Add new scale and translate
355         overloads to AffineTransform.
356         
357         * rendering/FilterEffectRenderer.cpp:
358         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
359         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Code clean up.
360         
361         * rendering/svg/SVGRenderingContext.cpp:
362         (WebCore::SVGRenderingContext::calculateScreenFontSizeScalingFactor):
363         (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
364         Return the AffineTransform instead of passing it through the reference of
365         an argument.
366         
367         (WebCore::SVGRenderingContext::createImageBuffer):
368         (WebCore::SVGRenderingContext::createImageBufferForPattern): Deleted.
369         Code clean up and method rename.
370         
371         (WebCore::SVGRenderingContext::clampedAbsoluteTargetRect): Deleted.
372         (WebCore::SVGRenderingContext::clampedAbsoluteSize): Deleted.
373         * rendering/svg/SVGRenderingContext.h: Move the clamping helper methods to
374         the ImageBuffer class.
375     
376 2015-05-07  Beth Dakin  <bdakin@apple.com>
377
378         New force-related DOM events should fire in WK1 views
379         https://bugs.webkit.org/show_bug.cgi?id=144663
380         -and corresponding-
381         rdar://problem/20281886
382
383         Reviewed by Sam Weinig.
384
385         All of the WK1 mouse events need to take the correspondingPressureEvent.
386         * page/EventHandler.h:
387
388         Make correspondingPressureEvent a part of CurrentEventScope. This is needed to 
389         have accurate pressure information for all of the mouse events in subframes.
390         * page/mac/EventHandlerMac.mm:
391         (WebCore::correspondingPressureEventSlot):
392         (WebCore::EventHandler::correspondingPressureEvent):
393         (WebCore::CurrentEventScope::CurrentEventScope):
394         (WebCore::CurrentEventScope::~CurrentEventScope):
395
396         These events don’t have an associated pressure, so send nil for the 
397         correspondingPressureEvent.
398         (WebCore::EventHandler::wheelEvent):
399         (WebCore::EventHandler::keyEvent):
400
401         Pipe through correspondingPressureEvent.
402         (WebCore::EventHandler::mouseDown):
403         (WebCore::EventHandler::mouseDragged):
404         (WebCore::EventHandler::mouseUp):
405         (WebCore::EventHandler::mouseMoved):
406
407         New function to handle pressure change events.
408         (WebCore::EventHandler::pressureChange):
409
410         Pipe through correspondingPressureEvent.
411         (WebCore::EventHandler::passMouseMovedEventToScrollbars):
412         (WebCore::EventHandler::currentPlatformMouseEvent):
413
414         Take the correspondingPressureEvent in order to build a PlatformMouseEvent with 
415         the correct pressure information.
416         * platform/mac/PlatformEventFactoryMac.h:
417         * platform/mac/PlatformEventFactoryMac.mm:
418         (WebCore::globalPointForEvent):
419         (WebCore::pointForEvent):
420         (WebCore::mouseButtonForEvent):
421         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
422         (WebCore::PlatformEventFactory::createPlatformMouseEvent):
423
424 2015-05-06  Roger Fong  <roger_fong@apple.com>
425
426         Media Controls: Scrubber should be independent of actual video time, causes scrubber to be jumpy.
427         https://bugs.webkit.org/show_bug.cgi?id=144700.
428         <rdar://problem/19997548>
429
430         Reviewed by Jer Noble.
431
432         Update time and timeline during the timeline input event instead of the wrapper's mousemove.
433         (Controller.prototype.handleWrapperMouseMove):
434         (Controller.prototype.handleTimelineMouseMove):
435         (Controller.prototype.drawTimelineBackground): 
436
437         (Controller.prototype.updateControlsWhileScrubbing): 
438         Updates time and scrubber to reflect timeline user input.
439
440 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
441
442         Handle meta viewport in HTMLPreloadScanner
443         https://bugs.webkit.org/show_bug.cgi?id=144640
444
445         Reviewed by Dean Jackson.
446
447         Add support for the <meta> tag to the HTMLPreloadScanner
448         and when the meta tag's name is viewport, get the document
449         to process the tag's attribute value, and set its ViewportArgument.
450
451         Tests: fast/dom/HTMLMetaElement/meta-preloader.html
452
453         * html/parser/HTMLPreloadScanner.cpp:
454         (WebCore::TokenPreloadScanner::tagIdFor): Added meta.
455         (WebCore::TokenPreloadScanner::initiatorFor): Added meta.
456         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Call document.processViewport is meta viewport encountered.
457         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
458         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Keep track of meta viewport tags.
459         (WebCore::testPreloadScannerViewportSupport): Testing function that makes sure this functionality is working.
460         * html/parser/HTMLPreloadScanner.h:
461         * testing/Internals.cpp:
462         (WebCore::Internals::testPreloaderSettingViewport): Calls the testing function.
463         * testing/Internals.h:
464         * testing/Internals.idl:
465
466 2015-05-07  Zalan Bujtas  <zalan@apple.com>
467
468         REGRESSION (r164449): Subpixel rendering: http://www.apple.com/iphone-6/ "Faster wireless." image displays vertical black line on 1x displays at specific window width.
469         https://bugs.webkit.org/show_bug.cgi?id=144723
470         rdar://problem/18307094
471
472         Reviewed by Simon Fraser.
473
474         This patch ensures that the backing store's graphics layer is always positioned on a device pixel boundary.
475
476         While calculating the backing store's graphics layer location, its ancestor layer's compositing bounds is taken into account.
477         However the compositing bounds is an unsnapped value, so in order to place the graphics layer properly,
478         we need to pixel align the ancestor compositing bounds before using it to adjust the child's graphics layer position.
479
480         Test: compositing/ancestor-compositing-layer-is-on-subpixel-position.html
481
482         * rendering/RenderLayerBacking.cpp:
483         (WebCore::RenderLayerBacking::updateGeometry):
484
485 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
486
487         Fix sizes crash and add invalid value tests.
488         https://bugs.webkit.org/show_bug.cgi?id=144739
489
490         Reviewed by Darin Adler.
491
492         Make sure that only CSS length are allowed when the sizes parser is calling computeLength.
493         Also make sure that for invalid lengths, the 100vw default is used instead.
494
495         Test: fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html
496
497         * css/SourceSizeList.cpp:
498         (WebCore::computeLength):
499         (WebCore::defaultLength):
500         (WebCore::parseSizesAttribute):
501
502 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
503
504         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
505         https://bugs.webkit.org/show_bug.cgi?id=144746
506
507         Reviewed by Martin Robinson.
508
509         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
510
511         * platform/gtk/GtkUtilities.cpp:
512         * platform/gtk/GtkUtilities.h:
513         * platform/text/gtk/HyphenationLibHyphen.cpp:
514         (WebCore::availableLocales):
515
516 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
517
518         Remove the WK1-only code path for independently composited iframes
519         https://bugs.webkit.org/show_bug.cgi?id=144722
520
521         Reviewed by Dean Jackson.
522
523         In WebKit1 on Mac, we allowed iframes to be composited independently of their
524         parent document, relying on the fact that the frame's platform view can host
525         a layer-backed view. However, this ran into bugs (rdar://problem/18862298),
526         and triggers the assertion at the end of FrameView::updateLayoutAndStyleIfNeededRecursive(),
527         because the compositing update after a layout can dirty style in notifyIFramesOfCompositingChange().
528         
529         Removing the WK1-only code path solves these problems. It also eliminates the need
530         to do compositing-specific frame overlap testing.
531
532         * page/FrameView.cpp:
533         (WebCore::FrameView::setIsOverlapped): No need to do compositing-related things here.
534         Any iframe that gets composited will participate in the normal compositing overlap
535         testing in its parent frame.
536         (WebCore::FrameView::hasCompositedContentIncludingDescendants): Deleted.
537         (WebCore::FrameView::hasCompositingAncestor): Deleted.
538         * page/FrameView.h:
539         * rendering/RenderLayerCompositor.cpp: Replace ownerElement() checks in this file
540         with an isMainFrameCompositor() for readability. Some 0->nullptr.
541         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
542         (WebCore::RenderLayerCompositor::chromeClient):
543         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
544         (WebCore::RenderLayerCompositor::updateCompositingLayers):
545         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
546         (WebCore::RenderLayerCompositor::updateBacking):
547         (WebCore::RenderLayerCompositor::layerTreeAsText):
548         (WebCore::RenderLayerCompositor::frameContentsCompositor):
549         (WebCore::RenderLayerCompositor::setIsInWindow):
550         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):
551         (WebCore::RenderLayerCompositor::requiresCompositingForFrame): frameRenderer.requiresAcceleratedCompositing()
552         already bails on no content RenderView, so the shouldPropagateCompositingToEnclosingFrame() check does
553         nothing and is removed.
554         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer):
555         (WebCore::RenderLayerCompositor::requiresScrollLayer):
556         (WebCore::RenderLayerCompositor::documentUsesTiledBacking):
557         (WebCore::RenderLayerCompositor::isMainFrameCompositor):
558         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls):
559         (WebCore::RenderLayerCompositor::requiresOverhangAreasLayer):
560         (WebCore::RenderLayerCompositor::requiresContentShadowLayer):
561         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
562         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
563         (WebCore::RenderLayerCompositor::updateLayerForHeader):
564         (WebCore::RenderLayerCompositor::updateLayerForFooter):
565         (WebCore::RenderLayerCompositor::ensureRootLayer): Main frame attaches via ChromeClient,
566         all other frames attach via parent frame.
567         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This call to
568         scheduleSetNeedsStyleRecalc(SyntheticStyleChange) was the source of dirtying style after
569         layout, but is no longer needed so remove it.
570         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
571         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers):
572         (WebCore::RenderLayerCompositor::scrollingCoordinator):
573         (WebCore::RenderLayerCompositor::graphicsLayerFactory):
574         (WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): Deleted.
575         (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame): Deleted.
576         (WebCore::RenderLayerCompositor::mainFrameBackingIsTiled): Deleted. This was mis-named;
577         it really asks whether the document uses tiled backing, but does not check for main frame.
578         * rendering/RenderLayerCompositor.h:
579         * rendering/RenderWidget.cpp:
580         (WebCore::RenderWidget::paintContents): No need to do frame overlap testing for
581         compositing now.
582
583 2015-05-06  Dean Jackson  <dino@apple.com>
584
585         Handle backdrop views that have to tile
586         https://bugs.webkit.org/show_bug.cgi?id=142317
587         <rdar://problem/20049088>
588
589         Reviewed by Simon Fraser.
590
591         Take 2 - this was rolled out because Mavericks was crashing.
592
593         Make sure backdrop layers don't tile. If they are big
594         enough, we'll leave it to the platform compositor to handle.
595
596         This also fixes a bug where if a layer changed from a backdrop
597         type to a tiled type, it would still retain its custom appearance
598         and we'd try to add children to the wrong layer.
599
600         Test: compositing/media-controls-bar-appearance-big.html
601
602         * platform/graphics/ca/GraphicsLayerCA.cpp:
603         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
604         a layer needs a backdrop before checking if it needs to tile.
605
606 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
607
608         Revert "Introducing the Platform Abstraction Layer (PAL)"
609         https://bugs.webkit.org/show_bug.cgi?id=144751
610
611         Unreviewed.
612
613         PAL should be a new target inside WebCore, rather than a top-level folder.
614
615         * WebCore.xcodeproj/project.pbxproj:
616         * Configurations/FeatureDefines.xcconfig:
617
618 2015-05-07  Dan Bernstein  <mitz@apple.com>
619
620         Tried to fix the build.
621
622         * Configurations/WebCoreTestSupport.xcconfig:
623
624 2015-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
625
626         AX: [ATK] The pre element should be mapped to ATK_ROLE_SECTION; not ATK_ROLE_PANEL
627         https://bugs.webkit.org/show_bug.cgi?id=144702
628
629         Reviewed by Chris Fleizach.
630
631         Add a new PreRole AccessibilityRole so that per-platform mapping is possible.
632         Map PreRole to ATK_ROLE_SECTION for Efl and Gtk; to NSAccessibilityGroupRole
633         for the Mac. Add PreRole to the list of "text type" ATK roles.
634
635         No new tests. Existing tests were updated to reflect the corrected mapping.
636
637         * accessibility/AccessibilityObject.h:
638         * accessibility/AccessibilityRenderObject.cpp:
639         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
640         * accessibility/atk/AccessibilityObjectAtk.cpp:
641         (WebCore::AccessibilityObject::allowsTextRanges):
642         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
643         (atkRole):
644         (roleIsTextType):
645         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
646         (createAccessibilityRoleMap):
647
648 2015-05-07  Dan Bernstein  <mitz@apple.com>
649
650         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
651         https://bugs.webkit.org/show_bug.cgi?id=144727
652
653         Reviewed by Darin Adler.
654
655         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig.
656         * Configurations/WebCore.xcconfig: For iOS, define INSTALL_PATH in terms of
657         INSTALL_PATH_PREFIX, and set INSTALL_PATH_PREFIX for the iOS 8.x Simulator.
658         * Configurations/WebCoreTestSupport.xcconfig: Define INSTALL_PATH in terms of
659         INSTALL_PATH_PREFIX and INSTALL_PATH_ACTUAL, and define INSTALL_PATH_PREFIX for the iOS 8.x
660         Simulator.
661
662 2015-05-07  Eric Carlson  <eric.carlson@apple.com>
663
664         [Mac] Playback target isn't set on new element
665         https://bugs.webkit.org/show_bug.cgi?id=144724
666
667         Reviewed by Jer Noble.
668
669         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
670         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
671         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setShouldPlayToPlaybackTarget
672         if necessary.
673         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Remember
674         the setting in case we don't have an AVPlayer yet.
675
676 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
677
678         Fix <script srcset> being loaded by the preloader.
679         https://bugs.webkit.org/show_bug.cgi?id=144675
680
681         Reviewed by Darin Adler.
682
683         Fix HTMLPreloadScanner to make sure that srcset is only loaded
684         when it is present on an <img>.
685
686         Tests: http/tests/loading/preload-script-src.html
687                http/tests/loading/preload-script-srcset-ignored.html
688
689         * html/parser/HTMLPreloadScanner.cpp:
690         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
691
692 2015-05-07  Žan Doberšek  <zdobersek@igalia.com>
693
694         Add missing type traits specialization for PlatformDisplayWayland
695         https://bugs.webkit.org/show_bug.cgi?id=144671
696
697         Reviewed by Carlos Garcia Campos.
698
699         * platform/graphics/wayland/PlatformDisplayWayland.h:
700         Add missing type traits specialization for the PlatformDisplayWayland
701         class via the SPECIALIZE_TYPE_TRAITS_PLATFORM_DISPLAY macro.
702
703 2015-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
704
705         [CSS Grid Layout] Mark grid shorthands as layout dependent
706         https://bugs.webkit.org/show_bug.cgi?id=144687
707
708         Reviewed by Darin Adler.
709
710         grid-template and grid shorthands were not marked us layout dependent,
711         so you can end up calling them before the grid has been laid out and
712         you'll get a crash at valueForGridTrackList() because of trackPositions
713         won't be initialized yet.
714
715         Tests: fast/css-grid-layout/grid-shorthand-computed-style-crash.html
716                fast/css-grid-layout/grid-template-shorthand-computed-style-crash.html
717
718         * css/CSSComputedStyleDeclaration.cpp:
719         (WebCore::isLayoutDependent): Add the grid shorthands only if the object
720         is a RenderGrid as otherwise it's not needed (using the same condition
721         for grid-template-columns and grid-template-rows properties too).
722
723 2015-05-06  Daniel Bates  <dabates@apple.com>
724
725         [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
726         https://bugs.webkit.org/show_bug.cgi?id=144657
727         <rdar://problem/18894598>
728
729         Reviewed by Andy Estes.
730
731         Export WebCore functionality to pause and resume the database thread so that we can
732         make use of this functionality from WebKit2.
733
734         * Modules/webdatabase/AbstractDatabaseServer.h:
735         * Modules/webdatabase/DatabaseManager.cpp:
736         (WebCore::DatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseServer::setPauseAllDatabases().
737         * Modules/webdatabase/DatabaseManager.h:
738         * Modules/webdatabase/DatabaseServer.cpp:
739         (WebCore::DatabaseServer::setPauseAllDatabases): Added; turns around and calls
740         DatabaseTracker::tracker().setDatabasesPaused() to pause or resume the database thread.
741         For now, we guard this call with PLATFORM(IOS). We'll look to remove this guard once
742         we fix <https://bugs.webkit.org/show_bug.cgi?id=144660>.
743         * Modules/webdatabase/DatabaseServer.h:
744
745 2015-05-06  Brent Fulgham  <bfulgham@apple.com>
746
747         Scroll-snap points do not handle margins and padding propertly
748         https://bugs.webkit.org/show_bug.cgi?id=144647
749         <rdar://problem/20829473>
750
751         Reviewed by Simon Fraser.
752
753         The calculation of scroll snap points was incorrect because it did not account for margins or padding.
754         This was fixed by using the "paddingBoxRect" to represent the overall size of the view area, and
755         subtracting the relevant padding when computing the size of the scroll snap offsets.
756
757         Extend testing internals with accessor methods to retrieve string representations of the scroll snap
758         offsets and scroll snap coordinates computed during layout. These values are used in the new
759         'css3/scroll-snap/scroll-snap-offsets-and-coordinates.html' test.
760
761         New tests:
762         * css3/scroll-snap/scroll-snap-offsets-and-coordinates.html: Added.
763         * platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html: Added.
764         * platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-padding.html: Added.
765         * platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-rotated.html: Added.
766
767         * css/LengthFunctions.h: Expose the 'valueForLength' method so we can use it in WebCoreTestSupport.
768         * dom/Node.h: Expose the 'renderBox' method so we can use it in WebCoreTestSupport.
769         * page/scrolling/AxisScrollSnapOffsets.cpp:
770         (WebCore::appendChildSnapOffsets): Use 'contentBoxRect' for overall size, so that we don't use padding
771         as part of our offset calculations.
772         (WebCore::updateSnapOffsetsForScrollableArea): Ditto.
773         * rendering/RenderBox.h: Expose 'canBeScrolledAndHasScrollableArea' for use in WebCoreTestSupport.
774         * rendering/style/RenderStyle.h: Expose 'scrollSnapCoordinates' for use in WebCoreTestSupport.
775         * testing/Internals.cpp:
776         (WebCore::appendOffsets): Helper function.
777         (WebCore::Internals::scrollSnapOffsets): Added.
778         * testing/Internals.h:
779         * testing/Internals.idl:
780
781 2015-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
782
783         Clean up TextRun constructors
784         https://bugs.webkit.org/show_bug.cgi?id=144712
785
786         Reviewed by Zalan Bujtas.
787
788         This patch uses constructor forwarding to make TextRun's constructors much simpler. It then
789         updates the implementations of RenderBlock::constructTextRun() to be more consistent with
790         TextRun (via using StringViews).
791
792         No new tests because there is no behavior change.
793
794         * mathml/MathMLMencloseElement.cpp:
795         (WebCore::MathMLMencloseElement::longDivLeftPadding):
796         * platform/graphics/TextRun.h:
797         (WebCore::TextRun::TextRun):
798         * rendering/RenderBlock.cpp:
799         (WebCore::RenderBlock::constructTextRun):
800         (WebCore::constructTextRunInternal): Deleted.
801         * rendering/RenderBlock.h:
802         * rendering/RenderEmbeddedObject.cpp:
803         (WebCore::RenderEmbeddedObject::paintReplaced):
804         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
805         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
806         * rendering/svg/SVGTextMetricsBuilder.cpp:
807         (WebCore::SVGTextMetricsBuilder::SVGTextMetricsBuilder):
808         * platform/win/DragImageWin.cpp:
809         (WebCore::createDragImageForLink):
810
811 2015-05-06  Sungmann Cho  <sungmann.cho@navercorp.com>
812
813         Rename URL::copy() to URL::isolatedCopy() to match String.
814         https://bugs.webkit.org/show_bug.cgi?id=144684
815
816         Reviewed by Darin Adler.
817
818         No new tests, no behavior change.
819
820         * Modules/websockets/WebSocketHandshake.cpp:
821         (WebCore::WebSocketHandshake::setURL):
822         (WebCore::WebSocketHandshake::httpURLForAuthenticationAndCookies):
823         * fileapi/ThreadableBlobRegistry.cpp:
824         (WebCore::BlobRegistryContext::BlobRegistryContext):
825         * html/parser/HTMLPreloadScanner.cpp:
826         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
827         * html/parser/HTMLResourcePreloader.h:
828         (WebCore::PreloadRequest::PreloadRequest):
829         * html/parser/XSSAuditor.cpp:
830         (WebCore::XSSAuditor::init):
831         * platform/CrossThreadCopier.cpp:
832         (WebCore::URL>::copy):
833         * platform/URL.cpp:
834         (WebCore::URL::isolatedCopy):
835         (WebCore::URL::copy): Deleted.
836         * platform/URL.h:
837         (WebCore::URLCapture::URLCapture):
838         * platform/network/BlobPart.h:
839         (WebCore::BlobPart::detachFromCurrentThread):
840         * platform/network/ResourceRequestBase.cpp:
841         (WebCore::ResourceRequestBase::copyData):
842         * platform/network/ResourceResponseBase.cpp:
843         (WebCore::ResourceResponseBase::copyData):
844         * workers/WorkerThread.cpp:
845         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
846
847 2015-05-06  Commit Queue  <commit-queue@webkit.org>
848
849         Unreviewed, rolling out r183894.
850         https://bugs.webkit.org/show_bug.cgi?id=144719
851
852         crashes on mavericks (Requested by dino on #webkit).
853
854         Reverted changeset:
855
856         "Handle backdrop views that have to tile"
857         https://bugs.webkit.org/show_bug.cgi?id=142317
858         http://trac.webkit.org/changeset/183894
859
860 2015-05-06  Jon Lee  <jonlee@apple.com>
861
862         CoreTextSPI.h uses wrong version number to denote Yosemite
863         https://bugs.webkit.org/show_bug.cgi?id=144701
864
865         Reviewed by Dean Jackson.
866
867         * platform/spi/cocoa/CoreTextSPI.h: Should 101000 not 10100.
868
869 2015-05-06  Jon Lee  <jonlee@apple.com>
870
871         Expose more font weights for -apple-system
872         https://bugs.webkit.org/show_bug.cgi?id=144707
873
874         Reviewed by Dean Jackson.
875
876         Update to platform/mac/fast/text/systemFont.html
877
878         * platform/graphics/mac/FontCacheMac.mm:
879         (WebCore::toNSFontWeight): New static method to map font weights to NSFontWeight constants available on
880         Yosemite and later.
881         (WebCore::fontWithFamily): Request the system font with a mapped weight on Yosemite and later.
882         * platform/spi/mac/NSFontSPI.h: Add [NSFont systemFontWithSize:weight:], and the proper NSFontWeight
883         constants.
884
885 2015-05-06  Dean Jackson  <dino@apple.com>
886
887         Handle backdrop views that have to tile
888         https://bugs.webkit.org/show_bug.cgi?id=142317
889         <rdar://problem/20049088>
890
891         Reviewed by Simon Fraser.
892
893         Make sure backdrop layers don't tile. If they are big
894         enough, we'll leave it to the platform compositor to handle.
895
896         This also fixes a bug where if a layer changed from a backdrop
897         type to a tiled type, it would still retain its custom appearance
898         and we'd try to add children to the wrong layer.
899
900         Test: compositing/media-controls-bar-appearance-big.html
901
902         * platform/graphics/ca/GraphicsLayerCA.cpp:
903         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
904         a layer needs a backdrop before checking if it needs to tile.
905
906 2015-05-06  Carlos Garcia Campos  <cgarcia@igalia.com> and Per Arne Vollan  <peavo@outlook.com>
907
908         [WinCairo] Compile error due to undefined symbols after r183868
909         https://bugs.webkit.org/show_bug.cgi?id=144692
910
911         Reviewed by Alex Christensen.
912
913         Speculative build fix. Add dummy PlatformDisplayWin.
914
915         * PlatformWinCairo.cmake: Add PlatformDisplay.cpp to compilation.
916         * platform/graphics/PlatformDisplay.cpp:
917         (WebCore::PlatformDisplay::createPlatformDisplay):
918         * platform/graphics/PlatformDisplay.h:
919         * platform/graphics/win/PlatformDisplayWin.h:
920         Add stubs to compile.
921         * WebCore.vcxproj/WebCore.vcxproj
922         * WebCore.vcxproj/WebCore.vcxproj.filters
923         Add new files to Windows build.
924
925 2015-05-06  David Hyatt  <hyatt@apple.com>
926
927         Avoid copies in scrollOffsetForFixedPosition() and inline it.
928         https://bugs.webkit.org/show_bug.cgi?id=144709
929
930         Reviewed by Simon Fraser.
931
932         * page/FrameView.cpp:
933         (WebCore::FrameView::frameScaleFactor):
934         Added so that scrollOffsetForFixedPosition() can be inlined without having to
935         reference Frame's implementation.
936
937         (WebCore::FrameView::scrollOffsetForFixedPosition): Deleted.
938         Moved this to the header.
939
940         * page/FrameView.h:
941         Inline scrollOffsetForFixedPosition() and get rid of all the copying
942         it was doing.
943
944 2015-05-06  David Hyatt  <hyatt@apple.com>
945
946         RenderLayer::currentTransform computes a pixel snapped rect it doesn't use.
947         https://bugs.webkit.org/show_bug.cgi?id=144708
948
949         Reviewed by Simon Fraser.
950
951         * rendering/RenderLayer.cpp:
952         (WebCore::RenderLayer::currentTransform):
953
954         Only compute a pixel snapped rect if we actually end up needing it. The common case
955         is that this rect is not needed, so pushing it inside the two if statements
956         speeds up the common case.
957
958 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
959
960         Fix the build.
961
962         * platform/spi/cocoa/QuartzCoreSPI.h:
963
964 2015-05-06  David Hyatt  <hyatt@apple.com>
965
966         Optimize topLeftLocationOffset() addition in updateLayerPosition
967         https://bugs.webkit.org/show_bug.cgi?id=144704
968
969         Reviewed by Dean Jackson.
970
971         * page/FrameView.cpp:
972         (WebCore::FrameView::FrameView):
973         * page/FrameView.h:
974         Move the hasFlippedBlocks bit to FrameView instead of RenderView. Works better for inlining
975         the check in any renderer header, and it also makes more sense conceptually, since the RenderView
976         itself could be a flipped block.
977
978         * rendering/RenderBox.cpp:
979         (WebCore::RenderBox::layoutOverflowRectForPropagation):
980         Change over to the FrameView bit.
981
982         * rendering/RenderBox.h:
983         (WebCore::RenderBox::applyTopLeftLocationOffset):
984         Add a new inlined function that can apply the top left location offset to a point without
985         multiple LayoutSize creations and copies. It invokes a helper for flipping that is not
986         inlined only in the case where actual flipped blocks exist in the render tree.
987
988         * rendering/RenderBoxModelObject.cpp:
989         (WebCore::RenderBoxModelObject::updateFromStyle):
990         Set the bit on the FrameView now instead of the RenderView.
991
992         * rendering/RenderLayer.cpp:
993         (WebCore::RenderLayer::updateLayerPosition):
994         Call the new applyTopLeftLocationOffset function so that the point can have offsets added
995         in without any extra copies.
996
997         (WebCore::RenderLayer::calculateClipRects):
998         * rendering/RenderLineBoxList.cpp:
999         (WebCore::RenderLineBoxList::rangeIntersectsRect):
1000         Switch over to the bit on the FrameView.
1001
1002         * rendering/RenderView.cpp:
1003         (WebCore::RenderView::RenderView):
1004         * rendering/RenderView.h:
1005         Get rid of the bit on the RenderView.
1006
1007 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
1008
1009         Introducing the Platform Abstraction Layer (PAL)
1010         https://bugs.webkit.org/show_bug.cgi?id=143358
1011
1012         Reviewed by Simon Fraser.
1013
1014         * WebCore.xcodeproj/project.pbxproj: Let the project know about the .a
1015         * Configurations/FeatureDefines.xcconfig: Updated
1016
1017 2015-05-06  Eric Carlson  <eric.carlson@apple.com>
1018
1019         [iOS] remove some unnecessary iOS-only media code
1020         https://bugs.webkit.org/show_bug.cgi?id=144697
1021         <rdar://problem/20229914>
1022
1023         Reviewed by Jer Noble.
1024
1025         * html/HTMLAttributeNames.in: Remove data-youtube-id.
1026
1027         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1028         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Remove dataYouTubeID.
1029
1030 2015-05-06  David Hyatt  <hyatt@apple.com>
1031
1032         Optimize relativePositionOffset() to avoid doing unnecessary work
1033         https://bugs.webkit.org/show_bug.cgi?id=144698
1034
1035         Reviewed by Simon Fraser.
1036
1037         * rendering/RenderBoxModelObject.cpp:
1038         (WebCore::RenderBoxModelObject::relativePositionOffset):
1039
1040         Patch relativePositionOffset to avoid doing unnecessary work in the common case where
1041         all values of top/left/right/bottom are either auto or fixed. We no longer fetch
1042         containingBlock() into a local always, but instead just invoke the function only
1043         when necessary.
1044
1045         Also avoid computing the percentage-relative maximum for the top/right/bottom/left lengths
1046         when they are fixed values, since that maximum won't be examined at all.
1047
1048 2015-05-06  Martin Robinson  <mrobinson@igalia.com>
1049
1050         [FreeType] Vertical CJK glyphs should not be rendered with synthetic oblique
1051         https://bugs.webkit.org/show_bug.cgi?id=144612
1052
1053         Reviewed by Darin Adler.
1054
1055         No new tests. This causes fast/text/international/synthesized-italic-vertical.html to pass.
1056
1057         * platform/graphics/Font.cpp:
1058         (WebCore::Font::nonSyntheticItalicFont): Compile this method for Cairo as well.
1059         * platform/graphics/FontCascadeFonts.cpp:
1060         (WebCore::FontCascadeFonts::glyphDataForSystemFallback): When searching for the system fallback,
1061         ensure that we do not use synthetic oblique when rendering vertical CJK glyphs.
1062         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Extend the CJK fix to Cairo ports.
1063         * platform/graphics/FontPlatformData.h:
1064         (WebCore::FontPlatformData::setSyntheticOblique): Added this helper method, because
1065         Freetype/Cairo ports needs to be able to recreate the scaled font matrix when the
1066         synthetic oblique settings changes.
1067         * platform/graphics/freetype/FontPlatformData.h: Rename initializeWithFontFace to buildScaledFont.
1068         Remove the now unused m_horizontalOrientationMatrix member.
1069         (WebCore::FontPlatformData::setSyntheticOblique): Added the helper here as well.
1070         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1071         (WebCore::FontPlatformData::FontPlatformData): Calculate whether or not to use synthetic oblique here,
1072         before buildScaledFont is called. Call buildScaledFont instead of initializeWithFontFace.
1073         (WebCore::FontPlatformData::operator=):
1074         (WebCore::FontPlatformData::buildScaledFont): Renamed from initializeWithFontFace, does
1075         the same thing, except calculate whether or not to use synthetic oblique. Instead just
1076         reads the value.
1077         (WebCore::FontPlatformData::setOrientation): Instead of adjusting the font matrix, recreate
1078         the entire font.
1079         (WebCore::FontPlatformData::setSyntheticOblique): Added.
1080         (WebCore::rotateCairoMatrixForVerticalOrientation): Deleted.
1081         (WebCore::FontPlatformData::initializeWithFontFace): Deleted.
1082
1083 2015-05-06  Alex Christensen  <achristensen@webkit.org>
1084
1085         [Content Extensions] Test splitting NFAs by max NFA size.
1086         https://bugs.webkit.org/show_bug.cgi?id=144659
1087
1088         Reviewed by Darin Adler.
1089
1090         * WebCore.xcodeproj/project.pbxproj:
1091         * contentextensions/CombinedURLFilters.cpp:
1092         (WebCore::ContentExtensions::generateNFAForSubtree):
1093         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1094         * contentextensions/CombinedURLFilters.h:
1095         * contentextensions/ContentExtensionCompiler.cpp:
1096         (WebCore::ContentExtensions::compileRuleList):
1097         * contentextensions/DFABytecodeCompiler.h:
1098         * contentextensions/DFABytecodeInterpreter.h:
1099         Make maxNFASize a parameter so we can test it with small values.
1100
1101 2015-05-06  Antti Koivisto  <antti@apple.com>
1102
1103         REGRESSION (r183467): Unable to start downloads in private browsing mode
1104         https://bugs.webkit.org/show_bug.cgi?id=144533
1105
1106         Reviewed by Darin Adler.
1107
1108         If willSendRequest delegate mutated the request we would lose the requester field value from the original.
1109
1110         No test runner support for mutating requests.
1111
1112         * platform/network/cf/ResourceRequestCFNet.cpp:
1113         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
1114
1115             This needs to keep the requester too.
1116
1117         * platform/network/cocoa/ResourceRequestCocoa.mm:
1118         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
1119
1120             Share implementations.
1121
1122 2015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
1123
1124         Toggling underline on font panel removes strike through
1125         https://bugs.webkit.org/show_bug.cgi?id=144670
1126         <rdar://problem/3790443>
1127
1128         Reviewed by Darin Adler.
1129
1130         * editing/EditingStyle.cpp:
1131         (WebCore::EditingStyle::EditingStyle): Added a variant that takes CSSStyleDeclaration.
1132         * editing/EditingStyle.h:
1133         (WebCore::EditingStyle::create): Ditto.
1134         * editing/Editor.cpp:
1135         (WebCore::Editor::applyStyleToSelection): Takes Ref<EditingStyle>&& instead of RefPtr<EditingStyle>&&.
1136         * editing/Editor.h:
1137         * editing/EditorCommand.cpp:
1138         (WebCore::applyCommandToFrame): Ditto.
1139         (WebCore::executeStrikethrough):
1140         (WebCore::executeUnderline):
1141
1142 2015-05-06  Jessie Berlin  <jberlin@webkit.org>
1143
1144         More build fixing.
1145
1146         * page/mac/TextIndicatorWindow.mm:
1147
1148 2015-05-06  Jessie Berlin  <jberlin@webkit.org>
1149
1150         32-bit build fix after r183859 and r183860.
1151
1152         * page/mac/TextIndicatorWindow.mm:
1153         Autosynthesis isn't available for our 32-bit builds.
1154
1155 2015-05-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1156
1157         [EGL] Move EGLDisplay handling to PlatformDisplay and remove PlatformDisplay definition from GLDefs.h
1158         https://bugs.webkit.org/show_bug.cgi?id=144685
1159
1160         Reviewed by Martin Robinson.
1161
1162         The EGL display is also initialized in multiple places, and could
1163         be unified in PlatformDisplay. Remove the PlatformDisplay
1164         definition from platform/graphics/opengl/GLDefs.h to avoid conflicts.
1165
1166         * platform/graphics/PlatformDisplay.cpp:
1167         (WebCore::PlatformDisplay::PlatformDisplay): Initialize m_eglDisplay.
1168         (WebCore::PlatformDisplay::~PlatformDisplay): Call terminateEGLDisplay().
1169         (WebCore::PlatformDisplay::eglDisplay): Lazy intialize the EGL
1170         display and return it.
1171         (WebCore::PlatformDisplay::initializeEGLDisplay):
1172         (WebCore::PlatformDisplay::terminateEGLDisplay):
1173         * platform/graphics/PlatformDisplay.h:
1174         * platform/graphics/egl/GLContextEGL.cpp:
1175         (WebCore::sharedEGLDisplay): Use PlatformDisplay::eglDisplay().
1176         * platform/graphics/opengl/GLDefs.h: Remove unneeded definitions.
1177         * platform/graphics/opengl/GLPlatformSurface.cpp:
1178         (WebCore::GLPlatformSurface::GLPlatformSurface): Remove
1179         m_sharedDisplay member, PlatformDisplay::sharedDisplay() can be used instead.
1180         (WebCore::GLPlatformSurface::sharedDisplay): Deleted.
1181         * platform/graphics/opengl/GLPlatformSurface.h:
1182         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Use
1183         EGLDisplay instead of PlatformDisplay.
1184         * platform/graphics/surfaces/egl/EGLContext.cpp:
1185         (WebCore::EGLOffScreenContext::initialize): Use PlatformDisplay::eglDisplay().
1186         * platform/graphics/surfaces/egl/EGLHelper.cpp: Remove the
1187         EGLDisplayConnection clas and use PlatformDisplay instead.
1188         (WebCore::EGLHelper::eglDisplay):
1189         (WebCore::EGLHelper::currentDisplay):
1190         (WebCore::EGLDisplayConnection::EGLDisplayConnection): Deleted.
1191         (WebCore::EGLDisplayConnection::~EGLDisplayConnection): Deleted.
1192         (WebCore::EGLDisplayConnection::display): Deleted.
1193         (WebCore::EGLDisplayConnection::terminate): Deleted.
1194         * platform/graphics/surfaces/egl/EGLHelper.h:
1195         * platform/graphics/surfaces/egl/EGLSurface.cpp:
1196         (WebCore::EGLTransportSurface::EGLTransportSurface): Use EGLHelper::eglDisplay().
1197         (WebCore::EGLTransportSurface::destroy): Ditto.
1198         (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Ditto.
1199         (WebCore::EGLOffScreenSurface::destroy): Ditto.
1200         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
1201         (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
1202         Use PlatformDisplay::eglDisplay().
1203         (WebCore::EGLWindowTransportSurface::swapBuffers): Ditto.
1204         (WebCore::EGLPixmapSurface::EGLPixmapSurface): Ditto.
1205         * platform/graphics/surfaces/glx/GLXContext.cpp:
1206         (WebCore::GLXOffScreenContext::initialize): Use X11Helper::nativeDisplay().
1207         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1208         (WebCore::GLXTransportSurface::GLXTransportSurface): Do not use m_sharedDisplay.
1209         (WebCore::GLXOffScreenSurface::initialize): Ditto.
1210         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1211         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Call
1212         PlatformDisplay::initializeEGLDisplay() to insialize the EGL display.
1213         * platform/graphics/wayland/PlatformDisplayWayland.h:
1214         * platform/graphics/x11/PlatformDisplayX11.cpp:
1215         (WebCore::PlatformDisplayX11::initializeEGLDisplay): Override
1216         PlatformDisplay::initializeEGLDisplay() to initialize the
1217         m_eglDisplay member.
1218         * platform/graphics/x11/PlatformDisplayX11.h:
1219
1220 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
1221
1222         Web Inspector: DOMStorage exception and issue with sessionStorage
1223         https://bugs.webkit.org/show_bug.cgi?id=144646
1224
1225         Reviewed by Timothy Hatcher.
1226
1227         * inspector/InspectorDOMStorageAgent.cpp:
1228         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1229         Return session storage if the identifier says not local storage.
1230
1231 2015-05-06  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1232
1233         Move ReadableStreamJSSource.h/.cpp to ReadableJSStream.h/.cpp
1234         https://bugs.webkit.org/show_bug.cgi?id=144567
1235
1236         Reviewed by Darin Adler.
1237
1238         In addition to renaming ReadableStreamJSSource.h/.cpp, ReadableStreamJSSource is now made a private class of
1239         ReadableJSStream, called ReadableJSStream::Source.
1240         Made some minor refactoring (passing some ExecState by ref and not by pointer).
1241         No functional change, existing tests cover the changes.
1242
1243         * bindings/js/JSReadableStreamCustom.cpp:
1244         * bindings/js/ReadableJSStream.cpp:
1245         (WebCore::ReadableJSStream::Source::create):
1246         (WebCore::ReadableJSStream::Source::Source):
1247         (WebCore::ReadableJSStream::Source::~Source):
1248         (WebCore::ReadableJSStream::Source::globalObject):
1249         (WebCore::ReadableJSStream::Source::start):
1250         (WebCore::ReadableJSStream::create):
1251         (WebCore::ReadableJSStream::ReadableJSStream):
1252         * bindings/js/ReadableJSStream.h:
1253
1254 2015-05-05  Tim Horton  <timothy_horton@apple.com>
1255
1256         REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
1257         https://bugs.webkit.org/show_bug.cgi?id=144651
1258         <rdar://problem/20755722>
1259
1260         * page/mac/TextIndicatorWindow.mm:
1261         Fix an incorrectly-applied review comment.
1262
1263 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
1264
1265         REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
1266         https://bugs.webkit.org/show_bug.cgi?id=144651
1267         <rdar://problem/20755722>
1268
1269         Reviewed by Dan Bernstein.
1270
1271         * page/mac/TextIndicatorWindow.h:
1272         * page/mac/TextIndicatorWindow.mm:
1273         (WebCore::TextIndicatorWindow::clearTextIndicator):
1274         (WebCore::TextIndicatorWindow::setTextIndicator):
1275         (WebCore::TextIndicatorWindow::closeWindow):
1276         (WebCore::TextIndicatorWindow::startFadeOut):
1277         We can't keep m_fadingOut on TextIndicatorWindow, since it is reused.
1278         Keep it on the WebTextIndicatorView instead.
1279
1280 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
1281
1282         Add missing vtable override specifiers under Source/WebCore/html
1283         https://bugs.webkit.org/show_bug.cgi?id=144578
1284
1285         Reviewed by Daniel Bates.
1286
1287         Update virtual method overrides under Source/WebCore/html
1288         which are missing the override specifier.
1289
1290         * html/canvas/WebGL2RenderingContext.h:
1291         * html/canvas/WebGLRenderingContext.h:
1292         * html/track/InbandTextTrack.h:
1293         * html/track/TrackListBase.h:
1294
1295 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
1296
1297         Add missing vtable override specifiers under Source/WebCore/rendering
1298         https://bugs.webkit.org/show_bug.cgi?id=144570
1299
1300         Reviewed by Darin Adler.
1301
1302         Update virtual method overrides under Source/WebCore/rendering
1303         which are missing the override specifiers.
1304
1305         * rendering/InlineTextBox.h:
1306         (WebCore::InlineTextBox::calculateBoundaries): Deleted.
1307         * rendering/RenderFlowThread.h:
1308         * rendering/RenderMedia.h:
1309         (WebCore::RenderMedia::shadowControlsNeedCustomLayoutMetrics): Deleted.
1310         * rendering/RenderMultiColumnSet.h:
1311         * rendering/RenderRegion.h:
1312         * rendering/RenderRegionSet.h:
1313         * rendering/RenderThemeGtk.h:
1314         * rendering/mathml/RenderMathMLOperator.h:
1315         * rendering/svg/RenderSVGBlock.h:
1316
1317 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
1318
1319         Add missing vtable override specifiers under Source/WebCore/Modules
1320         https://bugs.webkit.org/show_bug.cgi?id=144569
1321
1322         Reviewed by Darin Adler.
1323
1324         Update virtual method overrides under Source/WebCore/Modules
1325         which are missing the override specifier.
1326
1327         * Modules/mediasource/SourceBuffer.h:
1328         * Modules/mediastream/MediaStreamTrack.h:
1329         * Modules/mediastream/RTCVoidRequestImpl.h:
1330         * Modules/webaudio/AudioContext.h:
1331         (WebCore::AudioContext::mediaType): Deleted.
1332         (WebCore::AudioContext::presentationType): Deleted.
1333         (WebCore::AudioContext::canReceiveRemoteControlCommands): Deleted.
1334         (WebCore::AudioContext::didReceiveRemoteControlCommand): Deleted.
1335         (WebCore::AudioContext::overrideBackgroundPlaybackRestriction): Deleted.
1336         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
1337         * Modules/webaudio/MediaStreamAudioSourceNode.h:
1338         * Modules/webaudio/WaveShaperDSPKernel.h:
1339         * Modules/websockets/WebSocketChannel.h:
1340         (WebCore::WebSocketChannel::refThreadableWebSocketChannel): Deleted.
1341         (WebCore::WebSocketChannel::derefThreadableWebSocketChannel): Deleted.
1342         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
1343         (WebCore::WorkerThreadableWebSocketChannel::refThreadableWebSocketChannel): Deleted.
1344         (WebCore::WorkerThreadableWebSocketChannel::derefThreadableWebSocketChannel): Deleted.
1345
1346 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
1347
1348         EventHandler::m_eventHandlerWillResetCapturingMouseEventsElement is incorrectly initialized
1349         https://bugs.webkit.org/show_bug.cgi?id=144583
1350
1351         Reviewed by Daniel Bates.
1352
1353         * page/EventHandler.cpp:
1354         (WebCore::EventHandler::EventHandler): The
1355         m_eventHandlerWillResetCapturingMouseEventsElement is a boolean,
1356         so initialize it to false, instead of to nullptr.
1357
1358 2015-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
1359
1360         [CSS Grid Layout] grid-template-areas should accept none value
1361         https://bugs.webkit.org/show_bug.cgi?id=144624
1362
1363         Reviewed by Darin Adler.
1364
1365         Default value for grid-template-areas property is "none":
1366         http://dev.w3.org/csswg/css-grid/#propdef-grid-template-areas
1367
1368         Currently if you set the property to "none" from JavaScript, the value
1369         doesn't get reseted and it keeps the old value.
1370
1371         Update fast/css-grid-layout/grid-template-areas-get-set.html adding a
1372         new test case.
1373
1374         * css/CSSParser.cpp:
1375         (WebCore::CSSParser::parseGridTemplateAreas): Add support to parse
1376         "none" successfully.
1377
1378 2015-05-05  Zalan Bujtas  <zalan@apple.com>
1379
1380         Remove unused RenderLayerBacking::hasContentsLayer().
1381         https://bugs.webkit.org/show_bug.cgi?id=144658
1382
1383         Reviewed by Simon Fraser.
1384
1385         No change in functionality.
1386
1387         * rendering/RenderLayerBacking.h:
1388
1389 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1390
1391         [Content Extensions] Limit NFA size.
1392         https://bugs.webkit.org/show_bug.cgi?id=144649
1393
1394         Reviewed by Benjamin Poulain.
1395
1396         * contentextensions/CombinedURLFilters.cpp:
1397         (WebCore::ContentExtensions::generateNFAForSubtree):
1398         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1399         Add a maximum NFA size to ensure that we do not use too much memory when compiling.
1400         * contentextensions/ContentExtensionCompiler.cpp:
1401         (WebCore::ContentExtensions::compileRuleList):
1402         Remove debugging code that doesn't compile any more.
1403
1404 2015-05-05  Roger Fong  <roger_fong@apple.com>
1405
1406         Unreviewed. Some assertion failures in compositing code after r183820.
1407         https://bugs.webkit.org/show_bug.cgi?id=144630.
1408
1409         * rendering/RenderLayerCompositor.cpp:
1410         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1411
1412 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
1413
1414         Add a layout mode for computing fixed layout size from a minimum size
1415         https://bugs.webkit.org/show_bug.cgi?id=144610
1416         <rdar://problem/19790341>
1417
1418         Reviewed by Simon Fraser.
1419
1420         * platform/spi/cocoa/QuartzCoreSPI.h:
1421         Add some SPI.
1422
1423 2015-05-05  Brent Fulgham  <bfulgham@apple.com>
1424
1425         iOS] Scroll snap points trigger reentrant layout
1426         https://bugs.webkit.org/show_bug.cgi?id=144644
1427         <rdar://problem/20366547>
1428
1429         Reviewed by Simon Fraser.
1430
1431         Covered by scroll-snap-mandatory.html test.
1432
1433         We had an iOS code path in 'appendChildSnapOffsets' that used offsetLeft and offsetTop. This code
1434         was sometimes called during layout, which triggered a reentrant layout call, resulting in a debug
1435         assertion.
1436
1437         * page/scrolling/AxisScrollSnapOffsets.cpp:
1438         (WebCore::appendChildSnapOffsets): Remove iOS codepath.
1439
1440 2015-05-05  Roger Fong  <roger_fong@apple.com>
1441
1442         Blurry media control icons on non retina displays.
1443         https://bugs.webkit.org/show_bug.cgi?id=144638.
1444         <rdar://problem/20526166>
1445
1446         Reviewed by Dean Jackson.
1447
1448         * Modules/mediacontrols/mediaControlsApple.css:
1449         Adjust fullscreen buttons so that they look good on both 1x and 2x displays.
1450         (audio::-webkit-media-controls-fullscreen-button):
1451         (audio::-webkit-media-controls-fullscreen-button.exit):
1452         (audio::-webkit-media-controls-fullscreen-button:active):
1453         (audio::-webkit-media-controls-panel button.exit:active):
1454         Handle wireless playback picker button background in mediaControlsApple.js
1455         (audio::-webkit-media-controls-wireless-playback-picker-button):
1456         (audio::-webkit-media-controls-wireless-playback-picker-button.playing): Deleted.
1457
1458         * Modules/mediacontrols/mediaControlsApple.js:
1459         Update wireless playback picker button based on display type.
1460         (Controller.prototype.UIString):
1461         (Controller.prototype.handleReadyStateChange):
1462         (Controller.prototype.updateWirelessTargetPickerButton):
1463         (Controller.prototype.updateWirelessPlaybackStatus):
1464
1465 2015-05-05  Joseph Pecoraro  <pecoraro@apple.com>
1466
1467         Web Inspector: Crash under WebCore::domWindowFromExecState reloading page with inspector open
1468         https://bugs.webkit.org/show_bug.cgi?id=144636
1469
1470         Reviewed by Mark Lam.
1471
1472         This ensures we create an InjectedScript for the execution context
1473         (frame) preventing the global object / exec state from getting garbage
1474         collected before we remove it from our map.
1475
1476         * inspector/PageRuntimeAgent.cpp:
1477         (WebCore::PageRuntimeAgent::notifyContextCreated):
1478
1479 2015-05-05  Dean Jackson  <dino@apple.com>
1480
1481         [iOS] AirPlay placeholder in inline videos uses Helvetica or Times, should be system font
1482         https://bugs.webkit.org/show_bug.cgi?id=144643
1483
1484         Reviewed by Brent Fulgham.
1485
1486         The Airplay placard should use "-apple-system" as a font-family.
1487
1488         * Modules/mediacontrols/mediaControlsiOS.css:
1489         (audio::-webkit-media-controls-wireless-playback-status):
1490
1491 2015-05-05  Zalan Bujtas  <zalan@apple.com>
1492
1493         Navigating to www.apple.com hits assertion in WebCore::TextIteratorCopyableText::set()
1494         https://bugs.webkit.org/show_bug.cgi?id=144629
1495         rdar://problem/20689877
1496
1497         Reviewed by Andreas Kling.
1498
1499         This patch ensures that we don't emit empty text for the text iterator.
1500         In TextIterator::handleTextNode before emitting a string, certain characters (\n \t) need to
1501         be replaced with space. When such character is found, we emit the string we've processed so far and
1502         handle the replacement during the next callback.
1503         When the first character in the string needs replacing, there's nothing to emit. However if we don't
1504         handle at least one character, TextIterator::advance believes that processing is done and never calls  
1505         TextIterator::handleTextNode back with the rest of the string. 
1506
1507         Test: fast/text/simple-line-layout-innerText-with-newline.html
1508
1509         * editing/TextIterator.cpp:
1510         (WebCore::isNewLineOrTabCharacter):
1511         (WebCore::TextIterator::handleTextNode):
1512
1513 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1514
1515         [Content Extensions] Use less memory to store the json input.
1516         https://bugs.webkit.org/show_bug.cgi?id=144604
1517
1518         Reviewed by Benjamin Poulain.
1519
1520         * contentextensions/ContentExtensionCompiler.cpp:
1521         (WebCore::ContentExtensions::compileRuleList):
1522         * contentextensions/ContentExtensionCompiler.h:
1523         (WebCore::ContentExtensions::loadEncodedRules):
1524         Don't copy strings as much or keep them alive after done using them.
1525
1526 2015-05-05  Eric Carlson  <eric.carlson@apple.com>
1527
1528         Prevent recursive calls to show target picker menu.
1529         https://bugs.webkit.org/show_bug.cgi?id=144637
1530         <rdar://problem/20824726>
1531
1532         Reviewed by Jer Noble.
1533
1534         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Add m_showingMenu.
1535         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1536         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Do nothing if the menu
1537         is already showing.
1538
1539 2015-05-05  Dean Jackson  <dino@apple.com>
1540
1541         Use system blue for Airplay Glyph
1542         https://bugs.webkit.org/show_bug.cgi?id=144614
1543
1544         There was a typo in the last commit.
1545
1546         * Modules/mediacontrols/mediaControlsiOS.css:
1547         (audio::-webkit-media-controls-optimized-fullscreen-button): Transition duration should be 250ms.
1548
1549 2015-05-04  Dean Jackson  <dino@apple.com>
1550
1551         [iOS] Use system blue for Airplay Glyph
1552         https://bugs.webkit.org/show_bug.cgi?id=144614
1553
1554         Reviewed by Eric Carlson.
1555
1556         Revert to using masks for the glyphs in the media controls,
1557         which allows us to:
1558         - use the system blue color when Airplay is active <rdar://problem/20245297>
1559         - fade out from the active state <rdar://problem/20245487>
1560         - allow the play button to give touch feedback <rdar://problem/17849930>
1561
1562         While those are three separate bugs, they all get addressed by
1563         this single change.
1564
1565         * Modules/mediacontrols/mediaControlsiOS.css:
1566         (audio::-webkit-media-controls-optimized-fullscreen-button):
1567         (audio::-webkit-media-controls-optimized-fullscreen-button:active):
1568         (video::-webkit-media-controls-play-button):
1569         (video::-webkit-media-controls-play-button.paused):
1570         (video::-webkit-media-controls-fullscreen-button):
1571         (video::-webkit-media-controls-wireless-playback-picker-button):
1572         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
1573         (video::-webkit-media-controls-optimized-fullscreen-button):
1574         (video::-webkit-media-controls-play-button:active): Deleted.
1575         (video::-webkit-media-controls-play-button.paused:active): Deleted.
1576         (video::-webkit-media-controls-fullscreen-button:active): Deleted.
1577         (video::-webkit-media-controls-wireless-playback-picker-button:active): Deleted.
1578
1579 2015-05-05  Eric Carlson  <eric.carlson@apple.com>
1580
1581         Only autoplay videos should not automatically play to playback target
1582         https://bugs.webkit.org/show_bug.cgi?id=144633
1583
1584         Reviewed by Jer Noble.
1585
1586         * html/HTMLMediaElement.cpp:
1587         (WebCore::HTMLMediaElement::HTMLMediaElement): Set RequireUserGestureToAutoplayToExternalDevice.
1588         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove
1589         RequireUserGestureToAutoplayToExternalDevice.
1590         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate if playback
1591         was started from a user gesture, even if the video loops and/or doesn't have audio.
1592
1593         * html/HTMLMediaSession.h: Define RequireUserGestureToAutoplayToExternalDevice.
1594         (WebCore::HTMLMediaSession::hasBehaviorRestriction): New.
1595
1596 2015-05-05  Brent Fulgham  <bfulgham@apple.com>
1597
1598         Unreviewed logging fix.
1599
1600         * page/WheelEventTestTrigger.cpp:
1601         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Fix typo in logging channel.
1602
1603 2015-05-04  Roger Fong  <roger_fong@apple.com>
1604
1605         Media control volume slider is opaque.
1606         https://bugs.webkit.org/show_bug.cgi?id=144470.
1607         <rdar://problem/20770350>
1608
1609         Rubberstamped by Simon Fraser.
1610
1611         * Modules/mediacontrols/mediaControlsApple.css:
1612         (audio::-webkit-media-controls-panel): 
1613         Don't create a stacking context just for the controls.
1614         Doing so causes the mix-blend-mode on the volume box to fail.
1615
1616 2015-05-05  Alex Christensen  <achristensen@webkit.org>
1617
1618         [Content Extensions] Combine NFAs properly and free memory as we compile.
1619         https://bugs.webkit.org/show_bug.cgi?id=144485
1620
1621         Reviewed by Benjamin Poulain.
1622
1623         This patch correctly combines all regular expressions with a common prefix up to
1624         the last quantified term into the same NFA.  It also deletes the prefix tree as it 
1625         creates NFAs, thus reducing the maximum memory used when compiling.
1626
1627         * contentextensions/CombinedURLFilters.cpp:
1628         (WebCore::ContentExtensions::CombinedURLFilters::isEmpty):
1629         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
1630         (WebCore::ContentExtensions::generateNFAForSubtree):
1631         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1632         (WebCore::ContentExtensions::CombinedURLFilters::clear): Deleted.
1633         * contentextensions/CombinedURLFilters.h:
1634         * contentextensions/ContentExtensionCompiler.cpp:
1635         (WebCore::ContentExtensions::compileRuleList):
1636         * contentextensions/ContentExtensionsDebugging.h:
1637
1638 2015-05-04  Alex Christensen  <achristensen@webkit.org>
1639
1640         [Content Extensions] Use less memory when writing byte code to file
1641         https://bugs.webkit.org/show_bug.cgi?id=144602
1642
1643         Reviewed by Darin Adler.
1644
1645         * contentextensions/ContentExtensionCompiler.cpp:
1646         (WebCore::ContentExtensions::compileRuleList):
1647         * contentextensions/ContentExtensionCompiler.h:
1648         Compile one DFA at a time so we don't need to keep all the bytecode in memory at the same time.
1649         * contentextensions/DFABytecodeInterpreter.cpp:
1650         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1651         Jumps are now relative to the current DFA because we don't know about other DFAs that
1652         have been compiling when linking the DFA bytecode.  This will also make the DFA bytecode
1653         easier to minimize because more of the values are small in the DFAs after the first DFA.
1654         * platform/FileSystem.h:
1655
1656 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
1657
1658         Unreviewed, speculative WinCairo buildfix after r183807.
1659
1660         * WebCore.vcxproj/WebCore.vcxproj:
1661         * WebCore.vcxproj/WebCore.vcxproj.filters:
1662
1663 2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
1664
1665         Remove TextureMapperImageBuffer
1666         https://bugs.webkit.org/show_bug.cgi?id=143561
1667
1668         Reviewed by Žan Doberšek.
1669
1670         * CMakeLists.txt:
1671         * PlatformEfl.cmake:
1672         * PlatformGTK.cmake:
1673         * PlatformWinCairo.cmake:
1674         * platform/graphics/GraphicsContext3DPrivate.cpp:
1675         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1676         * platform/graphics/cairo/ImageBufferCairo.cpp:
1677         (WebCore::ImageBufferData::paintToTextureMapper):
1678         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1679         (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
1680         * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Removed.
1681         * platform/graphics/texmap/BitmapTextureImageBuffer.h: Removed.
1682         * platform/graphics/texmap/BitmapTexturePool.cpp:
1683         (WebCore::BitmapTexturePool::createTexture):
1684         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1685         (WebCore::GraphicsLayerTextureMapper::setFilters):
1686         * platform/graphics/texmap/TextureMapper.cpp:
1687         (WebCore::TextureMapper::create):
1688         (WebCore::TextureMapper::TextureMapper):
1689         * platform/graphics/texmap/TextureMapper.h:
1690         (WebCore::TextureMapper::accelerationMode): Deleted.
1691         * platform/graphics/texmap/TextureMapperGL.cpp:
1692         (WebCore::TextureMapperGL::TextureMapperGL):
1693         * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Removed.
1694         * platform/graphics/texmap/TextureMapperImageBuffer.h: Removed.
1695         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1696         (WebCore::CompositingCoordinator::CompositingCoordinator):
1697         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1698         (WebCore::GraphicsLayer::supportsContentsTiling):
1699         (WebCore::CoordinatedGraphicsLayer::setShouldSupportContentsTiling): Deleted.
1700         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1701
1702 2015-05-05  Javier Fernandez  <jfernandez@igalia.com>
1703
1704         [CSS Box Alignment] Upgrade align-content parsing to CSS3 Box Alignment spec
1705         https://bugs.webkit.org/show_bug.cgi?id=144443
1706
1707         Reviewed by Darin Adler.
1708
1709         Upgrade the align-content property to the last CSS3 Box
1710         Alignment specification. As it uses a different enumeration for
1711         Positional and Distribution alignment, it implies some changes in
1712         the FlexibleBox implementation.
1713
1714         Test: css3/parse-align-content.html
1715
1716         * css/CSSComputedStyleDeclaration.cpp:
1717         (WebCore::resolveContentAlignmentAuto):
1718         (WebCore::ComputedStyleExtractor::propertyValue):
1719         * css/CSSParser.cpp:
1720         (WebCore::isValidKeywordPropertyAndValue):
1721         (WebCore::isKeywordPropertyID):
1722         (WebCore::CSSParser::parseValue):
1723         * css/CSSPropertyNames.in:
1724         * rendering/RenderFlexibleBox.cpp:
1725         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
1726         (WebCore::RenderFlexibleBox::layoutColumnReverse):
1727         (WebCore::initialAlignContentOffset):
1728         (WebCore::alignContentSpaceBetweenChildren):
1729         (WebCore::RenderFlexibleBox::alignFlexLines):
1730         * rendering/style/RenderStyle.cpp:
1731         (WebCore::RenderStyle::resolveContentAlignment):
1732         (WebCore::RenderStyle::resolveContentJustification):
1733         * rendering/style/RenderStyle.h:
1734         * rendering/style/StyleRareNonInheritedData.cpp:
1735         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1736         (WebCore::StyleRareNonInheritedData::operator==):
1737         * rendering/style/StyleRareNonInheritedData.h:
1738
1739 2015-05-05  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
1740
1741         streams/readable-stream.html is very flaky
1742         https://bugs.webkit.org/show_bug.cgi?id=144455
1743
1744         Reviewed by Darin Adler.
1745
1746         Changed the link between readadable stream and controller.
1747         Controller ref()/deref() now increments/decrements its stream ref counter.
1748         This ensures that even if JS scripts do not keep track of the readable stream,
1749         the readable stream will not be disposed as long as the JS script has access to its controller.
1750
1751         Test: streams/readable-stream-gc.html
1752
1753         * Modules/streams/ReadableStreamController.h:
1754         (WebCore::ReadableStreamController::ReadableStreamController):
1755         (WebCore::ReadableStreamController::ref):
1756         (WebCore::ReadableStreamController::deref):
1757         (WebCore::ReadableStreamController::create): Deleted.
1758         (WebCore::ReadableStreamController::stream): Deleted.
1759         * bindings/js/JSReadableStreamControllerCustom.cpp:
1760         (WebCore::JSReadableStreamController::close):
1761         (WebCore::JSReadableStreamController::enqueue):
1762         (WebCore::JSReadableStreamController::error):
1763         * bindings/js/ReadableStreamJSSource.cpp:
1764         (WebCore::ReadableStreamJSSource::~ReadableStreamJSSource):
1765         (WebCore::ReadableStreamJSSource::start):
1766         (WebCore::ReadableJSStream::jsController):
1767         * bindings/js/ReadableStreamJSSource.h:
1768
1769 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
1770
1771         Small cleanup in RenderText::computePreferredLogicalWidths()
1772         https://bugs.webkit.org/show_bug.cgi?id=144615
1773
1774         Reviewed by Simon Fraser.
1775
1776         A little bit of cleanup before I tackle dependent widths in this function.
1777
1778         No new tests because there is no behavior change.
1779
1780         * rendering/RenderText.cpp:
1781         (WebCore::RenderText::computePreferredLogicalWidths):
1782
1783 2015-05-05  Joanmarie Diggs  <jdiggs@igalia.com>
1784
1785         [ATK] AX: figure out platform difference for ATK to make accessibility/table-cell-display-block.html work
1786         https://bugs.webkit.org/show_bug.cgi?id=143083
1787
1788         Reviewed by Chris Fleizach.
1789
1790         The main platform difference was that ATK was mapping the td element to
1791         the accessible table cell, and the render block resulting from the style
1792         wound up being the cell parent. In contrast, AX API was mapping the cell
1793         element to an AXGroup which was a child of the AXCell. Rather than try to
1794         bend yet another case to the will of our individual platforms' table needs,
1795         it made more sense to clean up the code that is competing and move toward
1796         more platform-unified handling. This is the first step in that direction,
1797         with ATK moving closer toward the WebCore/AX API mapping.
1798
1799         No new tests. Instead, modified and fixed the test which was being skipped
1800         for GTK, and also updated the expectations of some Mac tests whose FIXMEs
1801         should now be fixed.
1802
1803         * accessibility/AccessibilityNodeObject.cpp:
1804         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute):
1805         * accessibility/AccessibilityRenderObject.cpp:
1806         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1807         * accessibility/AccessibilityTable.cpp:
1808         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
1809         * accessibility/AccessibilityTableCell.cpp:
1810         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
1811         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1812         (createAccessibilityRoleMap):
1813
1814 2015-05-04  Jer Noble  <jer.noble@apple.com>
1815
1816         [iOS] Videos on apple.com flash when touching to show or hide the controls
1817         https://bugs.webkit.org/show_bug.cgi?id=144598
1818
1819         Reviewed by Eric Carlson.
1820
1821         The apple.com site will add a "selection" rectangle atop a playing video when it recieves a touchstart
1822         event. The default media controls use touchstart to signal the controls to become visible. Stop the touch
1823         from propagating down to the page in this case.
1824
1825         * Modules/mediacontrols/mediaControlsiOS.js:
1826         (ControllerIOS.prototype.handleWrapperTouchStart):
1827
1828 2015-05-04  Andreas Kling  <akling@apple.com>
1829
1830         Record the reference time when Performance is constructed.
1831         <https://webkit.org/b/144616>
1832
1833         Reviewed by Geoffrey Garen.
1834
1835         This is a merge of Blink's r156613 by simonjam@chromium.org.
1836
1837         Cache a copy of the DocumentLoader's reference timestamp when constructing
1838         the Performance object. That way we don't have to jump through a bunch of scary
1839         hoops to access it when now() is called later on.
1840
1841         * page/Performance.cpp:
1842         (WebCore::Performance::Performance):
1843         (WebCore::Performance::now): Deleted.
1844         * page/Performance.h:
1845
1846 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
1847
1848         Fix assertions in WK1 tests after r183777.
1849         
1850         Two issues with the original change:
1851         
1852         If not in compositing mode, we shouldn't schedule layer flushes, since
1853         Document::documentWillSuspendForPageCache() only only calls cancelCompositingLayerUpdate()
1854         if in compositing mode.
1855         
1856         Second, RenderLayerCompositor::rootBackgroundTransparencyChanged() never stored the
1857         new color, resulting in too many triggered compositing updates.
1858
1859         * rendering/RenderLayerCompositor.cpp:
1860         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
1861
1862 2015-05-04  Zalan Bujtas  <zalan@apple.com>
1863
1864         RenderWidget::setWidgetGeometry() can end up destroying *this*.
1865         https://bugs.webkit.org/show_bug.cgi?id=144601
1866
1867         Reviewed by Andreas Kling.
1868
1869         This is a speculative fix to ensure we don't crash on an invalid *this* renderer
1870         while flattening the current iframe.
1871         Calling RenderWidget::setWidgetGeometry() can result in destroying the current renderer.
1872         While it is not a issue in case of normal layout flow as widget positions are updated at post layout,
1873         frame flattening initiates this action in the middle of layout.
1874         This patch re-introduces refcount model for RenderWidgets so that the renderer is protected during layout
1875         when frame flattening is in use.
1876
1877         * rendering/RenderFrameBase.cpp:
1878         (WebCore::RenderFrameBase::layoutWithFlattening): Let's be paranoid about child view.
1879         * rendering/RenderObject.cpp:
1880         (WebCore::RenderObject::destroy):
1881         * rendering/FrameView.cpp:
1882         (WebCore::FrameView::layout):
1883         * rendering/RenderView.h:
1884         * rendering/RenderWidget.cpp:
1885         (WebCore::RenderWidget::~RenderWidget):
1886         * rendering/RenderWidget.h:
1887         (WebCore::RenderWidget::ref):
1888         (WebCore::RenderWidget::deref):
1889
1890 2015-05-04  Doug Russell  <d_russell@apple.com>
1891
1892         AX: setting focus via accessibility object needs to set isSynchronizing in resulting selection intent
1893         https://bugs.webkit.org/show_bug.cgi?id=144489
1894
1895         Reviewed by Chris Fleizach.
1896
1897         Resolves infinite looping when navigating rapidly between controls with the search API and then focusing
1898         on the returned control.
1899         Remove isSynchronizing flag from AXTextStateChangeIntent and put it on AXObjectCache.
1900         Move AXTextStateChangeIntent logic in AccessibilityRenderObject into a helper method.
1901         Call new AXTextStateChangeIntent helper from AccessibilityRenderObject::setFocus().
1902         Add support for setSelectedVisibleTextRange() in accessibility tests.
1903
1904         Test: platform/mac/accessibility/selection-sync.html
1905
1906         * accessibility/AXObjectCache.cpp:
1907         (WebCore::AXObjectCache::showIntent):
1908         (WebCore::AXObjectCache::setTextSelectionIntent):
1909         (WebCore::AXObjectCache::setIsSynchronizingSelection):
1910         (WebCore::AXObjectCache::postTextStateChangeNotification):
1911         * accessibility/AXObjectCache.h:
1912         * accessibility/AXTextStateChangeIntent.h:
1913         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
1914         * accessibility/AccessibilityRenderObject.cpp:
1915         (WebCore::setTextSelectionIntent):
1916         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1917         (WebCore::AccessibilityRenderObject::setFocused):
1918         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1919         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange): Deleted.
1920         * accessibility/mac/AXObjectCacheMac.mm:
1921         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1922
1923 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
1924
1925         [Mac] Audio-only files should not have a device picker
1926         https://bugs.webkit.org/show_bug.cgi?id=144606
1927         <rdar://problem/20806387>
1928
1929         Reviewed by Dean Jackson.
1930
1931         * Modules/mediacontrols/mediaControlsApple.js:
1932         (Controller.prototype.hasVideo): New.
1933         (Controller.prototype.updateFullscreenButtons): Use hasVideo.
1934         (Controller.prototype.updateHasVideo): Ditto.
1935         (Controller.prototype.updateWirelessTargetAvailable): Don't show the target picker button
1936         unless a file has video.
1937
1938 2015-05-04  Chris Dumez  <cdumez@apple.com>
1939
1940         Crash at com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::createWindow + 185
1941         https://bugs.webkit.org/show_bug.cgi?id=144597
1942         <rdar://problem/20361579>
1943
1944         Reviewed by Andreas Kling.
1945
1946         Test: fast/dom/Window/window-open-activeWindow-null-frame.html
1947
1948         In our implementation of window.open(), we make sure that the window
1949         which window.open() is called has a frame. However, we did not have the
1950         same check for the activeDOMWindow (i.e. the lexicalGlobalObject) causing
1951         us to crash in WebCore::createWindow() when dereferencing it.
1952
1953         This patch updates WebCore::createWindow() takes a reference to the
1954         openerFrame instead of a pointer to make it clear the implementation
1955         expects it to be non-null. A null check is then added for the frame
1956         at the call site: DOMWindow::createWindow().
1957
1958         * inspector/InspectorFrontendClientLocal.cpp:
1959         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1960         * loader/FrameLoader.cpp:
1961         (WebCore::isDocumentSandboxed):
1962         (WebCore::FrameLoader::submitForm):
1963         (WebCore::createWindow):
1964         Take a reference to openerFrame instead of a pointer as the
1965         implementation expects it to be non-null.
1966
1967         * loader/FrameLoader.h:
1968         * page/DOMWindow.cpp:
1969         (WebCore::DOMWindow::createWindow):
1970         Add null check for activeFrame before passing it to
1971         WebCore::createWindow().
1972
1973 2015-05-04  Dean Jackson  <dino@apple.com>
1974
1975         Create a named CSS property for system colors
1976         https://bugs.webkit.org/show_bug.cgi?id=144423
1977
1978         Follow-up comments from Darin Adler.
1979
1980         * rendering/RenderThemeIOS.h: Cache a Color rather than an RGBA32.
1981         * rendering/RenderThemeIOS.mm:
1982         (WebCore::RenderThemeIOS::systemColor): Use "add" to avoid multiple hits on the HashMap, and
1983         cache invalid responses so that we don't have to keep looking for non-existent colors.
1984         * rendering/RenderThemeMac.h: Same as iOS.
1985         * rendering/RenderThemeMac.mm:
1986         (WebCore::RenderThemeMac::systemColor):
1987
1988 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
1989
1990         display:none iframes cause repeated compositing flushing
1991         https://bugs.webkit.org/show_bug.cgi?id=144529
1992
1993         Reviewed by Darin Adler.
1994         
1995         FrameView::updateLayoutAndStyleIfNeededRecursive() only forces layout on rendered
1996         frames, by virtue of using its Widget children which are FrameViews.
1997         
1998         However, FrameView::flushCompositingStateIncludingSubframes() iterated over
1999         all frames, and return false if any subframe needed layout. Thus, if it saw
2000         non-rendered frames (which are never laid out), it would return false,
2001         which causes the CFRunLoopObserver that drives flushing to run again.
2002         
2003         Fix by having FrameView::flushCompositingStateIncludingSubframes() only check
2004         rendered frames, using FrameTree::traverseNextRendered() (which needs to be public).
2005         
2006         Also change FrameView::needsStyleRecalcOrLayout() and FrameView::updateLayoutAndStyleIfNeededRecursive()
2007         to fetch the list of FrameViews using FrameTree's nextRenderedSibling(), rather than using
2008         the Widget tree, since we'd like to eventually remove Widgets, and using the Frame
2009         tree matches flushCompositingStateIncludingSubframes() and other code.
2010
2011         Test: compositing/iframes/display-none-subframe.html
2012
2013         * page/FrameTree.h:
2014         * page/FrameView.cpp:
2015         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
2016         (WebCore::FrameView::needsStyleRecalcOrLayout):
2017         (WebCore::FrameView::renderedChildFrameViews): Helper that returns a vector
2018         of Ref<FrameView>s for rendered frames only.
2019         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2020         * page/FrameView.h:
2021
2022 2015-05-04  Chris Dumez  <cdumez@apple.com>
2023
2024         Unreviewed. Fix build with SECURITY_ASSERTIONS enabled.
2025         <rdar://problem/20653104>
2026
2027         * dom/ScriptExecutionContext.cpp:
2028         (WebCore::ScriptExecutionContext::ScriptExecutionContext):
2029         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache):
2030         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2031         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2032         * dom/ScriptExecutionContext.h:
2033
2034 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
2035
2036         Fix updating of tiled backing opaquenss when the page background color changes
2037         https://bugs.webkit.org/show_bug.cgi?id=144600
2038         rdar://problem/20723035
2039
2040         Reviewed by Tim Horton.
2041
2042         RenderLayerCompositor makes the page tiles opaque or not based on the result of
2043         viewHasTransparentBackground(), which consults the view transparency, and
2044         FrameView::documentBackgroundColor(). documentBackgroundColor() in turn is based
2045         on the root and/or body background colors.
2046
2047         We thus need to re-evaluate whether page tiles are opaque when any of these inputs
2048         change, but were failing to do so for the FrameView's baseBackgroundColor, and
2049         the page root background color.
2050         
2051         Fix by having FrameView::setBaseBackgroundColor(), and RenderBox::styleDidChange()
2052         (for the root) trigger a compositing update when necessary.
2053
2054         Added setViewBaseBackgroundColor() on Internals for testing.
2055
2056         Test: platform/mac-wk2/tiled-drawing/background-transparency-toggle.html
2057
2058         * page/FrameView.cpp:
2059         (WebCore::FrameView::setTransparent): Use the isViewForDocumentInFrame() helper.
2060         (WebCore::FrameView::setBaseBackgroundColor): Bail if we're not the view for the 
2061         frame's document, and trigger a compositing update check if the alpha changed.
2062         (WebCore::FrameView::isViewForDocumentInFrame): Helper that checks to see if
2063         this FrameView is associated with the Document being displayed in the FrameView's
2064         Frame. This returns false when we're setting up a new FrameView (its Frame still
2065         points to the old document, so renderView() returns the RenderView for the Frame's
2066         existing Document).
2067         * page/FrameView.h:
2068         * rendering/RenderBox.cpp:
2069         (WebCore::RenderBox::styleDidChange): Have the compositor check to see if it needs
2070         to do an update.
2071         * rendering/RenderLayerCompositor.cpp:
2072         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): If the result
2073         of documentBackgroundColor() changed in alpha since the last time, trigger a compositing
2074         update.
2075         * rendering/RenderLayerCompositor.h:
2076         * testing/Internals.cpp:
2077         (WebCore::Internals::setViewBaseBackgroundColor):
2078         * testing/Internals.h:
2079         * testing/Internals.idl:
2080
2081 2015-05-04  Jer Noble  <jer.noble@apple.com>
2082
2083         [iOS] Crash in -[WebCALayerHostWrapper resolveBounds]
2084         https://bugs.webkit.org/show_bug.cgi?id=144595
2085
2086         Reviewed by Eric Carlson.
2087
2088         It is possible for a WebCALayorHostWrapper to outlive the WebVideoFullscreenModel to which it refers,
2089         since the model pointer is bare, rather than a RefPtr. The reference to the model must be invalidated
2090         before the model is destroyed.
2091
2092         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2093         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
2094
2095 2015-05-04  Ryosuke Niwa  <rniwa@webkit.org>
2096
2097         Toggling underline or strike through affects each other
2098         https://bugs.webkit.org/show_bug.cgi?id=27818
2099
2100         Reviewed by Darin Adler.
2101
2102         This patch introduces a new mechanism to apply and remove text decorations. This is necessary because text
2103         decorations are always additive and we can't differentiate whether we're adding or removing a text decoration.
2104         Conceptually, we need four values for text decorations: adding underline, removing underline, adding
2105         line-through, and removing line-through but we have only three: underline, line-through, none.
2106
2107         After this patch, there are three mechanism by which text decorations states are kept tracked. While applying
2108         or removing text decorations, we use newly added m_underlineChange and m_strikeThroughChange in EditingStyle.
2109         For the typing style, we use -webkit-text-decorations-in-effect to store the state since we need to preserve
2110         every type of text decorations such as overline in addition to underline and line-through. Once applied, all
2111         text decorations should be expressed in terms of the standard text-decoration property.
2112
2113         Test: editing/execCommand/toggle-mixed-text-decorations.html
2114
2115         * editing/ApplyStyleCommand.cpp:
2116         (WebCore::ApplyStyleCommand::applyBlockStyle):
2117         (WebCore::ApplyStyleCommand::removeCSSStyle): conflictsWithInlineStyleOfElement now creates a new inline style
2118         instead of a list of properties to remove.
2119         (WebCore::ApplyStyleCommand::addBlockStyle):
2120         (WebCore::ApplyStyleCommand::applyInlineStyleChange): Merge inline styles instead of adding as string.
2121         Otherwise it would generate style content attribute with multiple text-decoration properties.
2122
2123         * editing/EditingStyle.cpp:
2124         (WebCore::HTMLElementEquivalent::matches):
2125         (WebCore::HTMLElementEquivalent::propertyExistsInStyle): Takes an EditingStyle instead of StyleProperties.
2126         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
2127         (WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent): 
2128         (WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle): Respect newly added m_strikeThroughChange and
2129         m_underlineChange in EditingStyle.
2130         (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle): Ditto.
2131         (WebCore::HTMLTextDecorationEquivalent::changeInStyle): Added. Retrieves the change enum for the associated
2132         type of text-decoration (underline or strike through).
2133         (WebCore::HTMLAttributeEquivalent::matches):
2134         (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
2135         (WebCore::EditingStyle::EditingStyle): Initialize m_underlineChange and m_strikeThroughChange. Also use the
2136         delegating constructor elsewhere. Also added the missing call to extractFontSizeDelta() in the variant that
2137         takes CSSPropertyID and String, and added a variant that takes CSSPropertyID and CSSValueID.
2138         (WebCore::EditingStyle::isEmpty): Return false when m_underlineChange and m_strikeThroughChange are not "none".
2139         (WebCore::applyTextDecorationChangeToValueList): Added.
2140         (WebCore::EditingStyle::overrideTypingStyleAt): Added. Used by Editor::computeAndSetTypingStyle to set a new
2141         typing style. Resolve m_underlineChange and m_strikeThroughChange into -webkit-text-decorations-in-effect.
2142         (WebCore::EditingStyle::clear): Clear m_underlineChange and m_strikeThroughChange.
2143         (WebCore::EditingStyle::copy): Copy m_underlineChange and m_strikeThroughChange.
2144         (WebCore::textDecorationValueList): Added.
2145         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Now takes a pointer to MutableStyleProperties
2146         instead of a vector. This was necessary we can't simply remove text-decoration property in ApplyStyleCommand's
2147         removeCSSStyle as that would result in unrelated text decorations also getting removed. Also added the code
2148         for m_underlineChange and m_strikeThroughChange. Only removing text decoration changes can cause a conflict
2149         since text decorations are always additive.
2150         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Check isEmpty() instead of the nullity of
2151         m_mutableStyle to respect m_underlineChange and m_strikeThroughChange.
2152         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes):
2153         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes):
2154         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode): Respect the values of m_underlineChange and
2155         m_strikeThroughChange. Here, the style is considered present if it has text decorations that are being added.
2156         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
2157         (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Takes EditingStyle instead of StyleProperties to
2158         respect m_underlineChange and m_strikeThroughChange.
2159         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
2160         (WebCore::mergeTextDecorationValues):
2161         (WebCore::EditingStyle::mergeStyle): Make a copy of CSSValueList before modifying it since CSSValueList's are
2162         shared with other immutable StyleProperties.
2163         (WebCore::StyleChange::StyleChange): Set m_applyUnderline, m_applyLineThrough, and m_cssStyle if either
2164         m_underlineChange or m_strikeThroughChange are TextDecorationChange::Add in EditingStyle if the current position
2165         doesn't already have the matching style.
2166         (WebCore::StyleChange::operator==): Moved from the header file. Also added the logic to compare m_cssStyle now
2167         that it's a StyleProperties instead of String.
2168
2169         * editing/EditingStyle.h: Added TextDecorationChange.
2170         (WebCore::EditingStyle::create): Added a variant that takes CSSPropertyID and CSSValueID.
2171         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
2172         (WebCore::EditingStyle::setUnderlineChange): Added.
2173         (WebCore::EditingStyle::underlineChange): Added.
2174         (WebCore::EditingStyle::setStrikeThroughChange): Added.
2175         (WebCore::EditingStyle::strikeThroughChange): Added.
2176         (WebCore::StyleChange::cssStyle): Now returns StyleProperties* instead of String so that ApplyStyleCommand's
2177         applyInlineStyleChange could merge inline styles instead of just appending it to the end.
2178         (WebCore::StyleChange::operator==): Moved into the cpp file.
2179
2180         * editing/Editor.cpp:
2181         (WebCore::Editor::applyStyle): Added. This variant takes EditingStyle instead of StyleProperties.
2182         (WebCore::Editor::applyStyleToSelection): Ditto.
2183         (WebCore::Editor::computeAndSetTypingStyle): Added a variant for EditingStyle. Also use overrideTypingStyleAt
2184         to set -webkit-text-decorations-in-effect based on m_underlineChange and m_strikeThroughChange 
2185
2186         * editing/Editor.h:
2187         * editing/EditorCommand.cpp:
2188         (WebCore::applyCommandToFrame):
2189         (WebCore::isStylePresent): Extracted from executeToggleStyle.
2190         (WebCore::executeApplyStyle):
2191         (WebCore::executeToggleStyle):
2192         (WebCore::executeToggleStyleInList): Deleted.
2193         (WebCore::textDecorationChangeForToggling): Added. Used in executeStrikethrough and executeUnderline.
2194         (WebCore::executeStrikethrough):
2195         (WebCore::executeUnderline):
2196
2197 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
2198
2199         [Mac] Fix build breakage caused by API deprecation
2200         https://bugs.webkit.org/show_bug.cgi?id=144593
2201
2202         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2203         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Suppress warnings.
2204
2205 2015-05-04  Chris Dumez  <cdumez@apple.com>
2206
2207         REGRESSION (r178156): CSS Parser incorrectly rejects valid calc() in padding-right property
2208         https://bugs.webkit.org/show_bug.cgi?id=144584
2209         <rdar://problem/20796829>
2210
2211         Reviewed by Darin Adler.
2212
2213         The CSS parser was rejecting calculated values at parsing time if it
2214         considered the value was negative and the CSS property did not allow
2215         negative values. However, doing so at this point will not always work
2216         because we don't necessarily know the font-size yet (for e.g. for
2217         calc(0.5em - 2px). Also, rejecting negative calculated values is not
2218         the right behavior as the the specification. The specification says
2219         we should clamp:
2220         http://dev.w3.org/csswg/css-values-3/#calc-range
2221
2222         This patch updates validateCalculationUnit() to stop marking the value
2223         as invalid if it is negative. Instead, let the CSSCalcValue's permitted
2224         range clamp the value as needed.
2225
2226         This bug was causing the bottom graphic on aldentrio.com to not be
2227         rendered properly.
2228
2229         Test: fast/css/negative-calc-values.html
2230               fast/css/padding-calc-value.html
2231
2232         * css/CSSParser.cpp:
2233         (WebCore::CSSParser::validateCalculationUnit):
2234
2235 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
2236
2237         [Mac] Show wireless playback placard even when an element has custom controls
2238         https://bugs.webkit.org/show_bug.cgi?id=144548
2239
2240         Reviewed by Brent Fulgham.
2241
2242         * Modules/mediacontrols/mediaControlsApple.js:
2243         (Controller.prototype.shouldHaveAnyUI): Return true when playing to wireless target.
2244         (Controller.prototype.reconnectControls): Add controls when playing to wireless target.
2245         (Controller.prototype.setPlaying): Return early when there is no 'controls' attribute.
2246         (Controller.prototype.showControls): Ditto.
2247         (Controller.prototype.updateWirelessPlaybackStatus): Call updateBase when playing to wireless
2248         target to ensure that controls have been set up.
2249         (Controller.prototype.handleWirelessPlaybackChange): Call reconnectControls when playing
2250         to wireless target when there is no 'controls' attribute.
2251         (Controller.prototype.showInlinePlaybackPlaceholderOnly): New.
2252
2253         * html/HTMLMediaElement.cpp:
2254         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Call configureMediaControls.
2255         (WebCore::HTMLMediaElement::configureMediaControls): Require controls when playing
2256         to wireless target.
2257         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Remove some unhelpful, noisy, logging.
2258
2259 2015-05-04  Dan Bernstein  <mitz@apple.com>
2260
2261         Fixed the build.
2262
2263         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2264         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Moved off of a deprecated
2265         method to a non-deprecated equivalent.
2266
2267 2015-05-04  Javier Fernandez  <jfernandez@igalia.com>
2268
2269         [CSS Box Alignment] Upgrade justify-content parsing to CSS3 Box Alignment spec.
2270         https://bugs.webkit.org/show_bug.cgi?id=144442
2271
2272         Reviewed by David Hyatt.
2273
2274         Upgrade the justify-content property to the last CSS3 Box
2275         Alignment specification. It defines a different enumeration for
2276         Positional and Distribution alignment, which requires changes in
2277         the FlexibleBox implementation.
2278
2279         A new parsing function has been implemented to replace the basic
2280         keyword IDs validation. Because of the complexity of the new
2281         values, a new CSSPrimitiveValue derived class has been defined
2282         which simplifies considerably the parsing logic.
2283
2284         We will follow the same approach than for Self Alignment, defining
2285         a single class to hold all the related alignment data. This makes
2286         possible to use a StyleBuilderConverter function instead of custom
2287         builder functions for these properties.
2288
2289         Test: css3/parse-justify-content.html
2290
2291         * CMakeLists.txt:
2292         * WebCore.xcodeproj/project.pbxproj:
2293         * css/CSSComputedStyleDeclaration.cpp:
2294         (WebCore::resolveContentAlignmentAuto):
2295         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
2296         (WebCore::ComputedStyleExtractor::propertyValue):
2297         (WebCore::valueForItemPositionWithOverflowAlignment): Deleted.
2298         * css/CSSContentDistributionValue.cpp: Added.
2299         (WebCore::CSSContentDistributionValue::CSSContentDistributionValue):
2300         (WebCore::CSSContentDistributionValue::~CSSContentDistributionValue):
2301         (WebCore::CSSContentDistributionValue::customCSSText):
2302         (WebCore::CSSContentDistributionValue::equals):
2303         * css/CSSContentDistributionValue.h: Added.
2304         (WebCore::CSSContentDistributionValue::create):
2305         (WebCore::CSSContentDistributionValue::distribution):
2306         (WebCore::CSSContentDistributionValue::position):
2307         (WebCore::CSSContentDistributionValue::overflow):
2308         * css/CSSParser.cpp:
2309         (WebCore::isValidKeywordPropertyAndValue):
2310         (WebCore::isKeywordPropertyID):
2311         (WebCore::CSSParser::parseValue):
2312         (WebCore::isContentDistributionKeyword):
2313         (WebCore::isContentPositionKeyword):
2314         (WebCore::isAlignmentOverflowKeyword):
2315         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
2316         (WebCore::CSSParser::parseItemPositionOverflowPosition):
2317         (WebCore::CSSParser::parseLegacyPosition): Deleted.
2318         * css/CSSParser.h:
2319         * css/CSSPrimitiveValueMappings.h:
2320         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2321         (WebCore::CSSPrimitiveValue::operator ContentPosition):
2322         (WebCore::CSSPrimitiveValue::operator ContentDistributionType):
2323         (WebCore::CSSPrimitiveValue::operator EFlexDirection): Deleted.
2324         * css/CSSPropertyNames.in:
2325         * css/CSSValue.cpp:
2326         (WebCore::CSSValue::equals):
2327         (WebCore::CSSValue::cssText):
2328         (WebCore::CSSValue::destroy):
2329         * css/CSSValue.h:
2330         (WebCore::CSSValue::isContentDistributionValue):
2331         (WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
2332         * css/CSSValueKeywords.in:
2333         * css/StyleBuilderConverter.h:
2334         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
2335         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData): Deleted.
2336         * rendering/RenderFlexibleBox.cpp:
2337         (WebCore::initialJustifyContentOffset):
2338         (WebCore::justifyContentSpaceBetweenChildren):
2339         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2340         (WebCore::RenderFlexibleBox::layoutColumnReverse):
2341         * rendering/RenderFullScreen.cpp:
2342         (WebCore::createFullScreenStyle):
2343         * rendering/mathml/RenderMathMLScripts.cpp:
2344         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
2345         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
2346         * rendering/style/RenderStyle.h:
2347         * rendering/style/RenderStyleConstants.h:
2348         * rendering/style/StyleContentAlignmentData.h: Added.
2349         (WebCore::StyleContentAlignmentData::StyleContentAlignmentData):
2350         (WebCore::StyleContentAlignmentData::setPosition):
2351         (WebCore::StyleContentAlignmentData::setDistribution):
2352         (WebCore::StyleContentAlignmentData::setOverflow):
2353         (WebCore::StyleContentAlignmentData::position):
2354         (WebCore::StyleContentAlignmentData::distribution):
2355         (WebCore::StyleContentAlignmentData::overflow):
2356         (WebCore::StyleContentAlignmentData::operator==):
2357         (WebCore::StyleContentAlignmentData::operator!=):
2358         * rendering/style/StyleRareNonInheritedData.cpp:
2359         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2360         (WebCore::StyleRareNonInheritedData::operator==):
2361         * rendering/style/StyleRareNonInheritedData.h:
2362
2363 2015-05-04  Per Arne Vollan  <peavo@outlook.com>
2364
2365         [WinCairo] Compile error in sharedEGLDisplay() method.
2366         https://bugs.webkit.org/show_bug.cgi?id=144563
2367
2368         Reviewed by Alex Christensen.
2369
2370         The PlatformDisplay type is undefined.
2371
2372         * platform/graphics/egl/GLContextEGL.cpp:
2373         (WebCore::sharedEGLDisplay):
2374
2375 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
2376
2377         [WTF] Remove Functional.h inclusions
2378         https://bugs.webkit.org/show_bug.cgi?id=144400
2379
2380         Reviewed by Darin Adler.
2381
2382         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebCore.
2383
2384         * Modules/mediastream/MediaStreamTrack.cpp:
2385         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
2386         * Modules/mediastream/UserMediaRequest.cpp:
2387         * page/scrolling/ScrollingTree.h:
2388         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
2389         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2390         * platform/MemoryPressureHandler.cpp:
2391         * platform/UserActivity.h: Include the <objc/objc.h> header that was previously
2392         indirectly included through Functional.h.
2393         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2394         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2395         * platform/mac/SoftLinking.h: Unconditionally include the <objc/runtime.h> header
2396         that was previously included for the Mac port through Functional.h.
2397
2398 2015-05-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
2399
2400         [Streams API] Refactor ReadableJSStream and ReadableStreamJSSource
2401         https://bugs.webkit.org/show_bug.cgi?id=144387
2402
2403         Reviewed by Darin Adler.
2404
2405         Made ReadableStreamReader a private class of ReadableJSStream.
2406         Simplified ReadableJSStream construction so that binding constructor does not need to know about ReadableStreamJSSource. 
2407
2408         No functional change, existing tests cover the changes.
2409
2410         * Modules/streams/ReadableStream.h:
2411         (WebCore::ReadableStream::source): Added to implement jsSource(), needed by ReadableJSStream.
2412         * bindings/js/JSReadableStreamCustom.cpp:
2413         (WebCore::constructJSReadableStream): Simplified to not have to handle source creation.
2414         * bindings/js/ReadableStreamJSSource.cpp:
2415         (WebCore::ReadableStreamJSSource::globalObject): Helper function to be used in other future methods.
2416         (WebCore::ReadableStreamJSSource::start):
2417         (WebCore::ReadableJSStream::create):
2418         (WebCore::ReadableJSStream::createReader):
2419         (WebCore::ReadableJSStream::jsSource):
2420         (WebCore::ReadableJSStream::Reader::create):
2421         (WebCore::ReadableJSStream::Reader::Reader):
2422         * bindings/js/ReadableStreamJSSource.h:
2423
2424 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
2425
2426         Remove move-js-headers.sh
2427         https://bugs.webkit.org/show_bug.cgi?id=144323
2428
2429         Reviewed by Daniel Bates.
2430
2431         move-js-headers.sh was only used by the Wx port, which has been removed from trunk long ago.
2432
2433         * move-js-headers.sh: Removed.
2434
2435 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
2436
2437         [ARM] Don't compare unsigned chars to EOF (-1)
2438         https://bugs.webkit.org/show_bug.cgi?id=144439
2439
2440         Reviewed by Geoffrey Garen.
2441
2442         * platform/linux/MemoryPressureHandlerLinux.cpp:
2443         (WebKit::nextToken): Don't cast return value of fgetc() to char.
2444
2445 2015-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
2446
2447         [CSS Grid Layout] Wrong computed style for named grid lines in implicit tracks
2448         https://bugs.webkit.org/show_bug.cgi?id=144449
2449
2450         Reviewed by Sergio Villar Senin.
2451
2452         If there're implicit tracks then trackPositions is bigger than
2453         trackSizes, so we need to use the proper index to append the trailing
2454         <ident>s in valueForGridTrackList().
2455
2456         Test: fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
2457
2458         * css/CSSComputedStyleDeclaration.cpp:
2459         (WebCore::valueForGridTrackList):
2460
2461 2015-05-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2462
2463         Purge PassRefPtr in WebCore/html
2464         https://bugs.webkit.org/show_bug.cgi?id=144543
2465
2466         Reviewed by Andreas Kling.
2467
2468         Change PassRefPtr in create() factory functions with Ref. In some functions,
2469         it returns RefPtr when it might have a chance to return nullptr.
2470
2471         No new tests, no behavior changes.
2472
2473         * Modules/encryptedmedia/MediaKeySession.cpp:
2474         (WebCore::MediaKeySession::sendError):
2475         * html/DOMFormData.h:
2476         (WebCore::DOMFormData::create):
2477         * html/HTMLMediaElement.cpp:
2478         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
2479         * html/HTMLMediaElement.h:
2480         * html/MediaError.h:
2481         (WebCore::MediaError::create):
2482         * html/MediaKeyError.h:
2483         (WebCore::MediaKeyError::create):
2484         * html/canvas/CanvasGradient.h:
2485         * html/canvas/CanvasProxy.cpp:
2486         (WebCore::CanvasProxy::create):
2487         * html/canvas/CanvasProxy.h:
2488         * html/canvas/WebGLActiveInfo.h:
2489         (WebCore::WebGLActiveInfo::create):
2490         * html/canvas/WebGLContextAttributes.h:
2491         * html/canvas/WebGLContextGroup.h:
2492         * html/canvas/WebGLProgram.h:
2493         * html/canvas/WebGLQuery.h:
2494         * html/canvas/WebGLRenderbuffer.h:
2495         * html/canvas/WebGLSampler.h:
2496         * html/canvas/WebGLShader.h:
2497         * html/canvas/WebGLShaderPrecisionFormat.h:
2498         * html/canvas/WebGLSync.h:
2499         * html/canvas/WebGLTexture.h:
2500         * html/canvas/WebGLTransformFeedback.h:
2501         * html/canvas/WebGLUniformLocation.h:
2502         * html/canvas/WebGLVertexArrayObjectOES.h:
2503         * html/shadow/ImageControlsRootElement.cpp:
2504         (WebCore::ImageControlsRootElement::maybeCreate):
2505         * html/shadow/ImageControlsRootElement.h:
2506         * html/shadow/MediaControlElements.cpp:
2507         (WebCore::MediaControlPanelElement::create):
2508         (WebCore::MediaControlPanelEnclosureElement::create):
2509         (WebCore::MediaControlOverlayEnclosureElement::create):
2510         (WebCore::MediaControlTimelineContainerElement::create):
2511         (WebCore::MediaControlVolumeSliderContainerElement::create):
2512         (WebCore::MediaControlStatusDisplayElement::create):
2513         (WebCore::MediaControlPanelMuteButtonElement::create):
2514         (WebCore::MediaControlVolumeSliderMuteButtonElement::create):
2515         (WebCore::MediaControlPlayButtonElement::create):
2516         (WebCore::MediaControlOverlayPlayButtonElement::create):
2517         (WebCore::MediaControlSeekForwardButtonElement::create):
2518         (WebCore::MediaControlSeekBackButtonElement::create):
2519         (WebCore::MediaControlRewindButtonElement::create):
2520         (WebCore::MediaControlReturnToRealtimeButtonElement::create):
2521         (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
2522         (WebCore::MediaControlClosedCaptionsContainerElement::create):
2523         (WebCore::MediaControlClosedCaptionsTrackListElement::create):
2524         (WebCore::MediaControlTimelineElement::create):
2525         (WebCore::MediaControlPanelVolumeSliderElement::create):
2526         (WebCore::MediaControlFullscreenVolumeSliderElement::create):
2527         (WebCore::MediaControlFullscreenButtonElement::create):
2528         (WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
2529         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
2530         (WebCore::MediaControlTimeRemainingDisplayElement::create):
2531         (WebCore::MediaControlCurrentTimeDisplayElement::create):
2532         * html/shadow/MediaControlElements.h:
2533         * html/shadow/MediaControlsApple.h:
2534         (WebCore::MediaControlsAppleEventListener::create):
2535         * html/shadow/MeterShadowElement.h:
2536         (WebCore::MeterInnerElement::create):
2537         (WebCore::MeterBarElement::create):
2538         (WebCore::MeterValueElement::create):
2539         * html/shadow/ProgressShadowElement.h:
2540         (WebCore::ProgressInnerElement::create):
2541         (WebCore::ProgressBarElement::create):
2542         (WebCore::ProgressValueElement::create):
2543         * html/shadow/mac/ImageControlsRootElementMac.cpp:
2544         (WebCore::ImageControlsRootElement::maybeCreate):
2545         * html/track/TextTrackCueList.h:
2546         (WebCore::TextTrackCueList::create):
2547         * html/track/VTTCue.cpp:
2548         (WebCore::VTTCue::create):
2549         * html/track/VTTCue.h:
2550         (WebCore::VTTCue::create):
2551         * html/track/VTTRegion.h:
2552         * html/track/VideoTrack.h:
2553         * html/track/VideoTrackList.h:
2554         * html/track/WebVTTElement.cpp:
2555         (WebCore::WebVTTElement::create):
2556         * html/track/WebVTTElement.h:
2557         * html/track/WebVTTParser.h:
2558         * platform/graphics/MediaPlayer.h:
2559         (WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
2560
2561 2015-05-03  Simon Fraser  <simon.fraser@apple.com>
2562
2563         Make some static data const
2564         https://bugs.webkit.org/show_bug.cgi?id=144552
2565
2566         Reviewed by Andreas Kling.
2567
2568         Turn baseTable and shiftTable into const data.
2569
2570         * platform/graphics/FormatConverter.cpp:
2571
2572 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
2573
2574         Assertion failure (!needsLayout()) loading inkedmag.com
2575         https://bugs.webkit.org/show_bug.cgi?id=144528
2576         rdar://problem/20788681
2577
2578         Reviewed by Darin Adler.
2579         
2580         When animated GIFs get into catch-up mode, which is common on inkedmag.com,
2581         BitmapImage::advanceAnimation() can synchronously call it's observer's
2582         animationAdvanced(). This could cause RenderImage::repaintOrMarkForLayout()
2583         to repaint or mark itself as needing layout in the middle of painting.
2584         If painting multiple tiles, this could occur when painting the first tile,
2585         and then painting the second tile would assert in RenderView::paint().
2586         
2587         It's always wrong to synchronously call the observer when advancing
2588         the animation, since this happens when painting, and you can't repaint
2589         when painting. The long comment and call to startAnimation(DoNotCatchUp)
2590         was required to explain and work around this, but it's simpler to just
2591         advance the animation on a zero-delay timer.
2592         
2593         Special handling is required for the case where internalAdvanceAnimation()
2594         is catching up, and reaches the end of a non-repeating image; there, we
2595         have to set a flag and do the notify on a zero-delay timer.
2596         
2597         Lots of comment cleanup.
2598
2599         Test: fast/images/set-needs-layout-in-painting.html
2600
2601         * platform/graphics/BitmapImage.cpp:
2602         (WebCore::BitmapImage::BitmapImage):
2603         (WebCore::BitmapImage::startTimer): Utility to create and start the timer.
2604         (WebCore::BitmapImage::repetitionCount):
2605         (WebCore::BitmapImage::startAnimation): Early return in the DoNotCatchUp clause.
2606         If skipping, and internalAdvanceAnimation() returns false (meaning it must have
2607         reached the end), then queue up a notify. Change the normal behavior to just
2608         start the timer.
2609         (WebCore::BitmapImage::stopAnimation):
2610         (WebCore::BitmapImage::internalAdvanceAnimation): Notify if the flag is set.
2611         * platform/graphics/BitmapImage.h:
2612         * rendering/RenderReplaced.cpp:
2613         (WebCore::RenderReplaced::paint): Add a SetLayoutNeededForbiddenScope to
2614         detect setNeedsLayouts when painting replaced elements, including images.
2615
2616 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2617
2618         [GTK][EFL] Unify platform display handling
2619         https://bugs.webkit.org/show_bug.cgi?id=144517
2620
2621         Reviewed by Martin Robinson.
2622
2623         There are several places were we are handling the X display
2624         connection:
2625
2626         - GLContext::sharedX11Display() creates a new connection.
2627         - X11Helper::nativeDisplay() creates a new connection.
2628         - BackingStoreBackendCairoX11 uses the GTK+ shared connection.
2629         - NetscapePlugin::x11HostDisplay() uses the GTK+/ecore shared connection
2630         - The rest of the GTK+ code uses the shared GTK+ connection
2631
2632         And then we also have WaylandDisplay and the code to check if the
2633         current display is wayland or X11.
2634         We could unify all these to share the same connection to reduce
2635         the amount of ifdefs and ensure a single connection. That will
2636         also allow us to use "smart pointers" for the X resources that
2637         need a Display* to be freed.
2638
2639         * PlatformEfl.cmake: Add new files to compilation.
2640         * PlatformGTK.cmake: Move some files to WebCore_SOURCES sinc ethey
2641         don't use GTK+ anymore, and add new files to compilation.
2642         * platform/graphics/GLContext.cpp:
2643         (WebCore::GLContext::cleanupActiveContextsAtExit): Remove the
2644         custom X11 connection.
2645         (WebCore::GLContext::createContextForWindow): Check if the shared
2646         display is Wayland to create a EGL context in such case.
2647         * platform/graphics/PlatformDisplay.cpp: Added.
2648         (WebCore::PlatformDisplay::createPlatformDisplay): Creates the
2649         shared display, using the GTK+/ecore shared connection.
2650         (WebCore::PlatformDisplay::sharedDisplay): Return the shared display.
2651         * platform/graphics/PlatformDisplay.h: Added.
2652         * platform/graphics/egl/GLContextEGL.cpp:
2653         (WebCore::sharedEGLDisplay): Use PlatformDisplay::sharedDisplay()
2654         to get the native display.
2655         (WebCore::GLContextEGL::createPixmapContext): Ditto.
2656         * platform/graphics/glx/GLContextGLX.cpp:
2657         (WebCore::GLContextGLX::createWindowContext): Ditto.
2658         (WebCore::GLContextGLX::createPbufferContext): Ditto.
2659         (WebCore::GLContextGLX::createPixmapContext): Ditto.
2660         (WebCore::GLContextGLX::createContext): Ditto.
2661         (WebCore::GLContextGLX::~GLContextGLX): Ditto.
2662         (WebCore::GLContextGLX::defaultFrameBufferSize): Ditto.
2663         (WebCore::GLContextGLX::makeContextCurrent): Ditto.
2664         (WebCore::GLContextGLX::swapBuffers): Ditto.
2665         (WebCore::GLContextGLX::cairoDevice): Ditto.
2666         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2667         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
2668         * platform/graphics/surfaces/glx/X11Helper.cpp:
2669         (WebCore::X11Helper::nativeDisplay): Ditto.
2670         * platform/graphics/wayland/PlatformDisplayWayland.cpp: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.cpp.
2671         (WebCore::PlatformDisplayWayland::globalCallback):
2672         (WebCore::PlatformDisplayWayland::globalRemoveCallback):
2673         (WebCore::PlatformDisplayWayland::create): Renamed instance() as
2674         create() since the single instance is now handled by PlatformDisplay.
2675         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
2676         (WebCore::PlatformDisplayWayland::createSurface):
2677         (WebCore::PlatformDisplayWayland::createSharingGLContext):
2678         * platform/graphics/wayland/PlatformDisplayWayland.h: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.h.
2679         * platform/graphics/x11/PlatformDisplayX11.cpp: Added.
2680         (WebCore::PlatformDisplayX11::PlatformDisplayX11):
2681         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
2682         * platform/graphics/x11/PlatformDisplayX11.h: Added.
2683         * platform/gtk/GtkUtilities.cpp:
2684         (WebCore::getDisplaySystemType): Deleted.
2685         * platform/gtk/GtkUtilities.h:
2686
2687 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2688
2689         [GTK] API tests crashing on debug builds due to extra unref
2690         https://bugs.webkit.org/show_bug.cgi?id=144508
2691
2692         Reviewed by Mario Sanchez Prada.
2693
2694         The problem is that we were assuming that when a new DOMWindow is
2695         created, the DOM object cache was notified about the previous
2696         DOMWindow being destroyed before objects for the new DOMWindow are
2697         added to the cache. However, that's not always the case and we
2698         only create a DOMWindowObserver for the first DOMWindow. We need
2699         to keep a pointer to the DOMWindow being observed to clear() the
2700         cache and create a new DOMWindowObserver when it changes in the
2701         Frame.
2702
2703         Fixes crashes in several unit tests in debug builds.
2704
2705         * bindings/gobject/DOMObjectCache.cpp:
2706
2707 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
2708
2709         Remove timer alignment logging that I added earler today.
2710
2711         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
2712
2713 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2714
2715         Purge PassRefPtr create() factory functions in html 
2716         https://bugs.webkit.org/show_bug.cgi?id=144522
2717
2718         Reviewed by Darin Adler.
2719
2720         Return Ref instead of PassRefPtr in create() factory functions in html, because the factory
2721         can't return null. This patch is a first step to purge in html. Following patch is going to
2722         be uploaded.
2723
2724         No new tests, no behavior changes.
2725
2726         * html/FileInputType.cpp:
2727         (WebCore::UploadButtonElement::create):
2728         (WebCore::UploadButtonElement::createForMultiple):
2729         * html/MediaController.cpp:
2730         (MediaController::create):
2731         * html/MediaController.h:
2732         * html/canvas/WebGLBuffer.cpp:
2733         (WebCore::WebGLBuffer::create):
2734         * html/canvas/WebGLBuffer.h:
2735         * html/canvas/WebGLContextAttributes.cpp:
2736         (WebCore::WebGLContextAttributes::create):
2737         * html/canvas/WebGLContextAttributes.h:
2738         * html/canvas/WebGLContextGroup.cpp:
2739         (WebCore::WebGLContextGroup::create):
2740         * html/canvas/WebGLContextGroup.h:
2741         * html/canvas/WebGLFramebuffer.cpp:
2742         (WebCore::WebGLFramebuffer::create):
2743         * html/canvas/WebGLFramebuffer.h:
2744         * html/canvas/WebGLProgram.cpp:
2745         (WebCore::WebGLProgram::create):
2746         * html/canvas/WebGLProgram.h:
2747         * html/canvas/WebGLQuery.cpp:
2748         (WebCore::WebGLQuery::create):
2749         * html/canvas/WebGLQuery.h:
2750         * html/canvas/WebGLRenderbuffer.cpp:
2751         (WebCore::WebGLRenderbuffer::create):
2752         * html/canvas/WebGLRenderbuffer.h:
2753         * html/canvas/WebGLSampler.cpp:
2754         (WebCore::WebGLSampler::create):
2755         * html/canvas/WebGLSampler.h:
2756         * html/canvas/WebGLShader.cpp:
2757         (WebCore::WebGLShader::create):
2758         * html/canvas/WebGLShader.h:
2759         * html/canvas/WebGLShaderPrecisionFormat.cpp:
2760         (WebCore::WebGLShaderPrecisionFormat::create):
2761         * html/canvas/WebGLShaderPrecisionFormat.h:
2762         * html/canvas/WebGLSync.cpp:
2763         (WebCore::WebGLSync::create):
2764         * html/canvas/WebGLSync.h:
2765         * html/canvas/WebGLTexture.cpp:
2766         (WebCore::WebGLTexture::create):
2767         * html/canvas/WebGLTexture.h:
2768         * html/canvas/WebGLTransformFeedback.cpp:
2769         (WebCore::WebGLTransformFeedback::create):
2770         * html/canvas/WebGLTransformFeedback.h:
2771         * html/canvas/WebGLUniformLocation.cpp:
2772         (WebCore::WebGLUniformLocation::create):
2773         * html/canvas/WebGLUniformLocation.h:
2774         * html/canvas/WebGLVertexArrayObject.cpp:
2775         (WebCore::WebGLVertexArrayObject::create):
2776         * html/canvas/WebGLVertexArrayObject.h:
2777         * html/canvas/WebGLVertexArrayObjectOES.cpp:
2778         (WebCore::WebGLVertexArrayObjectOES::create):
2779         * html/canvas/WebGLVertexArrayObjectOES.h:
2780
2781 2015-05-02  Andreas Kling  <akling@apple.com>
2782
2783         Style recalc always causes detach from shared StyleRareNonInheritedData.
2784         <https://webkit.org/b/144530>
2785
2786         Reviewed by Darin Adler.
2787
2788         StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
2789         when we were in style recalc. This caused the RenderStyle to COW off from the previously
2790         shared StyleRareNonInheritedData even if nothing actually changes.
2791
2792         This patch adds an early return to adjustStyleForMaskImages() when the previous style had
2793         no mask images. Further refinements could be made, but this covers the most common case where
2794         we don't have any mask images at all.
2795
2796         * css/StyleResolver.cpp:
2797         (WebCore::StyleResolver::adjustStyleForMaskImages):
2798
2799 2015-05-02  Alexey Proskuryakov  <ap@apple.com>
2800
2801         fast/frames/flattening/iframe-flattening-resize-event-count.html times out on Yosemite WK2
2802         https://bugs.webkit.org/show_bug.cgi?id=144155
2803
2804         Unreviewed, will roll out soon.
2805
2806         Added some temporary logging to better see if alignment is indeed the culprit.
2807
2808         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
2809
2810 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2811
2812         Use Ref instead of PassRefPtr in WebCore/svg 
2813         https://bugs.webkit.org/show_bug.cgi?id=144479
2814
2815         Reviewed by Darin Adler.
2816
2817         Remove remained PassRefPtr in svg.
2818
2819         No new tests, no behavior changes.
2820
2821         * svg/SVGFontFaceSrcElement.cpp:
2822         (WebCore::SVGFontFaceSrcElement::srcValue):
2823         * svg/SVGFontFaceSrcElement.h:
2824         * svg/properties/SVGPropertyInfo.h:
2825
2826 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
2827
2828         Small cleanup in BitmapImage
2829         https://bugs.webkit.org/show_bug.cgi?id=144515
2830
2831         Reviewed by Darin Adler.
2832
2833         Use an enum for the internalAdvanceAnimation() argument, with a default.
2834         
2835         Wrap the clearing of the timer in a clearTimer() function, called from
2836         stopAnimation(). This fixes the jarring reading of BitmapImage::internalAdvanceAnimation(),
2837         which used to start by calling stopAnimation().
2838
2839         * platform/graphics/BitmapImage.cpp:
2840         (WebCore::BitmapImage::clearTimer):
2841         (WebCore::BitmapImage::startAnimation):
2842         (WebCore::BitmapImage::stopAnimation):
2843         (WebCore::BitmapImage::advanceAnimation):
2844         (WebCore::BitmapImage::internalAdvanceAnimation):
2845         * platform/graphics/BitmapImage.h:
2846         * platform/graphics/Image.h:
2847
2848 2015-05-01  Simon Fraser  <simon.fraser@apple.com>
2849
2850         Avoid compositing updates after style recalcs which have no compositing implications
2851         https://bugs.webkit.org/show_bug.cgi?id=144502
2852
2853         Reviewed by Darin Adler.
2854         
2855         After r183461, we have reliable information about whether a style change with zero
2856         diff can be reliably ignored. Use that information to track whether a given
2857         recalcStyle() does anything which should force a compositing update.
2858         
2859         This eliminates up to 40% of the post-recalcStyle compositing updates on some pages.
2860         
2861         Add Internals API to test.
2862
2863         Test: compositing/updates/no-style-change-updates.html
2864
2865         * dom/Document.cpp:
2866         (WebCore::Document::recalcStyle): Tell the FrameView we're going to recalc style.
2867         * page/FrameView.cpp:
2868         (WebCore::FrameView::willRecalcStyle): Pass it on to the compositor.
2869         (WebCore::FrameView::updateCompositingLayersAfterStyleChange): Move the code
2870         that was here into RenderLayerCompositor::didRecalcStyleWithNoPendingLayout().
2871         * page/FrameView.h:
2872         * rendering/RenderLayerCompositor.cpp:
2873         (WebCore::RenderLayerCompositor::willRecalcStyle): Reset the m_layerNeedsCompositingUpdate flag.
2874         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): Bail on the update if
2875         no layers changed.
2876         (WebCore::RenderLayerCompositor::updateCompositingLayers): Logging. Increment m_compositingUpdateCount,
2877         which is used for testing.
2878         (WebCore::RenderLayerCompositor::layerStyleChanged): Set the m_layerNeedsCompositingUpdate flag.
2879         (WebCore::RenderLayerCompositor::startTrackingCompositingUpdates): Reset the counter.
2880         (WebCore::RenderLayerCompositor::compositingUpdateCount):
2881         * rendering/RenderLayerCompositor.h:
2882         * testing/Internals.cpp:
2883         (WebCore::Internals::startTrackingCompositingUpdates):
2884         (WebCore::Internals::compositingUpdateCount):
2885         * testing/Internals.h:
2886         * testing/Internals.idl:
2887
2888 2015-05-01  Andreas Kling  <akling@apple.com>
2889
2890         Reproducible crash removing name attribute from <img> node
2891         <https://webkit.org/b/144371>
2892         <rdar://problem/17198583>
2893
2894         Reviewed by Darin Adler.
2895
2896         The problem here was with HTMLImageElement::getNameAttribute(), which relies
2897         on Element::hasName() to avoid slow attribute lookups when the attribute
2898         is already known not to be present. Unfortunately hasName() uses an ElementData
2899         flag that wasn't getting updated until after the call to parseAttribute().
2900
2901         This patch fixes the issue by moving the code that updates the hasName() flag
2902         before the parseAttribute() virtual dispatch.
2903
2904         Test: fast/dom/HTMLImageElement/remove-name-id-attribute-from-image.html
2905
2906         * dom/Element.cpp:
2907         (WebCore::Element::attributeChanged):
2908
2909 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
2910
2911         Postpone caption style sheet creation
2912         https://bugs.webkit.org/show_bug.cgi?id=144499
2913
2914         Reviewed by Simon Fraser.
2915         
2916         Generating and inserting the caption user style sheet is expensive so don't do it until
2917         we see a text track, and only do it for the first video element in a PageGroup.
2918
2919         Test: media/track/track-user-stylesheet.html
2920
2921         * html/HTMLMediaElement.cpp:
2922         (WebCore::HTMLMediaElement::registerWithDocument): Only register for caption preferences
2923         changes if we have done so before.
2924         (WebCore::HTMLMediaElement::unregisterWithDocument): Only unregister for caption preferences
2925         changes if we registered for them.
2926         (WebCore::HTMLMediaElement::addTextTrack): Register for caption preference changes.
2927         * html/HTMLMediaElement.h:
2928
2929         * page/CaptionUserPreferencesMediaAF.cpp:
2930         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): Only
2931         generate the style sheet when called for the first time.
2932
2933 2015-05-01  Dean Jackson  <dino@apple.com>
2934
2935         [iOS] Scrubber display is broken if the buffered range is empty
2936         https://bugs.webkit.org/show_bug.cgi?id=144511
2937
2938         Reviewed by Eric Carlson.
2939
2940         Make sure that if video.buffered returns an empty list, we
2941         still draw the scrubber background correctly.
2942
2943         * Modules/mediacontrols/mediaControlsiOS.js:
2944         (ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
2945         is always at least as big as the current time.
2946
2947 2015-05-01  Roger Fong  <roger_fong@apple.com>
2948
2949         Media control volume slider should be vertical to avoid flickering issues.
2950         https://bugs.webkit.org/show_bug.cgi?id=144496.
2951         <rdar://problem/20451328>
2952
2953         Reviewed by Darin Adler.
2954
2955         * Modules/mediacontrols/mediaControlsApple.css:
2956         Resize and reposition the volume box so that it does not have to rotated via a transform.
2957         (audio::-webkit-media-controls-panel):
2958         (audio::-webkit-media-controls-panel .volume-box): Also set overflow: hidden so we can't interact
2959              with the volume slider while the volume box is hidden.
2960         (audio::-webkit-media-controls-panel .volume-box:active):
2961         Rotate and position the volume slider via transforms. Make sure it's not transformed in the fullscreen controls.
2962         (video::-webkit-media-controls-volume-slider):
2963         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
2964
2965 2015-05-01  Brent Fulgham  <bfulgham@apple.com>
2966
2967         Expand test infrastructure to support scrolling tests (Part 4): Scroll Snap Support
2968         https://bugs.webkit.org/show_bug.cgi?id=144482
2969
2970         Reviewed by Simon Fraser.
2971
2972         New tests will be landed in a second patch.
2973
2974         The new WheelEventTestTriggers do not work properly with scroll snap points, because some test deferral notifications
2975         need to be triggered for state changes on the scrolling thread. This required the following changes:
2976         1. A flag indicating that we want to know about WheelEvent state changes needed to be propagated to the scrolling thread,
2977            so that tests could be deferred until Scrolling thread rubberband or scroll-snap animations had completed.
2978         2. The ScrollingNodeID needed to be used for registering and clearing deferrals.
2979         3. The scrolling thread needed a way to dispatch messages to the main thread indicating that we should (or should not)
2980            defer tests due to scrolling actions.
2981
2982         Note that a future patch will extend this support to include the RemoteScrollingTree.
2983
2984         * page/WheelEventTestTrigger.cpp:
2985         (WebCore::WheelEventTestTrigger::deferTestsForReason): Added some logging features.
2986         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason): Ditto.
2987         (WebCore::dumpState): Helper function for logging test deferral state.
2988         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Added some logging features.
2989         * page/scrolling/AsyncScrollingCoordinator.cpp:
2990         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Make sure that the scrolling thread is
2991         told that it needs to send scrolling state back to the main thread. Only do this if we are in testing mode.
2992         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): The scrollingNodeID should be
2993         used as the identifier for this operation, not the page address.
2994         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added. receives messages from the scrolling thread
2995         and notifies the testing infrastructure.
2996         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
2997         * page/scrolling/AsyncScrollingCoordinator.h:
2998         * page/scrolling/ScrollingStateScrollingNode.cpp:
2999         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): When cloning the ScrollingStateScrollingNode,
3000         include the testing mode state.
3001         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Added.
3002         * page/scrolling/ScrollingStateScrollingNode.h:
3003         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger): Added.
3004         * page/scrolling/ScrollingTree.h:
3005         (WebCore::ScrollingTree::deferTestsForReason): Added stub.
3006         (WebCore::ScrollingTree::removeTestDeferralForReason): Ditto.
3007         * page/scrolling/ThreadedScrollingTree.cpp:
3008         (WebCore::ThreadedScrollingTree::deferTestsForReason): Added. Dispatches messages from the scrolling thread to the
3009         main thread.
3010         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Ditto.
3011         * page/scrolling/ThreadedScrollingTree.h:
3012         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
3013         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3014         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Initialize testing state flag.
3015         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): If the 'ExpectsWheelEventTestTrigger' flag is
3016         set, update local state.
3017         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): If we are testing, and the wheel event should be handled
3018         asynchronously, tell the testing infrastructure we need to wait for the thread state to sync.
3019         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason): Added. Notifies test system we need to defer tests
3020         until we notify them. Also used by the ScrollController during animations.
3021         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason): Ditto.
3022         * platform/Logging.h:
3023         * platform/ScrollAnimator.cpp:
3024         (WebCore::ScrollAnimator::deferTestsForReason): Added. Used by ScrollController during animation. This updates the
3025         testing infrastructure directly, since it is running in the same process and main thread.
3026         (WebCore::ScrollAnimator::removeTestDeferralForReason): Ditto.
3027         * platform/ScrollAnimator.h:
3028         * platform/cocoa/ScrollController.h:
3029         (WebCore::ScrollControllerClient::deferTestsForReason): Change client API.
3030         (WebCore::ScrollControllerClient::removeTestDeferralForReason): Ditto.
3031         (WebCore::ScrollControllerClient::testTrigger): Deleted.
3032         * platform/cocoa/ScrollController.mm:
3033         (WebCore::ScrollController::startSnapRubberbandTimer): Use new client API.
3034         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
3035         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
3036         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
3037
3038 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
3039
3040         Inline some small methods instead of them being EXPORT'd and out of line
3041         https://bugs.webkit.org/show_bug.cgi?id=144498
3042
3043         Reviewed by Darin Adler.
3044
3045         * page/Page.cpp:
3046         (WebCore::Page::testTrigger): Deleted.
3047         (WebCore::Page::clearTrigger): Deleted.
3048         (WebCore::Page::expectsWheelEventTriggers): Deleted.
3049         * page/Page.h:
3050         (WebCore::Page::testTrigger):
3051         (WebCore::Page::clearTrigger):
3052         (WebCore::Page::expectsWheelEventTriggers):
3053
3054 2015-05-01  Dan Bernstein  <mitz@apple.com>
3055
3056         WebCore part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
3057         https://bugs.webkit.org/show_bug.cgi?id=144501
3058
3059         Reviewed by Darin Adler.
3060
3061         Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm
3062
3063         Normally, loading substitute data (such as an error page) creates a new back-forward list
3064         item. FrameLoader has a mechanism that detects when a substitute data load occurs during
3065         handling of a provisional load error and prevents the creation of a new back-forwards list
3066         item in that case if the unreachable URL is the same as the failing provisional URL. This
3067         mechanism was broken in WebKit2, where handling the provisional load error is asynchronous.
3068
3069         The fix is to capture some state (namely, the failing provisional URL) when dispatching the
3070         load error and allow it to be restored when loading the substitute data.
3071
3072         * loader/FrameLoader.cpp:
3073         (WebCore::FrameLoader::FrameLoader): Removed initialization of
3074         m_delegateIsHandlingProvisionalLoadError.
3075         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking
3076         m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s
3077         URL, check m_provisionalLoadErrorBeingHandledURL.
3078         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting
3079         m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL.
3080         * loader/FrameLoader.h:
3081         (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client
3082         can call this from its override of dispatchDidFailProvisionalLoad and store the result.
3083         (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The
3084         client can call this prior to loading substitute data if it’s done as part of handling a
3085         previously-dispatched didFailProvisionalLoad.
3086
3087 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
3088
3089         USE(...) macro should expect unprefixed variables
3090         https://bugs.webkit.org/show_bug.cgi?id=144454
3091
3092         Reviewed by Daniel Bates.
3093
3094         * DerivedSources.make: Replace all occurrences WTF_USE with USE.
3095         * PlatformEfl.cmake: Ditto.
3096         * PlatformGTK.cmake: Ditto.
3097         * bindings/objc/PublicDOMInterfaces.h: Ditto.
3098         * config.h: Ditto.
3099         * crypto/mac/SerializedCryptoKeyWrapMac.mm: Ditto.
3100         * page/AlternativeTextClient.h: Ditto.
3101         * platform/efl/FileSystemEfl.cpp: Ditto.
3102         (WebCore::fileSystemRepresentation): Ditto.
3103         * platform/graphics/cg/ImageBufferDataCG.h: Ditto.
3104         * platform/graphics/cg/PDFDocumentImage.h: Ditto.
3105         * platform/ios/wak/WAKAppKitStubs.h: Ditto.
3106         * rendering/RenderLayerCompositor.cpp: Ditto.
3107
3108 2015-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
3109
3110         [OS X] Text dilation parameters are not restored after being set
3111         https://bugs.webkit.org/show_bug.cgi?id=144507
3112         <rdar://problem/19446938>
3113
3114         Reviewed by Simon Fraser and Ned Holbrook.
3115
3116         Create a RAII class who is in charge of saving, applying, and restoring dilation parameters. Use this class
3117         around our text drawing routines.
3118
3119         Note that this migrates our use of CTFontSetRenderingParameters() to CTFontSetRenderingStyle().
3120
3121         Test: fast/text/dilation-save-restore.html
3122
3123         * platform/graphics/cocoa/FontCascadeCocoa.mm:
3124         (WebCore::RenderingStyleSaver::RenderingStyleSaver):
3125         (WebCore::RenderingStyleSaver::~RenderingStyleSaver):
3126         (WebCore::showGlyphsWithAdvances):
3127         * platform/spi/cg/CoreGraphicsSPI.h:
3128         * platform/spi/cocoa/CoreTextSPI.h:
3129
3130 2015-05-01  Commit Queue  <commit-queue@webkit.org>
3131
3132         Unreviewed, rolling out r183687.
3133         https://bugs.webkit.org/show_bug.cgi?id=144505
3134
3135         Appears to have caused assertions (Requested by ap on
3136         #webkit).
3137
3138         Reverted changeset:
3139
3140         "Media control volume slider is opaque."
3141         https://bugs.webkit.org/show_bug.cgi?id=144470
3142         http://trac.webkit.org/changeset/183687
3143
3144 2015-05-01  Jeremy Jones  <jeremyj@apple.com>
3145
3146         Stop using deprecated AVKit SPI for enter and exit fullscreen.
3147         https://bugs.webkit.org/show_bug.cgi?id=144493
3148
3149         Reviewed by Jer Noble.
3150
3151         Replace 
3152             -enterFullScreenWithCompletionHandler:
3153             -exitFullScreenWithCompletionHandler:
3154         with
3155             -enterFullScreenAnimated:completionHandler:
3156             -exitFullScreenAnimated:completionHandler:
3157         
3158         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3159         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
3160         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
3161         * platform/spi/cocoa/AVKitSPI.h:
3162
3163 2015-05-01  Roger Fong  <roger_fong@apple.com>
3164
3165         Media control volume slider is opaque.
3166         https://bugs.webkit.org/show_bug.cgi?id=144470.
3167         <rdar://problem/20770350>
3168
3169         Rubberstamped by Simon Fraser.
3170
3171         * Modules/mediacontrols/mediaControlsApple.css:
3172         (audio::-webkit-media-controls-panel): 
3173         Don't create a stacking context just for the controls.
3174         Doing so causes the mix-blend-mode on the volume box to fail.
3175
3176 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
3177
3178         [GTK] REGRESSION(183368): It made editing tests assert
3179         https://bugs.webkit.org/show_bug.cgi?id=144447
3180
3181         Reviewed by Chris Fleizach.
3182
3183         Don't notify platforms of editing actions of type EditActionUnspecified.
3184         If we don't know what the action is, platform accessibility APIs certainly
3185         won't.
3186
3187         Add AXTextEditTypeAttributesChange and AXTextAttributesChanged as catch-alls
3188         for formatting changes. ATK lacks finely-grained signals through which to
3189         specify which text attributes have changed. If other platforms have such
3190         signals, new types can always be added.
3191
3192         Don't post an accessible replacement notification for AXTextEditTypeCut.
3193         The notification is handled by DeleteSelectionCommand. It is possible for
3194         white space to be inserted in preparation for a cut which was triggering
3195         a not-reached assert, but insertion of whitespace in preparation for a
3196         cut does not seem notification-worthy.
3197
3198         Treat AXTextEditTypeDictation the same as other insertion types (insert,
3199         paste, typing) with respect to replacement notifications.
3200
3201         No new tests. The hundreds of editing tests that had been crashing seem sufficient.
3202
3203         * accessibility/AXObjectCache.cpp:
3204         (WebCore::AXObjectCache::showIntent):
3205         (WebCore::AXObjectCache::textChangeForEditType):
3206         * accessibility/AXObjectCache.h:
3207         * accessibility/AXTextStateChangeIntent.h:
3208         * accessibility/atk/AXObjectCacheAtk.cpp:
3209         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
3210         * editing/AppendNodeCommand.cpp:
3211         (WebCore::AppendNodeCommand::doApply):
3212         (WebCore::AppendNodeCommand::doUnapply):
3213         * editing/DeleteFromTextNodeCommand.cpp:
3214         (WebCore::DeleteFromTextNodeCommand::doApply):
3215         (WebCore::DeleteFromTextNodeCommand::doUnapply):
3216         * editing/EditCommand.cpp:
3217         (WebCore::EditCommand::applyEditType):
3218         (WebCore::EditCommand::unapplyEditType):
3219         * editing/InsertIntoTextNodeCommand.cpp:
3220         (WebCore::InsertIntoTextNodeCommand::doApply):
3221         (WebCore::InsertIntoTextNodeCommand::doUnapply):
3222         * editing/InsertNodeBeforeCommand.cpp:
3223         (WebCore::InsertNodeBeforeCommand::doApply):
3224         (WebCore::InsertNodeBeforeCommand::doUnapply):
3225         * editing/ReplaceInsertIntoTextNodeCommand.cpp:
3226         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
3227
3228 2015-05-01  Brady Eidson  <beidson@apple.com>
3229
3230         Add API to disable meta refreshes.
3231         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
3232
3233         Reviewed by Alexey Proskuryakov.
3234
3235         Test: loader/meta-refresh-disabled.html
3236
3237         * dom/Document.cpp:
3238         (WebCore::Document::processHttpEquiv): Bail early if Settings have meta refreshes disabled.
3239         * page/Settings.in:
3240
3241 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
3242
3243         [Freetype] Properly support synthetic oblique in vertical text
3244         https://bugs.webkit.org/show_bug.cgi?id=144492
3245
3246         Reviewed by Sergio Villar Senin.
3247
3248         No new tests. Covered by existing tests.
3249
3250         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3251         (WebCore::FontPlatformData::initializeWithFontFace): Skew vertical when using synthetic
3252         oblique for vertical text.
3253
3254 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
3255
3256         AX: [ATK] REGRESSION: accessibility/canvas-fallback-content.html now crashes
3257         https://bugs.webkit.org/show_bug.cgi?id=144481
3258
3259         Reviewed by Chris Fleizach.
3260
3261         Canvas fallback content is allowed to be focusable if the canvas is displayed
3262         and visible. Update the style when creating an accessible object for a node in
3263         a canvas subtree and before Element::isFocusable() gets called.
3264
3265         No new tests. The existing, crashing test no longer crashes.
3266
3267         * accessibility/AXObjectCache.cpp:
3268         (WebCore::AXObjectCache::getOrCreate):
3269
3270 2015-05-01  Alex Christensen  <achristensen@webkit.org>
3271
3272         [Content Extensions] Add CombinedURLFilters debugging code.
3273         https://bugs.webkit.org/show_bug.cgi?id=144491
3274
3275         Reviewed by Daniel Bates.
3276
3277         No change in behavior.
3278
3279         * contentextensions/CombinedURLFilters.cpp:
3280         (WebCore::ContentExtensions::recursiveMemoryUsed):
3281         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
3282         (WebCore::ContentExtensions::prefixTreeVertexToString):
3283         (WebCore::ContentExtensions::recursivePrint):
3284         (WebCore::ContentExtensions::CombinedURLFilters::print):
3285         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
3286         (WebCore::ContentExtensions::generateNFAForSubtree):
3287         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
3288         * contentextensions/CombinedURLFilters.h:
3289         * contentextensions/NFA.cpp:
3290         (WebCore::ContentExtensions::NFA::memoryUsed):
3291         * contentextensions/NFA.h:
3292         * contentextensions/Term.h:
3293         (WebCore::ContentExtensions::quantifierToString):
3294         (WebCore::ContentExtensions::Term::toString):
3295
3296 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
3297
3298         Fix text track language selection logic
3299         https://bugs.webkit.org/show_bug.cgi?id=144467
3300
3301         Reviewed by Brent Fulgham.
3302
3303         No new tests, media/track/track-language-preference.html was updated.
3304
3305         * html/HTMLMediaElement.cpp:
3306         (WebCore::HTMLMediaElement::configureTextTrackGroup): Correct a minor style typo.
3307         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Update logging.
3308
3309         * page/CaptionUserPreferences.cpp:
3310         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Minor cleanup.
3311         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Give exact matches a
3312         higher score.
3313
3314         * page/CaptionUserPreferencesMediaAF.cpp:
3315         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Update for 
3316         indexOfBestMatchingLanguageInList change.
3317
3318         * platform/Language.cpp:
3319         (WebCore::indexOfBestMatchingLanguageInList): Add parameter for exact match. Convert the
3320         passed language to lower case as we do with the preferred languages.
3321         * platform/Language.h:
3322
3323 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
3324
3325         [Freetype] Add support for the font-synthesis property
3326         https://bugs.webkit.org/show_bug.cgi?id=144472
3327
3328         Reviewed by Sergio Villar Senin.
3329
3330         No new tests. This causes fast/css3-text/font-synthesis.html to pass
3331         for WebKitGTK+.
3332
3333         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3334         (WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
3335         (WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.
3336
3337 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
3338
3339         [GTK] New CORS tests from r183280 fail on WebKitGTK+
3340         https://bugs.webkit.org/show_bug.cgi?id=144469
3341
3342         Reviewed by Sergio Villar Senin.
3343
3344         No new tests. This causes failing tests to pass.
3345
3346         * platform/network/soup/ResourceHandleSoup.cpp:
3347         (WebCore::doRedirect): Clear the origin header on cross-origin redirects.
3348
3349 2015-04-30  Alex Christensen  <achristensen@webkit.org>
3350
3351         Compile fix when using content extensions debugging code.
3352
3353         * contentextensions/ContentExtensionCompiler.cpp:
3354         (WebCore::ContentExtensions::compileRuleList):
3355         * contentextensions/ContentExtensionsDebugging.h:
3356         * contentextensions/DFA.cpp:
3357         (WebCore::ContentExtensions::printTransitions):
3358         (WebCore::ContentExtensions::DFA::debugPrintDot):
3359         * contentextensions/DFANode.h:
3360         * contentextensions/NFA.cpp:
3361         (WebCore::ContentExtensions::NFA::memoryUsed):
3362         (WebCore::ContentExtensions::NFA::debugPrintDot):
3363
3364 2015-04-30  Dan Bernstein  <mitz@apple.com>
3365
3366         Fixed the build for <rdar://problem/20758514>
3367
3368         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
3369         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Don’t pass nil to
3370         -[AVMutableAudioMix setInputParameters:].
3371
3372 2015-04-30  Daniel Bates  <dabates@apple.com>
3373
3374         Clean up: Remove unnecessary runtime computation of string length
3375         https://bugs.webkit.org/show_bug.cgi?id=144483
3376
3377         Reviewed by Joseph Pecoraro.
3378
3379         Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
3380         computes strlen() of the first string literal as part of concatenating two string literals.
3381         It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
3382         string literal because the size of the string literal is known at compile time.
3383
3384         * Modules/webdatabase/DatabaseBackendBase.cpp:
3385         (WebCore::fullyQualifiedInfoTableName):
3386
3387 2015-04-30  Dean Jackson  <dino@apple.com>
3388
3389         Expose -apple-system as a font family
3390         https://bugs.webkit.org/show_bug.cgi?id=144484
3391         <rdar://problem/20767330>
3392
3393         Reviewed by Tim Horton.
3394
3395         Accept "-apple-system" for the font-family property, and
3396         rename "-apple-system-font-monospaced-numbers" to
3397         "-apple-system-monospaced-numbers".
3398
3399         Also change the media controls to use the new name.
3400
3401         Covered by existing tests and this new one:
3402             fast/text/system-font-legacy-name.html
3403
3404         * Modules/mediacontrols/mediaControlsApple.css:
3405         (audio::-webkit-media-controls-time-remaining-display):
3406         * Modules/mediacontrols/mediaControlsiOS.css:
3407         (::-webkit-media-controls):
3408         (audio::-webkit-media-controls-time-remaining-display):
3409         (audio::-webkit-media-controls-status-display):
3410         * platform/graphics/ios/FontCacheIOS.mm: Add support for the new name.
3411         (WebCore::createCTFontWithFamilyNameAndWeight):
3412         * platform/graphics/mac/FontCacheMac.mm: Ditto.
3413         (WebCore::fontWithFamily):
3414
3415 2015-04-30  Javier Fernandez  <jfernandez@igalia.com>
3416
3417         [CSS Grid Layout] overflow-position keyword for align and justify properties.
3418         https://bugs.webkit.org/show_bug.cgi?id=144235
3419
3420         Reviewed by Sergio Villar Senin.
3421
3422         When the alignment subject is larger than the alignment container,
3423         it will overflow. Some alignment modes, if honored in this
3424         situation, may cause data loss; an overflow alignment mode can be
3425         explicitly specified to avoid this.
3426
3427         This patch implements overflow-keyword handling for Grid Layout on
3428         align-self and justify-self properties.
3429
3430         Test: fast/css-grid-layout/grid-align-justify-overflow.html
3431
3432         * rendering/RenderGrid.cpp:
3433         (WebCore::computeOverflowAlignmentOffset):
3434         (WebCore::RenderGrid::rowPositionForChild):
3435         (WebCore::RenderGrid::columnPositionForChild):
3436         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
3437         * rendering/style/RenderStyle.cpp:
3438         (WebCore::resolveAlignmentData):
3439         (WebCore::resolveJustificationData):
3440         (WebCore::RenderStyle::resolveAlignment):
3441         (WebCore::RenderStyle::resolveAlignmentOverflow):
3442         (WebCore::RenderStyle::resolveJustification):
3443         (WebCore::RenderStyle::resolveJustificationOverflow):
3444         * rendering/style/RenderStyle.h:
3445
3446 2015-04-30  Jon Honeycutt  <jhoneycutt@apple.com>
3447
3448         Rebaseline bindings tests results after r183648.
3449
3450         Unreviewed.
3451
3452         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3453         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
3454         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3455         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
3456         * bindings/scripts/test/JS/JSTestInterface.cpp:
3457         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
3458         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
3459         (WebCore::setJSTestInterfaceImplementsStr2):
3460         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
3461         (WebCore::setJSTestInterfaceSupplementalStr2):
3462         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
3463         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
3464         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3465         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
3466         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3467         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
3468         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
3469         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
3470         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
3471         * bindings/scripts/test/JS/JSTestObj.cpp:
3472         (WebCore::setJSTestObjConstructorStaticStringAttr):
3473         (WebCore::setJSTestObjStringAttr):
3474         (WebCore::setJSTestObjReflectedStringAttr):
3475         (WebCore::setJSTestObjReflectedURLAttr):
3476         (WebCore::setJSTestObjReflectedCustomURLAttr):
3477         (WebCore::setJSTestObjStringAttrWithGetterException):
3478         (WebCore::setJSTestObjStringAttrWithSetterException):
3479         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
3480         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
3481         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
3482         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
3483         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
3484         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
3485         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
3486         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
3487         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
3488         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
3489         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
3490         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
3491         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
3492         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
3493         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
3494         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3495         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
3496         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3497         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
3498         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
3499         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
3500         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
3501
3502 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
3503
3504         Fixed elements end up in the middle of the view with pageScale < 1
3505         https://bugs.webkit.org/show_bug.cgi?id=144428
3506         rdar://problem/20404982
3507
3508         Reviewed by Tim Horton.
3509
3510         When pageScale is < 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
3511         returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
3512         hardcoding 'false' for this parameter.
3513         
3514         Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
3515         so we can use it when doing scrolling-thread fixed position stuff.
3516
3517         Not testable.
3518
3519         * page/scrolling/AsyncScrollingCoordinator.cpp:
3520         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3521         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
3522         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3523         (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
3524         * page/scrolling/ScrollingStateFrameScrollingNode.h:
3525         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3526         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
3527         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
3528         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3529         (WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
3530         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
3531         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3532         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
3533
3534 2015-04-30  Beth Dakin  <bdakin@apple.com>
3535
3536         Remove invalid assertion from MouseEvent::create()
3537         https://bugs.webkit.org/show_bug.cgi?id=144477
3538
3539         Reviewed by Tim Horton.
3540
3541         mouseforcechanged events and mouseforcewillbegin trigger this assertion. The 
3542         assertion does not seem valuable, so rather than changing it, just remove it.
3543         * dom/MouseEvent.cpp:
3544         (WebCore::MouseEvent::create):
3545
3546 2015-04-30  Dean Jackson  <dino@apple.com>
3547
3548         -apple-system-font-monospaced-numbers doesn't work on iOS
3549         https://bugs.webkit.org/show_bug.cgi?id=144478
3550         <rdar://problem/20544940>
3551
3552         Reviewed by Brent Fulgham.
3553
3554         Make sure to start from the system font descriptor when
3555         asking for a monospaced numeric alternate.
3556
3557         Test: platform/ios-simulator/fast/text/system-monospaced-numbers.html
3558
3559         * platform/graphics/ios/FontCacheIOS.mm:
3560         (WebCore::createCTFontWithFamilyNameAndWeight):
3561
3562 2015-04-30  Oliver Hunt  <oliver@apple.com>
3563
3564         DOM bindings should not be using a reference type to point to a temporary object
3565         https://bugs.webkit.org/show_bug.cgi?id=144474
3566
3567         Reviewed by Beth Dakin.
3568
3569         The DOM bindings will currently try and use a local reference to point
3570         to a temporary object. This currently works as a by product of the compiler's
3571         stack layout. This patch removes the dependency on undefined behaviour
3572         by ensuring that we use a value rather than reference type.
3573
3574         * bindings/scripts/CodeGeneratorJS.pm:
3575         (GenerateParametersCheck):
3576         (GetNativeTypeForCallbacks):
3577
3578 2015-04-30  Brady Eidson  <beidson@apple.com>
3579
3580         Build fix after r183646 for less enlightened platforms.
3581
3582         Unreviewed.
3583
3584         * Modules/webdatabase/DatabaseBackendBase.cpp:
3585         (WebCore::fullyQualifiedInfoTableName): Windows doesn’t have stpcpy :(
3586
3587 2015-04-30  Brady Eidson  <beidson@apple.com>
3588
3589         Javascript using WebSQL can create their own WebKit info table.
3590         <rdar://problem/20688792> and https://bugs.webkit.org/show_bug.cgi?id=144466
3591
3592         Reviewed by Alex Christensen.
3593
3594         Test: storage/websql/alter-to-info-table.html
3595
3596         * Modules/webdatabase/DatabaseBackendBase.cpp:
3597         (WebCore::DatabaseBackendBase::databaseInfoTableName): Return the info table name.
3598         (WebCore::fullyQualifiedInfoTableName): Append "main." to the info table name.
3599         (WebCore::DatabaseBackendBase::DatabaseBackendBase): Use the fully qualified name.
3600         (WebCore::DatabaseBackendBase::performOpenAndVerify): Ditto.
3601         (WebCore::DatabaseBackendBase::getVersionFromDatabase): Ditto.
3602         (WebCore::DatabaseBackendBase::setVersionInDatabase): Ditto.
3603
3604 2015-04-30  Beth Dakin  <bdakin@apple.com>
3605
3606         Should choose UIScrollView indicatorStyle based on the document background color
3607         https://bugs.webkit.org/show_bug.cgi?id=144473
3608         -and corresponding-
3609         rdar://problem/19897699
3610
3611         Reviewed by Simon Fraser.
3612
3613         Export this function.
3614         * platform/graphics/Color.h:
3615
3616 2015-04-30  Brent Fulgham  <bfulgham@apple.com>
3617
3618         [Win] Allow WebKit to build without ANGLE support
3619         https://bugs.webkit.org/show_bug.cgi?id=144459
3620         <rdar://problem/20707307>
3621
3622         Reviewed by Dean Jackson.
3623
3624         * platform/graphics/GLContext.cpp: Use the ENABLE(GRAPHICS_CONTEXT_3D)
3625         macro to avoid compiling this code if not using WEBGL/3D contexts.
3626
3627 2015-04-29  David Hyatt  <hyatt@apple.com>
3628
3629         Avoid containingBlock() calls when no writing mode flipping is needed.
3630         https://bugs.webkit.org/show_bug.cgi?id=144407
3631
3632         Reviewed by Simon Fraser.
3633
3634         Add a bool to RenderView that indicates whether or not any flipped blocks have been
3635         added to the view. Once tainted, the view just stays dirty forever. If no flipped
3636         blocks are ever seen, we can then optimize away calls to containingBlock().
3637
3638         The motivation for this patch is to improve layer position updating, which makes many
3639         calls to topLeftLocationOffset(), one of the functions that can be optimized by this
3640         change.
3641
3642         * rendering/RenderBox.cpp:
3643         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3644         * rendering/RenderBoxModelObject.cpp:
3645         (WebCore::RenderBoxModelObject::updateFromStyle):
3646         * rendering/RenderLayer.cpp:
3647         (WebCore::RenderLayer::calculateClipRects):
3648         * rendering/RenderLineBoxList.cpp:
3649         (WebCore::RenderLineBoxList::rangeIntersectsRect):
3650         * rendering/RenderView.cpp:
3651         (WebCore::RenderView::RenderView):
3652         * rendering/RenderView.h:
3653
3654 2015-04-29  Jer Noble  <jer.noble@apple.com>
3655
3656         Make GenericTaskQueue even more generic (and usable inside platform/)
3657         https://bugs.webkit.org/show_bug.cgi?id=144414
3658
3659         Reviewed by Eric Carlson.
3660
3661         Templatize GenericTaskQueue so that it can be used from within platform/.
3662
3663         * CMakeLists.txt:
3664         * WebCore.vcxproj/WebCore.vcxproj:
3665         * WebCore.vcxproj/WebCore.vcxproj.filters:
3666         * WebCore.xcodeproj/project.pbxproj:
3667         * dom/GenericTaskQueue.cpp: Removed.
3668         * html/HTMLMediaElement.h:
3669         * platform/GenericTaskQueue.h: Renamed from Source/WebCore/dom/GenericTaskQueue.h.
3670         (WebCore::TaskDispatcher::TaskDispatcher): Added default templatized class which just calls the parameter's postTask().
3671         (WebCore::TaskDispatcher::postTask): Call context's postTask().
3672         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Add a timer version which does not require a context.
3673         (WebCore::TaskDispatcher<Timer>::postTask): Set the timer.
3674         (WebCore::TaskDispatcher<Timer>::timerFired): Call the task.
3675         (WebCore::GenericTaskQueue::GenericTaskQueue): Moved from .cpp.
3676         (WebCore::GenericTaskQueue::enqueueTask): Ditto.
3677         (WebCore::GenericTaskQueue::close): Ditto.
3678         (WebCore::GenericTaskQueue::cancelAllTasks): Ditto.
3679         (WebCore::GenericTaskQueue::hasPendingTasks): Ditto.
3680
3681 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
3682
3683         Unreviewed build fix. WebCore has a weak symbol.
3684
3685         WebCore has a weak external symbol in it. A common cause of weak external
3686         symbols is when an inline function is listed in the linker export file.
3687         ERROR: symbol __ZNK7WebCore4Page25expectsWheelEventTriggersEv
3688
3689         * page/Page.cpp:
3690         (WebCore::Page::expectsWheelEventTriggers):
3691         * page/Page.h:
3692         (WebCore::Page::expectsWheelEventTriggers): Deleted.
3693
3694 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
3695
3696         Crash at WebCore::Document::absoluteRegionForEventTargets 
3697         https://bugs.webkit.org/show_bug.cgi?id=144426
3698         rdar://problem/20502166
3699
3700         Reviewed by Tim Horton.
3701
3702         When a frame had wheel event handlers, we would register the document itself
3703         as a handler in its parent document. This is problematic, because there's not
3704         code path that removes it when the frame is destroyed.
3705         
3706         It turns out we don't need to do this at all; the non-fast scrollable region
3707         already takes handlers in subframes into account.
3708
3709         Tests: fast/events/wheelevent-in-frame.html
3710                fast/events/wheelevent-in-reattached-frame.html
3711
3712         * dom/Document.cpp:
3713         (WebCore::Document::didAddWheelEventHandler):
3714         (WebCore::Document::didRemoveWheelEventHandler):
3715
3716 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
3717
3718         Not all videos should automatically play to playback target
3719         https://bugs.webkit.org/show_bug.cgi?id=144430
3720         <rdar://problem/20718523>
3721
3722         Reviewed by Darin Adler.
3723
3724         * Modules/mediasession/WebMediaSessionManager.cpp:
3725         (WebCore::WebMediaSessionManager::clientStateDidChange): Consider ExternalDeviceAutoPlayCandidate.
3726         Minor cleanup.
3727
3728         * html/HTMLMediaElement.cpp:
3729         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate when a <video>
3730         has a file with an audio track that does not loop.
3731
3732         * page/MediaProducer.h: Add ExternalDeviceAutoPlayCandidate.
3733
3734 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
3735
3736         LiveNodeList may unexpectedly return an element for empty string
3737         https://bugs.webkit.org/show_bug.cgi?id=144429
3738
3739         Reviewed by Darin Adler.
3740
3741         * dom/LiveNodeList.cpp:
3742         (WebCore::LiveNodeList::namedItem):
3743         Never return a result for an empty string.
3744
3745 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3746
3747         Remove PassRefPtr in SVGFEFooElement classes
3748         https://bugs.webkit.org/show_bug.cgi?id=144425
3749
3750         Reviewed by Darin Adler.
3751
3752         As a step to use Ref instead of PassRefPtr, this patch purges PassRefPtr
3753         in SVGFEFooElement.
3754
3755         No new tests, no behavior changes.
3756
3757         * css/RGBColor.cpp:
3758         (WebCore::RGBColor::create):
3759         * css/RGBColor.h:
3760         * platform/graphics/filters/PointLightSource.h:
3761         (WebCore::PointLightSource::create):
3762         * platform/graphics/filters/SpotLightSource.h:
3763         (WebCore::SpotLightSource::create):
3764         * svg/SVGColor.cpp:
3765         (WebCore::SVGColor::rgbColor):
3766         * svg/SVGColor.h:
3767         * svg/SVGFEDistantLightElement.cpp:
3768         (WebCore::SVGFEDistantLightElement::lightSource):
3769         * svg/SVGFEDistantLightElement.h:
3770         * svg/SVGFELightElement.cpp:
3771         (WebCore::SVGFELightElement::findLightSource):
3772         * svg/SVGFELightElement.h:
3773         * svg/SVGFEPointLightElement.cpp:
3774         (WebCore::SVGFEPointLightElement::lightSource):
3775         * svg/SVGFEPointLightElement.h:
3776         * svg/SVGFESpotLightElement.cpp:
3777         (WebCore::SVGFESpotLightElement::lightSource):
3778         * svg/SVGFESpotLightElement.h:
3779
3780 2015-04-29  Dean Jackson  <dino@apple.com>
3781
3782         Create a named CSS property for system colors
3783         https://bugs.webkit.org/show_bug.cgi?id=144423
3784         <rdar://problem/20491011>
3785
3786         Reviewed by Tim Horton.
3787
3788         Test: fast/css/apple-system-colors.html
3789
3790         Expose the following values to CSS color properties:
3791             -apple-system-blue
3792             -apple-system-brown
3793             -apple-system-gray
3794             -apple-system-green
3795             -apple-system-orange
3796             -apple-system-pink
3797             -apple-system-purple
3798             -apple-system-red
3799             -apple-system-yellow
3800
3801         On platforms other than OS X Yosemite and iOS, the
3802         actual color values are undefined and become transparent
3803         black. (In fact, not all are defined on iOS either.)
3804
3805         * WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
3806
3807         * css/CSSParser.cpp:
3808         (WebCore::CSSParser::validSystemColorValue): New helper function that
3809         checks if a CSSValueID is between the two system color values. This
3810         was being tested everywhere, which meant adding a new system color was
3811         at risk of being ignored. It's a static method so it can be used
3812         from the SVG CSS parser too.
3813         (WebCore::validPrimitiveValueColor): Use the new helper.
3814         (WebCore::CSSParser::parseValue): Ditto.
3815         (WebCore::CSSParser::parseBackgroundColor): Ditto.
3816         (WebCore::CSSParser::parseShadow): Ditto.
3817         (WebCore::parseDeprecatedGradientColorStop): Ditto.
3818         (WebCore::parseGradientColorOrKeyword): Ditto.
3819         * css/CSSParser.h: New static helper function.
3820
3821         * css/CSSValueKeywords.in: Add the new CSS value keywords.
3822
3823         * css/SVGCSSParser.cpp:
3824         (WebCore::validSystemControlColorValue): SVG has a restricted
3825         set of system colors, so use the helper from CSSParser but with
3826         an extra condition.
3827         (WebCore::CSSParser::parseSVGValue): Use the helper.
3828
3829         * platform/spi/ios/UIColorSPI.h: Added.
3830         * platform/spi/cocoa/NSColorSPI.h: Added.
3831
3832         * rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
3833         * rendering/RenderThemeIOS.mm:
3834         (WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
3835         * rendering/RenderThemeMac.mm:
3836         (WebCore::RenderThemeMac::systemColor): Ditto.
3837
3838 2015-04-29  Commit Queue  <commit-queue@webkit.org>
3839
3840         Unreviewed, rolling out r183600.
3841         https://bugs.webkit.org/show_bug.cgi?id=144432
3842
3843         New tests time out everywhere (Requested by ap on #webkit).
3844
3845         Reverted changeset:
3846
3847         "Crash at WebCore::Document::absoluteRegionForEventTargets"
3848         https://bugs.webkit.org/show_bug.cgi?id=144426
3849         http://trac.webkit.org/changeset/183600
3850
3851 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
3852
3853         Unreviewed iOS build fix. Unused parameter no longer exists.
3854
3855         * page/scrolling/ScrollingCoordinator.cpp:
3856         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
3857
3858 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
3859
3860         Crash at WebCore::Document::absoluteRegionForEventTargets 
3861         https://bugs.webkit.org/show_bug.cgi?id=144426
3862         rdar://problem/20502166
3863
3864         Reviewed by Tim Horton.
3865
3866         When a frame had wheel event handlers, we would register the document itself
3867         as a handler in its parent document. This is problematic, because there's not
3868         code path that removes it when the frame is destroyed.
3869         
3870         It turns out we don't need to do this at all; the non-fast scrollable region
3871         already takes handlers in subframes into account.
3872
3873         Tests: fast/events/wheelevent-in-frame.html
3874                fast/events/wheelevent-in-reattached-frame.html
3875
3876         * dom/Document.cpp:
3877         (WebCore::Document::didAddWheelEventHandler):
3878         (WebCore::Document::didRemoveWheelEventHandler):
3879
3880 2015-04-29  David Kilzer  <ddkilzer@apple.com>
3881
3882         Attempt #2: Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
3883         <http://webkit.org/b/144362>
3884
3885         Reviewed by Andy Estes.
3886
3887         This patch switches soft-linking of QuickLook.framework to
3888         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
3889         symbols.
3890
3891         No new tests since no change in behavior.
3892
3893         * WebCore.xcodeproj/project.pbxproj:
3894         - Add QuickLookSoftLinking.{h,mm} to the project.
3895
3896         * platform/ios/QuickLookSoftLink.h: Added.
3897         * platform/ios/QuickLookSoftLink.mm: Added.
3898         * platform/mac/SoftLinking.h:
3899         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
3900         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
3901         (SOFT_LINK_POINTER_FOR_HEADER): Add macro.
3902         (SOFT_LINK_POINTER_FOR_SOURCE): Add macro.
3903
3904         * platform/network/ios/QuickLook.h:
3905         - Remove unused declarations.
3906
3907         * platform/network/ios/QuickLook.mm:
3908         (WebCore::QLPreviewConverterClass): Deleted.
3909         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
3910         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
3911         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
3912         - Remove SOFT_LINK macros and unused methods after switching to
3913           new QuickLookSoftLink.{h,mm}.
3914         (WebCore::QLPreviewGetSupportedMIMETypesSet):
3915         - Switch to use NeverDestroyed<>.
3916         (WebCore::registerQLPreviewConverterIfNeeded):
3917         (createQLPreviewProtocol):
3918         (WebCore::QLPreviewProtocol):
3919         (WebCore::QuickLookHandle::QuickLookHandle):
3920         (WebCore::QuickLookHandle::create):
3921         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
3922         - Simplify code when using QuickLookSoftLink.h.
3923
3924         * platform/network/ios/WebCoreURLResponseIOS.mm:
3925         - Include QuickLookSoftLink.h header.
3926
3927 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
3928
3929         Compute the non-fast-scrollable region in main-document coordinates
3930         https://bugs.webkit.org/show_bug.cgi?id=144420
3931
3932         Reviewed by Tim Horton.
3933
3934         Compute the non-fast-scrollable region in document coordinates, to make it easier
3935         to reason about. Previously, it was document coordinates offset by top content inset.
3936
3937         * page/DebugPageOverlays.cpp:
3938         (WebCore::MouseWheelRegionOverlay::updateRegion): Traverse all frames to compute the wheel
3939         event handler region, mapping each to root view coords, and then mapping back into document
3940         coords at the end.
3941         (WebCore::NonFastScrollableRegionOverlay::updateRegion): No offset needed here; the
3942         overlay and region are both document coordinates.
3943         * page/FrameView.h: Make some mapping function overrides public, and expose widgetsInRenderTree().
3944         * page/Page.cpp:
3945         (WebCore::Page::nonFastScrollableRects): Remove frame argument.
3946         * page/Page.h:
3947         * page/PageOverlay.cpp:
3948         (WebCore::PageOverlay::bounds):
3949         (WebCore::PageOverlay::viewToOverlayOffset): Convenience function to map between
3950         view and overlay coordinates.
3951         * page/PageOverlay.h:
3952         * page/scrolling/AsyncScrollingCoordinator.cpp: New computeNonFastScrollableRegion() signature.
3953         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
3954         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
3955         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
3956         * page/scrolling/ScrollingCoordinator.cpp:
3957         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): This function
3958         recurses on frames, computing an absolute (document-relative) region per frame. This
3959         removes the confusing offsetting through top content inset.
3960         Change how we get to plugins that want wheel events; we can't get from PluginViewBase
3961         to renderers, so use FrameView's list of Widgets, and their RenderWidgets. This fixes
3962         regions for transformed plugin-ins.
3963         For subframes, we get a region in the subframe's document coords. Map to that sub-frame,
3964         then to our frame, then to our document.
3965         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Wrapper that hides
3966         the recursive function.
3967         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Deleted.
3968         * page/scrolling/ScrollingCoordinator.h:
3969         * page/scrolling/ScrollingTree.cpp:
3970         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Map the event point
3971         from view coordinates to document coordinates for testing against the non-fast region.
3972         We previously assert that the root note is a FrameScrolling node.
3973         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3974         (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): Similar to ScrollView::viewToContents()
3975         for the scrolling tree.
3976         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3977         * testing/Internals.cpp:
3978         (WebCore::Internals::nonFastScrollableRects): No need for frame arg.
3979
3980 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
3981
3982         Expand test infrastructure to support scrolling tests
3983         https://bugs.webkit.org/show_bug.cgi?id=143684
3984         <rdar://problem/20375516>
3985
3986         Reviewed by Simon Fraser.
3987
3988         Tested by various fast/scrolling and platform/mac-wk2/tiled-drawing/scrolling tests.
3989
3990         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
3991         function object to be fired when scroll events are finished. The object also keeps track of reasons
3992         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
3993         check rendering state in the middle of an animation.
3994
3995         Switch from the original WeakPtr design to ThreadSafeRefPtr, because WeakPtr cannot be shared
3996         across multiple threads.
3997
3998         * page/FrameView.cpp:
3999         (WebCore::FrameView::layout): Make sure ScrollAnimator knows about any active test trigger.
4000         (WebCore::FrameView::setScrollPosition): Ditto.
4001         (WebCore::FrameView::didAddScrollbar): Ditto.
4002         * page/MainFrame.cpp:
4003         (WebCore::MainFrame::testTrigger): Moved to Page.
4004         (WebCore::MainFrame::ensureTestTrigger): Ditto.
4005         * page/MainFrame.h:
4006         * page/Page.cpp:<