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