Record the reference time when Performance is constructed.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-04  Andreas Kling  <akling@apple.com>
2
3         Record the reference time when Performance is constructed.
4         <https://webkit.org/b/144616>
5
6         Reviewed by Geoffrey Garen.
7
8         This is a merge of Blink's r156613 by simonjam@chromium.org.
9
10         Cache a copy of the DocumentLoader's reference timestamp when constructing
11         the Performance object. That way we don't have to jump through a bunch of scary
12         hoops to access it when now() is called later on.
13
14         * page/Performance.cpp:
15         (WebCore::Performance::Performance):
16         (WebCore::Performance::now): Deleted.
17         * page/Performance.h:
18
19 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
20
21         Fix assertions in WK1 tests after r183777.
22         
23         Two issues with the original change:
24         
25         If not in compositing mode, we shouldn't schedule layer flushes, since
26         Document::documentWillSuspendForPageCache() only only calls cancelCompositingLayerUpdate()
27         if in compositing mode.
28         
29         Second, RenderLayerCompositor::rootBackgroundTransparencyChanged() never stored the
30         new color, resulting in too many triggered compositing updates.
31
32         * rendering/RenderLayerCompositor.cpp:
33         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged):
34
35 2015-05-04  Zalan Bujtas  <zalan@apple.com>
36
37         RenderWidget::setWidgetGeometry() can end up destroying *this*.
38         https://bugs.webkit.org/show_bug.cgi?id=144601
39
40         Reviewed by Andreas Kling.
41
42         This is a speculative fix to ensure we don't crash on an invalid *this* renderer
43         while flattening the current iframe.
44         Calling RenderWidget::setWidgetGeometry() can result in destroying the current renderer.
45         While it is not a issue in case of normal layout flow as widget positions are updated at post layout,
46         frame flattening initiates this action in the middle of layout.
47         This patch re-introduces refcount model for RenderWidgets so that the renderer is protected during layout
48         when frame flattening is in use.
49
50         * rendering/RenderFrameBase.cpp:
51         (WebCore::RenderFrameBase::layoutWithFlattening): Let's be paranoid about child view.
52         * rendering/RenderObject.cpp:
53         (WebCore::RenderObject::destroy):
54         * rendering/FrameView.cpp:
55         (WebCore::FrameView::layout):
56         * rendering/RenderView.h:
57         * rendering/RenderWidget.cpp:
58         (WebCore::RenderWidget::~RenderWidget):
59         * rendering/RenderWidget.h:
60         (WebCore::RenderWidget::ref):
61         (WebCore::RenderWidget::deref):
62
63 2015-05-04  Doug Russell  <d_russell@apple.com>
64
65         AX: setting focus via accessibility object needs to set isSynchronizing in resulting selection intent
66         https://bugs.webkit.org/show_bug.cgi?id=144489
67
68         Reviewed by Chris Fleizach.
69
70         Resolves infinite looping when navigating rapidly between controls with the search API and then focusing
71         on the returned control.
72         Remove isSynchronizing flag from AXTextStateChangeIntent and put it on AXObjectCache.
73         Move AXTextStateChangeIntent logic in AccessibilityRenderObject into a helper method.
74         Call new AXTextStateChangeIntent helper from AccessibilityRenderObject::setFocus().
75         Add support for setSelectedVisibleTextRange() in accessibility tests.
76
77         Test: platform/mac/accessibility/selection-sync.html
78
79         * accessibility/AXObjectCache.cpp:
80         (WebCore::AXObjectCache::showIntent):
81         (WebCore::AXObjectCache::setTextSelectionIntent):
82         (WebCore::AXObjectCache::setIsSynchronizingSelection):
83         (WebCore::AXObjectCache::postTextStateChangeNotification):
84         * accessibility/AXObjectCache.h:
85         * accessibility/AXTextStateChangeIntent.h:
86         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
87         * accessibility/AccessibilityRenderObject.cpp:
88         (WebCore::setTextSelectionIntent):
89         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
90         (WebCore::AccessibilityRenderObject::setFocused):
91         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
92         (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange): Deleted.
93         * accessibility/mac/AXObjectCacheMac.mm:
94         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
95
96 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
97
98         [Mac] Audio-only files should not have a device picker
99         https://bugs.webkit.org/show_bug.cgi?id=144606
100         <rdar://problem/20806387>
101
102         Reviewed by Dean Jackson.
103
104         * Modules/mediacontrols/mediaControlsApple.js:
105         (Controller.prototype.hasVideo): New.
106         (Controller.prototype.updateFullscreenButtons): Use hasVideo.
107         (Controller.prototype.updateHasVideo): Ditto.
108         (Controller.prototype.updateWirelessTargetAvailable): Don't show the target picker button
109         unless a file has video.
110
111 2015-05-04  Chris Dumez  <cdumez@apple.com>
112
113         Crash at com.apple.WebKit.WebContent at com.apple.WebCore: WebCore::createWindow + 185
114         https://bugs.webkit.org/show_bug.cgi?id=144597
115         <rdar://problem/20361579>
116
117         Reviewed by Andreas Kling.
118
119         Test: fast/dom/Window/window-open-activeWindow-null-frame.html
120
121         In our implementation of window.open(), we make sure that the window
122         which window.open() is called has a frame. However, we did not have the
123         same check for the activeDOMWindow (i.e. the lexicalGlobalObject) causing
124         us to crash in WebCore::createWindow() when dereferencing it.
125
126         This patch updates WebCore::createWindow() takes a reference to the
127         openerFrame instead of a pointer to make it clear the implementation
128         expects it to be non-null. A null check is then added for the frame
129         at the call site: DOMWindow::createWindow().
130
131         * inspector/InspectorFrontendClientLocal.cpp:
132         (WebCore::InspectorFrontendClientLocal::openInNewTab):
133         * loader/FrameLoader.cpp:
134         (WebCore::isDocumentSandboxed):
135         (WebCore::FrameLoader::submitForm):
136         (WebCore::createWindow):
137         Take a reference to openerFrame instead of a pointer as the
138         implementation expects it to be non-null.
139
140         * loader/FrameLoader.h:
141         * page/DOMWindow.cpp:
142         (WebCore::DOMWindow::createWindow):
143         Add null check for activeFrame before passing it to
144         WebCore::createWindow().
145
146 2015-05-04  Dean Jackson  <dino@apple.com>
147
148         Create a named CSS property for system colors
149         https://bugs.webkit.org/show_bug.cgi?id=144423
150
151         Follow-up comments from Darin Adler.
152
153         * rendering/RenderThemeIOS.h: Cache a Color rather than an RGBA32.
154         * rendering/RenderThemeIOS.mm:
155         (WebCore::RenderThemeIOS::systemColor): Use "add" to avoid multiple hits on the HashMap, and
156         cache invalid responses so that we don't have to keep looking for non-existent colors.
157         * rendering/RenderThemeMac.h: Same as iOS.
158         * rendering/RenderThemeMac.mm:
159         (WebCore::RenderThemeMac::systemColor):
160
161 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
162
163         display:none iframes cause repeated compositing flushing
164         https://bugs.webkit.org/show_bug.cgi?id=144529
165
166         Reviewed by Darin Adler.
167         
168         FrameView::updateLayoutAndStyleIfNeededRecursive() only forces layout on rendered
169         frames, by virtue of using its Widget children which are FrameViews.
170         
171         However, FrameView::flushCompositingStateIncludingSubframes() iterated over
172         all frames, and return false if any subframe needed layout. Thus, if it saw
173         non-rendered frames (which are never laid out), it would return false,
174         which causes the CFRunLoopObserver that drives flushing to run again.
175         
176         Fix by having FrameView::flushCompositingStateIncludingSubframes() only check
177         rendered frames, using FrameTree::traverseNextRendered() (which needs to be public).
178         
179         Also change FrameView::needsStyleRecalcOrLayout() and FrameView::updateLayoutAndStyleIfNeededRecursive()
180         to fetch the list of FrameViews using FrameTree's nextRenderedSibling(), rather than using
181         the Widget tree, since we'd like to eventually remove Widgets, and using the Frame
182         tree matches flushCompositingStateIncludingSubframes() and other code.
183
184         Test: compositing/iframes/display-none-subframe.html
185
186         * page/FrameTree.h:
187         * page/FrameView.cpp:
188         (WebCore::FrameView::flushCompositingStateIncludingSubframes):
189         (WebCore::FrameView::needsStyleRecalcOrLayout):
190         (WebCore::FrameView::renderedChildFrameViews): Helper that returns a vector
191         of Ref<FrameView>s for rendered frames only.
192         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
193         * page/FrameView.h:
194
195 2015-05-04  Chris Dumez  <cdumez@apple.com>
196
197         Unreviewed. Fix build with SECURITY_ASSERTIONS enabled.
198         <rdar://problem/20653104>
199
200         * dom/ScriptExecutionContext.cpp:
201         (WebCore::ScriptExecutionContext::ScriptExecutionContext):
202         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForPageCache):
203         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
204         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
205         * dom/ScriptExecutionContext.h:
206
207 2015-05-04  Simon Fraser  <simon.fraser@apple.com>
208
209         Fix updating of tiled backing opaquenss when the page background color changes
210         https://bugs.webkit.org/show_bug.cgi?id=144600
211         rdar://problem/20723035
212
213         Reviewed by Tim Horton.
214
215         RenderLayerCompositor makes the page tiles opaque or not based on the result of
216         viewHasTransparentBackground(), which consults the view transparency, and
217         FrameView::documentBackgroundColor(). documentBackgroundColor() in turn is based
218         on the root and/or body background colors.
219
220         We thus need to re-evaluate whether page tiles are opaque when any of these inputs
221         change, but were failing to do so for the FrameView's baseBackgroundColor, and
222         the page root background color.
223         
224         Fix by having FrameView::setBaseBackgroundColor(), and RenderBox::styleDidChange()
225         (for the root) trigger a compositing update when necessary.
226
227         Added setViewBaseBackgroundColor() on Internals for testing.
228
229         Test: platform/mac-wk2/tiled-drawing/background-transparency-toggle.html
230
231         * page/FrameView.cpp:
232         (WebCore::FrameView::setTransparent): Use the isViewForDocumentInFrame() helper.
233         (WebCore::FrameView::setBaseBackgroundColor): Bail if we're not the view for the 
234         frame's document, and trigger a compositing update check if the alpha changed.
235         (WebCore::FrameView::isViewForDocumentInFrame): Helper that checks to see if
236         this FrameView is associated with the Document being displayed in the FrameView's
237         Frame. This returns false when we're setting up a new FrameView (its Frame still
238         points to the old document, so renderView() returns the RenderView for the Frame's
239         existing Document).
240         * page/FrameView.h:
241         * rendering/RenderBox.cpp:
242         (WebCore::RenderBox::styleDidChange): Have the compositor check to see if it needs
243         to do an update.
244         * rendering/RenderLayerCompositor.cpp:
245         (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): If the result
246         of documentBackgroundColor() changed in alpha since the last time, trigger a compositing
247         update.
248         * rendering/RenderLayerCompositor.h:
249         * testing/Internals.cpp:
250         (WebCore::Internals::setViewBaseBackgroundColor):
251         * testing/Internals.h:
252         * testing/Internals.idl:
253
254 2015-05-04  Jer Noble  <jer.noble@apple.com>
255
256         [iOS] Crash in -[WebCALayerHostWrapper resolveBounds]
257         https://bugs.webkit.org/show_bug.cgi?id=144595
258
259         Reviewed by Eric Carlson.
260
261         It is possible for a WebCALayorHostWrapper to outlive the WebVideoFullscreenModel to which it refers,
262         since the model pointer is bare, rather than a RefPtr. The reference to the model must be invalidated
263         before the model is destroyed.
264
265         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
266         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
267
268 2015-05-04  Ryosuke Niwa  <rniwa@webkit.org>
269
270         Toggling underline or strike through affects each other
271         https://bugs.webkit.org/show_bug.cgi?id=27818
272
273         Reviewed by Darin Adler.
274
275         This patch introduces a new mechanism to apply and remove text decorations. This is necessary because text
276         decorations are always additive and we can't differentiate whether we're adding or removing a text decoration.
277         Conceptually, we need four values for text decorations: adding underline, removing underline, adding
278         line-through, and removing line-through but we have only three: underline, line-through, none.
279
280         After this patch, there are three mechanism by which text decorations states are kept tracked. While applying
281         or removing text decorations, we use newly added m_underlineChange and m_strikeThroughChange in EditingStyle.
282         For the typing style, we use -webkit-text-decorations-in-effect to store the state since we need to preserve
283         every type of text decorations such as overline in addition to underline and line-through. Once applied, all
284         text decorations should be expressed in terms of the standard text-decoration property.
285
286         Test: editing/execCommand/toggle-mixed-text-decorations.html
287
288         * editing/ApplyStyleCommand.cpp:
289         (WebCore::ApplyStyleCommand::applyBlockStyle):
290         (WebCore::ApplyStyleCommand::removeCSSStyle): conflictsWithInlineStyleOfElement now creates a new inline style
291         instead of a list of properties to remove.
292         (WebCore::ApplyStyleCommand::addBlockStyle):
293         (WebCore::ApplyStyleCommand::applyInlineStyleChange): Merge inline styles instead of adding as string.
294         Otherwise it would generate style content attribute with multiple text-decoration properties.
295
296         * editing/EditingStyle.cpp:
297         (WebCore::HTMLElementEquivalent::matches):
298         (WebCore::HTMLElementEquivalent::propertyExistsInStyle): Takes an EditingStyle instead of StyleProperties.
299         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
300         (WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent): 
301         (WebCore::HTMLTextDecorationEquivalent::propertyExistsInStyle): Respect newly added m_strikeThroughChange and
302         m_underlineChange in EditingStyle.
303         (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle): Ditto.
304         (WebCore::HTMLTextDecorationEquivalent::changeInStyle): Added. Retrieves the change enum for the associated
305         type of text-decoration (underline or strike through).
306         (WebCore::HTMLAttributeEquivalent::matches):
307         (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle):
308         (WebCore::EditingStyle::EditingStyle): Initialize m_underlineChange and m_strikeThroughChange. Also use the
309         delegating constructor elsewhere. Also added the missing call to extractFontSizeDelta() in the variant that
310         takes CSSPropertyID and String, and added a variant that takes CSSPropertyID and CSSValueID.
311         (WebCore::EditingStyle::isEmpty): Return false when m_underlineChange and m_strikeThroughChange are not "none".
312         (WebCore::applyTextDecorationChangeToValueList): Added.
313         (WebCore::EditingStyle::overrideTypingStyleAt): Added. Used by Editor::computeAndSetTypingStyle to set a new
314         typing style. Resolve m_underlineChange and m_strikeThroughChange into -webkit-text-decorations-in-effect.
315         (WebCore::EditingStyle::clear): Clear m_underlineChange and m_strikeThroughChange.
316         (WebCore::EditingStyle::copy): Copy m_underlineChange and m_strikeThroughChange.
317         (WebCore::textDecorationValueList): Added.
318         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Now takes a pointer to MutableStyleProperties
319         instead of a vector. This was necessary we can't simply remove text-decoration property in ApplyStyleCommand's
320         removeCSSStyle as that would result in unrelated text decorations also getting removed. Also added the code
321         for m_underlineChange and m_strikeThroughChange. Only removing text decoration changes can cause a conflict
322         since text decorations are always additive.
323         (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Check isEmpty() instead of the nullity of
324         m_mutableStyle to respect m_underlineChange and m_strikeThroughChange.
325         (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes):
326         (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes):
327         (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode): Respect the values of m_underlineChange and
328         m_strikeThroughChange. Here, the style is considered present if it has text decorations that are being added.
329         (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
330         (WebCore::elementMatchesAndPropertyIsNotInInlineStyleDecl): Takes EditingStyle instead of StyleProperties to
331         respect m_underlineChange and m_strikeThroughChange.
332         (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
333         (WebCore::mergeTextDecorationValues):
334         (WebCore::EditingStyle::mergeStyle): Make a copy of CSSValueList before modifying it since CSSValueList's are
335         shared with other immutable StyleProperties.
336         (WebCore::StyleChange::StyleChange): Set m_applyUnderline, m_applyLineThrough, and m_cssStyle if either
337         m_underlineChange or m_strikeThroughChange are TextDecorationChange::Add in EditingStyle if the current position
338         doesn't already have the matching style.
339         (WebCore::StyleChange::operator==): Moved from the header file. Also added the logic to compare m_cssStyle now
340         that it's a StyleProperties instead of String.
341
342         * editing/EditingStyle.h: Added TextDecorationChange.
343         (WebCore::EditingStyle::create): Added a variant that takes CSSPropertyID and CSSValueID.
344         (WebCore::EditingStyle::conflictsWithInlineStyleOfElement):
345         (WebCore::EditingStyle::setUnderlineChange): Added.
346         (WebCore::EditingStyle::underlineChange): Added.
347         (WebCore::EditingStyle::setStrikeThroughChange): Added.
348         (WebCore::EditingStyle::strikeThroughChange): Added.
349         (WebCore::StyleChange::cssStyle): Now returns StyleProperties* instead of String so that ApplyStyleCommand's
350         applyInlineStyleChange could merge inline styles instead of just appending it to the end.
351         (WebCore::StyleChange::operator==): Moved into the cpp file.
352
353         * editing/Editor.cpp:
354         (WebCore::Editor::applyStyle): Added. This variant takes EditingStyle instead of StyleProperties.
355         (WebCore::Editor::applyStyleToSelection): Ditto.
356         (WebCore::Editor::computeAndSetTypingStyle): Added a variant for EditingStyle. Also use overrideTypingStyleAt
357         to set -webkit-text-decorations-in-effect based on m_underlineChange and m_strikeThroughChange 
358
359         * editing/Editor.h:
360         * editing/EditorCommand.cpp:
361         (WebCore::applyCommandToFrame):
362         (WebCore::isStylePresent): Extracted from executeToggleStyle.
363         (WebCore::executeApplyStyle):
364         (WebCore::executeToggleStyle):
365         (WebCore::executeToggleStyleInList): Deleted.
366         (WebCore::textDecorationChangeForToggling): Added. Used in executeStrikethrough and executeUnderline.
367         (WebCore::executeStrikethrough):
368         (WebCore::executeUnderline):
369
370 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
371
372         [Mac] Fix build breakage caused by API deprecation
373         https://bugs.webkit.org/show_bug.cgi?id=144593
374
375         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
376         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Suppress warnings.
377
378 2015-05-04  Chris Dumez  <cdumez@apple.com>
379
380         REGRESSION (r178156): CSS Parser incorrectly rejects valid calc() in padding-right property
381         https://bugs.webkit.org/show_bug.cgi?id=144584
382         <rdar://problem/20796829>
383
384         Reviewed by Darin Adler.
385
386         The CSS parser was rejecting calculated values at parsing time if it
387         considered the value was negative and the CSS property did not allow
388         negative values. However, doing so at this point will not always work
389         because we don't necessarily know the font-size yet (for e.g. for
390         calc(0.5em - 2px). Also, rejecting negative calculated values is not
391         the right behavior as the the specification. The specification says
392         we should clamp:
393         http://dev.w3.org/csswg/css-values-3/#calc-range
394
395         This patch updates validateCalculationUnit() to stop marking the value
396         as invalid if it is negative. Instead, let the CSSCalcValue's permitted
397         range clamp the value as needed.
398
399         This bug was causing the bottom graphic on aldentrio.com to not be
400         rendered properly.
401
402         Test: fast/css/negative-calc-values.html
403               fast/css/padding-calc-value.html
404
405         * css/CSSParser.cpp:
406         (WebCore::CSSParser::validateCalculationUnit):
407
408 2015-05-04  Eric Carlson  <eric.carlson@apple.com>
409
410         [Mac] Show wireless playback placard even when an element has custom controls
411         https://bugs.webkit.org/show_bug.cgi?id=144548
412
413         Reviewed by Brent Fulgham.
414
415         * Modules/mediacontrols/mediaControlsApple.js:
416         (Controller.prototype.shouldHaveAnyUI): Return true when playing to wireless target.
417         (Controller.prototype.reconnectControls): Add controls when playing to wireless target.
418         (Controller.prototype.setPlaying): Return early when there is no 'controls' attribute.
419         (Controller.prototype.showControls): Ditto.
420         (Controller.prototype.updateWirelessPlaybackStatus): Call updateBase when playing to wireless
421         target to ensure that controls have been set up.
422         (Controller.prototype.handleWirelessPlaybackChange): Call reconnectControls when playing
423         to wireless target when there is no 'controls' attribute.
424         (Controller.prototype.showInlinePlaybackPlaceholderOnly): New.
425
426         * html/HTMLMediaElement.cpp:
427         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Call configureMediaControls.
428         (WebCore::HTMLMediaElement::configureMediaControls): Require controls when playing
429         to wireless target.
430         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Remove some unhelpful, noisy, logging.
431
432 2015-05-04  Dan Bernstein  <mitz@apple.com>
433
434         Fixed the build.
435
436         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
437         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Moved off of a deprecated
438         method to a non-deprecated equivalent.
439
440 2015-05-04  Javier Fernandez  <jfernandez@igalia.com>
441
442         [CSS Box Alignment] Upgrade justify-content parsing to CSS3 Box Alignment spec.
443         https://bugs.webkit.org/show_bug.cgi?id=144442
444
445         Reviewed by David Hyatt.
446
447         Upgrade the justify-content property to the last CSS3 Box
448         Alignment specification. It defines a different enumeration for
449         Positional and Distribution alignment, which requires changes in
450         the FlexibleBox implementation.
451
452         A new parsing function has been implemented to replace the basic
453         keyword IDs validation. Because of the complexity of the new
454         values, a new CSSPrimitiveValue derived class has been defined
455         which simplifies considerably the parsing logic.
456
457         We will follow the same approach than for Self Alignment, defining
458         a single class to hold all the related alignment data. This makes
459         possible to use a StyleBuilderConverter function instead of custom
460         builder functions for these properties.
461
462         Test: css3/parse-justify-content.html
463
464         * CMakeLists.txt:
465         * WebCore.xcodeproj/project.pbxproj:
466         * css/CSSComputedStyleDeclaration.cpp:
467         (WebCore::resolveContentAlignmentAuto):
468         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
469         (WebCore::ComputedStyleExtractor::propertyValue):
470         (WebCore::valueForItemPositionWithOverflowAlignment): Deleted.
471         * css/CSSContentDistributionValue.cpp: Added.
472         (WebCore::CSSContentDistributionValue::CSSContentDistributionValue):
473         (WebCore::CSSContentDistributionValue::~CSSContentDistributionValue):
474         (WebCore::CSSContentDistributionValue::customCSSText):
475         (WebCore::CSSContentDistributionValue::equals):
476         * css/CSSContentDistributionValue.h: Added.
477         (WebCore::CSSContentDistributionValue::create):
478         (WebCore::CSSContentDistributionValue::distribution):
479         (WebCore::CSSContentDistributionValue::position):
480         (WebCore::CSSContentDistributionValue::overflow):
481         * css/CSSParser.cpp:
482         (WebCore::isValidKeywordPropertyAndValue):
483         (WebCore::isKeywordPropertyID):
484         (WebCore::CSSParser::parseValue):
485         (WebCore::isContentDistributionKeyword):
486         (WebCore::isContentPositionKeyword):
487         (WebCore::isAlignmentOverflowKeyword):
488         (WebCore::CSSParser::parseContentDistributionOverflowPosition):
489         (WebCore::CSSParser::parseItemPositionOverflowPosition):
490         (WebCore::CSSParser::parseLegacyPosition): Deleted.
491         * css/CSSParser.h:
492         * css/CSSPrimitiveValueMappings.h:
493         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
494         (WebCore::CSSPrimitiveValue::operator ContentPosition):
495         (WebCore::CSSPrimitiveValue::operator ContentDistributionType):
496         (WebCore::CSSPrimitiveValue::operator EFlexDirection): Deleted.
497         * css/CSSPropertyNames.in:
498         * css/CSSValue.cpp:
499         (WebCore::CSSValue::equals):
500         (WebCore::CSSValue::cssText):
501         (WebCore::CSSValue::destroy):
502         * css/CSSValue.h:
503         (WebCore::CSSValue::isContentDistributionValue):
504         (WebCore::CSSValue::isWebKitCSSFilterValue): Deleted.
505         * css/CSSValueKeywords.in:
506         * css/StyleBuilderConverter.h:
507         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
508         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData): Deleted.
509         * rendering/RenderFlexibleBox.cpp:
510         (WebCore::initialJustifyContentOffset):
511         (WebCore::justifyContentSpaceBetweenChildren):
512         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
513         (WebCore::RenderFlexibleBox::layoutColumnReverse):
514         * rendering/RenderFullScreen.cpp:
515         (WebCore::createFullScreenStyle):
516         * rendering/mathml/RenderMathMLScripts.cpp:
517         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
518         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
519         * rendering/style/RenderStyle.h:
520         * rendering/style/RenderStyleConstants.h:
521         * rendering/style/StyleContentAlignmentData.h: Added.
522         (WebCore::StyleContentAlignmentData::StyleContentAlignmentData):
523         (WebCore::StyleContentAlignmentData::setPosition):
524         (WebCore::StyleContentAlignmentData::setDistribution):
525         (WebCore::StyleContentAlignmentData::setOverflow):
526         (WebCore::StyleContentAlignmentData::position):
527         (WebCore::StyleContentAlignmentData::distribution):
528         (WebCore::StyleContentAlignmentData::overflow):
529         (WebCore::StyleContentAlignmentData::operator==):
530         (WebCore::StyleContentAlignmentData::operator!=):
531         * rendering/style/StyleRareNonInheritedData.cpp:
532         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
533         (WebCore::StyleRareNonInheritedData::operator==):
534         * rendering/style/StyleRareNonInheritedData.h:
535
536 2015-05-04  Per Arne Vollan  <peavo@outlook.com>
537
538         [WinCairo] Compile error in sharedEGLDisplay() method.
539         https://bugs.webkit.org/show_bug.cgi?id=144563
540
541         Reviewed by Alex Christensen.
542
543         The PlatformDisplay type is undefined.
544
545         * platform/graphics/egl/GLContextEGL.cpp:
546         (WebCore::sharedEGLDisplay):
547
548 2015-05-04  Zan Dobersek  <zdobersek@igalia.com>
549
550         [WTF] Remove Functional.h inclusions
551         https://bugs.webkit.org/show_bug.cgi?id=144400
552
553         Reviewed by Darin Adler.
554
555         Remove unnecessary inclusions of the <wtf/Functional.h> header in WebCore.
556
557         * Modules/mediastream/MediaStreamTrack.cpp:
558         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
559         * Modules/mediastream/UserMediaRequest.cpp:
560         * page/scrolling/ScrollingTree.h:
561         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
562         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
563         * platform/MemoryPressureHandler.cpp:
564         * platform/UserActivity.h: Include the <objc/objc.h> header that was previously
565         indirectly included through Functional.h.
566         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
567         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
568         * platform/mac/SoftLinking.h: Unconditionally include the <objc/runtime.h> header
569         that was previously included for the Mac port through Functional.h.
570
571 2015-05-04  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
572
573         [Streams API] Refactor ReadableJSStream and ReadableStreamJSSource
574         https://bugs.webkit.org/show_bug.cgi?id=144387
575
576         Reviewed by Darin Adler.
577
578         Made ReadableStreamReader a private class of ReadableJSStream.
579         Simplified ReadableJSStream construction so that binding constructor does not need to know about ReadableStreamJSSource. 
580
581         No functional change, existing tests cover the changes.
582
583         * Modules/streams/ReadableStream.h:
584         (WebCore::ReadableStream::source): Added to implement jsSource(), needed by ReadableJSStream.
585         * bindings/js/JSReadableStreamCustom.cpp:
586         (WebCore::constructJSReadableStream): Simplified to not have to handle source creation.
587         * bindings/js/ReadableStreamJSSource.cpp:
588         (WebCore::ReadableStreamJSSource::globalObject): Helper function to be used in other future methods.
589         (WebCore::ReadableStreamJSSource::start):
590         (WebCore::ReadableJSStream::create):
591         (WebCore::ReadableJSStream::createReader):
592         (WebCore::ReadableJSStream::jsSource):
593         (WebCore::ReadableJSStream::Reader::create):
594         (WebCore::ReadableJSStream::Reader::Reader):
595         * bindings/js/ReadableStreamJSSource.h:
596
597 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
598
599         Remove move-js-headers.sh
600         https://bugs.webkit.org/show_bug.cgi?id=144323
601
602         Reviewed by Daniel Bates.
603
604         move-js-headers.sh was only used by the Wx port, which has been removed from trunk long ago.
605
606         * move-js-headers.sh: Removed.
607
608 2015-05-04  Csaba Osztrogonác  <ossy@webkit.org>
609
610         [ARM] Don't compare unsigned chars to EOF (-1)
611         https://bugs.webkit.org/show_bug.cgi?id=144439
612
613         Reviewed by Geoffrey Garen.
614
615         * platform/linux/MemoryPressureHandlerLinux.cpp:
616         (WebKit::nextToken): Don't cast return value of fgetc() to char.
617
618 2015-05-04  Manuel Rego Casasnovas  <rego@igalia.com>
619
620         [CSS Grid Layout] Wrong computed style for named grid lines in implicit tracks
621         https://bugs.webkit.org/show_bug.cgi?id=144449
622
623         Reviewed by Sergio Villar Senin.
624
625         If there're implicit tracks then trackPositions is bigger than
626         trackSizes, so we need to use the proper index to append the trailing
627         <ident>s in valueForGridTrackList().
628
629         Test: fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
630
631         * css/CSSComputedStyleDeclaration.cpp:
632         (WebCore::valueForGridTrackList):
633
634 2015-05-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
635
636         Purge PassRefPtr in WebCore/html
637         https://bugs.webkit.org/show_bug.cgi?id=144543
638
639         Reviewed by Andreas Kling.
640
641         Change PassRefPtr in create() factory functions with Ref. In some functions,
642         it returns RefPtr when it might have a chance to return nullptr.
643
644         No new tests, no behavior changes.
645
646         * Modules/encryptedmedia/MediaKeySession.cpp:
647         (WebCore::MediaKeySession::sendError):
648         * html/DOMFormData.h:
649         (WebCore::DOMFormData::create):
650         * html/HTMLMediaElement.cpp:
651         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
652         * html/HTMLMediaElement.h:
653         * html/MediaError.h:
654         (WebCore::MediaError::create):
655         * html/MediaKeyError.h:
656         (WebCore::MediaKeyError::create):
657         * html/canvas/CanvasGradient.h:
658         * html/canvas/CanvasProxy.cpp:
659         (WebCore::CanvasProxy::create):
660         * html/canvas/CanvasProxy.h:
661         * html/canvas/WebGLActiveInfo.h:
662         (WebCore::WebGLActiveInfo::create):
663         * html/canvas/WebGLContextAttributes.h:
664         * html/canvas/WebGLContextGroup.h:
665         * html/canvas/WebGLProgram.h:
666         * html/canvas/WebGLQuery.h:
667         * html/canvas/WebGLRenderbuffer.h:
668         * html/canvas/WebGLSampler.h:
669         * html/canvas/WebGLShader.h:
670         * html/canvas/WebGLShaderPrecisionFormat.h:
671         * html/canvas/WebGLSync.h:
672         * html/canvas/WebGLTexture.h:
673         * html/canvas/WebGLTransformFeedback.h:
674         * html/canvas/WebGLUniformLocation.h:
675         * html/canvas/WebGLVertexArrayObjectOES.h:
676         * html/shadow/ImageControlsRootElement.cpp:
677         (WebCore::ImageControlsRootElement::maybeCreate):
678         * html/shadow/ImageControlsRootElement.h:
679         * html/shadow/MediaControlElements.cpp:
680         (WebCore::MediaControlPanelElement::create):
681         (WebCore::MediaControlPanelEnclosureElement::create):
682         (WebCore::MediaControlOverlayEnclosureElement::create):
683         (WebCore::MediaControlTimelineContainerElement::create):
684         (WebCore::MediaControlVolumeSliderContainerElement::create):
685         (WebCore::MediaControlStatusDisplayElement::create):
686         (WebCore::MediaControlPanelMuteButtonElement::create):
687         (WebCore::MediaControlVolumeSliderMuteButtonElement::create):
688         (WebCore::MediaControlPlayButtonElement::create):
689         (WebCore::MediaControlOverlayPlayButtonElement::create):
690         (WebCore::MediaControlSeekForwardButtonElement::create):
691         (WebCore::MediaControlSeekBackButtonElement::create):
692         (WebCore::MediaControlRewindButtonElement::create):
693         (WebCore::MediaControlReturnToRealtimeButtonElement::create):
694         (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
695         (WebCore::MediaControlClosedCaptionsContainerElement::create):
696         (WebCore::MediaControlClosedCaptionsTrackListElement::create):
697         (WebCore::MediaControlTimelineElement::create):
698         (WebCore::MediaControlPanelVolumeSliderElement::create):
699         (WebCore::MediaControlFullscreenVolumeSliderElement::create):
700         (WebCore::MediaControlFullscreenButtonElement::create):
701         (WebCore::MediaControlFullscreenVolumeMinButtonElement::create):
702         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::create):
703         (WebCore::MediaControlTimeRemainingDisplayElement::create):
704         (WebCore::MediaControlCurrentTimeDisplayElement::create):
705         * html/shadow/MediaControlElements.h:
706         * html/shadow/MediaControlsApple.h:
707         (WebCore::MediaControlsAppleEventListener::create):
708         * html/shadow/MeterShadowElement.h:
709         (WebCore::MeterInnerElement::create):
710         (WebCore::MeterBarElement::create):
711         (WebCore::MeterValueElement::create):
712         * html/shadow/ProgressShadowElement.h:
713         (WebCore::ProgressInnerElement::create):
714         (WebCore::ProgressBarElement::create):
715         (WebCore::ProgressValueElement::create):
716         * html/shadow/mac/ImageControlsRootElementMac.cpp:
717         (WebCore::ImageControlsRootElement::maybeCreate):
718         * html/track/TextTrackCueList.h:
719         (WebCore::TextTrackCueList::create):
720         * html/track/VTTCue.cpp:
721         (WebCore::VTTCue::create):
722         * html/track/VTTCue.h:
723         (WebCore::VTTCue::create):
724         * html/track/VTTRegion.h:
725         * html/track/VideoTrack.h:
726         * html/track/VideoTrackList.h:
727         * html/track/WebVTTElement.cpp:
728         (WebCore::WebVTTElement::create):
729         * html/track/WebVTTElement.h:
730         * html/track/WebVTTParser.h:
731         * platform/graphics/MediaPlayer.h:
732         (WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
733
734 2015-05-03  Simon Fraser  <simon.fraser@apple.com>
735
736         Make some static data const
737         https://bugs.webkit.org/show_bug.cgi?id=144552
738
739         Reviewed by Andreas Kling.
740
741         Turn baseTable and shiftTable into const data.
742
743         * platform/graphics/FormatConverter.cpp:
744
745 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
746
747         Assertion failure (!needsLayout()) loading inkedmag.com
748         https://bugs.webkit.org/show_bug.cgi?id=144528
749         rdar://problem/20788681
750
751         Reviewed by Darin Adler.
752         
753         When animated GIFs get into catch-up mode, which is common on inkedmag.com,
754         BitmapImage::advanceAnimation() can synchronously call it's observer's
755         animationAdvanced(). This could cause RenderImage::repaintOrMarkForLayout()
756         to repaint or mark itself as needing layout in the middle of painting.
757         If painting multiple tiles, this could occur when painting the first tile,
758         and then painting the second tile would assert in RenderView::paint().
759         
760         It's always wrong to synchronously call the observer when advancing
761         the animation, since this happens when painting, and you can't repaint
762         when painting. The long comment and call to startAnimation(DoNotCatchUp)
763         was required to explain and work around this, but it's simpler to just
764         advance the animation on a zero-delay timer.
765         
766         Special handling is required for the case where internalAdvanceAnimation()
767         is catching up, and reaches the end of a non-repeating image; there, we
768         have to set a flag and do the notify on a zero-delay timer.
769         
770         Lots of comment cleanup.
771
772         Test: fast/images/set-needs-layout-in-painting.html
773
774         * platform/graphics/BitmapImage.cpp:
775         (WebCore::BitmapImage::BitmapImage):
776         (WebCore::BitmapImage::startTimer): Utility to create and start the timer.
777         (WebCore::BitmapImage::repetitionCount):
778         (WebCore::BitmapImage::startAnimation): Early return in the DoNotCatchUp clause.
779         If skipping, and internalAdvanceAnimation() returns false (meaning it must have
780         reached the end), then queue up a notify. Change the normal behavior to just
781         start the timer.
782         (WebCore::BitmapImage::stopAnimation):
783         (WebCore::BitmapImage::internalAdvanceAnimation): Notify if the flag is set.
784         * platform/graphics/BitmapImage.h:
785         * rendering/RenderReplaced.cpp:
786         (WebCore::RenderReplaced::paint): Add a SetLayoutNeededForbiddenScope to
787         detect setNeedsLayouts when painting replaced elements, including images.
788
789 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
790
791         [GTK][EFL] Unify platform display handling
792         https://bugs.webkit.org/show_bug.cgi?id=144517
793
794         Reviewed by Martin Robinson.
795
796         There are several places were we are handling the X display
797         connection:
798
799         - GLContext::sharedX11Display() creates a new connection.
800         - X11Helper::nativeDisplay() creates a new connection.
801         - BackingStoreBackendCairoX11 uses the GTK+ shared connection.
802         - NetscapePlugin::x11HostDisplay() uses the GTK+/ecore shared connection
803         - The rest of the GTK+ code uses the shared GTK+ connection
804
805         And then we also have WaylandDisplay and the code to check if the
806         current display is wayland or X11.
807         We could unify all these to share the same connection to reduce
808         the amount of ifdefs and ensure a single connection. That will
809         also allow us to use "smart pointers" for the X resources that
810         need a Display* to be freed.
811
812         * PlatformEfl.cmake: Add new files to compilation.
813         * PlatformGTK.cmake: Move some files to WebCore_SOURCES sinc ethey
814         don't use GTK+ anymore, and add new files to compilation.
815         * platform/graphics/GLContext.cpp:
816         (WebCore::GLContext::cleanupActiveContextsAtExit): Remove the
817         custom X11 connection.
818         (WebCore::GLContext::createContextForWindow): Check if the shared
819         display is Wayland to create a EGL context in such case.
820         * platform/graphics/PlatformDisplay.cpp: Added.
821         (WebCore::PlatformDisplay::createPlatformDisplay): Creates the
822         shared display, using the GTK+/ecore shared connection.
823         (WebCore::PlatformDisplay::sharedDisplay): Return the shared display.
824         * platform/graphics/PlatformDisplay.h: Added.
825         * platform/graphics/egl/GLContextEGL.cpp:
826         (WebCore::sharedEGLDisplay): Use PlatformDisplay::sharedDisplay()
827         to get the native display.
828         (WebCore::GLContextEGL::createPixmapContext): Ditto.
829         * platform/graphics/glx/GLContextGLX.cpp:
830         (WebCore::GLContextGLX::createWindowContext): Ditto.
831         (WebCore::GLContextGLX::createPbufferContext): Ditto.
832         (WebCore::GLContextGLX::createPixmapContext): Ditto.
833         (WebCore::GLContextGLX::createContext): Ditto.
834         (WebCore::GLContextGLX::~GLContextGLX): Ditto.
835         (WebCore::GLContextGLX::defaultFrameBufferSize): Ditto.
836         (WebCore::GLContextGLX::makeContextCurrent): Ditto.
837         (WebCore::GLContextGLX::swapBuffers): Ditto.
838         (WebCore::GLContextGLX::cairoDevice): Ditto.
839         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
840         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): Ditto.
841         * platform/graphics/surfaces/glx/X11Helper.cpp:
842         (WebCore::X11Helper::nativeDisplay): Ditto.
843         * platform/graphics/wayland/PlatformDisplayWayland.cpp: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.cpp.
844         (WebCore::PlatformDisplayWayland::globalCallback):
845         (WebCore::PlatformDisplayWayland::globalRemoveCallback):
846         (WebCore::PlatformDisplayWayland::create): Renamed instance() as
847         create() since the single instance is now handled by PlatformDisplay.
848         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
849         (WebCore::PlatformDisplayWayland::createSurface):
850         (WebCore::PlatformDisplayWayland::createSharingGLContext):
851         * platform/graphics/wayland/PlatformDisplayWayland.h: Renamed from Source/WebCore/platform/graphics/wayland/WaylandDisplay.h.
852         * platform/graphics/x11/PlatformDisplayX11.cpp: Added.
853         (WebCore::PlatformDisplayX11::PlatformDisplayX11):
854         (WebCore::PlatformDisplayX11::~PlatformDisplayX11):
855         * platform/graphics/x11/PlatformDisplayX11.h: Added.
856         * platform/gtk/GtkUtilities.cpp:
857         (WebCore::getDisplaySystemType): Deleted.
858         * platform/gtk/GtkUtilities.h:
859
860 2015-05-03  Carlos Garcia Campos  <cgarcia@igalia.com>
861
862         [GTK] API tests crashing on debug builds due to extra unref
863         https://bugs.webkit.org/show_bug.cgi?id=144508
864
865         Reviewed by Mario Sanchez Prada.
866
867         The problem is that we were assuming that when a new DOMWindow is
868         created, the DOM object cache was notified about the previous
869         DOMWindow being destroyed before objects for the new DOMWindow are
870         added to the cache. However, that's not always the case and we
871         only create a DOMWindowObserver for the first DOMWindow. We need
872         to keep a pointer to the DOMWindow being observed to clear() the
873         cache and create a new DOMWindowObserver when it changes in the
874         Frame.
875
876         Fixes crashes in several unit tests in debug builds.
877
878         * bindings/gobject/DOMObjectCache.cpp:
879
880 2015-05-03  Alexey Proskuryakov  <ap@apple.com>
881
882         Remove timer alignment logging that I added earler today.
883
884         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
885
886 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
887
888         Purge PassRefPtr create() factory functions in html 
889         https://bugs.webkit.org/show_bug.cgi?id=144522
890
891         Reviewed by Darin Adler.
892
893         Return Ref instead of PassRefPtr in create() factory functions in html, because the factory
894         can't return null. This patch is a first step to purge in html. Following patch is going to
895         be uploaded.
896
897         No new tests, no behavior changes.
898
899         * html/FileInputType.cpp:
900         (WebCore::UploadButtonElement::create):
901         (WebCore::UploadButtonElement::createForMultiple):
902         * html/MediaController.cpp:
903         (MediaController::create):
904         * html/MediaController.h:
905         * html/canvas/WebGLBuffer.cpp:
906         (WebCore::WebGLBuffer::create):
907         * html/canvas/WebGLBuffer.h:
908         * html/canvas/WebGLContextAttributes.cpp:
909         (WebCore::WebGLContextAttributes::create):
910         * html/canvas/WebGLContextAttributes.h:
911         * html/canvas/WebGLContextGroup.cpp:
912         (WebCore::WebGLContextGroup::create):
913         * html/canvas/WebGLContextGroup.h:
914         * html/canvas/WebGLFramebuffer.cpp:
915         (WebCore::WebGLFramebuffer::create):
916         * html/canvas/WebGLFramebuffer.h:
917         * html/canvas/WebGLProgram.cpp:
918         (WebCore::WebGLProgram::create):
919         * html/canvas/WebGLProgram.h:
920         * html/canvas/WebGLQuery.cpp:
921         (WebCore::WebGLQuery::create):
922         * html/canvas/WebGLQuery.h:
923         * html/canvas/WebGLRenderbuffer.cpp:
924         (WebCore::WebGLRenderbuffer::create):
925         * html/canvas/WebGLRenderbuffer.h:
926         * html/canvas/WebGLSampler.cpp:
927         (WebCore::WebGLSampler::create):
928         * html/canvas/WebGLSampler.h:
929         * html/canvas/WebGLShader.cpp:
930         (WebCore::WebGLShader::create):
931         * html/canvas/WebGLShader.h:
932         * html/canvas/WebGLShaderPrecisionFormat.cpp:
933         (WebCore::WebGLShaderPrecisionFormat::create):
934         * html/canvas/WebGLShaderPrecisionFormat.h:
935         * html/canvas/WebGLSync.cpp:
936         (WebCore::WebGLSync::create):
937         * html/canvas/WebGLSync.h:
938         * html/canvas/WebGLTexture.cpp:
939         (WebCore::WebGLTexture::create):
940         * html/canvas/WebGLTexture.h:
941         * html/canvas/WebGLTransformFeedback.cpp:
942         (WebCore::WebGLTransformFeedback::create):
943         * html/canvas/WebGLTransformFeedback.h:
944         * html/canvas/WebGLUniformLocation.cpp:
945         (WebCore::WebGLUniformLocation::create):
946         * html/canvas/WebGLUniformLocation.h:
947         * html/canvas/WebGLVertexArrayObject.cpp:
948         (WebCore::WebGLVertexArrayObject::create):
949         * html/canvas/WebGLVertexArrayObject.h:
950         * html/canvas/WebGLVertexArrayObjectOES.cpp:
951         (WebCore::WebGLVertexArrayObjectOES::create):
952         * html/canvas/WebGLVertexArrayObjectOES.h:
953
954 2015-05-02  Andreas Kling  <akling@apple.com>
955
956         Style recalc always causes detach from shared StyleRareNonInheritedData.
957         <https://webkit.org/b/144530>
958
959         Reviewed by Darin Adler.
960
961         StyleResolver::adjustStyleForMaskImages() was always calling RenderStyle::ensureMaskLayers()
962         when we were in style recalc. This caused the RenderStyle to COW off from the previously
963         shared StyleRareNonInheritedData even if nothing actually changes.
964
965         This patch adds an early return to adjustStyleForMaskImages() when the previous style had
966         no mask images. Further refinements could be made, but this covers the most common case where
967         we don't have any mask images at all.
968
969         * css/StyleResolver.cpp:
970         (WebCore::StyleResolver::adjustStyleForMaskImages):
971
972 2015-05-02  Alexey Proskuryakov  <ap@apple.com>
973
974         fast/frames/flattening/iframe-flattening-resize-event-count.html times out on Yosemite WK2
975         https://bugs.webkit.org/show_bug.cgi?id=144155
976
977         Unreviewed, will roll out soon.
978
979         Added some temporary logging to better see if alignment is indeed the culprit.
980
981         * page/Settings.cpp: (WebCore::Settings::setDOMTimerAlignmentInterval):
982
983 2015-05-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
984
985         Use Ref instead of PassRefPtr in WebCore/svg 
986         https://bugs.webkit.org/show_bug.cgi?id=144479
987
988         Reviewed by Darin Adler.
989
990         Remove remained PassRefPtr in svg.
991
992         No new tests, no behavior changes.
993
994         * svg/SVGFontFaceSrcElement.cpp:
995         (WebCore::SVGFontFaceSrcElement::srcValue):
996         * svg/SVGFontFaceSrcElement.h:
997         * svg/properties/SVGPropertyInfo.h:
998
999 2015-05-02  Simon Fraser  <simon.fraser@apple.com>
1000
1001         Small cleanup in BitmapImage
1002         https://bugs.webkit.org/show_bug.cgi?id=144515
1003
1004         Reviewed by Darin Adler.
1005
1006         Use an enum for the internalAdvanceAnimation() argument, with a default.
1007         
1008         Wrap the clearing of the timer in a clearTimer() function, called from
1009         stopAnimation(). This fixes the jarring reading of BitmapImage::internalAdvanceAnimation(),
1010         which used to start by calling stopAnimation().
1011
1012         * platform/graphics/BitmapImage.cpp:
1013         (WebCore::BitmapImage::clearTimer):
1014         (WebCore::BitmapImage::startAnimation):
1015         (WebCore::BitmapImage::stopAnimation):
1016         (WebCore::BitmapImage::advanceAnimation):
1017         (WebCore::BitmapImage::internalAdvanceAnimation):
1018         * platform/graphics/BitmapImage.h:
1019         * platform/graphics/Image.h:
1020
1021 2015-05-01  Simon Fraser  <simon.fraser@apple.com>
1022
1023         Avoid compositing updates after style recalcs which have no compositing implications
1024         https://bugs.webkit.org/show_bug.cgi?id=144502
1025
1026         Reviewed by Darin Adler.
1027         
1028         After r183461, we have reliable information about whether a style change with zero
1029         diff can be reliably ignored. Use that information to track whether a given
1030         recalcStyle() does anything which should force a compositing update.
1031         
1032         This eliminates up to 40% of the post-recalcStyle compositing updates on some pages.
1033         
1034         Add Internals API to test.
1035
1036         Test: compositing/updates/no-style-change-updates.html
1037
1038         * dom/Document.cpp:
1039         (WebCore::Document::recalcStyle): Tell the FrameView we're going to recalc style.
1040         * page/FrameView.cpp:
1041         (WebCore::FrameView::willRecalcStyle): Pass it on to the compositor.
1042         (WebCore::FrameView::updateCompositingLayersAfterStyleChange): Move the code
1043         that was here into RenderLayerCompositor::didRecalcStyleWithNoPendingLayout().
1044         * page/FrameView.h:
1045         * rendering/RenderLayerCompositor.cpp:
1046         (WebCore::RenderLayerCompositor::willRecalcStyle): Reset the m_layerNeedsCompositingUpdate flag.
1047         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): Bail on the update if
1048         no layers changed.
1049         (WebCore::RenderLayerCompositor::updateCompositingLayers): Logging. Increment m_compositingUpdateCount,
1050         which is used for testing.
1051         (WebCore::RenderLayerCompositor::layerStyleChanged): Set the m_layerNeedsCompositingUpdate flag.
1052         (WebCore::RenderLayerCompositor::startTrackingCompositingUpdates): Reset the counter.
1053         (WebCore::RenderLayerCompositor::compositingUpdateCount):
1054         * rendering/RenderLayerCompositor.h:
1055         * testing/Internals.cpp:
1056         (WebCore::Internals::startTrackingCompositingUpdates):
1057         (WebCore::Internals::compositingUpdateCount):
1058         * testing/Internals.h:
1059         * testing/Internals.idl:
1060
1061 2015-05-01  Andreas Kling  <akling@apple.com>
1062
1063         Reproducible crash removing name attribute from <img> node
1064         <https://webkit.org/b/144371>
1065         <rdar://problem/17198583>
1066
1067         Reviewed by Darin Adler.
1068
1069         The problem here was with HTMLImageElement::getNameAttribute(), which relies
1070         on Element::hasName() to avoid slow attribute lookups when the attribute
1071         is already known not to be present. Unfortunately hasName() uses an ElementData
1072         flag that wasn't getting updated until after the call to parseAttribute().
1073
1074         This patch fixes the issue by moving the code that updates the hasName() flag
1075         before the parseAttribute() virtual dispatch.
1076
1077         Test: fast/dom/HTMLImageElement/remove-name-id-attribute-from-image.html
1078
1079         * dom/Element.cpp:
1080         (WebCore::Element::attributeChanged):
1081
1082 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
1083
1084         Postpone caption style sheet creation
1085         https://bugs.webkit.org/show_bug.cgi?id=144499
1086
1087         Reviewed by Simon Fraser.
1088         
1089         Generating and inserting the caption user style sheet is expensive so don't do it until
1090         we see a text track, and only do it for the first video element in a PageGroup.
1091
1092         Test: media/track/track-user-stylesheet.html
1093
1094         * html/HTMLMediaElement.cpp:
1095         (WebCore::HTMLMediaElement::registerWithDocument): Only register for caption preferences
1096         changes if we have done so before.
1097         (WebCore::HTMLMediaElement::unregisterWithDocument): Only unregister for caption preferences
1098         changes if we registered for them.
1099         (WebCore::HTMLMediaElement::addTextTrack): Register for caption preference changes.
1100         * html/HTMLMediaElement.h:
1101
1102         * page/CaptionUserPreferencesMediaAF.cpp:
1103         (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges): Only
1104         generate the style sheet when called for the first time.
1105
1106 2015-05-01  Dean Jackson  <dino@apple.com>
1107
1108         [iOS] Scrubber display is broken if the buffered range is empty
1109         https://bugs.webkit.org/show_bug.cgi?id=144511
1110
1111         Reviewed by Eric Carlson.
1112
1113         Make sure that if video.buffered returns an empty list, we
1114         still draw the scrubber background correctly.
1115
1116         * Modules/mediacontrols/mediaControlsiOS.js:
1117         (ControllerIOS.prototype.drawTimelineBackground): Ensure that buffered
1118         is always at least as big as the current time.
1119
1120 2015-05-01  Roger Fong  <roger_fong@apple.com>
1121
1122         Media control volume slider should be vertical to avoid flickering issues.
1123         https://bugs.webkit.org/show_bug.cgi?id=144496.
1124         <rdar://problem/20451328>
1125
1126         Reviewed by Darin Adler.
1127
1128         * Modules/mediacontrols/mediaControlsApple.css:
1129         Resize and reposition the volume box so that it does not have to rotated via a transform.
1130         (audio::-webkit-media-controls-panel):
1131         (audio::-webkit-media-controls-panel .volume-box): Also set overflow: hidden so we can't interact
1132              with the volume slider while the volume box is hidden.
1133         (audio::-webkit-media-controls-panel .volume-box:active):
1134         Rotate and position the volume slider via transforms. Make sure it's not transformed in the fullscreen controls.
1135         (video::-webkit-media-controls-volume-slider):
1136         (video:-webkit-full-screen::-webkit-media-controls-volume-slider):
1137
1138 2015-05-01  Brent Fulgham  <bfulgham@apple.com>
1139
1140         Expand test infrastructure to support scrolling tests (Part 4): Scroll Snap Support
1141         https://bugs.webkit.org/show_bug.cgi?id=144482
1142
1143         Reviewed by Simon Fraser.
1144
1145         New tests will be landed in a second patch.
1146
1147         The new WheelEventTestTriggers do not work properly with scroll snap points, because some test deferral notifications
1148         need to be triggered for state changes on the scrolling thread. This required the following changes:
1149         1. A flag indicating that we want to know about WheelEvent state changes needed to be propagated to the scrolling thread,
1150            so that tests could be deferred until Scrolling thread rubberband or scroll-snap animations had completed.
1151         2. The ScrollingNodeID needed to be used for registering and clearing deferrals.
1152         3. The scrolling thread needed a way to dispatch messages to the main thread indicating that we should (or should not)
1153            defer tests due to scrolling actions.
1154
1155         Note that a future patch will extend this support to include the RemoteScrollingTree.
1156
1157         * page/WheelEventTestTrigger.cpp:
1158         (WebCore::WheelEventTestTrigger::deferTestsForReason): Added some logging features.
1159         (WebCore::WheelEventTestTrigger::removeTestDeferralForReason): Ditto.
1160         (WebCore::dumpState): Helper function for logging test deferral state.
1161         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Added some logging features.
1162         * page/scrolling/AsyncScrollingCoordinator.cpp:
1163         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Make sure that the scrolling thread is
1164         told that it needs to send scrolling state back to the main thread. Only do this if we are in testing mode.
1165         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): The scrollingNodeID should be
1166         used as the identifier for this operation, not the page address.
1167         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added. receives messages from the scrolling thread
1168         and notifies the testing infrastructure.
1169         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
1170         * page/scrolling/AsyncScrollingCoordinator.h:
1171         * page/scrolling/ScrollingStateScrollingNode.cpp:
1172         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): When cloning the ScrollingStateScrollingNode,
1173         include the testing mode state.
1174         (WebCore::ScrollingStateScrollingNode::setExpectsWheelEventTestTrigger): Added.
1175         * page/scrolling/ScrollingStateScrollingNode.h:
1176         (WebCore::ScrollingStateScrollingNode::expectsWheelEventTestTrigger): Added.
1177         * page/scrolling/ScrollingTree.h:
1178         (WebCore::ScrollingTree::deferTestsForReason): Added stub.
1179         (WebCore::ScrollingTree::removeTestDeferralForReason): Ditto.
1180         * page/scrolling/ThreadedScrollingTree.cpp:
1181         (WebCore::ThreadedScrollingTree::deferTestsForReason): Added. Dispatches messages from the scrolling thread to the
1182         main thread.
1183         (WebCore::ThreadedScrollingTree::removeTestDeferralForReason): Ditto.
1184         * page/scrolling/ThreadedScrollingTree.h:
1185         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1186         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1187         (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Initialize testing state flag.
1188         (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren): If the 'ExpectsWheelEventTestTrigger' flag is
1189         set, update local state.
1190         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): If we are testing, and the wheel event should be handled
1191         asynchronously, tell the testing infrastructure we need to wait for the thread state to sync.
1192         (WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason): Added. Notifies test system we need to defer tests
1193         until we notify them. Also used by the ScrollController during animations.
1194         (WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason): Ditto.
1195         * platform/Logging.h:
1196         * platform/ScrollAnimator.cpp:
1197         (WebCore::ScrollAnimator::deferTestsForReason): Added. Used by ScrollController during animation. This updates the
1198         testing infrastructure directly, since it is running in the same process and main thread.
1199         (WebCore::ScrollAnimator::removeTestDeferralForReason): Ditto.
1200         * platform/ScrollAnimator.h:
1201         * platform/cocoa/ScrollController.h:
1202         (WebCore::ScrollControllerClient::deferTestsForReason): Change client API.
1203         (WebCore::ScrollControllerClient::removeTestDeferralForReason): Ditto.
1204         (WebCore::ScrollControllerClient::testTrigger): Deleted.
1205         * platform/cocoa/ScrollController.mm:
1206         (WebCore::ScrollController::startSnapRubberbandTimer): Use new client API.
1207         (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
1208         (WebCore::ScrollController::startScrollSnapTimer): Ditto.
1209         (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
1210
1211 2015-05-01  Joseph Pecoraro  <pecoraro@apple.com>
1212
1213         Inline some small methods instead of them being EXPORT'd and out of line
1214         https://bugs.webkit.org/show_bug.cgi?id=144498
1215
1216         Reviewed by Darin Adler.
1217
1218         * page/Page.cpp:
1219         (WebCore::Page::testTrigger): Deleted.
1220         (WebCore::Page::clearTrigger): Deleted.
1221         (WebCore::Page::expectsWheelEventTriggers): Deleted.
1222         * page/Page.h:
1223         (WebCore::Page::testTrigger):
1224         (WebCore::Page::clearTrigger):
1225         (WebCore::Page::expectsWheelEventTriggers):
1226
1227 2015-05-01  Dan Bernstein  <mitz@apple.com>
1228
1229         WebCore part of <rdar://problem/8636045> Back/forward navigation to an error page in Safari breaks the back-forward list
1230         https://bugs.webkit.org/show_bug.cgi?id=144501
1231
1232         Reviewed by Darin Adler.
1233
1234         Test: TestWebKitAPI/Tests/WebKit2Cocoa/LoadAlternateHTMLString.mm
1235
1236         Normally, loading substitute data (such as an error page) creates a new back-forward list
1237         item. FrameLoader has a mechanism that detects when a substitute data load occurs during
1238         handling of a provisional load error and prevents the creation of a new back-forwards list
1239         item in that case if the unreachable URL is the same as the failing provisional URL. This
1240         mechanism was broken in WebKit2, where handling the provisional load error is asynchronous.
1241
1242         The fix is to capture some state (namely, the failing provisional URL) when dispatching the
1243         load error and allow it to be restored when loading the substitute data.
1244
1245         * loader/FrameLoader.cpp:
1246         (WebCore::FrameLoader::FrameLoader): Removed initialization of
1247         m_delegateIsHandlingProvisionalLoadError.
1248         (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL): Instead of checking
1249         m_delegateIsHandlingProvisionalLoadError and if true using the provisional document loader’s
1250         URL, check m_provisionalLoadErrorBeingHandledURL.
1251         (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Instead of checking and setting
1252         m_delegateIsHandlingProvisionalLoadError, use m_provisionalLoadErrorBeingHandledURL.
1253         * loader/FrameLoader.h:
1254         (WebCore::FrameLoader::provisionalLoadErrorBeingHandledURL): Added this getter. The client
1255         can call this from its override of dispatchDidFailProvisionalLoad and store the result.
1256         (WebCore::FrameLoader::setProvisionalLoadErrorBeingHandledURL): Added this setter. The
1257         client can call this prior to loading substitute data if it’s done as part of handling a
1258         previously-dispatched didFailProvisionalLoad.
1259
1260 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
1261
1262         USE(...) macro should expect unprefixed variables
1263         https://bugs.webkit.org/show_bug.cgi?id=144454
1264
1265         Reviewed by Daniel Bates.
1266
1267         * DerivedSources.make: Replace all occurrences WTF_USE with USE.
1268         * PlatformEfl.cmake: Ditto.
1269         * PlatformGTK.cmake: Ditto.
1270         * bindings/objc/PublicDOMInterfaces.h: Ditto.
1271         * config.h: Ditto.
1272         * crypto/mac/SerializedCryptoKeyWrapMac.mm: Ditto.
1273         * page/AlternativeTextClient.h: Ditto.
1274         * platform/efl/FileSystemEfl.cpp: Ditto.
1275         (WebCore::fileSystemRepresentation): Ditto.
1276         * platform/graphics/cg/ImageBufferDataCG.h: Ditto.
1277         * platform/graphics/cg/PDFDocumentImage.h: Ditto.
1278         * platform/ios/wak/WAKAppKitStubs.h: Ditto.
1279         * rendering/RenderLayerCompositor.cpp: Ditto.
1280
1281 2015-05-01  Myles C. Maxfield  <mmaxfield@apple.com>
1282
1283         [OS X] Text dilation parameters are not restored after being set
1284         https://bugs.webkit.org/show_bug.cgi?id=144507
1285         <rdar://problem/19446938>
1286
1287         Reviewed by Simon Fraser and Ned Holbrook.
1288
1289         Create a RAII class who is in charge of saving, applying, and restoring dilation parameters. Use this class
1290         around our text drawing routines.
1291
1292         Note that this migrates our use of CTFontSetRenderingParameters() to CTFontSetRenderingStyle().
1293
1294         Test: fast/text/dilation-save-restore.html
1295
1296         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1297         (WebCore::RenderingStyleSaver::RenderingStyleSaver):
1298         (WebCore::RenderingStyleSaver::~RenderingStyleSaver):
1299         (WebCore::showGlyphsWithAdvances):
1300         * platform/spi/cg/CoreGraphicsSPI.h:
1301         * platform/spi/cocoa/CoreTextSPI.h:
1302
1303 2015-05-01  Commit Queue  <commit-queue@webkit.org>
1304
1305         Unreviewed, rolling out r183687.
1306         https://bugs.webkit.org/show_bug.cgi?id=144505
1307
1308         Appears to have caused assertions (Requested by ap on
1309         #webkit).
1310
1311         Reverted changeset:
1312
1313         "Media control volume slider is opaque."
1314         https://bugs.webkit.org/show_bug.cgi?id=144470
1315         http://trac.webkit.org/changeset/183687
1316
1317 2015-05-01  Jeremy Jones  <jeremyj@apple.com>
1318
1319         Stop using deprecated AVKit SPI for enter and exit fullscreen.
1320         https://bugs.webkit.org/show_bug.cgi?id=144493
1321
1322         Reviewed by Jer Noble.
1323
1324         Replace 
1325             -enterFullScreenWithCompletionHandler:
1326             -exitFullScreenWithCompletionHandler:
1327         with
1328             -enterFullScreenAnimated:completionHandler:
1329             -exitFullScreenAnimated:completionHandler:
1330         
1331         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1332         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
1333         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
1334         * platform/spi/cocoa/AVKitSPI.h:
1335
1336 2015-05-01  Roger Fong  <roger_fong@apple.com>
1337
1338         Media control volume slider is opaque.
1339         https://bugs.webkit.org/show_bug.cgi?id=144470.
1340         <rdar://problem/20770350>
1341
1342         Rubberstamped by Simon Fraser.
1343
1344         * Modules/mediacontrols/mediaControlsApple.css:
1345         (audio::-webkit-media-controls-panel): 
1346         Don't create a stacking context just for the controls.
1347         Doing so causes the mix-blend-mode on the volume box to fail.
1348
1349 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
1350
1351         [GTK] REGRESSION(183368): It made editing tests assert
1352         https://bugs.webkit.org/show_bug.cgi?id=144447
1353
1354         Reviewed by Chris Fleizach.
1355
1356         Don't notify platforms of editing actions of type EditActionUnspecified.
1357         If we don't know what the action is, platform accessibility APIs certainly
1358         won't.
1359
1360         Add AXTextEditTypeAttributesChange and AXTextAttributesChanged as catch-alls
1361         for formatting changes. ATK lacks finely-grained signals through which to
1362         specify which text attributes have changed. If other platforms have such
1363         signals, new types can always be added.
1364
1365         Don't post an accessible replacement notification for AXTextEditTypeCut.
1366         The notification is handled by DeleteSelectionCommand. It is possible for
1367         white space to be inserted in preparation for a cut which was triggering
1368         a not-reached assert, but insertion of whitespace in preparation for a
1369         cut does not seem notification-worthy.
1370
1371         Treat AXTextEditTypeDictation the same as other insertion types (insert,
1372         paste, typing) with respect to replacement notifications.
1373
1374         No new tests. The hundreds of editing tests that had been crashing seem sufficient.
1375
1376         * accessibility/AXObjectCache.cpp:
1377         (WebCore::AXObjectCache::showIntent):
1378         (WebCore::AXObjectCache::textChangeForEditType):
1379         * accessibility/AXObjectCache.h:
1380         * accessibility/AXTextStateChangeIntent.h:
1381         * accessibility/atk/AXObjectCacheAtk.cpp:
1382         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1383         * editing/AppendNodeCommand.cpp:
1384         (WebCore::AppendNodeCommand::doApply):
1385         (WebCore::AppendNodeCommand::doUnapply):
1386         * editing/DeleteFromTextNodeCommand.cpp:
1387         (WebCore::DeleteFromTextNodeCommand::doApply):
1388         (WebCore::DeleteFromTextNodeCommand::doUnapply):
1389         * editing/EditCommand.cpp:
1390         (WebCore::EditCommand::applyEditType):
1391         (WebCore::EditCommand::unapplyEditType):
1392         * editing/InsertIntoTextNodeCommand.cpp:
1393         (WebCore::InsertIntoTextNodeCommand::doApply):
1394         (WebCore::InsertIntoTextNodeCommand::doUnapply):
1395         * editing/InsertNodeBeforeCommand.cpp:
1396         (WebCore::InsertNodeBeforeCommand::doApply):
1397         (WebCore::InsertNodeBeforeCommand::doUnapply):
1398         * editing/ReplaceInsertIntoTextNodeCommand.cpp:
1399         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
1400
1401 2015-05-01  Brady Eidson  <beidson@apple.com>
1402
1403         Add API to disable meta refreshes.
1404         <rdar://problem/20333198> and https://bugs.webkit.org/show_bug.cgi?id=144269
1405
1406         Reviewed by Alexey Proskuryakov.
1407
1408         Test: loader/meta-refresh-disabled.html
1409
1410         * dom/Document.cpp:
1411         (WebCore::Document::processHttpEquiv): Bail early if Settings have meta refreshes disabled.
1412         * page/Settings.in:
1413
1414 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
1415
1416         [Freetype] Properly support synthetic oblique in vertical text
1417         https://bugs.webkit.org/show_bug.cgi?id=144492
1418
1419         Reviewed by Sergio Villar Senin.
1420
1421         No new tests. Covered by existing tests.
1422
1423         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1424         (WebCore::FontPlatformData::initializeWithFontFace): Skew vertical when using synthetic
1425         oblique for vertical text.
1426
1427 2015-05-01  Joanmarie Diggs  <jdiggs@igalia.com>
1428
1429         AX: [ATK] REGRESSION: accessibility/canvas-fallback-content.html now crashes
1430         https://bugs.webkit.org/show_bug.cgi?id=144481
1431
1432         Reviewed by Chris Fleizach.
1433
1434         Canvas fallback content is allowed to be focusable if the canvas is displayed
1435         and visible. Update the style when creating an accessible object for a node in
1436         a canvas subtree and before Element::isFocusable() gets called.
1437
1438         No new tests. The existing, crashing test no longer crashes.
1439
1440         * accessibility/AXObjectCache.cpp:
1441         (WebCore::AXObjectCache::getOrCreate):
1442
1443 2015-05-01  Alex Christensen  <achristensen@webkit.org>
1444
1445         [Content Extensions] Add CombinedURLFilters debugging code.
1446         https://bugs.webkit.org/show_bug.cgi?id=144491
1447
1448         Reviewed by Daniel Bates.
1449
1450         No change in behavior.
1451
1452         * contentextensions/CombinedURLFilters.cpp:
1453         (WebCore::ContentExtensions::recursiveMemoryUsed):
1454         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
1455         (WebCore::ContentExtensions::prefixTreeVertexToString):
1456         (WebCore::ContentExtensions::recursivePrint):
1457         (WebCore::ContentExtensions::CombinedURLFilters::print):
1458         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
1459         (WebCore::ContentExtensions::generateNFAForSubtree):
1460         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
1461         * contentextensions/CombinedURLFilters.h:
1462         * contentextensions/NFA.cpp:
1463         (WebCore::ContentExtensions::NFA::memoryUsed):
1464         * contentextensions/NFA.h:
1465         * contentextensions/Term.h:
1466         (WebCore::ContentExtensions::quantifierToString):
1467         (WebCore::ContentExtensions::Term::toString):
1468
1469 2015-05-01  Eric Carlson  <eric.carlson@apple.com>
1470
1471         Fix text track language selection logic
1472         https://bugs.webkit.org/show_bug.cgi?id=144467
1473
1474         Reviewed by Brent Fulgham.
1475
1476         No new tests, media/track/track-language-preference.html was updated.
1477
1478         * html/HTMLMediaElement.cpp:
1479         (WebCore::HTMLMediaElement::configureTextTrackGroup): Correct a minor style typo.
1480         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Update logging.
1481
1482         * page/CaptionUserPreferences.cpp:
1483         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Minor cleanup.
1484         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Give exact matches a
1485         higher score.
1486
1487         * page/CaptionUserPreferencesMediaAF.cpp:
1488         (WebCore::CaptionUserPreferencesMediaAF::textTrackSelectionScore): Update for 
1489         indexOfBestMatchingLanguageInList change.
1490
1491         * platform/Language.cpp:
1492         (WebCore::indexOfBestMatchingLanguageInList): Add parameter for exact match. Convert the
1493         passed language to lower case as we do with the preferred languages.
1494         * platform/Language.h:
1495
1496 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
1497
1498         [Freetype] Add support for the font-synthesis property
1499         https://bugs.webkit.org/show_bug.cgi?id=144472
1500
1501         Reviewed by Sergio Villar Senin.
1502
1503         No new tests. This causes fast/css3-text/font-synthesis.html to pass
1504         for WebKitGTK+.
1505
1506         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1507         (WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
1508         (WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.
1509
1510 2015-05-01  Martin Robinson  <mrobinson@igalia.com>
1511
1512         [GTK] New CORS tests from r183280 fail on WebKitGTK+
1513         https://bugs.webkit.org/show_bug.cgi?id=144469
1514
1515         Reviewed by Sergio Villar Senin.
1516
1517         No new tests. This causes failing tests to pass.
1518
1519         * platform/network/soup/ResourceHandleSoup.cpp:
1520         (WebCore::doRedirect): Clear the origin header on cross-origin redirects.
1521
1522 2015-04-30  Alex Christensen  <achristensen@webkit.org>
1523
1524         Compile fix when using content extensions debugging code.
1525
1526         * contentextensions/ContentExtensionCompiler.cpp:
1527         (WebCore::ContentExtensions::compileRuleList):
1528         * contentextensions/ContentExtensionsDebugging.h:
1529         * contentextensions/DFA.cpp:
1530         (WebCore::ContentExtensions::printTransitions):
1531         (WebCore::ContentExtensions::DFA::debugPrintDot):
1532         * contentextensions/DFANode.h:
1533         * contentextensions/NFA.cpp:
1534         (WebCore::ContentExtensions::NFA::memoryUsed):
1535         (WebCore::ContentExtensions::NFA::debugPrintDot):
1536
1537 2015-04-30  Dan Bernstein  <mitz@apple.com>
1538
1539         Fixed the build for <rdar://problem/20758514>
1540
1541         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
1542         (WebCore::AudioSourceProviderAVFObjC::destroyMix): Don’t pass nil to
1543         -[AVMutableAudioMix setInputParameters:].
1544
1545 2015-04-30  Daniel Bates  <dabates@apple.com>
1546
1547         Clean up: Remove unnecessary runtime computation of string length
1548         https://bugs.webkit.org/show_bug.cgi?id=144483
1549
1550         Reviewed by Joseph Pecoraro.
1551
1552         Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
1553         computes strlen() of the first string literal as part of concatenating two string literals.
1554         It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
1555         string literal because the size of the string literal is known at compile time.
1556
1557         * Modules/webdatabase/DatabaseBackendBase.cpp:
1558         (WebCore::fullyQualifiedInfoTableName):
1559
1560 2015-04-30  Dean Jackson  <dino@apple.com>
1561
1562         Expose -apple-system as a font family
1563         https://bugs.webkit.org/show_bug.cgi?id=144484
1564         <rdar://problem/20767330>
1565
1566         Reviewed by Tim Horton.
1567
1568         Accept "-apple-system" for the font-family property, and
1569         rename "-apple-system-font-monospaced-numbers" to
1570         "-apple-system-monospaced-numbers".
1571
1572         Also change the media controls to use the new name.
1573
1574         Covered by existing tests and this new one:
1575             fast/text/system-font-legacy-name.html
1576
1577         * Modules/mediacontrols/mediaControlsApple.css:
1578         (audio::-webkit-media-controls-time-remaining-display):
1579         * Modules/mediacontrols/mediaControlsiOS.css:
1580         (::-webkit-media-controls):
1581         (audio::-webkit-media-controls-time-remaining-display):
1582         (audio::-webkit-media-controls-status-display):
1583         * platform/graphics/ios/FontCacheIOS.mm: Add support for the new name.
1584         (WebCore::createCTFontWithFamilyNameAndWeight):
1585         * platform/graphics/mac/FontCacheMac.mm: Ditto.
1586         (WebCore::fontWithFamily):
1587
1588 2015-04-30  Javier Fernandez  <jfernandez@igalia.com>
1589
1590         [CSS Grid Layout] overflow-position keyword for align and justify properties.
1591         https://bugs.webkit.org/show_bug.cgi?id=144235
1592
1593         Reviewed by Sergio Villar Senin.
1594
1595         When the alignment subject is larger than the alignment container,
1596         it will overflow. Some alignment modes, if honored in this
1597         situation, may cause data loss; an overflow alignment mode can be
1598         explicitly specified to avoid this.
1599
1600         This patch implements overflow-keyword handling for Grid Layout on
1601         align-self and justify-self properties.
1602
1603         Test: fast/css-grid-layout/grid-align-justify-overflow.html
1604
1605         * rendering/RenderGrid.cpp:
1606         (WebCore::computeOverflowAlignmentOffset):
1607         (WebCore::RenderGrid::rowPositionForChild):
1608         (WebCore::RenderGrid::columnPositionForChild):
1609         (WebCore::RenderGrid::rowAxisPositionForChild): Deleted.
1610         * rendering/style/RenderStyle.cpp:
1611         (WebCore::resolveAlignmentData):
1612         (WebCore::resolveJustificationData):
1613         (WebCore::RenderStyle::resolveAlignment):
1614         (WebCore::RenderStyle::resolveAlignmentOverflow):
1615         (WebCore::RenderStyle::resolveJustification):
1616         (WebCore::RenderStyle::resolveJustificationOverflow):
1617         * rendering/style/RenderStyle.h:
1618
1619 2015-04-30  Jon Honeycutt  <jhoneycutt@apple.com>
1620
1621         Rebaseline bindings tests results after r183648.
1622
1623         Unreviewed.
1624
1625         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1626         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
1627         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1628         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
1629         * bindings/scripts/test/JS/JSTestInterface.cpp:
1630         (WebCore::JSTestInterfaceConstructor::constructJSTestInterface):
1631         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
1632         (WebCore::setJSTestInterfaceImplementsStr2):
1633         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
1634         (WebCore::setJSTestInterfaceSupplementalStr2):
1635         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1636         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1637         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1638         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
1639         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1640         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
1641         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
1642         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
1643         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
1644         * bindings/scripts/test/JS/JSTestObj.cpp:
1645         (WebCore::setJSTestObjConstructorStaticStringAttr):
1646         (WebCore::setJSTestObjStringAttr):
1647         (WebCore::setJSTestObjReflectedStringAttr):
1648         (WebCore::setJSTestObjReflectedURLAttr):
1649         (WebCore::setJSTestObjReflectedCustomURLAttr):
1650         (WebCore::setJSTestObjStringAttrWithGetterException):
1651         (WebCore::setJSTestObjStringAttrWithSetterException):
1652         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1653         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1654         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1655         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1656         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1657         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1658         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
1659         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
1660         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
1661         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1662         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
1663         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
1664         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
1665         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
1666         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1667         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1668         (WebCore::JSTestOverloadedConstructorsConstructor::constructJSTestOverloadedConstructors4):
1669         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1670         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
1671         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
1672         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
1673         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1674
1675 2015-04-30  Simon Fraser  <simon.fraser@apple.com>
1676
1677         Fixed elements end up in the middle of the view with pageScale < 1
1678         https://bugs.webkit.org/show_bug.cgi?id=144428
1679         rdar://problem/20404982
1680
1681         Reviewed by Tim Horton.
1682
1683         When pageScale is < 1, we used fixed layout mode, and FrameView::fixedElementsLayoutRelativeToFrame()
1684         returns true. However, the scrolling thread was calling the static scrollOffsetForFixedPosition()
1685         hardcoding 'false' for this parameter.
1686         
1687         Fix by sending the value of fixedElementsLayoutRelativeToFrame over to the scrolling thread,
1688         so we can use it when doing scrolling-thread fixed position stuff.
1689
1690         Not testable.
1691
1692         * page/scrolling/AsyncScrollingCoordinator.cpp:
1693         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1694         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1695         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1696         (WebCore::ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame):
1697         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1698         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1699         (WebCore::ScrollingTreeFrameScrollingNode::ScrollingTreeFrameScrollingNode):
1700         (WebCore::ScrollingTreeFrameScrollingNode::updateBeforeChildren):
1701         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1702         (WebCore::ScrollingTreeFrameScrollingNode::fixedElementsLayoutRelativeToFrame):
1703         (WebCore::ScrollingTreeFrameScrollingNode::shouldUpdateScrollLayerPositionSynchronously): Deleted.
1704         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1705         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1706
1707 2015-04-30  Beth Dakin  <bdakin@apple.com>
1708
1709         Remove invalid assertion from MouseEvent::create()
1710         https://bugs.webkit.org/show_bug.cgi?id=144477
1711
1712         Reviewed by Tim Horton.
1713
1714         mouseforcechanged events and mouseforcewillbegin trigger this assertion. The 
1715         assertion does not seem valuable, so rather than changing it, just remove it.
1716         * dom/MouseEvent.cpp:
1717         (WebCore::MouseEvent::create):
1718
1719 2015-04-30  Dean Jackson  <dino@apple.com>
1720
1721         -apple-system-font-monospaced-numbers doesn't work on iOS
1722         https://bugs.webkit.org/show_bug.cgi?id=144478
1723         <rdar://problem/20544940>
1724
1725         Reviewed by Brent Fulgham.
1726
1727         Make sure to start from the system font descriptor when
1728         asking for a monospaced numeric alternate.
1729
1730         Test: platform/ios-simulator/fast/text/system-monospaced-numbers.html
1731
1732         * platform/graphics/ios/FontCacheIOS.mm:
1733         (WebCore::createCTFontWithFamilyNameAndWeight):
1734
1735 2015-04-30  Oliver Hunt  <oliver@apple.com>
1736
1737         DOM bindings should not be using a reference type to point to a temporary object
1738         https://bugs.webkit.org/show_bug.cgi?id=144474
1739
1740         Reviewed by Beth Dakin.
1741
1742         The DOM bindings will currently try and use a local reference to point
1743         to a temporary object. This currently works as a by product of the compiler's
1744         stack layout. This patch removes the dependency on undefined behaviour
1745         by ensuring that we use a value rather than reference type.
1746
1747         * bindings/scripts/CodeGeneratorJS.pm:
1748         (GenerateParametersCheck):
1749         (GetNativeTypeForCallbacks):
1750
1751 2015-04-30  Brady Eidson  <beidson@apple.com>
1752
1753         Build fix after r183646 for less enlightened platforms.
1754
1755         Unreviewed.
1756
1757         * Modules/webdatabase/DatabaseBackendBase.cpp:
1758         (WebCore::fullyQualifiedInfoTableName): Windows doesn’t have stpcpy :(
1759
1760 2015-04-30  Brady Eidson  <beidson@apple.com>
1761
1762         Javascript using WebSQL can create their own WebKit info table.
1763         <rdar://problem/20688792> and https://bugs.webkit.org/show_bug.cgi?id=144466
1764
1765         Reviewed by Alex Christensen.
1766
1767         Test: storage/websql/alter-to-info-table.html
1768
1769         * Modules/webdatabase/DatabaseBackendBase.cpp:
1770         (WebCore::DatabaseBackendBase::databaseInfoTableName): Return the info table name.
1771         (WebCore::fullyQualifiedInfoTableName): Append "main." to the info table name.
1772         (WebCore::DatabaseBackendBase::DatabaseBackendBase): Use the fully qualified name.
1773         (WebCore::DatabaseBackendBase::performOpenAndVerify): Ditto.
1774         (WebCore::DatabaseBackendBase::getVersionFromDatabase): Ditto.
1775         (WebCore::DatabaseBackendBase::setVersionInDatabase): Ditto.
1776
1777 2015-04-30  Beth Dakin  <bdakin@apple.com>
1778
1779         Should choose UIScrollView indicatorStyle based on the document background color
1780         https://bugs.webkit.org/show_bug.cgi?id=144473
1781         -and corresponding-
1782         rdar://problem/19897699
1783
1784         Reviewed by Simon Fraser.
1785
1786         Export this function.
1787         * platform/graphics/Color.h:
1788
1789 2015-04-30  Brent Fulgham  <bfulgham@apple.com>
1790
1791         [Win] Allow WebKit to build without ANGLE support
1792         https://bugs.webkit.org/show_bug.cgi?id=144459
1793         <rdar://problem/20707307>
1794
1795         Reviewed by Dean Jackson.
1796
1797         * platform/graphics/GLContext.cpp: Use the ENABLE(GRAPHICS_CONTEXT_3D)
1798         macro to avoid compiling this code if not using WEBGL/3D contexts.
1799
1800 2015-04-29  David Hyatt  <hyatt@apple.com>
1801
1802         Avoid containingBlock() calls when no writing mode flipping is needed.
1803         https://bugs.webkit.org/show_bug.cgi?id=144407
1804
1805         Reviewed by Simon Fraser.
1806
1807         Add a bool to RenderView that indicates whether or not any flipped blocks have been
1808         added to the view. Once tainted, the view just stays dirty forever. If no flipped
1809         blocks are ever seen, we can then optimize away calls to containingBlock().
1810
1811         The motivation for this patch is to improve layer position updating, which makes many
1812         calls to topLeftLocationOffset(), one of the functions that can be optimized by this
1813         change.
1814
1815         * rendering/RenderBox.cpp:
1816         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1817         * rendering/RenderBoxModelObject.cpp:
1818         (WebCore::RenderBoxModelObject::updateFromStyle):
1819         * rendering/RenderLayer.cpp:
1820         (WebCore::RenderLayer::calculateClipRects):
1821         * rendering/RenderLineBoxList.cpp:
1822         (WebCore::RenderLineBoxList::rangeIntersectsRect):
1823         * rendering/RenderView.cpp:
1824         (WebCore::RenderView::RenderView):
1825         * rendering/RenderView.h:
1826
1827 2015-04-29  Jer Noble  <jer.noble@apple.com>
1828
1829         Make GenericTaskQueue even more generic (and usable inside platform/)
1830         https://bugs.webkit.org/show_bug.cgi?id=144414
1831
1832         Reviewed by Eric Carlson.
1833
1834         Templatize GenericTaskQueue so that it can be used from within platform/.
1835
1836         * CMakeLists.txt:
1837         * WebCore.vcxproj/WebCore.vcxproj:
1838         * WebCore.vcxproj/WebCore.vcxproj.filters:
1839         * WebCore.xcodeproj/project.pbxproj:
1840         * dom/GenericTaskQueue.cpp: Removed.
1841         * html/HTMLMediaElement.h:
1842         * platform/GenericTaskQueue.h: Renamed from Source/WebCore/dom/GenericTaskQueue.h.
1843         (WebCore::TaskDispatcher::TaskDispatcher): Added default templatized class which just calls the parameter's postTask().
1844         (WebCore::TaskDispatcher::postTask): Call context's postTask().
1845         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Add a timer version which does not require a context.
1846         (WebCore::TaskDispatcher<Timer>::postTask): Set the timer.
1847         (WebCore::TaskDispatcher<Timer>::timerFired): Call the task.
1848         (WebCore::GenericTaskQueue::GenericTaskQueue): Moved from .cpp.
1849         (WebCore::GenericTaskQueue::enqueueTask): Ditto.
1850         (WebCore::GenericTaskQueue::close): Ditto.
1851         (WebCore::GenericTaskQueue::cancelAllTasks): Ditto.
1852         (WebCore::GenericTaskQueue::hasPendingTasks): Ditto.
1853
1854 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1855
1856         Unreviewed build fix. WebCore has a weak symbol.
1857
1858         WebCore has a weak external symbol in it. A common cause of weak external
1859         symbols is when an inline function is listed in the linker export file.
1860         ERROR: symbol __ZNK7WebCore4Page25expectsWheelEventTriggersEv
1861
1862         * page/Page.cpp:
1863         (WebCore::Page::expectsWheelEventTriggers):
1864         * page/Page.h:
1865         (WebCore::Page::expectsWheelEventTriggers): Deleted.
1866
1867 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
1868
1869         Crash at WebCore::Document::absoluteRegionForEventTargets 
1870         https://bugs.webkit.org/show_bug.cgi?id=144426
1871         rdar://problem/20502166
1872
1873         Reviewed by Tim Horton.
1874
1875         When a frame had wheel event handlers, we would register the document itself
1876         as a handler in its parent document. This is problematic, because there's not
1877         code path that removes it when the frame is destroyed.
1878         
1879         It turns out we don't need to do this at all; the non-fast scrollable region
1880         already takes handlers in subframes into account.
1881
1882         Tests: fast/events/wheelevent-in-frame.html
1883                fast/events/wheelevent-in-reattached-frame.html
1884
1885         * dom/Document.cpp:
1886         (WebCore::Document::didAddWheelEventHandler):
1887         (WebCore::Document::didRemoveWheelEventHandler):
1888
1889 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
1890
1891         Not all videos should automatically play to playback target
1892         https://bugs.webkit.org/show_bug.cgi?id=144430
1893         <rdar://problem/20718523>
1894
1895         Reviewed by Darin Adler.
1896
1897         * Modules/mediasession/WebMediaSessionManager.cpp:
1898         (WebCore::WebMediaSessionManager::clientStateDidChange): Consider ExternalDeviceAutoPlayCandidate.
1899         Minor cleanup.
1900
1901         * html/HTMLMediaElement.cpp:
1902         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate when a <video>
1903         has a file with an audio track that does not loop.
1904
1905         * page/MediaProducer.h: Add ExternalDeviceAutoPlayCandidate.
1906
1907 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
1908
1909         LiveNodeList may unexpectedly return an element for empty string
1910         https://bugs.webkit.org/show_bug.cgi?id=144429
1911
1912         Reviewed by Darin Adler.
1913
1914         * dom/LiveNodeList.cpp:
1915         (WebCore::LiveNodeList::namedItem):
1916         Never return a result for an empty string.
1917
1918 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1919
1920         Remove PassRefPtr in SVGFEFooElement classes
1921         https://bugs.webkit.org/show_bug.cgi?id=144425
1922
1923         Reviewed by Darin Adler.
1924
1925         As a step to use Ref instead of PassRefPtr, this patch purges PassRefPtr
1926         in SVGFEFooElement.
1927
1928         No new tests, no behavior changes.
1929
1930         * css/RGBColor.cpp:
1931         (WebCore::RGBColor::create):
1932         * css/RGBColor.h:
1933         * platform/graphics/filters/PointLightSource.h:
1934         (WebCore::PointLightSource::create):
1935         * platform/graphics/filters/SpotLightSource.h:
1936         (WebCore::SpotLightSource::create):
1937         * svg/SVGColor.cpp:
1938         (WebCore::SVGColor::rgbColor):
1939         * svg/SVGColor.h:
1940         * svg/SVGFEDistantLightElement.cpp:
1941         (WebCore::SVGFEDistantLightElement::lightSource):
1942         * svg/SVGFEDistantLightElement.h:
1943         * svg/SVGFELightElement.cpp:
1944         (WebCore::SVGFELightElement::findLightSource):
1945         * svg/SVGFELightElement.h:
1946         * svg/SVGFEPointLightElement.cpp:
1947         (WebCore::SVGFEPointLightElement::lightSource):
1948         * svg/SVGFEPointLightElement.h:
1949         * svg/SVGFESpotLightElement.cpp:
1950         (WebCore::SVGFESpotLightElement::lightSource):
1951         * svg/SVGFESpotLightElement.h:
1952
1953 2015-04-29  Dean Jackson  <dino@apple.com>
1954
1955         Create a named CSS property for system colors
1956         https://bugs.webkit.org/show_bug.cgi?id=144423
1957         <rdar://problem/20491011>
1958
1959         Reviewed by Tim Horton.
1960
1961         Test: fast/css/apple-system-colors.html
1962
1963         Expose the following values to CSS color properties:
1964             -apple-system-blue
1965             -apple-system-brown
1966             -apple-system-gray
1967             -apple-system-green
1968             -apple-system-orange
1969             -apple-system-pink
1970             -apple-system-purple
1971             -apple-system-red
1972             -apple-system-yellow
1973
1974         On platforms other than OS X Yosemite and iOS, the
1975         actual color values are undefined and become transparent
1976         black. (In fact, not all are defined on iOS either.)
1977
1978         * WebCore.xcodeproj/project.pbxproj: Two new SPI header files.
1979
1980         * css/CSSParser.cpp:
1981         (WebCore::CSSParser::validSystemColorValue): New helper function that
1982         checks if a CSSValueID is between the two system color values. This
1983         was being tested everywhere, which meant adding a new system color was
1984         at risk of being ignored. It's a static method so it can be used
1985         from the SVG CSS parser too.
1986         (WebCore::validPrimitiveValueColor): Use the new helper.
1987         (WebCore::CSSParser::parseValue): Ditto.
1988         (WebCore::CSSParser::parseBackgroundColor): Ditto.
1989         (WebCore::CSSParser::parseShadow): Ditto.
1990         (WebCore::parseDeprecatedGradientColorStop): Ditto.
1991         (WebCore::parseGradientColorOrKeyword): Ditto.
1992         * css/CSSParser.h: New static helper function.
1993
1994         * css/CSSValueKeywords.in: Add the new CSS value keywords.
1995
1996         * css/SVGCSSParser.cpp:
1997         (WebCore::validSystemControlColorValue): SVG has a restricted
1998         set of system colors, so use the helper from CSSParser but with
1999         an extra condition.
2000         (WebCore::CSSParser::parseSVGValue): Use the helper.
2001
2002         * platform/spi/ios/UIColorSPI.h: Added.
2003         * platform/spi/cocoa/NSColorSPI.h: Added.
2004
2005         * rendering/RenderThemeIOS.h: New systemColor override. Also add a cache for system colors.
2006         * rendering/RenderThemeIOS.mm:
2007         (WebCore::RenderThemeIOS::systemColor): Ask UIColor to provide the color values for the new CSS values.
2008         * rendering/RenderThemeMac.mm:
2009         (WebCore::RenderThemeMac::systemColor): Ditto.
2010
2011 2015-04-29  Commit Queue  <commit-queue@webkit.org>
2012
2013         Unreviewed, rolling out r183600.
2014         https://bugs.webkit.org/show_bug.cgi?id=144432
2015
2016         New tests time out everywhere (Requested by ap on #webkit).
2017
2018         Reverted changeset:
2019
2020         "Crash at WebCore::Document::absoluteRegionForEventTargets"
2021         https://bugs.webkit.org/show_bug.cgi?id=144426
2022         http://trac.webkit.org/changeset/183600
2023
2024 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2025
2026         Unreviewed iOS build fix. Unused parameter no longer exists.
2027
2028         * page/scrolling/ScrollingCoordinator.cpp:
2029         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
2030
2031 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
2032
2033         Crash at WebCore::Document::absoluteRegionForEventTargets 
2034         https://bugs.webkit.org/show_bug.cgi?id=144426
2035         rdar://problem/20502166
2036
2037         Reviewed by Tim Horton.
2038
2039         When a frame had wheel event handlers, we would register the document itself
2040         as a handler in its parent document. This is problematic, because there's not
2041         code path that removes it when the frame is destroyed.
2042         
2043         It turns out we don't need to do this at all; the non-fast scrollable region
2044         already takes handlers in subframes into account.
2045
2046         Tests: fast/events/wheelevent-in-frame.html
2047                fast/events/wheelevent-in-reattached-frame.html
2048
2049         * dom/Document.cpp:
2050         (WebCore::Document::didAddWheelEventHandler):
2051         (WebCore::Document::didRemoveWheelEventHandler):
2052
2053 2015-04-29  David Kilzer  <ddkilzer@apple.com>
2054
2055         Attempt #2: Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
2056         <http://webkit.org/b/144362>
2057
2058         Reviewed by Andy Estes.
2059
2060         This patch switches soft-linking of QuickLook.framework to
2061         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
2062         symbols.
2063
2064         No new tests since no change in behavior.
2065
2066         * WebCore.xcodeproj/project.pbxproj:
2067         - Add QuickLookSoftLinking.{h,mm} to the project.
2068
2069         * platform/ios/QuickLookSoftLink.h: Added.
2070         * platform/ios/QuickLookSoftLink.mm: Added.
2071         * platform/mac/SoftLinking.h:
2072         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
2073         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
2074         (SOFT_LINK_POINTER_FOR_HEADER): Add macro.
2075         (SOFT_LINK_POINTER_FOR_SOURCE): Add macro.
2076
2077         * platform/network/ios/QuickLook.h:
2078         - Remove unused declarations.
2079
2080         * platform/network/ios/QuickLook.mm:
2081         (WebCore::QLPreviewConverterClass): Deleted.
2082         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
2083         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
2084         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
2085         - Remove SOFT_LINK macros and unused methods after switching to
2086           new QuickLookSoftLink.{h,mm}.
2087         (WebCore::QLPreviewGetSupportedMIMETypesSet):
2088         - Switch to use NeverDestroyed<>.
2089         (WebCore::registerQLPreviewConverterIfNeeded):
2090         (createQLPreviewProtocol):
2091         (WebCore::QLPreviewProtocol):
2092         (WebCore::QuickLookHandle::QuickLookHandle):
2093         (WebCore::QuickLookHandle::create):
2094         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
2095         - Simplify code when using QuickLookSoftLink.h.
2096
2097         * platform/network/ios/WebCoreURLResponseIOS.mm:
2098         - Include QuickLookSoftLink.h header.
2099
2100 2015-04-29  Simon Fraser  <simon.fraser@apple.com>
2101
2102         Compute the non-fast-scrollable region in main-document coordinates
2103         https://bugs.webkit.org/show_bug.cgi?id=144420
2104
2105         Reviewed by Tim Horton.
2106
2107         Compute the non-fast-scrollable region in document coordinates, to make it easier
2108         to reason about. Previously, it was document coordinates offset by top content inset.
2109
2110         * page/DebugPageOverlays.cpp:
2111         (WebCore::MouseWheelRegionOverlay::updateRegion): Traverse all frames to compute the wheel
2112         event handler region, mapping each to root view coords, and then mapping back into document
2113         coords at the end.
2114         (WebCore::NonFastScrollableRegionOverlay::updateRegion): No offset needed here; the
2115         overlay and region are both document coordinates.
2116         * page/FrameView.h: Make some mapping function overrides public, and expose widgetsInRenderTree().
2117         * page/Page.cpp:
2118         (WebCore::Page::nonFastScrollableRects): Remove frame argument.
2119         * page/Page.h:
2120         * page/PageOverlay.cpp:
2121         (WebCore::PageOverlay::bounds):
2122         (WebCore::PageOverlay::viewToOverlayOffset): Convenience function to map between
2123         view and overlay coordinates.
2124         * page/PageOverlay.h:
2125         * page/scrolling/AsyncScrollingCoordinator.cpp: New computeNonFastScrollableRegion() signature.
2126         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
2127         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2128         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
2129         * page/scrolling/ScrollingCoordinator.cpp:
2130         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): This function
2131         recurses on frames, computing an absolute (document-relative) region per frame. This
2132         removes the confusing offsetting through top content inset.
2133         Change how we get to plugins that want wheel events; we can't get from PluginViewBase
2134         to renderers, so use FrameView's list of Widgets, and their RenderWidgets. This fixes
2135         regions for transformed plugin-ins.
2136         For subframes, we get a region in the subframe's document coords. Map to that sub-frame,
2137         then to our frame, then to our document.
2138         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Wrapper that hides
2139         the recursive function.
2140         (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Deleted.
2141         * page/scrolling/ScrollingCoordinator.h:
2142         * page/scrolling/ScrollingTree.cpp:
2143         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously): Map the event point
2144         from view coordinates to document coordinates for testing against the non-fast region.
2145         We previously assert that the root note is a FrameScrolling node.
2146         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
2147         (WebCore::ScrollingTreeFrameScrollingNode::viewToContentsOffset): Similar to ScrollView::viewToContents()
2148         for the scrolling tree.
2149         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
2150         * testing/Internals.cpp:
2151         (WebCore::Internals::nonFastScrollableRects): No need for frame arg.
2152
2153 2015-04-29  Brent Fulgham  <bfulgham@apple.com>
2154
2155         Expand test infrastructure to support scrolling tests
2156         https://bugs.webkit.org/show_bug.cgi?id=143684
2157         <rdar://problem/20375516>
2158
2159         Reviewed by Simon Fraser.
2160
2161         Tested by various fast/scrolling and platform/mac-wk2/tiled-drawing/scrolling tests.
2162
2163         This series of changes adds a new singleton class, 'WheelEventTestTrigger', which encapsulates a
2164         function object to be fired when scroll events are finished. The object also keeps track of reasons
2165         why the test should not yet fire (e.g., 'rubberbanding' is active) so that tests do not incorrectly
2166         check rendering state in the middle of an animation.
2167
2168         Switch from the original WeakPtr design to ThreadSafeRefPtr, because WeakPtr cannot be shared
2169         across multiple threads.
2170
2171         * page/FrameView.cpp:
2172         (WebCore::FrameView::layout): Make sure ScrollAnimator knows about any active test trigger.
2173         (WebCore::FrameView::setScrollPosition): Ditto.
2174         (WebCore::FrameView::didAddScrollbar): Ditto.
2175         * page/MainFrame.cpp:
2176         (WebCore::MainFrame::testTrigger): Moved to Page.
2177         (WebCore::MainFrame::ensureTestTrigger): Ditto.
2178         * page/MainFrame.h:
2179         * page/Page.cpp:
2180         (WebCore::Page::testTrigger): Moved from MainFrame, and converted to use RefPtr.
2181         (WebCore::Page::ensureTestTrigger): Ditto.
2182         * page/Page.h:
2183         * page/WheelEventTestTrigger.cpp:
2184         (WebCore::WheelEventTestTrigger::WheelEventTestTrigger): Remove WeakPtr code.
2185         (WebCore::WheelEventTestTrigger::createWeakPtr): Deleted.
2186         * page/WheelEventTestTrigger.h:
2187         * page/mac/EventHandlerMac.mm:
2188         (WebCore::EventHandler::platformPrepareForWheelEvents): Make sure the scroll animator knows about
2189         any active test trigger object.
2190         * page/scrolling/AsyncScrollingCoordinator.cpp:
2191         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll): Notify WheelEventTestTrigger
2192         that the scrolling thread is synced with the main thread.
2193         * platform/ScrollAnimator.h: Hold a RefPtr to the WheelEventTestTrigger. 
2194         (WebCore::ScrollAnimator::ScrollAnimator::setWheelEventTestTrigger):
2195         * platform/cocoa/ScrollController.h:
2196         * platform/cocoa/ScrollController.mm:
2197         (WebCore::ScrollController::startSnapRubberbandTimer): Notify test trigger to hold tests until rubber band
2198         snapping is complete.
2199         (WebCore::ScrollController::stopSnapRubberbandTimer): Notify test trigger that rubber band snapping is done.
2200         (WebCore::ScrollController::startScrollSnapTimer): Notify test trigger to hold tests until scroll snapping
2201         is complete.
2202         (WebCore::ScrollController::stopScrollSnapTimer): Notify test trigger that scroll snapping is done.
2203         * platform/mac/ScrollAnimatorMac.mm:
2204         (WebCore::ScrollAnimatorMac::didBeginScrollGesture): Notify test trigger that a content scroll is in progress.
2205         (WebCore::ScrollAnimatorMac::didEndScrollGesture): Notify test trigger that a content scroll is finished.
2206         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledSoon): Notify test trigger to hold tests until the content
2207         scrolling is complete.
2208         (WebCore::ScrollAnimatorMac::sendContentAreaScrolledTimerFired): Notify test trigger that content scrolling is done.
2209         * rendering/RenderBox.cpp:
2210         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
2211         (WebCore::RenderBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
2212         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
2213         (WebCore::RenderBox::setScrollTop): Ditto.
2214         * rendering/RenderLayer.cpp:
2215         (WebCore::RenderLayer::createScrollbar): Make sure the ScrollAnimator knows about any active test triggers.
2216         * rendering/RenderListBox.cpp:
2217         (WebCore::connectScrollAnimatorToTestTrigger): Helper function.
2218         (WebCore::RenderListBox::setScrollLeft): Call 'connectScrollAnimatorToTestTrigger' to connect the ScrollAnimator
2219         to the WheelEventTestTrigger so that future scroll operations can notify the test infrastructure.
2220         (WebCore::RenderListBox::setScrollTop): Ditto.
2221         (WebCore::RenderListBox::createScrollbar): Ditto.
2222         * testing/js/WebCoreTestSupport.cpp:
2223         (WebCoreTestSupport::monitorWheelEvents): Look for WheelEventTestTrigger in Page, rather than MainFrame.
2224         (WebCoreTestSupport::setTestCallbackAndStartNotificationTimer): Ditto.
2225
2226 2015-04-29  Javier Fernandez  <jfernandez@igalia.com>
2227
2228         [CSS Box Alignment] Unifying alignment data in a single class
2229         https://bugs.webkit.org/show_bug.cgi?id=144384
2230
2231         Reviewed by David Hyatt.
2232
2233         The new CSS Box Alignment specification introduces more complex
2234         values and syntax for defining alignment properties. Most of the
2235         alignment values were just keyword identifiers, but the new syntax
2236         allows different combinations of identifiers to determine the
2237         alignment behavior (eg. overflow-alignment keyword).
2238
2239         This patch wll help to implement later overflow handling and
2240         specially Content Dstribution alignment, the most complex case by
2241         far. It will be more consistent against style changes and repaint,
2242         snce we will have just one field to monitoring for value
2243         modfications.
2244
2245         No new tests, because no new functionality was added; it's just a
2246         code refactoring which is just expected to pass current tests.
2247
2248         * css/CSSComputedStyleDeclaration.cpp:
2249         (WebCore::resolveSelfAlignmentAuto):
2250         (WebCore::ComputedStyleExtractor::propertyValue):
2251         * css/CSSPropertyNames.in:
2252         * css/StyleBuilderConverter.h:
2253         (WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
2254         (WebCore::StyleBuilderConverter::convertSVGColor): Deleted.
2255         * css/StyleBuilderCustom.h:
2256         (WebCore::StyleBuilderCustom::applyInitialWebkitMaskImage): Deleted.
2257         (WebCore::StyleBuilderCustom::applyInheritWebkitMaskImage): Deleted.
2258         (WebCore::ApplyPropertyBorderImageModifier::applyInheritValue): Deleted.
2259         (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue): Deleted.
2260         (WebCore::ApplyPropertyBorderImageModifier::applyValue): Deleted.
2261         (WebCore::ApplyPropertyBorderImageModifier::getValue): Deleted.
2262         (WebCore::ApplyPropertyBorderImageModifier::setValue): Deleted.
2263         (WebCore::StyleBuilderCustom::applyInheritLineHeight): Deleted.
2264         * css/StyleResolver.cpp:
2265         (WebCore::StyleResolver::adjustRenderStyle):
2266         * mathml/MathMLTextElement.cpp:
2267         (WebCore::MathMLTextElement::createElementRenderer):
2268         * rendering/RenderFlexibleBox.cpp:
2269         (WebCore::RenderFlexibleBox::styleDidChange):
2270         * rendering/RenderFullScreen.cpp:
2271         (WebCore::createFullScreenStyle):
2272         * rendering/RenderMenuList.cpp:
2273         (WebCore::RenderMenuList::adjustInnerStyle):
2274         * rendering/mathml/RenderMathMLRoot.cpp:
2275         (WebCore::RenderMathMLRoot::updateStyle):
2276         * rendering/mathml/RenderMathMLScripts.cpp:
2277         (WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair):
2278         (WebCore::RenderMathMLScripts::fixAnonymousStyles):
2279         * rendering/style/RenderStyle.cpp:
2280         (WebCore::RenderStyle::resolveAlignment):
2281         (WebCore::RenderStyle::resolveJustification):
2282         * rendering/style/RenderStyle.h:
2283         * rendering/style/StyleRareNonInheritedData.cpp:
2284         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
2285         (WebCore::StyleRareNonInheritedData::operator==):
2286         (WebCore::StyleRareNonInheritedData::contentDataEquivalent): Deleted.
2287         * rendering/style/StyleRareNonInheritedData.h:
2288         * rendering/style/StyleSelfAlignmentData.h: Added.
2289         (WebCore::StyleSelfAlignmentData::StyleSelfAlignmentData):
2290         (WebCore::StyleSelfAlignmentData::setPosition):
2291         (WebCore::StyleSelfAlignmentData::setPositionType):
2292         (WebCore::StyleSelfAlignmentData::setOverflow):
2293         (WebCore::StyleSelfAlignmentData::position):
2294         (WebCore::StyleSelfAlignmentData::positionType):
2295         (WebCore::StyleSelfAlignmentData::overflow):
2296         (WebCore::StyleSelfAlignmentData::operator==):
2297         (WebCore::StyleSelfAlignmentData::operator!=):
2298
2299 2015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
2300
2301         NodeList has issues with Symbol and empty string
2302         https://bugs.webkit.org/show_bug.cgi?id=144310
2303
2304         Reviewed by Darin Adler.
2305
2306         Tests: fast/dom/StyleSheet/stylesheet-symbol-names.html
2307                fast/dom/dataset-name-getter-symbols.html
2308                fast/dom/named-items-with-empty-name.html
2309                fast/dom/named-items-with-symbol-name.html
2310                storage/domstorage/localstorage/named-items.html
2311
2312         Test different bindings objects with custom named setter
2313         and getter handlers. Ensure that they handle Symbol properties
2314         gracefully. Often times avoiding the string path.
2315
2316         * dom/StaticNodeList.cpp:
2317         (WebCore::StaticNodeList::namedItem):
2318         (WebCore::StaticElementList::namedItem):
2319         Better handle the empty string. It should not match an item.
2320
2321         * bindings/js/JSDOMBinding.h:
2322         (WebCore::propertyNameToString):
2323         In cases where we would use this, we should have handled
2324         Symbol properties.
2325
2326         (WebCore::propertyNameToAtomicString):
2327         For Symbols, use the unique string. This should result
2328         in no matches for a Symbol property.
2329
2330         * bindings/js/JSDOMStringMapCustom.cpp:
2331         (WebCore::JSDOMStringMap::getOwnPropertySlotDelegate):
2332         (WebCore::JSDOMStringMap::deleteProperty):
2333         (WebCore::JSDOMStringMap::putDelegate):
2334         * bindings/js/JSStorageCustom.cpp:
2335         (WebCore::JSStorage::canGetItemsForName):
2336         (WebCore::JSStorage::nameGetter):
2337         (WebCore::JSStorage::deleteProperty):
2338         (WebCore::JSStorage::putDelegate):
2339         * bindings/js/JSStyleSheetListCustom.cpp:
2340         (WebCore::JSStyleSheetList::canGetItemsForName):
2341         Treat Symbol properties as private properties. They just
2342         go directly through to the Object, and avoid the string
2343         getter/setter property path.
2344
2345 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
2346
2347         [Mac] Register with device picker whenever a page has <video>
2348         https://bugs.webkit.org/show_bug.cgi?id=144408
2349
2350         Reviewed by Jer Noble.
2351
2352         * Modules/mediasession/WebMediaSessionManager.cpp:
2353         (WebCore::WebMediaSessionManager::setPlaybackTarget): Drive-by fix: don't tell a client to play
2354         to the target when it has not routes.
2355
2356         * html/HTMLMediaElement.cpp:
2357         (WebCore::HTMLMediaElement::mediaState): Set RequiresPlaybackTargetMonitoring whenever the 
2358         element is <video> with a video track that does not block wireless playback.
2359
2360 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
2361
2362         [GTK] Add support for automatic hyphenation
2363         https://bugs.webkit.org/show_bug.cgi?id=44478
2364
2365         Reviewed by Carlos Garcia Campos.
2366
2367         No new tests. This patch unskips and updates results for existing hyphenation tests.
2368
2369         * PlatformGTK.cmake: Add the libhypen implementation to the source list.
2370         * platform/gtk/GtkUtilities.cpp:
2371         (WebCore::topLevelPath): Add this helper function taken from the test harness.
2372         (WebCore::getWebKitBuildDirectory): Ditto.
2373         * platform/gtk/GtkUtilities.h: Add function declarations for the helper functions.
2374         * platform/text/Hyphenation.cpp: Surround this implementation with !USE(LIBHYPHEN),
2375           so that it can still be shared.
2376         * platform/text/gtk/HyphenationLibHyphen.cpp: Added.
2377         (WebCore::extractLocaleFromDictionaryFilePath): Take in a dictionary filename and
2378         determine the locale that it covers.
2379         (WebCore::scanDirectoryForDicionaries): Look for all installed dictionaries as well
2380         as ones in the JHBuild root for testing.
2381         (WebCore::scanTestDictionariesDirectoryIfNecessary): Try to scan the dictionaries installed
2382         in the JHBuild root.
2383         (WebCore::availableLocales): Getter for global hash of installed dictionaries.
2384         (WebCore::canHyphenate): Added libhyphen implementation.
2385         (WebCore::HyphenationDictionary): Helper class that properly manages the memory of
2386         an open libhyphen dictionary. This is useful so that they can be stored in an MRU
2387         cache. This is a similar approach to the CoreFoundation implementation.
2388         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForNullKey): MRU cache
2389         helper.
2390         (WebCore::AtomicStringKeyedMRUCache<RefPtr<HyphenationDictionary>>::createValueForKey): Ditto.
2391         (WebCore::hyphenDictionaryCache): A cache for opened hyphenation dictionaries.
2392         (WebCore::countLeadingSpaces): Count leading spaces, since WebCore often passes words with them.
2393         (WebCore::lastHyphenLocation): Added libhyphen implementation.
2394
2395 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2396
2397         Unreviewed build fix.
2398
2399         * platform/graphics/mac/FontCacheMac.mm:
2400         (WebCore::fontWithFamily):
2401
2402 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
2403
2404         Some media tests assert after r183096
2405         https://bugs.webkit.org/show_bug.cgi?id=144098
2406
2407         Reviewed by Brent Fulgham.
2408
2409         Never assert when a MediaPlaybackTargetClient client calls one of the methods on Document
2410         after it has been unregistered. A media element unregisters itself when it is removed from the 
2411         document, but scripts can still run and modify state that results in a call to
2412         playbackTargetPickerClientStateDidChange. Remove the asserts instead of adding checks to
2413         the various call sites.
2414
2415         * dom/Document.cpp:
2416         (WebCore::Document::showPlaybackTargetPicker): Don't assert if the client has already
2417         been unregistered.
2418         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
2419
2420 2015-04-29  Zalan Bujtas  <zalan@apple.com>
2421
2422         Simple line layout: Web process spins endlessly below layoutSimpleLines.
2423         https://bugs.webkit.org/show_bug.cgi?id=144403
2424         rdar://problem/20742783
2425
2426         Reviewed by Antti Koivisto.
2427
2428         When a text fragment overlaps multiple renderes and it does not fit the current line,
2429         we revert the text fragment iterator position so that the overlapping content
2430         gets processed again for the next line.
2431         However, TextFragmentIterator::revertToFragment() was reverting too much and
2432         we started processing old content all over again -> infinite loop.
2433
2434         This patch ensures that text fragment iterator is reverted to the right position.
2435
2436         Test: fast/text/simple-line-layout-wrapping-multiple-renderers-hang.html
2437
2438         * rendering/SimpleLineLayout.cpp:
2439         (WebCore::SimpleLineLayout::createLineRuns):
2440         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2441         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToEndOfFragment):
2442         (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment): Deleted.
2443         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2444
2445 2015-04-29  Filip Pizlo  <fpizlo@apple.com>
2446
2447         JSTypeInfo should have an inline type flag to indicate of getCallData() has been overridden
2448         https://bugs.webkit.org/show_bug.cgi?id=144397
2449
2450         Reviewed by Andreas Kling.
2451
2452         If you override getCallData() and you want to be called a "function", then you need to use the
2453         new TypeOfShouldCallGetCallData flag.
2454
2455         * bindings/scripts/CodeGeneratorJS.pm:
2456         (GenerateHeader):
2457         * bridge/objc/objc_runtime.h:
2458         * bridge/runtime_method.h:
2459         * bridge/runtime_object.h:
2460
2461 2015-04-29  Commit Queue  <commit-queue@webkit.org>
2462
2463         Unreviewed, rolling out r183553 and r183561.
2464         https://bugs.webkit.org/show_bug.cgi?id=144406
2465
2466         broke the iOS build (Requested by thorton__ on #webkit).
2467
2468         Reverted changesets:
2469
2470         "Switch QuickLook soft-linking to use
2471         QuickLookSoftLink.{h,mm}"
2472         https://bugs.webkit.org/show_bug.cgi?id=144362
2473         http://trac.webkit.org/changeset/183553
2474
2475         "Unreviewed iOS build fix after r183553: fix declaration of
2476         QLPreviewScheme"
2477         http://trac.webkit.org/changeset/183561
2478
2479 2015-04-29  Antti Koivisto  <antti@apple.com>
2480
2481         ResourceLoadPriority should be enum class
2482         https://bugs.webkit.org/show_bug.cgi?id=144326
2483
2484         Reviewed by Darin Adler.
2485
2486         * html/HTMLLinkElement.cpp:
2487         (WebCore::HTMLLinkElement::process):
2488         * loader/LinkLoader.cpp:
2489         (WebCore::LinkLoader::loadLink):
2490         * loader/ResourceLoadScheduler.cpp:
2491         (WebCore::ResourceLoadScheduler::scheduleLoad):
2492         (WebCore::ResourceLoadScheduler::servePendingRequests):
2493         (WebCore::ResourceLoadScheduler::HostInformation::~HostInformation):
2494         (WebCore::ResourceLoadScheduler::HostInformation::priorityToIndex):
2495         (WebCore::ResourceLoadScheduler::HostInformation::schedule):
2496         (WebCore::ResourceLoadScheduler::HostInformation::remove):
2497         (WebCore::ResourceLoadScheduler::HostInformation::hasRequests):
2498         (WebCore::ResourceLoadScheduler::HostInformation::limitRequests):
2499         * loader/ResourceLoadScheduler.h:
2500         (WebCore::ResourceLoadScheduler::HostInformation::requestsPending):
2501
2502             Modernize ResourceLoadScheduler code a bit while switching to enum class.
2503
2504         * loader/cache/CachedResource.cpp:
2505         (WebCore::defaultPriorityForResourceType):
2506         * loader/cache/CachedResourceLoader.cpp:
2507         (WebCore::CachedResourceLoader::requestResource):
2508         * loader/icon/IconLoader.cpp:
2509         (WebCore::IconLoader::startLoading):
2510         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2511         (WebCore::WebCoreAVFResourceLoader::startLoading):
2512         * platform/network/ResourceLoadPriority.h:
2513         (WebCore::operator++):
2514         (WebCore::operator--):
2515         * platform/network/ResourceRequestBase.cpp:
2516         (WebCore::ResourceRequestBase::adopt):
2517         (WebCore::ResourceRequestBase::copyData):
2518         (WebCore::ResourceRequestBase::cachePolicy):
2519         (WebCore::ResourceRequestBase::priority):
2520         (WebCore::ResourceRequestBase::setPriority):
2521         * platform/network/ResourceRequestBase.h:
2522
2523             Remove bitfields. ResourceRequests are not present in large enough numbers to require this kind of optimization.
2524             Use modern initialization syntax.
2525
2526         (WebCore::ResourceRequestBase::ResourceRequestBase):
2527         (WebCore::CrossThreadResourceRequestDataBase::CrossThreadResourceRequestDataBase): Deleted.
2528         * platform/network/cf/ResourceRequestCFNet.cpp:
2529         (WebCore::initializeMaximumHTTPConnectionCountPerHost):
2530         (WebCore::initializeHTTPConnectionSettingsOnStartup):
2531         * platform/network/cf/ResourceRequestCFNet.h:
2532         (WebCore::toResourceLoadPriority):
2533         (WebCore::toPlatformRequestPriority):
2534         * platform/network/soup/ResourceRequest.h:
2535         (WebCore::toSoupMessagePriority):
2536         * testing/Internals.cpp:
2537         (WebCore::stringToResourceLoadPriority):
2538
2539 2015-04-29  Myles C. Maxfield  <mmaxfield@apple.com>
2540
2541         [OS X] Use CTFontCreateForCSS instead of doing font search ourselves
2542         https://bugs.webkit.org/show_bug.cgi?id=132159
2543
2544         Reviewed by Darin Adler.
2545
2546         On platforms that support it, delegate font selection logic to the platform. Currently, this is
2547         only supported on Mac, using CTFontCreateForCSS().
2548
2549         This also changes the mechanism that enforces our font whitelist in our tests. We used to
2550         swizzle the implementations of NSFontManager methods. This patch migrates to using a whitelist of
2551         font family names instead.
2552
2553         Note that this patch is a work in progress, because it makes the following tests fail:
2554         fast/css/font-weight-1.html
2555         fast/forms/validation-message-appearance.html
2556         fast/forms/select/optgroup-rendering.html
2557
2558         No new tests, because there is no behavior change.
2559
2560         * platform/graphics/FontCache.h: Add a function to set the whitlist.
2561         * platform/graphics/mac/FontCacheMac.mm:
2562         (WebCore::fontWhitelist):
2563         (WebCore::FontCache::setFontWhitelist):
2564         (WebCore::toAppKitFontWeight):
2565         (WebCore::toCoreTextFontWeight):
2566         (WebCore::fontWithFamily): If ENABLE(PLATFORM_FONT_LOOKUP), use CTFontCreateForCSS().
2567         (WebCore::FontCache::createFontPlatformData):
2568         * platform/spi/cocoa/CoreTextSPI.h: Add signature for CTFontCreateForCSS().
2569
2570 2015-04-29  Jer Noble  <jer.noble@apple.com>
2571
2572         Unreviewed iOS build fix after r183553: fix declaration of QLPreviewScheme
2573
2574         * platform/ios/QuickLookSoftLink.mm:
2575
2576 2015-04-29  Eric Carlson  <eric.carlson@apple.com>
2577
2578         [Mac] Use new device picker menu API
2579         https://bugs.webkit.org/show_bug.cgi?id=144392
2580
2581         Reviewed by Jer Noble.
2582
2583         * Modules/mediasession/WebMediaSessionManager.cpp:
2584         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Pass the route state to the picker.
2585         * platform/graphics/MediaPlaybackTargetPicker.h:
2586
2587         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
2588         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2589         (WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):  m_deviceChangeTimer -> m_pendingActionTimer.
2590         (WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac): Ditto.
2591         (WebCore::MediaPlaybackTargetPickerMac::pendingActionTimerFired): Renamed from 
2592         outputeDeviceAvailabilityChangedTimerFired.
2593         (WebCore::MediaPlaybackTargetPickerMac::availableDevicesDidChange): Use addPendingAction.
2594         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Call new picker API if it is
2595         available. New API returns true if a target is chosen, so call currentDeviceDidChange in that case.
2596         (WebCore::MediaPlaybackTargetPickerMac::addPendingAction): New.
2597         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange): Make asynchronous because it 
2598         can now be called from showPlaybackTargetPicker.
2599         (WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired): Renamed
2600         pendingActionTimerFired.
2601
2602         * platform/spi/cocoa/AVKitSPI.h: Add new SPI.
2603
2604 2015-04-29  Antti Koivisto  <antti@apple.com>
2605
2606         Main resource loaded via 304 response becomes empty if reloaded by user
2607         https://bugs.webkit.org/show_bug.cgi?id=144386
2608
2609         Reviewed by Darin Adler.
2610
2611         Memory cache layer may make a main resource request conditional (add If-modified-since/If-none-match header).
2612         DocumentLoader stores the final ResourceRequest associated with document. If user triggered reload for
2613         conditionally loaded document DocumentLoader would include the same conditionals to the new request as well.
2614         Since these were not added by the memory cache it would pass any 304 response back to the DocumentLoader.
2615         However DocumentLoader has no code to handle 304 so we would end up with an empty document.
2616
2617         Test: http/tests/cache/main-resource-304-reload.html
2618
2619         * loader/DocumentLoader.cpp:
2620         (WebCore::DocumentLoader::startLoadingMainResource):
2621
2622             Ensure DocumentLoader doesn't issue conditional requests.
2623
2624 2015-04-28  Jer Noble  <jer.noble@apple.com>
2625
2626         Replace HTMLMediaElement's seek timer with a task queue.
2627         https://bugs.webkit.org/show_bug.cgi?id=144353
2628
2629         Reviewed by Eric Carlson.
2630
2631         No change in functionality, so no new tests added.
2632
2633         Replace a zero-length timer with an explicit task queue, backed by Document's postTask(). To
2634         make enqueued tasks cancellable, add a new GenericTaskQueue class modelled on
2635         GenericEventQueue which can cancel enqueued but not-yet-executed tasks.
2636
2637         * CMakeLists.txt:
2638         * WebCore.vcxproj/WebCore.vcxproj:
2639         * WebCore.vcxproj/WebCore.vcxproj.filters:
2640         * WebCore.xcodeproj/project.pbxproj:
2641         * dom/GenericTaskQueue.cpp: Added.
2642         (WebCore::GenericTaskQueue::GenericTaskQueue): Initialize ivars.
2643         (WebCore::GenericTaskQueue::enqueueTask): Wrap the task and pass it to the ScriptExecutionContext.
2644         (WebCore::GenericTaskQueue::close): Assert that the task queue will not accept any additional tasks.
2645         (WebCore::GenericTaskQueue::cancelAllTasks): Revoke outstanding weak pointers, thereby cancelling tasks.
2646         * dom/GenericTaskQueue.h: Added.
2647         (WebCore::GenericTaskQueue::hasPendingTasks):
2648         * html/HTMLMediaElement.cpp:
2649         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize the task queue.
2650         (WebCore::HTMLMediaElement::~HTMLMediaElement): Close the task queue.
2651         (WebCore::HTMLMediaElement::seekWithTolerance): Post a task, rather than start a timer.
2652         (WebCore::HTMLMediaElement::seekTask): Renamed from seekTimerFired().
2653         (WebCore::HTMLMediaElement::seekTimerFired): Deleted.
2654         * html/HTMLMediaElement.h:
2655
2656 2015-04-28  David Kilzer  <ddkilzer@apple.com>
2657
2658         Switch QuickLook soft-linking to use QuickLookSoftLink.{h,mm}
2659         <http://webkit.org/b/144362>
2660
2661         Reviewed by Andy Estes.
2662
2663         This patch switches soft-linking of QuickLook.framework to
2664         QuickLookSoftLink.{h,mm} so that we stop exporting unintended
2665         symbols.
2666
2667         No new tests since no change in behavior.
2668
2669         * WebCore.xcodeproj/project.pbxproj:
2670         - Add QuickLookSoftLinking.{h,mm} to the project.
2671
2672         * platform/ios/QuickLookSoftLink.h: Added.
2673         * platform/ios/QuickLookSoftLink.mm: Added.
2674         * platform/mac/SoftLinking.h:
2675         (SOFT_LINK_CLASS_FOR_HEADER): Add macro.
2676         (SOFT_LINK_CLASS_FOR_SOURCE): Add macro.
2677
2678         * platform/network/ios/QuickLook.h:
2679         - Remove unused declarations.
2680
2681         * platform/network/ios/QuickLook.mm:
2682         (WebCore::QLPreviewConverterClass): Deleted.
2683         (WebCore::QLTypeCopyBestMimeTypeForFileNameAndMimeType): Deleted.
2684         (WebCore::QLTypeCopyBestMimeTypeForURLAndMimeType): Deleted.
2685         (WebCore::QLTypeCopyUTIForURLAndMimeType): Deleted.
2686         - Remove SOFT_LINK macros and unused methods after switching to
2687           new QuickLookSoftLink.{h,mm}.
2688         (WebCore::QLPreviewGetSupportedMIMETypesSet):
2689         - Switch to use NeverDestroyed<>.
2690         (WebCore::registerQLPreviewConverterIfNeeded):
2691         (createQLPreviewProtocol):
2692         (WebCore::QLPreviewProtocol):
2693         (WebCore::QuickLookHandle::QuickLookHandle):
2694         (WebCore::QuickLookHandle::create):
2695         (WebCore::QuickLookHandle::shouldCreateForMIMEType):
2696         - Simplify code when using QuickLookSoftLink.h.
2697
2698         * platform/network/ios/WebCoreURLResponseIOS.mm:
2699         - Include QuickLookSoftLink.h header.
2700
2701 2015-04-29  Darin Adler  <darin@apple.com>
2702
2703         [ES6] Implement Unicode code point escapes
2704         https://bugs.webkit.org/show_bug.cgi?id=144377
2705
2706         Reviewed by Antti Koivisto.
2707
2708         Test: js/unicode-escape-sequences.html
2709
2710         * css/CSSParser.cpp:
2711         (WebCore::CSSParser::parseEscape): Use ICU's UCHAR_MAX_VALUE instead of writing
2712         out 0x10FFFF; clearer this way. Also use our replacementCharacter instead of
2713         writing out 0xFFFD.
2714
2715         * html/parser/HTMLEntityParser.cpp:
2716         (WebCore::isAlphaNumeric): Deleted.
2717         (WebCore::HTMLEntityParser::legalEntityFor): Use ICU's UCHAR_MAX_VALUE and
2718         U_IS_SURROGATE instead of writing the code out. Didn't use U_IS_UNICODE_CHAR
2719         because that also includes U_IS_UNICODE_NONCHAR and thus would change behavior,
2720         but maye it's something we want to do in the future.
2721         (WebCore::HTMLEntityParser::consumeNamedEntity): Use isASCIIAlphanumeric instead
2722         of a the function in this file that does the same thing less efficiently.
2723
2724         * html/parser/InputStreamPreprocessor.h:
2725         (WebCore::InputStreamPreprocessor::processNextInputCharacter): Use
2726         replacementCharacter from CharacterNames.h instead of writing out 0xFFFd.
2727
2728         * xml/parser/CharacterReferenceParserInlines.h:
2729         (WebCore::consumeCharacterReference): Use ICU's UCHAR_MAX_VALUE instead of
2730         defining our own local highestValidCharacter constant.
2731
2732 2015-04-29  Martin Robinson  <mrobinson@igalia.com>
2733
2734         [CMake] [GTK] Organize and clean up unused CMake variables
2735         https://bugs.webkit.org/show_bug.cgi?id=144364
2736
2737         Reviewed by Gyuyoung Kim.
2738
2739         * PlatformGTK.cmake: Add variables specific to this project.
2740
2741 2015-04-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2742
2743         REGRESSION(r182573): [GTK] The default context menu contains an empty item since r182573
2744         https://bugs.webkit.org/show_bug.cgi?id=144388
2745
2746         Reviewed by Brady Eidson.
2747
2748         There used to be a method in ContextMenuItem to check if share
2749         menu item was supported or not, but since r182573, there's a
2750         method to get the share menu item. If the returned menu item is
2751         null, it's not added to the menu, but we are not returning a null
2752         ContextMenu item even though we don't support share menu item.
2753
2754         * platform/gtk/ContextMenuItemGtk.cpp:
2755         (WebCore::ContextMenuItem::shareMenuItem): Return a null ContextMenuItem.
2756
2757 2015-04-29  Zan Dobersek  <zdobersek@igalia.com>
2758
2759         Switch to std::function<>, std::bind() in MediaPlayerPrivateAVFoundationObjC
2760         https://bugs.webkit.org/show_bug.cgi?id=144232
2761
2762         Reviewed by Darin Adler.
2763
2764         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2765         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 
2766         Replace uses of WTF::Function<> and WTF::bind() with the STL alternatives.
2767
2768 2015-04-29  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2769
2770         Fix crash in WebCore::LogicalSelectionOffsetCaches::ContainingBlockInfo::setBlock().
2771         https://bugs.webkit.org/show_bug.cgi?id=140261
2772
2773         Reviewed by Darin Adler.
2774
2775         We need to check whether RenderObject is valid in RenderView::fooSubtreeSelection functions
2776         because invalid object has caused a crash. This patch adds isValidObjectForNewSelection(), and use it.
2777
2778         * rendering/RenderView.cpp:
2779         (WebCore::isValidObjectForNewSelection):
2780         (WebCore::RenderView::clearSubtreeSelection):
2781         (WebCore::RenderView::applySubtreeSelection):
2782
2783 2015-04-29  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2784
2785         Synchronous XMLHttpRequest should get access to AppCache resources stored as flat files
2786         https://bugs.webkit.org/show_bug.cgi?id=143711
2787
2788         Reviewed by Darin Adler.
2789
2790         This patch checks whether a substitute resource data is stored in memory or in file for synchronous loads.
2791         If data is stored in file, it reads the data through SharedBuffer::createWithContentsOfFile.
2792         This patch refactors some routines to replace Vector<char> by SharedBuffer to transmit response data.
2793
2794         Test: http/tests/appcache/simple-video-sync.html
2795
2796         * html/HTMLMediaElement.cpp:
2797         (WebCore::HTMLMediaElement::parseAttribute):
2798         * loader/DocumentThreadableLoader.cpp:
2799         (WebCore::DocumentThreadableLoader::loadRequest):
2800         * loader/FrameLoader.cpp:
2801         (WebCore::FrameLoader::loadResourceSynchronously):
2802         * loader/FrameLoader.h:
2803         * loader/appcache/ApplicationCacheHost.cpp:
2804         (WebCore::ApplicationCacheHost::maybeLoadResource):
2805         (WebCore::ApplicationCacheHost::createFileURL):
2806         (WebCore::ApplicationCacheHost::maybeLoadSynchronously):
2807         (WebCore::ApplicationCacheHost::maybeLoadFallbackSynchronously):
2808         * loader/appcache/ApplicationCacheHost.h:
2809         * xml/XSLTProcessorLibxslt.cpp:
2810         (WebCore::docLoaderFunc):
2811         * xml/parser/XMLDocumentParserLibxml2.cpp:
2812         (WebCore::openFunc):
2813
2814 2015-04-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2815
2816         Purge PassRefPtr from createSVGPathSegFoo factory functions
2817         https://bugs.webkit.org/show_bug.cgi?id=144374
2818
2819         Reviewed by Darin Adler.
2820
2821         Use Ref instead of PassRefPtr in createSVGPathSegFoo functions because
2822         those factory functions can't return null. Additionally let's remove unnecessary
2823         #include<PassRefPtr.h> there.
2824
2825         No new tests, no behavior changes.
2826
2827         * svg/SVGColor.cpp:
2828         (WebCore::SVGColor::cloneForCSSOM):
2829         * svg/SVGColor.h:
2830         * svg/SVGGlyphMap.h:
2831         (WebCore::GlyphMapNode::create):
2832         * svg/SVGPaint.cpp:
2833         (WebCore::SVGPaint::cloneForCSSOM):
2834         * svg/SVGPaint.h:
2835         * svg/SVGPathElement.cpp:
2836         (WebCore::SVGPathElement::createSVGPathSegClosePath):
2837         (WebCore::SVGPathElement::createSVGPathSegMovetoAbs):
2838         (WebCore::SVGPathElement::createSVGPathSegMovetoRel):
2839         (WebCore::SVGPathElement::createSVGPathSegLinetoAbs):
2840         (WebCore::SVGPathElement::createSVGPathSegLinetoRel):
2841         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs):
2842         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel):
2843         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs):
2844         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel):
2845         (WebCore::SVGPathElement::createSVGPathSegArcAbs):
2846         (WebCore::SVGPathElement::createSVGPathSegArcRel):
2847         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs):
2848         (WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel):
2849         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs):
2850         (WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel):
2851         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs):
2852         (WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel):
2853         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs):
2854         (WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel):
2855         * svg/SVGPathElement.h:
2856         * svg/SVGPathSegArcAbs.h:
2857         (WebCore::SVGPathSegArcAbs::create):
2858         * svg/SVGPathSegArcRel.h:
2859         (WebCore::SVGPathSegArcRel::create):
2860         * svg/SVGPathSegClosePath.h:
2861         (WebCore::SVGPathSegClosePath::create):
2862         * svg/SVGPathSegCurvetoCubicAbs.h:
2863         (WebCore::SVGPathSegCurvetoCubicAbs::create):
2864         * svg/SVGPathSegCurvetoCubicRel.h:
2865         (WebCore::SVGPathSegCurvetoCubicRel::create):
2866         * svg/SVGPathSegCurvetoCubicSmoothAbs.h:
2867         (WebCore::SVGPathSegCurvetoCubicSmoothAbs::create):
2868         * svg/SVGPathSegCurvetoCubicSmoothRel.h:
2869         (WebCore::SVGPathSegCurvetoCubicSmoothRel::create):
2870         * svg/SVGPathSegCurvetoQuadraticAbs.h:
2871         (WebCore::SVGPathSegCurvetoQuadraticAbs::create):
2872         * svg/SVGPathSegCurvetoQuadraticRel.h:
2873         (WebCore::SVGPathSegCurvetoQuadraticRel::create):
2874         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.h:
2875         (WebCore::SVGPathSegCurvetoQuadraticSmoothAbs::create):
2876         * svg/SVGPathSegCurvetoQuadraticSmoothRel.h:
2877         (WebCore::SVGPathSegCurvetoQuadraticSmoothRel::create):
2878         * svg/SVGPathSegLinetoAbs.h:
2879         (WebCore::SVGPathSegLinetoAbs::create):
2880         * svg/SVGPathSegLinetoHorizontalAbs.h:
2881         (WebCore::SVGPathSegLinetoHorizontalAbs::create):
2882         * svg/SVGPathSegLinetoHorizontalRel.h:
2883         (WebCore::SVGPathSegLinetoHorizontalRel::create):
2884         * svg/SVGPathSegLinetoRel.h:
2885         (WebCore::SVGPathSegLinetoRel::create):
2886         * svg/SVGPathSegLinetoVerticalAbs.h:
2887         (WebCore::SVGPathSegLinetoVerticalAbs::create):
2888         * svg/SVGPathSegLinetoVerticalRel.h:
2889         (WebCore::SVGPathSegLinetoVerticalRel::create):
2890         * svg/SVGPathSegMovetoAbs.h:
2891         (WebCore::SVGPathSegMovetoAbs::create):
2892         * svg/SVGPathSegMovetoRel.h:
2893         (WebCore::SVGPathSegMovetoRel::create):
2894         * svg/SVGViewSpec.h:
2895         (WebCore::SVGViewSpec::create):
2896         * svg/animation/SMILTimeContainer.h:
2897         (WebCore::SMILTimeContainer::create):
2898         * svg/animation/SVGSMILElement.cpp:
2899         (WebCore::ConditionEventListener::create):
2900         * svg/graphics/SVGImage.h:
2901         * svg/graphics/SVGImageForContainer.h:
2902         * svg/graphics/filters/SVGFilter.cpp:
2903         (WebCore::SVGFilter::create):
2904         * svg/graphics/filters/SVGFilter.h:
2905
2906 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
2907
2908         Make a non-static version of FrameView::yPositionForRootContentLayer()
2909         https://bugs.webkit.org/show_bug.cgi?id=144375
2910
2911         Reviewed by Andy Estes.
2912
2913         There were two calls to the static FrameView::yPositionForRootContentLayer()
2914         which passed in all the arguments for the same FrameView. Make a member
2915         function for convenience.
2916
2917         * page/FrameView.cpp:
2918         (WebCore::FrameView::yPositionForRootContentLayer):
2919         * page/FrameView.h:
2920         * rendering/RenderLayerCompositor.cpp:
2921         (WebCore::RenderLayerCompositor::updateRootLayerPosition):
2922
2923 2015-04-28  Ryuan Choi  <ryuan.choi@navercorp.com>
2924
2925         [CoordinatedGraphics] Merge TILED_BACKING_STORE guard with COORDINATED_GRAPHICS
2926         https://bugs.webkit.org/show_bug.cgi?id=143001
2927
2928         Reviewed by Gyuyoung Kim.
2929
2930         TiledBackingStore has only been used by Coordinated Graphics since Qt and WebKit1/Efl were dropped.
2931         So, this patch replaces USE(TILED_BACKING_STORE) with USE(COORDINATED_GRAPHICS) to merge the features.
2932
2933         In addition, this moves TiledBackingStore and related files from platform to platform/texmap/coordinated
2934         where other coordinated graphics files are located.
2935
2936         * CMakeLists.txt: Move TiledBackingStore.cpp because this is not common file.
2937         * PlatformEfl.cmake:
2938         * PlatformGTK.cmake:
2939         * WebCore.vcxproj/WebCore.vcxproj: Follow new location of TiledBackingStore* files.
2940         * WebCore.vcxproj/WebCore.vcxproj.filters:
2941         * loader/EmptyClients.h:
2942         * page/Chrome.cpp:
2943         * page/Chrome.h:
2944         * page/ChromeClient.h:
2945         * page/Frame.cpp:
2946         (WebCore::Frame::createView):
2947         * page/FrameView.cpp:
2948         (WebCore::FrameView::requestScrollPositionUpdate):
2949         * page/FrameView.h:
2950         * page/Page.cpp:
2951         (WebCore::Page::setPageScaleFactor):
2952         * platform/HostWindow.h:
2953         * platform/ScrollView.cpp:
2954         (WebCore::ScrollView::unscaledVisibleContentSizeIncludingObscuredArea):
2955         (WebCore::ScrollView::unscaledUnobscuredVisibleContentSize):
2956         (WebCore::ScrollView::visibleContentRectInternal):
2957         (WebCore::ScrollView::scrollTo):
2958         * platform/ScrollView.h:
2959         * platform/graphics/cairo/TileCairo.h: Removed because it is dead code since r169328
2960         * platform/graphics/texmap/coordinated/Tile.h: Renamed from Source/WebCore/platform/graphics/Tile.h.
2961         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.cpp.
2962         * platform/graphics/texmap/coordinated/TiledBackingStore.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStore.h.
2963         * platform/graphics/texmap/coordinated/TiledBackingStoreBackend.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreBackend.h.
2964         * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h: Renamed from Source/WebCore/platform/graphics/TiledBackingStoreClient.h.
2965
2966 2015-04-28  Brent Fulgham  <bfulgham@apple.com>
2967
2968         REGRESSION(180076): [Mac, iOS] Correct possible null dereference in printing code
2969         https://bugs.webkit.org/show_bug.cgi?id=144366
2970         <rdar://problem/20533513>
2971
2972         Reviewed by Dean Jackson.
2973
2974         * rendering/RenderBlockFlow.cpp:
2975         (WebCore::needsAppleMailPaginationQuirk): Check if the document settings is a nullptr
2976         before attempting to dereference it. 
2977
2978 2015-04-28  Andreas Kling  <akling@apple.com>
2979
2980         Simplify DOM wrapper destruction, don't deref() in finalizers.
2981         <https://webkit.org/b/144183>
2982
2983         Reviewed by Darin Adler.
2984
2985         DOM JS bindings had two mechanisms to call deref() on the WebCore object,
2986         once through a weak finalizer, and once through the JSCell's regular destructor.
2987
2988         That was once believed to be an optimization, but these days the finalizer will
2989         run just moments before the destructor anyway, all in the same call stack.
2990         And more importantly, the finalizer is not guaranteed to run, for instance in the
2991         case where a Weak is assigned to after going dead, but before the WeakBlock
2992         has been swept by the incremental sweeper.
2993
2994         Simplify this by just removing the deref() from the generated finalizers.
2995         This makes it easier to reason about DOM wrapper destruction, and eliminates
2996         the awkward time window  where a DOM wrapper could have a null impl().
2997
2998         We could spend more time on figuring out a way to have finalizers manage the
2999         destruction of these wrappers, but that would require fundamental changes to
3000         our implementation of JSC::Weak pointers. It would allow us to make JSDOMWrapper
3001         destructor-less, and shrink each wrapper object by 1 pointer (the ClassInfo*.)
3002         However the risk:reward ratio does not seem justified at this point in time.
3003
3004         * bindings/scripts/CodeGeneratorJS.pm:
3005         (GenerateHeader):
3006         (GenerateImplementation):
3007         * bindings/js/JSCSSValueCustom.cpp:
3008         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3009         (WebCore::JSTestActiveDOMObject::~JSTestActiveDOMObject):
3010         (WebCore::JSTestActiveDOMObjectOwner::finalize):
3011         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3012         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3013         (WebCore::JSTestCustomNamedGetter::~JSTestCustomNamedGetter):
3014         (WebCore::JSTestCustomNamedGetterOwner::finalize):
3015         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3016         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3017         (WebCore::JSTestEventConstructor::~JSTestEventConstructor):
3018         (WebCore::JSTestEventConstructorOwner::finalize):
3019         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3020         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3021         (WebCore::JSTestEventTarget::~JSTestEventTarget):
3022         (WebCore::JSTestEventTargetOwner::finalize):
3023         * bindings/scripts/test/JS/JSTestEventTarget.h:
3024         * bindings/scripts/test/JS/JSTestException.cpp:
3025         (WebCore::JSTestException::~JSTestException):
3026         (WebCore::JSTestExceptionOwner::finalize):
3027         * bindings/scripts/test/JS/JSTestException.h:
3028         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3029         (WebCore::JSTestGenerateIsReachable::~JSTestGenerateIsReachable):
3030         (WebCore::JSTestGenerateIsReachableOwner::finalize):
3031         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3032         * bindings/scripts/test/JS/JSTestInterface.cpp:
3033         (WebCore::JSTestInterface::~JSTestInterface):
3034         (WebCore::JSTestInterfaceOwner::finalize):
3035         * bindings/scripts/test/JS/JSTestInterface.h:
3036         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3037         (WebCore::JSTestMediaQueryListListener::~JSTestMediaQueryListListener):
3038         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
3039         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3040         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3041         (WebCore::JSTestNamedConstructor::~JSTestNamedConstructor):
3042         (WebCore::JSTestNamedConstructorOwner::finalize):
3043         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3044         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3045         (WebCore::JSTestNondeterministic::~JSTestNondeterministic):
3046         (WebCore::JSTestNondeterministicOwner::finalize):
3047         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3048         * bindings/scripts/test/JS/JSTestObj.cpp:
3049         (WebCore::JSTestObj::~JSTestObj):
3050         (WebCore::JSTestObjOwner::finalize):
3051         * bindings/scripts/test/JS/JSTestObj.h:
3052         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3053         (WebCore::JSTestOverloadedConstructors::~JSTestOverloadedConstructors):
3054         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
3055         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3056         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3057         (WebCore::JSTestSerializedScriptValueInterface::~JSTestSerializedScriptValueInterface):
3058         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
3059         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3060         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3061         (WebCore::JSTestTypedefs::~JSTestTypedefs):
3062         (WebCore::JSTestTypedefsOwner::finalize):
3063         * bindings/scripts/test/JS/JSTestTypedefs.h:
3064         * bindings/scripts/test/JS/JSattribute.cpp:
3065         (WebCore::JSattribute::~JSattribute):
3066         (WebCore::JSattributeOwner::finalize):
3067         * bindings/scripts/test/JS/JSattribute.h:
3068         * bindings/scripts/test/JS/JSreadonly.cpp:
3069         (WebCore::JSreadonly::~JSreadonly):
3070         (WebCore::JSreadonlyOwner::finalize):
3071         * bindings/scripts/test/JS/JSreadonly.h:
3072
3073 2015-04-28  Alex Christensen  <achristensen@webkit.org>
3074
3075         Build WinCairo without cygwin.
3076         https://bugs.webkit.org/show_bug.cgi?id=144365
3077
3078         Reviewed by Myles Maxfield.
3079
3080         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
3081         Pass the CC executable to build-generated-files.pl like r182164.
3082         * WebCore.vcxproj/build-generated-files.pl:
3083         Default to 8 CPUs unless otherwise specified.
3084
3085 2015-04-28  Sam Weinig  <sam@webkit.org>
3086
3087         [Content Extensions] Process NFAs individually to avoid having all NFAs live at the same time
3088         https://bugs.webkit.org/show_bug.cgi?id=144363
3089
3090         Reviewed by Alex Christensen.
3091
3092         This brings dirty memory use when compiling our test content extension down from ~300MB to ~100MB.
3093
3094         * contentextensions/CombinedURLFilters.cpp:
3095         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
3096         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs): Deleted.
3097         * contentextensions/CombinedURLFilters.h:
3098         Replace function that creates a Vector of all the NFAs with one that allows incremental processing
3099         as they are created.
3100
3101         * contentextensions/ContentExtensionCompiler.cpp:
3102         (WebCore::ContentExtensions::addUniversalActionsToDFA):
3103         Extract code to add universal actions into a helper, since we need to call it in two places now.
3104
3105         (WebCore::ContentExtensions::compileRuleList):
3106         Adopt CombinedURLFilters::processNFAs. Now that we don't have a Vector of NFAs, we need to keep track
3107         of whether or not any NFAs were processed and if we are currently processing the first NFA so we can
3108         ensure that we have some bytecode generated event for empty rule sets, and that universal actions are
3109         placed on the first DFA.
3110
3111 2015-04-28  Timothy Horton  <timothy_horton@apple.com>
3112
3113         [TextIndicator] Yellow highlight takes too long to fade out on scroll
3114         https://bugs.webkit.org/show_bug.cgi?id=144358
3115         <rdar://problem/19451011>
3116
3117         Reviewed by Beth Dakin.
3118
3119         * page/TextIndicator.h:
3120         Add Lifetime and DismissalAnimation enums.
3121
3122         (WebCore::TextIndicator::contentImageWithHighlight):
3123         (WebCore::TextIndicator::contentImage):
3124         Fix style.
3125
3126         * page/mac/TextIndicatorWindow.h:
3127         * page/mac/TextIndicatorWindow.mm:
3128         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
3129         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
3130         (WebCore::TextIndicatorWindow::clearTextIndicator):
3131         (WebCore::TextIndicatorWindow::setTextIndicator):
3132         (WebCore::TextIndicatorWindow::closeWindow):
3133         (WebCore::TextIndicatorWindow::startFadeOut):
3134         Rename m_startFadeOutTimer to m_temporaryTextIndicatorTimer (and related).
3135         This is just about temporary-lifetime TextIndicators, like the ones
3136         you get when the find-in-page UI is hidden but you hit Cmd-G.
3137
3138         Add clearTextIndicator, which takes a DismissalAnimation, providing
3139         clients an opportunity to avoid the normal fade-out animation, if it
3140         was going to happen.
3141
3142 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
3143
3144         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
3145         https://bugs.webkit.org/show_bug.cgi?id=144304
3146
3147         Reviewed by Geoffrey Garen.
3148
3149         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
3150
3151         * Configurations/FeatureDefines.xcconfig:
3152
3153 2015-04-28  Commit Queue  <commit-queue@webkit.org>
3154
3155         Unreviewed, rolling out r183514.
3156         https://bugs.webkit.org/show_bug.cgi?id=144359
3157
3158         It broke cloop test bots (Requested by mcatanzaro on #webkit).
3159
3160         Reverted changeset:
3161
3162         "Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT"
3163         https://bugs.webkit.org/show_bug.cgi?id=144304
3164         http://trac.webkit.org/changeset/183514
3165
3166 2015-04-28  Michael Catanzaro  <mcatanzaro@igalia.com>
3167
3168         Fully replace ENABLE_LLINT_C_LOOP with ENABLE_JIT
3169         https://bugs.webkit.org/show_bug.cgi?id=144304
3170
3171         Reviewed by Geoffrey Garen.
3172
3173         Define ENABLE_JIT, enabled by default, instead of ENABLE_LLINT_C_LOOP, disabled by default.
3174
3175         * Configurations/FeatureDefines.xcconfig:
3176
3177 2015-04-28  Zalan Bujtas  <zalan@apple.com>
3178
3179         Checkboxes on bugs.webkit.org are painted with stripes at some zoom levels.
3180         https://bugs.webkit.org/show_bug.cgi?id=144351
3181
3182         Reviewed by Simon Fraser.
3183
3184         This patch ensures that CG context is properly restored after painting dashed/dotted lines.
3185
3186         Test: fast/forms/checkbox-painting-with-hr.html
3187
3188         * platform/graphics/cg/GraphicsContextCG.cpp:
3189         (WebCore::GraphicsContext::drawLine):
3190
3191 2015-04-28  Simon Fraser  <simon.fraser@apple.com>
3192
3193         Provide contentsToView() and viewToContents() functions on ScrollView, and use them
3194         https://bugs.webkit.org/show_bug.cgi?id=144357
3195
3196         Reviewed by Tim Horton.
3197
3198         Too much code was consulting topContentInset() and headerHeight() directly. Replace
3199         with calls to new contentsToView() and viewToContents() functions, which wrap the
3200         exisiting documentScrollOffsetRelativeToViewOrigin().
3201         
3202         Use the new functions in FrameView and ScrollView coordinate mapping functions.
3203         
3204         No behavior change.
3205
3206         * page/FrameView.cpp:
3207         (WebCore::FrameView::convertFromRendererToContainingView):
3208         (WebCore::FrameView::convertFromContainingViewToRenderer):
3209         * platform/ScrollView.cpp:
3210         (WebCore::ScrollView::viewToContents):
3211         (WebCore::ScrollView::contentsToView):
3212         (WebCore::ScrollView::rootViewToContents):
3213         (WebCore::ScrollView::contentsToRootView):
3214         (WebCore::ScrollView::rootViewToTotalContents):
3215         (WebCore::ScrollView::windowToContents):
3216         (WebCore::ScrollView::contentsToWindow):
3217         * platform/ScrollView.h:
3218
3219 2015-04-28  Eric Carlson  <eric.carlson@apple.com>
3220
3221         [Mac] Simplify code to support media engines which do not support target playback
3222         https://bugs.webkit.org/show_bug.cgi?id=144332
3223
3224         Reviewed by Jer Noble.
3225
3226         * Modules/mediasession/WebMediaSessionManager.cpp:
3227         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): Always make client
3228         callback, let them decide if it is significant or not.
3229
3230         * html/HTMLMediaElement.cpp:
3231         (WebCore::HTMLMediaElement::HTMLMediaElement): m_loadTimer -> m_pendingActionTimer.
3232         (WebCore::HTMLMediaElement::scheduleDelayedAction): Handle CheckPlaybackTargetCompatablity.
3233         (WebCore::HTMLMediaElement::scheduleNextSourceChild): m_loadTimer -> m_pendingActionTimer.
3234         (WebCore::HTMLMediaElement::loadTimerFired): Renamed pendingActionTimerFired.
3235         (WebCore::HTMLMediaElement::prepareForLoad): m_loadTimer -> m_pendingActionTimer.
3236         (WebCore::HTMLMediaElement::setDefaultPlaybackRate): Add logging.
3237         (WebCore::HTMLMediaElement::clearMediaPlayer): m_loadTimer -> m_pendingActionTimer.
3238         (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): Removed.
3239         (WebCore::HTMLMediaElement::dispatchEvent): If a 'webkitcurrentplaybacktargetiswirelesschanged'
3240         event is dispatched when the current target is wireless but the media engine does not support
3241         wireless playback, tell the media engine not to play to the target.
3242         * html/HTMLMediaElement.h:
3243         * html/HTMLMediaElement.idl:
3244
3245         * html/HTMLMediaSession.cpp:
3246         (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Drive-by fix to disallow audio-only files.
3247         (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): Deleted.
3248         * html/HTMLMediaSession.h:
3249
3250         * platform/graphics/MediaPlayer.cpp:
3251         (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): Deleted.
3252         * platform/graphics/MediaPlayer.h:
3253         * platform/graphics/MediaPlayerPrivate.h:
3254
3255         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3256         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Use a RetainPtr
3257         to explicitly manage the lifetime of the temporary object.
3258         (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Ditto.
3259         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3260
3261         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3262         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
3263         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless):
3264         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): Deleted.
3265
3266         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3267         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3268         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
3269         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetWireless):
3270         (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Deleted.
3271
3272 2015-04-28  Alex Christensen  <achristensen@webkit.org>
3273
3274         [Content Extensions] Use less memory for CombinedURLFilters.
3275         https://bugs.webkit.org/show_bug.cgi?id=144290
3276
3277         Reviewed by Andreas Kling.
3278
3279         * contentextensions/CombinedURLFilters.cpp:
3280         (WebCore::ContentExtensions::recursiveMemoryUsed):
3281         (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
3282         (WebCore::ContentExtensions::generateNFAForSubtree):
3283         (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
3284         * contentextensions/NFA.cpp:
3285         (WebCore::ContentExtensions::NFA::memoryUsed):
3286         (WebCore::ContentExtensions::NFA::setActions):
3287         * contentextensions/NFA.h:
3288         * contentextensions/NFANode.h:
3289         * contentextensions/Term.h:
3290         (WebCore::ContentExtensions::Term::Term::generateGraph):
3291         (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
3292         Use Vectors instead of HashTables in PrefixTreeVertex because the sets stay small and need to be more memory efficient.
3293
3294 2015-04-28  Brady Eidson  <beidson@apple.com>
3295
3296         Consolidate most "frame load" arguments into FrameLoadRequest.
3297         https://bugs.webkit.org/show_bug.cgi?id=144276
3298
3299         Reviewed by Alexey Proskuryakov.
3300
3301         No new tests (No change in behavior).
3302         
3303         This patch starts the long overdue process of wrangling the insane load methods in FrameLoader.
3304         
3305         Humble beginnings of this long process:
3306         - Put most of the various "frame load" arguments that are passed around within FrameLoader on FrameLoadRequest.
3307         - Get rid of the "easy" constructors of FrameLoadRequest, forcing users to actually think about what they're doing.
3308         - Change a private FrameLoader load method (urlSelected) to take a FrameLoadRequest instead of argument gobbledygook.
3309         - Change a public FrameLoader load methods (changeLocation) to take a FrameLoadRequest instead of gobbledygook.
3310         
3311         These cover the straightforward changes where it was easy to figure out what the values of the FrameLoadRequest
3312         arguments were from these various call sites.
3313         
3314         Further refactoring can be done in much smaller patches, handling fewer cases at a time. Little by little we will be
3315         able to reduce the number of "load" methods on FrameLoader and make sure that they mainly only take a FrameLoadRequest
3316         as an argument.
3317
3318         * inspector/InspectorFrontendClientLocal.cpp:
3319         (WebCore::InspectorFrontendClientLocal::openInNewTab):
3320         
3321         * inspector/InspectorPageAgent.cpp:
3322         (WebCore::InspectorPageAgent::navigate):
3323         
3324         * loader/FrameLoadRequest.cpp:
3325         (WebCore::FrameLoadRequest::FrameLoadRequest):
3326         * loader/FrameLoadRequest.h:
3327         (WebCore::FrameLoadRequest::FrameLoadRequest):
3328         (WebCore::FrameLoadRequest::lockHistory):
3329         (WebCore::FrameLoadRequest::lockBackForwardList):
3330         (WebCore::FrameLoadRequest::shouldSendReferrer):
3331         (WebCore::FrameLoadRequest::allowNavigationToInvalidURL):
3332         (WebCore::FrameLoadRequest::newFrameOpenerPolicy):
3333         (WebCore::FrameLoadRequest::shouldReplaceDocumentIfJavaScriptURL):
3334         
3335         * loader/FrameLoader.cpp:
3336         (WebCore::FrameLoader::changeLocation):
3337         (WebCore::FrameLoader::urlSelected):
3338         (WebCore::FrameLoader::loadFrameRequest):
3339         * loader/FrameLoader.h:
3340         
3341         * loader/NavigationScheduler.cpp:
3342         (WebCore::NavigationScheduler::scheduleLocationChange):
3343         
3344         * page/ContextMenuController.cpp:
3345         (WebCore::openNewWindow):
3346         (WebCore::ContextMenuController::contextMenuItemSelected):
3347         
3348         * page/DOMWindow.cpp:
3349         (WebCore::DOMWindow::createWindow):
3350
3351 2015-04-27  Myles C. Maxfield  <mmaxfield@apple.com>
3352
3353         [Mac] [iOS] Implement font-synthesis CSS property
3354         https://bugs.webkit.org/show_bug.cgi?id=144305
3355
3356         Reviewed by Andreas Kling.
3357
3358         This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
3359
3360         The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
3361         determine if we should synthesize bold and italics, this CSS property simply guards that decision.
3362
3363         Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
3364         regarding font-synthesis into FontDescription (from RenderStyle).
3365
3366         Test: fast/css3-text/font-synthesis.html
3367
3368         * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
3369         inside FontDescription. This also means that the property must be marked as a "high priority" property, which
3370         is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
3371         FontCacheIOS and FontCacheMac have access to the saved state.
3372         * css/CSSComputedStyleDeclaration.cpp:
3373         (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
3374         * css/CSSSegmentedFontFace.cpp:
3375         (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
3376         FontSynthesis state inside FontDescription.
3377         * css/StyleBuilderConverter.h:
3378         (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
3379         StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
3380         CSSPropertyNames.in
3381         * css/StyleBuilderCustom.h:
3382         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
3383         * platform/graphics/FontDescription.h:
3384         (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
3385         (WebCore::FontDescription::fontSynthesis): Ditto.
3386         (WebCore::FontDescription::setFontSynthesis): Ditto.
3387         (WebCore::FontDescription::initialFontSynthesis): Ditto.
3388         (WebCore::FontDescription::operator==): Update to include new state.
3389         * platform/graphics/FontCache.h:
3390         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
3391         state inside FontDescription.