[CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-04-26  Manuel Rego Casasnovas  <rego@igalia.com>
2
3         [CSS Grid Layout] LayoutBox::hasDefiniteLogicalHeight() should consider abspos boxes as definite
4         https://bugs.webkit.org/show_bug.cgi?id=144144
5
6         Reviewed by Darin Adler.
7
8         Change order in hasDefiniteLogicalHeight() ifs to consider definite
9         absolutely positioned elements.
10
11         Test: fast/css-grid-layout/percent-track-breadths-regarding-container-size.html
12
13         * rendering/RenderBox.cpp:
14         (WebCore::RenderBox::hasDefiniteLogicalHeight):
15
16 2015-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
17
18         SVGFilterBuilder should drive the builtin sourceAlpha from the passed sourceGraphic
19         https://bugs.webkit.org/show_bug.cgi?id=144137
20
21         Reviewed by Darin Adler.
22
23         The SourceAlpha should be driven from the last applied FilterEffect. This
24         will require the SourceAlpha FilterEffect to wrap a FilterEffect rather
25         than just getting the SourceGraphic reference from FilterEffectRenderer.
26
27         This is based on the Blink patch:
28         https://src.chromium.org/viewvc/blink?revision=194115&view=revision.
29
30         Test: svg/filters/sourceAlpha-input-filter-effect.html
31         
32         * platform/graphics/filters/SourceAlpha.cpp:
33         (WebCore::SourceAlpha::create): Make SourceAlpha wraps a FilterEffect
34         rather than a Filter.
35         
36         (WebCore::SourceAlpha::determineAbsolutePaintRect): Determine the paint
37         rect from the wrapped FilterEffect.
38         
39         (WebCore::SourceAlpha::platformApplySoftware): Extract the alpha channel
40         from the wrapped FilterEffect.
41         
42         (WebCore::SourceAlpha::SourceAlpha): 
43         * platform/graphics/filters/SourceAlpha.h:
44         (WebCore::SourceAlpha::SourceAlpha): Deleted.
45         Reimplement the constructor of the SourceAlpha such that it wraps the
46         sourceEffect in its inputEffects.
47     
48         * rendering/FilterEffectRenderer.cpp:
49         (WebCore::FilterEffectRenderer::buildReferenceFilter): Delete the FIXME
50         comment and do exactly what it said. This matches the implementation of
51         Gecko and Blink.
52         
53         * rendering/svg/RenderSVGResourceFilter.cpp:
54         (WebCore::RenderSVGResourceFilter::buildPrimitives):
55         Delete the extra argument.
56
57         * svg/graphics/filters/SVGFilterBuilder.cpp:
58         (WebCore::SVGFilterBuilder::SVGFilterBuilder):
59         * svg/graphics/filters/SVGFilterBuilder.h: Drive the SourceAlpha from the
60         passed source FilterEffect.
61
62         * platform/graphics/filters/FEBlend.cpp:
63         * platform/graphics/filters/FEBlend.h:
64         * platform/graphics/filters/FEColorMatrix.cpp:
65         * platform/graphics/filters/FEColorMatrix.h:
66         * platform/graphics/filters/FEComponentTransfer.cpp:
67         * platform/graphics/filters/FEComponentTransfer.h:
68         * platform/graphics/filters/FEComposite.cpp:
69         * platform/graphics/filters/FEComposite.h:
70         * platform/graphics/filters/FEConvolveMatrix.cpp:
71         * platform/graphics/filters/FEConvolveMatrix.h:
72         * platform/graphics/filters/FEDiffuseLighting.cpp:
73         * platform/graphics/filters/FEDiffuseLighting.h:
74         * platform/graphics/filters/FEDisplacementMap.cpp:
75         * platform/graphics/filters/FEDisplacementMap.h:
76         * platform/graphics/filters/FEDropShadow.cpp:
77         * platform/graphics/filters/FEDropShadow.h:
78         * platform/graphics/filters/FEFlood.cpp:
79         * platform/graphics/filters/FEFlood.h:
80         * platform/graphics/filters/FEGaussianBlur.cpp:
81         * platform/graphics/filters/FEGaussianBlur.h:
82         * platform/graphics/filters/FELighting.cpp:
83         * platform/graphics/filters/FELighting.h:
84         * platform/graphics/filters/FEMerge.cpp:
85         * platform/graphics/filters/FEMerge.h:
86         * platform/graphics/filters/FEMorphology.cpp:
87         * platform/graphics/filters/FEMorphology.h:
88         * platform/graphics/filters/FEOffset.cpp:
89         * platform/graphics/filters/FEOffset.h:
90         * platform/graphics/filters/FESpecularLighting.cpp:
91         * platform/graphics/filters/FESpecularLighting.h:
92         * platform/graphics/filters/FETile.cpp:
93         * platform/graphics/filters/FETile.h:
94         * platform/graphics/filters/FETurbulence.cpp:
95         * platform/graphics/filters/FETurbulence.h:
96         * platform/graphics/filters/Filter.h:
97         * platform/graphics/filters/FilterEffect.cpp:
98         * platform/graphics/filters/FilterEffect.h:
99         * platform/graphics/filters/SourceGraphic.cpp:
100         * platform/graphics/filters/SourceGraphic.h:
101         * rendering/svg/RenderSVGResourceFilter.h:
102         * rendering/svg/SVGRenderTreeAsText.cpp:
103         Code clean up: Pointer to reference conversion. It starts by converting
104         FilterEffect::m_filter from pointer to reference and it kept expanding.
105         All the creations of FilterEffect were happening by passing "this" so
106         passing "*this" did not require to check whether the pointer is nil.
107
108         * svg/SVGFEBlendElement.cpp:
109         * svg/SVGFEBlendElement.h:
110         * svg/SVGFEColorMatrixElement.cpp:
111         * svg/SVGFEColorMatrixElement.h:
112         * svg/SVGFEComponentTransferElement.cpp:
113         * svg/SVGFEComponentTransferElement.h:
114         * svg/SVGFECompositeElement.cpp:
115         * svg/SVGFECompositeElement.h:
116         * svg/SVGFEConvolveMatrixElement.cpp:
117         * svg/SVGFEConvolveMatrixElement.h:
118         * svg/SVGFEDiffuseLightingElement.cpp:
119         * svg/SVGFEDiffuseLightingElement.h:
120         * svg/SVGFEDisplacementMapElement.cpp:
121         * svg/SVGFEDisplacementMapElement.h:
122         * svg/SVGFEDropShadowElement.cpp:
123         * svg/SVGFEDropShadowElement.h:
124         * svg/SVGFEFloodElement.cpp:
125         * svg/SVGFEFloodElement.h:
126         * svg/SVGFEGaussianBlurElement.cpp:
127         * svg/SVGFEGaussianBlurElement.h:
128         * svg/SVGFEImageElement.cpp:
129         * svg/SVGFEImageElement.h:
130         * svg/SVGFEMergeElement.cpp:
131         * svg/SVGFEMergeElement.h:
132         * svg/SVGFEMorphologyElement.cpp:
133         * svg/SVGFEMorphologyElement.h:
134         * svg/SVGFEOffsetElement.cpp:
135         * svg/SVGFEOffsetElement.h:
136         * svg/SVGFESpecularLightingElement.cpp:
137         * svg/SVGFESpecularLightingElement.h:
138         * svg/SVGFETileElement.cpp:
139         * svg/SVGFETileElement.h:
140         * svg/SVGFETurbulenceElement.cpp:
141         * svg/SVGFETurbulenceElement.h:
142         * svg/SVGFilterPrimitiveStandardAttributes.h:
143         * svg/graphics/filters/SVGFEImage.cpp:
144         * svg/graphics/filters/SVGFEImage.h:
145         Code clean up: Pointer to reference and PassRefPtr<> to RefPtr<> or Ref<>
146         conversion.
147
148 2015-04-26  Darin Adler  <darin@apple.com>
149
150         REGRESSION (r174283): disabled default buttons use impossible-to-read white text on Mac
151         https://bugs.webkit.org/show_bug.cgi?id=144237
152
153         Reviewed by Simon Fraser.
154
155         No test because DumpRenderTree and WebKitTestRunner don't have a good method
156         for testing behaviors that are specific to active windows. That's the same reason
157         that the change that caused this bug didn't come with a regression test.
158
159         * rendering/RenderTheme.cpp:
160         (WebCore::RenderTheme::adjustStyle): Renamed "e" to "element". Added a comment to
161         clarify the meaning of the setInsideDefaultButton function, and added an
162         isDisabledFormControl check so it won't trigger on a disabled button.
163         (WebCore::RenderTheme::systemColor): Moved CSSValueActivebuttontext into
164         alphabetical order to match the rest of the switch statement ordering.
165
166         * rendering/RenderThemeMac.mm:
167         (WebCore::RenderThemeMac::systemColor): Moved CSSValueActivebuttontext into
168         alphabetical order to match the rest of the switch statement ordering. Also
169         fixed its behavior on older versions of OS X; it should just return the same
170         thing that CSSValueButtontext would return in that context.
171
172 2015-04-26  Yusuke Suzuki  <utatane.tea@gmail.com>
173
174         [ES6] Implement ES6 template literals
175         https://bugs.webkit.org/show_bug.cgi?id=142691
176
177         Reviewed by Darin Adler.
178
179         Add ENABLE_ES6_TEMPLATE_LITERAL_SYNTAX compile time flag.
180
181         * Configurations/FeatureDefines.xcconfig:
182
183 2015-04-26  Javier Fernandez  <jfernandez@igalia.com>
184
185         [CSS Grid Layout] Support for align-self and align-items in grid layout
186         https://bugs.webkit.org/show_bug.cgi?id=133225
187
188         Reviewed by Darin Adler.
189
190         Implementation of align-self and align-items properties for grid. It supports
191         different writing-modes and direction. Margins, borders and paddings are also
192         considered when computing the final position and stretched size.
193
194         Overflow handling is still missing and will be added when implemented row-axis
195         alignment support.
196
197         Test: fast/css-grid-layout/grid-align.html
198
199         * rendering/RenderBox.cpp:
200         (WebCore::RenderBox::computeLogicalHeight):
201         * rendering/RenderGrid.cpp:
202         (WebCore::RenderGrid::logicalContentHeightForChild):
203         (WebCore::RenderGrid::layoutGridItems):
204         (WebCore::computeOverflowAlignmentOffset):
205         (WebCore::RenderGrid::endOfRowForChild):
206         (WebCore::RenderGrid::startOfRowForChild):
207         (WebCore::RenderGrid::centeredRowPositionForChild):
208         (WebCore::marginWidthForChild):
209         (WebCore::marginHeightForChild):
210         (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild):
211         (WebCore::RenderGrid::needToStretchChildLogicalHeight):
212         (WebCore::RenderGrid::marginLogicalHeightForChild):
213         (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
214         (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
215         (WebCore::RenderGrid::rowPositionForChild):
216         (WebCore::RenderGrid::findChildLogicalPosition):
217         (WebCore::RenderGrid::populateGridPositions): Deleted.
218         * rendering/RenderGrid.h:
219
220 2015-04-26  Doug Russell  <d_russell@apple.com>
221
222         AX: richer text change notifications (142719)
223         https://bugs.webkit.org/show_bug.cgi?id=142719
224
225         Reviewed by Darin Adler.
226
227         Richer accessibility value change notifications. Introduce AXTextEditType,
228         postTextStateChangeNotification and postTextReplacementNotification to give assistive
229         tech apps more reliable context for responding to changes in web content. Also implement
230         a mechanism to post value changes in password form fields in coalesced ticks to thwart
231         analyzing the cadence of changes.
232
233         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent,
234         and an overload of postTextReplacementNotification to give assistive tech apps more
235         reliable context for responding to changes in web content selection. Also block posting
236         selection changes on password fields.
237
238         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
239                platform/mac/accessibility/selection-change-userinfo.html
240                platform/mac/accessibility/value-change-userinfo.html
241
242         * CMakeLists.txt:
243         * WebCore.vcxproj/WebCore.vcxproj:
244         * WebCore.vcxproj/WebCore.vcxproj.filters:
245         * WebCore.xcodeproj/project.pbxproj:
246         * accessibility/AXObjectCache.cpp:
247         (WebCore::AXObjectCache::AXObjectCache):
248         (WebCore::AXObjectCache::notificationPostTimerFired):
249         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
250         (WebCore::AXObjectCache::showIntent):
251         (WebCore::AXObjectCache::setTextSelectionIntent):
252         (WebCore::isPasswordFieldOrContainedByPasswordField):
253         (WebCore::AXObjectCache::postTextStateChangeNotification):
254         (WebCore::AXObjectCache::postTextReplacementNotification):
255         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
256         (WebCore::AXObjectCache::rootWebArea):
257         (WebCore::AXObjectCache::textChangeForEditType):
258         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
259         (WebCore::AXObjectCache::frameLoadingEventNotification): Deleted.
260         * accessibility/AXObjectCache.h:
261         (WebCore::AXObjectCache::postTextStateChangeNotification):
262         (WebCore::AXObjectCache::postTextReplacementNotification):
263         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
264         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
265         (WebCore::AXObjectCache::textChangeForEditType):
266         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
267         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
268         (WebCore::AXObjectCache::getOrCreate): Deleted.
269         (WebCore::AXObjectCache::attachWrapper): Deleted.
270         * accessibility/AXTextStateChangeIntent.h: Added.
271         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
272         * accessibility/AccessibilityNodeObject.cpp:
273         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
274         * accessibility/AccessibilityNodeObject.h:
275         * accessibility/AccessibilityObject.cpp:
276         (WebCore::AccessibilityObject::isContainedByPasswordField):
277         * accessibility/AccessibilityObject.h:
278         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
279         (WebCore::AccessibilityObject::isPasswordField): Deleted.
280         * accessibility/AccessibilityRenderObject.cpp:
281         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
282         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
283         * accessibility/AccessibilityScrollView.h:
284         * accessibility/atk/AXObjectCacheAtk.cpp:
285         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
286         * accessibility/ios/AXObjectCacheIOS.mm:
287         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
288         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
289         * accessibility/mac/AXObjectCacheMac.mm:
290         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
291         (WebCore::AXPostNotificationWithUserInfo):
292         (WebCore::AXObjectCache::postPlatformNotification):
293         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
294         (WebCore::textReplacementChangeDictionary):
295         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
296         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
297         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
298         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
299         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
300         (arrayRemovingNonJSONTypes):
301         (dictionaryRemovingNonJSONTypes):
302         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
303         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
304         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
305         (textMarkerRangeFromVisiblePositions):
306         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
307         * editing/AppendNodeCommand.cpp:
308         (WebCore::AppendNodeCommand::AppendNodeCommand):
309         (WebCore::sendAXTextChangedIgnoringLineBreaks):
310         (WebCore::AppendNodeCommand::doApply):
311         (WebCore::AppendNodeCommand::doUnapply):
312         * editing/AppendNodeCommand.h:
313         (WebCore::AppendNodeCommand::create):
314         * editing/ApplyStyleCommand.cpp:
315         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
316         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
317         * editing/ApplyStyleCommand.h:
318         * editing/CompositeEditCommand.cpp:
319         (WebCore::EditCommandComposition::unapplyEditType):
320         (WebCore::CompositeEditCommand::CompositeEditCommand):
321         (WebCore::CompositeEditCommand::apply):
322         (WebCore::CompositeEditCommand::insertParagraphSeparator):
323         (WebCore::CompositeEditCommand::insertNodeBefore):
324         (WebCore::CompositeEditCommand::appendNode):
325         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
326         (WebCore::CompositeEditCommand::insertTextIntoNode):
327         (WebCore::CompositeEditCommand::deleteTextFromNode):
328         (WebCore::CompositeEditCommand::replaceTextInNode):
329         (WebCore::CompositeEditCommand::moveParagraphs):
330         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
331         (WebCore::CompositeEditCommand::applyStyle): Deleted.
332         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
333         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
334         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
335         (WebCore::CompositeEditCommand::inputText): Deleted.
336         * editing/CompositeEditCommand.h:
337         * editing/DeleteFromTextNodeCommand.cpp:
338         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
339         (WebCore::DeleteFromTextNodeCommand::doApply):
340         (WebCore::DeleteFromTextNodeCommand::doUnapply):
341         * editing/DeleteFromTextNodeCommand.h:
342         (WebCore::DeleteFromTextNodeCommand::create):
343         (WebCore::DeleteFromTextNodeCommand::deletedText):
344         * editing/DeleteSelectionCommand.cpp:
345         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
346         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
347         * editing/DeleteSelectionCommand.h:
348         (WebCore::DeleteSelectionCommand::create):
349         * editing/DictationCommand.cpp:
350         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
351         (WebCore::DictationCommand::insertParagraphSeparator):
352         * editing/EditAction.h:
353         * editing/EditCommand.cpp:
354         (WebCore::EditCommand::EditCommand):
355         (WebCore::EditCommand::editingAction):
356         (WebCore::EditCommand::applyEditType):
357         (WebCore::EditCommand::unapplyEditType):
358         (WebCore::SimpleEditCommand::SimpleEditCommand):
359         (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
360         (WebCore::EditCommand::setParent): Deleted.
361         * editing/EditCommand.h:
362         * editing/EditingAllInOne.cpp:
363         * editing/Editor.cpp:
364         (WebCore::Editor::handleTextEvent):
365         (WebCore::Editor::deleteSelectionWithSmartDelete):
366         (WebCore::Editor::replaceSelectionWithFragment):
367         (WebCore::Editor::replaceSelectionWithText):
368         (WebCore::Editor::appliedEditing):
369         (WebCore::Editor::unappliedEditing):
370         (WebCore::Editor::performCutOrCopy):
371         (WebCore::Editor::markMisspellingsAfterTypingToWord):
372         (WebCore::Editor::changeBackToReplacedString):
373         (WebCore::Editor::transpose):
374         (WebCore::Editor::changeSelectionAfterCommand):
375         * editing/Editor.h:
376         * editing/EditorCommand.cpp:
377         (WebCore::executeInsertFragment):
378         * editing/FrameSelection.cpp:
379         (WebCore::FrameSelection::moveTo):
380         (WebCore::FrameSelection::moveWithoutValidationTo):
381         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
382         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
383         (WebCore::FrameSelection::setSelection):
384         (WebCore::FrameSelection::updateAndRevealSelection):
385         (WebCore::isBoundary):
386         (WebCore::FrameSelection::textSelectionIntent):
387         (WebCore::FrameSelection::modify):
388         (WebCore::FrameSelection::selectAll):
389         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
390         (WebCore::FrameSelection::modifyMovingBackward): Deleted.
391         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
392         (WebCore::FrameSelection::selectionAtWordStart): Deleted.
393         * editing/FrameSelection.h:
394         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
395         (WebCore::FrameSelection::selection): Deleted.
396         * editing/InsertIntoTextNodeCommand.cpp:
397         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
398         (WebCore::InsertIntoTextNodeCommand::doApply):
399         (WebCore::InsertIntoTextNodeCommand::doUnapply):
400         * editing/InsertIntoTextNodeCommand.h:
401         (WebCore::InsertIntoTextNodeCommand::create):
402         (WebCore::InsertIntoTextNodeCommand::insertedText):
403         * editing/InsertNodeBeforeCommand.cpp:
404         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
405         (WebCore::InsertNodeBeforeCommand::doApply):
406         (WebCore::InsertNodeBeforeCommand::doUnapply):
407         * editing/InsertNodeBeforeCommand.h:
408         (WebCore::InsertNodeBeforeCommand::create):
409         * editing/InsertParagraphSeparatorCommand.cpp:
410         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
411         * editing/InsertParagraphSeparatorCommand.h:
412         (WebCore::InsertParagraphSeparatorCommand::create):
413         * editing/InsertTextCommand.cpp:
414         (WebCore::InsertTextCommand::InsertTextCommand):
415         * editing/InsertTextCommand.h:
416         (WebCore::InsertTextCommand::create):
417         (WebCore::InsertTextCommand::createWithMarkerSupplier):
418         * editing/MoveSelectionCommand.cpp:
419         (WebCore::MoveSelectionCommand::doApply):
420         * editing/RemoveNodePreservingChildrenCommand.cpp:
421         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
422         * editing/RemoveNodePreservingChildrenCommand.h:
423         (WebCore::RemoveNodePreservingChildrenCommand::create):
424         * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
425         (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
426         (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
427         * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
428         * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
429         (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
430         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
431         * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
432         * editing/ReplaceSelectionCommand.cpp:
433         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
434         (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
435         (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
436         * editing/ReplaceSelectionCommand.h:
437         (WebCore::ReplaceSelectionCommand::create):
438         * editing/TypingCommand.cpp:
439         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
440         (WebCore::TypingCommand::insertParagraphSeparator):
441         * editing/atk/FrameSelectionAtk.cpp:
442         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
443         * editing/ios/DictationCommandIOS.cpp:
444         (WebCore::DictationCommandIOS::DictationCommandIOS):
445         * editing/ios/DictationCommandIOS.h:
446         * editing/mac/FrameSelectionMac.mm:
447         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
448         * html/HTMLTextFormControlElement.cpp:
449         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
450         * page/DragController.cpp:
451         (WebCore::DragController::concludeEditDrag):
452         * page/EventHandler.cpp:
453         (WebCore::setInitialKeyboardSelection):
454         * page/FocusController.cpp:
455         (WebCore::FocusController::advanceFocusInDocumentOrder):
456
457 2015-04-26  Darin Adler  <darin@apple.com>
458
459         REGRESSION (r176751): line-height ignored in <button> elements
460         https://bugs.webkit.org/show_bug.cgi?id=144234
461
462         Reviewed by Antti Koivisto.
463
464         Test: fast/forms/button-line-height.html
465
466         The theme code was overriding line heights on all themed form controls.
467         Instead it should have only overridden line height when the theme overrides the font.
468         For <input type=button> on Mac, the theme always overrides the font, but for
469         other elements like <button> it does not.
470
471         * platform/Theme.h: Changed controlFont to return an Optional so we can tell
472         when the theme is overriding the font. Otherwise if the font from the user-agent
473         style sheet and the font from the theme are the same, we will think we are not
474         overriding the font when we actually are.
475
476         * platform/mac/ThemeMac.h: Updated controlFont to return Optional.
477         * platform/mac/ThemeMac.mm:
478         (WebCore::ThemeMac::controlFont): Ditto.
479
480         * rendering/RenderTheme.cpp:
481         (WebCore::RenderTheme::adjustStyle): Set line height only if the font is
482         overriden by the theme, all the time for PushButtonPart on Mac, and not at all
483         for other parts. Also tightened up the logic a little since RenderStyle's
484         setFontDescription already does an "==" comparison; we don't have to do
485         that twice.
486
487 2015-04-26  Darin Adler  <darin@apple.com>
488
489         REGRESSION (r173801): Use after free in WebCore::NotificationCenter::~NotificationCenter
490         https://bugs.webkit.org/show_bug.cgi?id=137163
491
492         Reviewed by Andy Estes.
493
494         Test: fast/notifications/request-notification-permission-while-reloading.html
495
496         The test doesn't crash under WebKit2, but that's still OK for our purposes.
497
498         * Modules/notifications/NotificationCenter.cpp:
499         (WebCore::NotificationCenter::NotificationCenter): Initialize m_timer.
500         (WebCore::NotificationCenter::createNotification): Moved here from the header.
501         (WebCore::NotificationCenter::requestPermission): Start the timer and ref the notification
502         center when we need to defer a callback. Also use a lambda for the callback and changed
503         the argument to match what the bindings actually pass. Before we said PassRefPtr, but the
504         bindings were not transferring ownership of the VoidCallback. The new type is a little
505         strange but it's consistent with how the bindings work right now.
506         (WebCore::NotificationCenter::timerFired): Added. Calls all the callbacks, then does a deref
507         to match the ref we did above.
508         (WebCore::NotificationCenter::requestTimedOut): Deleted.
509         (WebCore::NotificationCenter::NotificationRequestCallback::createAndStartTimer): Deleted.
510         (WebCore::NotificationCenter::NotificationRequestCallback::NotificationRequestCallback): Deleted.
511         (WebCore::NotificationCenter::NotificationRequestCallback::startTimer): Deleted.
512         (WebCore::NotificationCenter::NotificationRequestCallback::timerFired): Deleted.
513
514         * Modules/notifications/NotificationCenter.h: Reorganized the header to be a bit more tidy.
515         Changed the argument type for requestPermission to match the reality of what's passed by the
516         bindings. Removed NotificationRequestCallback and replaced the m_callbacks HashSet with a
517         vector of std::function.
518
519 2015-04-26  Simon Fraser  <simon.fraser@apple.com>
520
521         Modernize animations code
522         https://bugs.webkit.org/show_bug.cgi?id=144196
523
524         Reviewed by Darin Adler.
525         
526         General cleanup in animation-related code.
527         
528         Use C++ references where possible. Use modern loops. Make classes fast-allocated.
529         Use C++11 member initialization. Order member variables to optimize packing.
530         
531         This removes some null checks in CompositeAnimation, but the values in m_transitions
532         and m_keyframeAnimations can never be null.
533         
534         No behavior change.
535
536         * page/animation/AnimationBase.cpp:
537         (WebCore::AnimationBase::AnimationBase):
538         (WebCore::AnimationBase::animationsMatch):
539         (WebCore::AnimationBase::updateStateMachine):
540         (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
541         (WebCore::AnimationBase::beginAnimationUpdateTime):
542         (WebCore::AnimationBase::getElapsedTime):
543         * page/animation/AnimationBase.h:
544         (WebCore::AnimationBase::animation):
545         (WebCore::AnimationBase::setAnimation):
546         * page/animation/AnimationController.cpp:
547         (WebCore::AnimationControllerPrivate::ensureCompositeAnimation):
548         (WebCore::AnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse):
549         * page/animation/CompositeAnimation.cpp:
550         (WebCore::CompositeAnimation::CompositeAnimation):
551         (WebCore::CompositeAnimation::clearRenderer):
552         (WebCore::CompositeAnimation::updateTransitions):
553         (WebCore::CompositeAnimation::updateKeyframeAnimations):
554         (WebCore::CompositeAnimation::animate):
555         (WebCore::CompositeAnimation::getAnimatedStyle):
556         (WebCore::CompositeAnimation::timeToNextService):
557         (WebCore::CompositeAnimation::getAnimationForProperty):
558         (WebCore::CompositeAnimation::computeExtentOfTransformAnimation):
559         (WebCore::CompositeAnimation::suspendAnimations):
560         (WebCore::CompositeAnimation::resumeAnimations):
561         (WebCore::CompositeAnimation::overrideImplicitAnimations):
562         (WebCore::CompositeAnimation::resumeOverriddenImplicitAnimations):
563         (WebCore::CompositeAnimation::isAnimatingProperty):
564         (WebCore::CompositeAnimation::pauseTransitionAtTime):
565         (WebCore::CompositeAnimation::numberOfActiveAnimations):
566         * page/animation/CompositeAnimation.h:
567         (WebCore::CompositeAnimation::create):
568         (WebCore::CompositeAnimation::animationController):
569         * page/animation/ImplicitAnimation.cpp:
570         (WebCore::ImplicitAnimation::ImplicitAnimation):
571         (WebCore::ImplicitAnimation::sendTransitionEvent):
572         * page/animation/ImplicitAnimation.h:
573         (WebCore::ImplicitAnimation::create):
574         * page/animation/KeyframeAnimation.cpp:
575         (WebCore::KeyframeAnimation::KeyframeAnimation):
576         (WebCore::KeyframeAnimation::animate):
577         (WebCore::KeyframeAnimation::getAnimatedStyle):
578         (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation):
579         (WebCore::KeyframeAnimation::startAnimation):
580         (WebCore::KeyframeAnimation::sendAnimationEvent):
581         (WebCore::KeyframeAnimation::overrideAnimations):
582         (WebCore::KeyframeAnimation::resumeOverriddenAnimations):
583         (WebCore::KeyframeAnimation::timeToNextService):
584         * page/animation/KeyframeAnimation.h:
585         * platform/animation/Animation.cpp:
586         (WebCore::Animation::animationsMatch):
587         * platform/animation/Animation.h:
588         * rendering/RenderLayer.cpp:
589         (WebCore::RenderLayer::paint):
590         (WebCore::performOverlapTests):
591         * rendering/style/KeyframeList.h:
592         (WebCore::KeyframeList::properties):
593         (WebCore::KeyframeList::keyframes):
594         (WebCore::KeyframeList::beginProperties): Deleted.
595         (WebCore::KeyframeList::endProperties): Deleted.
596         (WebCore::KeyframeList::operator[]): Deleted.
597         * rendering/style/RenderStyle.h:
598
599 2015-04-25  Simon Fraser  <simon.fraser@apple.com>
600
601         Expand compositing coverage rect when scrolling and animating
602         https://bugs.webkit.org/show_bug.cgi?id=144214
603         rdar://problem/20695926
604
605         Reviewed by Darin Adler.
606         
607         r183300 added a secondary rect that gets mapped through graphics layers during
608         layer flushing, which represents a rect, in layer coordinates, that represents
609         the portion of this layer that's visible in the viewport.
610         
611         This patch extends that rect based on scrolling and animating, with the extended
612         coverage rect being mapped into descendants (where it's used to determine whether
613         they should detach their backing store). This required moving the responsibility for
614         extending the coverage rect from TileController (where it was used to compute
615         tiled extent), to GraphicsLayerCA. Thus, GraphicsLayerCA now owns the concept
616         of coverage rect, and pushes it onto TileControllers.
617
618         Test: compositing/tiling/transform-origin-tiled.html
619
620         * platform/graphics/TiledBacking.h: Coverage rect is now pushed onto
621         TiledBacking from outside; new functions reflect that.
622         * platform/graphics/ca/GraphicsLayerCA.cpp:
623         (WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly): No need to pass
624         old visible rect to commitLayerChangesBeforeSublayers.
625         (WebCore::accumulatesTransform):
626         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush): Now calls computeVisibleAndCoverageRect(),
627         then adjustCoverageRect() which adjusts for scrolling and animations.
628         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect): Fetch the coverage rect from the
629         TransformState, but we can only use this if mapping it through various transforms didn't clamp
630         it (which can happen with severe rotations in perspective).
631         (WebCore::GraphicsLayerCA::adjustCoverageRect): If this layer represents the page tiled backing,
632         ask the TileController to do coverage adjustment (code which should move into here eventually).
633         For other tiled layers, do motion-based adjustment. This should really be done for all layers
634         (an animating non-tiled layer may contain a tiled layer).
635         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): The VisibleRectChanged wasn't needed
636         any more; layers only react to changed in coverage rect now.
637         (WebCore::GraphicsLayerCA::recursiveCommitChanges): If adjustCoverageRect() changed the
638         coverage rect, here we push the new rect back into the TransformState so it will affect
639         descendants.
640         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
641         (WebCore::GraphicsLayerCA::updateCoverage): Coverage and backing store attachment go
642         hand-in-hand now.
643         (WebCore::GraphicsLayerCA::changeLayerTypeTo):
644         (WebCore::GraphicsLayerCA::computeVisibleRect): Deleted.
645         (WebCore::GraphicsLayerCA::updateBackingStoreAttachment): Deleted.
646         (WebCore::GraphicsLayerCA::updateVisibleRect): Deleted.
647         * platform/graphics/ca/GraphicsLayerCA.h:
648         * platform/graphics/ca/TileController.cpp:
649         (WebCore::TileController::setVisibleRect): Visible rect is only used for scroll performance
650         logging now.
651         (WebCore::TileController::setCoverageRect):
652         (WebCore::TileController::tilesWouldChangeForCoverageRect):
653         (WebCore::TileController::revalidateTiles):
654         (WebCore::TileController::boundsForSize): This is required because when computeTileCoverageRect()
655         is called at the top of committing the owning layer, we haven't yet pushed a new size to the
656         underlying platform layer (which TileController::bounds() consults).
657         (WebCore::TileController::bounds):
658         (WebCore::TileController::computeTileCoverageRect): Have to push the new size in, since the
659         underlying layer hasn't been updated yet.
660         (WebCore::TileController::didRevalidateTiles):
661         (WebCore::TileController::tilesWouldChangeForVisibleRect): Deleted.
662         * platform/graphics/ca/TileController.h:
663         * platform/graphics/ca/TileCoverageMap.cpp:
664         (WebCore::TileCoverageMap::TileCoverageMap): Add a layer to the tile map that shows 
665         a dark blue outline for the coverage rect.
666         (WebCore::TileCoverageMap::update): Fix some minor issues with map position when top
667         content inset is non-zero.
668         * platform/graphics/ca/TileCoverageMap.h:
669         * platform/graphics/ca/TileGrid.cpp: Everything is in terms of coverage rect now.
670         (WebCore::TileGrid::tilesWouldChangeForCoverageRect):
671         (WebCore::TileGrid::revalidateTiles):
672         (WebCore::TileGrid::tilesWouldChangeForVisibleRect): Deleted.
673         * platform/graphics/ca/TileGrid.h:
674         * platform/graphics/transforms/TransformState.cpp:
675         (WebCore::TransformState::operator=):
676         (WebCore::TransformState::mappedQuad): Pass direction into mapQuad().
677         (WebCore::TransformState::mappedSecondaryQuad): Ditto.
678         (WebCore::TransformState::setLastPlanarSecondaryQuad): This function allows a caller
679         to pass in a secondary quad, and get it mapped into the coordinate space of the last
680         "flattening" state (since the TransformState may have in-flight XY offset, or transform).
681         This mapping is achieved by re-using mapQuad(), but in the inverse direction.
682         (WebCore::TransformState::mapQuad): Make direction a parameter.
683         (WebCore::TransformState::flattenWithTransform): This code omitted to map the secondary
684         quad. Failure was detected by tests.
685         * platform/graphics/transforms/TransformState.h:
686         (WebCore::TransformState::isMappingSecondaryQuad):
687         (WebCore::TransformState::direction):
688         (WebCore::TransformState::inverseDirection):
689         (WebCore::TransformState::lastPlanarSecondaryQuad): Deleted.
690
691 2015-04-25  Dan Bernstein  <mitz@apple.com>
692
693         Updated expected bindings generation test results after r183343.
694
695         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h:
696         * bindings/scripts/test/ObjC/DOMTestCallback.h:
697         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h:
698         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
699         * bindings/scripts/test/ObjC/DOMTestEventTarget.h:
700         * bindings/scripts/test/ObjC/DOMTestException.h:
701         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h:
702         * bindings/scripts/test/ObjC/DOMTestInterface.h:
703         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h:
704         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h:
705         * bindings/scripts/test/ObjC/DOMTestNode.h:
706         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h:
707         * bindings/scripts/test/ObjC/DOMTestObj.h:
708         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h:
709         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
710         * bindings/scripts/test/ObjC/DOMTestTypedefs.h:
711         * bindings/scripts/test/ObjC/DOMattribute.h:
712         * bindings/scripts/test/ObjC/DOMreadonly.h:
713
714 2015-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
715
716         font-synthesis's initial value is "style weight"
717         https://bugs.webkit.org/show_bug.cgi?id=144195
718
719         Reviewed by Darin Adler.
720
721         Updated fast/css3-text/font-synthesis-parse.html.
722
723         * rendering/style/RenderStyle.h:
724
725 2015-04-25  Commit Queue  <commit-queue@webkit.org>
726
727         Unreviewed, rolling out r183305.
728         https://bugs.webkit.org/show_bug.cgi?id=144213
729
730         Crashes on wikipedia (Requested by litherum on #webkit).
731
732         Reverted changeset:
733
734         "[Cocoa] FontPlatformData's equality check should always use
735         reference URLs"
736         https://bugs.webkit.org/show_bug.cgi?id=144168
737         http://trac.webkit.org/changeset/183305
738
739 2015-04-25  Dan Bernstein  <mitz@apple.com>
740
741         WebCore part of <rdar://problem/20697966> Avoid using TBD as an argument to NS_AVAILABLE
742         https://bugs.webkit.org/show_bug.cgi?id=144201
743
744         Reviewed by Darin Adler.
745
746         Instead of TBD, use the high version number to which it corresponds in CFAvailability.h,
747         9876.5.
748
749         * bindings/objc/WebKitAvailability.h: Added a definition of __NSi_9876_5, so that we can
750         use 9876_5 in availability macros. Removed the definition of
751         __AVAILABILITY_INTERNAL__MAC_TBD, which will no longer be used.
752
753         * bindings/scripts/CodeGeneratorObjC.pm:
754         (ReadPublicInterfaces): Use 9876_5 instead of TBD.
755
756 2015-04-25  Timothy Hatcher  <timothy@apple.com>
757
758         Update localized strings.
759
760         * English.lproj/Localizable.strings: Updated.
761
762 2015-04-25  Darin Adler  <darin@apple.com>
763
764         Crash if IDBTransaction is aborted right after it's created
765         https://bugs.webkit.org/show_bug.cgi?id=144199
766
767         Reviewed by Simon Fraser.
768
769         Test: storage/indexeddb/transaction-abort.html
770
771         * Modules/indexeddb/IDBTransactionBackend.cpp:
772         (WebCore::IDBTransactionBackend::IDBTransactionBackend): Don't start the
773         transaction if it is already complete (has been aborted).
774
775 2015-04-25  Martin Robinson  <mrobinson@igalia.com>
776
777         Rename ENABLE_3D_RENDERING to ENABLE_3D_TRANSFORMS
778         https://bugs.webkit.org/show_bug.cgi?id=144182
779
780         Reviewed by Simon Fraser.
781
782         * Configurations/FeatureDefines.xcconfig: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
783         * WebCore.vcxproj/WebCoreCommon.props: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
784         * WebCore.vcxproj/WebCoreTestSupportCommon.props: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
785         * css/CSSComputedStyleDeclaration.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
786         * css/MediaQueryEvaluator.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
787         * platform/graphics/GraphicsContext.h: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
788         * platform/graphics/cairo/GraphicsContextCairo.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
789         * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
790         * rendering/RenderLayer.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
791         * rendering/RenderLayerCompositor.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
792         * rendering/RenderObject.cpp: Replace all instances of 3D_RENDERING with 3D_TRANSFORMS.
793
794 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
795
796         [Cocoa] FontPlatformData's equality check should always use reference URLs
797         https://bugs.webkit.org/show_bug.cgi?id=144168
798
799         Reviewed by Tim Horton.
800
801         <rdar://problem/18985642> is not fixed, so we need to continue using the older
802         objectForEqualityCheck().
803
804         No new tests because there is no behavior change.
805
806         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
807         (WebCore::FontPlatformData::objectForEqualityCheck):
808
809 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
810
811         Implement parsing support for font-synthesis CSS property
812         https://bugs.webkit.org/show_bug.cgi?id=144180
813         <rdar://problem/20692791>
814         <rdar://problem/20625024>
815
816         Reviewed by Tim Horton.
817
818         See http://www.w3.org/TR/css-fonts-3/#font-synthesis-prop
819
820         This property allows web authors to opt out of font synthesis. This patch only
821         implements parsing support for the property.
822
823         Test: fast/css3-text/font-synthesis-parse.html
824
825         * css/CSSComputedStyleDeclaration.cpp:
826         (WebCore::fontSynthesisFromStyle): Create a CSSValue for the existing style object.
827         (WebCore::ComputedStyleExtractor::propertyValue): Call fontSynthesisFromStyle().
828         * css/CSSParser.cpp:
829         (WebCore::CSSParser::parseValue): Call parseFontSynthesis().
830         (WebCore::CSSParser::parseFontSynthesis): Accept the grammar
831         "none | [ weight || style ]"
832         * css/CSSParser.h: Function signature.
833         * css/CSSPropertyNames.in: New CSS property name.
834         * css/CSSValueKeywords.in: New CSS value names.
835         * css/StyleBuilderCustom.h:
836         (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Construct an internal
837         representation of font-synthesis for a given CSSValue.
838         * rendering/style/RenderStyle.h: Function signature.
839         * rendering/style/RenderStyleConstants.h: Internal representation of
840         font-synthesis.
841         * rendering/style/StyleRareInheritedData.h: Where we actually store the bits
842         related to this internal representation.
843
844 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
845
846         Have the web inspector report accurate memory use for layers with detached backing store
847         https://bugs.webkit.org/show_bug.cgi?id=144179
848
849         Reviewed by Dean Jackson.
850
851         Only report memory use for layers whose backing store is attached.
852
853         * platform/graphics/ca/GraphicsLayerCA.cpp:
854         * platform/graphics/ca/PlatformCALayer.h: Add backingContributesToMemoryEstimate()
855         which platforms can override if they allow backing store detaching.
856
857 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
858
859         Track a coverage rect through GraphicsLayerCA flushes, use it to mark backing store attached
860         https://bugs.webkit.org/show_bug.cgi?id=144165
861
862         Reviewed by Dean Jackson.
863         
864         Push in the clipRect as the secondary rect when doing a GraphicsLayerCA flush,
865         which maps this rect through all the layers. Each layer tests intersection with
866         this rect to determine if its backing store should be attached.
867         
868         This will cause us to drop backing store for layers that don't intersect the
869         visible part of the view, which is too aggressive. A future patch will add
870         some padding.
871
872         Tests: compositing/visible-rect/coverage-clipped.html
873                compositing/visible-rect/coverage-scrolling.html
874
875         * platform/graphics/ca/GraphicsLayerCA.cpp:
876         (WebCore::GraphicsLayerCA::GraphicsLayerCA): Remove initialization of things with
877         C++11 initializers. Initialize the new m_intersectsCoverageRect bit.
878         (WebCore::GraphicsLayerCA::flushCompositingState): Push the clipRect in as the
879         secondary coverage rect. A future patch will inflate this on the way down the tree.
880         (WebCore::GraphicsLayerCA::computeVisibleRect): If we're clipping, and
881         we have a secondary coverage rect, that rect can be clipped to us too.
882         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
883         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
884         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
885         (WebCore::GraphicsLayerCA::updateBackingStoreAttachment):
886         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
887         * platform/graphics/ca/GraphicsLayerCA.h: New CoverageRectChanged bit.
888         Use more C++11 initializers.
889         (WebCore::GraphicsLayerCA::coverageRect):
890
891 2015-04-24  Dean Jackson  <dino@apple.com>
892
893         AnimationController::scrollWasUpdated() shows up in scrolling profiles on pages that don't use scroll triggers
894         https://bugs.webkit.org/show_bug.cgi?id=144173
895         <rdar://problem/20526168>
896
897         Reviewed by Simon Fraser.
898
899         Keep a list of Animations that care about scroll updates, and only
900         run the animation update if the list is not empty.
901
902         Covered by existing tests.
903
904         * page/animation/AnimationBase.cpp:
905         (WebCore::AnimationBase::updateStateMachine): Tell the AnimationController
906         if this is an animation that depends on scrolling.
907         * page/animation/AnimationController.cpp:
908         (WebCore::AnimationControllerPrivate::animationWillBeRemoved): Call the
909         new removeFromAnimationsDependentOnScroll as this animation is deleted.
910         (WebCore::AnimationControllerPrivate::addToAnimationsDependentOnScroll):
911         (WebCore::AnimationControllerPrivate::removeFromAnimationsDependentOnScroll):
912         (WebCore::AnimationControllerPrivate::scrollWasUpdated): Only update if
913         there are animations that care.
914         (WebCore::AnimationController::wantsScrollUpdates): Helper to expose this
915         value to FrameView.
916         * page/animation/AnimationController.h:
917         * page/animation/AnimationControllerPrivate.h:
918         (WebCore::AnimationControllerPrivate::wantsScrollUpdates):
919
920 2015-04-24  Tim Horton  <timothy_horton@apple.com>
921
922         WKPDFView does not support password-protected PDFs
923         https://bugs.webkit.org/show_bug.cgi?id=144162
924         <rdar://problem/18411512>
925
926         Reviewed by Andy Estes.
927
928         * English.lproj/Localizable.strings:
929         Add some localizable strings.
930
931 2015-04-24  David Kilzer  <ddkilzer@apple.com>
932
933         Fix iOS EWS builds after updating to iOS 8.3 SDK
934
935         * platform/spi/cocoa/CoreTextSPI.h:
936         * rendering/RenderThemeIOS.mm:
937         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
938         - Update __IPHONE_OS_VERSION_MIN_REQUIRED for these constants.
939
940 2015-04-24  Jer Noble  <jer.noble@apple.com>
941
942         Unreviewed iOS build fix; add declarations to AVKitSPI.h
943
944         * platform/spi/cocoa/AVKitSPI.h:
945
946 2015-04-24  Enrica Casucci  <enrica@apple.com>
947
948         Make rangeExpandedAroundPositionByCharacters to all platforms.
949         https://bugs.webkit.org/show_bug.cgi?id=144161
950
951         Reviewed by Tim Horton.
952
953         No change in functionality, simply making this available
954         to all platforms.
955
956         * editing/VisibleUnits.cpp:
957         (WebCore::rangeExpandedAroundPositionByCharacters):
958         * editing/VisibleUnits.h:
959         * editing/mac/DataDetection.mm:
960         * editing/mac/DictionaryLookup.h:
961         * editing/mac/DictionaryLookup.mm:
962         (WebCore::rangeExpandedAroundPositionByCharacters): Deleted.
963
964 2015-04-24  Andreas Kling  <akling@apple.com>
965
966         Purge PassRefPtr from NamedNodeMap.
967         <https://webkit.org/b/144091>
968
969         Reviewed by Antti Koivisto.
970
971         Use RefPtr instead of PassRefPtr in NamedNodeMap.
972
973         * dom/NamedNodeMap.cpp:
974         (WebCore::NamedNodeMap::getNamedItem):
975         (WebCore::NamedNodeMap::getNamedItemNS):
976         (WebCore::NamedNodeMap::removeNamedItem):
977         (WebCore::NamedNodeMap::removeNamedItemNS):
978         (WebCore::NamedNodeMap::setNamedItem):
979         (WebCore::NamedNodeMap::setNamedItemNS):
980         (WebCore::NamedNodeMap::item):
981         * dom/NamedNodeMap.h:
982
983 2015-04-24  Commit Queue  <commit-queue@webkit.org>
984
985         Unreviewed, rolling out r183266.
986         https://bugs.webkit.org/show_bug.cgi?id=144164
987
988         Broke 32-bit build and a test. (Requested by ap on #webkit).
989
990         Reverted changeset:
991
992         "AX: richer text change notifications (142719)"
993         https://bugs.webkit.org/show_bug.cgi?id=142719
994         http://trac.webkit.org/changeset/183266
995
996 2015-04-24  Brady Eidson  <beidson@apple.com>
997
998         Origin header is preserved on cross-origin redirects.
999         https://bugs.webkit.org/show_bug.cgi?id=144157.
1000
1001         Reviewed by Sam Weinig.
1002
1003         Tests: http/tests/security/cors-post-redirect-301.html
1004                http/tests/security/cors-post-redirect-302.html
1005                http/tests/security/cors-post-redirect-307.html
1006                http/tests/security/cors-post-redirect-308.html
1007
1008         * platform/network/cf/ResourceHandleCFNet.cpp:
1009         (WebCore::ResourceHandle::willSendRequest): Always clear any origin header for cross-origin redirects.
1010         * platform/network/mac/ResourceHandleMac.mm:
1011         (WebCore::ResourceHandle::willSendRequest): Ditto.
1012
1013 2015-04-24  Brent Fulgham  <bfulgham@apple.com>
1014
1015         Immediate action not functional for embedded PDFs
1016         https://bugs.webkit.org/show_bug.cgi?id=143952
1017         <rdar://problem/19842365>        
1018
1019         Reviewed by Tim Horton.
1020
1021         Add a dictionary lookup method to allow us to retrieve
1022         relevant information for PDFs.
1023
1024         * editing/mac/DictionaryLookup.mm:
1025         (WebCore::dictionaryLookupForPDFSelection): Updated to properly handle cases
1026         where the Lookup engine selects a smaller range than the initial automatic
1027         selection performed on clicking.
1028
1029 2015-04-24  Simon Fraser  <simon.fraser@apple.com>
1030
1031         Make it possible to map a secondary quad through TransformState
1032         https://bugs.webkit.org/show_bug.cgi?id=144156
1033
1034         Reviewed by Dean Jackson.
1035
1036         A future patch will need to map two quads simultaneously through TransformState,
1037         so add the ability to provide an optional secondary quad.
1038         
1039         This patch also firms up the setQuad() contract, fixing webkit.org/b/106680,
1040         requiring the state to be flattened when setting the quad (and now, the secondary quad).
1041         Previously, setQuad implicitly flattened but failed to update m_mapPoint when
1042         doing so.
1043
1044         * platform/graphics/ca/GraphicsLayerCA.cpp:
1045         (WebCore::GraphicsLayerCA::computeVisibleRect): Now we have to explicitly flatten
1046         before setting the quad.
1047         * platform/graphics/ca/GraphicsLayerCA.h: Drive-up #include removal.
1048         * platform/graphics/transforms/TransformState.cpp:
1049         (WebCore::TransformState::operator=): Copy the secondary quad if we have one.
1050         (WebCore::TransformState::translateMappedCoordinates): Move the secondary quad
1051         if we have one.
1052         (WebCore::TransformState::mappedQuad): Code factored into mapQuad().
1053         (WebCore::TransformState::mappedSecondaryQuad): Return the secondary quad mapped
1054         into the state's current coordinate space.
1055         (WebCore::TransformState::mapQuad): Factored code.
1056         * platform/graphics/transforms/TransformState.h:
1057         (WebCore::TransformState::setQuad): Make the contract more explicit with assertions.
1058         (WebCore::TransformState::setSecondaryQuad): Ditto when setting the secondary quad.
1059         (WebCore::TransformState::lastPlanarSecondaryQuad):
1060         (WebCore::TransformState::lastPlanarQuad): Deleted.
1061
1062 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
1063
1064         [iOS] Reimplement r182512 and r183153 in a cleaner way
1065         https://bugs.webkit.org/show_bug.cgi?id=144151
1066
1067         Reviewed by Enrica Casucci.
1068
1069         On iOS, we create FontPlatformData's ctFont() by round tripping it through a CGFontRef.
1070         This causes the resultant ctFont() to lose system-font-ness. Patches r182512 and r183153
1071         react to this fact by making users of a FontPlatformData use the original font passed in
1072         to the FontPlatformData instead of the FontPlatformData's ctFont(), but only if we
1073         detect that the FontPlatformData represents a system font (the underlying APIs have
1074         different behavior for system fonts and non-system-fonts).
1075
1076         However, on OS X, we create a FontPlatformData's ctFont() directly from the original
1077         font passed in to the constructor. This preserves system-font-ness (because it no
1078         longer has the CGFontRef in the middle of the transformation). Therefore, OS X has the
1079         correct behavior regarding system fonts.
1080
1081         The difference between the two ctFont() creation codepaths seems to be historical
1082         rather than intentional. Rather than change all the call sites of ctFont() to use a
1083         different platform font object if a system font is detected, a cleaner solution is to
1084         simply unify the two ctFont() creation codepaths to the version which preserves system-
1085         font-ness. Doing this will make all users of FontPlatformData automatically have the
1086         correct behavior with no updates.
1087
1088         This patch reverts the relevant parts of r182512 and r183153 in favor of this new
1089         solution.
1090
1091         No new tests because there is no behavior change.
1092
1093         * platform/graphics/FontPlatformData.h:
1094         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
1095         * platform/graphics/cocoa/FontCocoa.mm:
1096         (WebCore::Font::platformWidthForGlyph):
1097         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1098         (WebCore::FontPlatformData::ctFontSize):
1099         (WebCore::FontPlatformData::ctFont):
1100         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
1101         (WebCore::Font::getCFStringAttributes):
1102
1103 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
1104
1105         Unreviewed build fix.
1106
1107         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1108         (WebCore::FontPlatformData::FontPlatformData):
1109
1110 2015-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
1111
1112         [Cocoa] Start cleaning up FontPlatformData
1113         https://bugs.webkit.org/show_bug.cgi?id=144133
1114
1115         Reviewed by Enrica Casucci.
1116
1117         This is the start of a crusade to ultimately remove one of the CTFontRefs which we have inside
1118         FontPlatformData. This patch starts this effort out by removing the FontPlatformData
1119         constructor which accepts an NSFont. This constructor simply casts the NSFont to a CTFontRef,
1120         and forwards to another constructor. This patch moves this cast to callers of this constructor,
1121         thereby enumerating the places we have left that use NSFont with FontPlatformData.
1122
1123         This patch also cleans up two of the constructors in FontPlatformData.cpp to forward on to
1124         a common constructor.
1125
1126         This patch also collects places inside FontPlatformDataCocoa.mm where we check if a pointer is
1127         not 0 and not -1, and puts this common code inside a new function,
1128         FontPlatformData::isValidCTFontRef().
1129
1130         No new tests because there is no behavior change.
1131
1132         * platform/graphics/FontPlatformData.cpp:
1133         (WebCore::FontPlatformData::FontPlatformData): Coalesce constructors.
1134         * platform/graphics/FontPlatformData.h:
1135         (WebCore::FontPlatformData::isValidCTFontRef): Check if a pointer is not 0 and not -1.
1136         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
1137         * platform/graphics/cocoa/FontCocoa.mm:
1138         (WebCore::Font::platformCreateScaledFont): Receive cast which has been hoisted from the deleted
1139         FontPlatformData constructor.
1140         (WebCore::Font::compositeFontReferenceFont): Ditto.
1141         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1142         (WebCore::FontPlatformData::~FontPlatformData): Use isValidCTFontRef().
1143         (WebCore::FontPlatformData::platformDataInit): Ditto.
1144         (WebCore::FontPlatformData::platformDataAssign): Ditto.
1145         (WebCore::FontPlatformData::platformIsEqual): Simplify preprocessor macros.
1146         (WebCore::FontPlatformData::allowsLigatures): Remove unnecessary NSFont use.
1147         (WebCore::FontPlatformData::FontPlatformData): Deleted.
1148         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1149         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Remove unnecessary
1150         NSFont use.
1151         * platform/graphics/mac/FontCacheMac.mm:
1152         (WebCore::FontCache::systemFallbackForCharacters): Receive cast which has been hoisted from the
1153         deleted FontPlatformData constructor.
1154         (WebCore::FontCache::createFontPlatformData): Ditto.
1155         * platform/mac/DragImageMac.mm:
1156         (WebCore::fontFromNSFont): Ditto.
1157         (WebCore::widthWithFont): Ditto.
1158         (WebCore::drawAtPoint): Ditto.
1159
1160 2015-04-24  Doug Russell  <d_russell@apple.com>
1161
1162         AX: richer text change notifications (142719)
1163         https://bugs.webkit.org/show_bug.cgi?id=142719
1164
1165         Reviewed by Darin Adler.
1166
1167         Richer accessibility value change notifications. Introduce AXTextEditType, postTextStateChangeNotification and postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content. Also implement a mechanism to post value changes in password form fields in coalesced ticks to thwart analyzing the cadence of changes.
1168
1169         Richer accessibility selection change notifications. Introduce AXTextStateChangeIntent, and an overload of postTextReplacementNotification to give assistive tech apps more reliable context for responding to changes in web content selection. Also block posting selection changes on password fields.
1170
1171         Tests: platform/mac/accessibility/input-replacevalue-userinfo.html
1172                platform/mac/accessibility/selection-change-userinfo.html
1173                platform/mac/accessibility/value-change-userinfo.html
1174
1175         * CMakeLists.txt:
1176         * WebCore.vcxproj/WebCore.vcxproj:
1177         * WebCore.vcxproj/WebCore.vcxproj.filters:
1178         * WebCore.xcodeproj/project.pbxproj:
1179         * accessibility/AXObjectCache.cpp:
1180         (WebCore::AXObjectCache::AXObjectCache):
1181         (WebCore::AXObjectCache::notificationPostTimerFired):
1182         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
1183         (WebCore::AXObjectCache::showIntent):
1184         (WebCore::AXObjectCache::setTextSelectionIntent):
1185         (WebCore::isPasswordFieldOrContainedByPasswordField):
1186         (WebCore::AXObjectCache::postTextStateChangeNotification):
1187         (WebCore::AXObjectCache::postTextReplacementNotification):
1188         (WebCore::AXObjectCache::enqueuePasswordValueChangeNotification):
1189         (WebCore::AXObjectCache::rootWebArea):
1190         (WebCore::AXObjectCache::selectedChildrenChanged): Deleted.
1191         * accessibility/AXObjectCache.h:
1192         (WebCore::AXObjectCache::postTextStateChangeNotification):
1193         (WebCore::AXObjectCache::postTextReplacementNotification):
1194         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1195         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1196         (WebCore::AXObjectCache::textChangeForEditType):
1197         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1198         (WebCore::AXObjectCache::computedObjectAttributeCache): Deleted.
1199         (WebCore::AXObjectCache::getOrCreate): Deleted.
1200         (WebCore::AXObjectCache::attachWrapper): Deleted.
1201         * accessibility/AXTextStateChangeIntent.h: Added.
1202         (WebCore::AXTextStateChangeIntent::AXTextStateChangeIntent):
1203         * accessibility/AccessibilityNodeObject.cpp:
1204         (WebCore::AccessibilityNodeObject::passwordFieldOrContainingPasswordField):
1205         * accessibility/AccessibilityNodeObject.h:
1206         * accessibility/AccessibilityObject.cpp:
1207         (WebCore::AccessibilityObject::isContainedByPasswordField):
1208         * accessibility/AccessibilityObject.h:
1209         (WebCore::AccessibilityObject::passwordFieldOrContainingPasswordField):
1210         (WebCore::AccessibilityObject::isPasswordField): Deleted.
1211         * accessibility/AccessibilityRenderObject.cpp:
1212         (WebCore::AccessibilityRenderObject::setSelectedTextRange):
1213         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1214         * accessibility/AccessibilityScrollView.h:
1215         * accessibility/atk/AXObjectCacheAtk.cpp:
1216         (WebCore::AXObjectCache::textChangeForEditType):
1217         (WebCore::AXObjectCache::nodeTextChangePlatformNotification):
1218         (WebCore::AXObjectCache::postPlatformNotification): Deleted.
1219         * accessibility/ios/AXObjectCacheIOS.mm:
1220         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1221         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1222         * accessibility/mac/AXObjectCacheMac.mm:
1223         (WebCore::AXObjectCache::setShouldRepostNotificationsForTests):
1224         (WebCore::AXPostNotificationWithUserInfo):
1225         (WebCore::AXObjectCache::postPlatformNotification):
1226         (WebCore::AXObjectCache::postTextStateChangePlatformNotification):
1227         (WebCore::textReplacementChangeDictionary):
1228         (WebCore::AXObjectCache::postTextReplacementPlatformNotification):
1229         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
1230         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1231         (+[WebAccessibilityObjectWrapperBase accessibilitySetShouldRepostNotifications:]):
1232         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:]):
1233         (arrayRemovingNonJSONTypes):
1234         (dictionaryRemovingNonJSONTypes):
1235         (-[WebAccessibilityObjectWrapperBase accessibilityPostedNotification:userInfo:]):
1236         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
1237         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1238         (textMarkerRangeFromVisiblePositions):
1239         (-[WebAccessibilityObjectWrapper textMarkerRangeFromVisiblePositions:endPosition:]):
1240         * editing/AppendNodeCommand.cpp:
1241         (WebCore::AppendNodeCommand::AppendNodeCommand):
1242         (WebCore::sendAXTextChangedIgnoringLineBreaks):
1243         (WebCore::AppendNodeCommand::doApply):
1244         (WebCore::AppendNodeCommand::doUnapply):
1245         * editing/AppendNodeCommand.h:
1246         (WebCore::AppendNodeCommand::create):
1247         * editing/ApplyStyleCommand.cpp:
1248         (WebCore::ApplyStyleCommand::ApplyStyleCommand):
1249         (WebCore::ApplyStyleCommand::applyBlockStyle): Deleted.
1250         * editing/ApplyStyleCommand.h:
1251         * editing/CompositeEditCommand.cpp:
1252         (WebCore::EditCommandComposition::unapplyEditType):
1253         (WebCore::CompositeEditCommand::CompositeEditCommand):
1254         (WebCore::CompositeEditCommand::apply):
1255         (WebCore::CompositeEditCommand::insertParagraphSeparator):
1256         (WebCore::CompositeEditCommand::insertNodeBefore):
1257         (WebCore::CompositeEditCommand::appendNode):
1258         (WebCore::CompositeEditCommand::removeNodePreservingChildren):
1259         (WebCore::CompositeEditCommand::insertTextIntoNode):
1260         (WebCore::CompositeEditCommand::deleteTextFromNode):
1261         (WebCore::CompositeEditCommand::replaceTextInNode):
1262         (WebCore::CompositeEditCommand::moveParagraphs):
1263         (WebCore::EditCommandComposition::getNodesInCommand): Deleted.
1264         (WebCore::CompositeEditCommand::applyStyle): Deleted.
1265         (WebCore::CompositeEditCommand::insertLineBreak): Deleted.
1266         (WebCore::CompositeEditCommand::insertNodeAt): Deleted.
1267         (WebCore::CompositeEditCommand::removeChildrenInRange): Deleted.
1268         (WebCore::CompositeEditCommand::inputText): Deleted.
1269         * editing/CompositeEditCommand.h:
1270         * editing/DeleteFromTextNodeCommand.cpp:
1271         (WebCore::DeleteFromTextNodeCommand::DeleteFromTextNodeCommand):
1272         (WebCore::DeleteFromTextNodeCommand::doApply):
1273         (WebCore::DeleteFromTextNodeCommand::doUnapply):
1274         * editing/DeleteFromTextNodeCommand.h:
1275         (WebCore::DeleteFromTextNodeCommand::create):
1276         (WebCore::DeleteFromTextNodeCommand::deletedText):
1277         * editing/DeleteSelectionCommand.cpp:
1278         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand):
1279         (WebCore::DeleteSelectionCommand::preservesTypingStyle): Deleted.
1280         * editing/DeleteSelectionCommand.h:
1281         (WebCore::DeleteSelectionCommand::create):
1282         * editing/DictationCommand.cpp:
1283         (WebCore::DictationCommand::insertTextRunWithoutNewlines):
1284         (WebCore::DictationCommand::insertParagraphSeparator):
1285         * editing/EditAction.h:
1286         * editing/EditCommand.cpp:
1287         (WebCore::EditCommand::EditCommand):
1288         (WebCore::EditCommand::editingAction):
1289         (WebCore::EditCommand::applyEditType):
1290         (WebCore::EditCommand::unapplyEditType):
1291         (WebCore::SimpleEditCommand::SimpleEditCommand):
1292         (WebCore::SimpleEditCommand::notifyAccessibilityForTextChange):
1293         (WebCore::EditCommand::setParent): Deleted.
1294         * editing/EditCommand.h:
1295         * editing/EditingAllInOne.cpp:
1296         * editing/Editor.cpp:
1297         (WebCore::Editor::handleTextEvent):
1298         (WebCore::Editor::deleteSelectionWithSmartDelete):
1299         (WebCore::Editor::replaceSelectionWithFragment):
1300         (WebCore::Editor::replaceSelectionWithText):
1301         (WebCore::Editor::appliedEditing):
1302         (WebCore::Editor::unappliedEditing):
1303         (WebCore::Editor::performCutOrCopy):
1304         (WebCore::Editor::markMisspellingsAfterTypingToWord):
1305         (WebCore::Editor::changeBackToReplacedString):
1306         (WebCore::Editor::transpose):
1307         (WebCore::Editor::changeSelectionAfterCommand):
1308         * editing/Editor.h:
1309         * editing/EditorCommand.cpp:
1310         (WebCore::executeInsertFragment):
1311         * editing/FrameSelection.cpp:
1312         (WebCore::FrameSelection::moveTo):
1313         (WebCore::FrameSelection::moveWithoutValidationTo):
1314         (WebCore::FrameSelection::setSelectionByMouseIfDifferent):
1315         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
1316         (WebCore::FrameSelection::setSelection):
1317         (WebCore::FrameSelection::updateAndRevealSelection):
1318         (WebCore::isBoundary):
1319         (WebCore::FrameSelection::textSelectionIntent):
1320         (WebCore::FrameSelection::modify):
1321         (WebCore::FrameSelection::selectAll):
1322         (WebCore::FrameSelection::wordSelectionContainingCaretSelection):
1323         (WebCore::FrameSelection::modifyMovingBackward): Deleted.
1324         (WebCore::FrameSelection::selectFrameElementInParentIfFullySelected): Deleted.
1325         (WebCore::FrameSelection::selectionAtWordStart): Deleted.
1326         * editing/FrameSelection.h:
1327         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1328         (WebCore::FrameSelection::selection): Deleted.
1329         * editing/InsertIntoTextNodeCommand.cpp:
1330         (WebCore::InsertIntoTextNodeCommand::InsertIntoTextNodeCommand):
1331         (WebCore::InsertIntoTextNodeCommand::doApply):
1332         (WebCore::InsertIntoTextNodeCommand::doUnapply):
1333         * editing/InsertIntoTextNodeCommand.h:
1334         (WebCore::InsertIntoTextNodeCommand::create):
1335         (WebCore::InsertIntoTextNodeCommand::insertedText):
1336         * editing/InsertNodeBeforeCommand.cpp:
1337         (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
1338         (WebCore::InsertNodeBeforeCommand::doApply):
1339         (WebCore::InsertNodeBeforeCommand::doUnapply):
1340         * editing/InsertNodeBeforeCommand.h:
1341         (WebCore::InsertNodeBeforeCommand::create):
1342         * editing/InsertParagraphSeparatorCommand.cpp:
1343         (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand):
1344         * editing/InsertParagraphSeparatorCommand.h:
1345         (WebCore::InsertParagraphSeparatorCommand::create):
1346         * editing/InsertTextCommand.cpp:
1347         (WebCore::InsertTextCommand::InsertTextCommand):
1348         * editing/InsertTextCommand.h:
1349         (WebCore::InsertTextCommand::create):
1350         (WebCore::InsertTextCommand::createWithMarkerSupplier):
1351         * editing/MoveSelectionCommand.cpp:
1352         (WebCore::MoveSelectionCommand::doApply):
1353         * editing/RemoveNodePreservingChildrenCommand.cpp:
1354         (WebCore::RemoveNodePreservingChildrenCommand::RemoveNodePreservingChildrenCommand):
1355         * editing/RemoveNodePreservingChildrenCommand.h:
1356         (WebCore::RemoveNodePreservingChildrenCommand::create):
1357         * editing/ReplaceDeleteFromTextNodeCommand.cpp: Copied from Source/WebCore/editing/AppendNodeCommand.h.
1358         (WebCore::ReplaceDeleteFromTextNodeCommand::ReplaceDeleteFromTextNodeCommand):
1359         (WebCore::ReplaceDeleteFromTextNodeCommand::notifyAccessibilityForTextChange):
1360         * editing/ReplaceDeleteFromTextNodeCommand.h: Copied from Source/WebCore/editing/AppendNodeCommand.h.
1361         * editing/ReplaceInsertIntoTextNodeCommand.cpp: Added.
1362         (WebCore::ReplaceInsertIntoTextNodeCommand::ReplaceInsertIntoTextNodeCommand):
1363         (WebCore::ReplaceInsertIntoTextNodeCommand::notifyAccessibilityForTextChange):
1364         * editing/ReplaceInsertIntoTextNodeCommand.h: Copied from Source/WebCore/editing/RemoveNodePreservingChildrenCommand.h.
1365         * editing/ReplaceSelectionCommand.cpp:
1366         (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
1367         (WebCore::ReplaceSelectionCommand::InsertedNodes::didReplaceNode): Deleted.
1368         (WebCore::ReplaceSelectionCommand::insertAsListItems): Deleted.
1369         * editing/ReplaceSelectionCommand.h:
1370         (WebCore::ReplaceSelectionCommand::create):
1371         * editing/TypingCommand.cpp:
1372         (WebCore::TypingCommand::insertTextRunWithoutNewlines):
1373         (WebCore::TypingCommand::insertParagraphSeparator):
1374         * editing/atk/FrameSelectionAtk.cpp:
1375         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1376         * editing/ios/DictationCommandIOS.cpp:
1377         (WebCore::DictationCommandIOS::DictationCommandIOS):
1378         * editing/ios/DictationCommandIOS.h:
1379         * editing/mac/FrameSelectionMac.mm:
1380         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
1381         * html/HTMLTextFormControlElement.cpp:
1382         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
1383         * page/DragController.cpp:
1384         (WebCore::DragController::concludeEditDrag):
1385         * page/EventHandler.cpp:
1386         (WebCore::setInitialKeyboardSelection):
1387         * page/FocusController.cpp:
1388         (WebCore::FocusController::advanceFocusInDocumentOrder):
1389
1390 2015-04-24  Darin Adler  <darin@apple.com>
1391
1392         Convert OwnPtr and PassOwnPtr uses to std::unique_ptr
1393         https://bugs.webkit.org/show_bug.cgi?id=128007
1394
1395         Reviewed by Anders Carlsson.
1396
1397         * PlatformEfl.cmake: Removed OwnPtrCairo source files.
1398         * PlatformGTK.cmake: Ditto.
1399         * PlatformWinCairo.cmake: Ditto.
1400         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1401         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1402
1403         * platform/CrossThreadCopier.cpp: Removed OwnPtr specialization.
1404         * platform/CrossThreadCopier.h: Ditto.
1405
1406         * platform/ScrollAnimatorNone.cpp: Removed unneeded include.
1407         * platform/ThreadGlobalData.cpp: Ditto.
1408         * platform/ThreadGlobalData.h: Ditto.
1409         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h: Ditto.
1410
1411         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1412         (WebCore::AVFWrapper::processNotification): Use unique_ptr.
1413         (WebCore::AVFWrapper::notificationCallback): Use make_unique.
1414         (WebCore::AVFWrapper::platformLayer): Ditto.
1415
1416         * platform/graphics/cairo/CairoUtilities.cpp:
1417         (WebCore::appendPathToCairoContext): Use cairo_path_destroy directly
1418         instead of a smart pointer; the code path is simple enough that it is
1419         clear this way.
1420
1421         * platform/graphics/cairo/ImageBufferCairo.cpp:
1422         (WebCore::ImageBuffer::ImageBuffer): Use make_unique.
1423         * platform/graphics/cairo/ImageBufferDataCairo.h: Use unique_ptr.
1424
1425         * platform/graphics/cairo/OwnPtrCairo.cpp: Removed.
1426         * platform/graphics/cairo/OwnPtrCairo.h: Removed.
1427
1428         * platform/graphics/cairo/PathCairo.cpp:
1429         (WebCore::Path::Path): Use cairo_path_destroy directly instead of a
1430         smart pointer; the code path is simple enough that it is clear this way.
1431         (WebCore::Path::operator=): Ditto.
1432         (WebCore::Path::addPath): Ditto.
1433         (WebCore::Path::apply): Ditto.
1434         * platform/graphics/cairo/PlatformContextCairo.cpp:
1435         (WebCore::PlatformContextCairo::clipForPatternFilling): Ditto.
1436
1437         * platform/graphics/freetype/FontCacheFreeType.cpp: Removed unneeded include.
1438         * platform/graphics/glx/GLContextGLX.cpp: Ditto.
1439
1440         * platform/graphics/surfaces/egl/EGLSurface.cpp:
1441         (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Use make_unique.
1442
1443         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
1444         (WebCore::GLXConfigSelector::findMatchingConfig): Use unique_ptr with X11Deleter.
1445         (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
1446         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1447         (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
1448         (WebCore::GLXOffScreenSurface::initialize): Ditto.
1449
1450         * platform/graphics/surfaces/glx/OwnPtrX11.h: Removed.
1451
1452         * platform/graphics/surfaces/glx/X11Helper.cpp:
1453         (WebCore::X11Helper::createOffScreenWindow): Use unique_ptr with X11Deleter.
1454         (WebCore::X11Helper::createPixmap): Ditto.
1455
1456         * platform/graphics/surfaces/glx/X11Helper.h: Added X11Deleter,
1457         which can be used with unique_ptr to make it call XFree instead of delete.
1458
1459         * platform/graphics/win/FullScreenController.cpp: Use unique_ptr.
1460         (FullScreenController::FullScreenController): Use make_unique.
1461         (FullScreenController::enterFullScreen): Ditto.
1462         * platform/graphics/win/FullScreenController.h: Use unique_ptr.
1463
1464         * platform/graphics/win/GraphicsContext3DWin.cpp: Removed unneeded includes.
1465
1466         * platform/graphics/win/WKCAImageQueue.cpp:
1467         (WebCore::WKCAImageQueue::WKCAImageQueue): Use make_unique.
1468         * platform/graphics/win/WKCAImageQueue.h: Use unique_ptr.
1469
1470         * platform/network/NetworkStorageSessionStub.cpp: Removed unneeded include.
1471
1472         * platform/network/ResourceHandleInternal.h: Use unique_ptr.
1473
1474         * platform/network/curl/MultipartHandle.cpp:
1475         (WebCore::MultipartHandle::create): Deleted.
1476         * platform/network/curl/MultipartHandle.h: Deleted the create function.
1477
1478         * platform/network/curl/ResourceHandleManager.cpp:
1479         (WebCore::headerCallback): Use make_unique.
1480
1481 2015-04-24  Per Arne Vollan  <peavo@outlook.com>
1482
1483         [Win] Popup menu is not accessible.
1484         https://bugs.webkit.org/show_bug.cgi?id=141704
1485
1486         Reviewed by Brent Fulgham.
1487
1488         Get accessibility information for items in popup menus.
1489
1490         * platform/win/PopupMenuWin.cpp:
1491         (WebCore::PopupMenuWin::onGetObject):
1492         (WebCore::PopupMenuWin::wndProc):
1493         (WebCore::AccessiblePopupMenu::AccessiblePopupMenu):
1494         (WebCore::AccessiblePopupMenu::~AccessiblePopupMenu):
1495         (WebCore::AccessiblePopupMenu::QueryInterface):
1496         (WebCore::AccessiblePopupMenu::AddRef):
1497         (WebCore::AccessiblePopupMenu::Release):
1498         (WebCore::AccessiblePopupMenu::GetTypeInfoCount):
1499         (WebCore::AccessiblePopupMenu::GetTypeInfo):
1500         (WebCore::AccessiblePopupMenu::GetIDsOfNames):
1501         (WebCore::AccessiblePopupMenu::Invoke):
1502         (WebCore::AccessiblePopupMenu::get_accParent):
1503         (WebCore::AccessiblePopupMenu::get_accChildCount):
1504         (WebCore::AccessiblePopupMenu::get_accChild):
1505         (WebCore::AccessiblePopupMenu::get_accName):
1506         (WebCore::AccessiblePopupMenu::get_accValue):
1507         (WebCore::AccessiblePopupMenu::get_accDescription):
1508         (WebCore::AccessiblePopupMenu::get_accRole):
1509         (WebCore::AccessiblePopupMenu::get_accState):
1510         (WebCore::AccessiblePopupMenu::get_accHelp):
1511         (WebCore::AccessiblePopupMenu::get_accKeyboardShortcut):
1512         (WebCore::AccessiblePopupMenu::get_accFocus):
1513         (WebCore::AccessiblePopupMenu::get_accSelection):
1514         (WebCore::AccessiblePopupMenu::get_accDefaultAction):
1515         (WebCore::AccessiblePopupMenu::accSelect):
1516         (WebCore::AccessiblePopupMenu::accLocation):
1517         (WebCore::AccessiblePopupMenu::accNavigate):
1518         (WebCore::AccessiblePopupMenu::accHitTest):
1519         (WebCore::AccessiblePopupMenu::accDoDefaultAction):
1520         (WebCore::AccessiblePopupMenu::put_accName):
1521         (WebCore::AccessiblePopupMenu::put_accValue):
1522         (WebCore::AccessiblePopupMenu::get_accHelpTopic):
1523         * platform/win/PopupMenuWin.h:
1524         * platform/win/ScrollbarThemeWin.h:
1525         (WebCore::ScrollbarThemeWin::hasButtons): Deleted.
1526
1527 2015-04-23  Antti Koivisto  <antti@apple.com>
1528
1529         Memory cache live resources repeatedly purged during painting
1530         https://bugs.webkit.org/show_bug.cgi?id=144104
1531         <rdar://problem/20667695>
1532
1533         Reviewed by Chris Dumez.
1534
1535         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
1536         This slows down page loads significantly.
1537
1538         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
1539
1540         With this path we do all regular cache pruning asynchronously. If memory is really critical
1541         the low memory handling code will still prune synchronously.
1542
1543         * loader/cache/CachedResource.cpp:
1544         (WebCore::CachedResource::removeClient):
1545         (WebCore::CachedResource::didAccessDecodedData):
1546
1547             prune() -> pruneSoon()
1548
1549         * loader/cache/MemoryCache.cpp:
1550
1551             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
1552
1553         (WebCore::MemoryCache::needsPruning):
1554
1555             Factor into a function.
1556
1557         (WebCore::MemoryCache::prune):
1558         (WebCore::MemoryCache::pruneSoon):
1559
1560             Prune asynchronously.
1561
1562         * loader/cache/MemoryCache.h:
1563
1564 2015-04-24  Antti Koivisto  <antti@apple.com>
1565
1566         Unreviewed, rolling out r183259.
1567
1568         Wrong ChangeLog.
1569
1570         Reverted changeset:
1571
1572         "Memory cache live resources repeatedly purged during
1573         painting"
1574         https://bugs.webkit.org/show_bug.cgi?id=144104
1575         http://trac.webkit.org/changeset/183259
1576
1577 2015-04-24  Antti Koivisto  <antti@apple.com>
1578
1579         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
1580         https://bugs.webkit.org/show_bug.cgi?id=144050
1581
1582         Reviewed by Chris Dumez.
1583
1584         We are seeing null Element pointer crashes with this stack:
1585
1586         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
1587         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
1588         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
1589
1590         The most likely cause seems to be that this code
1591
1592             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
1593             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
1594
1595         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with null entry in
1596         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
1597         could happen. The related code is fragile with lot of state (especially in ScriptElement class)
1598         and involves many opportunities for re-entry via scripts.
1599
1600         No repro, no test case.
1601
1602         * dom/ScriptRunner.cpp:
1603         (WebCore::ScriptRunner::timerFired):
1604
1605             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
1606             but this also covers possibility this is caused by something else.
1607
1608 2015-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1609
1610         [SOUP] Use a webkit subdirectory for the disk cache
1611         https://bugs.webkit.org/show_bug.cgi?id=144048
1612
1613         Reviewed by Martin Robinson.
1614
1615         Add a static method to SoupNetworkSession to clear a soup cache
1616         given its directory.
1617
1618         * platform/network/soup/SoupNetworkSession.cpp:
1619         (WebCore::strIsNumeric):
1620         (WebCore::SoupNetworkSession::clearCache):
1621         * platform/network/soup/SoupNetworkSession.h:
1622
1623 2015-04-23  Andy Estes  <aestes@apple.com>
1624
1625         Fix the iOS build after r183234.
1626
1627         * platform/ios/LegacyTileCache.mm:
1628         (WebCore::LegacyTileCache::commitScaleChange):
1629
1630 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
1631
1632         Fix Windows build.
1633
1634         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1635         (PlatformCALayerWin::setBackingStoreAttached):
1636         (PlatformCALayerWin::backingStoreAttached):
1637         * platform/graphics/ca/win/PlatformCALayerWin.h:
1638
1639 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
1640
1641         Make it possible to detach GraphicsLayerCA backing store
1642         https://bugs.webkit.org/show_bug.cgi?id=144140
1643
1644         Reviewed by Tim Horton.
1645
1646         This changes makes it possible to denote a GraphicsLayerCA's backing store
1647         as "attached" or not. When not attached, the backing store is made volatile
1648         and can be purged. This will be used in a future patch.
1649
1650         * platform/graphics/ca/GraphicsLayerCA.h: Add updateBackingStoreAttachment().
1651         * platform/graphics/ca/PlatformCALayer.h:
1652         * platform/graphics/ca/mac/PlatformCALayerMac.h:
1653         * platform/graphics/ca/mac/PlatformCALayerMac.mm: Stubs. In future, we could
1654         remove backing store on Mac and iOS WK1 too.
1655         (PlatformCALayerMac::setBackingStoreAttached):
1656         (PlatformCALayerMac::backingStoreAttached):
1657
1658 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
1659
1660         Remove "layer" from GraphicsLayerCA member function names
1661         https://bugs.webkit.org/show_bug.cgi?id=144139
1662
1663         Reviewed by Myles Maxfield.
1664
1665         Rename "updateLayer*" to "update*" in GraphicsLayerCA.
1666
1667         * platform/graphics/ca/GraphicsLayerCA.cpp:
1668         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1669         (WebCore::GraphicsLayerCA::updateNames):
1670         (WebCore::GraphicsLayerCA::updateDrawsContent):
1671         (WebCore::GraphicsLayerCA::updateLayerNames): Deleted.
1672         (WebCore::GraphicsLayerCA::updateLayerDrawsContent): Deleted.
1673         * platform/graphics/ca/GraphicsLayerCA.h:
1674
1675 2015-04-23  Dan Bernstein  <mitz@apple.com>
1676
1677         <rdar://problem/20663758> Fix the build after AVPlayerViewController API change
1678
1679         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1680         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Don’t pass a nil completion
1681         handler to -[AVPlayerViewController exitFullScreenAnimated:completionHandler:].
1682
1683 2015-04-23  Darin Adler  <darin@apple.com>
1684
1685         Another round of removing use of OwnPtr, PassOwnPtr, and deleteOwnedPtr
1686         https://bugs.webkit.org/show_bug.cgi?id=144090
1687
1688         Reviewed by Anders Carlsson.
1689
1690         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h: Removed unneeded include.
1691
1692         * Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed include of
1693         RefCountedSupplement.h.
1694
1695         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
1696         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
1697         Pass data using rvalue references, and use new/delete to pass it across
1698         threads, rather than using PassOwnPtr.
1699         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h: Pass data
1700         in an rvalue reference instead of PassOwnPtr.
1701         * Modules/websockets/WebSocket.cpp:
1702         (WebCore::WebSocket::didReceiveBinaryData): Take an rvalue reference
1703         instead of a PassOwnPtr.
1704         * Modules/websockets/WebSocket.h: Ditto.
1705         * Modules/websockets/WebSocketChannel.cpp: Ditto.
1706         (WebCore::WebSocketChannel::processFrame): Ditto.
1707         * Modules/websockets/WebSocketChannelClient.h:
1708         (WebCore::WebSocketChannelClient::didReceiveBinaryData): Ditto.
1709         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
1710         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
1711         Ditto.
1712         * Modules/websockets/WorkerThreadableWebSocketChannel.h: Ditto.
1713
1714         * WebCore.xcodeproj/project.pbxproj: Removed RefCountedSupplement.h.
1715
1716         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1717         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Fixed comment
1718         to not mention adoptPtr.
1719
1720         * page/make_settings.pl:
1721         (generateInternalSettingsHeaderFile): Removed include of RefCountedSupplement.h.
1722
1723         * platform/ColorChooserClient.h: Removed unneded include.
1724         * platform/ContextMenuItem.h: Ditto.
1725
1726         * platform/RefCountedSupplement.h: Removed.
1727
1728         * platform/ScrollAnimator.cpp: Removed unneeded include.
1729         * platform/ScrollAnimatorNone.h: Ditto.
1730
1731         * platform/ThreadGlobalData.cpp: Added now-needed include of PassOwnPtr.h.
1732
1733         * platform/graphics/GlyphMetricsMap.h: Ditto.
1734         * platform/graphics/MediaPlayer.h: Ditto.
1735         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h: Ditto.
1736         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Ditto.
1737         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: Ditto.
1738         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h: Ditto.
1739         * platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.h: Ditto.
1740         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h: Ditto.
1741         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: Ditto.
1742
1743         * platform/graphics/cg/ImageBufferCG.cpp:
1744         (WebCore::ImageBuffer::ImageBuffer): Use make_unique instead of adoptPtr.
1745         * platform/graphics/cg/ImageBufferDataCG.cpp:
1746         (WebCore::ImageBufferData::getData): Return a RefPtr instead of a PassRefPtr.
1747         * platform/graphics/cg/ImageBufferDataCG.h: Streamlined the header a bit,
1748         use unique_ptr instead of OwnPtr and RefPtr instead of PassRefPtr.
1749
1750         * platform/graphics/cocoa/IOSurface.h: Use unique_ptr instead of OwnPtr.
1751         * platform/graphics/cocoa/IOSurface.mm:
1752         (IOSurface::ensureGraphicsContext): Use make_unique instead of adoptPtr.
1753
1754         * platform/graphics/egl/GLContextEGL.cpp: Removed unneeded includes.
1755         * platform/graphics/filters/FilterOperation.h: Ditto.
1756         * platform/graphics/harfbuzz/HarfBuzzShaper.h: Ditto.
1757         * platform/ios/DeviceMotionClientIOS.h: Ditto.
1758         * platform/ios/DeviceOrientationClientIOS.h: Ditto.
1759
1760         * platform/ios/LegacyTileCache.h: Use unique_ptr instead of OwnPtr.
1761         * platform/ios/LegacyTileCache.mm:
1762         (WebCore::LegacyTileCache::LegacyTileCache): Use make_unique instead of
1763         a create function, and also get rid of unneeded initialization to null.
1764         (WebCore::LegacyTileCache::commitScaleChange): Ditto.
1765
1766         * platform/ios/LegacyTileGrid.h: Made constructor public and got rid of create
1767         function. Made constructor take a reference to the tile cache, and make both
1768         tileCache() and m_tileCache be references too.
1769
1770         * platform/ios/LegacyTileGrid.mm:
1771         (WebCore::LegacyTileGrid::LegacyTileGrid): Updated to use reference.
1772         (WebCore::LegacyTileGrid::visibleRect): Ditto.
1773         (WebCore::LegacyTileGrid::tileByteSize) Ditto.:
1774         (WebCore::LegacyTileGrid::dropDistantTiles): Ditto.
1775         (WebCore::LegacyTileGrid::updateTileOpacity): Ditto.
1776         (WebCore::LegacyTileGrid::updateTileBorderVisibility): Ditto.
1777         (WebCore::LegacyTileGrid::updateHostLayerSize): Ditto.
1778         (WebCore::LegacyTileGrid::invalidateTiles): Ditto.
1779         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage): Ditto.
1780         (WebCore::LegacyTileGrid::tileDistance2): Ditto.
1781         (WebCore::LegacyTileGrid::createTiles): Ditto.
1782         * platform/ios/LegacyTileGridTile.mm:
1783         (WebCore::LegacyTileGridTile::LegacyTileGridTile): Ditto.
1784         (WebCore::LegacyTileGridTile::invalidateRect): Ditto.
1785         (WebCore::LegacyTileGridTile::showBorder): Ditto.
1786         * platform/ios/LegacyTileLayer.mm:
1787         (-[LegacyTileHostLayer renderInContext:]): Ditto.
1788         (-[LegacyTileLayer layoutSublayers]): Ditto.
1789         (-[LegacyTileLayer drawInContext:]): Ditto.
1790
1791         * platform/ios/LegacyTileLayerPool.h: Removed unneeded include.
1792         * platform/ios/ScrollAnimatorIOS.mm: Ditto.
1793         * platform/mac/ScrollAnimatorMac.mm: Ditto.
1794         * platform/mac/WebVideoFullscreenController.h: Ditto.
1795         * platform/network/BlobData.cpp: Ditto.
1796
1797         * platform/network/ResourceHandle.cpp:
1798         (WebCore::ResourceHandle::ResourceHandle): Use make_unique instead of adoptPtr.
1799         * platform/network/ResourceHandle.h: Use unique_ptr instead of OwnPtr.
1800
1801         * platform/network/ResourceHandleInternal.h: Added now-needed include.
1802
1803         * platform/network/ResourceResponseBase.h: Removed unneeded includes and
1804         tweaked formatting a bit.
1805
1806         * platform/network/SynchronousLoaderClient.h: Removed the create function and
1807         the private constructor. Used data member initialize to make the default
1808         empty constructor automatically get generated (and be public now).
1809
1810         * platform/network/cf/FormDataStreamCFNet.cpp:
1811         (WebCore::formFinishFinalizationOnMainThread): Use delete instead of adoptPtr
1812         to delete the context argument.
1813
1814         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1815         (WebCore::defaultNetworkStorageSession): Return a unique_ptr& instead of an OwnPtr&.
1816         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use make_unique
1817         instead of adoptPtr.
1818         (WebCore::NetworkStorageSession::defaultStorageSession): Ditto.
1819
1820         * platform/network/cf/ResourceHandleCFNet.cpp:
1821         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Use a
1822         SynchronousLoaderClient on the stack instead of putting one on the heap with adoptPtr.
1823         * platform/network/mac/ResourceHandleMac.mm:
1824         (WebCore::ResourceHandle::platformLoadResourceSynchronously): Ditto.
1825
1826         * platform/text/TextCodec.h: Removed unneeded include.
1827         * platform/win/CursorWin.cpp: Ditto.
1828
1829         * rendering/RenderLayer.cpp:
1830         (WebCore::RenderLayer::calculateClipRects): Use move instead of release since
1831         we are using RefPtr&& instead of PassRefPtr.
1832
1833         * rendering/RenderLayerFilterInfo.cpp:
1834         (WebCore::RenderLayer::FilterInfo::setRenderer): Use RefPtr&& instead of PassRefPtr.
1835         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients): Streamlined to use
1836         modern for loops and auto.
1837         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients): Ditto.
1838
1839         * rendering/RenderLayerFilterInfo.h: Streamlined code and removed some stuff that
1840         I think is unneeded on iOS; there is no unused private field and I suspect the problem
1841         that led to the warning is gone. Deleted friending of deleteOwnedPtr.
1842
1843         * rendering/RenderLayerMaskImageInfo.cpp: Removed unneeded includes. Moved private
1844         client classes in here from the header and made them members of MaskImageInfo.
1845         Streamlined them a bit in other ways.
1846         (WebCore::RenderLayer::MaskImageInfo::getIfExists): Use nullptr.
1847         (WebCore::RenderLayer::MaskImageInfo::MaskImageInfo): Use member initialization
1848         and also pass the layer in rather than the MaskImageInfo.
1849         (WebCore::RenderLayer::MaskImageInfo::notifyFinished): Deleted. Moved the code
1850         into the SVGDocumentClient.
1851         (WebCore::RenderLayer::MaskImageInfo::imageChanged): Deleted. Moved the code into
1852         the ImageClient.
1853         (WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients): Streamlined a bit
1854         to use a for loop.
1855         (WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients): Ditto.
1856
1857         * rendering/RenderLayerMaskImageInfo.h: Reduced unneeded includes. Got rid of
1858         definitions of private member classes here in the header; they can be in the cpp
1859         file instead. Also cut down from three classes to two, and gave the classes less
1860         redundant names since they are already members of MaskImageInfo. Removed some
1861         unneeded functions and friending of deleteOwnedPtr.
1862
1863         * testing/InternalSettings.cpp: Got rid of comment about RefCountedSupplement
1864         since no code anywhere was using it, so not using it here was not remarkable.
1865
1866 2015-04-23  Jer Noble  <jer.noble@apple.com>
1867
1868         [iOS] Add a wrapper around the hosted AVPlayerLayer to intercept -setBounds:
1869         https://bugs.webkit.org/show_bug.cgi?id=144129
1870
1871         Reviewed by Simon Fraser.
1872
1873         When passing the hosted AVPlayerLayer to the fullscreen controller, the new superlayer will
1874         resize the hosted layer with a call to -setBounds:. But because this is a hosted layer, the
1875         bonuds change has no effect. Instead, wrap the CALayerHost in another CALayer whose job it is
1876         to intercept -setBounds: in the same way that WebAVVideoLayer did. In fact, we should just use
1877         that wrapper class inside WebAVVideoLayer as well, to avoid duplicating code.
1878
1879         Drive-by Fix: Null-check m_videoElement in setVideoLayerFrame().
1880
1881         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
1882         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1883         (-[WebCALayerHostWrapper setVideoSublayer:]):
1884         (-[WebCALayerHostWrapper videoSublayer]):
1885         (-[WebCALayerHostWrapper setBounds:]): Moved from WebAVVideoLayer.
1886         (-[WebCALayerHostWrapper resolveBounds]): Ditto.
1887         (-[WebAVVideoLayer setBounds:]): Moved to WebCALayerHostWrapper.
1888         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Create the wrapper.
1889         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Clear the wrapper.
1890         (-[WebAVVideoLayer resolveBounds]): Deleted. Moved to WebCALayerHostWrapper.
1891         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
1892         (WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Null-check m_videoElement.
1893
1894 2015-04-23  Tim Horton  <timothy_horton@apple.com>
1895
1896         Yellow highlight has gray background color when invoking Lookup on an address in a Google Maps drop down
1897         https://bugs.webkit.org/show_bug.cgi?id=138737
1898         <rdar://problem/18904429>
1899
1900         Reviewed by Simon Fraser.
1901
1902         * rendering/RenderReplaced.cpp:
1903         (WebCore::RenderReplaced::paint):
1904         Other RenderObjects don't paint box decorations in the selection painting phase,
1905         so RenderReplaced probably shouldn't either. This fixes the case where, when doing
1906         selection-only painting of a bit of text over top of a RenderReplaced, the RenderReplaced
1907         would paint its background, filling the previously transparent bitmap with an unwanted color.
1908
1909 2015-04-23  Roger Fong  <roger_fong@apple.com>
1910
1911         Update media timeline controls when video is paused..
1912         https://bugs.webkit.org/show_bug.cgi?id=144122.
1913         <rdar://problem/20422927>
1914
1915         Reviewed by Dean Jackson.
1916
1917         * Modules/mediacontrols/mediaControlsApple.js:
1918         (Controller.prototype.drawTimelineBackground): Use timelineWidth because offsetWidth is 0 when display: none.
1919         (Controller.prototype.setPlaying): Show controls when pausing.
1920         (Controller.prototype.showControls): Update time and timeline when unhiding controls.
1921
1922 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
1923
1924         Changing TiledBacking velocity should schedule a tile revalidation
1925         https://bugs.webkit.org/show_bug.cgi?id=144123
1926
1927         Reviewed by Tim Horton.
1928
1929         Changing the velocity parameters on the TileController affect the computed
1930         coverage rect, so whenever we make a change to velocity data that could
1931         affect the outcome (basically any non-zero old or new velocities),
1932         schedule a layer flush.
1933
1934         * platform/graphics/TiledBacking.h:
1935         (WebCore::VelocityData::velocityOrScaleIsChanging):
1936         * platform/graphics/ca/TileController.cpp:
1937         (WebCore::TileController::setVelocity):
1938
1939 2015-04-23  Jer Noble  <jer.noble@apple.com>
1940
1941         [Mac] Disable QTKit by default on future OS X.
1942         https://bugs.webkit.org/show_bug.cgi?id=144082
1943
1944         Reviewed by Darin Adler.
1945
1946         Settings::gQTKitEnabled defaults to false.
1947
1948         * page/Settings.cpp:
1949
1950 2015-04-23  Daniel Bates  <dabates@apple.com>
1951
1952         Clean up: Use references instead of pointers in more SVG files
1953         https://bugs.webkit.org/show_bug.cgi?id=144045
1954
1955         Reviewed by Darin Adler.
1956
1957         * rendering/svg/SVGRootInlineBox.cpp:
1958         (WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Pass reference instead of pointer.
1959
1960         * rendering/svg/SVGTextLayoutEngine.cpp:
1961         (WebCore::SVGTextLayoutEngine::recordTextFragment): Changed parameter textBox from pointer to reference.
1962         (WebCore::SVGTextLayoutEngine::layoutInlineTextBox): Ditto.
1963         (WebCore::SVGTextLayoutEngine::currentVisualCharacterMetrics): Changed parameter textBox from pointer to
1964         reference and made it const since this function does not modify textBox.
1965         (WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Changed parameters from pointers to references.
1966         Also, removed comma from comment so that it reads well.
1967         * rendering/svg/SVGTextLayoutEngine.h: Updated declarations for the above functions.
1968
1969         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1970         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift): Changed parameter style from pointer to reference.
1971         Added case BS_LENGTH to switch block and removed default case so that the compiler checks that we handle all cases.
1972         Renamed parameter contextElement to context since the name of its data type conveys that it is an element.
1973         (WebCore::SVGTextLayoutEngineBaseline::calculateAlignmentBaselineShift): Changed parameter textRenderer from
1974         pointer to reference and removed runtime assertion that textRenderer is non-null (since it well-formed reference
1975         cannot point to a non-existent object).
1976         (WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle): Changed parameter style from pointer to reference
1977         removed runtime assertion that style is non-null.
1978         * rendering/svg/SVGTextLayoutEngineBaseline.h: Updated declarations for the above functions.
1979
1980 2015-04-23  Commit Queue  <commit-queue@webkit.org>
1981
1982         Unreviewed, rolling out r183194.
1983         https://bugs.webkit.org/show_bug.cgi?id=144121
1984
1985         Made multiple tests flaky (Requested by ap_ on #webkit).
1986
1987         Reverted changeset:
1988
1989         "Memory cache live resources repeatedly purged during
1990         painting"
1991         https://bugs.webkit.org/show_bug.cgi?id=144104
1992         http://trac.webkit.org/changeset/183194
1993
1994 2015-04-23  Roger Fong  <roger_fong@apple.com>
1995
1996         Unreviewed. Missed a button in r182900.
1997
1998         * Modules/mediacontrols/mediaControlsApple.css:
1999         (audio::-webkit-media-controls-wireless-playback-picker-button:active):
2000
2001 2015-04-23  Roger Fong  <roger_fong@apple.com>
2002
2003         Unreviewed. Just shift some CSS around for code cleanup purposes.
2004
2005         * Modules/mediacontrols/mediaControlsApple.css:
2006         (video::-webkit-media-controls-panel):
2007         (video::-webkit-media-controls-panel:hover):
2008
2009 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
2010
2011         [iOS] WebKit services should inherit environment variables for home
2012         https://bugs.webkit.org/show_bug.cgi?id=144078
2013         rdar://problem/20571678
2014
2015         Reviewed by Dan Bernstein.
2016
2017         Added an SPI header for a drive-by fix.
2018
2019         * WebCore.xcodeproj/project.pbxproj:
2020         * platform/spi/cf/CFBundleSPI.h: Added.
2021
2022 2015-04-23  Alex Christensen  <achristensen@webkit.org>
2023
2024         Use less memory when compiling content extensions.
2025         https://bugs.webkit.org/show_bug.cgi?id=144051
2026
2027         Reviewed by Darin Adler and Benjamin Poulain.
2028
2029         No change in functionality, correctness already covered by existing tests.
2030
2031         Before this patch, a DFANode contained a HashSet of transitions.
2032         Large vectors of DFANodes made many small HashSets, which was inefficient use of memory.
2033         We now put all the actions and transitions into one big compact Vector and each node owns ranges in that vector.
2034
2035         * contentextensions/CombinedURLFilters.cpp:
2036         (WebCore::ContentExtensions::recursiveMemoryUsed):
2037         (WebCore::ContentExtensions::CombinedURLFilters::memoryUsed):
2038         * contentextensions/CombinedURLFilters.h:
2039         * contentextensions/ContentExtensionCompiler.cpp:
2040         (WebCore::ContentExtensions::compileRuleList):
2041         * contentextensions/ContentExtensionsDebugging.h:
2042         * contentextensions/DFA.cpp:
2043         (WebCore::ContentExtensions::DFA::memoryUsed):
2044         (WebCore::ContentExtensions::DFANode::actions):
2045         (WebCore::ContentExtensions::DFANode::transitions):
2046         (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
2047         (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
2048         (WebCore::ContentExtensions::DFANode::addFallbackTransition):
2049         (WebCore::ContentExtensions::DFANode::containsTransition):
2050         (WebCore::ContentExtensions::DFANode::kill):
2051         (WebCore::ContentExtensions::DFA::minimize):
2052         (WebCore::ContentExtensions::DFA::DFA): Deleted.
2053         (WebCore::ContentExtensions::DFA::operator=): Deleted.
2054         * contentextensions/DFA.h:
2055         * contentextensions/DFABytecodeCompiler.cpp:
2056         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
2057         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNodeTransitions):
2058         (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
2059         * contentextensions/DFABytecodeCompiler.h:
2060         * contentextensions/DFAMinimizer.cpp:
2061         (WebCore::ContentExtensions::DFAMinimizer::minimize):
2062         * contentextensions/DFAMinimizer.h:
2063         * contentextensions/DFANode.h:
2064         (WebCore::ContentExtensions::DFANode::isKilled):
2065         (WebCore::ContentExtensions::DFANode::hasFallbackTransition):
2066         (WebCore::ContentExtensions::DFANode::hasActions):
2067         (WebCore::ContentExtensions::DFANode::transitionsLength):
2068         (WebCore::ContentExtensions::DFANode::actionsLength):
2069         (WebCore::ContentExtensions::DFANode::actionsStart):
2070         (WebCore::ContentExtensions::DFANode::setActions):
2071         (WebCore::ContentExtensions::DFANode::setTransitions):
2072         (WebCore::ContentExtensions::DFANode::resetTransitions):
2073         (WebCore::ContentExtensions::DFANode::transitionsStart):
2074         (WebCore::ContentExtensions::DFANode::setHasFallbackTransitionWithoutChangingDFA):
2075         * contentextensions/NFA.cpp:
2076         (WebCore::ContentExtensions::NFA::memoryUsed):
2077         * contentextensions/NFA.h:
2078         * contentextensions/NFAToDFA.cpp:
2079         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
2080         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
2081         (WebCore::ContentExtensions::getOrCreateDFANode):
2082         (WebCore::ContentExtensions::NFAToDFA::convert):
2083
2084 2015-04-23  David Hyatt  <hyatt@apple.com>
2085
2086         Don't fire a bunch of mouse moveds during scrolling.
2087         https://bugs.webkit.org/show_bug.cgi?id=99940
2088
2089         Reviewed by Simon Fraser.
2090
2091         * page/EventHandler.cpp:
2092         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
2093         Even for the short interval timer, make sure to cancel and restart it instead of allowing the original to
2094         complete. This has the effect of preventing fake mouse moves from firing until the scroll stops.
2095
2096 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
2097
2098         Unreviewed, fix the release build.
2099
2100         * html/HTMLMediaSession.cpp:
2101         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners): Add an UNUSED_PARAM.
2102
2103 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2104
2105         Remove m_isPageTiledBackingLayer data member from GraphicsLayerCA, just use the layer type instead
2106         https://bugs.webkit.org/show_bug.cgi?id=144108
2107
2108         Reviewed by Dean Jackson.
2109
2110         No need for the m_isPageTiledBackingLayer data member. We can just check the layer
2111         type instead.
2112
2113         * platform/graphics/ca/GraphicsLayerCA.cpp:
2114         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2115         (WebCore::GraphicsLayerCA::initialize):
2116         (WebCore::GraphicsLayerCA::platformCALayerShowRepaintCounter):
2117         (WebCore::GraphicsLayerCA::updateContentsScale):
2118         (WebCore::GraphicsLayerCA::getDebugBorderInfo):
2119         (WebCore::GraphicsLayerCA::requiresTiledLayer):
2120         * platform/graphics/ca/GraphicsLayerCA.h:
2121         (WebCore::GraphicsLayerCA::isPageTiledBackingLayer):
2122
2123 2015-04-23  Brady Eidson  <beidson@apple.com>
2124
2125         Content extension with oft-repeated rules can cause slowdown.
2126         rdar://problem/20618511 and https://bugs.webkit.org/show_bug.cgi?id=144010
2127
2128         Reviewed by Alex Christensen.
2129
2130         No new tests (Behavior covered by existing tests).
2131
2132         * WebCore.xcodeproj/project.pbxproj:
2133
2134         * contentextensions/ContentExtension.cpp:
2135         (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
2136
2137         Add the String identifier for the extension and the rule action ID to Actions:
2138         * contentextensions/ContentExtensionRule.cpp:
2139         (WebCore::ContentExtensions::Action::deserialize):
2140         * contentextensions/ContentExtensionRule.h:
2141         (WebCore::ContentExtensions::Action::Action):
2142         (WebCore::ContentExtensions::Action::operator==):
2143         (WebCore::ContentExtensions::Action::setExtensionIdentifier):
2144         (WebCore::ContentExtensions::Action::extensionIdentifier):
2145         (WebCore::ContentExtensions::Action::actionID):
2146         (WebCore::ContentExtensions::Action::type): Deleted.
2147
2148         Object to manage a CSSStyleSheet and selectors identified by ID:
2149         * contentextensions/ContentExtensionStyleSheet.cpp:
2150         (WebCore::ContentExtensions::ContentExtensionStyleSheet::ContentExtensionStyleSheet):
2151         (WebCore::ContentExtensions::ContentExtensionStyleSheet::addDisplayNoneSelector):
2152         * contentextensions/ContentExtensionStyleSheet.h:
2153         (WebCore::ContentExtensions::ContentExtensionStyleSheet::create):
2154         (WebCore::ContentExtensions::ContentExtensionStyleSheet::styleSheet):
2155
2156         Instead of globbing selectors together into a String and making a new stylesheet,
2157         add new unique selectors to an already existing sheet:
2158         * contentextensions/ContentExtensionsBackend.cpp:
2159         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
2160         (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
2161         (WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
2162
2163         * dom/DocumentStyleSheetCollection.cpp:
2164         (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector):
2165         (WebCore::DocumentStyleSheetCollection::addContentExtensionUserSheet): Deleted.
2166         * dom/DocumentStyleSheetCollection.h:
2167
2168         * loader/DocumentLoader.cpp:
2169         (WebCore::DocumentLoader::commitData):
2170         (WebCore::DocumentLoader::addPendingContentExtensionDisplayNoneSelector):
2171         (WebCore::DocumentLoader::addPendingContentExtensionSheet): Deleted.
2172         * loader/DocumentLoader.h:
2173
2174 2015-04-23  Antti Koivisto  <antti@apple.com>
2175
2176         Memory cache live resources repeatedly purged during painting
2177         https://bugs.webkit.org/show_bug.cgi?id=144104
2178         <rdar://problem/20667695>
2179
2180         Reviewed by Chris Dumez.
2181
2182         On some PLT pages (like nytimes.com) we get into state where painting repeatedly purges live bitmaps.
2183         This slows down page loads significantly.
2184
2185         This might have regressed because improvements in page caching keep more pages and so resources 'live'.
2186
2187         With this path we do all regular cache pruning asynchronously. If memory is really critical
2188         the low memory handling code will still prune synchronously.
2189
2190         * loader/cache/CachedResource.cpp:
2191         (WebCore::CachedResource::removeClient):
2192         (WebCore::CachedResource::didAccessDecodedData):
2193
2194             prune() -> pruneSoon()
2195
2196         * loader/cache/MemoryCache.cpp:
2197
2198             Decrease the pruning size target from 0.95 to 0.8 so we don't need to prune so often.
2199
2200         (WebCore::MemoryCache::needsPruning):
2201
2202             Factor into a function.
2203
2204         (WebCore::MemoryCache::prune):
2205         (WebCore::MemoryCache::pruneSoon):
2206
2207             Prune asynchronously.
2208
2209         * loader/cache/MemoryCache.h:
2210
2211 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
2212
2213         Unreviewed, make a suggested change I overlooked in Darin's review of
2214         https://bugs.webkit.org/show_bug.cgi?id=144098
2215
2216         * dom/Document.cpp:
2217         (WebCore::Document::removePlaybackTargetPickerClient): const auto& -> auto
2218         (WebCore::Document::showPlaybackTargetPicker): Ditto.
2219         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
2220         (WebCore::Document::playbackTargetAvailabilityDidChange): Ditto.
2221         (WebCore::Document::setPlaybackTarget): Ditto.
2222         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
2223
2224 2015-04-23  Joonghun Park  <jh718.park@samsung.com>
2225
2226         Use std::unique_ptr instead of OwnPtr in ThreadGlobalData
2227         https://bugs.webkit.org/show_bug.cgi?id=141950
2228
2229         Reviewed by Darin Adler.
2230
2231         No new tests, no behavior changes.
2232
2233         * dom/EventNames.h:
2234         (WebCore::EventNames::create):
2235         * loader/cache/CachedResourceRequestInitiators.h:
2236         * platform/ThreadGlobalData.cpp:
2237         (WebCore::ThreadGlobalData::ThreadGlobalData):
2238         (WebCore::ThreadGlobalData::destroy):
2239         * platform/ThreadGlobalData.h:
2240
2241 2015-04-23  Eric Carlson  <eric.carlson@apple.com>
2242
2243         Some media tests assert after r183096
2244         https://bugs.webkit.org/show_bug.cgi?id=144098
2245
2246         Reviewed by Darin Adler.
2247
2248         * dom/Document.cpp:
2249         (WebCore::Document::removePlaybackTargetPickerClient): Don't assert if the client has already
2250             been removed from the map. This happens when a media element is removed from the document
2251             before its destructor runs and is not an error.
2252         (WebCore::Document::showPlaybackTargetPicker): It is an error to call this after the client 
2253             has been removed from the map so leave the assert in a debug build, but return early
2254             so a release build doesn't crash.
2255         (WebCore::Document::playbackTargetPickerClientStateDidChange): Ditto.
2256         (WebCore::Document::playbackTargetAvailabilityDidChange): Use "auto" for the map iterator variable.
2257         (WebCore::Document::setPlaybackTarget): Ditto.
2258         (WebCore::Document::setShouldPlayToPlaybackTarget): Ditto.
2259         * dom/Document.h: Fix map typedef names.
2260
2261 2015-04-23  Andreas Kling  <akling@apple.com>
2262
2263         DOM nodes should be allocated with fastMalloc().
2264
2265         Unreviewed. This got lost in the TreeShared merge. :|
2266
2267         * dom/Node.h:
2268
2269 2015-04-23  Chris Dumez  <cdumez@apple.com>
2270
2271         [WK2] WebDiagnosticLoggingClient is leaking
2272         https://bugs.webkit.org/show_bug.cgi?id=144089
2273         <rdar://problem/19706214>
2274
2275         Reviewed by Darin Adler.
2276
2277         WebDiagnosticLoggingClient is leaking. It is constructed inside WebPage
2278         constructor but there is no code destroying it.
2279
2280         This patch adds a new xxxDestroyed() virtual function to
2281         DiagnosticLoggingClient and that is overriden in
2282         WebDiagnosticLoggingClient to call "delete this". This is the same
2283         pattern as for other WK2 clients (e.g. WebFrameLoaderClient,
2284         WebProgressTrackerClient).
2285
2286         * loader/EmptyClients.h:
2287         * page/DiagnosticLoggingClient.h:
2288         * page/MainFrame.cpp:
2289         (WebCore::MainFrame::~MainFrame):
2290
2291 2015-04-22  Antti Koivisto  <antti@apple.com>
2292
2293         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
2294         https://bugs.webkit.org/show_bug.cgi?id=144050
2295         rdar://problem/15534973
2296
2297         Reviewed by Chris Dumez.
2298
2299         We are seeing null Element pointer crashes with this stack:
2300
2301         47 com.apple.WebCore:  WebCore::toScriptElementIfPossible + 4 <==
2302         47 com.apple.WebCore:  WebCore::ScriptRunner::timerFired + 452
2303         47 com.apple.WebCore:  WebCore::ThreadTimers::sharedTimerFiredInternal + 175
2304
2305         The most likely cause seems to be that this code
2306
2307             ASSERT(m_pendingAsyncScripts.contains(scriptElement));
2308             m_scriptsToExecuteSoon.append(m_pendingAsyncScripts.take(scriptElement));
2309
2310         in ScriptRunner::notifyScriptReady fails to find scriptElement and we are left with a null entry in
2311         m_scriptsToExecuteSoon. However I haven't managed to repro this or find the exact path how this
2312         could happen. The related code is fragile with lot of state (in ScriptElement class)
2313         and involves many opportunities for re-entry via scripts.
2314
2315         No repro, no test case.
2316
2317         * dom/ScriptRunner.cpp:
2318         (WebCore::ScriptRunner::timerFired):
2319
2320             Paper this over by adding a null check. We could check m_pendingAsyncScripts.take() above
2321             but this also covers possibility this is caused by something else.
2322
2323 2015-04-23  Simon Fraser  <simon.fraser@apple.com>
2324
2325         Use a typedef for TileGrid tile validation policy flags
2326         https://bugs.webkit.org/show_bug.cgi?id=144085
2327
2328         Reviewed by Tim Horton.
2329
2330         Replace 'unsigned' with a typedef for the bitmask of TileValidationPolicyFlags.
2331
2332         * platform/graphics/ca/TileController.cpp:
2333         (WebCore::TileController::tileRevalidationTimerFired):
2334         * platform/graphics/ca/TileGrid.cpp:
2335         (WebCore::TileGrid::revalidateTiles):
2336         * platform/graphics/ca/TileGrid.h:
2337
2338 2015-04-23  Andreas Kling  <akling@apple.com>
2339
2340         Slap Node's reference counting functions with ALWAYS_INLINE stick.
2341
2342         Speculative fix for weird ~3% regression on Speedometer seen after TreeShared
2343         was merged into Node. Since the memory layout didn't change, failure to inline
2344         seems like a possible source of regression.
2345
2346         * dom/Node.h:
2347         (WebCore::Node::ref):
2348         (WebCore::Node::deref):
2349         (WebCore::Node::hasOneRef):
2350         (WebCore::Node::refCount):
2351
2352 2015-04-22  Simon Fraser  <simon.fraser@apple.com>
2353
2354         [iOS] Move computeCoverageRect code from FrameView into TileController
2355         https://bugs.webkit.org/show_bug.cgi?id=144087
2356
2357         Reviewed by Benjamin Poulain.
2358         
2359         There is code in four different places that adjusts tiling coverage rect:
2360         1. LegacyTileCache. This will remain unchanged.
2361         2. FrameView::computeTileCoverageRect(). This was added to do velocity-based
2362         page tiled coverage expansion for iOS WK2.
2363         3. TileController::computeTileCoverageRect(): this is used for the page tiles
2364         on Mac.
2365         4. GraphicsLayerCA::adjustTiledLayerVisibleRect(). This is used by non-page
2366         tiled layers on both iOS and Mac.
2367         
2368         This patch reduced this list to 3, coalescing FrameView::computeTileCoverageRect()
2369         and TileController::computeTileCoverageRect(). It removes the rect inflation that
2370         affects the visibleRect passed into rootLayer->flushCompositingState() for iOS,
2371         but the page tiles now do an identical coverage inflation. The visible rect
2372         change does affect visible rect computations for non-page tiled backings, but
2373         a future patch will restore that.
2374
2375         * page/FrameView.cpp:
2376         (WebCore::FrameView::setScrollVelocity):
2377         (WebCore::FrameView::computeCoverageRect): Deleted.
2378         * page/FrameView.h:
2379         * platform/graphics/TiledBacking.h:
2380         (WebCore::VelocityData::VelocityData):
2381         * platform/graphics/ca/TileController.cpp:
2382         (WebCore::TileController::setVelocity):
2383         (WebCore::TileController::computeTileCoverageRect):
2384         * platform/graphics/ca/TileController.h:
2385         * rendering/RenderLayerCompositor.cpp:
2386         (WebCore::RenderLayerCompositor::flushPendingLayerChanges):
2387
2388 2015-04-22  Darin Adler  <darin@apple.com>
2389
2390         Remove OwnPtr and PassOwnPtr use from WebKit/cf, WebKit/mac, and WebKit2
2391         https://bugs.webkit.org/show_bug.cgi?id=143943
2392
2393         Reviewed by Anders Carlsson.
2394
2395         * editing/Editor.cpp:
2396         (WebCore::Editor::insertDictationPhrases): Changed this iOS-only
2397         function to take a Vector<Vector<String>>&& and not involve PassOwnPtr.
2398         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Changed this iOS-only
2399         function to take a Vector<Vector<String>> and not involve PassOwnPtr. Also made
2400         it take a reference rather than a pointer to the element and simplify the code
2401         a bit using modern for loops and auto.
2402         * editing/Editor.h: Ditto.
2403
2404         * editing/ios/DictationCommandIOS.cpp:
2405         (WebCore::DictationCommandIOS::DictationCommandIOS): Take
2406         a Vector<Vector<String>>&& instead of a PassOwnPtr.
2407         (WebCore::DictationCommandIOS::~DictationCommandIOS): Deleted. No need to
2408         explicitly define this.
2409         (WebCore::DictationCommandIOS::doApply): Updated to use modern for loop and
2410         work with a Vector<Vector<String>> instead of an OwnPtr.
2411         * editing/ios/DictationCommandIOS.h: Updated to not use PassOwnPtr and OwnPtr.
2412         Also modernized a bit by using override.
2413
2414         * platform/network/ios/QuickLook.h: Return an NSURLRequest * instead of a
2415         PassOwnPtr<ResourceRequest> from this iOS-specific function.
2416         * platform/network/ios/QuickLook.mm:
2417         (WebCore::registerQLPreviewConverterIfNeeded): Ditto.
2418
2419 2015-04-22  Jinwoo Song  <jinwoo7.song@samsung.com>
2420
2421         Convert OwnPtr to std::unique_ptr in GraphicsContextCairo.cpp
2422         https://bugs.webkit.org/show_bug.cgi?id=144033
2423
2424         Reviewed by Darin Adler.
2425
2426         Use unique_ptr for creating a copy of cairo_path_t and use lambda function
2427         for custom deleter, cairo_path_destroy().
2428
2429         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2430         (WebCore::drawPathShadow): Use std::unique_ptr instead of OwnPtr.
2431         (WebCore::GraphicsContext::clip): Call cairo_path_destroy() immediately.
2432         * platform/graphics/cairo/OwnPtrCairo.cpp:
2433         (WTF::deleteOwnedPtr<cairo_path_t>): Deleted. Remove unnecessary deleter anymore.
2434         * platform/graphics/cairo/OwnPtrCairo.h: Ditto.
2435
2436 2015-04-22  Darin Adler  <darin@apple.com>
2437
2438         Eliminate remaining uses of OwnPtr and PassOwnPtr in WebCore outside the editing and platform directories
2439         https://bugs.webkit.org/show_bug.cgi?id=143949
2440
2441         Reviewed by Andreas Kling.
2442
2443         * dom/ContainerNode.h: Removed unneeded includes and forward declarations.
2444         * dom/Document.h: Ditto.
2445
2446         * dom/DocumentParser.h: Fixed comment to not mention PassOwnPtr.
2447
2448         * html/shadow/MediaControlElements.cpp:
2449         (WebCore::MediaControlTextTrackContainerElement::create): Return a Ref instead of a PassRefPtr.
2450         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation): Pass a reference
2451         rather than a pointer to TextTrackRepresentation::create.
2452         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Return a
2453         RefPtr instead of a PassRefPtr.
2454
2455         * html/shadow/MediaControlElements.h: Use unique_ptr for m_textTrackRepresentation.
2456         Also fix a couple uses of PassRefPtr.
2457
2458         * loader/DocumentLoader.cpp:
2459         (WebCore::DocumentLoader::DocumentLoader): Use make_unique.
2460         (WebCore::DocumentLoader::addAllArchiveResources): Ditto.
2461         (WebCore::DocumentLoader::addArchiveResource): Ditto.
2462         (WebCore::DocumentLoader::clearArchiveResources): Set to nullptr instead of calling clear.
2463         (WebCore::DocumentLoader::startLoadingMainResource): Use make_unique.
2464         * loader/DocumentLoader.h: Made m_archiveResourceCollection and
2465         m_applicationCacheHost use unique_ptr.
2466
2467         * loader/WorkerThreadableLoader.cpp:
2468         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Use delete here instead
2469         of using OwnPtr to do the deletion. Matches the other code nearby.
2470
2471         * loader/appcache/ApplicationCacheGroup.cpp:
2472         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Handle case where the host is
2473         null; this happens during the DocumentLoader destruction process since unique_ptr sets itself
2474         to null before it destroys the object it points to and OwnPtr does not.
2475
2476         * loader/cocoa/DiskCacheMonitorCocoa.mm:
2477         (WebCore::DiskCacheMonitor::monitorFileBackingStoreCreation): Use delete instead of adoptPtr
2478         to delete a raw pointer.
2479         (WebCore::DiskCacheMonitor::DiskCacheMonitor): Use unique_ptr instead of OwnPtr.
2480
2481         * page/DragController.h: Removed some unneeded forward declarations and changed the
2482         create function to return unique_ptr.
2483
2484         * platform/LayoutUnit.h: Removed wtf_ceil workaround hack here. Not sure why we ever did it
2485         this way!
2486
2487         * platform/graphics/FontCascade.cpp:
2488         (WTF::deleteOwnedPtr<WebCore::TextLayout>): Deleted.
2489         (WebCore::FontCascade::createLayout): Changed to return a unique_ptr.
2490         (WebCore::FontCascade::deleteLayout): Deleted.
2491         * platform/graphics/FontCascade.h: Made the above changes.
2492
2493         * platform/graphics/ImageBuffer.h: Changed copyImage to return a RefPtr instead of a PassRefPtr.
2494
2495         * platform/graphics/TextTrackRepresentation.cpp:
2496         (WebCore::TextTrackRepresentation::create): Use make_unique and return a unique_ptr.
2497         * platform/graphics/TextTrackRepresentation.h: Removed unneeded includes and forward declarations
2498         and made create return a unique_ptr.
2499         * platform/graphics/cairo/ImageBufferCairo.cpp:
2500         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
2501         * platform/graphics/cg/ImageBufferCG.cpp:
2502         (WebCore::ImageBuffer::copyImage): Changed to return a RefPtr.
2503
2504         * platform/graphics/ios/TextTrackRepresentationIOS.h: Use reference instead of pointer,
2505         made more things private.
2506         * platform/graphics/ios/TextTrackRepresentationIOS.mm:
2507         (TextTrackRepresentation::create): Use make_unique.
2508         (TextTrackRepresentationIOS::TextTrackRepresentationIOS): Take a reference.
2509
2510         * platform/graphics/mac/ComplexTextController.cpp:
2511         (WebCore::FontCascade::createLayout): Return a unique_ptr with a custom destruction function.
2512         The custom destruction function eliminates the need to put TextLayout in a visible header.
2513         (WebCore::FontCascade::deleteLayout): Deleted. Use a lambda instead.
2514         (WebCore::roundCGFloat): Deleted. Old fashioned way to deal with multiple floating point sizes.
2515         Just use std::round instead.
2516         (WebCore::ceilCGFloat): Deleted. Same as above. Just use std::ceil instead.
2517         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Use std::round and std::ceil.
2518
2519         * rendering/RenderBlockLineLayout.cpp:
2520         (WebCore::RenderTextInfo::RenderTextInfo): Deleted. Can compile constructor and destructor
2521         now thanks to use of unique_ptr with a custom deleter.
2522         (WebCore::RenderTextInfo::~RenderTextInfo): Deleted. Ditto.
2523         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Updated for RenderTextInfo data member
2524         name change.
2525
2526         * rendering/RenderView.h: Removed unneeded include.
2527
2528         * rendering/line/BreakingContext.h: Removed unneeded include.
2529         (WebCore::BreakingContext::handleOutOfFlowPositioned): Updated for RenderTextInfo data member
2530         name change.
2531         (WebCore::BreakingContext::handleFloat): Ditto.
2532         (WebCore::BreakingContext::handleReplaced): Ditto.
2533         (WebCore::BreakingContext::handleText): Ditto.
2534         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Ditto.
2535
2536         * rendering/line/LineBreaker.h: Made the RenderTextInfo struct more like a struct by taking
2537         off all the m_ prefixes from the data member names. Initialized all the values in the struct
2538         to defaults so we don't need an explicit constructor. We also don't need an explicit destructor
2539         any more due to use of a unique_ptr with a deleter.
2540
2541 2015-04-22  Roger Fong  <roger_fong@apple.com>
2542
2543         Volume slider appears/doesn't appear at the wrong times.
2544         https://bugs.webkit.org/show_bug.cgi?id=144072.
2545         <rdar://problem/20576145>
2546
2547         Reviewed by Dean Jackson.
2548
2549         Set background divs to match volume box dimensions.
2550         * Modules/mediacontrols/mediaControlsApple.css:
2551         (audio::-webkit-media-controls-volume-slider-container-background):
2552         (audio::-webkit-media-controls-volume-slider-container-tint):
2553
2554         Draw the volume slider immediately on mousing over the mute box.
2555         * Modules/mediacontrols/mediaControlsApple.js:
2556         (Controller.prototype.createControls):
2557         (Controller.prototype.handleMuteBoxOver):
2558
2559 2015-04-22  Jer Noble  <jer.noble@apple.com>
2560
2561         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
2562         https://bugs.webkit.org/show_bug.cgi?id=144023
2563
2564         Reviewed by Darin Adler.
2565
2566         Partially revert r183097 (as it was not sufficient to protect against re-entrancy). Instead,
2567         protect against re-entrancy in provideMediaData() directly by removing the first sample
2568         from the TrackBuffer's decodeQueue at a time. If provideMediaData() is called re-entrantly,
2569         or if any other method which modifies the decodeQueue is called from inside
2570         provideMediaData, no iterators will be invalidated.
2571
2572         * Modules/mediasource/SourceBuffer.cpp:
2573         (WebCore::SourceBuffer::provideMediaData):
2574         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2575         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
2576
2577 2015-04-22  Zalan Bujtas  <zalan@apple.com>
2578
2579         Create RenderRubyText for <rt> only when the parent renderer is a RenderRuby.
2580         https://bugs.webkit.org/show_bug.cgi?id=144035
2581         rdar://problem/20604467
2582
2583         Reviewed by Darin Adler.
2584
2585         This patch extends HTMLElement::createElementRenderer()
2586         with the render tree insertion point so that we can create different type
2587         of renderers based on the render tree context.
2588
2589         Test: fast/ruby/ruby-rt-with-region-crash.html
2590
2591         * CMakeLists.txt:
2592         * Modules/plugins/PluginReplacement.h:
2593         * Modules/plugins/QuickTimePluginReplacement.h:
2594         * Modules/plugins/QuickTimePluginReplacement.mm:
2595         (WebCore::QuickTimePluginReplacement::createElementRenderer):
2596         * Modules/plugins/YouTubePluginReplacement.cpp:
2597         (WebCore::YouTubePluginReplacement::createElementRenderer):
2598         * Modules/plugins/YouTubePluginReplacement.h:
2599         * WebCore.vcxproj/WebCore.vcxproj:
2600         * WebCore.vcxproj/WebCore.vcxproj.filters:
2601         * WebCore.xcodeproj/project.pbxproj:
2602         * dom/Element.cpp:
2603         (WebCore::Element::createElementRenderer):
2604         * dom/Element.h:
2605         * html/HTMLAppletElement.cpp:
2606         (WebCore::HTMLAppletElement::createElementRenderer):
2607         * html/HTMLAppletElement.h:
2608         * html/HTMLAttachmentElement.cpp:
2609         (WebCore::HTMLAttachmentElement::createElementRenderer):
2610         * html/HTMLAttachmentElement.h:
2611         * html/HTMLBRElement.cpp:
2612         (WebCore::HTMLBRElement::createElementRenderer):
2613         * html/HTMLBRElement.h:
2614         * html/HTMLButtonElement.cpp:
2615         (WebCore::HTMLButtonElement::createElementRenderer):
2616         * html/HTMLButtonElement.h:
2617         * html/HTMLCanvasElement.cpp:
2618         (WebCore::HTMLCanvasElement::createElementRenderer):
2619         * html/HTMLCanvasElement.h:
2620         * html/HTMLDetailsElement.cpp:
2621         (WebCore::HTMLDetailsElement::createElementRenderer):
2622         * html/HTMLDetailsElement.h:
2623         * html/HTMLElement.cpp:
2624         (WebCore::HTMLElement::createElementRenderer):
2625         * html/HTMLElement.h:
2626         * html/HTMLFieldSetElement.cpp:
2627         (WebCore::HTMLFieldSetElement::createElementRenderer):
2628         * html/HTMLFieldSetElement.h:
2629         * html/HTMLFrameElement.cpp:
2630         (WebCore::HTMLFrameElement::createElementRenderer):
2631         * html/HTMLFrameElement.h:
2632         * html/HTMLFrameSetElement.cpp:
2633         (WebCore::HTMLFrameSetElement::createElementRenderer):
2634         * html/HTMLFrameSetElement.h:
2635         * html/HTMLIFrameElement.cpp:
2636         (WebCore::HTMLIFrameElement::createElementRenderer):
2637         * html/HTMLIFrameElement.h:
2638         * html/HTMLImageElement.cpp:
2639         (WebCore::HTMLImageElement::createElementRenderer):
2640         * html/HTMLImageElement.h:
2641         * html/HTMLInputElement.cpp:
2642         (WebCore::HTMLInputElement::createElementRenderer):
2643         * html/HTMLInputElement.h:
2644         * html/HTMLMediaElement.cpp:
2645         (WebCore::HTMLMediaElement::parseAttribute):
2646         * html/HTMLMediaElement.h:
2647         * html/HTMLMeterElement.cpp:
2648         (WebCore::HTMLMeterElement::createElementRenderer):
2649         * html/HTMLMeterElement.h:
2650         * html/HTMLPlugInElement.cpp:
2651         (WebCore::HTMLPlugInElement::createElementRenderer):
2652         * html/HTMLPlugInElement.h:
2653         * html/HTMLPlugInImageElement.cpp:
2654         (WebCore::HTMLPlugInImageElement::createElementRenderer):
2655         * html/HTMLPlugInImageElement.h:
2656         * html/HTMLProgressElement.cpp:
2657         (WebCore::HTMLProgressElement::createElementRenderer):
2658         * html/HTMLProgressElement.h:
2659         * html/HTMLSelectElement.cpp:
2660         (WebCore::HTMLSelectElement::createElementRenderer):
2661         * html/HTMLSelectElement.h:
2662         * html/HTMLSummaryElement.cpp:
2663         (WebCore::HTMLSummaryElement::createElementRenderer):
2664         * html/HTMLSummaryElement.h:
2665         * html/HTMLTextAreaElement.cpp:
2666         (WebCore::HTMLTextAreaElement::createElementRenderer):
2667         * html/HTMLTextAreaElement.h:
2668         * html/HTMLVideoElement.cpp:
2669         (WebCore::HTMLVideoElement::createElementRenderer):
2670         * html/HTMLVideoElement.h:
2671         * html/HTMLWBRElement.cpp:
2672         (WebCore::HTMLWBRElement::createElementRenderer):
2673         * html/HTMLWBRElement.h:
2674         * html/RubyElement.cpp:
2675         (WebCore::RubyElement::createElementRenderer):
2676         * html/RubyElement.h:
2677         * html/RubyTextElement.cpp:
2678         (WebCore::RubyTextElement::createElementRenderer):
2679         * html/RubyTextElement.h:
2680         * html/shadow/DetailsMarkerControl.cpp:
2681         (WebCore::DetailsMarkerControl::createElementRenderer):
2682         * html/shadow/DetailsMarkerControl.h:
2683         * html/shadow/MediaControlElements.cpp:
2684         (WebCore::MediaControlTimelineContainerElement::createElementRenderer):
2685         (WebCore::MediaControlVolumeSliderContainerElement::createElementRenderer):
2686         (WebCore::MediaControlTextTrackContainerElement::createElementRenderer):
2687         * html/shadow/MediaControlElements.h:
2688         * html/shadow/MeterShadowElement.cpp:
2689         (WebCore::MeterInnerElement::createElementRenderer):
2690         * html/shadow/MeterShadowElement.h:
2691         * html/shadow/ProgressShadowElement.cpp:
2692         (WebCore::ProgressInnerElement::createElementRenderer):
2693         * html/shadow/ProgressShadowElement.h:
2694         * html/shadow/SliderThumbElement.cpp:
2695         (WebCore::SliderThumbElement::createElementRenderer):
2696         (WebCore::SliderContainerElement::createElementRenderer):
2697         * html/shadow/SliderThumbElement.h:
2698         * html/shadow/TextControlInnerElements.cpp:
2699         (WebCore::TextControlInnerContainer::createElementRenderer):
2700         (WebCore::TextControlInnerTextElement::createElementRenderer):
2701         * html/shadow/TextControlInnerElements.h:
2702         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
2703         (WebCore::ImageControlsButtonElementMac::createElementRenderer):
2704         * html/shadow/mac/ImageControlsButtonElementMac.h:
2705         * html/shadow/mac/ImageControlsRootElementMac.cpp:
2706         (WebCore::ImageControlsRootElementMac::createElementRenderer):
2707         * html/shadow/mac/ImageControlsRootElementMac.h:
2708         * html/track/VTTCue.cpp:
2709         (WebCore::VTTCueBox::createElementRenderer):
2710         * html/track/VTTCue.h:
2711         * mathml/MathMLInlineContainerElement.cpp:
2712         (WebCore::MathMLInlineContainerElement::createElementRenderer):
2713         * mathml/MathMLInlineContainerElement.h:
2714         * mathml/MathMLMathElement.cpp:
2715         (WebCore::MathMLMathElement::createElementRenderer):
2716         * mathml/MathMLMathElement.h:
2717         * mathml/MathMLMencloseElement.cpp:
2718         (WebCore::MathMLMencloseElement::createElementRenderer):
2719         * mathml/MathMLMencloseElement.h:
2720         * mathml/MathMLSelectElement.cpp:
2721         (WebCore::MathMLSelectElement::createElementRenderer):
2722         * mathml/MathMLSelectElement.h:
2723         * mathml/MathMLTextElement.cpp:
2724         (WebCore::MathMLTextElement::createElementRenderer):
2725         * mathml/MathMLTextElement.h:
2726         * rendering/RenderBlock.cpp:
2727         (WebCore::RenderBlock::clone):
2728         * rendering/RenderElement.cpp:
2729         * rendering/RenderRuby.h:
2730         (WebCore::isRuby):
2731         * style/RenderTreePosition.cpp: Added.
2732         (WebCore::RenderTreePosition::computeNextSibling):
2733         (WebCore::RenderTreePosition::invalidateNextSibling):
2734         (WebCore::RenderTreePosition::previousSiblingRenderer):
2735         (WebCore::RenderTreePosition::nextSiblingRenderer):
2736         (WebCore::RenderTreePosition::isRendererReparented):
2737         * style/RenderTreePosition.h: Added.
2738         (WebCore::RenderTreePosition::RenderTreePosition):
2739         (WebCore::RenderTreePosition::parent):
2740         (WebCore::RenderTreePosition::canInsert):
2741         (WebCore::RenderTreePosition::insert):
2742         * style/StyleResolveTree.cpp:
2743         (WebCore::Style::createRendererIfNeeded):
2744         (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
2745         (WebCore::Style::textRendererIsNeeded):
2746         (WebCore::Style::RenderTreePosition::parent): Deleted.
2747         (WebCore::Style::isRendererReparented): Deleted.
2748         (WebCore::Style::nextSiblingRenderer): Deleted.
2749         (WebCore::Style::RenderTreePosition::RenderTreePosition): Deleted.
2750         (WebCore::Style::RenderTreePosition::canInsert): Deleted.
2751         (WebCore::Style::RenderTreePosition::insert): Deleted.
2752         (WebCore::Style::RenderTreePosition::computeNextSibling): Deleted.
2753         (WebCore::Style::RenderTreePosition::invalidateNextSibling): Deleted.
2754         (WebCore::Style::previousSiblingRenderer): Deleted.
2755         * svg/SVGAElement.cpp:
2756         (WebCore::SVGAElement::createElementRenderer):
2757         * svg/SVGAElement.h:
2758         * svg/SVGAltGlyphElement.cpp:
2759         (WebCore::SVGAltGlyphElement::createElementRenderer):
2760         * svg/SVGAltGlyphElement.h:
2761         * svg/SVGCircleElement.cpp:
2762         (WebCore::SVGCircleElement::createElementRenderer):
2763         * svg/SVGCircleElement.h:
2764         * svg/SVGClipPathElement.cpp:
2765         (WebCore::SVGClipPathElement::createElementRenderer):
2766         * svg/SVGClipPathElement.h:
2767         * svg/SVGDefsElement.cpp:
2768         (WebCore::SVGDefsElement::createElementRenderer):
2769         * svg/SVGDefsElement.h:
2770         * svg/SVGEllipseElement.cpp:
2771         (WebCore::SVGEllipseElement::createElementRenderer):
2772         * svg/SVGEllipseElement.h:
2773         * svg/SVGFilterElement.cpp:
2774         (WebCore::SVGFilterElement::createElementRenderer):
2775         * svg/SVGFilterElement.h:
2776         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
2777         (WebCore::SVGFilterPrimitiveStandardAttributes::createElementRenderer):
2778         * svg/SVGFilterPrimitiveStandardAttributes.h:
2779         * svg/SVGForeignObjectElement.cpp:
2780         (WebCore::SVGForeignObjectElement::createElementRenderer):
2781         * svg/SVGForeignObjectElement.h:
2782         * svg/SVGGElement.cpp:
2783         (WebCore::SVGGElement::createElementRenderer):
2784         * svg/SVGGElement.h:
2785         * svg/SVGGraphicsElement.cpp:
2786         (WebCore::SVGGraphicsElement::createElementRenderer):
2787         * svg/SVGGraphicsElement.h:
2788         * svg/SVGImageElement.cpp:
2789         (WebCore::SVGImageElement::createElementRenderer):
2790         * svg/SVGImageElement.h:
2791         * svg/SVGLinearGradientElement.cpp:
2792         (WebCore::SVGLinearGradientElement::createElementRenderer):
2793         * svg/SVGLinearGradientElement.h:
2794         * svg/SVGMarkerElement.cpp:
2795         (WebCore::SVGMarkerElement::createElementRenderer):
2796         * svg/SVGMarkerElement.h:
2797         * svg/SVGMaskElement.cpp:
2798         (WebCore::SVGMaskElement::createElementRenderer):
2799         * svg/SVGMaskElement.h:
2800         * svg/SVGPathElement.cpp:
2801         (WebCore::SVGPathElement::createElementRenderer):
2802         * svg/SVGPathElement.h:
2803         * svg/SVGPatternElement.cpp:
2804         (WebCore::SVGPatternElement::createElementRenderer):
2805         * svg/SVGPatternElement.h:
2806         * svg/SVGRadialGradientElement.cpp:
2807         (WebCore::SVGRadialGradientElement::createElementRenderer):
2808         * svg/SVGRadialGradientElement.h:
2809         * svg/SVGRectElement.cpp:
2810         (WebCore::SVGRectElement::createElementRenderer):
2811         * svg/SVGRectElement.h:
2812         * svg/SVGSVGElement.cpp:
2813         (WebCore::SVGSVGElement::createElementRenderer):
2814         * svg/SVGSVGElement.h:
2815         * svg/SVGStopElement.cpp:
2816         (WebCore::SVGStopElement::createElementRenderer):
2817         * svg/SVGStopElement.h:
2818         * svg/SVGSwitchElement.cpp:
2819         (WebCore::SVGSwitchElement::createElementRenderer):
2820         * svg/SVGSwitchElement.h:
2821         * svg/SVGSymbolElement.cpp:
2822         (WebCore::SVGSymbolElement::createElementRenderer):
2823         * svg/SVGSymbolElement.h:
2824         * svg/SVGTRefElement.cpp:
2825         (WebCore::SVGTRefElement::createElementRenderer):
2826         * svg/SVGTRefElement.h:
2827         * svg/SVGTSpanElement.cpp:
2828         (WebCore::SVGTSpanElement::createElementRenderer):
2829         * svg/SVGTSpanElement.h:
2830         * svg/SVGTextElement.cpp:
2831         (WebCore::SVGTextElement::createElementRenderer):
2832         * svg/SVGTextElement.h:
2833         * svg/SVGTextPathElement.cpp:
2834         (WebCore::SVGTextPathElement::createElementRenderer):
2835         * svg/SVGTextPathElement.h:
2836         * svg/SVGUseElement.cpp:
2837         (WebCore::SVGUseElement::createElementRenderer):
2838         * svg/SVGUseElement.h:
2839
2840 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
2841
2842         VisibleSelection should only accept Range by reference
2843         https://bugs.webkit.org/show_bug.cgi?id=144047
2844
2845         Reviewed by Tim Horton.
2846
2847         Update VisibleSelection to expect a Range reference argument, rather than a
2848         Range*. Also update all uses of VisibleSelection to pass a reference instead
2849         of a pointer.
2850
2851         No change in behavior, so new tests.
2852
2853         * editing/Editor.cpp:
2854         (WebCore::Editor::selectionForCommand):
2855         (WebCore::Editor::advanceToNextMisspelling):
2856         (WebCore::Editor::markMisspellingsAfterTypingToWord):
2857         (WebCore::Editor::markAndReplaceFor):
2858         (WebCore::Editor::transpose):
2859         (WebCore::Editor::findString):
2860         (WebCore::Editor::rangeOfString):
2861         * editing/FrameSelection.cpp:
2862         (WebCore::FrameSelection::setSelectedRange):
2863         * editing/SpellingCorrectionCommand.cpp:
2864         (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
2865         * editing/VisibleSelection.cpp:
2866         (WebCore::VisibleSelection::VisibleSelection):
2867         * editing/VisibleSelection.h:
2868         * editing/mac/EditorMac.mm:
2869         (WebCore::Editor::replaceNodeFromPasteboard):
2870         * page/DragController.cpp:
2871         (WebCore::selectElement):
2872         * page/TextIndicator.cpp:
2873         (WebCore::TextIndicator::createWithRange):
2874         * page/mac/EventHandlerMac.mm:
2875         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
2876         * rendering/SelectionSubtreeRoot.cpp:
2877         (WebCore::SelectionSubtreeRoot::adjustForVisibleSelection):
2878
2879 2015-04-22  Roger Fong  <roger_fong@apple.com>
2880
2881         Audio controls should render with a black background.
2882         https://bugs.webkit.org/show_bug.cgi?id=144074.
2883         <rdar://problem/20596939>
2884
2885         Reviewed by Darin Adler.
2886
2887         * Modules/mediacontrols/mediaControlsApple.css:
2888         (audio::-webkit-media-controls-panel-background-container):
2889         (audio::-webkit-media-controls-panel .volume-box):
2890
2891 2015-04-22  Roger Fong  <roger_fong@apple.com>
2892
2893         Inline media control icons scale down when video is too small.
2894         https://bugs.webkit.org/show_bug.cgi?id=144073.
2895         <rdar://problem/20659451>
2896
2897         Reviewed by Darin Adler.
2898
2899         Just make sure the buttons use min-width.
2900         * Modules/mediacontrols/mediaControlsApple.css:
2901         (audio::-webkit-media-controls-rewind-button):
2902         (audio::-webkit-media-controls-play-button):
2903         (audio::-webkit-media-controls-panel .mute-box):
2904         (video::-webkit-media-controls-volume-max-button):
2905         (audio::-webkit-media-controls-wireless-playback-picker-button):
2906         (audio::-webkit-media-controls-toggle-closed-captions-button):
2907         (audio::-webkit-media-controls-fullscreen-button):
2908
2909 2015-04-22  Jer Noble  <jer.noble@apple.com>
2910
2911         Add new optimized fullscreen delegate methods
2912         https://bugs.webkit.org/show_bug.cgi?id=144071
2913
2914         Reviewed by Eric Carlson.
2915
2916         AVPlayerViewController requires three new delegate methods to be implemented by WebKit which
2917         notify the delegates exactly when the owning view will enter and leave fullscreen mode. One
2918         of the delegate methods (-enterOptimizedFullScreenModeRedirectingVideoToLayer:) gives the
2919         delegate an opportunity to move the video sublayer into a new CALayer. The matching delegate
2920         (-leaveOptimizedFullScreenMode), allows us to return our sublayer back to its original parent.
2921         The third delegate (-isOptimizedFullscreenPossible) is required so the AVPlayerViewController
2922         knows whether to allow a standard -> optimized fullscreen transition.
2923
2924         Drive-by fix: initialize ivars at declaration time.
2925
2926         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2927         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2928         (-[WebAVPlayerController isOptimizedFullscreenPossible]):
2929         (-[WebAVVideoLayer enterOptimizedFullScreenModeRedirectingVideoToLayer:]):
2930         (-[WebAVVideoLayer leaveOptimizedFullScreenMode]):
2931         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
2932         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal):
2933         (+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]): Deleted.
2934
2935 2015-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
2936
2937         [iOS] Caret does not line up with text when using the system font
2938         https://bugs.webkit.org/show_bug.cgi?id=144076
2939         <rdar://problem/20578301>
2940
2941         Reviewed by Enrica Casucci.
2942
2943         Determining caret locations often uses the complex text codepath, which means
2944         the complex text codepath must know about custom tracking.
2945
2946         This regression is due to r182512.
2947
2948         Note that this patch is a short-term solution until I can solve the bigger issue of
2949         having two CTFontRefs and using each in their proper place.
2950
2951         No new tests because there is no way to robustly test the system font.
2952
2953         * platform/graphics/Font.h:
2954         (WebCore::Font::hasCustomTracking):
2955         * platform/graphics/cocoa/FontCocoa.mm:
2956         (WebCore::canUseFastGlyphAdvanceGetter):
2957         (WebCore::Font::platformWidthForGlyph):
2958         (WebCore::hasCustomTracking): Deleted.
2959         * platform/graphics/mac/SimpleFontDataCoreText.cpp:
2960         (WebCore::Font::getCFStringAttributes):
2961
2962 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
2963
2964         Context menu doesn't account for selection semantics
2965         https://bugs.webkit.org/show_bug.cgi?id=143958
2966         <rdar://problem/19735706>
2967
2968         Reviewed by Tim Horton.
2969
2970         Before using the default word-only selection for context menus, check with the
2971         lookup service to see if we can get a semantically appropriate selection.
2972
2973         * editing/EditingBehavior.h:
2974         (WebCore::EditingBehavior::shouldSelectBasedOnDictionaryLookup): Added, so that we can
2975         behavior correctly when using non-Mac editing behavior.
2976         * editing/mac/DictionaryLookup.mm:
2977         (WebCore::rangeForDictionaryLookupAtHitTestResult): Modified to honor standard WebKit
2978         behavior when hit testing at end-of-line/end-of-paragraph, etc.
2979         * page/EventHandler.cpp:
2980         (WebCore::EventHandler::shouldAppendTrailingWhitespace): New helper function to share code.
2981         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
2982         (WebCore::EventHandler::selectClosestContextualWordFromMouseEvent): Added.
2983         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent): Renamed from selectClosestWordOrLinkFromMouseEvent.
2984         Have this call the new 'selectClosestContextualWordFromMouseEvent' instead of the vanilla 'selectClosestWordFromMouseEvent'.
2985         * page/EventHandler.h:
2986         * page/mac/EventHandlerMac.mm:
2987         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup): Added.
2988
2989 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
2990
2991         [Mac] Extend action menus to support PDF
2992         https://bugs.webkit.org/show_bug.cgi?id=143895
2993         <rdar://problem/19003333>
2994
2995         Reviewed by Tim Horton.
2996
2997         Tested by TestWebKitAPI ActionMenus.mm.
2998
2999         Add a new dictionary lookup method to support PDF Selections. This code replicates the
3000         DOM Range-based logic used for HTML documents, but does so using the PDFKit API and
3001         its support types.
3002
3003         * Configurations/Base.xcconfig: Add PDFKit include path for build.
3004         * editing/mac/DictionaryLookup.h:
3005         * editing/mac/DictionaryLookup.mm:
3006         (WebCore::expandSelectionByCharacters): Helper function for PDF support.
3007         (WebCore::dictionaryLookupForPDFSelection): Added.
3008
3009 2015-04-22  Zalan Bujtas  <zalan@apple.com>
3010
3011         Move render ruby initialization logic from RenderElement::createFor() to *::createElementRenderer()
3012         https://bugs.webkit.org/show_bug.cgi?id=144058
3013
3014         Reviewed by Darin Adler.
3015
3016         No change in functionality.
3017
3018         * CMakeLists.txt:
3019         * WebCore.vcxproj/WebCore.vcxproj:
3020         * WebCore.vcxproj/WebCore.vcxproj.filters:
3021         * WebCore.xcodeproj/project.pbxproj:
3022         * html/HTMLTagNames.in:
3023         * html/RubyElement.cpp: Added.
3024         (WebCore::RubyElement::RubyElement):
3025         (WebCore::RubyElement::create):
3026         (WebCore::RubyElement::createElementRenderer):
3027         * html/RubyElement.h: Added.
3028         * html/RubyTextElement.cpp: Added.
3029         (WebCore::RubyTextElement::RubyTextElement):
3030         (WebCore::RubyTextElement::create):
3031         (WebCore::RubyTextElement::createElementRenderer):
3032         * html/RubyTextElement.h: Added.
3033         * rendering/RenderElement.cpp:
3034         (WebCore::RenderElement::createFor):
3035
3036 2015-04-22  Roger Fong  <roger_fong@apple.com>
3037
3038         Show correct wireless play placard on iOS.
3039         <rdar://problem/20656596>
3040
3041         Copy wireless player placard code from r182631 to iOS.
3042         * Modules/mediacontrols/mediaControlsiOS.css:
3043         (audio::-webkit-media-controls-wireless-playback-status):
3044         (audio::-webkit-media-controls-wireless-playback-text):
3045         (audio::-webkit-media-controls-wireless-playback-text-top):
3046         (audio::-webkit-media-controls-wireless-playback-text-bottom):
3047         (audio::-webkit-media-controls-wireless-playback-status.small):
3048         (audio::-webkit-media-controls-wireless-playback-text-top.small):
3049         (audio::-webkit-media-controls-wireless-playback-text-bottom.small):
3050         * Modules/mediacontrols/mediaControlsiOS.js:
3051         (ControllerIOS.prototype.createControls):
3052         (ControllerIOS.prototype.configureInlineControls):
3053
3054 2015-04-22  Roger Fong  <roger_fong@apple.com>
3055
3056         Rollout part of r182263 that broke inline media controls on iOS.
3057         <rdar://problem/20654260>
3058
3059         * Modules/mediacontrols/mediaControlsApple.js:
3060         (Controller.prototype.handlePanelTransitionEnd):
3061         (Controller.prototype.setPlaying):
3062         (Controller.prototype.showControls):
3063         (Controller.prototype.hideControls):
3064
3065 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
3066
3067         Unreviewed post-review clean up after r183096.
3068
3069         * Modules/mediasession/WebMediaSessionManagerClient.h:
3070         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3071
3072 2015-04-22  Nan Wang  <nanwang1101@yahoo.com>
3073
3074         AX: WebKit does not expose text fields inside tree views.
3075         https://bugs.webkit.org/show_bug.cgi?id=142196
3076
3077         Reviewed by Chris Fleizach.
3078
3079         The problem is that any object in a tree which is not a static text 
3080         or treeitem will be ignored. Fixed it by exposing the children of treeitem.
3081
3082         Test: accessibility/treeitem-child-exposed.html
3083
3084         * accessibility/AccessibilityRenderObject.cpp:
3085         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree):
3086
3087 2015-04-22  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3088
3089         [Streams API] Implement ReadableStreamController
3090         https://bugs.webkit.org/show_bug.cgi?id=143608
3091
3092         Reviewed by Benjamin Poulain.
3093
3094         Introducing ReadableStreamController, an abstraction to manage JS source stream queues.
3095         This new interface is not exposed to JS scripts as specified, using NoInterfaceObject.
3096
3097         A controller is created at the time a ReadableJSStream is started and it is owned by it.
3098         The controller may outlive the stream but as its reference will be reset, the calls to
3099         its methods would result in exceptions.
3100
3101         The constructor is not implemented yet.
3102
3103         Change covered by existing tests and rebased expectations.
3104
3105         * CMakeLists.txt:
3106         * DerivedSources.cpp:
3107         * DerivedSources.make: Added ReadableStreamController.idl related files.
3108         * Modules/streams/ReadableStreamController.h: Added.
3109         * Modules/streams/ReadableStreamController.idl: Added.
3110         * WebCore.vcxproj/WebCore.vcxproj:
3111         * WebCore.vcxproj/WebCore.vcxproj.filters:
3112         * WebCore.xcodeproj/project.pbxproj:
3113         * bindings/js/JSBindingsAllInOne.cpp: Added ReadableStreamController.idl related files.
3114         * bindings/js/JSReadableStreamControllerCustom.cpp: Added.
3115         * bindings/js/ReadableStreamJSSource.cpp:
3116         * bindings/js/ReadableStreamJSSource.h: Removed custom controller implementation.
3117
3118 2015-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
3119
3120         Rename hasOverride{Height,Width}() to hasOverrideLogicalContent{Height,Width}()
3121         https://bugs.webkit.org/show_bug.cgi?id=143984
3122
3123         Reviewed by Darin Adler.
3124
3125         This patch is renaming these LayoutBox methods, because of their names
3126         don't match with the getters and setters, which is confusing. Specially
3127         now that we also have hasOverrideContainingBlockLogical{Height,Width}().
3128
3129         No new tests (this is just a refactoring).
3130
3131         * rendering/RenderBlockFlow.cpp:
3132         (WebCore::RenderBlockFlow::fitBorderToLinesIfNeeded):
3133         * rendering/RenderBlockLineLayout.cpp:
3134         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
3135         * rendering/RenderBox.cpp:
3136         (WebCore::RenderBox::hasOverrideLogicalContentHeight):
3137         (WebCore::RenderBox::hasOverrideLogicalContentWidth):
3138         (WebCore::RenderBox::overrideLogicalContentWidth):
3139         (WebCore::RenderBox::overrideLogicalContentHeight):
3140         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
3141         (WebCore::RenderBox::computeLogicalWidthInRegion):
3142         (WebCore::RenderBox::computeLogicalHeight):
3143         (WebCore::RenderBox::computePercentageLogicalHeight):
3144         (WebCore::RenderBox::availableLogicalHeightUsing):
3145         * rendering/RenderBox.h:
3146         * rendering/RenderDeprecatedFlexibleBox.cpp:
3147         (WebCore::contentWidthForChild):
3148         (WebCore::contentHeightForChild):
3149         * rendering/RenderFlexibleBox.cpp:
3150         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
3151         * rendering/RenderRubyBase.cpp:
3152         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds):
3153         * rendering/RenderTableSection.cpp:
3154         (WebCore::RenderTableSection::calcRowLogicalHeight):
3155
3156 2015-04-21  Jer Noble  <jer.noble@apple.com>
3157
3158         [Mac][MediaSource] Crash when SourceBuffer::provideMediaData() is called re-entrantly.
3159         https://bugs.webkit.org/show_bug.cgi?id=144023
3160
3161         Reviewed by Eric Carlson.
3162
3163         Fixes non-deterministic crash in media/media-source/media-source-stalled-holds-sleep-assertion.html.
3164
3165         Platform changes have introduced a re-entrancy to provideMediaData().  Calling
3166         SourceBufferPrivate::enqueueSample() can result in a re-entrant call back into
3167         SourceBuffer::provideMediaData(). To protect against this, wrap the client call
3168         from SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples() to
3169         SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples() in a dispatch_async() to the
3170         main thread. This gives the original provideMediaData() a chance to finish before the next
3171         one begins.
3172
3173         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3174         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
3175
3176 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
3177
3178         [Mac] Use one playback target for all web processes
3179         https://bugs.webkit.org/show_bug.cgi?id=144009
3180
3181         Reviewed by Tim Horton.
3182
3183         * Modules/mediacontrols/mediaControlsApple.js:
3184         (Controller.prototype.updateWirelessPlaybackStatus): Drive-by fix to show controls when
3185             we show the placeholder image.
3186
3187         Instead of having each Page/Document pair manage access to the playback target for the videos
3188         in a web process, put all of the logic into a new class - WebMediaSessionManager. A singleton
3189         instance talks to the target picker and manages video element access for all web processes.
3190         All playback target logic was removed from Document, Page, and MediaSessionManager.
3191
3192         * Modules/mediasession: Added.
3193         * Modules/mediasession/WebMediaSessionManager.cpp: Added.
3194         (WebCore::ClientState::ClientState):
3195         (WebCore::flagsAreSet):
3196         (WebCore::WebMediaSessionManager::WebMediaSessionManager):
3197         (WebCore::WebMediaSessionManager::~WebMediaSessionManager):
3198         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
3199         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
3200         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
3201         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
3202         (WebCore::WebMediaSessionManager::clientStateDidChange):
3203         (WebCore::WebMediaSessionManager::setPlaybackTarget):
3204         (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
3205         (WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
3206         (WebCore::WebMediaSessionManager::taskTimerFired):
3207         (WebCore::WebMediaSessionManager::find):
3208         (WebCore::WebMediaSessionManager::forEachClient):
3209         * Modules/mediasession/WebMediaSessionManager.h: Added.
3210         * Modules/mediasession/WebMediaSessionManagerClient.h: Added.
3211         (WebCore::WebMediaSessionManagerClient::~WebMediaSessionManagerClient):
3212         * Modules/webaudio/AudioContext.cpp:
3213         (WebCore::AudioContext::mediaState): Replaces isPlayingAudio.
3214         (WebCore::AudioContext::isPlayingAudio): Deleted.
3215         * Modules/webaudio/AudioContext.h:
3216         * WebCore.xcodeproj/project.pbxproj: Added new files.
3217         * dom/Document.cpp:
3218         (WebCore::Document::Document):
3219         (WebCore::Document::addAudioProducer): Take a MediaProducer instead of an AudioProducer.
3220         (WebCore::Document::removeAudioProducer):
3221         (WebCore::Document::updateIsPlayingMedia):
3222         (WebCore::nextPlaybackTargetClientContextId):
3223         (WebCore::Document::addPlaybackTargetPickerClient):
3224         (WebCore::Document::removePlaybackTargetPickerClient):
3225         (WebCore::Document::showPlaybackTargetPicker):
3226         (WebCore::Document::playbackTargetPickerClientStateDidChange):
3227         (WebCore::Document::playbackTargetAvailabilityDidChange):
3228         (WebCore::Document::setPlaybackTarget):
3229         (WebCore::Document::setShouldPlayToPlaybackTarget):
3230         (WebCore::Document::configurePlaybackTargetMonitoring): Deleted.
3231         (WebCore::Document::requiresPlaybackTargetRouteMonitoring): Deleted.
3232         (WebCore::Document::didChoosePlaybackTarget): Deleted.
3233         * dom/Document.h:
3234         (WebCore::Document::mediaState):
3235         (WebCore::Document::isPlayingAudio): Deleted.
3236         * html/HTMLMediaElement.cpp:
3237         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3238         (WebCore::HTMLMediaElement::registerWithDocument):
3239         (WebCore::HTMLMediaElement::setMuted): 
3240         (WebCore::HTMLMediaElement::parseAttribute):
3241         * html/HTMLMediaElement.h:
3242         * html/HTMLMediaSession.cpp:
3243         (WebCore::HTMLMediaSession::registerWithDocument):
3244         (WebCore::HTMLMediaSession::unregisterWithDocument):
3245         (WebCore::HTMLMediaSession::showPlaybackTargetPicker):
3246         (WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
3247         (WebCore::HTMLMediaSession::setPlaybackTarget):
3248         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange):
3249         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget):
3250         (WebCore::HTMLMediaSession::mediaStateDidChange):
3251         (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Deleted.
3252         (WebCore::HTMLMediaSession::requiresPlaybackTargetRouteMonitoring): Deleted.
3253         (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Deleted.
3254         (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Deleted.
3255         * html/HTMLMediaSession.h:
3256         * page/AudioProducer.h: Removed.
3257         * page/ChromeClient.h:
3258         * page/MediaProducer.h: Copied from Source/WebCore/page/AudioProducer.h.
3259         (WebCore::MediaProducer::~MediaProducer):
3260         (WebCore::AudioProducer::~AudioProducer): Deleted.
3261         * page/Page.cpp:
3262         (WebCore::Page::Page):
3263         (WebCore::Page::updateIsPlayingMedia):
3264         (WebCore::Page::addPlaybackTargetPickerClient):
3265         (WebCore::Page::removePlaybackTargetPickerClient):
3266         (WebCore::Page::showPlaybackTargetPicker):
3267         (WebCore::Page::playbackTargetPickerClientStateDidChange):
3268         (WebCore::Page::setPlaybackTarget):
3269         (WebCore::Page::playbackTargetAvailabilityDidChange):
3270         (WebCore::Page::setShouldPlayToPlaybackTarget):
3271         (WebCore::Page::playbackTarget): Deleted.
3272         (WebCore::Page::didChoosePlaybackTarget): Deleted.
3273         (WebCore::Page::configurePlaybackTargetMonitoring): Deleted.
3274         * page/Page.h:
3275         (WebCore::Page::mediaState):
3276         (WebCore::Page::isPlayingAudio): Deleted.
3277         (WebCore::Page::hasWirelessPlaybackTarget): Deleted.
3278         * platform/audio/MediaSession.h:
3279         (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
3280         (WebCore::MediaSession::requiresPlaybackTargetRouteMonitoring):
3281         (WebCore::MediaSessionClient::setShouldPlayToPlaybackTarget):
3282         (WebCore::MediaSession::startPlayingToPlaybackTarget): Deleted.
3283         (WebCore::MediaSession::stopPlayingToPlaybackTarget): Deleted.
3284         (WebCore::MediaSessionClient::startPlayingToPlaybackTarget): Deleted.
3285         (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget): Deleted.
3286         * platform/audio/MediaSessionManager.cpp:
3287         (WebCore::MediaSessionManager::sessionWillBeginPlayback):
3288         (WebCore::MediaSessionManager::sessionCanLoadMedia):
3289         (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): Deleted.
3290         * platform/audio/MediaSessionManager.h:
3291         * platform/graphics/MediaPlaybackTargetClient.h: Copied from Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h.
3292         (WebCore::MediaPlaybackTargetClient::~MediaPlaybackTargetClient):
3293         (WebCore::MediaPlaybackTargetPickerClient::~MediaPlaybackTargetPickerClient): Deleted.
3294         * platform/graphics/MediaPlaybackTargetPicker.cpp:
3295         (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
3296         (WebCore::MediaPlaybackTargetPicker::startingMonitoringPlaybackTargets):
3297         (WebCore::MediaPlaybackTargetPicker::stopMonitoringPlaybackTargets):
3298         * platform/graphics/MediaPlaybackTargetPicker.h:
3299         * platform/graphics/MediaPlaybackTargetPickerClient.h: Removed.
3300         * platform/graphics/MediaPlayer.cpp:
3301         (WebCore::MediaPlayer::setShouldPlayToPlaybackTarget):
3302         (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Deleted.
3303         (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Deleted.
3304         * platform/graphics/MediaPlayer.h:
3305         * platform/graphics/MediaPlayerPrivate.h:
3306         (WebCore::MediaPlayerPrivateInterface::setShouldPlayToPlaybackTarget):
3307         (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget): Deleted.
3308         (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget): Deleted.
3309         * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp: Added.
3310         (WebCore::WebMediaSessionManagerMac::singleton):
3311         (WebCore::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
3312         (WebCore::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
3313         (WebCore::WebMediaSessionManagerMac::targetPicker):
3314         * platform/graphics/avfoundation/WebMediaSessionManagerMac.h: Added.
3315         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
3316         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3317         (WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
3318         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3319         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3320         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3321         (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
3322         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
3323         (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Deleted.
3324         (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Deleted.
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
3326         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3327         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
3328         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Deleted.
3329         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Deleted.
3330         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Deleted.
3331         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3332         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3333         (WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
3334         (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Deleted.
3335         (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Deleted.
3336         (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Deleted.
3337         * testing/Internals.cpp:
3338         (WebCore::Internals::isPagePlayingAudio):
3339
3340 2015-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
3341
3342         [iOS] When computing visible rects for tiling, stop searching at UIWindows
3343         https://bugs.webkit.org/show_bug.cgi?id=144022
3344         <rdar://problem/18327227>
3345
3346         Reviewed by Simon Fraser.
3347
3348         [WAKWindow _visibleRectRespectingMasksToBounds:] computes a visible rect which we use
3349         to determine which tiles to create. We do this by finding the frame of the _hostLayer,
3350         and then walking up the CALayer hierarchy converting each rect into its parent's
3351         coordinate system (all the while clipping to bounds if necessary). This walk up the
3352         layer hierarchy should stop at a layer associated with a UIWindow.
3353
3354         * platform/ios/wak/WAKWindow.mm:
3355         (-[WAKWindow _visibleRectRespectingMasksToBounds:]):
3356
3357 2015-04-21  Jinwoo Song  <jinwoo7.song@samsung.com>
3358
3359         [Cairo] Implement Path::addPath
3360         https://bugs.webkit.org/show_bug.cgi?id=130580
3361
3362         Reviewed by Dirk Schulze.
3363
3364         Add support for addPath method for ports using cairo.
3365         This patch is originally authored by Jae Hyun Park <jaepark@webkit.org>.
3366
3367         Test: fast/canvas/canvas-path-addPath.html
3368
3369         * platform/graphics/cairo/PathCairo.cpp:
3370         (WebCore::Path::addPath): Implement addPath for cairo.
3371
3372 2015-04-21  Tim Horton  <timothy_horton@apple.com>
3373
3374         Fix the iOS build.
3375
3376         * platform/spi/cg/CoreGraphicsSPI.h:
3377
3378 2015-04-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
3379
3380         SVGAnimateElementBase::calculateAnimatedValue() asserts when reinserting an SVG animating element within the same animation limits
3381         https://bugs.webkit.org/show_bug.cgi?id=143994
3382
3383         Reviewed by Simon Fraser.
3384
3385         Make sure the SVG animation variables are reset cleanly such that if the
3386         an