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