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