9afb0250bda8845f08be931636b716c15f947228
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-12-23  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         [SVG -> OTF Converter] Make Placeholder a move-only type
4         https://bugs.webkit.org/show_bug.cgi?id=139870
5
6         Reviewed by Anders Carlsson.
7
8         No new tests because there is no behavior change.
9
10         * svg/SVGToOTFFontConversion.cpp:
11         (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder):
12         (WebCore::SVGToOTFFontConverter::Placeholder::populate):
13         (WebCore::SVGToOTFFontConverter::Placeholder::~Placeholder):
14
15 2014-12-23  Chris Dumez  <cdumez@apple.com>
16
17         Move color CSS properties to the new StyleBuilder
18         https://bugs.webkit.org/show_bug.cgi?id=139898
19
20         Reviewed by Antti Koivisto.
21
22         Move color CSS properties to the new StyleBuilder by teaching the
23         StyleBuilder generator how to handle them.
24
25         * css/CSSPropertyNames.in:
26         - Move color properties to the new StyleBuilder.
27
28         * css/DeprecatedStyleBuilder.cpp:
29         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
30         (WebCore::defaultInitialColor): Deleted.
31         (WebCore::ApplyPropertyColor::applyInheritValue): Deleted.
32         (WebCore::ApplyPropertyColor::applyInitialValue): Deleted.
33         (WebCore::ApplyPropertyColor::applyValue): Deleted.
34         (WebCore::ApplyPropertyColor::applyColorValue): Deleted.
35         (WebCore::ApplyPropertyColor::createHandler): Deleted.
36         - Drop color properties support from the DeprecatedStyleBuilder.
37
38         * css/makeprop.pl:
39         - Teach the StyleBuilder generator how to handle color properties.
40         - Use a class for StyleBuilderFunctions instead of a namespace so
41           that it can be made a friend of RenderStyle class.
42
43         * rendering/style/RenderStyle.h:
44         - Mark StyleBuilderFunctions class as friend as its functions
45           can set RenderStyle members directly. This is similar to what
46           is already done for StyleBuilderCustom class. The new color
47           properties handling calls private methods on RenderStyle.
48         - Mark invalidColor() method as static as it does not require
49           an instance.
50
51 2014-12-23  Zalan Bujtas  <zalan@apple.com>
52
53         Incorrect dashed and dotted border painting.
54         https://bugs.webkit.org/show_bug.cgi?id=139872
55         rdar://problem/18024205
56
57         Reviewed by Simon Fraser.
58
59         This patch makes dashed/dotted border painting symmetric and consistent.
60         It also works with subpixel positioning.
61
62         Tests: fast/borders/border-painting-correctness-dashed.html
63                fast/borders/border-painting-correctness-dotted.html
64
65         * platform/graphics/cg/GraphicsContextCG.cpp:
66         (WebCore::GraphicsContext::drawLine):
67         * rendering/RenderObject.cpp:
68         (WebCore::RenderObject::drawLineForBoxSide):
69
70 2014-12-22  Chris Dumez  <cdumez@apple.com>
71
72         [iOS] Log which type of resources are commonly loaded using FeatureCounter
73         https://bugs.webkit.org/show_bug.cgi?id=139890
74
75         Reviewed by Darin Adler.
76
77         Log which type of resources are commonly loaded using FeatureCounter
78         (e.g. stylesheets, scripts, fonts, images, ...).
79
80         * loader/SubresourceLoader.cpp:
81         (WebCore::logResourceLoadedUsingFeatureCounter):
82         (WebCore::SubresourceLoader::didFinishLoading):
83         * platform/FeatureCounterKeys.h:
84
85 2014-12-22  Chris Dumez  <cdumez@apple.com>
86
87         [iOS] Log using FeatureCounter when a PacheCache fails due to memory pressure
88         https://bugs.webkit.org/show_bug.cgi?id=139874
89         <rdar://problem/19255690>
90
91         Reviewed by Darin Adler.
92
93         Log using FeatureCounter when a PacheCache fails due to memory
94         pressure. To detect this, a flag is added to HistoryItem to mark
95         items that are no longer in the page becaused they were pruned
96         (either because of a low memory handling or because the page cache
97         reached its maximum capacity).
98
99         * history/HistoryItem.cpp:
100         (WebCore::HistoryItem::HistoryItem):
101         * history/HistoryItem.h:
102         * history/PageCache.cpp:
103         (WebCore::PageCache::add):
104         (WebCore::PageCache::take):
105         (WebCore::PageCache::get):
106         (WebCore::PageCache::prune):
107         * platform/FeatureCounterKeys.h:
108
109 2014-12-22  Commit Queue  <commit-queue@webkit.org>
110
111         Unreviewed, rolling out r177658.
112         https://bugs.webkit.org/show_bug.cgi?id=139900
113
114         Caused many assertion failures (Requested by ap on #webkit).
115
116         Reverted changeset:
117
118         "Incorrect dashed and dotted border painting."
119         https://bugs.webkit.org/show_bug.cgi?id=139872
120         http://trac.webkit.org/changeset/177658
121
122 2014-12-22  Jaehun Lim  <ljaehun.lim@samsung.com>
123
124         Unreviewed build fix after r177661 and r177662
125
126         * dom/SecurityOriginPolicy.cpp: Modify #include path.
127
128 2014-12-22  Mark Rowe  <mrowe@apple.com>
129
130         [Mac] Engineering builds of WebCore on OS X 10.8 and 10.9 shouldn't build with -gline-tables-only
131         <https://webkit.org/b/139883> / <rdar://problem/19297261>
132
133         Reviewed by Alexey Proskuryakov.
134
135         * Configurations/DebugRelease.xcconfig: Override the setting using conditional settings
136         so that they take precedence over the conditional settings in Base.xcconfig.
137
138 2014-12-22  Alexey Proskuryakov  <ap@apple.com>
139
140         Unreviewed build fix.
141
142         * WebCore.exp.in: Move SQLiteDatabaseTracker::setClient export out of PLATFORM(IOS) section.
143
144 2014-12-22  Anders Carlsson  <andersca@apple.com>
145
146         Remove two functions from SecurityOrigin
147         https://bugs.webkit.org/show_bug.cgi?id=139885
148
149         Reviewed by Andreas Kling.
150
151         * page/SecurityOrigin.h:
152         (WebCore::SecurityOrigin::canAccessPasswordManager): Deleted.
153         (WebCore::SecurityOrigin::canAccessFileSystem): Deleted.
154
155 2014-12-22  Chris Dumez  <cdumez@apple.com>
156
157         [iOS] Log using FeatureCounter user-triggered zooming
158         https://bugs.webkit.org/show_bug.cgi?id=139879
159         <rdar://problem/19329130>
160
161         Reviewed by Benjamin Poulain.
162
163         Log using FeatureCounter user-triggered zooming on iOS.
164
165         * WebCore.exp.in:
166         * WebCore.xcodeproj/project.pbxproj:
167         * platform/FeatureCounter.h:
168         * platform/FeatureCounterKeys.h:
169
170 2014-12-22  Benjamin Poulain  <bpoulain@apple.com>
171
172         Form elements should match :valid and :invalid based on their associated elements
173         https://bugs.webkit.org/show_bug.cgi?id=139850
174
175         Reviewed by Darin Adler.
176
177         In the latest HTML spec, form elements can match :valid or :invalid based
178         on their associated element.
179
180         The tricky part is that object lifetime is a mess. When elements are associated
181         with forms by the parser, the form is set by the constructor of HTMLFormControlElement.
182         At that point, the real object has not been initialized yet which
183         makes it impossible to find its validity.
184
185         To work around the lifetime problem, the code of HTMLFormControlElement::didChangeForm()
186         uses m_willValidateInitialized and m_willValidate direclty instead
187         of invoking willValidate(). That way we don't try to validate an incomplete object.
188
189         When the object really validates, HTMLFormControlElement::setNeedsWillValidateCheck()
190         takes care of updating the form.
191
192         Tests: fast/css/pseudo-invalid-form-and-fieldset-basics.html
193                fast/css/pseudo-invalid-form-basics.html
194                fast/css/pseudo-invalid-form-dynamically-created-basics.html
195                fast/css/pseudo-invalid-form-invalidation-optimization.html
196                fast/css/pseudo-valid-form-and-fieldset-basics.html
197                fast/css/pseudo-valid-form-basics.html
198                fast/css/pseudo-valid-form-dynamically-created-basics.html
199                fast/css/pseudo-valid-form-invalidation-optimization.html
200                fast/selectors/invalid-form-style-update-1.html
201                fast/selectors/invalid-form-style-update-2.html
202                fast/selectors/invalid-form-style-update-3.html
203                fast/selectors/valid-form-style-update-1.html
204                fast/selectors/valid-form-style-update-2.html
205                fast/selectors/valid-form-style-update-3.html
206
207         * css/StyleResolver.cpp:
208         (WebCore::StyleResolver::canShareStyleWithControl):
209         (WebCore::StyleResolver::canShareStyleWithElement):
210         HTMLFormElement is not a FormControl, we have to generalize the test
211         for :valid/:invalid with style sharing.
212
213         * html/HTMLFormControlElement.cpp:
214         (WebCore::HTMLFormControlElement::~HTMLFormControlElement):
215         Since we now have willChangeForm(), didChangeForm(), we have to null
216         the form ourself, as documented by FormAssociatedElement.
217
218         (WebCore::HTMLFormControlElement::setNeedsWillValidateCheck):
219         (WebCore::HTMLFormControlElement::willChangeForm):
220         (WebCore::HTMLFormControlElement::didChangeForm):
221         (WebCore::HTMLFormControlElement::updateValidity):
222         Update the owner form when any of the associated form element changes
223         to invalid.
224
225         * html/HTMLFormControlElement.h:
226         * html/HTMLFormElement.cpp:
227         (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
228         (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
229         (WebCore::HTMLFormElement::matchesValidPseudoClass):
230         (WebCore::HTMLFormElement::matchesInvalidPseudoClass):
231         This is very similar to the code of fieldset, but we have much weaker
232         invariants due to the insane way FormAssociatedElement initializes.
233
234         * html/HTMLFormElement.h:
235         * html/HTMLInputElement.cpp:
236         (WebCore::HTMLInputElement::initializeInputType):
237         For completeness, we should always validate when changing the type.
238         The code was only doing that when the element was inserted into the tree,
239         that was too fragile.
240
241 2014-12-22  Anders Carlsson  <andersca@apple.com>
242
243         Try to fix the Windows build.
244
245         * dom/DOMAllInOne.cpp:
246
247 2014-12-22  Anders Carlsson  <andersca@apple.com>
248
249         Add a SecurityOriginPolicy class
250         https://bugs.webkit.org/show_bug.cgi?id=139875
251
252         Reviewed by Sam Weinig.
253
254         This is the first step towards making SecurityOrigin immutable. SecurityOriginPolicy will hold a
255         SecurityOrigin and will handle things that would otherwise mutate SecurityOrigin.
256
257         * CMakeLists.txt:
258         * WebCore.exp.in:
259         * WebCore.vcxproj/WebCore.vcxproj:
260         * WebCore.vcxproj/WebCore.vcxproj.filters:
261         * WebCore.xcodeproj/project.pbxproj:
262         * dom/DOMImplementation.cpp:
263         (WebCore::DOMImplementation::createDocument):
264         (WebCore::DOMImplementation::createHTMLDocument):
265         * dom/Document.cpp:
266         (WebCore::Document::create):
267         (WebCore::Document::open):
268         (WebCore::Document::cloneDataFromDocument):
269         (WebCore::Document::initSecurityContext):
270         * dom/ScriptExecutionContext.h:
271         * dom/SecurityContext.cpp:
272         (WebCore::SecurityContext::setSecurityOriginPolicy):
273         (WebCore::SecurityContext::securityOrigin):
274         (WebCore::SecurityContext::isSecureTransitionTo):
275         (WebCore::SecurityContext::enforceSandboxFlags):
276         (WebCore::SecurityContext::setSecurityOrigin): Deleted.
277         * dom/SecurityContext.h:
278         (WebCore::SecurityContext::securityOriginPolicy):
279         (WebCore::SecurityContext::securityOrigin): Deleted.
280         * dom/SecurityOriginPolicy.cpp: Added.
281         (WebCore::SecurityOriginPolicy::create):
282         (WebCore::SecurityOriginPolicy::SecurityOriginPolicy):
283         (WebCore::SecurityOriginPolicy::~SecurityOriginPolicy):
284         * dom/SecurityOriginPolicy.h: Added.
285         (WebCore::SecurityOriginPolicy::origin):
286         * loader/DocumentWriter.cpp:
287         (WebCore::DocumentWriter::begin):
288         * workers/WorkerGlobalScope.cpp:
289         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
290         * xml/XMLHttpRequest.cpp:
291         (WebCore::XMLHttpRequest::responseXML):
292         * xml/XMLTreeViewer.cpp:
293         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
294         * xml/XSLTProcessor.cpp:
295         (WebCore::XSLTProcessor::createDocumentFromSource):
296
297 2014-12-22  Zalan Bujtas  <zalan@apple.com>
298
299         Incorrect dashed and dotted border painting.
300         https://bugs.webkit.org/show_bug.cgi?id=139872
301         rdar://problem/18024205
302
303         Reviewed by Simon Fraser.
304
305         This patch makes dashed/dotted border painting symmetric and consistent.
306         It also works with subpixel positioning.
307
308         Tests: fast/borders/border-painting-correctness-dashed.html
309                fast/borders/border-painting-correctness-dotted.html
310
311         * platform/graphics/cg/GraphicsContextCG.cpp:
312         (WebCore::GraphicsContext::drawLine):
313         * rendering/RenderObject.cpp:
314         (WebCore::RenderObject::drawLineForBoxSide):
315
316 2014-12-22  Timothy Horton  <timothy_horton@apple.com>
317
318         TextIndicatorWindow is larger than it needs to be, especially when not bouncing
319         https://bugs.webkit.org/show_bug.cgi?id=139876
320         <rdar://problem/19311017>
321
322         Reviewed by Sam Weinig.
323
324         * page/TextIndicator.cpp:
325         (WebCore::TextIndicator::wantsBounce):
326         (WebCore::TextIndicator::wantsContentCrossfade):
327         (WebCore::TextIndicator::wantsFadeIn):
328         * page/TextIndicator.h:
329         * page/mac/TextIndicatorWindow.mm:
330         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
331         (-[WebTextIndicatorView _animationDuration]):
332         (-[WebTextIndicatorView present]):
333         (WebCore::TextIndicatorWindow::setTextIndicator):
334         (-[WebTextIndicatorView _textIndicatorWantsBounce]): Deleted.
335         (-[WebTextIndicatorView _textIndicatorWantsContentCrossfade]): Deleted.
336         (-[WebTextIndicatorView _textIndicatorWantsFadeIn]): Deleted.
337         Move the various switches over TextIndicatorPresentationTransition into TextIndicator.
338         Adjust the margin; only inflate by the shadow if we're not bouncing.
339         If we are bouncing, fix the math to more tightly fit the bounce.
340         Previously we were inflating by way too much, and even when we didn't need to.
341
342 2014-12-22  Chris Dumez  <cdumez@apple.com>
343
344         [iOS] Log using FeatureCounter when a PacheCache entry is not reused because it expired
345         https://bugs.webkit.org/show_bug.cgi?id=139869
346         <rdar://problem/19255690>
347
348         Reviewed by Darin Adler.
349
350         Log using FeatureCounter when a PacheCache entry is not reused because
351         it expired.
352
353         * history/PageCache.cpp:
354         (WebCore::PageCache::take):
355         (WebCore::PageCache::get):
356         * history/PageCache.h:
357         * loader/FrameLoader.cpp:
358         (WebCore::FrameLoader::commitProvisionalLoad):
359         (WebCore::FrameLoader::loadDifferentDocumentItem):
360         * loader/HistoryController.cpp:
361         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
362         * platform/FeatureCounterKeys.h:
363
364 2014-12-22  Antti Koivisto  <antti@apple.com>
365
366         Try to fix the windows build.
367
368         * platform/graphics/win/SimpleFontDataCGWin.cpp:
369
370 2014-12-22  Timothy Horton  <timothy_horton@apple.com>
371
372         Adjust TextIndicator shadow parameters
373         https://bugs.webkit.org/show_bug.cgi?id=139871
374         <rdar://problem/19283300>
375
376         Reviewed by Sam Weinig.
377
378         * page/mac/TextIndicatorWindow.mm:
379         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
380         Slightly adjust the shadow and bounce size.
381
382 2014-12-22  Chris Dumez  <cdumez@apple.com>
383
384         Consistently use "FeatureCounter*Key" naming for FeatureCounter keys
385         https://bugs.webkit.org/show_bug.cgi?id=139867
386
387         Reviewed by Darin Adler.
388
389         Consistently use "FeatureCounter*Key" naming for FeatureCounter keys.
390
391         * loader/FrameLoader.cpp:
392         (WebCore::logNavigationWithFeatureCounter):
393         * platform/FeatureCounterKeys.h:
394
395 2014-12-22  Antti Koivisto  <antti@apple.com>
396
397         Generic font code should not know about SVG font missing glyph
398         https://bugs.webkit.org/show_bug.cgi?id=139864
399
400         Reviewed by Andreas Kling and Myles Maxfield.
401
402         The defined missing glyph is an SVG font concept and should be handled in SVG code.
403
404         * platform/graphics/FontGlyphs.cpp:
405         (WebCore::FontGlyphs::glyphDataForSystemFallback):
406         (WebCore::FontGlyphs::glyphDataForVariant):
407
408             Return null glyph instead of the missing glyph (the missing glyph was already a null glyph in all non-svg-font cases).
409             Use early return style.
410
411         * platform/graphics/FontGlyphs.h:
412         * platform/graphics/SegmentedFontData.cpp:
413         * platform/graphics/SimpleFontData.cpp:
414         (WebCore::SimpleFontData::platformGlyphInit):
415         * platform/graphics/SimpleFontData.h:
416
417             Remove the missingGlyph member.
418
419         * platform/graphics/WidthIterator.cpp:
420         (WebCore::WidthIterator::advanceInternal):
421
422             Explicitly skip over null glyphs. Before they had non-null fontData and would get skipped implicitly.
423
424         * platform/graphics/mac/SimpleFontDataMac.mm:
425         * rendering/svg/SVGTextRunRenderingContext.cpp:
426         (WebCore::missingGlyphForFont):
427
428             Get the missing glyph from the SVG font element.
429
430         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
431
432             Return the missing glyph if the normal lookup didn't produce results.
433
434         * svg/SVGFontData.cpp:
435         (WebCore::SVGFontData::initializeFontData):
436
437 2014-12-22  Chris Dumez  <cdumez@apple.com>
438
439         Move "Auto" CSS properties to the new StyleBuilder
440         https://bugs.webkit.org/show_bug.cgi?id=139858
441
442         Reviewed by Antti Koivisto.
443
444         Move "Auto" CSS properties from DeprecatedStyleBuilder to the new
445         StyleBuilder, by adding support in the generator for using hasAutoXXX()
446         / setHasAutoXXX() methods on RenderStyle.
447
448         No new tests, no web-exposed behavior change.
449
450         * css/CSSPropertyNames.in:
451         * css/DeprecatedStyleBuilder.cpp:
452         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
453         (WebCore::ApplyPropertyAuto::setValue): Deleted.
454         (WebCore::ApplyPropertyAuto::value): Deleted.
455         (WebCore::ApplyPropertyAuto::hasAuto): Deleted.
456         (WebCore::ApplyPropertyAuto::setAuto): Deleted.
457         (WebCore::ApplyPropertyAuto::applyInheritValue): Deleted.
458         (WebCore::ApplyPropertyAuto::applyInitialValue): Deleted.
459         (WebCore::ApplyPropertyAuto::applyValue): Deleted.
460         (WebCore::ApplyPropertyAuto::createHandler): Deleted.
461         * css/StyleBuilderCustom.h:
462         (WebCore::StyleBuilderCustom::applyInitialColumnGap):
463         (WebCore::StyleBuilderCustom::applyInheritColumnGap):
464         (WebCore::StyleBuilderCustom::applyValueColumnGap):
465         * css/makeprop.pl:
466         (getNameForMethods):
467         (getAutoGetter):
468         (getAutoSetter):
469         (generateInitialValueSetter):
470         (generateInheritValueSetter):
471         (generateValueSetter):
472
473 2014-12-21  Shivakumar JM  <shiva.jm@samsung.com>
474
475         HTMLSelectElement add() should support adding group of options element (HTMLOptGroupElement).
476         https://bugs.webkit.org/show_bug.cgi?id=139806
477
478         Reviewed by Darin Adler.
479
480         HTMLSelectElement add() should support adding group of options (optgroup) element.
481
482         Test: fast/dom/HTMLSelectElement/select-add-optgroup.html
483
484         * html/HTMLSelectElement.cpp:
485         (WebCore::HTMLSelectElement::add):
486
487 2014-12-21  Chris Dumez  <cdumez@apple.com>
488
489         Fix missing assertion in r177623.
490         https://bugs.webkit.org/show_bug.cgi?id=139334
491
492         Reviewed by Darin Adler.
493
494         ValueWithCalculation::setCalculation() was meant to include an
495         "isCalculation()" assertion but I inadvertently omitted the
496         ASSERT() around the statement.
497
498         * css/CSSParser.h:
499         (WebCore::CSSParser::ValueWithCalculation::setCalculation):
500
501 2014-12-21  Gabor Rapcsanyi  <rgabor@webkit.org>
502
503         AX: Hidden aria table crash
504         https://bugs.webkit.org/show_bug.cgi?id=139856
505
506         Reviewed by Chris Fleizach.
507
508         Change axCaption to pointer and check it's value because
509         AXObjectCache::getOrCreate() can return with nullptr.
510
511         Test: accessibility/aria-hidden-crash.html
512
513         * accessibility/AccessibilityTable.cpp:
514         (WebCore::AccessibilityTable::addChildren):
515
516 2014-12-20  Chris Dumez  <cdumez@apple.com>
517
518         Get rid of error-prone ReleaseParsedCalcValueCondition argument in CSSParser
519         https://bugs.webkit.org/show_bug.cgi?id=139334
520
521         Reviewed by Darin Adler.
522
523         Get rid of error-prone ReleaseParsedCalcValueCondition argument in
524         CSSParser that determines the the m_parsedCalculation member should
525         be released.
526
527         Instead, introduce a new ValueWithCalculation type which wraps a
528         CSSParserValue and an optional parsed calculation value. This way,
529         the parsed calculation value is now associated with its CSSParserValue.
530         This makes it very difficult to use a parsed calculation value for the
531         wrong CSSParserValue. The API is also easier to use as developers no
532         longer need to explicitly indicate if the calculation value should be
533         released or not.
534
535         No new tests, no web-behavior change.
536
537 2014-12-20  Eric Carlson  <eric.carlson@apple.com>
538
539         [iOS] add optimized fullscreen API
540         https://bugs.webkit.org/show_bug.cgi?id=139833
541         <rdar://problem/18844486>
542
543         Reviewed by Simon Fraser.
544
545         * Configurations/FeatureDefines.xcconfig: Add ENABLE_VIDEO_PRESENTATION_MODE.
546
547         * Modules/mediacontrols/MediaControlsHost.cpp:
548         (WebCore::MediaControlsHost::optimizedFullscreenSupported): Deleted.
549         (WebCore::MediaControlsHost::fullscreenMode): Deleted.
550         * Modules/mediacontrols/MediaControlsHost.h:
551         * Modules/mediacontrols/MediaControlsHost.idl:
552
553         * Modules/mediacontrols/mediaControlsiOS.js:
554         (ControllerIOS.prototype.addVideoListeners): Listen for 'webkitpresentationmodechanged'.
555         (ControllerIOS.prototype.removeVideoListeners): Stop listening for 'webkitpresentationmodechanged'.
556         (ControllerIOS.prototype.configureInlineControls): Call video element instead of using the now 
557             removed host property.
558         (ControllerIOS.prototype.updateControls): Ditto.
559         (ControllerIOS.prototype.presentationMode): New, return webkitPresentationMode when possible.
560         (ControllerIOS.prototype.handleFullscreenButtonClicked): Use webkitSetPresentationMode when possible.
561         (ControllerIOS.prototype.handleOptimizedFullscreenButtonClicked): Use video element instead of 
562             using the now removed host method.
563         (ControllerIOS.prototype.handlePresentationModeChange): New, react to presentation mode changes.
564         (ControllerIOS.prototype.handleFullscreenChange): Call handlePresentationModeChange.
565
566         * dom/EventNames.h: Add webkitpresentationmodechanged.
567
568         * html/HTMLAttributeNames.in: Add onwebkitpresentationmodechanged.
569
570         * html/HTMLMediaElement.cpp:
571         (WebCore::HTMLMediaElement::enterFullscreen): Early return when asked to change to the current 
572             mode. Call fullscreenModeChanged() instead of whacking the instance variable directly.
573         (WebCore::HTMLMediaElement::exitFullscreen): Ditto.
574         * html/HTMLMediaElement.h:
575         (WebCore::HTMLMediaElement::fullscreenModeChanged): Make virtual.
576
577         * html/HTMLVideoElement.cpp:
578         (WebCore::HTMLVideoElement::parseAttribute): Deal with onwebkitpresentationmodechange.
579         (WebCore::presentationModeFullscreen): New.
580         (WebCore::presentationModeOptimized): Ditto.
581         (WebCore::presentationModeInline): Ditto.
582         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Ditto.
583         (WebCore::HTMLVideoElement::webkitSetPresentationMode): Ditto.
584         (WebCore::HTMLVideoElement::webkitPresentationMode): Ditto.
585         (WebCore::HTMLVideoElement::fullscreenModeChanged): Ditto.
586         * html/HTMLVideoElement.h:
587         * html/HTMLVideoElement.idl:
588
589         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
590         (WebVideoFullscreenInterfaceAVKit::setIsOptimized): Simplify the logic a bit. Don't report
591             a mode change when 
592
593 2014-12-20  David Kilzer  <ddkilzer@apple.com>
594
595         Switch from using PLATFORM_NAME to SDK selectors in WebCore, WebInspectorUI, WebKit, WebKit2
596         <http://webkit.org/b/139463>
597
598         Reviewed by Mark Rowe.
599
600         Also remove all uses of SQLITE3_HEADER_SEARCH_PATHS and
601         WEBCORE_SQLITE3_HEADER_SEARCH_PATHS which were phased out in
602         r132859 and needed for Leopard.
603
604         * Configurations/Base.xcconfig:
605         - Only set GCC_ENABLE_OBJC_GC, GCC_MODEL_TUNING and TOOLCHAINS
606           on OS X.
607         - Set GCC_OPTIMIZATION_LEVEL_normal based on SDK.
608         - Simplify SQLITE3_HEADER_SEARCH_PATHS.
609         * Configurations/DebugRelease.xcconfig:
610         - Only set MACOSX_DEPLOYMENT_TARGET and SDKROOT on OS X.
611         * Configurations/Version.xcconfig:
612         - Set SYSTEM_VERSION_PREFIX separately for iOS and OS X.
613         * Configurations/WebCore.xcconfig:
614         - Set EXPORTED_SYMBOLS_FILE_i386, EXPORTED_SYMBOLS_FILE_x86_64,
615           FRAMEWORK_SEARCH_PATHS, INSTALL_PATH, DYLIB_INSTALL_NAME_BASE,
616           OTHER_LDFLAGS, SECTORDER_FLAGS, NORMAL_WEBCORE_FRAMEWORKS_DIR,
617           WEBCORE_FRAMEWORKS_DIR, NORMAL_PRODUCTION_FRAMEWORKS_DIR,
618           PRODUCTION_FRAMEWORKS_DIR,
619           JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production and
620           EXCLUDED_SOURCE_FILE_NAMES based on SDK.
621         - Make sure DYLIB_INSTALL_NAME_BASE and OTHER_LDFLAGS are
622           overrideable by WebCoreTestSupport.xcconfig.
623         * Configurations/WebCoreTestSupport.xcconfig:
624         - Set PRIVATE_HEADERS_FOLDER_PATH_Production and
625           INSTALL_PATH_Production based on SDK.
626         - Override SECT_ORDER_FLAGS from WebCore.xcconfig.
627
628 2014-12-19  Myles C. Maxfield  <mmaxfield@apple.com>
629
630         [SVG -> OTF Converter] Make placeholders more robust
631         https://bugs.webkit.org/show_bug.cgi?id=139836
632
633         Reviewed by Dan Bernstein.
634
635         This patch creates a Placeholder object which hides the complexity of
636         populating offsets to subtables.
637
638         No new tests because there is no behavior change.
639
640         * svg/SVGToOTFFontConversion.cpp:
641         (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder):
642         (WebCore::SVGToOTFFontConverter::Placeholder::populate):
643         (WebCore::SVGToOTFFontConverter::Placeholder::~Placeholder):
644         (WebCore::SVGToOTFFontConverter::appendArabicReplacementSubtable):
645         (WebCore::SVGToOTFFontConverter::appendGSUBTable):
646
647 2014-12-19  Chris Dumez  <cdumez@apple.com>
648
649         Fix initial / inherit support for '-webkit-perspective-origin' CSS property
650         https://bugs.webkit.org/show_bug.cgi?id=139843
651
652         Reviewed by Simon Fraser.
653
654         Fix initial / inherit support for '-webkit-perspective-origin' CSS
655         property. These previously had no effect.
656
657         This patch updates the code to be consistent with
658         '-webkit-transform-origin' and gets rid of the code in
659         DeprecatedStyleBuilder as it isn't used.
660
661         Test: fast/css/perspective-origin-initial-inherit.html
662
663         * css/DeprecatedStyleBuilder.cpp:
664         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
665         (WebCore::ApplyPropertyPerspectiveOrigin::applyInheritValue): Deleted.
666         (WebCore::ApplyPropertyPerspectiveOrigin::applyInitialValue): Deleted.
667         (WebCore::ApplyPropertyPerspectiveOrigin::applyValue): Deleted.
668         (WebCore::ApplyPropertyPerspectiveOrigin::createHandler): Deleted.
669         * css/StyleProperties.cpp:
670         (WebCore::StyleProperties::getPropertyValue):
671         (WebCore::StyleProperties::asText):
672         * css/StylePropertyShorthand.cpp:
673         (WebCore::webkitPerspectiveOriginShorthand):
674         (WebCore::shorthandForProperty):
675         (WebCore::matchingShorthandsForLonghand):
676         * css/StylePropertyShorthand.h:
677         * css/StyleResolver.cpp:
678         (WebCore::StyleResolver::applyProperty):
679
680 2014-12-19  Commit Queue  <commit-queue@webkit.org>
681
682         Unreviewed, rolling out r177599.
683         https://bugs.webkit.org/show_bug.cgi?id=139846
684
685         this breaks so many things (Requested by thorton_ on #webkit).
686
687         Reverted changeset:
688
689         "TextIndicator's window can be pushed down if it intersects
690         the menu bar"
691         https://bugs.webkit.org/show_bug.cgi?id=139841
692         http://trac.webkit.org/changeset/177599
693
694 2014-12-19  Timothy Horton  <timothy_horton@apple.com>
695
696         TextIndicator's window can be pushed down if it intersects the menu bar
697         https://bugs.webkit.org/show_bug.cgi?id=139841
698         <rdar://problem/19311017>
699
700         Reviewed by Anders Carlsson.
701
702         * page/mac/TextIndicatorWindow.mm:
703         (WebCore::TextIndicatorWindow::setTextIndicator):
704         Ensure that the textIndicatorWindow sits above the menubar, and re-set
705         its frame so that it moves under the menubar if required.
706
707 2014-12-19  Anders Carlsson  <andersca@apple.com>
708
709         Use WebCore::MachSendRights for the compositing render server port
710         https://bugs.webkit.org/show_bug.cgi?id=139834
711
712         Reviewed by Tim Horton.
713
714         * WebCore.exp.in:
715
716 2014-12-19  Chris Dumez  <cdumez@apple.com>
717
718         [iOS] Log how often media element playback happens using FeatureCounter
719         https://bugs.webkit.org/show_bug.cgi?id=139819
720         <rdar://problem/19309988>
721
722         Reviewed by Eric Carlson.
723
724         Log using FeatureCounter how often we start loading for audio / video
725         elements, and how often they end up being played.
726
727         * html/HTMLMediaElement.cpp:
728         (WebCore::HTMLMediaElement::HTMLMediaElement):
729         Add flag to identify when a media element starts playing for the first
730         time.
731
732         (WebCore::HTMLMediaElement::loadResource):
733         Log when a media element starts loading.
734
735         (WebCore::HTMLMediaElement::updatePlayState):
736         Log when a media element starts playing for the first time.
737
738         * html/HTMLMediaElement.h:
739         Add flag to identify when a media element starts playing for the first
740         time.
741
742         * platform/FeatureCounterKeys.h:
743         Add FeatureCounter keys for HTMLMediaElement loading / playback.
744
745 2014-12-19  Andreas Kling  <akling@apple.com>
746
747         Ref-ify TextIterator API.
748         <https://webkit.org/b/139823>
749
750         Reviewed by Antti Koivisto.
751
752         Change TextIterator functions that always return Range objects to return
753         Ref<Range> instead of PassRefPtr<Range>.
754
755         One API (rangeFromLocationAndLength) may return nullptr, so its return type
756         is now RefPtr<Range>.
757
758         * editing/TextIterator.cpp:
759         (WebCore::TextIterator::range):
760         (WebCore::TextIterator::node):
761         (WebCore::SimplifiedBackwardsTextIterator::range):
762         (WebCore::CharacterIterator::range):
763         (WebCore::characterSubrange):
764         (WebCore::BackwardsCharacterIterator::range):
765         (WebCore::TextIterator::subrange):
766         (WebCore::TextIterator::rangeFromLocationAndLength):
767         (WebCore::TextIterator::getLocationAndLengthFromRange):
768         (WebCore::collapsedToBoundary):
769         (WebCore::findPlainText):
770         * editing/TextIterator.h:
771
772 2014-12-19  Joseph Pecoraro  <pecoraro@apple.com>
773
774         Web Inspector: CRASH in inspector-protocol/debugger/terminate-dedicated-worker-while-paused.html
775         https://bugs.webkit.org/show_bug.cgi?id=139792
776
777         Reviewed by Timothy Hatcher.
778
779         * bindings/js/WorkerScriptDebugServer.cpp:
780         (WebCore::WorkerScriptDebugServer::removeListener):
781         When removing listeners, we could be during WorkerGlobalObject shutdown
782         and WorkerGlobalObject::script may be null.
783
784         * workers/WorkerMessagingProxy.cpp:
785         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
786         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
787         This postTask may happen after m_pageInspector has been cleared, so
788         only execute it if m_pageInspector is still valid.
789
790 2014-12-19  Chris Dumez  <cdumez@apple.com>
791
792         Drop useless HTMLMediaElement::m_previousProgress member
793         https://bugs.webkit.org/show_bug.cgi?id=139822
794
795         Reviewed by Eric Carlson.
796
797         Drop HTMLMediaElement::m_previousProgress member and it is not used or
798         even initialized.
799
800         * html/HTMLMediaElement.h:
801
802 2014-12-19  Chris Dumez  <cdumez@apple.com>
803
804         [iOS] Log how successful the memory cache is using FeatureCounter
805         https://bugs.webkit.org/show_bug.cgi?id=139802
806
807         Reviewed by Andreas Kling.
808
809         Log how successful the memory cache is using FeatureCounter and why we
810         choose not to use the resource in the memory cache when it is present.
811
812         * loader/cache/CachedResourceLoader.cpp:
813         (WebCore::CachedResourceLoader::requestResource):
814         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
815         * platform/FeatureCounterKeys.h:
816
817 2014-12-19  Commit Queue  <commit-queue@webkit.org>
818
819         Unreviewed, rolling out r177574.
820         https://bugs.webkit.org/show_bug.cgi?id=139821
821
822         "Broke Production builds by installing
823         libWebCoreTestSupport.dylib in the wrong directory" (Requested
824         by ddkilzer on #webkit).
825
826         Reverted changeset:
827
828         "Switch from using PLATFORM_NAME to SDK selectors in WebCore,
829         WebInspectorUI, WebKit, WebKit2"
830         https://bugs.webkit.org/show_bug.cgi?id=139463
831         http://trac.webkit.org/changeset/177574
832
833 2014-12-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
834
835         Only when the SVG is inline and only when a shape is referenced before it is defined, this shape will not be drawn.
836         https://bugs.webkit.org/show_bug.cgi?id=139451.
837
838         Reviewed by Antti Koivisto.
839
840         Tests: svg/in-html/defs-after-use.html.
841
842         When parsing the children of an SVG element is finished, we need to notify the
843         other SVG elements which have incomplete shadow trees because of early referencing
844         to this element. The referencing elements need to rebuild their shadow trees and
845         make new copies of the this element and its sub-tree.
846         
847         This is the case where a <use> tag references target elements before these target
848         elements are defined. Updating the shadow DOM tree of a <use> element should update
849         the corresponding shadow render tree as well.
850
851         * svg/SVGElement.cpp:
852         (WebCore::SVGElement::finishParsingChildren):
853         Invalidate all the referencing elements of a target element whose sub-tree has
854         just finished parsing.
855
856 2014-12-19  David Kilzer  <ddkilzer@apple.com>
857
858         Switch from using PLATFORM_NAME to SDK selectors in WebCore, WebInspectorUI, WebKit, WebKit2
859         <http://webkit.org/b/139463>
860
861         Reviewed by Mark Rowe.
862
863         Also remove all uses of SQLITE3_HEADER_SEARCH_PATHS and
864         WEBCORE_SQLITE3_HEADER_SEARCH_PATHS which were phased out in
865         r132859 and needed for Leopard.
866
867         * Configurations/Base.xcconfig:
868         - Only set GCC_ENABLE_OBJC_GC, GCC_MODEL_TUNING and TOOLCHAINS
869           on OS X.
870         - Set GCC_OPTIMIZATION_LEVEL_normal based on SDK.
871         - Simplify SQLITE3_HEADER_SEARCH_PATHS.
872         * Configurations/DebugRelease.xcconfig:
873         - Only set MACOSX_DEPLOYMENT_TARGET and SDKROOT on OS X.
874         * Configurations/Version.xcconfig:
875         - Set SYSTEM_VERSION_PREFIX separately for iOS and OS X.
876         * Configurations/WebCore.xcconfig:
877         - Set EXPORTED_SYMBOLS_FILE_i386, EXPORTED_SYMBOLS_FILE_x86_64,
878           FRAMEWORK_SEARCH_PATHS, INSTALL_PATH, DYLIB_INSTALL_NAME_BASE,
879           OTHER_LDFLAGS, SECTORDER_FLAGS, NORMAL_WEBCORE_FRAMEWORKS_DIR,
880           WEBCORE_FRAMEWORKS_DIR, NORMAL_PRODUCTION_FRAMEWORKS_DIR,
881           PRODUCTION_FRAMEWORKS_DIR,
882           JAVASCRIPTCORE_PRIVATE_HEADERS_DIR_Production and
883           EXCLUDED_SOURCE_FILE_NAMES based on SDK.
884         - Make sure DYLIB_INSTALL_NAME_BASE and OTHER_LDFLAGS are
885           overrideable by WebCoreTestSupport.xcconfig.
886         * Configurations/WebCoreTestSupport.xcconfig:
887         - Set PRIVATE_HEADERS_FOLDER_PATH_Production and
888           INSTALL_PATH_Production based on SDK.
889         - Override SECT_ORDER_FLAGS from WebCore.xcconfig.
890
891 2014-12-19  Chris Dumez  <cdumez@apple.com>
892
893         Clean up StyleBuilderCustom and DeprecatedStyleBuilder
894         https://bugs.webkit.org/show_bug.cgi?id=139807
895
896         Reviewed by Antti Koivisto.
897
898         Clean up StyleBuilderCustom and DeprecatedStyleBuilder.
899
900         * css/DeprecatedStyleBuilder.cpp:
901
902         - Remove unnecessary header includes.
903
904         (WebCore::ApplyPropertyPerspectiveOrigin::applyInheritValue):
905         (WebCore::ApplyPropertyPerspectiveOrigin::applyInitialValue):
906         (WebCore::ApplyPropertyPerspectiveOrigin::applyValue):
907         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
908         (WebCore::ApplyPropertyExpanding::applyInheritValue): Deleted.
909         (WebCore::ApplyPropertyExpanding::applyInitialValue): Deleted.
910         (WebCore::ApplyPropertyExpanding::applyValue): Deleted.
911         (WebCore::ApplyPropertyExpanding::createHandler): Deleted.
912
913         - Rename ApplyPropertyExpanding to ApplyPropertyPerspectiveOrigin as
914           PerspectiveOrigin is the only remaining user of this class. This also
915           allows us to simplify the implementation a lot.
916
917         (WebCore::ApplyPropertyDefaultBase::setValue): Deleted.
918         (WebCore::ApplyPropertyDefaultBase::value): Deleted.
919         (WebCore::ApplyPropertyDefaultBase::initial): Deleted.
920         (WebCore::ApplyPropertyDefaultBase::applyInheritValue): Deleted.
921         (WebCore::ApplyPropertyDefaultBase::applyInitialValue): Deleted.
922         (WebCore::ApplyPropertyDefaultBase::applyValue): Deleted.
923
924         - There is no longer any user of this templated class.
925
926         * css/StyleBuilderCustom.h:
927
928         - Introduce a macro that declares all 3 handlers (inherit, initial and
929           value) in the StyleBuilderCustom class. This greatly reduces the
930           number of lines in this class.
931         - Also alphabetize the handlers.
932
933 2014-12-18  Jeremy Jones  <jeremyj@apple.com>
934
935         dispatch to main thread before accessing playerController() in WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse
936         https://bugs.webkit.org/show_bug.cgi?id=139809
937
938         Reviewed by Dan Bernstein.
939
940         This prevents a race in playerController().
941
942         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
943         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
944
945 2014-12-18  Jessie Berlin  <jberlin@webkit.org>
946
947         More speculative build fixing.
948
949         * WebCore.exp.in:
950
951 2014-12-18  Andreas Kling  <akling@apple.com>
952
953         Ref-ify various Document-related things.
954         <https://webkit.org/b/139796>
955
956         Reviewed by Anders Carlsson.
957
958         * bindings/objc/DOMHTML.mm:
959         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
960         * dom/CDATASection.cpp:
961         (WebCore::CDATASection::create):
962         (WebCore::CDATASection::virtualCreate):
963         * dom/CDATASection.h:
964         * dom/Comment.cpp:
965         (WebCore::Comment::create):
966         * dom/Comment.h:
967         * dom/Document.cpp:
968         (WebCore::Document::create):
969         (WebCore::Document::createDocumentFragment):
970         (WebCore::Document::createTextNode):
971         (WebCore::Document::createComment):
972         (WebCore::Document::createEditingTextNode):
973         (WebCore::Document::createCSSStyleDeclaration):
974         (WebCore::Document::createElement):
975         (WebCore::Document::createRange):
976         (WebCore::Document::createParser):
977         (WebCore::Document::cloneNodeInternal):
978         (WebCore::Document::cloneDocumentWithoutChildren):
979         * dom/Document.h:
980         (WebCore::Document::create):
981         (WebCore::Document::createXHTML):
982         (WebCore::Document::createNonRenderedPlaceholder):
983         * dom/DocumentFragment.cpp:
984         (WebCore::DocumentFragment::create):
985         * dom/DocumentFragment.h:
986         * dom/DocumentType.h:
987         * dom/EntityReference.cpp:
988         (WebCore::EntityReference::create):
989         * dom/EntityReference.h:
990         * dom/Text.cpp:
991         (WebCore::Text::create):
992         (WebCore::Text::createEditingText):
993         (WebCore::Text::splitText):
994         (WebCore::Text::virtualCreate):
995         (WebCore::Text::createWithLengthLimit):
996         * dom/Text.h:
997         * editing/markup.cpp:
998         (WebCore::replaceChildrenWithText):
999         * html/FTPDirectoryDocument.cpp:
1000         (WebCore::FTPDirectoryDocument::createParser):
1001         * html/FTPDirectoryDocument.h:
1002         * html/HTMLDocument.cpp:
1003         (WebCore::HTMLDocument::createParser):
1004         (WebCore::HTMLDocument::cloneDocumentWithoutChildren):
1005         * html/HTMLDocument.h:
1006         (WebCore::HTMLDocument::create):
1007         (WebCore::HTMLDocument::createSynthesizedDocument):
1008         * html/ImageDocument.cpp:
1009         (WebCore::ImageDocument::createParser):
1010         * html/ImageDocument.h:
1011         * html/MediaDocument.cpp:
1012         (WebCore::MediaDocument::createParser):
1013         * html/MediaDocument.h:
1014         * html/PluginDocument.cpp:
1015         (WebCore::PluginDocument::createParser):
1016         * html/PluginDocument.h:
1017         * html/TextDocument.cpp:
1018         (WebCore::TextDocument::createParser):
1019         * html/TextDocument.h:
1020         * html/parser/HTMLConstructionSite.cpp:
1021         (WebCore::HTMLConstructionSite::insertTextNode):
1022         * html/parser/HTMLDocumentParser.h:
1023         (WebCore::HTMLDocumentParser::create):
1024         * loader/SinkDocument.cpp:
1025         (WebCore::SinkDocument::createParser):
1026         * loader/SinkDocument.h:
1027         * svg/SVGDocument.cpp:
1028         (WebCore::SVGDocument::cloneDocumentWithoutChildren):
1029         * svg/SVGDocument.h:
1030         * xml/parser/XMLDocumentParser.h:
1031         (WebCore::XMLDocumentParser::create):
1032         * xml/parser/XMLDocumentParserLibxml2.cpp:
1033         (WebCore::XMLParserContext::createStringParser):
1034         (WebCore::XMLParserContext::createMemoryParser):
1035
1036 2014-12-18  Anders Carlsson  <andersca@apple.com>
1037
1038         Use MachSendRight in WebKit2
1039         https://bugs.webkit.org/show_bug.cgi?id=139800
1040
1041         Reviewed by Tim Horton.
1042
1043         * WebCore.exp.in:
1044         * platform/cocoa/MachSendRight.h:
1045         (WebCore::MachSendRight::MachSendRight):
1046         (WebCore::MachSendRight::sendRight):
1047         * platform/graphics/cocoa/IOSurface.h:
1048         * platform/graphics/cocoa/IOSurface.mm:
1049         (IOSurface::createFromSendRight):
1050         (IOSurface::createFromMachPort): Deleted.
1051
1052 2014-12-18  Gavin Barraclough  <barraclough@apple.com>
1053
1054         Add strong typing to RefCounter interface, return value as a bool.
1055         https://bugs.webkit.org/show_bug.cgi?id=139776
1056
1057         Reviewed by Geoff Garen.
1058
1059         Currently all token vended by a RefCounter have the same type - Ref<RefCounter::Count>.
1060         This means there is no compile time type checking to prevent mistakes. Update the count()
1061         method to token<>(), templated on type used to identify the token being returned.
1062         Calls to token<T>() will return a result of type RefCounter::Token<T>.
1063
1064         There are a few problems with the fact the counter will return you an exact count of the
1065         number of outstanding tokens:
1066           - It is desirable to only fire the callback on zero-edge changes; it is more consistent
1067             to do so if the value is only readable as a boolean.
1068           - It is desirable to provide the value as an argument to the callback, however to make
1069             this useful for integer values it is also necessary to indicate the direction of change
1070             (0->1 is often interesting where 2->1 is not).
1071           - There is a mismatch between the precision of returning a count, and the inherent
1072             imprecision of a token based mechanism, where it may be difficult to guarantee
1073             absolutely no unnecessary refcount churn, and thus unintentional counter values.
1074
1075         * page/PageThrottler.cpp:
1076         (WebCore::m_mediaActivityCounter):
1077         (WebCore::m_pageLoadActivityCounter):
1078             - lambdas now passed the value.
1079         (WebCore::PageThrottler::mediaActivityToken):
1080         (WebCore::PageThrottler::pageLoadActivityToken):
1081             - count() -> token<>().
1082         * page/PageThrottler.h:
1083             - specify tpoken type for PageActivityAssertionToken.
1084
1085 2014-12-18  Benjamin Poulain  <bpoulain@apple.com>
1086
1087         HTMLFormControlElement and HTMLObjectElement need not to look for an ancestor on construction
1088         https://bugs.webkit.org/show_bug.cgi?id=139791
1089
1090         Reviewed by Alexey Proskuryakov.
1091
1092         The objects are being constructed, they have not been inserted into the tree yet.
1093         There is not chance of finding the owner form at this point,
1094         that is done when inserting the node into the tree.
1095
1096         * html/HTMLFormControlElement.cpp:
1097         (WebCore::HTMLFormControlElement::HTMLFormControlElement):
1098         * html/HTMLObjectElement.cpp:
1099         (WebCore::HTMLObjectElement::HTMLObjectElement):
1100
1101 2014-12-18  Chris Fleizach  <cfleizach@apple.com>
1102
1103         AX: Recursive crash at WebCore::accessibleNameForNode
1104         https://bugs.webkit.org/show_bug.cgi?id=139616
1105
1106         Reviewed by Mario Sanchez Prada.
1107
1108         An image that uses aria-labelledby to reference its own parent can lead to a recursion crash.
1109         There needs to be some information we can pass through these methods to ensure we don't hit this case.
1110
1111         Test: accessibility/accessibility-description-crash.html
1112
1113         * accessibility/AccessibilityNodeObject.cpp:
1114         (WebCore::AccessibilityNodeObject::alternativeText):
1115         (WebCore::AccessibilityNodeObject::textUnderElement):
1116         (WebCore::accessibleNameForNode):
1117         (WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements):
1118         * accessibility/AccessibilityObject.h:
1119         (WebCore::AccessibilityTextUnderElementMode::AccessibilityTextUnderElementMode):
1120
1121 2014-12-18  Chris Fleizach  <cfleizach@apple.com>
1122
1123         AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an element with any explicit ARIA role, including presentation.
1124         https://bugs.webkit.org/show_bug.cgi?id=133613
1125
1126         Reviewed by Mario Sanchez Prada.
1127
1128         This adds a heuristic to avoid a problem we have where too many objects that say they respond to press actions for accessibility.
1129         It results from people installing click handlers on container nodes and then lots of static text objects are "clickable" in the eyes of VoiceOver.
1130
1131         What we can do is avoid this determination if the element is presentational.
1132
1133         Test: platform/mac/accessibility/press-action-for-presentational-descendants.html
1134
1135         * accessibility/AccessibilityObject.cpp:
1136         (WebCore::nodeHasPresentationRole):
1137         (WebCore::AccessibilityObject::supportsPressAction):
1138         * accessibility/AccessibilityObject.h:
1139         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1140         (-[WebAccessibilityObjectWrapper accessibilityActionNames]):
1141
1142 2014-12-18  Chris Fleizach  <cfleizach@apple.com>
1143
1144         AX: event.target should sometimes be a descendant element on AXPress-triggered mouse clicks
1145         https://bugs.webkit.org/show_bug.cgi?id=135689
1146
1147         Reviewed by Mario Sanchez Prada.
1148
1149         When trying to find the right sub-node to target, we need to go back up the parent chain to find 
1150         an Element, in case we land on a Text node for example.
1151
1152         Test: accessibility/press-target-uses-text-descendant-node.html
1153
1154         * accessibility/AccessibilityObject.cpp:
1155         (WebCore::AccessibilityObject::press):
1156
1157 2014-12-16  Sam Weinig  <sam@webkit.org>
1158
1159         Unify the Mac and iOS implementations of FontPlatformData a bit
1160         https://bugs.webkit.org/show_bug.cgi?id=139721
1161
1162         Reviewed by Anders Carlsson.
1163
1164         This is a first pass of unifying the Mac and iOS implementations of FontPlatformData.
1165         Notable changes:
1166         - Change the storage of the platform font to be CTFontRef across the board. Adds NSFont
1167           setter/getter/constructor as a temporary measures during the transition away from NSFont.
1168         - Removes duplicate code that only differed by whether the type was NSFont or CTFontRef.
1169         - Reduces the number of #ifdefs.
1170
1171         * platform/graphics/FontPlatformData.cpp:
1172         (WebCore::FontPlatformData::FontPlatformData):
1173         (WebCore::FontPlatformData::operator=):
1174         (WebCore::FontPlatformData::openTypeTable): Deleted.
1175         * platform/graphics/FontPlatformData.h:
1176         (WebCore::FontPlatformData::nsFont):
1177         (WebCore::FontPlatformData::setNSFont):
1178         (WebCore::FontPlatformData::hash):
1179         (WebCore::FontPlatformData::operator==):
1180         (WebCore::FontPlatformData::isHashTableDeletedValue):
1181         (WebCore::toCTFontRef): Deleted.
1182         (WebCore::FontPlatformData::font): Deleted.
1183         (WebCore::FontPlatformData::roundsGlyphAdvances): Deleted.
1184         (WebCore::FontPlatformData::cgFont): Deleted.
1185         (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
1186         * platform/graphics/SimpleFontData.h:
1187         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1188         (WebCore::FontPlatformData::FontPlatformData):
1189         (WebCore::FontPlatformData::~FontPlatformData):
1190         (WebCore::FontPlatformData::platformDataInit):
1191         (WebCore::FontPlatformData::platformDataAssign):
1192         (WebCore::FontPlatformData::setFont):
1193         (WebCore::FontPlatformData::roundsGlyphAdvances):
1194         (WebCore::FontPlatformData::allowsLigatures):
1195         (WebCore::FontPlatformData::ctFont):
1196         (WebCore::FontPlatformData::openTypeTable):
1197         (WebCore::FontPlatformData::loadFont): Deleted.
1198         * platform/graphics/mac/FontCacheMac.mm:
1199         (WebCore::FontCache::systemFallbackForCharacters):
1200         * platform/graphics/mac/FontMac.mm:
1201         (WebCore::Font::drawGlyphs):
1202         * platform/graphics/mac/SimpleFontDataMac.mm:
1203         (WebCore::SimpleFontData::getCompositeFontReferenceFontData):
1204         (WebCore::SimpleFontData::platformInit):
1205         (WebCore::SimpleFontData::platformCreateScaledFontData):
1206         (WebCore::SimpleFontData::containsCharacters):
1207         (WebCore::SimpleFontData::determinePitch):
1208         (WebCore::SimpleFontData::renderingStyle):
1209         (WebCore::SimpleFontData::advanceForColorBitmapFont):
1210
1211 2014-12-18  Anders Carlsson  <andersca@apple.com>
1212
1213         Build fix.
1214
1215         * platform/cocoa/MachSendRight.cpp:
1216
1217 2014-12-18  Timothy Horton  <timothy_horton@apple.com>
1218
1219         Change page preview loading order, and add a TextIndicator
1220         https://bugs.webkit.org/show_bug.cgi?id=139793
1221         <rdar://problem/19288547>
1222
1223         Reviewed by Beth Dakin.
1224
1225         * WebCore.exp.in:
1226         * platform/spi/mac/NSPopoverSPI.h:
1227         Add an export and some SPI.
1228
1229 2014-12-18  Anders Carlsson  <andersca@apple.com>
1230
1231         Clean up MachSendRight and add a copySendRight member function
1232         https://bugs.webkit.org/show_bug.cgi?id=139788
1233
1234         Reviewed by Tim Horton.
1235
1236         * platform/cocoa/MachSendRight.cpp:
1237         (WebCore::retainSendRight):
1238         (WebCore::releaseSendRight):
1239         Use mach_error_string.
1240
1241         (WebCore::MachSendRight::copySendRight):
1242         Create a new send right with the given mach port.
1243
1244         (WebCore::MachSendRight::leakSendRight):
1245         Use std::exchange.
1246
1247         * platform/cocoa/MachSendRight.h:
1248
1249 2014-12-18  Joseph Pecoraro  <pecoraro@apple.com>
1250
1251         Web Inspector: ASSERT seen closing/opening multiple inspectors
1252         https://bugs.webkit.org/show_bug.cgi?id=139783
1253
1254         Reviewed by Timothy Hatcher.
1255
1256         * inspector/InspectorDOMAgent.cpp:
1257         (WebCore::InspectorDOMAgent::nodeForObjectId):
1258
1259 2014-12-18  Anders Carlsson  <andersca@apple.com>
1260
1261         Add a MachSendRight class to WebCore and use it in IOSurface
1262         https://bugs.webkit.org/show_bug.cgi?id=139787
1263
1264         Reviewed by Tim Horton.
1265
1266         * WebCore.exp.in:
1267         * WebCore.xcodeproj/project.pbxproj:
1268         * platform/cocoa/MachSendRight.cpp: Added.
1269         (WebCore::retainSendRight):
1270         (WebCore::releaseSendRight):
1271         (WebCore::MachSendRight::adopt):
1272         (WebCore::MachSendRight::create):
1273         (WebCore::MachSendRight::MachSendRight):
1274         (WebCore::MachSendRight::~MachSendRight):
1275         (WebCore::MachSendRight::operator=):
1276         (WebCore::MachSendRight::leakSendRight):
1277         * platform/cocoa/MachSendRight.h: Added.
1278         * platform/graphics/cocoa/IOSurface.h:
1279         * platform/graphics/cocoa/IOSurface.mm:
1280         (IOSurface::createSendRight):
1281         (IOSurface::createMachPort): Deleted.
1282
1283 2014-12-18  Andreas Kling  <akling@apple.com>
1284
1285         Ref-ify DOMSettableTokenList.
1286         <https://webkit.org/b/139785>
1287
1288         Reviewed by Chris Dumez.
1289
1290         Make DOMSettableTokenList::create() return a Ref, and have its two client
1291         elements store it in a Ref instead of a RefPtr (and fix their getter API
1292         to return references.)
1293
1294         * html/DOMSettableTokenList.cpp:
1295         (WebCore::DOMSettableTokenList::create): Deleted.
1296         * html/DOMSettableTokenList.h:
1297         * html/HTMLLinkElement.cpp:
1298         (WebCore::HTMLLinkElement::sizes): Deleted.
1299         * html/HTMLLinkElement.h:
1300         * html/HTMLOutputElement.cpp:
1301         (WebCore::HTMLOutputElement::htmlFor): Deleted.
1302         * html/HTMLOutputElement.h:
1303
1304 2014-12-18  Andreas Kling  <akling@apple.com>
1305
1306         Ref-ify ClientRectList.
1307         <https://webkit.org/b/139780>
1308
1309         Reviewed by Anders Carlsson.
1310
1311         Make the ClientRectList::create() helpers return Ref, along with a bunch
1312         of other functions that always return non-null ClientRectLists.
1313
1314         Also make ClientRectList store a Vector<Ref<ClientRect>> internally since
1315         entries in the Vector are never null.
1316
1317         * dom/ClientRectList.cpp:
1318         (WebCore::ClientRectList::item):
1319         * dom/ClientRectList.h:
1320         (WebCore::ClientRectList::create):
1321         * dom/Element.cpp:
1322         (WebCore::Element::getClientRects):
1323         * dom/Element.h:
1324         * dom/Range.cpp:
1325         (WebCore::Range::getClientRects):
1326         * dom/Range.h:
1327         * page/Page.cpp:
1328         (WebCore::Page::nonFastScrollableRects):
1329         * page/Page.h:
1330         * testing/Internals.cpp:
1331         (WebCore::Internals::inspectorHighlightRects):
1332         (WebCore::Internals::nonFastScrollableRects):
1333         * testing/Internals.h:
1334
1335 2014-12-18  Andreas Kling  <akling@apple.com>
1336
1337         Ref-ify ClientRect.
1338         <https://webkit.org/b/139777>
1339
1340         Reviewed by Anders Carlsson.
1341
1342         Make the ClientRect::create() helpers return Ref, along with a bunch
1343         of other functions that always return non-null ClientRects.
1344
1345         * dom/ClientRect.h:
1346         (WebCore::ClientRect::create):
1347         * dom/Element.cpp:
1348         (WebCore::Element::getBoundingClientRect):
1349         * dom/Element.h:
1350         * dom/Range.cpp:
1351         (WebCore::Range::getBoundingClientRect):
1352         * dom/Range.h:
1353         * html/track/VTTRegion.cpp:
1354         (WebCore::VTTRegion::displayLastTextTrackCueBox):
1355         * testing/Internals.cpp:
1356         (WebCore::Internals::absoluteCaretBounds):
1357         (WebCore::Internals::boundingBox):
1358         (WebCore::Internals::selectionBounds):
1359         * testing/Internals.h:
1360
1361 2014-12-18  Chris Dumez  <cdumez@apple.com>
1362
1363         [iOS] Log navigation types using FeatureCounter API
1364         https://bugs.webkit.org/show_bug.cgi?id=139753
1365
1366         Reviewed by Darin Adler.
1367
1368         Log navigation types using FeatureCounter API.
1369
1370         No new tests, no behavior change other than additional feature
1371         counting.
1372
1373         * loader/FrameLoader.cpp:
1374         (WebCore::logNavigationWithFeatureCounter):
1375         (WebCore::FrameLoader::loadWithDocumentLoader):
1376         * platform/FeatureCounterKeys.h:
1377
1378 2014-12-18  Chris Dumez  <cdumez@apple.com>
1379
1380         Move 'font-weight' CSS property to the new StyleBuilder
1381         https://bugs.webkit.org/show_bug.cgi?id=139765
1382
1383         Reviewed by Antti Koivisto.
1384
1385         Move 'font-weight' CSS property to the new StyleBuilder by using
1386         custom code.
1387
1388         No new tests, no behavior change.
1389
1390         * css/CSSPropertyNames.in:
1391         * css/DeprecatedStyleBuilder.cpp:
1392         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
1393         (WebCore::ApplyPropertyFontWeight::applyValue): Deleted.
1394         (WebCore::ApplyPropertyFontWeight::createHandler): Deleted.
1395         * css/StyleBuilderCustom.h:
1396         (WebCore::StyleBuilderCustom::applyInitialFontWeight):
1397         (WebCore::StyleBuilderCustom::applyInheritFontWeight):
1398         (WebCore::StyleBuilderCustom::applyValueFontWeight):
1399
1400 2014-12-18  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1401
1402         Internals methods return 0 instead of false when they fail
1403         https://bugs.webkit.org/show_bug.cgi?id=139766
1404
1405         Reviewed by Darin Adler.
1406
1407         Some Internals method explicitly return 0 although
1408         they expect boolean value.
1409
1410         No new tests, no behavior change.
1411
1412         * testing/Internals.cpp:
1413         (WebCore::Internals::hasSpellingMarker):
1414         (WebCore::Internals::hasAutocorrectedMarker):
1415         (WebCore::Internals::isOverwriteModeEnabled):
1416         (WebCore::Internals::hasGrammarMarker):
1417         Return false instead of 0.
1418
1419 2014-12-18  Chris Dumez  <cdumez@apple.com>
1420
1421         [iOS] Log why cached resources are being revalidated using FeatureCounter API
1422         https://bugs.webkit.org/show_bug.cgi?id=139759
1423         <rdar://problem/19288177>
1424
1425         Reviewed by Antti Koivisto.
1426
1427         Log why cached resources are being revalidated using FeatureCounter API.
1428         Also log if revalidation is successful or not.
1429
1430         No new tests, no behavior change.
1431
1432         * loader/SubresourceLoader.cpp:
1433         (WebCore::SubresourceLoader::willSendRequest):
1434         (WebCore::SubresourceLoader::didReceiveResponse):
1435         * loader/cache/CachedImage.cpp:
1436         (WebCore::CachedImage::mustRevalidateDueToCacheHeaders):
1437         * loader/cache/CachedImage.h:
1438         * loader/cache/CachedResource.cpp:
1439         (WebCore::CachedResource::failBeforeStarting):
1440         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
1441         * loader/cache/CachedResource.h:
1442         (WebCore::CachedResource::loader):
1443         * loader/cache/CachedResourceLoader.cpp:
1444         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
1445         * platform/FeatureCounterKeys.h:
1446
1447 2014-12-18  Antti Koivisto  <antti@apple.com>
1448
1449         Remove alwaysUseBaselineOfPrimaryFont setting
1450         https://bugs.webkit.org/show_bug.cgi?id=139770
1451
1452         Reviewed by Anders Carlsson.
1453
1454         "FIXME: This is unneeded and should be removed."
1455
1456         This iOS-only setting has no clients anymore.
1457
1458         * page/Settings.in:
1459         * rendering/RootInlineBox.cpp:
1460         (WebCore::RootInlineBox::ascentAndDescentForBox):
1461
1462 2014-12-18  Radu Stavila  <stavila@adobe.com>
1463
1464         [SVG Masking] Enable the use of <mask> elements for -webkit-mask-image
1465         https://bugs.webkit.org/show_bug.cgi?id=139294
1466
1467         Reviewed by Simon Fraser.
1468
1469         This patch links together all parts required for the functionality which improves 
1470         the -webkit-mask-image property by allowing it to reference a <mask> element defined 
1471         in an inline or external SVG document.
1472         Support for this new functionality has been added in a previous patch, under issue
1473         https://bugs.webkit.org/show_bug.cgi?id=139092. A more detailed description of how
1474         the new functionality works can be found in the ChangeLog for that commit.
1475         The containsSVGDocument in ScrollView has been removed because it was added in the
1476         previous patch but is no longer required.
1477
1478         Tests: css3/masking/mask-base64.html
1479                css3/masking/mask-multiple-values.html
1480                css3/masking/mask-svg-clipped-fragmentId.html
1481                css3/masking/mask-svg-fragmentId.html
1482                css3/masking/mask-svg-inline-fragmentId.html
1483                css3/masking/mask-svg-inline-invalid-fragmentId.html
1484                css3/masking/mask-svg-invalid-fragmentId.html
1485                css3/masking/mask-svg-no-fragmentId-tiled.html
1486                css3/masking/mask-svg-no-fragmentId.html
1487                css3/masking/mask-svg-script-entire-svg-to-mask.html
1488                css3/masking/mask-svg-script-mask-to-entire-svg.html
1489                css3/masking/mask-svg-script-mask-to-none.html
1490                css3/masking/mask-svg-script-mask-to-png.html
1491                css3/masking/mask-svg-script-none-to-mask.html
1492                css3/masking/mask-svg-script-none-to-png.html
1493                css3/masking/mask-svg-script-png-to-mask.html
1494                css3/masking/mask-svg-script-png-to-none.html
1495
1496         * css/CSSComputedStyleDeclaration.cpp:
1497         (WebCore::ComputedStyleExtractor::propertyValue):
1498         * css/CSSParser.cpp:
1499         (WebCore::CSSParser::parseFillShorthand):
1500         (WebCore::CSSParser::parseFillProperty):
1501         (WebCore::CSSParser::parseMaskImage):
1502         * css/CSSParser.h:
1503         * css/CSSValue.h:
1504         * css/DeprecatedStyleBuilder.cpp:
1505         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
1506         * css/StyleResolver.cpp:
1507         (WebCore::StyleResolver::adjustStyleForMaskImages):
1508         (WebCore::StyleResolver::applyMatchedProperties):
1509         (WebCore::StyleResolver::applyProperty):
1510         (WebCore::StyleResolver::loadPendingSVGDocuments):
1511         (WebCore::StyleResolver::createMaskImageOperations):
1512         (WebCore::StyleResolver::loadPendingImages):
1513         * css/StyleResolver.h:
1514         * page/FrameView.cpp:
1515         (WebCore::FrameView::containsSVGDocument): Deleted.
1516         * page/FrameView.h:
1517         * page/animation/CSSPropertyAnimation.cpp:
1518         (WebCore::blendFunc):
1519         (WebCore::MaskImagePropertyWrapper::MaskImagePropertyWrapper):
1520         (WebCore::MaskImagePropertyWrapper::equals):
1521         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1522         * platform/ScrollView.h:
1523         (WebCore::ScrollView::containsSVGDocument): Deleted.
1524         * platform/graphics/MaskImageOperation.cpp:
1525         (WebCore::MaskImageOperation::~MaskImageOperation):
1526         (WebCore::MaskImageOperation::operator==):
1527         * platform/graphics/MaskImageOperation.h:
1528         * rendering/RenderBox.cpp:
1529         (WebCore::RenderBox::maskClipRect):
1530         * rendering/RenderBox.h:
1531         * rendering/RenderBoxModelObject.cpp:
1532         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1533         (WebCore::RenderBoxModelObject::calculateFillTileSize):
1534         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1535         * rendering/RenderElement.cpp:
1536         (WebCore::RenderElement::~RenderElement):
1537         (WebCore::RenderElement::updateFillImages):
1538         * rendering/RenderLayer.cpp:
1539         (WebCore::RenderLayer::calculateClipRects):
1540         * rendering/RenderLayer.h:
1541         * rendering/RenderLayerMaskImageInfo.cpp:
1542         (WebCore::RenderLayer::MaskImageInfo::~MaskImageInfo):
1543         (WebCore::RenderLayer::MaskImageInfo::updateMaskImageClients):
1544         (WebCore::RenderLayer::MaskImageInfo::removeMaskImageClients):
1545         * rendering/RenderLayerMaskImageInfo.h:
1546         * rendering/style/FillLayer.cpp:
1547         (WebCore::FillLayer::hasImage):
1548         * rendering/style/FillLayer.h:
1549         (WebCore::FillLayer::image):
1550         (WebCore::FillLayer::imageOrMaskImage): Deleted.
1551         * rendering/style/RenderStyle.cpp:
1552         (WebCore::RenderStyle::setMaskImage):
1553         * rendering/style/RenderStyle.h:
1554
1555 2014-12-18  Antti Koivisto  <antti@apple.com>
1556
1557         Stop returning GlyphPage from various Font functions
1558         https://bugs.webkit.org/show_bug.cgi?id=139627
1559
1560         Reviewed by Darin Adler.
1561
1562         Make all
1563
1564             std::pair<GlyphData, GlyphPage*> glyphDataAndPage*(...)
1565
1566         style functions to just return GlyphData only. The GlyphPage value was only used for an obscure SVG fallback case.
1567
1568         * platform/graphics/Font.h:
1569         (WebCore::Font::glyphDataForCharacter):
1570         (WebCore::Font::glyphDataAndPageForCharacter): Deleted.
1571         * platform/graphics/FontGlyphs.cpp:
1572         (WebCore::glyphDataForCJKCharacterWithoutSyntheticItalic):
1573         (WebCore::glyphDataForNonCJKCharacterWithGlyphOrientation):
1574         (WebCore::FontGlyphs::glyphDataForSystemFallback):
1575         (WebCore::FontGlyphs::glyphDataForVariant):
1576         (WebCore::FontGlyphs::glyphDataForCharacter):
1577         (WebCore::glyphDataAndPageForCJKCharacterWithoutSyntheticItalic): Deleted.
1578         (WebCore::glyphDataAndPageForNonCJKCharacterWithGlyphOrientation): Deleted.
1579         (WebCore::FontGlyphs::glyphDataAndPageForSystemFallback): Deleted.
1580         (WebCore::FontGlyphs::glyphDataAndPageForVariant): Deleted.
1581         (WebCore::FontGlyphs::glyphDataAndPageForCharacter): Deleted.
1582         * platform/graphics/FontGlyphs.h:
1583         (WebCore::FontGlyphs::GlyphPagesStateSaver::GlyphPagesStateSaver): Deleted.
1584         (WebCore::FontGlyphs::GlyphPagesStateSaver::~GlyphPagesStateSaver): Deleted.
1585
1586             No longer needed.
1587
1588         * rendering/svg/SVGTextRunRenderingContext.cpp:
1589         (WebCore::SVGTextRunRenderingContext::glyphDataForCharacter):
1590
1591             Simplify by not trying to resolve fallbacks in case context sensitive (based on lang attribute etc)
1592             glyph selection fails. Instead just fall back to a default font. This behavior is not specified
1593             anywhere as far as I can see. (normal non-context sensitive fallbacks will still work fine).
1594             This removes the need to hackishly mutate glyph pages.
1595
1596             Also fix a bug where we didn't use the specified missing glyph when context sensitive selection failed.
1597
1598 2014-12-18  Chris Dumez  <cdumez@apple.com>
1599
1600         Move 'list-style-image' CSS property to the new StyleBuilder
1601         https://bugs.webkit.org/show_bug.cgi?id=139763
1602
1603         Reviewed by Antti Koivisto.
1604
1605         Move 'list-style-image' CSS property to the new StyleBuilder
1606         by reusing an existing Converter helper and renaming it for
1607         clarity.
1608
1609         No new tests, no behavior change.
1610
1611         * css/CSSPropertyNames.in:
1612         * css/DeprecatedStyleBuilder.cpp:
1613         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
1614         (WebCore::ApplyPropertyStyleImage::applyValue): Deleted.
1615         (WebCore::ApplyPropertyStyleImage::createHandler): Deleted.
1616         * css/StyleBuilderConverter.h:
1617         (WebCore::StyleBuilderConverter::convertStyleImage):
1618         (WebCore::StyleBuilderConverter::convertBorderImageSource): Deleted.
1619
1620 2014-12-17  Csaba Osztrogonác  <ossy@webkit.org>
1621
1622         URTBF after r177452.
1623         https://bugs.webkit.org/show_bug.cgi?id=139752
1624
1625         * CMakeLists.txt:
1626
1627 2014-12-17  Andreas Kling  <akling@apple.com>
1628
1629         Ref-ify Range::create().
1630         <https://webkit.org/b/139755>
1631
1632         Reviewed by Anders Carlsson.
1633
1634         * dom/Document.cpp:
1635         (WebCore::acceptsEditingFocus):
1636         * dom/Element.cpp:
1637         (WebCore::Element::innerText):
1638         * dom/Range.cpp:
1639         (WebCore::Range::create):
1640         (WebCore::Range::cloneRange):
1641         (WebCore::rangeOfContents):
1642         * dom/Range.h:
1643         * editing/AlternativeTextController.cpp:
1644         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
1645         * editing/CompositeEditCommand.cpp:
1646         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
1647         * editing/VisibleUnits.cpp:
1648         (WebCore::charactersAroundPosition):
1649         * editing/markup.cpp:
1650         (WebCore::StyledMarkupAccumulator::renderedText):
1651         * page/FocusController.cpp:
1652         (WebCore::relinquishesEditingFocus):
1653
1654 2014-12-17  Dan Bernstein  <mitz@apple.com>
1655
1656         <rdar://problem/19282508> WebKitLegacy is unusable due to bad dylib identifier
1657         https://bugs.webkit.org/show_bug.cgi?id=139760
1658
1659         Reviewed by Anders Carlsson.
1660
1661         * Configurations/WebCore.xcconfig:
1662
1663 2014-12-17  Anders Carlsson  <andersca@apple.com>
1664
1665         Get rid of FrameLoader::defaultObjectContentType
1666         https://bugs.webkit.org/show_bug.cgi?id=139758
1667
1668         Reviewed by Geoffrey Garen.
1669
1670         Move the FrameLoader::defaultObjectContentType implementation to its only caller in WebKit/win.
1671
1672         * loader/FrameLoader.cpp:
1673         (WebCore::FrameLoader::defaultObjectContentType): Deleted.
1674         * loader/FrameLoader.h:
1675
1676 2014-12-17  peavo@outlook.com  <peavo@outlook.com>
1677
1678         [Curl] Compile error, setWasCached method has been removed.
1679         https://bugs.webkit.org/show_bug.cgi?id=139737
1680
1681         Reviewed by Alex Christensen.
1682
1683         The ResourceResponseBase::setWasCached() method has been replaced
1684         with ResourceResponseBase::setSource().
1685
1686         * platform/network/curl/CurlCacheEntry.cpp:
1687         (WebCore::CurlCacheEntry::setResponseFromCachedHeaders):
1688
1689 2014-12-17  Chris Dumez  <cdumez@apple.com>
1690
1691         [iOS] Make it possible to toggle FeatureCounter support at runtime
1692         https://bugs.webkit.org/show_bug.cgi?id=139688
1693         <rdar://problem/19266254>
1694
1695         Reviewed by Andreas Kling.
1696
1697         Make it possible to toggle FeatureCounter support at runtime by adding
1698         a setting (disabled by default) and moving the API to a new
1699         FeatureCounter class under WebCore/plattorm which only logs if the
1700         setting is enabled. For privacy reasons, FeatureCounter logging is also
1701         disabled for private / ephemeral sessions.
1702
1703         No new tests, no behavior change.
1704
1705         * CMakeLists.txt:
1706         * Configurations/WebCore.xcconfig:
1707         * WebCore.vcxproj/WebCore.vcxproj:
1708         * WebCore.vcxproj/WebCore.vcxproj.filters:
1709         * WebCore.xcodeproj/project.pbxproj:
1710         * history/PageCache.cpp:
1711         (WebCore::logCanCacheFrameDecision):
1712         (WebCore::logCanCachePageDecision):
1713         * page/Settings.in:
1714         * platform/FeatureCounter.cpp: Renamed from Source/WTF/wtf/FeatureCounter.cpp.
1715         (WebCore::FeatureCounter::shouldUseForPage):
1716         (WebCore::FeatureCounter::incrementKey):
1717         (WebCore::FeatureCounter::setKey):
1718         * platform/FeatureCounter.h: Renamed from Source/WTF/wtf/FeatureCounter.h.
1719         * platform/FeatureCounterKeys.h:
1720         * platform/ios/FeatureCounter.mm: Renamed from Source/WTF/wtf/ios/FeatureCounter.mm.
1721         (WebCore::FeatureCounter::incrementKey):
1722         (WebCore::FeatureCounter::setKey):
1723
1724 2014-12-17  Anders Carlsson  <andersca@apple.com>
1725
1726         Get rid of PluginPackageNone.cpp
1727         https://bugs.webkit.org/show_bug.cgi?id=139735
1728
1729         Reviewed by Andreas Kling.
1730
1731         * CMakeLists.txt:
1732         * PlatformEfl.cmake:
1733         * PlatformGTK.cmake:
1734         * PlatformWin.cmake:
1735         * plugins/PluginPackageNone.cpp: Removed.
1736
1737 2014-12-17  Andreas Kling  <akling@apple.com>
1738
1739         Purge PassRefPtr from Frame.
1740         <https://webkit.org/b/139731>
1741
1742         Reviewed by Anders Carlsson.
1743
1744         Remove all use of PassRefPtr from the Frame class, instead using
1745         Ref or RefPtr as appropriate.
1746
1747         * WebCore.exp.in:
1748         * loader/DocumentWriter.cpp:
1749         (WebCore::DocumentWriter::begin):
1750         * page/Frame.cpp:
1751         (WebCore::Frame::create):
1752         (WebCore::Frame::setView):
1753         (WebCore::Frame::setDocument):
1754         (WebCore::Frame::rangeForPoint):
1755         (WebCore::Frame::createView):
1756         * page/Frame.h:
1757         * xml/XSLTProcessor.cpp:
1758         (WebCore::XSLTProcessor::createDocumentFromSource):
1759
1760 2014-12-17  Myles C. Maxfield  <mmaxfield@apple.com>
1761
1762         Test fix after r177444.
1763
1764         Unreviewed.
1765
1766         * accessibility/AccessibilitySlider.cpp:
1767         (WebCore::AccessibilitySliderThumb::elementRect):
1768
1769 2014-12-16  Myles C. Maxfield  <mmaxfield@apple.com>
1770
1771         Addressing more post-review comments in r177035
1772
1773         * accessibility/AccessibilitySlider.cpp:
1774         (WebCore::AccessibilitySliderThumb::elementRect):
1775         * html/HTMLInputElement.cpp:
1776         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
1777
1778 2014-12-17  Zan Dobersek  <zdobersek@igalia.com>
1779
1780         [TexMap] Sprinkle range-based for-loops where still possible
1781         https://bugs.webkit.org/show_bug.cgi?id=138752
1782
1783         Reviewed by Chris Dumez.
1784
1785         Apply range-based for-loops where possible in the TextureMapper,
1786         TextureMapperGL and TextureMapperTiledBackingStore classes.
1787
1788         Also prettify the loop in SharedGLData destructor and return
1789         nullptr instead of explicitly constructing the empty PassRefPtr
1790         object in TextureMapperTiledBackingStore::texture().
1791
1792         * platform/graphics/texmap/TextureMapper.cpp:
1793         (WebCore::BitmapTexturePool::acquireTexture):
1794         * platform/graphics/texmap/TextureMapperGL.cpp:
1795         (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
1796         (WebCore::TextureMapperGLData::~TextureMapperGLData):
1797         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
1798         (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
1799         (WebCore::TextureMapperTiledBackingStore::drawBorder):
1800         (WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
1801         (WebCore::TextureMapperTiledBackingStore::createOrDestroyTilesIfNeeded):
1802         (WebCore::TextureMapperTiledBackingStore::updateContents):
1803         (WebCore::TextureMapperTiledBackingStore::texture):
1804
1805 2014-12-17  Radu Stavila  <stavila@adobe.com>
1806
1807         The SVGDocument of an SVGImage should not perform any additional actions when the SVGImage is being destroyed
1808         https://bugs.webkit.org/show_bug.cgi?id=139644
1809
1810         Reviewed by Antti Koivisto.
1811
1812         When an SVGImage is destroyed, having its SVGDocument perform style recalc and dispatching events is not only
1813         useless but can also cause problems, such as re-entrancy in StyleResolver::loadPendingResources.
1814
1815         No new tests required, existing tests cover this change.
1816
1817         * dom/Document.cpp:
1818         (WebCore::Document::Document):
1819         * dom/Document.h:
1820         (WebCore::Document::isBeingDestroyed):
1821         (WebCore::Document::setIsBeingDestroyed):
1822         * loader/FrameLoader.cpp:
1823         (WebCore::FrameLoader::closeURL):
1824         * svg/graphics/SVGImage.cpp:
1825         (WebCore::SVGImage::~SVGImage):
1826
1827 2014-12-17  Chris Dumez  <cdumez@apple.com>
1828
1829         Drop useless 'clipToContents' argument for windowClipRect()
1830         https://bugs.webkit.org/show_bug.cgi?id=139722
1831
1832         Reviewed by Darin Adler.
1833
1834         Drop useless 'clipToContents' argument for windowClipRect(). This
1835         argument is never used.
1836
1837         No new tests, no behavior change.
1838
1839         * page/FrameView.cpp:
1840         (WebCore::FrameView::windowClipRect):
1841         * page/FrameView.h:
1842         * platform/ScrollView.h:
1843
1844 2014-12-16  Shivakumar JM  <shiva.jm@samsung.com>
1845
1846         text node should not be created, On setting document.title to the empty string.
1847         https://bugs.webkit.org/show_bug.cgi?id=139121
1848
1849         Reviewed by Darin Adler.
1850
1851         Do not create text node, On setting document.title to the empty string as in spec.
1852         I have confirmed this matches the behavior of Firefox and Chrome.
1853
1854         Test: fast/dom/Document/document-set-title-no-child.html
1855
1856         * html/HTMLTitleElement.cpp:
1857         (WebCore::HTMLTitleElement::setText):
1858
1859 2014-12-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1860
1861         Move WebCore/platform/graphics/surfaces to std::unique_ptr
1862         https://bugs.webkit.org/show_bug.cgi?id=139641
1863
1864         Reviewed by Andreas Kling.
1865
1866         Replace OwnPtr|PassOwnPtr with std::make_unique<>|std::unique_ptr<>.
1867
1868         * platform/graphics/GLContext.cpp:
1869         (WebCore::GLContext::sharingContext):
1870         (WebCore::GLContext::createContextForWindow):
1871         (WebCore::GLContext::createOffscreenContext):
1872         * platform/graphics/GLContext.h:
1873         * platform/graphics/GraphicsContext3DPrivate.cpp:
1874         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1875         * platform/graphics/GraphicsContext3DPrivate.h:
1876         * platform/graphics/egl/GLContextEGL.cpp:
1877         (WebCore::GLContextEGL::createWindowContext):
1878         (WebCore::GLContextEGL::createPbufferContext):
1879         (WebCore::GLContextEGL::createPixmapContext):
1880         (WebCore::GLContextEGL::createContext):
1881         * platform/graphics/egl/GLContextEGL.h:
1882         * platform/graphics/glx/GLContextGLX.cpp:
1883         (WebCore::GLContextGLX::createWindowContext):
1884         (WebCore::GLContextGLX::createPbufferContext):
1885         (WebCore::GLContextGLX::createPixmapContext):
1886         (WebCore::GLContextGLX::createContext):
1887         * platform/graphics/glx/GLContextGLX.h:
1888         * platform/graphics/surfaces/GLTransportSurface.cpp:
1889         (WebCore::GLTransportSurface::createTransportSurface):
1890         (WebCore::GLTransportSurfaceClient::createTransportSurfaceClient):
1891         * platform/graphics/surfaces/GLTransportSurface.h:
1892         * platform/graphics/surfaces/GraphicsSurface.h:
1893         * platform/graphics/surfaces/GraphicsSurfaceToken.h:
1894         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
1895         * platform/graphics/surfaces/egl/EGLSurface.cpp:
1896         (WebCore::EGLTransportSurface::createTransportSurface):
1897         (WebCore::EGLTransportSurface::createTransportSurfaceClient):
1898         (WebCore::EGLTransportSurface::EGLTransportSurface):
1899         * platform/graphics/surfaces/egl/EGLSurface.h:
1900         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
1901         (WebCore::EGLXTransportSurfaceClient::EGLXTransportSurfaceClient):
1902         * platform/graphics/surfaces/egl/EGLXSurface.h:
1903         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1904         (WebCore::GLXTransportSurface::GLXTransportSurface):
1905         (WebCore::GLXOffScreenSurface::initialize):
1906         * platform/graphics/surfaces/glx/GLXSurface.h:
1907
1908 2014-12-16  Timothy Horton  <timothy_horton@apple.com>
1909
1910         Implement and adopt two new TextIndicator presentation animations
1911         https://bugs.webkit.org/show_bug.cgi?id=139715
1912         <rdar://problem/19237945>
1913
1914         Reviewed by Anders Carlsson.
1915
1916         * WebCore.exp.in:
1917         Adjust one symbol and export another.
1918
1919         * page/TextIndicator.cpp:
1920         (WebCore::TextIndicator::createWithSelectionInFrame):
1921         Take a blue-highlight snapshot if we're doing a crossfade without a bounce.
1922
1923         * page/TextIndicator.h:
1924         (WebCore::TextIndicator::presentationTransition):
1925         Add FadeIn and Crossfade transition types.
1926
1927         * page/mac/TextIndicatorWindow.h:
1928         * page/mac/TextIndicatorWindow.mm:
1929         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
1930         (createBounceAnimation):
1931         (createContentCrossfadeAnimation):
1932         (createShadowFadeAnimation):
1933         (createFadeInAnimation):
1934         (-[WebTextIndicatorView _textIndicatorWantsBounce]):
1935         (-[WebTextIndicatorView _textIndicatorWantsContentCrossfade]):
1936         (-[WebTextIndicatorView _textIndicatorWantsFadeIn]):
1937         Factor out the animation construction.
1938
1939         (-[WebTextIndicatorView _animationDuration]):
1940         Factor out the duration computation.
1941
1942         (-[WebTextIndicatorView present]):
1943         (-[WebTextIndicatorView setAnimationProgress:]):
1944         Implement FadeIn and Crossfade transitions.
1945         They can be driven externally and then continue from where they
1946         left off when the progress reaches 100%.
1947         FadeIn changes the opacity of the whole bubble, Crossfade
1948         crossfades the content (from blue to yellow).
1949
1950         (WebCore::TextIndicatorWindow::TextIndicatorWindow):
1951         (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
1952         Don't immediately destroy the window if it is crossfades or fades in.
1953         Fade it out, instead.
1954
1955         (WebCore::TextIndicatorWindow::setAnimationProgress):
1956         Drive the paused animation manually. If progress hits 100%,
1957         start running it automatically from where it last left off.
1958
1959         (WebCore::TextIndicatorWindow::setTextIndicator):
1960         (WebCore::TextIndicatorWindow::startFadeOut):
1961         (-[WebTextIndicatorView presentWithCompletionHandler:]): Deleted.
1962         (WebCore::TextIndicatorWindow::startFadeOutTimerFired): Deleted.
1963         Remove the completion block from -present.
1964
1965         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
1966         Add some SPI.
1967
1968 2014-12-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1969
1970         Move WebCore/platform/image-decoders to std::unique_ptr<>
1971         https://bugs.webkit.org/show_bug.cgi?id=139668
1972
1973         Reviewed by Andreas Kling.
1974
1975         As a step to use std::unique_ptr<>, this patch replaces OwnPtr|PassOwnPtr with
1976         std::unique_ptr<> | std::make_unique<>.
1977
1978         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1979         (WebCore::BMPImageDecoder::setFailed):
1980         (WebCore::BMPImageDecoder::decode):
1981         (WebCore::BMPImageDecoder::decodeHelper):
1982         * platform/image-decoders/bmp/BMPImageDecoder.h:
1983         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1984         (WebCore::GIFImageDecoder::setFailed):
1985         (WebCore::GIFImageDecoder::gifComplete):
1986         (WebCore::GIFImageDecoder::decode):
1987         * platform/image-decoders/gif/GIFImageDecoder.h:
1988         * platform/image-decoders/gif/GIFImageReader.cpp:
1989         (GIFFrameContext::decode):
1990         (GIFImageReader::addFrameIfNecessary):
1991         * platform/image-decoders/gif/GIFImageReader.h:
1992         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1993         (WebCore::ICOImageDecoder::decode):
1994         (WebCore::ICOImageDecoder::decodeAtIndex):
1995         * platform/image-decoders/ico/ICOImageDecoder.h:
1996         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1997         (WebCore::JPEGImageDecoder::setFailed):
1998         (WebCore::JPEGImageDecoder::decode):
1999         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2000         * platform/image-decoders/png/PNGImageDecoder.cpp:
2001         (WebCore::PNGImageDecoder::setFailed):
2002         (WebCore::PNGImageDecoder::decode):
2003         * platform/image-decoders/png/PNGImageDecoder.h:
2004
2005 2014-12-16  Andreas Kling  <akling@apple.com>
2006
2007         Use Ref for SecurityOrigin.
2008         <https://webkit.org/b/139710>
2009
2010         Reviewed by Anders Carlsson.
2011
2012         Make SecurityOrigin::create*() return Ref<SecurityOrigin>.
2013
2014         * html/HTMLAnchorElement.cpp:
2015         (WebCore::HTMLAnchorElement::origin):
2016         * loader/DocumentLoadTiming.cpp:
2017         (WebCore::DocumentLoadTiming::addRedirect):
2018         * loader/DocumentLoader.cpp:
2019         (WebCore::DocumentLoader::willSendRequest):
2020         * loader/FrameLoader.cpp:
2021         (WebCore::FrameLoader::commitProvisionalLoad):
2022         * loader/PingLoader.cpp:
2023         (WebCore::PingLoader::sendPing):
2024         * loader/appcache/ApplicationCacheHost.cpp:
2025         (WebCore::ApplicationCacheHost::isApplicationCacheBlockedForRequest):
2026         * loader/appcache/ApplicationCacheStorage.cpp:
2027         (WebCore::ApplicationCacheStorage::getOriginsWithCache):
2028         * page/ContentSecurityPolicy.cpp:
2029         (WebCore::stripURLForUseInReport):
2030         * page/DOMWindow.cpp:
2031         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
2032         * page/SecurityOrigin.cpp:
2033         (WebCore::getCachedOrigin):
2034         (WebCore::SecurityOrigin::create):
2035         (WebCore::SecurityOrigin::createUnique):
2036         (WebCore::SecurityOrigin::isolatedCopy):
2037         (WebCore::SecurityOrigin::canRequest):
2038         (WebCore::SecurityOrigin::createFromString):
2039         (WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier):
2040         (WebCore::SecurityOrigin::createFromDatabaseIdentifier):
2041         * page/SecurityOrigin.h:
2042         * page/SecurityPolicy.cpp:
2043         (WebCore::SecurityPolicy::isAccessToURLWhiteListed):
2044         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2045         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
2046         * storage/StorageTracker.cpp:
2047         (WebCore::StorageTracker::deleteOriginWithIdentifier):
2048         * workers/DefaultSharedWorkerRepository.cpp:
2049         (WebCore::DefaultSharedWorkerRepository::connectToWorker):
2050         * workers/WorkerThread.cpp:
2051         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2052
2053 2014-12-16  Chris Dumez  <cdumez@apple.com>
2054
2055         Move 'cursor' CSS property to the new StyleBuilder
2056         https://bugs.webkit.org/show_bug.cgi?id=139660
2057
2058         Reviewed by Benjamin Poulain.
2059
2060         Move 'cursor' CSS property to the new StyleBuilder by using
2061         custom code.
2062
2063         No new tests, no behavior change.
2064
2065         * css/CSSPropertyNames.in:
2066         * css/DeprecatedStyleBuilder.cpp:
2067         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
2068         (WebCore::ApplyPropertyCursor::applyInheritValue): Deleted.
2069         (WebCore::ApplyPropertyCursor::applyInitialValue): Deleted.
2070         (WebCore::ApplyPropertyCursor::applyValue): Deleted.
2071         (WebCore::ApplyPropertyCursor::createHandler): Deleted.
2072         * css/StyleBuilderCustom.h:
2073         (WebCore::StyleBuilderCustom::applyInitialCursor):
2074         (WebCore::StyleBuilderCustom::applyInheritCursor):
2075         (WebCore::StyleBuilderCustom::applyValueCursor):
2076
2077 2014-12-16  Zalan Bujtas  <zalan@apple.com>
2078
2079         Subpixel rendering: Animating HTML elements leaves trails when embedded to a subpxiel positioned iframe.
2080         https://bugs.webkit.org/show_bug.cgi?id=139691
2081         rdar://problem/19078958
2082
2083         Reviewed by Simon Fraser.
2084
2085         This patch ensures that repaint rect and actual paint coordinate calculations are in sync.
2086
2087         RenderWidget painting still snaps final coordinates to integral positions. We need to
2088         mimic the same snapping behaviour when the repaint rects are being calculated so that
2089         they are in sync with the final repaint rects. This is a workaround until after
2090         widgets get pushed to device pixel positions.
2091
2092         Test: fast/repaint/hidpi-content-inside-iframe-leaves-trails.html
2093
2094         * rendering/RenderBox.cpp:
2095         (WebCore::RenderBox::computeRectForRepaint):
2096         * rendering/RenderView.cpp:
2097         (WebCore::RenderView::repaintViewRectangle):
2098         * rendering/RenderWidget.cpp:
2099         (WebCore::RenderWidget::paintContents):
2100
2101 2014-12-16  Beth Dakin  <bdakin@apple.com>
2102
2103         REGRESSION: Preview popovers obscure the link, look wrong
2104         https://bugs.webkit.org/show_bug.cgi?id=139711
2105         -and corresponding-
2106         rdar://problem/19271854
2107
2108         Reviewed by Tim Horton.
2109
2110         New SPI.
2111         * WebCore.xcodeproj/project.pbxproj:
2112         * platform/spi/mac/NSPopoverSPI.h: Added.
2113
2114 2014-12-16  Myles C. Maxfield  <mmaxfield@apple.com>
2115
2116         [iOS] Cherokee language is drawn as boxes
2117         https://bugs.webkit.org/show_bug.cgi?id=139706
2118
2119         Reviewed by Simon Fraser.
2120
2121         Test: platform/ios-simulator/fast/text/cherokee.html
2122
2123         * platform/graphics/ios/FontCacheIOS.mm:
2124         (WebCore::languageSpecificFallbackFont):
2125
2126 2014-12-16  Enrica Casucci  <enrica@apple.com>
2127
2128         Fix iOS builders for 8.0
2129         https://bugs.webkit.org/show_bug.cgi?id=139495
2130
2131         Reviewed by Jer Noble
2132
2133         * WebCore.exp.in:
2134         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2135         (-[WebVideoFullscreenController enterFullscreen:mode:]):
2136         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
2137         (-[WebVideoFullscreenController enterFullscreen:]): Deleted.
2138         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2139
2140 2014-12-16  Myles C. Maxfield  <mmaxfield@apple.com>
2141
2142         Ruby overhang uses ints instead of floats
2143         https://bugs.webkit.org/show_bug.cgi?id=139624
2144
2145         Reviewed by Dave Hyatt.
2146
2147         Simply change the type.
2148
2149         Updated existing tests.
2150
2151         * rendering/RenderBlockLineLayout.cpp:
2152         (WebCore::RenderBlockFlow::setMarginsForRubyRun):
2153         * rendering/RenderRubyRun.cpp:
2154         (WebCore::RenderRubyRun::getOverhang):
2155         * rendering/RenderRubyRun.h:
2156         * rendering/line/LineWidth.cpp:
2157         (WebCore::LineWidth::applyOverhang):
2158
2159 2014-12-16  Gavin Barraclough  <barraclough@apple.com>
2160
2161         Move Mac process suppression from WebCore to WebKit2
2162         https://bugs.webkit.org/show_bug.cgi?id=139705
2163
2164         Reviewed by Geoff Garen.
2165
2166         Currently PageThrottler constructs the PageActivityState, holds a copy of the ViewState,
2167         and an optional UserActivity.
2168
2169         Instead, still construct the PageActivityState but just pass this out via the Page to WebPage.
2170         Logic From PageThrottler::updateUserActivity merged into WebPage::updateUserActivity.
2171
2172         * WebCore.exp.in:
2173             - removed createUserActivity.
2174         * page/ChromeClient.h:
2175         (WebCore::ChromeClient::setPageActivityState):
2176             - added to propagate PageActivityState to WebPage.
2177         * page/Page.cpp:
2178         (WebCore::Page::Page):
2179             - PageThrottler constructor now takes a Page&.
2180         (WebCore::Page::setViewState):
2181             - no longer necessary to pass this to PageThrottler.
2182         (WebCore::Page::setPageActivityState):
2183             - added to propagate PageActivityState to WebPage.
2184         (WebCore::Page::enablePageThrottler): Deleted.
2185             - PageThrottler no longer has a UserActivity.
2186         * page/Page.h:
2187         (WebCore::Page::pageThrottler):
2188             - added setPageActivityState, removed enablePageThrottler.
2189         * page/PageThrottler.cpp:
2190         (WebCore::PageThrottler::PageThrottler):
2191             - removed m_viewState, added m_page.
2192         (WebCore::PageThrottler::setActivityFlag):
2193             - propagate PageActivityState via Page to WebPage.
2194         (WebCore::PageThrottler::createUserActivity): Deleted.
2195         (WebCore::PageThrottler::updateUserActivity): Deleted.
2196         (WebCore::PageThrottler::setViewState): Deleted.
2197             - removed; PageThrottler no longer has a PageThrottler or UserActivity.
2198         * page/PageThrottler.h:
2199             - removed createUserActivity, setViewState, m_viewState, m_activity; added m_page.
2200
2201 2014-12-16  Jer Noble  <jer.noble@apple.com>
2202
2203         Unreviewed build fix after r177375; explicitly cast to NSUInteger.
2204
2205         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2206         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
2207         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
2208
2209 2014-12-16  peavo@outlook.com  <peavo@outlook.com>
2210
2211         [Win] Compiling WebCore fails because of invalid project file.
2212         https://bugs.webkit.org/show_bug.cgi?id=139686
2213
2214         Reviewed by Alex Christensen.
2215
2216         A WebCore project file contains illegal characters.
2217
2218         * WebCore.vcxproj/WebCore.vcxproj.filters:
2219
2220 2014-12-16  Gavin Barraclough  <barraclough@apple.com>
2221
2222         Introduce PageActivityState
2223         https://bugs.webkit.org/show_bug.cgi?id=139687
2224
2225         Reviewed by Anders Carlsson.
2226
2227         Add a bitfield to track each of the activities on the page separately.
2228         Split the hysteresis & counters so we can track these separately.
2229
2230         * page/PageThrottler.cpp:
2231         (WebCore::PageThrottler::PageThrottler):
2232             - initialze new hysteresis, counters; closures call setActivityFlag.
2233         (WebCore::PageThrottler::mediaActivityToken):
2234         (WebCore::PageThrottler::pageLoadActivityToken):
2235             - split m_pageActivityCounter -> m_mediaActivityCounter, m_pageLoadActivityCounter.
2236         (WebCore::PageThrottler::updateUserActivity):
2237             - use m_activityState to check for activity.
2238         (WebCore::PageThrottler::setActivityFlag):
2239             - helper to clear/set a bit in m_activityState, and call updateUserActivity as necessary.
2240         * page/PageThrottler.h:
2241         (WebCore::PageThrottler::didReceiveUserInput):
2242         (WebCore::PageThrottler::pluginDidEvaluateWhileAudioIsPlaying):
2243             - split m_hysteresis -> m_userInputHysteresis, m_audiblePluginHysteresis
2244
2245 2014-12-16  Myles C. Maxfield  <litherum@gmail.com>
2246
2247         Ruby does not preserve expansion opportunities from enclosing context
2248         https://bugs.webkit.org/show_bug.cgi?id=139618
2249
2250         Reviewed by David Hyatt.
2251
2252         There is currently no sharing of expansion opportunity information between
2253         ruby bases and the text surrounding the ruby. This patch adds a bit on
2254         RenderText, m_contentIsKnownToFollow, which affects how expansion
2255         opportunities are handled at paint-time, as well as a bit on RenderRubyBase,
2256         m_isAfterExpansion, which affects how expansions are calculated when laying
2257         out a line. This patch also adds a field to RenderRubyBase which represents
2258         the base's starting position within a ruby. This field is necessary because
2259         an expansion from a line might occur at the very beginning of a ruby base,
2260         so we have to remember some state from expansion time to RenderRubyBase
2261         layout time.
2262
2263         Added more tests to fast/ruby/ruby-justification.html.
2264
2265         * rendering/InlineBox.h:
2266         (WebCore::InlineBox::setExpansionWithoutGrowing):
2267         (WebCore::InlineBox::expansion):
2268         * rendering/InlineFlowBox.cpp:
2269         (WebCore::InlineFlowBox::removeChild): Keep the bit on InlineTextBox up to
2270         date.
2271         (WebCore::InlineFlowBox::placeBoxRangeInInlineDirection): Set expansion
2272         information in InlineFlowBoxes so the total expansion for a whole line
2273         is held in the RootInlineBox's expansion.
2274         * rendering/InlineTextBox.h:
2275         (WebCore::InlineTextBox::expansionBehavior):
2276         * rendering/RenderBlockFlow.h:
2277         * rendering/RenderBlockLineLayout.cpp:
2278         (WebCore::RenderBlockFlow::updateRubyForJustifiedText):
2279         updateRubyForJustifiedText() had a bunch of problems with it. First of all,
2280         it didn't actually set the InlineBoxes as dirty, so the second layout pass
2281         sometimes wouldn't perform any updates. Secondarily, it didn't take
2282         overhangs into account. Thirdly, it didn't mark the ruby base and text as
2283         needing layout so that subsequent layouts would actually traverse into them.
2284         (WebCore::RenderBlockFlow::computeExpansionForJustifiedText):
2285         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2286         This nested if triangle is super nasty, but I'm not sure of a better way to
2287         write it.
2288         (WebCore::updateRubyForJustifiedText): Deleted.
2289         (WebCore::computeExpansionForJustifiedText): Deleted.
2290         * rendering/RenderRubyBase.cpp:
2291         (WebCore::RenderRubyBase::RenderRubyBase):
2292         (WebCore::RenderRubyBase::adjustInlineDirectionLineBounds):
2293         * rendering/RenderRubyBase.h:
2294         * rendering/RenderRubyRun.cpp:
2295         (WebCore::RenderRubyRun::layout):
2296         * rendering/RenderText.cpp:
2297         (WebCore::RenderText::RenderText):
2298         * rendering/RenderText.h:
2299         (WebCore::RenderText::contentIsKnownToFollow):
2300         (WebCore::RenderText::setContentIsKnownToFollow):
2301
2302 2014-12-16  Jer Noble  <jer.noble@apple.com>
2303
2304         [iOS] Crash in WebKit::WebPageProxy::dispatchViewStateChange() tapping a link from another app while playing a video
2305         https://bugs.webkit.org/show_bug.cgi?id=139550
2306
2307         Reviewed by Anders Carlsson.
2308
2309         The existing "dispatch to WebThread, then release" model is insufficient and still
2310         can result in RefPtr race conditions between the main thread and the web thread.
2311         Make WebVideoFullscreenInterfaceAVKit a thread-safe ref-counted class, which
2312         eliminates the necessity of disptaching back to the web thread before releasing.
2313
2314         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2315         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2316         (WebVideoFullscreenInterfaceAVKit::setDuration): Use a strongThis model.
2317         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): Ditto.
2318         (WebVideoFullscreenInterfaceAVKit::setRate): Ditto.
2319         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): Ditto.
2320         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): Ditto.
2321         (mediaSelectionOptions): Return a RetainPtr object.
2322         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): Use a strongThis model.
2323         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): Ditto.
2324         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): Ditto.
2325         (WebVideoFullscreenInterfaceAVKit::setupFullscreen): Ditto.
2326         (WebVideoFullscreenInterfaceAVKit::enterFullscreen): Ditto.
2327         (WebVideoFullscreenInterfaceAVKit::exitFullscreen): Ditto.
2328         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen): Ditto.
2329         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Added utility
2330             function. Lets us use the implied this pointer rather than an explicit
2331             strongThis.
2332         (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Ditto.
2333         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Ditto.
2334         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal): Ditto.
2335         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): Ditto.
2336         (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): Use a strongThis model.
2337
2338 2014-12-16  Ryosuke Niwa  <rniwa@webkit.org>
2339
2340         Nested template contents are not cloned by document.importNode
2341         https://bugs.webkit.org/show_bug.cgi?id=137619
2342
2343         Reviewed by Andreas Kling.
2344
2345         The bug was caused by Document.importNode not cloning HTMLTemplateElement's content.
2346
2347         Fixed the bug by sharing code between Document::importNode and Node::cloneNode by
2348         generalizing Node::cloneNodeInternal, added in r177314, by taking the owner document
2349         as an argument. The most of code changes are the result of adding this argument.
2350
2351         Document::importNode is the only function in which the actual logic changes.
2352         Note that the code to import TEXT_NODE, CDATA_SECTION_NODE, ENTITY_REFERENCE_NODE,
2353         PROCESSING_INSTRUCTION_NODE and COMMENT_NODE nodes are identical to that of cloneNode.
2354
2355         This patch removes the call to hasValidNamespaceForElements in ELEMENT_NODE but this
2356         should not introduce an observable behavior change since all instantiated elements
2357         should have a valid namespace in the first place.
2358
2359         Because DOCUMENT_NODE and DOCUMENT_TYPE_NODE cannot be imported and DOCUMENT_TYPE_NODE
2360         can only appear as a direct child of DOCUMENT_NODE, neither nodes nor unimplemented
2361         XPATH_NAMESPACE_NODE and XPATH_NAMESPACE_NODE can appear inside the recursive calls
2362         for ELEMENT_NODE and DOCUMENT_FRAGMENT_NODE nodes.
2363
2364         While importNode behaves differently from cloneNode for ATTRIBUTE_NODE, namely that
2365         it merges all of its child nodes, this behavior isn't present when recursing inside
2366         ELEMENT_NODE and DOCUMENT_FRAGMENT_NODE since we are using cloneDataFromElement.
2367
2368         Thus there should be no observable behavior changes for DOCUMENT_FRAGMENT_NODE and
2369         ELEMENT_NODE nodes either.
2370
2371         Test: fast/dom/HTMLTemplateElement/importNode-nested-templates.html
2372
2373         * dom/Attr.cpp:
2374         (WebCore::Attr::cloneNodeInternal):
2375         * dom/Attr.h:
2376         * dom/CDATASection.cpp:
2377         (WebCore::CDATASection::cloneNodeInternal):
2378         * dom/CDATASection.h:
2379         * dom/Comment.cpp:
2380         (WebCore::Comment::cloneNodeInternal):
2381         * dom/Comment.h:
2382         * dom/ContainerNode.cpp:
2383         (WebCore::ContainerNode::cloneChildNodes):
2384         * dom/Document.cpp:
2385         (WebCore::Document::importNode):
2386         (WebCore::Document::cloneNodeInternal):
2387         * dom/Document.h:
2388         * dom/DocumentFragment.cpp:
2389         (WebCore::DocumentFragment::cloneNodeInternal):
2390         * dom/DocumentFragment.h:
2391         * dom/DocumentType.cpp:
2392         (WebCore::DocumentType::cloneNodeInternal):
2393         * dom/DocumentType.h:
2394         * dom/Element.cpp:
2395         (WebCore::Element::cloneNodeInternal):
2396         (WebCore::Element::cloneElementWithChildren):
2397         (WebCore::Element::cloneElementWithoutChildren):
2398         (WebCore::Element::cloneElementWithoutAttributesAndChildren):
2399         * dom/Element.h:
2400         * dom/EntityReference.cpp:
2401         (WebCore::EntityReference::cloneNodeInternal):
2402         * dom/EntityReference.h:
2403         * dom/Node.h:
2404         (WebCore::Node::cloneNode):
2405         * dom/ProcessingInstruction.cpp:
2406         (WebCore::ProcessingInstruction::cloneNodeInternal):
2407         * dom/ProcessingInstruction.h:
2408         * dom/ShadowRoot.cpp:
2409         (WebCore::ShadowRoot::cloneNodeInternal):
2410         * dom/ShadowRoot.h:
2411         * dom/Text.cpp:
2412         (WebCore::Text::cloneNodeInternal):
2413         * dom/Text.h:
2414         * editing/ApplyStyleCommand.cpp:
2415         (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
2416         (WebCore::ApplyStyleCommand::applyInlineStyleChange):
2417         * editing/BreakBlockquoteCommand.cpp:
2418         (WebCore::BreakBlockquoteCommand::doApply):
2419         * editing/InsertParagraphSeparatorCommand.cpp:
2420         (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
2421         (WebCore::InsertParagraphSeparatorCommand::doApply):
2422         * editing/ModifySelectionListLevel.cpp:
2423         (WebCore::IncreaseSelectionListLevelCommand::doApply):
2424         * editing/SplitElementCommand.cpp:
2425         (WebCore::SplitElementCommand::doApply):
2426         * editing/markup.cpp:
2427         (WebCore::createFragmentFromText):
2428         * html/HTMLKeygenElement.cpp:
2429         * html/HTMLScriptElement.cpp:
2430         (WebCore::HTMLScriptElement::cloneElementWithoutAttributesAndChildren):
2431         * html/HTMLScriptElement.h:
2432         * html/HTMLTemplateElement.cpp:
2433         (WebCore::HTMLTemplateElement::cloneNodeInternal):
2434         * html/HTMLTemplateElement.h:
2435         * html/shadow/SliderThumbElement.cpp:
2436         (WebCore::SliderThumbElement::cloneElementWithoutAttributesAndChildren):
2437         * html/shadow/SliderThumbElement.h:
2438         * html/track/WebVTTElement.cpp:
2439         (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
2440         * html/track/WebVTTElement.h:
2441         * svg/SVGScriptElement.cpp:
2442         (WebCore::SVGScriptElement::cloneElementWithoutAttributesAndChildren):
2443         * svg/SVGScriptElement.h:
2444         * svg/SVGUseElement.cpp:
2445         (WebCore::SVGUseElement::buildShadowTree):
2446         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
2447
2448 2014-12-16  Tibor Meszaros  <tmeszaros.u-szeged@partner.samsung.com>
2449
2450         Document.contentType implementation
2451         https://bugs.webkit.org/show_bug.cgi?id=132269
2452
2453         Reviewed by Darin Adler.
2454
2455         Chromium merge from https://codereview.chromium.org/151653004
2456
2457         Tests: fast/dom/document-contentType-DOMParser.html
2458                fast/dom/document-contentType-createDocument.html
2459                fast/dom/document-contentType-data-uri.html
2460                fast/xsl/xslt-contentType.html
2461                http/tests/dom/document-contentType-meta.html
2462                http/tests/dom/document-contentType-xhr.html
2463                http/tests/dom/document-contentType.html
2464
2465         * dom/Document.cpp:
2466         (WebCore::Document::overrideMIMEType):
2467         (WebCore::Document::contentType):
2468         (WebCore::Document::cloneDataFromDocument):
2469         * dom/Document.h:
2470         * dom/Document.idl:
2471         * loader/DocumentLoader.cpp:
2472         (WebCore::DocumentLoader::currentContentType):
2473         * loader/DocumentLoader.h:
2474         * xml/XMLHttpRequest.cpp:
2475         (WebCore::XMLHttpRequest::responseXML):
2476         * xml/XSLTProcessor.cpp:
2477         (WebCore::XSLTProcessor::createDocumentFromSource):
2478
2479 2014-12-16  Anders Carlsson  <andersca@apple.com>
2480
2481         Put some common code in StorageNamespaceProvider
2482         https://bugs.webkit.org/show_bug.cgi?id=139682
2483
2484         Reviewed by Tim Horton.
2485
2486         We have code in two places that gets the local storage area from a given document,
2487         choosing either the local storage namespace or the transient local storage namespace.
2488         Move it to StorageNamespaceProvider::localStorageArea.
2489
2490         * bindings/js/ScriptController.cpp:
2491         * inspector/InspectorDOMStorageAgent.cpp:
2492         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2493         * page/DOMWindow.cpp:
2494         (WebCore::DOMWindow::localStorage):
2495         * page/Navigator.cpp:
2496         * storage/StorageNamespaceProvider.cpp:
2497         (WebCore::StorageNamespaceProvider::localStorageArea):
2498         (WebCore::StorageNamespaceProvider::localStorageNamespace):
2499         * storage/StorageNamespaceProvider.h:
2500
2501 2014-12-16  Anders Carlsson  <andersca@apple.com>
2502
2503         Add FeatureCounterKeys.h to the Xcode project.
2504
2505         * WebCore.xcodeproj/project.pbxproj:
2506
2507 2014-12-16  Chris Dumez  <cdumez@apple.com>
2508
2509         REGRESSION (r163928): Animated GIFs are not resumed when translated into view using -webkit-transform
2510         https://bugs.webkit.org/show_bug.cgi?id=139672
2511         <rdar://problem/19260797>
2512
2513         Reviewed by Antti Koivisto.
2514
2515         After r163928, animated GIFs were not resumed when translated into view
2516         using '-webkit-transform' CSS property.
2517
2518         This broke animated gifs on the mobile version of weibo.com (which is
2519         one of the most popular blogging sites in China) on iPhone. e.g.
2520         http://m.weibo.cn/page/tpl?containerid=1005052150182731_-_WEIBO_SECOND_PROFILE_WEIBO&itemid=&title=全部微博
2521
2522         This patch calls FrameView::resumeVisibleImageAnimationsIncludingSubframes()
2523         after style recalc so that we resume animated images if they become visible
2524         after the style has changed. Doing so after layout wouldn't work because
2525         no layout happens in this case.
2526
2527         Test: fast/images/animated-gif-webkit-transform.html
2528
2529         * dom/Document.cpp:
2530         (WebCore::Document::recalcStyle):
2531
2532 2014-12-16  Sebastian Dröge  <sebastian@centricular.com>
2533
2534         [GStreamer] Fix deadlock when shutting down AudioDestination
2535         https://bugs.webkit.org/show_bug.cgi?id=139496
2536
2537         Reviewed by Philippe Normand.
2538
2539         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
2540         (webKitWebAudioSrcLoop):
2541         (webKitWebAudioSrcChangeState):
2542         Sometimes we would wait forever for the task to shut down. This
2543         was happening because of a bug in GStreamer that caused joining
2544         a paused task to deadlock.
2545
2546 2014-12-15  Dhi Aurrahman  <diorahman@rockybars.com>
2547
2548         Extend :lang()'s selector checker to handle ranges with '*' properly and perform matching within the ASCII range
2549         https://bugs.webkit.org/show_bug.cgi?id=139340
2550
2551         Reviewed by Benjamin Poulain.
2552
2553         Asterisk is considered as a valid subtag of a language range to express wildcard matching 
2554         in :lang()'s extended filtering procedure. The matching rules introduced by language 
2555         range with '*' is outlined in [1].
2556
2557         The matching of subtags is performed case-insensitively within the ASCII range[2].
2558
2559         [1] www.ietf.org/rfc/rfc4647.txt
2560         [2] http://dev.w3.org/csswg/selectors4/#the-lang-pseudo
2561
2562         Test: fast/selectors/lang-equal-ignoring-case.html
2563               fast/selectors/lang-valid-extended-filtering.html
2564
2565         * css/SelectorCheckerTestFunctions.h:
2566         (WebCore::equalIgnoringCaseWithinASCIIRange): Handle matching case-insensitively within the ASCII range.
2567         (WebCore::containslanguageSubtagMatchingRange):
2568         (WebCore::matchesLangPseudoClass):
2569
2570 2014-12-15  Chris Dumez  <cdumez@apple.com>
2571
2572         [iOS] Add feature counting support
2573         https://bugs.webkit.org/show_bug.cgi?id=139652
2574         <rdar://problem/19255690>
2575
2576         Reviewed by Gavin Barraclough.
2577
2578         Use FeatureCounter API to log PageCache failure reasons
2579         as well as its success rate.
2580
2581         No new tests, no behavior change.
2582
2583         * history/PageCache.cpp:
2584         (WebCore::logCanCacheFrameDecision):
2585         (WebCore::logCanCachePageDecision):
2586         (WebCore::PageCache::canCache):
2587         * platform/FeatureCounterKeys.h: Added.
2588
2589 2014-12-15  Beth Dakin  <bdakin@apple.com>
2590
2591         Speculative build fix.
2592
2593         * platform/spi/mac/LookupSPI.h:
2594
2595 2014-12-15  Beth Dakin  <bdakin@apple.com>
2596
2597         Speculative build fix.
2598
2599         * platform/spi/mac/LookupSPI.h:
2600
2601 2014-12-15  Jer Noble  <jer.noble@apple.com>
2602
2603         Switching src of <video> with clipping layer results in empty black square.
2604         https://bugs.webkit.org/show_bug.cgi?id=139650
2605
2606         Reviewed by Simon Fraser.
2607
2608         Test: compositing/video-clip-change-src.html
2609
2610         When the contentsLayer changes after a contentsClippingLayer has already been created, make sure to parent the
2611         new contentsLayer, as updateRects() will only reparent when first creating a contentsClippingLayer.
2612
2613         * platform/graphics/ca/GraphicsLayerCA.cpp:
2614         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
2615
2616 2014-12-15  Beth Dakin  <bdakin@apple.com>
2617
2618         Make lookup an immediate action instead of an action menu item
2619         https://bugs.webkit.org/show_bug.cgi?id=139661
2620         -and corresponding-
2621         rdar://problem/19198414
2622
2623         Reviewed by Tim Horton.
2624
2625         New SPI.
2626         * platform/spi/mac/LookupSPI.h:
2627
2628 2014-12-12  Anders Carlsson  <andersca@apple.com>
2629
2630         Get rid of the DONT_FINALIZE_ON_MAIN_THREAD #define
2631         https://bugs.webkit.org/show_bug.cgi?id=139613
2632
2633         Reviewed by Sam Weinig.
2634
2635         * WebCore.exp.in:
2636         Update symbols.
2637
2638         * WebCore.xcodeproj/project.pbxproj:
2639         Remove -Wno-deprecated-declarations from the WebCoreObjCExtras.mm build flags.
2640
2641         * platform/mac/WebCoreObjCExtras.h:
2642         If OBJC_NO_GC is defined to 1, just make WebCoreObjCFinalizeOnMainThread a no-op inline function.
2643
2644         * platform/mac/WebCoreObjCExtras.mm:
2645         (WebCoreObjCFinalizeOnMainThread):
2646         Move this to the .h file for easier inlining.
2647
2648         (WebCoreObjCScheduleDeallocateOnMainThread):
2649         Use a lambda.
2650
2651 2014-12-15  Gavin Barraclough  <barraclough@apple.com>
2652
2653         Separate counted and hysteresis activities in PageThrottler
2654         https://bugs.webkit.org/show_bug.cgi?id=139657
2655
2656         Reviewed by Sam Weinig.
2657
2658         Currently all activities funnel into a common hysteresis mechanism, the result of
2659         which is combined with the visually idle state, the result of which in turn drives
2660         a UserActivity::Impl.
2661
2662         This is a first refactoring towards moving the UserActivity out to WebKit2. Use
2663         m_hysteresis only of the impulse activities (plugin evaluation, user input), and
2664         flatten the three types of activities (impulse, counted, ViewState) to all directly
2665         control a UserActivity. Switch from a UserActivity::Impl to a UserActivity since
2666         this will provide hysteresis for media activity.
2667
2668         * page/PageThrottler.cpp:
2669         (WebCore::m_pageActivityCounter):
2670             - when the RefCounter changes just call updateUserActivity directly, removeed redundant call to updateUserActivity.
2671         (WebCore::PageThrottler::createUserActivity):
2672             - m_activity is now a UserActivity.
2673         (WebCore::PageThrottler::updateUserActivity):
2674             - previously just checked m_hysteresis for activity; now check m_pageActivityCounter too.
2675         (WebCore::PageThrottler::pageActivityCounterValueDidChange): Deleted.
2676             - no longer needed; when the RefCounter changes just call updateUserActivity directly.
2677         * page/PageThrottler.h:
2678             - removed pageActivityCounterValueDidChange, m_activity is now a UserActivity.
2679
2680 2014-12-15  Commit Queue  <commit-queue@webkit.org>
2681
2682         Unreviewed, rolling out r177284.
2683         https://bugs.webkit.org/show_bug.cgi?id=139658
2684
2685         "Breaks API tests and LayoutTests on Yosemite Debug"
2686         (Requested by msaboff on #webkit).
2687
2688         Reverted changeset:
2689
2690         "Make sure range based iteration of Vector<> still receives
2691         bounds checking"
2692         https://bugs.webkit.org/show_bug.cgi?id=138821
2693         http://trac.webkit.org/changeset/177284
2694
2695 2014-12-15  Ryosuke Niwa  <rniwa@webkit.org>
2696
2697         cloneNode(true) does not clone nested template elements' contents
2698         https://bugs.webkit.org/show_bug.cgi?id=137755
2699
2700         Reviewed by Darin Adler.
2701
2702         The bug was caused by cloneChildNodes not copying template element's content.
2703
2704         Fixed the bug by adding the third behavior (CloneContent) to the polymorphic
2705         cloneNodeInternal, which copies template element's content but not its children,
2706         in addition to the existing CloneSelf (deep=false) and CloneChildren (deep=true).
2707
2708         Test: fast/dom/HTMLTemplateElement/cloneNode-nested-templates.html
2709
2710         * dom/Attr.cpp:
2711         (WebCore::Attr::cloneNodeInternal): Renamed from cloneNode.
2712         * dom/Attr.h:
2713         * dom/CDATASection.cpp:
2714         (WebCore::CDATASection::cloneNodeInternal): Renamed from cloneNode.
2715         * dom/CDATASection.h:
2716         * dom/Comment.cpp:
2717         (WebCore::Comment::cloneNodeInternal): Renamed from cloneNode.
2718         * dom/Comment.h:
2719         * dom/ContainerNode.cpp:
2720         (WebCore::ContainerNode::cloneChildNodes): Calls cloneNode with CloneContent.
2721         * dom/Document.cpp:
2722         (WebCore::Document::cloneNodeInternal): Renamed from cloneNode.
2723         * dom/Document.h:
2724         * dom/DocumentFragment.cpp:
2725         (WebCore::DocumentFragment::cloneNodeInternal): Renamed from cloneNode.
2726         * dom/DocumentFragment.h:
2727         * dom/DocumentType.cpp:
2728         (WebCore::DocumentType::cloneNodeInternal): Renamed from cloneNode.
2729         * dom/DocumentType.h:
2730         * dom/Element.cpp:
2731         (WebCore::Element::cloneNodeInternal): Renamed from cloneNode.
2732         * dom/Element.h:
2733         * dom/EntityReference.cpp:
2734         (WebCore::EntityReference::cloneNodeInternal): Renamed from cloneNode.
2735         * dom/EntityReference.h:
2736         * dom/Node.h:
2737         (WebCore::Node::cloneNode): Added. It calls cloneNodeInternal with CloneSelf or CloneChildren.
2738         * dom/ProcessingInstruction.cpp:
2739         (WebCore::ProcessingInstruction::cloneNodeInternal): Renamed from cloneNode.
2740         * dom/ProcessingInstruction.h:
2741         * dom/ShadowRoot.cpp:
2742         (WebCore::ShadowRoot::cloneNodeInternal): Renamed from cloneNode. Also moved from ShadowRoot.h.
2743         * dom/ShadowRoot.h:
2744         * dom/Text.cpp:
2745         (WebCore::Text::cloneNodeInternal): Renamed from cloneNode.
2746         * dom/Text.h:
2747         * html/HTMLTemplateElement.cpp:
2748         (WebCore::HTMLTemplateElement::cloneNodeInternal): Renamed from cloneNode. This is the only
2749         function in which CloneContent results in a different behavior from CloneSelf.
2750         * html/HTMLTemplateElement.h:
2751
2752 2014-12-15  Benjamin Poulain  <bpoulain@apple.com>
2753
2754         Unify the various serialization of selector list
2755         https://bugs.webkit.org/show_bug.cgi?id=139606
2756
2757         Reviewed by Andreas Kling.
2758
2759         There were code in various place to build a string from the selectors contained
2760         in a selecor list.
2761
2762         This patch adds a single function to do that: buildSelectorsText(). All the call sites
2763         were modified to use it.
2764
2765         The serialization of :-webkit-any() gets fixed as a result.
2766
2767         * css/CSSSelector.cpp:
2768         (WebCore::CSSSelector::selectorText):
2769         (WebCore::appendSelectorList): Deleted.
2770         * css/CSSSelectorList.cpp:
2771         (WebCore::CSSSelectorList::selectorsText):
2772         (WebCore::CSSSelectorList::buildSelectorsText):
2773         * css/CSSSelectorList.h:
2774         * css/CSSStyleRule.cpp:
2775         (WebCore::CSSStyleRule::generateSelectorText):
2776         * css/WebKitCSSRegionRule.cpp:
2777         (WebCore::WebKitCSSRegionRule::cssText):
2778
2779 2014-12-15  Antti Koivisto  <antti@apple.com>
2780
2781         Try to fix iOS build.
2782
2783         * WebCore.exp.in:
2784
2785 2014-12-15  Javier Fernandez  <jfernandez@igalia.com>
2786
2787         Floats Don't Overhang Their Block Formatting Contex
2788         https://bugs.webkit.org/show_bug.cgi?id=139476
2789
2790         Reviewed by David Hyatt.
2791
2792         From Blink r172530 by <robhogan@gmail.com>
2793
2794         Floats Don't Overhang Their Block Formatting Context Per
2795         http://www.w3.org/TR/CSS2/visuren.html#float-position: "References
2796         to [the elements] in the [rules that govern the behaviour of
2797         floats] refer only to other elements in the same block formatting
2798         context as the float."
2799
2800         This means we don't need to look for intruding or overhanging
2801         floats in boxes that establish a new block formatting
2802         context. Even that we don't have a test breaking this rule it
2803         seems we are doing unnecessary work in
2804         rebuildFloatsFromIntruding() so make sure we avoid adding floats
2805         from different block formatting contexts.
2806
2807         Test:
2808         fast/block/float/floats-do-not-overhang-from-block-formatting-context.html
2809
2810         * rendering/RenderBlockFlow.cpp:
2811         (WebCore::RenderBlockFlow::addIntrudingFloats):
2812
2813 2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
2814
2815         Unreviewed build fix after r177301
2816
2817         * html/ColorInputType.cpp:
2818         (WebCore::ColorInputType::elementRectRelativeToRootView):
2819
2820 2014-12-15  Timothy Horton  <timothy_horton@apple.com>
2821
2822         Implement Data Detectors immediate actions for WebKit2
2823         https://bugs.webkit.org/show_bug.cgi?id=139617
2824         <rdar://problem/19198539>
2825
2826         Reviewed by Beth Dakin.
2827
2828         * platform/spi/mac/DataDetectorsSPI.h:
2829         Add some new SPI.
2830
2831 2014-12-12  Simon Fraser  <simon.fraser@apple.com>
2832
2833         REGRESSION (r168217): Images are cropped out during animation at jetblue.com
2834         https://bugs.webkit.org/show_bug.cgi?id=136410
2835         rdar://problem/18188533
2836
2837         Reviewed by Dean Jackson.
2838         
2839         During GraphicsLayer flushing, for tiled layers we can compute a visible rect using
2840         the current state of an animation, which is obtained via the AnimationController.
2841         If that animation was running in a subframe, AnimationController could use a stale
2842         beginAnimationUpdateTime since no-one called its beginAnimationUpdate(). That
2843         resulted in an incorrect computation of the visible rect, resulting in missing tiles.
2844         
2845         There are two parts to this fix. First, add an assertion that beginAnimationUpdateTime()
2846         is being called inside an animation update block. This required moving m_beginAnimationUpdateCount
2847         into AnimationControllerPrivate, and changes to endAnimationUpdate().
2848         
2849         The second is adding a AnimationUpdateBlock to getAnimatedStyleForRenderer(), which
2850         can be called outside of style resolution. We also need some in other API functions.
2851         
2852         Testing revealed that layout can call via layoutOverflowRectForPropagation(), suggesting
2853         that we should have an animation batch inside FrameView::layout(). In addition, a single
2854         resolveStyle/layout should use the same animationBeginTime, so we add a batch to 
2855         updateLayoutAndStyleIfNeededRecursive().
2856         
2857         Identical to the patch that was rolled out in r177269 with the addition of a 
2858         Ref<Frame> protector(m_frame) in AnimationControllerPrivate::animationTimerFired()
2859         that ensures that the AnimationControllerPrivate is kept alive for the scope of
2860         the AnimationPrivateUpdateBlock, when a transitionEnd event destroys an iframe.
2861         
2862         No test because it's timing-dependent. Existing tests exercise the new assertion.
2863
2864         * css/CSSComputedStyleDeclaration.cpp:
2865         (WebCore::computeRenderStyleForProperty):
2866         * page/FrameView.cpp:
2867         (WebCore::FrameView::layout):
2868         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
2869         * page/animation/AnimationController.cpp:
2870         (WebCore::AnimationPrivateUpdateBlock::AnimationPrivateUpdateBlock):
2871         (WebCore::AnimationPrivateUpdateBlock::~AnimationPrivateUpdateBlock):
2872         (WebCore::AnimationControllerPrivate::AnimationControllerPrivate):
2873         (WebCore::AnimationControllerPrivate::animationTimerFired):
2874         (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
2875         (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
2876         (WebCore::AnimationControllerPrivate::beginAnimationUpdateTime):
2877         (WebCore::AnimationControllerPrivate::beginAnimationUpdate):
2878         (WebCore::AnimationControllerPrivate::endAnimationUpdate):
2879         (WebCore::AnimationControllerPrivate::getAnimatedStyleForRenderer):
2880         (WebCore::AnimationController::AnimationController):
2881         (WebCore::AnimationController::notifyAnimationStarted):
2882         (WebCore::AnimationController::pauseAnimationAtTime):
2883         (WebCore::AnimationController::pauseTransitionAtTime):
2884         (WebCore::AnimationController::resumeAnimationsForDocument):
2885         (WebCore::AnimationController::startAnimationsIfNotSuspended):
2886         (WebCore::AnimationController::beginAnimationUpdate):
2887         (WebCore::AnimationController::endAnimationUpdate):
2888         * page/animation/AnimationController.h:
2889         * page/animation/AnimationControllerPrivate.h:
2890
2891 2014-12-12  Simon Fraser  <simon.fraser@apple.com>
2892
2893         REGRESSION (r168217): Images are cropped out during animation at jetblue.com
2894         https://bugs.webkit.org/show_bug.cgi?id=136410
2895
2896         Reviewed by Dean Jackson.
2897
2898         We were hitting the new assertion under Page::setPageScaleFactor(), which
2899         calls recalcStyle(), so move the AnimationUpdateBlock from updateStyleIfNeeded()
2900         to recalcStyle().
2901
2902         * dom/Document.cpp:
2903         (WebCore::Document::recalcStyle):
2904         (WebCore::Document::updateStyleIfNeeded):
2905
2906 2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
2907
2908         Addressing post-review comments in r177035
2909         https://bugs.webkit.org/show_bug.cgi?id=139557
2910
2911         Reviewed by Darin Adler.
2912
2913         This patch deletes the helper functions rendererBoundingBox() and rendererAnchorRect() and
2914         migrates callers to using renderers directly.
2915
2916         It also improves the comment in RenderElement.h regarding RenderElement::anchorRect().
2917
2918         No new tests because this is simply refactoring.
2919
2920         * WebCore.exp.in: Delete exported symbol for rendererBoundingBox()
2921         * accessibility/AccessibilitySlider.cpp:
2922         (WebCore::AccessibilitySliderThumb::elementRect): Migrate off rendererBoundingBox()
2923         * dom/ContainerNode.cpp:
2924         (WebCore::rendererAnchorRect): Deleted.
2925         * dom/ContainerNode.h:
2926         * dom/Node.cpp:
2927         (WebCore::rendererBoundingBox): Deleted.
2928         * dom/Node.h:
2929         * html/ColorInputType.cpp:
2930         (WebCore::ColorInputType::elementRectRelativeToRootView): Migrate off rendererBoundingBox().
2931         * html/HTMLInputElement.cpp:
2932         (WebCore::HTMLInputElement::setupDateTimeChooserParameters): Ditto.
2933         * html/ValidationMessage.cpp:
2934         (WebCore::ValidationMessage::buildBubbleTree): Ditto.
2935         * page/FrameView.cpp:
2936         (WebCore::FrameView::scrollElementToRect): Migrate off rendererAnchorRect().
2937         (WebCore::FrameView::scrollToAnchor): Ditto.
2938         * page/SpatialNavigation.cpp:
2939         (WebCore::nodeRectInAbsoluteCoordinates): Migrate off rendererBoundingBox().
2940         * rendering/RenderElement.h:
2941
2942 2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
2943
2944         Delete Notation because we don't use it
2945         https://bugs.webkit.org/show_bug.cgi?id=139171
2946
2947         Reviewed by Kent Tamura.
2948
2949         No tests because this is un-exposing something that never gets instantiated.
2950
2951         * CMakeLists.txt:
2952         * DerivedSources.cpp:
2953         * DerivedSources.make:
2954         * WebCore.exp.in:
2955         * WebCore.order:
2956         * WebCore.vcxproj/WebCore.vcxproj:
2957         * WebCore.vcxproj/WebCore.vcxproj.filters:
2958         * WebCore.xcodeproj/project.pbxproj:
2959         * bindings/gobject/WebKitDOMNodeFilter.h:
2960         * bindings/gobject/WebKitDOMNodeFilter.symbols:
2961         * bindings/gobject/WebKitDOMPrivate.cpp:
2962         (WebKit::wrap):
2963         * bindings/gobject/webkitdom.symbols:
2964         * bindings/js/JSNodeCustom.cpp:
2965         (WebCore::createWrapperInline):
2966         * bindings/objc/DOM.mm:
2967         (kitClass):
2968         * bindings/objc/DOMCore.h:
2969         * bindings/objc/PublicDOMInterfaces.h:
2970         * dom/DOMAllInOne.cpp:
2971         * dom/Document.cpp:
2972         (WebCore::Document::importNode):
2973         (WebCore::Document::adoptNode):
2974         (WebCore::Document::childTypeAllowed):
2975         (WebCore::Document::canReplaceChild):
2976         * dom/Node.cpp:
2977         (WebCore::Node::dumpStatistics):
2978         (WebCore::Node::isDefaultNamespace):
2979         (WebCore::Node::lookupPrefix):
2980         (WebCore::Node::lookupNamespaceURI):
2981         (WebCore::appendTextContent):
2982         (WebCore::Node::setTextContent):
2983         * dom/Node.h:
2984         * dom/Node.idl:
2985         * dom/NodeFilter.h:
2986         * dom/NodeFilter.idl:
2987         * dom/Notation.cpp: Removed.
2988         * dom/Notation.h: Removed.
2989         * dom/Notation.idl: Removed.
2990         * dom/Range.cpp:
2991         (WebCore::lengthOfContentsInNode):
2992         (WebCore::Range::processContentsBetweenOffsets):
2993         (WebCore::Range::insertNode):
2994         (WebCore::Range::checkNodeWOffset):
2995         (WebCore::Range::checkNodeBA):
2996         (WebCore::Range::selectNode):
2997         (WebCore::Range::selectNodeContents):
2998         (WebCore::Range::surroundContents):
2999         * editing/MarkupAccumulator.cpp:
3000         (WebCore::MarkupAccumulator::appendStartMarkup):
3001         * xml/XPathUtil.cpp:
3002         (WebCore::XPath::isValidContextNode):
3003
3004 2014-12-15  Gavin Barraclough  <barraclough@apple.com>
3005
3006         Change HysteresisActivity to use a lambda
3007         https://bugs.webkit.org/show_bug.cgi?id=139636
3008
3009         Reviewed by Darin Adler.
3010
3011         The current implementation provides notifications via callbacks to a delegate. Using a delegate
3012         with callbacks is limiting a number of ways. The callback names are very ambiguous, the callbacks
3013         must either be on a separate object (more boilerplate), or the callback must be public for
3014         HysteresisActivity to call them, or friends get involved. Without the boilerplate of extra
3015         delegate objects it's hard to scale use of these objects - a single object can't serve as a
3016         delegate for multiple HysteresisActivity members.
3017
3018         Instead, make HysteresisActivity take a lambda to callback on state change. To simplify, changed
3019         HysteresisState to only track Started/Stopped states (removed WillStopPendingTimeout).
3020
3021         * WebCore.exp.in:
3022             - removed exports of deleted functions.
3023         * page/PageThrottler.cpp:
3024         (WebCore::PageThrottler::PageThrottler):
3025             - m_hysteresis lambda calls updateUserActivity.
3026         (WebCore::PageThrottler::pageActivityCounterValueDidChange):
3027             - ASSERT updated due to removal of WillStopPendingTimeout state.
3028         (WebCore::PageThrottler::started): Deleted.
3029         (WebCore::PageThrottler::stopped): Deleted.
3030             - functionality replaced by lambda.
3031         * page/PageThrottler.h:
3032             - HysteresisActivity is no longer templated on delegate type, removed function declarations & friend.
3033         * platform/HysteresisActivity.h:
3034         (WebCore::HysteresisActivity::HysteresisActivity):
3035             - HysteresisActivity takes a lambda, not a delegate.
3036         (WebCore::HysteresisActivity::start):
3037             - delegate call -> callback.
3038         (WebCore::HysteresisActivity::state):
3039             - simplified to remove WillStopPendingTimeout.
3040         (WebCore::HysteresisActivity::hysteresisTimerFired):
3041             - delegate call -> callback.
3042         * platform/UserActivity.cpp:
3043         (WebCore::UserActivity::UserActivity):
3044             - HysteresisActivity lambda calls hysteresisUpdated.
3045         (WebCore::UserActivity::hysteresisUpdated):
3046         (WebCore::UserActivity::started): Deleted.
3047         (WebCore::UserActivity::stopped): Deleted.
3048             - started/stopped -> hysteresisUpdated.
3049         * platform/UserActivity.h:
3050             - started/stopped -> hysteresisUpdated, removed friend.
3051
3052 2014-12-15  Antti Koivisto  <antti@apple.com>
3053
3054         WebKit level persistent caching
3055         https://bugs.webkit.org/show_bug.cgi?id=30322
3056
3057         Reviewed by Sam Weinig.
3058
3059         Test: http/tests/cache/disk-cache-validation.html
3060
3061         * WebCore.exp.in:
3062         * inspector/InspectorResourceAgent.cpp:
3063         (WebCore::buildObjectForResourceResponse):
3064         * platform/network/ResourceResponseBase.cpp:
3065         (WebCore::ResourceResponseBase::ResourceResponseBase):
3066         (WebCore::ResourceResponseBase::source):
3067         (WebCore::ResourceResponseBase::setSource):
3068         (WebCore::ResourceResponseBase::wasCached): Deleted.
3069         (WebCore::ResourceResponseBase::setWasCached): Deleted.
3070
3071             Replace wasCached bit with Source enum.
3072             This is useful for testing.
3073
3074         * platform/network/ResourceResponseBase.h:
3075         (WebCore::ResourceResponseBase::containsCertificateInfo):
3076         (WebCore::ResourceResponseBase::encode):
3077         (WebCore::ResourceResponseBase::decode):
3078         * testing/Internals.cpp:
3079         (WebCore::Internals::xhrResponseSource):
3080         (WebCore::Internals::clearMemoryCache):
3081         * testing/Internals.h:
3082         * testing/Internals.idl:
3083
3084             Testing support.
3085
3086         * xml/XMLHttpRequest.h:
3087
3088 2014-12-15  Andreas Kling  <akling@apple.com>
3089
3090         Purge PassRefPtr from FocusEvent code.
3091         <https://webkit.org/b/139647>
3092
3093         Reviewed by Anders Carlsson.
3094
3095         Convert FocusEvent-related code from using PassRefPtr to using RefPtr&& instead.
3096
3097         * dom/Document.cpp:
3098         (WebCore::Document::setFocusedElement):
3099         * dom/Element.cpp:
3100         (WebCore::Element::dispatchFocusInEvent):
3101         (WebCore::Element::dispatchFocusOutEvent):
3102         (WebCore::Element::dispatchFocusEvent):
3103         (WebCore::Element::dispatchBlurEvent):
3104         * dom/Element.h:
3105         * dom/FocusEvent.cpp:
3106         (WebCore::FocusEvent::FocusEvent):
3107         * dom/FocusEvent.h:
3108         * html/HTMLFormControlElement.cpp:
3109         (WebCore::HTMLFormControlElement::dispatchBlurEvent):
3110         * html/HTMLFormControlElement.h:
3111         * html/HTMLSelectElement.cpp:
3112         (WebCore::HTMLSelectElement::dispatchFocusEvent):
3113         (WebCore::HTMLSelectElement::dispatchBlurEvent):
3114         * html/HTMLSelectElement.h:
3115         * html/HTMLTextFormControlElement.cpp:
3116         (WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
3117         (WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
3118         * html/HTMLTextFormControlElement.h:
3119         * page/FocusController.cpp:
3120         (WebCore::dispatchEventsOnWindowAndFocusedElement):
3121
3122 2014-12-15  Myles C. Maxfield  <mmaxfield@apple.com>
3123
3124         [iOS] Codepoints not associated with languages are drawn as boxes
3125         https://bugs.webkit.org/show_bug.cgi?id=138906
3126
3127         Reviewed by Darin Adler.
3128
3129         Use SPI CTFontCreateForCharacters(), but only if we don't already know what to do
3130         with the characters.
3131
3132         Test: platform/ios-simulator/fast/text/non-language-font-fallback.html
3133
3134         * platform/graphics/ios/FontCacheIOS.mm:
3135         (WebCore::FontCache::systemFallbackForCharacters):
3136         * platform/spi/cocoa/CoreTextSPI.h:
3137
3138 2014-12-15  Bem Jones-Bey  <bjonesbe@adobe.com>
3139
3140         [CSS Shapes] Fix StyleBuilder code to use CSSValueNone to match spec and other code
3141         https://bugs.webkit.org/show_bug.cgi?id=139601
3142
3143         Reviewed by Chris Dumez.
3144
3145         Change the code to properly use CSSValueNone instead of CSSValueAuto.
3146         Asserts have been added to catch similar errors in the future.
3147         In doing this change, it became apparent that there is nothing
3148         special about the shape-outside property that requires custom code, so
3149         it was changed to use a standard converter function. 
3150
3151         No change observable via LayoutTests.
3152
3153         * css/CSSPropertyNames.in: Use a converter instead of custom code.
3154         * css/StyleBuilderConverter.h:
3155         (WebCore::isImageShape): Helper function so that isImageSetValue can
3156             be properly guarded.
3157         (WebCore::StyleBuilderConverter::convertShapeValue): Format as a
3158             converter instead of custom code.
3159         * css/StyleBuilderCustom.h:
3160         (WebCore::StyleBuilderCustom::applyValueWebkitShapeOutside): Deleted.
3161
3162 2014-12-15  Oliver Hunt  <oliver@apple.com>
3163
3164         Make sure range based iteration of Vector<> still receives bounds checking
3165         https://bugs.webkit.org/show_bug.cgi?id=138821
3166
3167         Reviewed by Mark Lam.
3168
3169         Update to deal with different iterator type.
3170
3171         * bindings/js/SerializedScriptValue.cpp:
3172         (WebCore::CloneDeserializer::deserializeString):
3173         * editing/TextIterator.cpp:
3174         (WebCore::SearchBuffer::isBadMatch):
3175         * page/mac/ServicesOverlayController.mm:
3176         (WebCore::ServicesOverlayController::buildSelectionHighlight):
3177         * platform/graphics/SegmentedFontData.cpp:
3178         (WebCore::SegmentedFontData::fontDataForCharacter):
3179         (WebCore::SegmentedFontData::containsCharacter):
3180         (WebCore::SegmentedFontData::isLoading):
3181         * platform/graphics/WOFFFileFormat.cpp:
3182         (WebCore::convertWOFFToSfnt):
3183         * platform/graphics/cairo/GradientCairo.cpp:
3184         (WebCore::Gradient::platformGradient):
3185         * platform/image-decoders/gif/GIFImageDecoder.cpp:
3186         (WebCore::GIFImageDecoder::clearFrameBufferCache):
3187         * rendering/RenderBox.cpp:
3188         (WebCore::RenderBox::paintFillLayers):
3189         * rendering/style/GridResolvedPosition.cpp:
3190         (WebCore::firstNamedGridLineBeforePosition):
3191         (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
3192         * svg/SVGFontElement.cpp:
3193         (WebCore::kerningForPairOfStringsAndGlyphs):
3194         * svg/SVGPathByteStream.h:
3195         (WebCore::SVGPathByteStream::append):
3196         * xml/XPathNodeSet.h:
3197         (WebCore::XPath::NodeSet::begin):
3198         (WebCore::XPath::NodeSet::end):
3199
3200 2014-12-15  Chris Dumez  <cdumez@apple.com>
3201
3202         Move '-webkit-text-decoration-skip' to the new StyleBuilder
3203         https://bugs.webkit.org/show_bug.cgi?id=139633
3204
3205         Reviewed by Darin Adler.
3206
3207         Move '-webkit-text-decoration-skip' to the new StyleBuilder by
3208         introducing a new TextDecorationSkip converter.
3209
3210         No new tests, no behavior change.
3211
3212         * css/CSSPropertyNames.in:
3213         * css/DeprecatedStyleBuilder.cpp:
3214         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3215         (WebCore::valueToDecorationSkip): Deleted.
3216         (WebCore::ApplyPropertyTextDecorationSkip::applyValue): Deleted.
3217         (WebCore::ApplyPropertyTextDecorationSkip::createHandler): Deleted.
3218         * css/StyleBuilderConverter.h:
3219         (WebCore::StyleBuilderConverter::valueToDecorationSkip):
3220         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
3221
3222 2014-12-15  Bartlomiej Gajda  <b.gajda@samsung.com>
3223
3224         [MSE] Prevent SourceBuffer monitoring algorithm from triggering a HAVE_NOTHING to HAVE_METADATA transition.
3225         https://bugs.webkit.org/show_bug.cgi?id=139444
3226
3227         Reviewed by Jer Noble.
3228
3229         In case of 2 SourceBuffers, there can be transition to HaveMetadata from monitorSourceBuffers,
3230         even though second SourceBuffer did not receive init segment - we can't query for it's metadata
3231         such as width/height (if second one was video), so we shouldn't fire the event.
3232         W3 Bug reference : https://www.w3.org/Bugs/Public/show_bug.cgi?id=27542
3233
3234         Test: media/media-source/media-source-loadedmetada-with-two-sourcebuffers.html
3235
3236         * Modules/mediasource/MediaSource.cpp:
3237         (WebCore::MediaSource::monitorSourceBuffers):
3238         * Modules/mediasource/SourceBuffer.h:
3239         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
3240         (WebCore::mimeTypeCache):
3241
3242 2014-12-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3243
3244         Move WebCore/platform/text to std::unique_ptr 
3245         https://bugs.webkit.org/show_bug.cgi?id=139395
3246
3247         Reviewed by Darin Adler.
3248
3249         As a step to use std::unique_ptr<>, this patch replaces OwnPtr|PassOwnPtr with
3250         std::unique_ptr<> | std::make_unique<>.
3251
3252         * dom/Document.h:
3253         * platform/text/LineBreakIteratorPoolICU.h:
3254         (WebCore::LineBreakIteratorPool::LineBreakIteratorPool):
3255         (WebCore::LineBreakIteratorPool::create): Deleted.
3256         * platform/text/LocaleICU.cpp:
3257         (WebCore::Locale::create):
3258         (WebCore::LocaleICU::createLabelVector):
3259         (WebCore::createFallbackMonthLabels):
3260         (WebCore::createFallbackAMPMLabels):
3261         (WebCore::LocaleICU::initializeDateTimeFormat):
3262         (WebCore::LocaleICU::shortMonthLabels):
3263         (WebCore::LocaleICU::create): Deleted.
3264         (WebCore::LocaleICU::standAloneMonthLabels): Deleted.
3265         (WebCore::LocaleICU::shortStandAloneMonthLabels): Deleted.
3266         * platform/text/LocaleICU.h:
3267         * platform/text/LocaleNone.cpp:
3268         (WebCore::Locale::create):
3269         * platform/text/PlatformLocale.h:
3270         (WebCore::Locale::createDefault):
3271         * platform/text/TextCodecLatin1.cpp:
3272         * platform/text/TextCodecUTF16.cpp:
3273         * platform/text/TextEncoding.cpp:
3274         * platform/text/mac/LocaleMac.h:
3275         * platform/text/mac/LocaleMac.mm:
3276         (WebCore::Locale::create):
3277         (WebCore::LocaleMac::create):
3278         * platform/text/mac/TextCodecMac.cpp:
3279         * platform/text/win/LocaleWin.cpp:
3280         (WebCore::Locale::create):
3281         (WebCore::LocaleWin::create):
3282         * platform/text/win/LocaleWin.h:
3283         * platform/text/win/TextCodecWin.cpp:
3284         (WebCore::newTextCodecWin):
3285
3286 2014-12-15  Xavier Claessens  <xavier.claessens@collabora.com>
3287
3288         [GStreamer] the webkitwebsrc element can stale
3289         https://bugs.webkit.org/show_bug.cgi?id=138425
3290
3291         Reviewed by Philippe Normand.
3292
3293         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3294         (removeTimeoutSources):
3295         (webKitWebSrcStart):
3296         (webKitWebSrcChangeState):
3297
3298 2014-12-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3299
3300         [GTK] Remove GamepadDeviceGtk::create()
3301         https://bugs.webkit.org/show_bug.cgi?id=139637
3302
3303         Reviewed by Carlos Garcia Campos.
3304
3305         std::make_unique<> can replace GamepadDeviceGtk::create() factory function.
3306
3307         * platform/gtk/GamepadsGtk.cpp: Add "explicit" to GamepadsGtk constructor.
3308         (WebCore::GamepadsGtk::registerDevice):
3309         (WebCore::GamepadDeviceGtk::create): Deleted.
3310
3311 2014-12-15  Chris Dumez  <cdumez@apple.com>
3312
3313         Move 'counter-increment' / 'counter-reset' to the new StyleBuilder
3314         https://bugs.webkit.org/show_bug.cgi?id=139635
3315
3316         Reviewed by Antti Koivisto.
3317
3318         Move 'counter-increment' / 'counter-reset' to the new StyleBuilder by
3319         using custom code.
3320
3321         No new tests, no behavior change.
3322
3323         * css/CSSPropertyNames.in:
3324         * css/DeprecatedStyleBuilder.cpp:
3325         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
3326         (WebCore::ApplyPropertyCounter::emptyFunction): Deleted.
3327         (WebCore::ApplyPropertyCounter::applyInheritValue): Deleted.
3328         (WebCore::ApplyPropertyCounter::applyValue): Deleted.
3329         (WebCore::ApplyPropertyCounter::createHandler): Deleted.
3330         * css/StyleBuilderCustom.h:
3331         (WebCore::StyleBuilderCustom::applyInitialCounterIncrement):
3332         (WebCore::StyleBuilderCustom::applyInitialCounterReset):
3333         (WebCore::StyleBuilderCustom::applyInheritCounter):
3334         (WebCore::StyleBuilderCustom::applyValueCounter):
3335         (WebCore::StyleBuilderCustom::applyInheritCounterIncrement):
3336         (WebCore::StyleBuilderCustom::applyValueCounterIncrement):
3337         (WebCore::StyleBuilderCustom::applyInheritCounterReset):
3338         (WebCore::StyleBuilderCustom::applyValueCounterReset):
3339
3340 2014-12-14  Commit Queue  <commit-queue@webkit.org>
3341
3342         Unreviewed, rolling out r177238 and r177244.
3343         https://bugs.webkit.org/show_bug.cgi?id=139632
3344
3345         Introduced memory corruption (Requested by ap on #webkit).
3346
3347         Reverted changesets:
3348
3349         "REGRESSION (r168217): Images are cropped out during animation
3350         at jetblue.com"
3351         https://bugs.webkit.org/show_bug.cgi?id=136410
3352         http://trac.webkit.org/changeset/177238
3353
3354         https://bugs.webkit.org/show_bug.cgi?id=139596
3355         http://trac.webkit.org/changeset/177244
3356
3357 2014-12-14  Commit Queue  <commit-queue@webkit.org>
3358
3359         Unreviewed, rolling out r177223 and r177226.
3360         https://bugs.webkit.org/show_bug.cgi?id=139631
3361
3362         Multiple tests are flakily asserting in
3363         StyleResolver::loadPendingResources (Requested by ap_ on
3364         #webkit).
3365
3366         Reverted changesets:
3367
3368         "[SVG Masking] Enable the use of <mask> elements for -webkit-
3369         mask-image"
3370         https://bugs.webkit.org/show_bug.cgi?id=139294
3371         http://trac.webkit.org/changeset/177223
3372
3373         "animations/cross-fade-webkit-mask-image.html is flaky"
3374         https://bugs.webkit.org/show_bug.cgi?id=139590
3375         http://trac.webkit.org/changeset/177226
3376
3377 2014-12-14  Andreas Kling  <akling@apple.com>
3378
3379         Event construction helpers should return Ref instead of PassRefPtr.
3380         <https://webkit.org/b/139625>
3381
3382         Reviewed by Antti Koivisto.
3383
3384         Change all the FooEvent::create() construction helpers to return Ref<FooEvent>
3385         instead of PassRefPtr<FooEvent>.
3386
3387         This allows the compiler to omit null checks at each call site, since we know
3388         that these functions always return valid objects.
3389
3390         * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.h:
3391         (WebCore::WebKitPlaybackTargetAvailabilityEvent::create):
3392         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
3393         (WebCore::MediaKeyMessageEvent::create):
3394         * Modules/encryptedmedia/MediaKeyNeededEvent.h:
3395         (WebCore::MediaKeyNeededEvent::create):
3396         * Modules/gamepad/GamepadEvent.h:
3397         (WebCore::GamepadEvent::create):
3398         * Modules/indexeddb/IDBVersionChangeEvent.h:
3399         (WebCore::IDBVersionChangeEvent::create):
3400         * Modules/indieui/UIRequestEvent.cpp:
3401         (WebCore::UIRequestEvent::create):
3402         * Modules/indieui/UIRequestEvent.h:
3403         * Modules/mediastream/MediaStreamEvent.cpp:
3404         (WebCore::MediaStreamEvent::create):
3405         * Modules/mediastream/MediaStreamEvent.h:
3406         * Modules/mediastream/MediaStreamTrackEvent.cpp:
3407         (WebCore::MediaStreamTrackEvent::create):
3408         * Modules/mediastream/MediaStreamTrackEvent.h:
3409         * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
3410         (WebCore::RTCDTMFToneChangeEvent::create):
3411         * Modules/mediastream/RTCDTMFToneChangeEvent.h:
3412         * Modules/mediastream/RTCDataChannelEvent.cpp:
3413         (WebCore::RTCDataChannelEvent::create):
3414         * Modules/mediastream/RTCDataChannelEvent.h:
3415         * Modules/mediastream/RTCIceCandidateEvent.cpp:
3416         (WebCore::RTCIceCandidateEvent::create):
3417         * Modules/mediastream/RTCIceCandidateEvent.h:
3418         * Modules/speech/SpeechSynthesisEvent.cpp:
3419         (WebCore::SpeechSynthesisEvent::create):
3420         * Modules/speech/SpeechSynthesisEvent.h:
3421         * Modules/webaudio/AudioProcessingEvent.cpp:
3422         (WebCore::AudioProcessingEvent::create):
3423         * Modules/webaudio/AudioProcessingEvent.h:
3424         * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
3425         (WebCore::OfflineAudioCompletionEvent::create):
3426         * Modules/webaudio/OfflineAudioCompletionEvent.h:
3427         * Modules/websockets/CloseEvent.h:
3428         (WebCore::CloseEvent::create):
3429         * dom/AnimationEvent.h:
3430         * dom/AutocompleteErrorEvent.h:
3431         * dom/BeforeLoadEvent.h:
3432         * dom/BeforeTextInsertedEvent.h:
3433         * dom/BeforeUnloadEvent.h:
3434         * dom/ClipboardEvent.h:
3435         * dom/CompositionEvent.h:
3436         * dom/CustomEvent.h:
3437         * dom/DeviceMotionEvent.h:
3438         * dom/DeviceOrientationEvent.h:
3439         * dom/ErrorEvent.h:
3440         * dom/Event.h:
3441         (WebCore::Event::create):
3442         * dom/FocusEvent.h:
3443         * dom/HashChangeEvent.h:
3444         * dom/KeyboardEvent.h:
3445         * dom/MessageEvent.h:
3446         * dom/MouseEvent.cpp:
3447         (WebCore::MouseEvent::create):
3448         (WebCore::SimulatedMouseEvent::create):
3449         * dom/MouseEvent.h:
3450         (WebCore::MouseEvent::create):
3451         * dom/MutationEvent.h:
3452         * dom/OverflowEvent.h:
3453         * dom/PageTransitionEvent.h:
3454         * dom/PopStateEvent.cpp:
3455         (WebCore::PopStateEvent::create):
3456         * dom/PopStateEvent.h:
3457         * dom/ProgressEvent.h:
3458         (WebCore::ProgressEvent::create):
3459         * dom/TextEvent.cpp:
3460         (WebCore::TextEvent::create):
3461         (WebCore::TextEvent::createForPlainTextPaste):
3462         (WebCore::TextEvent::createForFragmentPaste):
3463         (WebCore::TextEvent::createForDrop):
3464         (WebCore::TextEvent::createForDictation):
3465         * dom/TextEvent.h:
3466         * dom/TouchEvent.h:
3467         * dom/TransitionEvent.h:
3468         * dom/UIEvent.h:
3469         (WebCore::UIEvent::create):
3470         * dom/WebKitAnimationEvent.h:
3471         * dom/WebKitTransitionEvent.h:
3472         * dom/WheelEvent.h:
3473         * html/MediaKeyEvent.h:
3474         * html/canvas/WebGLContextEvent.h:
3475         * html/track/TrackEvent.h:
3476         * storage/StorageEvent.cpp:
3477         (WebCore::StorageEvent::create):
3478         * storage/StorageEvent.h:
3479         * svg/SVGZoomEvent.h:
3480         (WebCore::SVGZoomEvent::create):
3481         * xml/XMLHttpRequestProgressEvent.h:
3482         (WebCore::XMLHttpRequestProgressEvent::create):
3483
3484 2014-12-14  Ryosuke Niwa  <rniwa@webkit.org>
3485
3486         REGRESSION(r160182): Fragment parser doesn't close a form element with a close tag
3487         https://bugs.webkit.org/show_bug.cgi?id=139561
3488
3489         Reviewed by Darin Adler.
3490
3491         The bug was caused by us not setting the form pointer in insertHTMLFormElement.
3492         Since we already avoid associating a form inside HTMLConstructionSite::createHTMLElement,
3493         we didn't need this code at all.
3494
3495         Fixed the bug by partially reverting r160182.
3496
3497         Test: fast/dom/dom-parse-close-form.html
3498
3499         * html/parser/HTMLConstructionSite.cpp:
3500         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
3501         (WebCore::HTMLConstructionSite::insideTemplateElement): Deleted.
3502        &