Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-02-03  Chris Dumez  <cdumez@apple.com>
2
3         Drop ResourceLoadPriorityUnresolved resource load priority and use Optional<> instead
4         https://bugs.webkit.org/show_bug.cgi?id=141186
5
6         Reviewed by Antti Koivisto.
7
8         Drop ResourceLoadPriorityUnresolved resource load priority value and use
9         Optional<ResourceLoadPriority> when needed instead. If the Optional
10         doesn't have a value, then it means it is unresolved. Having
11         ResourceLoadPriorityUnresolved in ResourceLoadPriority was confusing
12         because this value is only valid in CachedResourceRequest, it is not
13         a valid value in CachedResource or in ResourceRequest. After this
14         refactoring, it now becomes more obvious.
15
16 2015-02-03  Chris Dumez  <cdumez@apple.com>
17
18         REGRESSION(176609): Very high memory usage in Canvas/reuse.html performance test
19         https://bugs.webkit.org/show_bug.cgi?id=139812
20
21         Reviewed by Geoffrey Garen.
22
23         Update DOMTimerFireState.elementsChangedOutsideViewport to keep only
24         weak pointers to the Elements, instead of ref'ing them, so as to not
25         extend their life unnecessarily (by preventing garbage-collection).
26         The same approach was already adopted in r176496 for
27         DOMTimer.m_elementsCausingThrottling to address the same issue.
28
29         No new tests, already covered by Canvas/reuse.html performance test.
30
31         * page/DOMTimer.cpp:
32         (WebCore::DOMTimerFireState::setScriptMadeNonUserObservableChangesToElement):
33         (WebCore::DOMTimerFireState::elementsChangedOutsideViewport):
34
35 2015-02-03  Jer Noble  <jer.noble@apple.com>
36
37         [MSE] Setting timestampOffset does not change the timestamps in the actual sample, leading to visual and audible errors.
38         https://bugs.webkit.org/show_bug.cgi?id=140929
39
40         Reviewed by Alexey Proskuryakov.
41
42         Fixes http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html.
43
44         Only apply the timestamp offset to the actual sample after step 1.6, where we may loop back to
45         the top, to avoid double-offsetting the same sample.
46
47         * Modules/mediasource/SourceBuffer.cpp:
48         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
49
50 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
51
52         Restore interface before exiting optimized fullscreen mode.
53         https://bugs.webkit.org/show_bug.cgi?id=141167
54
55         Reviewed by Simon Fraser.
56
57         This change allows the user interface to be restored before exiting optimized fullscreen mode.
58
59         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: Add declaration.
60         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: 
61         (-[WebAVPlayerController playerViewController:restoreUserInterfaceForOptimizedFullscreenStopWithCompletionHandler:]): Added.
62         (WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline): Added.
63         * platform/spi/ios/AVKitSPI.h: Add new SPI.
64
65 2015-02-03  Jeremy Jones  <jeremyj@apple.com>
66
67         Prevent flicker when exiting fullscreen by synchronizing transactions.
68         https://bugs.webkit.org/show_bug.cgi?id=140897
69
70         Reviewed by Tim Horton.
71
72         Synchronize across CAContexts when moving the video layer between layer hierarchies.
73         Normally transactions involving multiple CAContexts are not synchronized.
74
75         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
76         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenLayer):
77         * platform/spi/cocoa/QuartzCoreSPI.h: add additional CAContext SPI declarations.
78
79 2015-02-03  Ryosuke Niwa  <rniwa@webkit.org>
80
81         Smart quoting could move the caret backwards in some configurations
82         https://bugs.webkit.org/show_bug.cgi?id=141203
83         <rdar://problem/17452543>
84
85         Reviewed by Enrica Casucci.
86
87         The bug was caused by markAndReplaceFor not running the code to preserve the selection after
88         text replacement only when smart quote is enabled. Furthermore, when smart link was disabled,
89         we never applied smart quote due to the following condition at line 2502:
90
91         if (!(shouldPerformReplacement || shouldCheckForCorrection || shouldMarkLink) || !doReplacement)
92             continue;
93
94         This condition prevented the code to apply smart quote from running when both continuous
95         spellchecking, smart link, and text replacement are disabled.
96
97         Fixed the bug by treating smart quotes and smart dashes like any other text replacement and set
98         shouldPerformReplacement to true whenever either one of those text checking options are present.
99
100         Smart link didn't have this issue due to the explicit check for shouldMarkLink.
101
102         Smart dashes didn't suffer this problem either because dashes replacement happens only once
103         the caret has moved past the dashes but his patch makes go through the same code path to preserve
104         the selection as well for consistency.
105
106         Test: editing/inserting/smart-quote-with-all-configurations.html
107
108         * editing/Editor.cpp:
109         (WebCore::Editor::markAndReplaceFor):
110
111 2015-02-02  Enrica Casucci  <enrica@apple.com>
112
113         Additional emoji support.
114         https://bugs.webkit.org/show_bug.cgi?id=141047
115         rdar://problem/19045135
116
117         Reviewed by Darin Adler.
118
119         Adds support for emoji modifiers and group emoji.
120
121         Test: editing/deleting/delete-emoji.html
122
123         * platform/graphics/FontCascade.cpp:
124         (WebCore::FontCascade::characterRangeCodePath):
125         * platform/text/TextBreakIterator.cpp:
126         (WebCore::cursorMovementIterator):
127         * rendering/RenderText.cpp:
128         (WebCore::isEmojiGroupCandidate):
129         (WebCore::isEmojiModifier):
130         (WebCore::RenderText::previousOffsetForBackwardDeletion):
131
132 2015-02-03  Jer Noble  <jer.noble@apple.com>
133
134         Passing invalid values to OfflineAudioContext's constructor should not crash.
135         https://bugs.webkit.org/show_bug.cgi?id=141197
136
137         Reviewed by Darin Adler.
138
139         Test: webaudio/offlineaudiocontext-constructor.html
140
141         Throw a SYNTAX_ERR exception if passed in a zero for channelCount or numberOfSamples. This avoids
142         a crash where OfflineAudioDestinationNode is passed a null renderTarget.
143
144         * Modules/webaudio/OfflineAudioContext.cpp:
145         (WebCore::OfflineAudioContext::create):
146
147 2015-02-03  Jer Noble  <jer.noble@apple.com>
148
149         [MSE] Setting timestampOffset does not change the timestamps in the actual sample, leading to visual and audible errors.
150         https://bugs.webkit.org/show_bug.cgi?id=140929
151
152         Reviewed by Darin Adler.
153
154         Test: media/media-source/media-source-timeoffset.html
155
156         Changing timestampOffset will correctly offset the presentation and decode times within SourceBuffer and
157         will correctly modify things like buffered ranges. But those changes need to be reflected in the underlying
158         MediaSample for decoders to decode and display the samples at the correct times.
159
160         Add a method to MediaSample which allows the caller to offset timestamps of the underlying PlatformMediaSample.
161
162         * Modules/mediasource/SourceBuffer.cpp:
163         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Call offsetTimestampsBy() on the sample.
164         * platform/MediaSample.h:
165         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
166         (WebCore::MediaSampleAVFObjC::offsetTimestampsBy): Create a new sample with the same underlying data
167             but with a new timing info array, each timing info offset by the requested amount.
168         * platform/mock/mediasource/MockBox.h:
169         (WebCore::MockBox::offsetTimestampsBy): Offset m_presentationTimestamp and m_decodeTimestamp;
170         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
171         (WebCore::MockMediaSample::offsetTimestampsBy): Pass to MockBox.
172
173 2015-02-03  Jer Noble  <jer.noble@apple.com>
174
175         [Mac][EME] Crash in CDMSessionMediaSourceAVFObjC::layerDidReceiveError() - NSError not KVO compliant for key NSUnderlyingError.
176         https://bugs.webkit.org/show_bug.cgi?id=140529
177
178         Reviewed by Darin Adler.
179
180         The underlying error should be fetched from the userInfo dictionary, not the error itself.
181
182         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
183         (WebCore::systemCodeForError):
184
185 2015-02-03  Commit Queue  <commit-queue@webkit.org>
186
187         Unreviewed, rolling out r179548.
188         https://bugs.webkit.org/show_bug.cgi?id=141201
189
190         Hits debug assertions in 50+ SVG tests (Requested by brrian on
191         #webkit).
192
193         Reverted changeset:
194
195         "Move InstanceInvalidationGuard/UpdateBlocker to SVGElement
196         from SVGElementInstance"
197         https://bugs.webkit.org/show_bug.cgi?id=141148
198         http://trac.webkit.org/changeset/179548
199
200 2015-02-03  Jer Noble  <jer.noble@apple.com>
201
202         [Mac] HLS audio is not correctly selected according to system language
203         https://bugs.webkit.org/show_bug.cgi?id=140398
204         rdar://problem/19218487
205
206         Reviewed by Darin Adler.
207
208         Test: http/tests/media/hls/hls-audio-tracks-locale-selection.html
209
210         When AVMediaSelectionOptions come and go and no explicit track selection choice has
211         been made, automatically pick the most appropriate track according to the user's
212         current preferred locale settings.
213
214         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
215         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
216         (WebCore::MediaSelectionGroupAVFObjC::MediaSelectionGroupAVFObjC): Set m_shouldSelectOptionAutomatically
217             to true by default.
218         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): If m_shouldSelectOptionAutomatically is set
219             pick the most appropriate media selection option.
220         (WebCore::MediaSelectionGroupAVFObjC::setSelectedOption): Set m_shouldSelectOptionAutomatically to false.
221         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
222         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Remove these automatic selection
223             requests as they are ineffective when -appliesMediaSelectionCriteriaAutomatically is NO.
224
225 2015-02-03  Darin Adler  <darin@apple.com>
226
227         Move InstanceInvalidationGuard/UpdateBlocker to SVGElement from SVGElementInstance
228         https://bugs.webkit.org/show_bug.cgi?id=141148
229
230         Reviewed by Brent Fulgham.
231
232         Inspired by this change Rob Buis made in Blink:
233
234             http://src.chromium.org/viewvc/blink?view=revision&revision=173343
235
236         I actually wrote the whole thing and then discovered we did it almost identically.
237
238         * svg/SVGAnimatedTypeAnimator.cpp:
239         (WebCore::SVGElementAnimatedPropertyList::setInstanceUpdatesBlocked): Added this
240         helper function to get around a circular header dependency.
241         * svg/SVGAnimatedTypeAnimator.h:
242         (WebCore::SVGAnimatedTypeAnimator::executeAction): Use setInstanceUpdatesBlocked.
243
244         * svg/SVGElement.cpp:
245         (WebCore::SVGElement::removedFrom): Use invalidateInstances.
246         (WebCore::SVGElement::finishParsingChildren): Ditto.
247         (WebCore::SVGElement::svgAttributeChanged): Ditto.
248         (WebCore::SVGElement::childrenChanged): Ditto.
249         (WebCore::SVGElement::setInstanceUpdatesBlocked): Added an assertion that will
250         catch anyone who nests InstanceUpdateBlocker by accident.
251         (WebCore::SVGElement::invalidateInstances): Moved this here from
252         SVGElementInstance::invalidateAllInstancesOfElement. I had already modified this
253         so it had nothing to do with SVGElementInstance, so it was a simple matter of
254         converting this into a member function. Added a FIXME about the mysterious
255         updateStyleIfNeeded that makes multiple tests fail if it's removed.
256
257         * svg/SVGElement.h: Added public InstanceUpdateBlocker class, protected
258         InstanceInvalidationGuard class, and private invalidateInstances function.
259         Unlike the ones in SVGElementInstance these use references so they are then
260         not copyable without using the WTF_MAKE_NONCOPYABLE macro.
261
262         * svg/SVGElementInstance.cpp:
263         (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Deleted.
264         (WebCore::SVGElementInstance::InstanceUpdateBlocker::InstanceUpdateBlocker): Deleted.
265         (WebCore::SVGElementInstance::InstanceUpdateBlocker::~InstanceUpdateBlocker): Deleted.
266         * svg/SVGElementInstance.h: Removed InvalidationGuard, InstanceUpdateBlocker, and
267         invalidateAllInstancesOfElement. Didn't do any further cleanup since we soon will
268         delete this entire file.
269
270         * svg/SVGAElement.cpp:
271         (WebCore::SVGAElement::svgAttributeChanged): Updated to use new name and reference
272         instead of pointer.
273         * svg/SVGAnimateElementBase.cpp:
274         (WebCore::applyCSSPropertyToTargetAndInstances): Ditto.
275         (WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
276         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
277         * svg/SVGAnimatedPath.cpp:
278         (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation): Ditto.
279         * svg/SVGCircleElement.cpp:
280         (WebCore::SVGCircleElement::svgAttributeChanged): Ditto.
281         * svg/SVGClipPathElement.cpp:
282         (WebCore::SVGClipPathElement::svgAttributeChanged): Ditto.
283         * svg/SVGComponentTransferFunctionElement.cpp:
284         (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged): Ditto.
285         * svg/SVGCursorElement.cpp:
286         (WebCore::SVGCursorElement::svgAttributeChanged): Ditto.
287         * svg/SVGEllipseElement.cpp:
288         (WebCore::SVGEllipseElement::svgAttributeChanged): Ditto.
289         * svg/SVGFEBlendElement.cpp:
290         (WebCore::SVGFEBlendElement::svgAttributeChanged): Ditto.
291         * svg/SVGFEColorMatrixElement.cpp:
292         (WebCore::SVGFEColorMatrixElement::svgAttributeChanged): Ditto.
293         * svg/SVGFECompositeElement.cpp:
294         (WebCore::SVGFECompositeElement::svgAttributeChanged): Ditto.
295         * svg/SVGFEConvolveMatrixElement.cpp:
296         (WebCore::SVGFEConvolveMatrixElement::svgAttributeChanged): Ditto.
297         * svg/SVGFEDiffuseLightingElement.cpp:
298         (WebCore::SVGFEDiffuseLightingElement::svgAttributeChanged): Ditto.
299         * svg/SVGFEDisplacementMapElement.cpp:
300         (WebCore::SVGFEDisplacementMapElement::svgAttributeChanged): Ditto.
301         * svg/SVGFEDropShadowElement.cpp:
302         (WebCore::SVGFEDropShadowElement::svgAttributeChanged): Ditto.
303         * svg/SVGFEGaussianBlurElement.cpp:
304         (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged): Ditto.
305         * svg/SVGFEImageElement.cpp:
306         (WebCore::SVGFEImageElement::svgAttributeChanged): Ditto.
307         * svg/SVGFELightElement.cpp:
308         (WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
309         * svg/SVGFEMergeNodeElement.cpp:
310         (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
311         * svg/SVGFEMorphologyElement.cpp:
312         (WebCore::SVGFEMorphologyElement::svgAttributeChanged): Ditto.
313         * svg/SVGFEOffsetElement.cpp:
314         (WebCore::SVGFEOffsetElement::svgAttributeChanged): Ditto.
315         * svg/SVGFESpecularLightingElement.cpp:
316         (WebCore::SVGFESpecularLightingElement::svgAttributeChanged): Ditto.
317         * svg/SVGFETileElement.cpp:
318         (WebCore::SVGFETileElement::svgAttributeChanged): Ditto.
319         * svg/SVGFETurbulenceElement.cpp:
320         (WebCore::SVGFETurbulenceElement::svgAttributeChanged): Ditto.
321         * svg/SVGFilterElement.cpp:
322         (WebCore::SVGFilterElement::svgAttributeChanged): Ditto.
323         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
324         (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged): Ditto.
325         * svg/SVGForeignObjectElement.cpp:
326         (WebCore::SVGForeignObjectElement::svgAttributeChanged): Ditto.
327         * svg/SVGGElement.cpp:
328         (WebCore::SVGGElement::svgAttributeChanged): Ditto.
329         * svg/SVGGradientElement.cpp:
330         (WebCore::SVGGradientElement::svgAttributeChanged): Ditto.
331         * svg/SVGGraphicsElement.cpp:
332         (WebCore::SVGGraphicsElement::svgAttributeChanged): Ditto.
333         * svg/SVGImageElement.cpp:
334         (WebCore::SVGImageElement::svgAttributeChanged): Ditto.
335         * svg/SVGLineElement.cpp:
336         (WebCore::SVGLineElement::svgAttributeChanged): Ditto.
337         * svg/SVGLinearGradientElement.cpp:
338         (WebCore::SVGLinearGradientElement::svgAttributeChanged): Ditto.
339         * svg/SVGMPathElement.cpp:
340         (WebCore::SVGMPathElement::svgAttributeChanged): Ditto.
341         * svg/SVGMarkerElement.cpp:
342         (WebCore::SVGMarkerElement::svgAttributeChanged): Ditto.
343         * svg/SVGMaskElement.cpp:
344         (WebCore::SVGMaskElement::svgAttributeChanged): Ditto.
345         * svg/SVGPathElement.cpp:
346         (WebCore::SVGPathElement::svgAttributeChanged): Ditto.
347         * svg/SVGPatternElement.cpp:
348         (WebCore::SVGPatternElement::svgAttributeChanged): Ditto.
349         * svg/SVGPolyElement.cpp:
350         (WebCore::SVGPolyElement::svgAttributeChanged): Ditto.
351         * svg/SVGRadialGradientElement.cpp:
352         (WebCore::SVGRadialGradientElement::svgAttributeChanged): Ditto.
353         * svg/SVGRectElement.cpp:
354         (WebCore::SVGRectElement::svgAttributeChanged): Ditto.
355         * svg/SVGSVGElement.cpp:
356         (WebCore::SVGSVGElement::svgAttributeChanged): Ditto.
357         * svg/SVGScriptElement.cpp:
358         (WebCore::SVGScriptElement::svgAttributeChanged): Ditto.
359         * svg/SVGStopElement.cpp:
360         (WebCore::SVGStopElement::svgAttributeChanged): Ditto.
361         * svg/SVGSymbolElement.cpp:
362         (WebCore::SVGSymbolElement::svgAttributeChanged): Ditto.
363         * svg/SVGTRefElement.cpp:
364         (WebCore::SVGTRefElement::svgAttributeChanged): Ditto.
365         * svg/SVGTextContentElement.cpp:
366         (WebCore::SVGTextContentElement::svgAttributeChanged): Ditto.
367         * svg/SVGTextPathElement.cpp:
368         (WebCore::SVGTextPathElement::svgAttributeChanged): Ditto.
369         * svg/SVGTextPositioningElement.cpp:
370         (WebCore::SVGTextPositioningElement::svgAttributeChanged): Ditto.
371         * svg/SVGUseElement.cpp:
372         (WebCore::SVGUseElement::svgAttributeChanged): Ditto.
373         * svg/animation/SVGSMILElement.cpp:
374         (WebCore::SVGSMILElement::svgAttributeChanged): Ditto.
375
376 2015-02-02  Darin Adler  <darin@apple.com>
377
378         REGRESSION (r170576): Storage leaks in parsing of CSS image sizes
379         https://bugs.webkit.org/show_bug.cgi?id=141026
380
381         Reviewed by Brent Fulgham.
382
383         Forgot to actually fix the leak in the successful parse case!
384
385         * css/CSSParser.cpp:
386         (WebCore::CSSParser::sourceSize): Added a call to destroy.
387
388 2015-02-02  Benjamin Poulain  <benjamin@webkit.org>
389
390         JIT Compile simple cases of :nth-last-child()
391         https://bugs.webkit.org/show_bug.cgi?id=141053
392
393         Reviewed by Andreas Kling.
394
395         This patch adds the code generator for :nth-last-child(), skipping
396         any :nth-last-child(An+B of selector list).
397
398         The code generator is boring here, nothing fancy.
399         There is no optimization opportunity here so it is basically the same
400         speed as the code generated by Clang when the simple selector is alone.
401
402         The only reason to JIT compile this is to avoid going to slow-path
403         for every selector that contain :nth-last-child().
404
405         * cssjit/SelectorCompiler.cpp:
406         (WebCore::SelectorCompiler::addNthChildType):
407         The code creating the intermediate representation of :nth-child() is exactly
408         the same as what we need for :nth-last-child(). I extracted the code from addPseudoClassType()
409         and share it for both simple selectors.
410
411         (WebCore::SelectorCompiler::addPseudoClassType):
412         I fail :nth-last-child(An+B of selector list). Let's add it later.
413
414         (WebCore::SelectorCompiler::minimumRegisterRequirements):
415         Oops, there was a bug with nthChildOfFilters.
416
417         (WebCore::SelectorCompiler::hasAnyCombinators):
418         (WebCore::SelectorCompiler::computeBacktrackingMemoryRequirements):
419         (WebCore::SelectorCompiler::computeBacktrackingInformation):
420         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
421         (WebCore::SelectorCompiler::setChildrenAffectedByBackwardPositionalRules):
422         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
423
424 2015-02-02  Zalan Bujtas  <zalan@apple.com>
425
426         Simple line layout: Rename FlowContentsIterator to TextFragmentIterator.
427         https://bugs.webkit.org/show_bug.cgi?id=141177
428
429         Rubber-stamped by Antti Koivisto
430
431         FlowContentsIterator is easy to confuse with FlowContents::Iterator.
432         TextFragmentIterator reflects the functionality better.
433
434         No change in functionality.
435
436         * CMakeLists.txt:
437         * WebCore.vcxproj/WebCore.vcxproj:
438         * WebCore.vcxproj/WebCore.vcxproj.filters:
439         * WebCore.xcodeproj/project.pbxproj:
440         * rendering/SimpleLineLayout.cpp:
441         (WebCore::SimpleLineLayout::LineState::setOverflowedFragment):
442         (WebCore::SimpleLineLayout::LineState::overflowedFragment):
443         (WebCore::SimpleLineLayout::LineState::appendFragment):
444         (WebCore::SimpleLineLayout::begin):
445         (WebCore::SimpleLineLayout::end):
446         (WebCore::SimpleLineLayout::preWrap):
447         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
448         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
449         (WebCore::SimpleLineLayout::firstFragment):
450         (WebCore::SimpleLineLayout::createLineRuns):
451         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
452         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary):
453         (WebCore::SimpleLineLayout::createTextRuns):
454         * rendering/SimpleLineLayoutTextFragmentIterator.cpp: Renamed from Source/WebCore/rendering/SimpleLineLayoutFlowContentsIterator.cpp.
455         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
456         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
457         (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
458         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
459         (WebCore::SimpleLineLayout::nextBreakablePosition):
460         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextBreakablePosition):
461         (WebCore::SimpleLineLayout::findNextNonWhitespace):
462         (WebCore::SimpleLineLayout::TextFragmentIterator::findNextNonWhitespacePosition):
463         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
464         * rendering/SimpleLineLayoutTextFragmentIterator.h: Renamed from Source/WebCore/rendering/SimpleLineLayoutFlowContentsIterator.h.
465         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
466         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::start):
467         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::end):
468         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::width):
469         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::type):
470         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isCollapsed):
471         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isBreakable):
472         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
473         (WebCore::SimpleLineLayout::TextFragmentIterator::style):
474         (WebCore::SimpleLineLayout::TextFragmentIterator::segmentForPosition):
475         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
476         (WebCore::SimpleLineLayout::TextFragmentIterator::characterAt):
477         (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak):
478         (WebCore::SimpleLineLayout::TextFragmentIterator::isEnd):
479
480 2015-02-02  Chris Dumez  <cdumez@apple.com>
481
482         Add diagnostic logging for ResourceResponse's source
483         https://bugs.webkit.org/show_bug.cgi?id=141170
484         <rdar://problem/19632080>
485
486         Reviewed by Antti Koivisto.
487
488         Add diagnostic logging for ResourceResponse's source (network, disk
489         cache, disk cache after validation) to give us an idea of our network
490         cache efficacy.
491
492         * loader/ResourceLoader.cpp:
493         (WebCore::logResourceResponseSource):
494         (WebCore::ResourceLoader::didReceiveResponse):
495         * page/DiagnosticLoggingKeys.cpp:
496         (WebCore::DiagnosticLoggingKeys::networkKey):
497         (WebCore::DiagnosticLoggingKeys::diskCacheKey):
498         (WebCore::DiagnosticLoggingKeys::diskCacheAfterValidationKey):
499         (WebCore::DiagnosticLoggingKeys::resourceResponseKey):
500         (WebCore::DiagnosticLoggingKeys::scriptKey):
501         (WebCore::DiagnosticLoggingKeys::sourceKey):
502         * page/DiagnosticLoggingKeys.h:
503
504 2015-02-02  Dhi Aurrahman  <diorahman@rockybars.com>
505
506         Optimize matchesLangPseudoClass() of :lang()
507         https://bugs.webkit.org/show_bug.cgi?id=140873
508
509         Reviewed by Darin Adler.
510
511         Avoid unnecessary memory allocation.
512
513         No new tests, no behavior changed.
514
515         * css/SelectorCheckerTestFunctions.h:
516         (WebCore::equalIgnoringASCIICase):
517         (WebCore::containslanguageSubtagMatchingRange):
518         (WebCore::matchesLangPseudoClass):
519
520 2015-02-02  Roger Fong  <roger_fong@apple.com>
521
522         WebGL2: Implement spec section 3.7.1 Setting and getting state (Part 2).
523         https://bugs.webkit.org/show_bug.cgi?id=141096
524         <rdar://problem/15002469>
525
526         Reviewed by Brent Fulgham.
527
528         This patch handles some of the valid arguments that could be passed into getParameter.
529         The unhandled cases will be implemented as the associated WebGL2 features are implemented.
530         In addition, getParameter queries that return 64 bit integer currently just return 0 as 
531         we need to use ::glGetInteger64v which is only available in GLES 3.0 headers.
532         I will be adding these headers in a future patch.
533
534         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
535         (WebCore::toJS): Accept a 64 bit integer type.
536         * html/canvas/WebGL2RenderingContext.cpp: Handle various parameter inputs.
537         (WebCore::WebGL2RenderingContext::getParameter):
538         * html/canvas/WebGLGetInfo.cpp: Add a 64 bit integer type.
539         (WebCore::WebGLGetInfo::WebGLGetInfo):
540         (WebCore::WebGLGetInfo::getInt64):
541         * html/canvas/WebGLGetInfo.h:
542         * html/canvas/WebGLRenderingContextBase.cpp:
543         (WebCore::WebGLRenderingContextBase::getInt64Parameter):
544         * html/canvas/WebGLRenderingContextBase.h:
545         * platform/graphics/GraphicsContext3D.h:
546         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
547         (WebCore::GraphicsContext3D::getInteger64v):
548
549 2015-02-02  Zalan Bujtas  <zalan@apple.com>
550
551         Simple line layout: use std::upper_bound in splitFragmentToFitLine()
552         https://bugs.webkit.org/show_bug.cgi?id=141146
553
554         Reviewed by Antti Koivisto.
555
556         Replace the custom binary search implementation with std::upper_bound and
557         move splitting functionality to TextFragment.
558
559         No change in functionality.
560
561         * rendering/SimpleLineLayout.cpp:
562         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator):
563         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++):
564         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=):
565         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*):
566         (WebCore::SimpleLineLayout::begin):
567         (WebCore::SimpleLineLayout::end):
568         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
569         * rendering/SimpleLineLayoutFlowContentsIterator.cpp:
570         (WebCore::SimpleLineLayout::FlowContentsIterator::runWidth):
571         * rendering/SimpleLineLayoutFlowContentsIterator.h:
572         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::split):
573
574 2015-02-02  Geoffrey Garen  <ggaren@apple.com>
575
576         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
577         https://bugs.webkit.org/show_bug.cgi?id=140900
578
579         Reviewed by Mark Hahnenberg.
580
581         Re-landing just the HandleBlock piece of this patch.
582
583         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
584         (WebCore::MemoryPressureHandler::install):
585
586 2015-02-02  Brent Fulgham  <bfulgham@apple.com>
587
588         [Win] 64-bit build fix after r179492.
589
590         * WebCore.vcxproj/WebCore.vcxproj: Forgot to build these files
591         as standalone under 64-bit target.
592
593 2015-02-02  Benjamin Poulain  <bpoulain@apple.com>
594
595         Clean up attribute handling: part 2 - attributeNode
596         https://bugs.webkit.org/show_bug.cgi?id=141109
597
598         Reviewed by Andreas Kling.
599
600         Our implementation was covering some old legacy behaviors of Firefox,
601         even copying bugs in some cases.
602
603         The spec (https://dom.spec.whatwg.org) now defines the behavior precisely,
604         let's move a bit closer to that.
605
606         Tests: fast/dom/Element/attribute-ascii-case-insensitive-3.html
607                fast/dom/Element/attribute-setAttributeNode-multiple-times.html
608                fast/dom/Element/attribute-setAttributeNodeNS-multiple-times.html
609                fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html
610                fast/dom/Element/mozilla-dom-base-tests/test_bug339494.html
611                fast/dom/Element/mozilla-dom-base-tests/test_bug364092.xhtml
612                fast/dom/Element/setAttributeNode-overriding-lowercase-values.html
613
614         * dom/Element.cpp:
615         (WebCore::findAttrNodeInList):
616         New getter for the name-without-namespace case.
617
618         (WebCore::Element::setAttributeNode):
619         This one is the tricky one: https://dom.spec.whatwg.org/#dom-element-setattributenode
620
621         When setAttributeNode() is used with an AttributeNode without namespace,
622         getting the old value behaves like getAttribute(), with ASCII lowercase name matching.
623         When used with a namespace, getting the old value behaves like getAttributeNS().
624
625         Setting the value is a whole different story, the name used always keeps
626         the original case.
627
628         Now that's a bit tricky for us because AttributeNodes are just legacy stuff we don't
629         used internally.
630
631         We have 4 cases to handle:
632         1) The name being set is lowercase, there was no conflicting name on the element.
633            That's easy, we just override any node that would exist, set the name otherwise.
634         2) The name is lowercase but there was an existing attribute for it.
635            -We create a new AttributeNode for the name to represent the old name.
636            -We check the names are the same with attribute.name().matches(attrNode->qualifiedName())
637             and override the value.
638         3) The name has uppercase characters, there is no conflicting name.
639            We would not find an element to remove, we just use setAttributeInternal() as usual
640            to add the attribute;
641         4) The name has uppercase characters, there is a lowercase conflicing name.
642            This is the weird behavior: we need to nuke the old attribute, then add the new attribute
643            with a different case.
644
645            First we remove the attribute with a lowercase name with removeAttributeInternal().
646            That becomes the old node.
647
648            There might still be an element of the same name as what we are trying to add. We don't want
649            to add another version of the same attribute. We need to use findAttributeIndexByName() again
650            to find if there is a conflicting attribute. Then we call setAttributeInternal() which handle
651            the both the cases where there was an element or not.
652
653         (WebCore::Element::setAttributeNodeNS):
654         This should work like any "NS" method.
655
656         (WebCore::Element::removeAttributeNode):
657         The method removeAttributeNode() is supposed to be exact.
658
659         (WebCore::Element::getAttributeNode):
660         (WebCore::Element::hasAttribute):
661         (WebCore::Element::attrIfExists):
662         * dom/Element.h:
663         * dom/ElementData.cpp:
664         (WebCore::ElementData::findAttributeIndexByNameSlowCase): Deleted.
665         (WebCore::ElementData::findAttributeIndexByNameForAttributeNode): Deleted.
666         Kill the slow case, every caller has been updated now.
667         * dom/ElementData.h:
668         (WebCore::ElementData::findAttributeIndexByName):
669         * dom/QualifiedName.h:
670         (WebCore::QualifiedName::matchesIgnoringCaseForLocalName): Deleted.
671
672 2015-02-02  peavo@outlook.com  <peavo@outlook.com>
673
674         Memory is written to after deallocated, in GraphicsLayer::setMaskLayer.
675         https://bugs.webkit.org/show_bug.cgi?id=141168
676
677         Reviewed by Brent Fulgham.
678
679         Visual Studio detected that a deallocated heap block had been modified in GraphicsLayer::setMaskLayer,
680         when called from RenderLayerBacking::updateChildClippingStrategy.
681
682         * rendering/RenderLayerBacking.cpp:
683         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
684
685 2015-02-02  Andreas Kling  <akling@apple.com>
686
687         [Cocoa] Make decoded image data purgeable ASAP.
688         <https://webkit.org/b/140298>
689         <rdar://problem/19623377>
690
691         Reviewed by Antti Koivisto.
692
693         Re-landing this patch since it turned out to not be the cause of
694         the memory regression we saw around that revision.
695
696         Mark decoded images as "transient" which makes CoreGraphics mark
697         the backing stores as purgeable shortly after they're used.
698
699         The decoded representation will remain in CoreGraphics's caches
700         indefinitely unless the kernel gets starved and needs the pages.
701
702         Most resources will now reach a state where the encoded data is
703         mmap'ed from disk cache (once the entire resource is downloaded)
704         and the decoded data is purgeable.
705
706         This also has the side effect of making the MemoryCache more
707         palatial since the decoded data cost can be deducted for images,
708         allowing us to cache more resources.
709
710         Note that the worst case for this new behavior would be something
711         like hovering below 100% memory utilization and constantly having
712         to drop and re-decode images. While churny, it still beats
713         crashing the process, plus there's tiling to remove many of the
714         reasons we'd need the decoded data.
715
716         * platform/graphics/cg/ImageSourceCG.cpp:
717         (WebCore::ImageSource::createFrameAtIndex):
718
719 2015-02-02  Joseph Pecoraro  <pecoraro@apple.com>
720
721         Web Inspector: Support console.table
722         https://bugs.webkit.org/show_bug.cgi?id=141058
723
724         Reviewed by Timothy Hatcher.
725
726         * inspector/CommandLineAPIModuleSource.js:
727         Include "table(foo)" as an alias of "console.table(foo)" on
728         the command line.
729
730 2015-02-02  Roger Fong  <roger_fong@apple.com>
731
732         [Win] Build fix following r179482.
733
734         * WebCore.vcxproj/WebCore.vcxproj:
735         * WebCore.vcxproj/WebCore.vcxproj.filters:
736         * bindings/js/JSBindingsAllInOne.cpp:
737         * platform/graphics/GraphicsContext3D.h:
738
739 2015-02-02  Chris Dumez  <cdumez@apple.com>
740
741         Access MemoryCache singleton using MemoryCache::singleton()
742         https://bugs.webkit.org/show_bug.cgi?id=141104
743
744         Reviewed by Andreas Kling.
745
746         Access MemoryCache singleton using MemoryCache::singleton() static
747         member function, instead of a free function, as per the recent
748         coding style discussion on WebKit-dev.
749
750 2015-02-02  Zalan Bujtas  <zalan@apple.com>
751
752         Ambiguous naming: Do not call replacedContentRect()'s return value paint rect.
753         https://bugs.webkit.org/show_bug.cgi?id=141125
754
755         Reviewed by Simon Fraser.
756
757         It's the content box rect with the object-fit adjustment.
758
759         No change in functionality.
760
761         * rendering/RenderHTMLCanvas.cpp:
762         (WebCore::RenderHTMLCanvas::paintReplaced):
763         * rendering/RenderImage.cpp:
764         (WebCore::RenderImage::updateInnerContentRect):
765         (WebCore::RenderImage::paintReplaced):
766         * rendering/RenderReplaced.cpp:
767         (WebCore::RenderReplaced::replacedContentRect):
768         * rendering/SimpleLineLayout.cpp:
769         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
770
771 2015-02-02  Brent Fulgham  <bfulgham@apple.com>
772
773         [Win] Build fix after r179476.
774         https://bugs.webkit.org/show_bug.cgi?id=141026
775
776         Reviewed by Anders Carlsson.
777
778         MSVC has a compiler bug that forces us to make some explicit statements about how
779         the passed pointer values are handled.
780
781         * css/CSSParser.cpp:
782         (WebCore::CSSParser::SourceSize::SourceSize):
783         (WebCore::CSSParser::sourceSize):
784         * css/CSSParser.h:
785
786 2015-02-02  Benjamin Poulain  <benjamin@webkit.org>
787
788         Get rid of invalidSelectorVector, use Bison's error recovery instead
789         https://bugs.webkit.org/show_bug.cgi?id=141147
790
791         Reviewed by Darin Adler.
792
793         * css/CSSGrammar.y.in:
794         Instead of reducing a null selector, we can use a real parsing error
795         to get out of invalid selector endings.
796
797         When that happens, Bison will pop the stack until it can reduce any
798         valid error recovery rules.
799
800         The problem is to make sure there is no floating values because
801         none of the reduce block between the error and the recovery would
802         be executed.
803
804         In this case, "nth_selector_ending" is a non-recursive production of
805         the NTHCHILDFUNCTIONS. In turn, NTHCHILDFUNCTIONS are productions
806         of the non-recursive "pseudo". "pseudo" is only used as a trivial
807         production of "specifier". "specifier" is only used by "specifier_list".
808
809         "specifier_list" has error recovery code -> no production could have
810         generated a floating values between "specifier_list" and "nth_selector_ending".
811
812 2015-01-30  Roger Fong  <roger_fong@apple.com>
813
814         WebGL2: Implement spec section 3.7.1 Setting and getting state (Part 1).
815         https://bugs.webkit.org/show_bug.cgi?id=141096
816         <rdar://problem/15002469>
817
818         Reviewed by Brent Fulgham.
819
820         This patch implements the WebGL2 versions of getParameter, getIndexedParameter and isEnabled.
821         It also removes the WebGL1 implementations from WebGLRenderingContextBase and moves it to WebGLRenderingContext.
822         I’ve stubbed out most of the parameters for now, some of which will be implemented in Part 2, 
823         and the rest as the our WebGL2 implementation progresses.        
824
825         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
826         (WebCore::toJS):
827         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
828         * html/canvas/WebGL2RenderingContext.cpp:
829         (WebCore::WebGL2RenderingContext::getIndexedParameter):
830         (WebCore::WebGL2RenderingContext::getParameter):
831         (WebCore::WebGL2RenderingContext::validateCapability):
832         * html/canvas/WebGL2RenderingContext.h:
833         * html/canvas/WebGL2RenderingContext.idl:
834         * html/canvas/WebGLRenderingContext.cpp:
835         (WebCore::WebGLRenderingContext::getParameter):
836         (WebCore::WebGLRenderingContext::validateCapability):
837         * html/canvas/WebGLRenderingContext.h:
838         * html/canvas/WebGLRenderingContextBase.cpp:
839         (WebCore::WebGLRenderingContextBase::getParameter): Deleted.
840         (WebCore::WebGLRenderingContextBase::validateCapability): Deleted.
841         * html/canvas/WebGLRenderingContextBase.h:
842         * html/canvas/WebGLRenderingContextBase.idl:
843         * platform/graphics/GraphicsContext3D.h:
844
845 2015-02-02  Daniel Bates  <dabates@apple.com>
846
847         [iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestructionObserver::observeContext
848         https://bugs.webkit.org/show_bug.cgi?id=141057
849         <rdar://problem/19068790>
850
851         Reviewed by Alexey Proskuryakov.
852
853         Fixes an issue where we would create-/delete- the RSA crypto keys and dispatch callbacks on the wrong
854         thread in WebKit1 for iOS. In iOS WebKit1 we should perform such operations on thread WebThread.
855
856         This change is covered by existing layout tests.
857
858         * crypto/mac/CryptoKeyRSAMac.cpp:
859         (WebCore::CryptoKeyRSA::generatePair):
860
861 2015-02-02  Jeremy Jones  <jeremyj@apple.com>
862
863         Prevent crash when accessing WebAVPlayerController.delegate.
864         https://bugs.webkit.org/show_bug.cgi?id=140893
865
866         Reviewed by Darin Adler.
867
868         This patch aims to prevent a null delegate access during invalidation by adding null checks before accessing the delegate, by making explicit the recreation of m_playerController, and by consolidating and correcting the teardown sequence.
869
870         * WebCore.exp.in:
871         * platform/ios/WebVideoFullscreenInterface.h: add resetMediaState()
872         * platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto.
873         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
874         (-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Check for null before accessing delegate.
875         (-[WebAVPlayerController play:]): ditto.
876         (-[WebAVPlayerController pause:]): ditto.
877         (-[WebAVPlayerController togglePlayback:]): ditto.
878         (-[WebAVPlayerController setPlaying:]): ditto.
879         (-[WebAVPlayerController beginScrubbing:]): ditto.
880         (-[WebAVPlayerController endScrubbing:]): ditto.
881         (-[WebAVPlayerController seekToTime:]): ditto.
882         (-[WebAVPlayerController beginScanningForward:]): ditto.
883         (-[WebAVPlayerController endScanningForward:]): ditto.
884         (-[WebAVPlayerController beginScanningBackward:]): ditto.
885         (-[WebAVPlayerController endScanningBackward:]): ditto.
886         (-[WebAVPlayerController seekToBeginning:]): ditto.
887         (-[WebAVPlayerController seekToEnd:]): ditto.
888         (-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]): ditto.
889         (-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]): ditto.
890         (-[WebAVPlayerController layoutSublayersOfLayer:]): ditto.
891         (WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit): initialize m_playerController
892         (WebVideoFullscreenInterfaceAVKit::resetMediaState): Added.
893         (WebVideoFullscreenInterfaceAVKit::setDuration): remove playerController()
894         (WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto.
895         (WebVideoFullscreenInterfaceAVKit::setRate): ditto.
896         (WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto.
897         (WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto.
898         (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): ditto.
899         (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto.
900         (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto.
901         (WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto.
902         (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): ditto.
903         (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): ditto.
904         (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): consolidated cleanup code from invalidate()
905         (WebVideoFullscreenInterfaceAVKit::invalidate): consolidate cleanup code.
906         (WebVideoFullscreenInterfaceAVKit::playerController): Deleted.
907         * platform/ios/WebVideoFullscreenModelVideoElement.mm:
908         (WebVideoFullscreenModelVideoElement::setVideoElement): call resetMediaState()
909
910 2015-02-02  Darin Adler  <darin@apple.com>
911
912         REGRESSION (r170576): Storage leaks in parsing of CSS image sizes
913         https://bugs.webkit.org/show_bug.cgi?id=141026
914
915         Reviewed by Anders Carlsson.
916
917         * css/CSSGrammar.y.in: Fixed all the shift/reduce conflicts caused
918         by the ENABLE_PICTURE_SIZES code by removing all the redundant
919         maybe_space which caused them. Rearranged the productions for
920         ENABLE_PICTURE_SIZES to tighten up the code quite a bit. Changed
921         the code to build up the source size vector as a Vector instead of
922         a special class, and use the SourceSize struct from inside the
923         CSSParser class.'
924
925         * css/CSSParser.cpp:
926         (WebCore::CSSParser::setupParser): Changed this to take a StringView.
927         In the future we can change all the parsing functions to take StringView,
928         since they don't work with the String in place.
929         (WebCore::CSSParser::parseSizesAttribute): Changed to return a vector
930         of SourceSize instead of a SourceSizeList. This is better because it's
931         a real CSS data structure that does not contain a CSSParserValue.
932         (WebCore::CSSParser::sourceSize): Added. Helper that creates a
933         SourceSize, mapping parser data structures into real CSS ones.
934
935         * css/CSSParser.h: Updated for changes above.
936
937         * css/MediaQuery.cpp:
938         (WebCore::MediaQuery::MediaQuery): Use std::make_unique and the copy
939         constructor directly instead of using a MediaQuery::copy function.
940
941         * css/MediaQueryExp.cpp: Streamlined the class a little bit.
942         * css/MediaQueryExp.h: Removed unneeded includes. Moved functions out
943         of the class body so the class is easier to read. Removed the unneeded
944         copy function.
945
946         * css/SourceSizeList.cpp:
947         (WebCore::SourceSize::match): Changed to use WTF::move instead
948         of releasing and then re-creating the unique_ptr.
949         (WebCore::computeLength): Added a comment to explain this function
950         is using an incorrect strategy. Also added some type checking code
951         to handle cases where a null or non-primitive CSS value might be
952         returned. Probably dead code, but we don't want to risk a bad cast.
953         Worthe cleaning up when we fix the strategy.
954         (WebCore::SourceSizeList::getEffectiveSize): Updated since the
955         vector now contains actual SourceSize objects rather than pointers
956         to SourceSize objects on the heap.
957
958         * css/SourceSizeList.h: Changed the CSSParserValue argument to be
959         an rvalue reference to make it clearer that we take ownership of it
960         when it's moved in. Added a move constructor and a destructor. Added
961         comments explaining that it's not correct design to use a
962         CSSParserValue here, outside the parser. Changed SourceSizeList's
963         append function to move a SourceSize in rather than a unique_ptr.
964         Made getEffectiveSize private. Moved the various inline functions to
965         the bottom of the file to make the class definitions easier to read.
966
967
968         * css/SourceSizeList.cpp: Made almost everything about this private
969         to this source file instead of public in the header.
970         (WebCore::match): Made this a free function instead of a member function
971         and made it take the media query expression as an argument.
972         (WebCore::computeLength): Changed the argument type to CSSValue*,
973         rather than using CSSParserValue here outside the parser.
974         (WebCore::parseSizesAttribute): Streamlined and simplified this.
975         Now that the parser builds the list in the correct order, there was
976         no need to iterate backwards any more so we could use a modern for
977         loop.
978
979         * css/SourceSizeList.h: Removed almost everything in this header.
980
981         * html/HTMLImageElement.cpp:
982         (WebCore::HTMLImageElement::parseAttribute): Call the
983         parseSizesAttribute function as free function since it's no longer
984         a member of a SourceSizeList class.
985
986         * html/parser/HTMLPreloadScanner.cpp:
987         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
988         Ditto.
989
990 2015-02-02  Darin Adler  <darin@apple.com>
991
992         Fix some leaks found by the leak bot
993         https://bugs.webkit.org/show_bug.cgi?id=141149
994
995         Reviewed by Alexey Proskuryakov.
996
997         * bindings/js/JSSubtleCryptoCustom.cpp:
998         (WebCore::importKey): Changed argument types to std::unique_ptr for better code clarity.
999         (WebCore::JSSubtleCrypto::importKey): Use WTF::move instead of release.
1000         (WebCore::JSSubtleCrypto::wrapKey): Fixed leaks by adding missing delete calls to the
1001         case where we get a DOM exception.
1002         (WebCore::JSSubtleCrypto::unwrapKey): Ditto.
1003
1004         * dom/SelectorQuery.cpp:
1005         (WebCore::SelectorQuery::SelectorQuery): Use WTF::move here. Not clear how this could
1006         have caused the storage leak, but it does seem obviously missing. The leak is pretty big,
1007         implying that we leak almost all CSSSelectorList objects we parse; not sure this fixes it.
1008
1009         * loader/WorkerThreadableLoader.cpp:
1010         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): Added code to
1011         deleted the unguarded pointer if postTaskForModeToWorkerGlobalScope fails.
1012         (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Ditto.
1013         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): Ditto.
1014         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck): Ditto.
1015
1016         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1017         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Added missing adoptNS.
1018
1019         * platform/graphics/mac/GraphicsContextMac.mm:
1020         (WebCore::GraphicsContext::updateDocumentMarkerResources): Added missing release.
1021
1022 2015-02-01  Chris Dumez  <cdumez@apple.com>
1023
1024         Use more references in HistoryItem
1025         https://bugs.webkit.org/show_bug.cgi?id=141133
1026
1027         Reviewed by Andreas Kling.
1028
1029         Use more references in HistoryItem instead of pointers.
1030
1031 2015-02-01  Commit Queue  <commit-queue@webkit.org>
1032
1033         Unreviewed, rolling out r179467 and r179470.
1034         https://bugs.webkit.org/show_bug.cgi?id=141144
1035
1036         Broke svg/custom/use-events-crash.svg (Requested by ap on
1037         #webkit).
1038
1039         Reverted changesets:
1040
1041         "Stop dispatching events with SVGElementInstance objects as
1042         their targets"
1043         https://bugs.webkit.org/show_bug.cgi?id=141108
1044         http://trac.webkit.org/changeset/179467
1045
1046         "REGRESSION(r179467): svg/custom/use-events-crash.svg times
1047         out"
1048         http://trac.webkit.org/changeset/179470
1049
1050 2015-01-31  Darin Adler  <darin@apple.com>
1051
1052         Stop dispatching events to with SVGElementInstance objects as their targets
1053         https://bugs.webkit.org/show_bug.cgi?id=141108
1054
1055         Reviewed by Anders Carlsson.
1056
1057         Test: svg/custom/use-event-retargeting.html
1058
1059         * dom/EventDispatcher.cpp:
1060         (WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
1061         events at SVGElementInstance objects with code that retargets them at the use
1062         element instead. Also wrote the code in a simpler way.
1063
1064 2015-02-01  Zan Dobersek  <zdobersek@igalia.com>
1065
1066         [TexMap] Optimize TextureMapperLayer::removeAllChildren()
1067         https://bugs.webkit.org/show_bug.cgi?id=140734
1068
1069         Reviewed by Chris Dumez.
1070
1071         Instead of removing the children from the Vector member one by one,
1072         move the Vector out and iterate through the ex-children, clearing
1073         out the pointer to the parent.
1074
1075         * platform/graphics/texmap/TextureMapperLayer.cpp:
1076         (WebCore::TextureMapperLayer::removeAllChildren):
1077
1078 2015-02-01  Zan Dobersek  <zdobersek@igalia.com>
1079
1080         [TexMap] Avoid unnecessary TransformationMatrix copies in GraphicsLayerTransform
1081         https://bugs.webkit.org/show_bug.cgi?id=140735
1082
1083         Reviewed by Chris Dumez.
1084
1085         * platform/graphics/GraphicsLayerTransform.cpp:
1086         (WebCore::GraphicsLayerTransform::combined): Return a const reference to the matrix.
1087         (WebCore::GraphicsLayerTransform::combinedForChildren): Ditto.
1088         (WebCore::GraphicsLayerTransform::combineTransforms): First copy the parent transform,
1089         then apply the translation and multiplication. Previously this copied the parent
1090         transform into a temporary object, performed the translation and multiplication, and
1091         copied that temporary object again when assigning to the member variable.
1092         (WebCore::GraphicsLayerTransform::combineTransformsForChildren): Mark const. m_childrenDirty
1093         and m_combinedForChildren members are marked mutable.
1094         * platform/graphics/GraphicsLayerTransform.h:
1095
1096 2015-01-31  Myles C. Maxfield  <litherum@gmail.com>
1097
1098         REGRESSION (r177689): Emoji variation sequences rendered incorrectly (as characters from other non-emoji font)
1099         https://bugs.webkit.org/show_bug.cgi?id=141112
1100
1101         Reviewed by Sam Weinig.
1102
1103         Typo in r177689.
1104
1105         Test: platform/mac/fast/text/combining-mark-paint.html
1106
1107         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1108         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1109
1110 2015-01-31  Commit Queue  <commit-queue@webkit.org>
1111
1112         Unreviewed, rolling out r178183.
1113         https://bugs.webkit.org/show_bug.cgi?id=141132
1114
1115         Caused more mallocing than the volatility saved. (Requested by
1116         kling on #webkit).
1117
1118         Reverted changeset:
1119
1120         "[Cocoa] Make decoded image data purgeable ASAP."
1121         https://bugs.webkit.org/show_bug.cgi?id=140298
1122         http://trac.webkit.org/changeset/178183
1123
1124 2015-01-31  Chris Dumez  <cdumez@apple.com>
1125
1126         Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
1127         https://bugs.webkit.org/show_bug.cgi?id=141110
1128
1129         Reviewed by Antti Koivisto.
1130
1131         Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING
1132         enabled. Previously, we would be using a HashMap of HashMap to store
1133         CachedResources. The outer HashMap would use the URL as key and the inner
1134         HashMap would use the partition name as key. This would make traversing the
1135         structure overly complicated, especially considering that the code needs to
1136         traverse a simple HashMap if CACHE_PARTITIONING is disabled.
1137
1138         This patch updates the CachedResourceMap structure to be a simple HashMap,
1139         whose key is an std::pair<URL, String /* partitionName */>. Having a flat
1140         structure simplifies the traversal code a lot and enables more code sharing
1141         between CACHE_PARTITIONING and !CACHE_PARTITIONING. This shouldn't regress
1142         performance because we always have both a URL and a partition name when we
1143         need to look up a resource. We never need to retrieve all resources with
1144         a particular URL.
1145
1146         This patch also switches to using a URL as key instead of a String as we
1147         always have a URL has input.
1148
1149         * loader/cache/MemoryCache.cpp:
1150         (WebCore::MemoryCache::add):
1151         (WebCore::MemoryCache::revalidationSucceeded):
1152         (WebCore::MemoryCache::resourceForRequestImpl):
1153         (WebCore::MemoryCache::removeImageFromCache):
1154         (WebCore::MemoryCache::remove):
1155         After removing the resource from the CachedResourceMap, remove the
1156         sessionID from m_sessionResources if the CachedResourceMap is now
1157         empty. Previously, no code was removing sessionIDs from
1158         m_sessionResources.
1159
1160         (WebCore::MemoryCache::removeResourcesWithOrigin):
1161         (WebCore::MemoryCache::getOriginsWithCache):
1162         (WebCore::MemoryCache::getStatistics):
1163         (WebCore::MemoryCache::setDisabled):
1164         * loader/cache/MemoryCache.h:
1165
1166 2015-01-31  Sam Weinig  <sam@webkit.org>
1167
1168         Merge the iOS implementations of GraphicsContext::drawText and GraphicsContext::drawBidiText with the platform independent ones
1169         https://bugs.webkit.org/show_bug.cgi?id=141131
1170
1171         Reviewed by Antti Koivisto.
1172
1173         * platform/graphics/GraphicsContext.cpp:
1174         (WebCore::GraphicsContext::drawText):
1175         The only difference between the two implementation here was the iOS one returns the length of
1176         the text that was drawn. As all platforms now support that, we can merge by keeping the iOS one.
1177
1178         (WebCore::GraphicsContext::drawBidiText):
1179         This function had a few differences:
1180             - iOS returns the length of the text that was drawn.
1181                 Since this is not used anywhere, I dropped this ability.
1182             - iOS took additional inputs of initial bidi status and run length (and returned the
1183               the final bidi status as an out parameter)
1184                 Since this was also unused, I dropped it.
1185             - iOS used the fact that font.drawText() returns the length that was drawn, to avoid
1186               measuring the text twice.
1187                 I kept this, since all platforms now support this.
1188
1189         * platform/graphics/GraphicsContext.h:
1190         Update signatures. Remove WEBCORE_EXPORT for function that is not used outside of WebCore.
1191
1192 2015-01-31  Andreas Kling  <akling@apple.com>
1193
1194         Shrink RenderBlock.
1195         <https://webkit.org/b/141129>
1196
1197         Reviewed by Antti Koivisto.
1198
1199         Get rid of the bitfield in RenderBlock by moving the essential bits to
1200         RenderElement (plenty of space in the bitfield there.)
1201
1202         RenderBlock also had a cache of its line-height, but it doesn't appear
1203         to help any of the benchmarks that we're tracking so I'd say it's okay
1204         to lose this optimization.
1205
1206         This knocks 8 bytes off of RenderBlock (and all of its subclasses.)
1207
1208         * rendering/RenderBlock.cpp:
1209         (WebCore::RenderBlock::RenderBlock):
1210         (WebCore::RenderBlock::styleDidChange):
1211         (WebCore::RenderBlock::recomputeLogicalWidth):
1212         (WebCore::RenderBlock::lineHeight):
1213         * rendering/RenderBlock.h:
1214         (WebCore::RenderBlock::setHasMarginBeforeQuirk):
1215         (WebCore::RenderBlock::setHasMarginAfterQuirk):
1216         (WebCore::RenderBlock::setHasBorderOrPaddingLogicalWidthChanged):
1217         (WebCore::RenderBlock::hasMarginBeforeQuirk):
1218         (WebCore::RenderBlock::hasMarginAfterQuirk):
1219         (WebCore::RenderBlock::hasBorderOrPaddingLogicalWidthChanged):
1220         * rendering/RenderBlockFlow.cpp:
1221         (WebCore::RenderBlockFlow::layoutInlineChildren):
1222         (WebCore::RenderBlockFlow::invalidateLineLayoutPath):
1223         (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
1224         (WebCore::RenderBlockFlow::ensureLineBoxes):
1225         * rendering/RenderBlockFlow.h:
1226         (WebCore::RenderBlockFlow::lineLayoutPath):
1227         (WebCore::RenderBlockFlow::setLineLayoutPath):
1228         (WebCore::RenderBlockFlow::setHasMarkupTruncation):
1229         (WebCore::RenderBlockFlow::hasMarkupTruncation):
1230         (WebCore::RenderBlockFlow::simpleLineLayout):
1231         * rendering/RenderElement.cpp:
1232         (WebCore::RenderElement::RenderElement):
1233         * rendering/RenderElement.h:
1234         (WebCore::RenderElement::setRenderBlockHasMarginBeforeQuirk):
1235         (WebCore::RenderElement::setRenderBlockHasMarginAfterQuirk):
1236         (WebCore::RenderElement::setRenderBlockHasBorderOrPaddingLogicalWidthChanged):
1237         (WebCore::RenderElement::renderBlockHasMarginBeforeQuirk):
1238         (WebCore::RenderElement::renderBlockHasMarginAfterQuirk):
1239         (WebCore::RenderElement::renderBlockHasBorderOrPaddingLogicalWidthChanged):
1240         (WebCore::RenderElement::setRenderBlockFlowLineLayoutPath):
1241         (WebCore::RenderElement::setRenderBlockFlowHasMarkupTruncation):
1242         (WebCore::RenderElement::renderBlockFlowLineLayoutPath):
1243         (WebCore::RenderElement::renderBlockFlowHasMarkupTruncation):
1244         * rendering/RenderFlowThread.cpp:
1245         (WebCore::RenderFlowThread::removeLineRegionInfo):
1246
1247 2015-01-31  Chris Dumez  <cdumez@apple.com>
1248
1249         Remove useless PageCache::singleton() call from PageCache member function
1250         https://bugs.webkit.org/show_bug.cgi?id=141127
1251
1252         Reviewed by Andreas Kling.
1253
1254         * history/PageCache.cpp:
1255         (WebCore::PageCache::get):
1256
1257 2015-01-31  Sam Weinig  <sam@webkit.org>
1258
1259         Remove empty #if/#endif
1260
1261         Rubber-stamped by Antti Koivisto.
1262
1263         * platform/graphics/FontPlatformData.h:
1264
1265 2015-01-31  Sam Weinig  <sam@webkit.org>
1266
1267         Remove support for disabling drawing of emoji
1268         https://bugs.webkit.org/show_bug.cgi?id=141126
1269
1270         Reviewed by Antti Koivisto.
1271
1272         Remove unused support for disabling the drawing of emoji.
1273
1274         * WebCore.exp.in:
1275         * platform/graphics/GraphicsContext.cpp:
1276         (WebCore::GraphicsContext::emojiDrawingEnabled): Deleted.
1277         (WebCore::GraphicsContext::setEmojiDrawingEnabled): Deleted.
1278         * platform/graphics/GraphicsContext.h:
1279         (WebCore::GraphicsContextState::GraphicsContextState):
1280         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1281         (WebCore::FontCascade::drawGlyphs):
1282
1283 2015-01-31  Sam Weinig  <sam@webkit.org>
1284
1285         Remove even more Mountain Lion support
1286         https://bugs.webkit.org/show_bug.cgi?id=141124
1287
1288         Reviewed by Alexey Proskuryakov.
1289
1290         * Configurations/Base.xcconfig:
1291         * Configurations/DebugRelease.xcconfig:
1292         * Configurations/FeatureDefines.xcconfig:
1293         * Configurations/Version.xcconfig:
1294         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1295         (-[WebAccessibilityObjectWrapper accessibilityActionNames]):
1296         (-[WebAccessibilityObjectWrapper subrole]):
1297         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1298         (PlatformCALayer::drawLayerContents):
1299         * platform/mac/ThemeMac.mm:
1300         (-[WebCoreThemeView _focusRingVisibleRect]):
1301
1302 2015-01-30  Sam Weinig  <sam@webkit.org>
1303
1304         Merge SimpleFontDataIOS.mm and SimpleFontDataMac.mm into FontCocoa.mm
1305         https://bugs.webkit.org/show_bug.cgi?id=141101
1306
1307         Rubber-stamped by Dan Bernstein.
1308
1309         * WebCore.xcodeproj/project.pbxproj:
1310         Remove SimpleFontDataIOS.mm and SimpleFontDataMac.mm. Add FontCocoa.mm.
1311
1312         * platform/graphics/Font.h:
1313         Remove a few CG only functions from the header that can be implemented as static functions
1314         in the implementation file.
1315
1316         * platform/graphics/cocoa/FontCocoa.mm: Copied from Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm.
1317         (WebCore::fontFamilyShouldNotBeUsedForArabic):
1318         (WebCore::Font::platformInit):
1319         (WebCore::Font::platformCharWidthInit):
1320         (WebCore::Font::platformCreateScaledFont):
1321         (WebCore::Font::determinePitch):
1322         (WebCore::renderingStyle):
1323         (WebCore::advanceForColorBitmapFont):
1324         (WebCore::hasCustomTracking):
1325         (WebCore::canUseFastGlyphAdvanceGetter):
1326         (WebCore::Font::platformWidthForGlyph):
1327         (WebCore::Font::compositeFontReferenceFont):
1328         (WebCore::copyFontTableForTag): Deleted.
1329         (WebCore::Font::renderingStyle): Deleted.
1330         Merge in the iOS specific parts.
1331
1332         * platform/graphics/ios/SimpleFontDataIOS.mm: Removed.
1333         * platform/graphics/mac/SimpleFontDataMac.mm: Removed.
1334
1335 2015-01-31  Zalan Bujtas  <zalan@apple.com>
1336
1337         Regression(r179438) Simple line layout: ASSERTION at SimpleLineLayout::FlowContentsIterator::runWidth().
1338         https://bugs.webkit.org/show_bug.cgi?id=141121
1339
1340         Reviewed by Antti Koivisto.
1341
1342         When a breakable text fragment does not fit the current line, we split it.
1343         The first part stays on the current line, while the second part gets pushed to the next line.
1344         In certain cases, the first part could end up being empty.
1345         This patch ensures that we don't measure empty fragments.
1346
1347         Covered by existing tests.
1348
1349         * rendering/SimpleLineLayout.cpp:
1350         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
1351
1352 2015-01-31  Commit Queue  <commit-queue@webkit.org>
1353
1354         Unreviewed, rolling out r179426.
1355         https://bugs.webkit.org/show_bug.cgi?id=141119
1356
1357         "caused a memory use regression" (Requested by Guest45 on
1358         #webkit).
1359
1360         Reverted changeset:
1361
1362         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
1363         pages"
1364         https://bugs.webkit.org/show_bug.cgi?id=140900
1365         http://trac.webkit.org/changeset/179426
1366
1367 2015-01-30  Zalan Bujtas  <zalan@apple.com>
1368
1369         Simple line layout: Improve FlowContentsIterator::TextFragment's encapsulation.
1370         https://bugs.webkit.org/show_bug.cgi?id=141090
1371
1372         Reviewed by Andreas Kling.
1373
1374         Make members private to avoid accidental change in TextFragment.
1375
1376         No change in functionality.
1377
1378         * rendering/SimpleLineLayout.cpp:
1379         (WebCore::SimpleLineLayout::LineState::addFragment):
1380         (WebCore::SimpleLineLayout::LineState::addWhitespace):
1381         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
1382         (WebCore::SimpleLineLayout::firstFragment):
1383         (WebCore::SimpleLineLayout::createLineRuns):
1384         * rendering/SimpleLineLayoutFlowContentsIterator.cpp:
1385         (WebCore::SimpleLineLayout::FlowContentsIterator::nextTextFragment):
1386         * rendering/SimpleLineLayoutFlowContentsIterator.h:
1387         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::TextFragment):
1388         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::start):
1389         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::end):
1390         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::width):
1391         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::type):
1392         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isCollapsed):
1393         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isBreakable):
1394         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isEmpty):
1395
1396 2015-01-30  Zalan Bujtas  <zalan@apple.com>
1397
1398         Simple line layout: Make LineState fragment handling simpler.
1399         https://bugs.webkit.org/show_bug.cgi?id=141100
1400
1401         Reviewed by Andreas Kling.
1402
1403         New fragments are appeneded to the Run's last entry
1404         instead of accumulating them until after a new run is required. 
1405         (whitespace collapse or line end)
1406         LineState::appendFragment manages whitespace collapsing now.
1407         This makes createLineRuns() logic lighter and no need to "flush"
1408         the LineState when the line ends.
1409
1410         No change in functionality.
1411
1412         * rendering/SimpleLineLayout.cpp: Make LineState members private and introduce getters.
1413         (WebCore::SimpleLineLayout::LineState::setAvailableWidth):
1414         (WebCore::SimpleLineLayout::LineState::setLogicalLeftOffset):
1415         (WebCore::SimpleLineLayout::LineState::setOverflowedFragment):
1416         (WebCore::SimpleLineLayout::LineState::availableWidth):
1417         (WebCore::SimpleLineLayout::LineState::logicalLeftOffset):
1418         (WebCore::SimpleLineLayout::LineState::overflowedFragment):
1419         (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace):
1420         (WebCore::SimpleLineLayout::LineState::isWhitespaceOnly):
1421         (WebCore::SimpleLineLayout::LineState::fits):
1422         (WebCore::SimpleLineLayout::LineState::firstCharacterFits):
1423         (WebCore::SimpleLineLayout::LineState::width):
1424         (WebCore::SimpleLineLayout::LineState::appendFragment): Append each fragment to the Run 
1425         by either creating a new run or expanding the last one.
1426         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace): Remove trailing whitespace from
1427         the Run's and reset the trailing whitespace variables.
1428         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
1429         (WebCore::SimpleLineLayout::updateLineConstrains):
1430         (WebCore::SimpleLineLayout::firstFragment):
1431         (WebCore::SimpleLineLayout::createLineRuns):
1432         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
1433         (WebCore::SimpleLineLayout::createTextRuns):
1434         (WebCore::SimpleLineLayout::LineState::createRun): Deleted.
1435         (WebCore::SimpleLineLayout::LineState::addFragment): Deleted.
1436         (WebCore::SimpleLineLayout::LineState::addWhitespace): Deleted.
1437         (WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly): Deleted.
1438
1439 2015-01-30  Chris Dumez  <cdumez@apple.com>
1440
1441         Drop HistoryItem's m_prev / m_next
1442         https://bugs.webkit.org/show_bug.cgi?id=141105
1443
1444         Reviewed by Zalan Bujtas.
1445
1446         Drop HistoryItem's m_prev / m_next. Those are no longer needed after
1447         the PageCache refactoring in <http://trac.webkit.org/r179347>.
1448
1449         * history/HistoryItem.cpp:
1450         (WebCore::HistoryItem::HistoryItem):
1451         * history/HistoryItem.h:
1452
1453 2015-01-30  Jeongmin Kim  <jm86.kim@lge.com>
1454
1455         Update the comment in RenderLayer for clarity as related code location is changed
1456         https://bugs.webkit.org/show_bug.cgi?id=141103
1457
1458         Reviewed by Simon Fraser.
1459
1460         Update the comment in RenderLayer for clarity as related code location is changed
1461         The repainting in implicitClose() that is now called in setVisualUpdatesAllowed(bool) is removed
1462
1463         * rendering/RenderLayer.cpp:
1464         (WebCore::shouldSuppressPaintingLayer):
1465         * rendering/RenderLayerCompositor.cpp:
1466         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1467
1468 2015-01-30  Chris Dumez  <cdumez@apple.com>
1469
1470         Optimize MemoryCache::getSessionMap() a bit
1471         https://bugs.webkit.org/show_bug.cgi?id=141069
1472
1473         Reviewed by Anders Carlsson.
1474
1475         Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
1476         instead of previously 3. Also rename the method to
1477         ensureSessionResourceMap() as we usually don't use "get" prefix for
1478         getters and the implementation will also create the HashMap value if
1479         the key is not found.
1480
1481         Also add a alternative sessionResourceMap() method which returns
1482         the HashMap value if the key exists but doesn't try to create it if
1483         missing. This is actually what we really want for some call sites.
1484
1485         * loader/cache/MemoryCache.cpp:
1486         (WebCore::MemoryCache::add):
1487         (WebCore::MemoryCache::revalidationSucceeded):
1488         (WebCore::MemoryCache::resourceForRequest):
1489         (WebCore::MemoryCache::removeImageFromCache):
1490         (WebCore::MemoryCache::remove):
1491         (WebCore::MemoryCache::getSessionMap): Deleted.
1492         * loader/cache/MemoryCache.h:
1493
1494 2015-01-30  Chris Dumez  <cdumez@apple.com>
1495
1496         Unreviewed. Remove outdated comment.
1497
1498         * loader/cache/MemoryCache.cpp:
1499
1500 2015-01-30  Eric Carlson  <eric.carlson@apple.com>
1501
1502         Remove MediaPlayerProxy.h
1503         https://bugs.webkit.org/show_bug.cgi?id=141087
1504
1505         Reviewed by Sam Weinig.
1506
1507         * WebCore.xcodeproj/project.pbxproj: Remove reference to MediaPlayerProxy.h.
1508         * platform/graphics/mac/MediaPlayerProxy.h: Removed.
1509
1510 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
1511
1512         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
1513         https://bugs.webkit.org/show_bug.cgi?id=140900
1514
1515         Reviewed by Mark Hahnenberg.
1516
1517         Re-landing just the HandleBlock piece of this patch.
1518
1519         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1520         (WebCore::MemoryPressureHandler::install):
1521
1522 2015-01-30  Chris Dumez  <cdumez@apple.com>
1523
1524         Update MemoryCache code to use more references instead of pointers
1525         https://bugs.webkit.org/show_bug.cgi?id=141099
1526
1527         Reviewed by Andreas Kling.
1528
1529 2015-01-30  Brian J. Burg  <burg@cs.washington.edu>
1530
1531         Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
1532         https://bugs.webkit.org/show_bug.cgi?id=141039
1533
1534         Reviewed by Timothy Hatcher.
1535
1536         Don't unconditionally stop the environment stopwatch, since it could have
1537         already stopped due to the debugger pausing.
1538
1539         * inspector/InspectorTimelineAgent.cpp:
1540         (WebCore::InspectorTimelineAgent::internalStop):
1541
1542 2015-01-30  Chris Dumez  <cdumez@apple.com>
1543
1544         When no background-size is specified on the 2nd background layer, it takes the first instead of the initial value
1545         https://bugs.webkit.org/show_bug.cgi?id=141059
1546
1547         Reviewed by Antti Koivisto.
1548
1549         This patch fixes fill size support for 'initial' value.
1550
1551         Test: fast/css/background-layers-initial-size.html
1552
1553         * css/CSSToStyleMap.cpp:
1554         - Add check for initial values and set fill size to initialFillSize()
1555           in this case (which is 'auto'). Previously, we were handling all
1556           non CSSPrimitiveValues the same way and setting the fill size type
1557           to SizeNone, which means no size (not 'auto').
1558         - Clean up the rest of the function (no behavior change).
1559
1560         * rendering/style/FillLayer.cpp:
1561         (WebCore::FillLayer::FillLayer):
1562         - Initialize m_sizeLength to SizeNone instead of calling
1563           initialFillSizeType(). There is no behavior change here. However,
1564           initialFillSizeType() was not supposed to return SizeNone.
1565         - Stop explicitly initializing m_sizeLength to LengthSize() as this
1566           is already what happens implicitly.
1567
1568         * rendering/style/FillLayer.h:
1569         (WebCore::FillLayer::initialFillSize):
1570         Return FillSize() instead of FillSize(SizeNone, LengthSize()).
1571         FillSize() is equivalent to FillSize(SizeLength, LengthSize())
1572         which is resolved to 'auto'. SizeNone means no size which isn't
1573         what we want as an initial value.
1574
1575         (WebCore::FillLayer::initialFillSizeType): Deleted.
1576         (WebCore::FillLayer::initialFillSizeLength): Deleted.
1577         Remove Individual initialFillSizeType() / initialFillSizeLength()
1578         functions now that all caller use initialFillSize() instead.
1579
1580 2015-01-30  Commit Queue  <commit-queue@webkit.org>
1581
1582         Unreviewed, rolling out r179403.
1583         https://bugs.webkit.org/show_bug.cgi?id=141091
1584
1585         Broke fast/files/workers/worker-apply-blob-url-to-xhr.html
1586         (Requested by ap_ on #webkit).
1587
1588         Reverted changeset:
1589
1590         "Optimize MemoryCache::getSessionMap() a bit"
1591         https://bugs.webkit.org/show_bug.cgi?id=141069
1592         http://trac.webkit.org/changeset/179403
1593
1594 2015-01-30  Chris Dumez  <cdumez@apple.com>
1595
1596         Rename shared() static member functions to singleton() for singleton classes.
1597         https://bugs.webkit.org/show_bug.cgi?id=141088
1598
1599         Reviewed by Ryosuke Niwa and Benjamin Poulain.
1600
1601         Rename shared() static member functions to singleton() for singleton
1602         classes as per the recent coding style change.
1603
1604 2015-01-30  Matthew Mirman  <mmirman@apple.com>
1605
1606         Added ClientRect as an interface that requires attributes 
1607         on instance for compatibility.
1608         https://bugs.webkit.org/show_bug.cgi?id=141063
1609         <rdar://problem/18437653>
1610
1611         Reviewed by Oliver Hunt.
1612
1613         Added a new test to LayoutTests/js/resources/JSON-stringify.js
1614
1615         * bindings/scripts/CodeGeneratorJS.pm:
1616         (InterfaceRequiresAttributesOnInstanceForCompatibility):
1617
1618 2015-01-30  Chris Dumez  <cdumez@apple.com>
1619
1620         Optimize MemoryCache::getSessionMap() a bit
1621         https://bugs.webkit.org/show_bug.cgi?id=141069
1622
1623         Reviewed by Anders Carlsson.
1624
1625         Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
1626         instead of previously 3. Also rename the method to sessionResources()
1627         as we usually don't use "get" prefix for getters.
1628
1629         * loader/cache/MemoryCache.cpp:
1630         (WebCore::MemoryCache::sessionResources):
1631         (WebCore::MemoryCache::add):
1632         (WebCore::MemoryCache::revalidationSucceeded):
1633         (WebCore::MemoryCache::resourceForRequest):
1634         (WebCore::MemoryCache::removeImageFromCache):
1635         (WebCore::MemoryCache::remove):
1636         (WebCore::MemoryCache::getSessionMap): Deleted.
1637         * loader/cache/MemoryCache.h:
1638
1639 2015-01-30  Chris Dumez  <cdumez@apple.com>
1640
1641         Store MemoryCache's live decoded resources in a ListHashSet
1642         https://bugs.webkit.org/show_bug.cgi?id=141051
1643
1644         Reviewed by Antti Koivisto.
1645
1646         Store MemoryCache's live decoded resources in a ListHashSet instead of
1647         a linked list. The frequent operations are:
1648         1. Add items to one end
1649         2. Remove items from the other end or anywhere in the container by value
1650
1651         Using a ListHashSet instead of a manual linked list results in *much*
1652         simpler / shorter code and is fast for all operations (faster than
1653         linked list even for removing an given element from the container given
1654         its value). The previous implementation required us to keep a lot of
1655         pointers up-to-date, which was error prone.
1656
1657         This is a first step towards simplifying the MemoryCache implementation.
1658
1659         * loader/cache/CachedResource.cpp:
1660         (WebCore::CachedResource::CachedResource):
1661         (WebCore::CachedResource::setDecodedSize):
1662         (WebCore::CachedResource::didAccessDecodedData):
1663         * loader/cache/CachedResource.h:
1664         (WebCore::CachedResource::inLiveDecodedResourcesList): Deleted.
1665         * loader/cache/MemoryCache.cpp:
1666         (WebCore::MemoryCache::pruneLiveResourcesToSize):
1667         (WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
1668         (WebCore::MemoryCache::insertInLiveDecodedResourcesList):
1669         * loader/cache/MemoryCache.h:
1670         (WebCore::MemoryCache::inLiveDecodedResourcesList):
1671
1672 2015-01-30  Csaba Osztrogonác  <ossy@webkit.org>
1673
1674         [cairo] Fix #if guards in platform/graphics/cairo directory
1675         https://bugs.webkit.org/show_bug.cgi?id=141076
1676
1677         Reviewed by Sergio Villar Senin.
1678
1679         * platform/graphics/cairo/BackingStoreBackendCairo.h:
1680         * platform/graphics/cairo/BitmapImageCairo.cpp:
1681         * platform/graphics/cairo/CairoUtilities.cpp:
1682         * platform/graphics/cairo/CairoUtilities.h:
1683         * platform/graphics/cairo/DrawErrorUnderline.h:
1684         * platform/graphics/cairo/DrawingBufferCairo.cpp:
1685         * platform/graphics/cairo/FloatRectCairo.cpp:
1686         * platform/graphics/cairo/FontCairo.cpp:
1687         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
1688         * platform/graphics/cairo/FontCustomPlatformData.h:
1689         * platform/graphics/cairo/GradientCairo.cpp:
1690         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1691         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1692         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
1693         * platform/graphics/cairo/ImageBufferCairo.cpp:
1694         * platform/graphics/cairo/ImageBufferDataCairo.h:
1695         * platform/graphics/cairo/ImageCairo.cpp:
1696         * platform/graphics/cairo/IntRectCairo.cpp:
1697         * platform/graphics/cairo/OwnPtrCairo.cpp:
1698         * platform/graphics/cairo/OwnPtrCairo.h:
1699         * platform/graphics/cairo/PathCairo.cpp:
1700         * platform/graphics/cairo/PatternCairo.cpp:
1701         * platform/graphics/cairo/PlatformContextCairo.cpp:
1702         * platform/graphics/cairo/PlatformContextCairo.h:
1703         * platform/graphics/cairo/PlatformPathCairo.cpp:
1704         * platform/graphics/cairo/PlatformPathCairo.h:
1705         * platform/graphics/cairo/RefPtrCairo.cpp:
1706         * platform/graphics/cairo/RefPtrCairo.h:
1707         * platform/graphics/cairo/TileCairo.h:
1708         * platform/graphics/cairo/TransformationMatrixCairo.cpp:
1709
1710 2015-01-29  Darin Adler  <darin@apple.com>
1711
1712         Remove SVGUseElement.instanceRoot and all tests that depend on it
1713         https://bugs.webkit.org/show_bug.cgi?id=141025
1714
1715         Reviewed by Anders Carlsson.
1716
1717         * svg/SVGUseElement.cpp:
1718         (WebCore::SVGUseElement::instanceRoot): Deleted.
1719         * svg/SVGUseElement.h: Removed instanceRoot.
1720         * svg/SVGUseElement.idl: Ditto.
1721
1722 2015-01-29  Tim Horton  <timothy_horton@apple.com>
1723
1724         Fix the build with newer Clang.
1725
1726         * platform/graphics/ca/GraphicsLayerCA.h:
1727
1728 2015-01-29  Sam Weinig  <sam@webkit.org>
1729
1730         Try to fix the iOS build.
1731
1732         * WebCore.exp.in:
1733
1734 2015-01-29  Brent Fulgham  <bfulgham@apple.com>
1735
1736         [Win] Build fix after r179368.
1737
1738         * platform/graphics/win/UniscribeController.cpp:
1739         (WebCore::UniscribeController::shapeAndPlaceItem): Don't use the no longer
1740         valid isPrinterFont method.
1741
1742 2015-01-29  Tim Horton  <timothy_horton@apple.com>
1743
1744         Fix the build after r179368
1745
1746         * platform/graphics/FontDescription.h:
1747         (WebCore::FontDescription::equalForTextAutoSizing):
1748
1749 2015-01-29  Simon Fraser  <simon.fraser@apple.com>
1750
1751         Border-radius clipping on a stacking context causes descendants to not render
1752         https://bugs.webkit.org/show_bug.cgi?id=140536
1753
1754         Reviewed by Zalan Bujtas.
1755         
1756         Fix one of the issues introduced in r178029. The changes in GraphicsLayerCA
1757         failed to adhere to the "set a bit and flush later" pattern that this class uses,
1758         instead poking the platform layers directly. This caused an issue where the bounds
1759         of the clipping layer would later be set to 0x0, causing content to disappear.
1760         
1761         Fix by changing the "applyClippingBorder" function to "setMasksToBoundsRect"
1762         and have it update via a new MasksToBoundsRectChanged dirty bit.
1763
1764         In order to avoid clobbering the mask layer used to clip contents, we need another
1765         shape mask layer, so rename m_shapeMaskLayer to m_contentsShapeMaskLayer, then
1766         introduce a new m_shapeMaskLayer which is used for masks-to-bounds clipping. Update
1767         the reflection cloning code to correctly clone this layer.
1768
1769         Test: compositing/clipping/border-radius-stacking-context-clip.html
1770
1771         * WebCore.exp.in:
1772         * platform/graphics/GraphicsLayer.h:
1773         (WebCore::GraphicsLayer::maskToBoundsRect):
1774         (WebCore::GraphicsLayer::setMasksToBoundsRect):
1775         (WebCore::GraphicsLayer::applyClippingBorder): Deleted.
1776         (WebCore::GraphicsLayer::clearClippingBorder): Deleted.
1777         * platform/graphics/ca/GraphicsLayerCA.cpp:
1778         (WebCore::GraphicsLayerCA::willBeDestroyed):
1779         (WebCore::GraphicsLayerCA::setMasksToBoundsRect):
1780         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
1781         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1782         (WebCore::GraphicsLayerCA::updateContentsImage):
1783         (WebCore::GraphicsLayerCA::updateContentsRects):
1784         (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
1785         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
1786         (WebCore::GraphicsLayerCA::applyClippingBorder): Deleted.
1787         (WebCore::GraphicsLayerCA::clearClippingBorder): Deleted.
1788         * platform/graphics/ca/GraphicsLayerCA.h:
1789         * rendering/RenderLayerBacking.cpp:
1790         (WebCore::RenderLayerBacking::updateChildClippingStrategy): Add a FIXME since
1791         this code is trying to access geometry and we may not have done layout yet.
1792         Also, to clear the rounded rect, just set a non-rounded rect the size of the layer.
1793
1794 2015-01-29  Sam Weinig  <sam@webkit.org>
1795
1796         Remove support for screen font substitution
1797         https://bugs.webkit.org/show_bug.cgi?id=141038
1798
1799         Reviewed by Tim Horton.
1800
1801         - Removes the screen font substitution setting (which was only on in Mountain Lion)
1802         - Remove the concept of a printer font, from the family of Font related classes.
1803
1804         * WebCore.exp.in:
1805         * css/StyleResolver.cpp:
1806         (WebCore::StyleResolver::initializeFontStyle):
1807         * page/Settings.cpp:
1808         (WebCore::Settings::Settings):
1809         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Deleted.
1810         (WebCore::Settings::setScreenFontSubstitutionEnabled): Deleted.
1811         * page/Settings.h:
1812         (WebCore::Settings::screenFontSubstitutionEnabled): Deleted.
1813         * page/mac/SettingsMac.mm:
1814         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Deleted.
1815         * platform/graphics/FontCache.h:
1816         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):
1817         * platform/graphics/FontCascade.cpp:
1818         (WebCore::FontCascade::FontCascade):
1819         * platform/graphics/FontCascade.h:
1820         (WebCore::FontCascade::isPrinterFont): Deleted.
1821         * platform/graphics/FontDescription.h:
1822         (WebCore::FontDescription::FontDescription):
1823         (WebCore::FontDescription::setWeight):
1824         (WebCore::FontDescription::equalForTextAutoSizing):
1825         (WebCore::FontDescription::operator==):
1826         (WebCore::FontDescription::usePrinterFont): Deleted.
1827         (WebCore::FontDescription::setUsePrinterFont): Deleted.
1828         * platform/graphics/FontPlatformData.h:
1829         (WebCore::FontPlatformData::isCompositeFontReference):
1830         (WebCore::FontPlatformData::hash):
1831         (WebCore::FontPlatformData::operator==):
1832         (WebCore::FontPlatformData::isPrinterFont): Deleted.
1833         * platform/graphics/WidthIterator.h:
1834         (WebCore::WidthIterator::supportsTypesettingFeatures):
1835         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1836         (WebCore::FontCascade::drawGlyphs):
1837         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1838         (WebCore::FontPlatformData::FontPlatformData):
1839         (WebCore::FontPlatformData::platformDataInit):
1840         (WebCore::FontPlatformData::platformDataAssign):
1841         * platform/graphics/ios/FontCacheIOS.mm:
1842         (WebCore::FontCache::getSystemFontFallbackForCharacters):
1843         (WebCore::FontCache::createFontPlatformData):
1844         * platform/graphics/ios/SimpleFontDataIOS.mm:
1845         (WebCore::Font::platformCreateScaledFont):
1846         * platform/graphics/mac/ComplexTextController.cpp:
1847         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1848         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
1849         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
1850         * platform/graphics/mac/FontCacheMac.mm:
1851         (WebCore::FontCache::systemFallbackForCharacters):
1852         (WebCore::FontCache::createFontPlatformData):
1853         * platform/graphics/mac/SimpleFontDataMac.mm:
1854         (WebCore::Font::compositeFontReferenceFont):
1855         (WebCore::Font::platformCreateScaledFont):
1856         * platform/mac/DragImageMac.mm:
1857         (WebCore::fontFromNSFont):
1858         (WebCore::widthWithFont):
1859         (WebCore::drawAtPoint):
1860         * style/StyleResolveForDocument.cpp:
1861         (WebCore::Style::resolveForDocument):
1862
1863 2015-01-20  David Hyatt  <hyatt@apple.com>
1864
1865         Japanese line breaking rules need to be respected before and after Ruby.
1866         https://bugs.webkit.org/show_bug.cgi?id=91588
1867         <rdar://problem/17306535>
1868
1869         Reviewed by Dean Jackson.
1870
1871         Added fast/ruby/ruby-punctuation-avoid-breaking.html.
1872
1873         This patch has to add support for following line breaking rules at both
1874         sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
1875         just hard-code the rules (and apply this hard-coding only to Ruby and not
1876         to other inline replaced elements).
1877
1878         For breaking after a Ruby we do better. The Ruby run caches its prior characters
1879         and line layout is able to obtain them and use them when deciding whether or not
1880         to break. This means for the "after" side of a Ruby, we're able to behave the same
1881         as if no Ruby was used.
1882
1883         * rendering/RenderBlockFlow.h:
1884         (WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):
1885         * rendering/RenderBlockLineLayout.cpp:
1886         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
1887         * rendering/RenderRubyBase.cpp:
1888         (WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):
1889         * rendering/RenderRubyBase.h:
1890         * rendering/RenderRubyRun.cpp:
1891         (WebCore::RenderRubyRun::RenderRubyRun):
1892         (WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
1893         (WebCore::RenderRubyRun::canBreakBefore):
1894         * rendering/RenderRubyRun.h:
1895         * rendering/RenderRubyText.cpp:
1896         (WebCore::RenderRubyText::canBreakBefore):
1897         * rendering/RenderRubyText.h:
1898         * rendering/line/BreakingContextInlineHeaders.h:
1899         (WebCore::BreakingContext::handleReplaced):
1900         (WebCore::BreakingContext::canBreakAtThisPosition):
1901         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
1902
1903 2015-01-28  Beth Dakin  <bdakin@apple.com>
1904
1905         Remove more Mountain Lion code from WebCore
1906         https://bugs.webkit.org/show_bug.cgi?id=141014
1907
1908         Reviewed by Anders Carlsson.
1909
1910         * WebCore.exp.in:
1911         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1912         (AXAttributeStringSetSpelling):
1913         (AXAttributedStringAppendText):
1914         * crypto/CommonCryptoUtilities.h:
1915         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
1916         (WebCore::transformAES_CBC):
1917         * editing/cocoa/HTMLConverter.mm:
1918         (_dateForString):
1919         * html/canvas/ANGLEInstancedArrays.cpp:
1920         (WebCore::ANGLEInstancedArrays::supported):
1921         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1922         * page/mac/SettingsMac.mm:
1923         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
1924         (WebCore::Settings::initializeDefaultFontFamilies):
1925         * platform/audio/mac/MediaSessionManagerMac.cpp:
1926         (MediaSessionManager::updateSessionState):
1927         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1928         (WebCore::MemoryPressureHandler::install):
1929         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
1930         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Deleted.
1931         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1932         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption):
1933         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1934         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1935         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1936         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
1937         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
1938         * platform/graphics/cocoa/IOSurface.mm:
1939         (IOSurface::state):
1940         (IOSurface::isVolatile):
1941         (IOSurface::setIsVolatile):
1942         * platform/graphics/mac/SimpleFontDataMac.mm:
1943         (WebCore::Font::platformInit):
1944         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1945         (WebCore::Extensions3DOpenGL::drawArraysInstanced):
1946         (WebCore::Extensions3DOpenGL::drawElementsInstanced):
1947         (WebCore::Extensions3DOpenGL::vertexAttribDivisor):
1948         * platform/mac/WebCoreSystemInterface.h:
1949         * platform/mac/WebCoreSystemInterface.mm:
1950         * platform/network/cf/ResourceHandleCFNet.cpp:
1951         (WebCore::ResourceHandle::createCFURLConnection):
1952         * platform/network/cocoa/ProtectionSpaceCocoa.h:
1953         (WebCore::ProtectionSpace::encodingRequiresPlatformData):
1954         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
1955         (WebCore::ProtectionSpace::encodingRequiresPlatformData):
1956         * platform/network/mac/ResourceHandleMac.mm:
1957         (WebCore::ResourceHandle::createNSURLConnection):
1958         * platform/network/mac/WebCoreURLResponse.mm:
1959         (WebCore::synthesizeRedirectResponseIfNecessary):
1960         * platform/spi/cf/CFNetworkSPI.h:
1961         * platform/text/mac/LocaleMac.mm:
1962         (WebCore::LocaleMac::LocaleMac):
1963
1964 2015-01-29  Benjamin Poulain  <bpoulain@apple.com>
1965
1966         Remove an extraneous check from the parser of :not()
1967         https://bugs.webkit.org/show_bug.cgi?id=141021
1968
1969         Reviewed by Darin Adler.
1970
1971         * css/CSSGrammar.y.in:
1972         :not() takes a selector list, it can be null if there selector list is invalid,
1973         but there cannot be a invalid pointer.
1974
1975 2015-01-29  Tim Horton  <timothy_horton@apple.com>
1976
1977         Fix the iOS build after r179347
1978
1979         * loader/FrameLoader.cpp:
1980         (WebCore::FrameLoader::commitProvisionalLoad):
1981
1982 2015-01-29  Andreas Kling  <akling@apple.com>
1983
1984         JavaScript bindings constructors should take Ref<ImplType>&&.
1985         <https://webkit.org/b/140952>
1986
1987         Reviewed by Darin Adler.
1988
1989         When constructing a JS wrapper object, there is always going to be a
1990         corresponding DOM object.
1991
1992         Tweak the JavaScript DOM bindings generator to spit out constructors
1993         that take the DOM object by Ref&& rather than PassRefPtr.
1994
1995         This avoids generating unnecessary null checks around every instance
1996         of wrapper construction.
1997
1998         * bindings/js/JSDOMBinding.h:
1999         (WebCore::createWrapper):
2000         * bindings/js/JSDOMWindowShell.cpp:
2001         (WebCore::JSDOMWindowShell::setWindow):
2002         * bindings/js/JSDocumentCustom.cpp:
2003         (WebCore::JSDocument::location):
2004         * bindings/scripts/CodeGeneratorJS.pm:
2005         (GenerateHeader):
2006         (GenerateImplementation):
2007
2008 2015-01-29  Chris Dumez  <cdumez@apple.com>
2009
2010         Clean up / modernize PageCache class
2011         https://bugs.webkit.org/show_bug.cgi?id=141009
2012
2013         Reviewed by Darin Adler.
2014
2015         Clean up / modernize PageCache class:
2016         - Use more references instead of pointers
2017         - Use a ListHashSet<Ref<HistoryItem>> internally instead of a linked
2018           list of HistoryItem*. This avoids having the ref/unref HistoryItems
2019           manually and maintaining the list size separately. It also simplifies
2020           the code dealing with the container and makes looking up HistoryItems
2021           faster as a bonus. Similarly to the previous implementation, we are
2022           adding elements to one end and removing from the opposite end when
2023           pruning to drop old history items first. Note that even though the
2024           previous implementation was called LRUList, it did not move items to
2025           the front when accessed. The new implementation doesn't either.
2026          - Rename "capacity" to "maxSize" to avoid confusing with containers'
2027            capacity (which doesn't limit the size of the container).
2028          - Use unsigned instead of int for all values that are supposed to be
2029            positive.
2030          - Do not explicitely define the default constructor and let the
2031            compiler generate it for us (and use in-class initialization for
2032            members)
2033          - Fix indentation in the header.
2034
2035 2015-01-29  Julien Isorce  <j.isorce@samsung.com>
2036
2037         HTMLImageLoader: fix build failure on assert condition after r179340
2038         https://bugs.webkit.org/show_bug.cgi?id=140722
2039
2040         Reviewed by Csaba Osztrogonác.
2041
2042         * html/HTMLImageLoader.cpp:
2043         (WebCore::HTMLImageLoader::imageChanged): image() directly
2044         returns a CachedImage*.
2045
2046 2015-01-29  Julien Isorce  <j.isorce@samsung.com>
2047
2048         CachedImage: ensure clients overrides imageChanged instead of notifyFinished
2049         https://bugs.webkit.org/show_bug.cgi?id=140722
2050
2051         Reviewed by Tim Horton.
2052
2053         imageChanged is called whenever a frame of an image changes
2054         because we got more data from the network.
2055
2056         notifyFinished was called when the image was entirely loaded.
2057
2058         The problem was that some clients were implementing only
2059         imageChanged (ex: RenderBox), some only notifyFinished and
2060         some both (ex: RenderImage) which made the situation difficult
2061         to understand and to maintain.
2062
2063         For example when the image finished loading, both imageChanged
2064         and notifyFinished were called with the difference that for the
2065         first one isLoaded() returned false.
2066         It could result in functions being called twice in a row,
2067         ex: contentChanged(ImageChanged).
2068
2069         So this patch tries to simplify the situation by marking
2070         CachedImageClient::notifyFinished final in order to prevent
2071         clients from implementing it.
2072         Indeed this patch ensure that CachedImage clients implement
2073         and only implement imageChanged function.
2074
2075         Also Clients can now differentiate intermediate and end
2076         calls by checking isLoaded() in imageChanged.
2077
2078         * html/HTMLImageLoader.cpp:
2079         (WebCore::HTMLImageLoader::imageChanged): Added instead
2080         of notifyFinished.
2081         (WebCore::HTMLImageLoader::notifyFinished): Deleted.
2082         * html/HTMLImageLoader.h:
2083
2084         * loader/ImageLoader.cpp:
2085         (WebCore::ImageLoader::imageChanged): Added instead
2086         of notifyFinished.
2087         (WebCore::ImageLoader::notifyFinished): Deleted.
2088         * loader/ImageLoader.h:
2089
2090         * loader/cache/CachedImage.cpp:
2091         (WebCore::CachedImage::finishLoading): Explicilty mark image as
2092         loaded and before notifying observers. So that it avoids to call
2093         notifyFinished (from CachedResource::finishLoading).
2094
2095         * loader/cache/CachedImageClient.h:
2096         Make CachedImageClient::notifyFinished final to make sure
2097         sub classes implement imageChanged instead.
2098
2099         * rendering/RenderImage.cpp:
2100         (WebCore::RenderImage::notifyFinished): Deleted.
2101         ImageChanged already exists and is more clever than notifyFinished.
2102         Indeed invalidateBackgroundObscurationStatus() will be called by
2103         RenderReplaced::layout() upon call to setNeedsLayout() in
2104         RenderImage::imageDimensionsChanged.
2105         Also contentChanged(ImageChanged) is now called only when necessary.
2106         * rendering/RenderImage.h:
2107
2108         * svg/SVGFEImageElement.cpp:
2109         (WebCore::SVGFEImageElement::imageChanged): Added instead
2110         of notifyFinished.
2111         (WebCore::SVGFEImageElement::notifyFinished): Deleted.
2112         * svg/SVGFEImageElement.h:
2113
2114 2015-01-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2115
2116         Poor performance on IE's Chalkboard benchmark.
2117         https://bugs.webkit.org/show_bug.cgi?id=140753.
2118
2119         Reviewed by Zalan Bujtas.
2120
2121         Test: PerformanceTests/SVG/UnderTheSeeBenchmark.html
2122               PerformanceTests/SVG/WorldcupBenchmark.html
2123               
2124         The SVG rendering code was not skipping the SVG elements which are outside the
2125         clipping rectangle. We were drawing all the SVG elements even if some of them
2126         are completely outside the clipping rectangle. The fix is to pass the correct
2127         dirty rectangle to the ScrollView which then gets propagated to the SVG renderers.
2128
2129         * svg/graphics/SVGImage.cpp:
2130         (WebCore::SVGImage::draw):
2131         SVGImage::draw() needs to pass the intersection of 'srcRect' and context->clipBounds(),
2132         to ScrollView::paint(). This will ensure RenderSVGShape::paint() gets the correct
2133         clipping rectangle. If there is no intersection between the boundingBox of the
2134         RenderSVGShape and the clipping rectangle, the RenderSVGShape will not be drawn.
2135
2136 2015-01-28  Brent Fulgham  <bfulgham@apple.com>
2137
2138         Scroll snap points do not work in the vertical direction
2139         https://bugs.webkit.org/show_bug.cgi?id=141001
2140         <rdar://problem/19632089>
2141
2142         Reviewed by Beth Dakin.
2143
2144         New scroll snap tests are being prepared separately. A manual test case is attached to the issue.
2145
2146         * page/EventHandler.cpp:
2147         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis): We want to consider momentum end phase
2148         when dealing with Scroll Snap Points.
2149         * platform/mac/AxisScrollSnapAnimator.mm:
2150         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): We do NOT want to bail out early here. In fact, it's strange
2151         that this code was like this at all, since it meant a large number of cases were not being used. We also want to
2152         trigger the scroll snap animation (when applicable) upon an inertia scroll end.
2153         * platform/mac/ScrollAnimatorMac.mm:
2154         (WebCore::gestureShouldBeginSnap): Added.
2155         (WebCore::ScrollAnimatorMac::allowsVerticalStretching): If we have automatic elasticity, and we have active scroll
2156         snap points, we want to let the scroll snap animator deal with the gesture.
2157         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching): Ditto.
2158
2159 2015-01-28  Benjamin Poulain  <bpoulain@apple.com>
2160
2161         Start fixing the handling of Element's attributes when they contain non-ASCII characters
2162         https://bugs.webkit.org/show_bug.cgi?id=141016
2163
2164         Reviewed by Ryosuke Niwa.
2165
2166         Attribute handling does not work properly when the attribute name contains non-ASCII character.
2167
2168         The HTML parser tokenize those names as ASCII lowercase. Some of the code is CSS and Element use
2169         unicode lowercase for the names. This breaks all the APIs as soon as a name contains a character
2170         that is non-ASCII and uppercase since some APIs change it, other don't.
2171
2172         This patch is a first step toward fixing this mess, it only address the simple cases.
2173         The HTML spec says the names should be compared ASCII case-insensitive, to I spread that behavior
2174         to places that were using unicode.
2175
2176         Tests: fast/css/attribute-ascii-case-insensitive-html.html
2177                fast/css/attribute-ascii-case-insensitive-xhtml-expected.xhtml
2178                fast/css/attribute-ascii-case-insensitive-xhtml.xhtml
2179                fast/css/attribute-ascii-case-insensitive-xml-in-html.html
2180                fast/dom/Element/attribute-ascii-case-insensitive-1.html
2181                fast/dom/Element/attribute-ascii-case-insensitive-2.html
2182                fast/selectors/attribute-ascii-case-insensitive-style-update.html
2183                fast/selectors/element-matches-attribute-ascii-case-insensitive-html.html
2184                fast/selectors/querySelector-attribute-ascii-case-insensitive-html.html
2185
2186         * css/CSSSelector.cpp:
2187         (WebCore::CSSSelector::setAttribute):
2188         * dom/Element.cpp:
2189         (WebCore::Element::synchronizeAttribute):
2190         (WebCore::Element::setAttribute):
2191         (WebCore::Element::removeAttribute):
2192         (WebCore::Element::hasAttribute):
2193         * dom/ElementData.cpp:
2194         (WebCore::ElementData::findAttributeIndexByNameSlowCase):
2195         * dom/ElementData.h:
2196         (WebCore::ElementData::findAttributeIndexByName):
2197
2198 2015-01-28  Zalan Bujtas  <zalan@apple.com>
2199
2200         Simple line layout: Drop uncommitted/committed terms from LineState.
2201         https://bugs.webkit.org/show_bug.cgi?id=141005
2202
2203         Reviewed by Antti Koivisto.
2204
2205         Fragments form segments and segments turn into runs on the lines.
2206         We add fragments only when they fit so they should not be in 'uncommitted' state at all.
2207
2208         No change in functionality.
2209
2210         * rendering/SimpleLineLayout.cpp:
2211         (WebCore::SimpleLineLayout::LineState::createRun):
2212         (WebCore::SimpleLineLayout::LineState::addFragment):
2213         (WebCore::SimpleLineLayout::LineState::addWhitespace):
2214         (WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly):
2215         (WebCore::SimpleLineLayout::LineState::width):
2216         (WebCore::SimpleLineLayout::LineState::firstCharacterFits):
2217         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
2218         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
2219         (WebCore::SimpleLineLayout::firstFragment):
2220         (WebCore::SimpleLineLayout::createLineRuns):
2221         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2222         (WebCore::SimpleLineLayout::createTextRuns): Unnecessary assert.
2223         (WebCore::SimpleLineLayout::LineState::commitAndCreateRun): Deleted.
2224         (WebCore::SimpleLineLayout::LineState::addUncommitted): Deleted.
2225         (WebCore::SimpleLineLayout::LineState::addUncommittedWhitespace): Deleted.
2226
2227 2015-01-28  Chris Dumez  <cdumez@apple.com>
2228
2229         Regression(r177494): Bad cast to WebKitCSSResourceValue in StyleBuilderConverter::convertMaskImageOperations()
2230         https://bugs.webkit.org/show_bug.cgi?id=140991
2231         <rdar://problem/19625305>
2232
2233         Reviewed by Antti Koivisto.
2234
2235         convertMaskImageOperations() was assuming that the CSSValueList's values
2236         were always WebKitCSSResourceValue values. However, they can be
2237         CSSInitialValues as well so we should check before casting.
2238
2239         Test: css3/masking/mask-image-initial-value-crash.html
2240
2241         * css/StyleBuilderConverter.h:
2242         (WebCore::maskImageValueFromIterator):
2243         (WebCore::StyleBuilderConverter::convertMaskImageOperations):
2244
2245 2015-01-28  Chris Dumez  <cdumez@apple.com>
2246
2247         Remove dead code from MemoryCache
2248         https://bugs.webkit.org/show_bug.cgi?id=140964
2249
2250         Reviewed by Andreas Kling.
2251
2252         Remove dead code from MemoryCache, make more things private and
2253         clean up a little bit.
2254
2255         * WebCore.exp.in:
2256         * inspector/InspectorResourceAgent.cpp:
2257         * loader/cache/MemoryCache.cpp:
2258         (WebCore::MemoryCache::MemoryCache):
2259         (WebCore::MemoryCache::revalidationSucceeded):
2260         (WebCore::MemoryCache::removeImageFromCache):
2261         (WebCore::MemoryCache::pruneLiveResources):
2262         (WebCore::MemoryCache::pruneDeadResources):
2263         (WebCore::MemoryCache::pruneDeadResourcesToSize):
2264         (WebCore::MemoryCache::remove):
2265         (WebCore::MemoryCache::removeRequestFromSessionCaches):
2266         (WebCore::MemoryCache::setDisabled):
2267         (WebCore::MemoryCache::resourceForURL): Deleted.
2268         (WebCore::MemoryCache::pruneLiveResourcesToPercentage): Deleted.
2269         (WebCore::MemoryCache::pruneDeadResourcesToPercentage): Deleted.
2270         (WebCore::MemoryCache::evict): Deleted.
2271         (WebCore::MemoryCache::removeUrlFromCache): Deleted.
2272         (WebCore::MemoryCache::removeRequestFromCache): Deleted.
2273         (WebCore::MemoryCache::pruneToPercentage): Deleted.
2274         * loader/cache/MemoryCache.h:
2275         (WebCore::MemoryCache::LRUList::LRUList): Deleted.
2276         (WebCore::MemoryCache::remove): Deleted.
2277         (WebCore::MemoryCache::setPruneEnabled): Deleted.
2278         (WebCore::MemoryCache::minDeadCapacity): Deleted.
2279         (WebCore::MemoryCache::maxDeadCapacity): Deleted.
2280         (WebCore::MemoryCache::capacity): Deleted.
2281         (WebCore::MemoryCache::liveSize): Deleted.
2282         (WebCore::MemoryCache::deadSize): Deleted.
2283         * platform/MemoryPressureHandler.cpp:
2284         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2285
2286 2015-01-28  Brian J. Burg  <burg@cs.washington.edu>
2287
2288         Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
2289         https://bugs.webkit.org/show_bug.cgi?id=140961
2290
2291         Reviewed by Timothy Hatcher.
2292
2293         No new tests, no behavior changed.
2294
2295         * CMakeLists.txt:
2296         * WebCore.vcxproj/WebCore.vcxproj:
2297         * WebCore.vcxproj/WebCore.vcxproj.filters:
2298         * WebCore.xcodeproj/project.pbxproj:
2299         * inspector/InspectorAllInOne.cpp:
2300         * inspector/InspectorCSSAgent.cpp:
2301         (WebCore::InspectorCSSAgent::setPropertyText): Deleted.
2302         (WebCore::InspectorCSSAgent::toggleProperty): Deleted.
2303         * inspector/InspectorCSSAgent.h:
2304         * inspector/InspectorStyleSheet.cpp:
2305         (WebCore::InspectorStyle::InspectorStyle):
2306         (WebCore::InspectorStyle::populateAllProperties):
2307         (WebCore::InspectorStyleSheet::InspectorStyleSheet):
2308         (WebCore::InspectorStyleSheet::reparseStyleSheet):
2309         (WebCore::InspectorStyleSheet::inspectorStyleForId):
2310         (WebCore::InspectorStyle::setPropertyText): Deleted.
2311         (WebCore::InspectorStyle::toggleProperty): Deleted.
2312         (WebCore::InspectorStyle::newLineAndWhitespaceDelimiters): Deleted.
2313         (WebCore::InspectorStyleSheet::setPropertyText): Deleted.
2314         (WebCore::InspectorStyleSheet::toggleProperty): Deleted.
2315         (WebCore::InspectorStyleSheet::rememberInspectorStyle): Deleted.
2316         (WebCore::InspectorStyleSheet::forgetInspectorStyle): Deleted.
2317         (WebCore::InspectorStyleSheet::revalidateStyle): Deleted.
2318         * inspector/InspectorStyleSheet.h:
2319         * inspector/InspectorStyleTextEditor.cpp: Removed.
2320         * inspector/InspectorStyleTextEditor.h: Removed.
2321
2322 2015-01-28  Zalan Bujtas  <zalan@apple.com>
2323
2324         Simple line layout: Move FlowContents iterator interface to FlowContentsIterator.
2325         https://bugs.webkit.org/show_bug.cgi?id=140944
2326
2327         Reviewed by Antti Koivisto.
2328
2329         This patch cleans up FlowContents's interface by moving the iterator functionality
2330         to this new FlowContentsIterator class.
2331
2332         No change in functionality.
2333
2334         * CMakeLists.txt:
2335         * WebCore.vcxproj/WebCore.vcxproj:
2336         * WebCore.vcxproj/WebCore.vcxproj.filters:
2337         * WebCore.xcodeproj/project.pbxproj:
2338         * rendering/SimpleLineLayout.cpp:
2339         (WebCore::SimpleLineLayout::LineState::addUncommitted):
2340         (WebCore::SimpleLineLayout::LineState::addUncommittedWhitespace):
2341         (WebCore::SimpleLineLayout::preWrap):
2342         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
2343         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2344         (WebCore::SimpleLineLayout::firstFragment):
2345         (WebCore::SimpleLineLayout::createLineRuns):
2346         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
2347         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary):
2348         (WebCore::SimpleLineLayout::createTextRuns):
2349         * rendering/SimpleLineLayoutFlowContents.cpp:
2350         (WebCore::SimpleLineLayout::FlowContents::FlowContents):
2351         (WebCore::SimpleLineLayout::FlowContents::Style::Style): Deleted.
2352         (WebCore::SimpleLineLayout::FlowContents::nextTextFragment): Deleted.
2353         (WebCore::SimpleLineLayout::nextBreakablePosition): Deleted.
2354         (WebCore::SimpleLineLayout::FlowContents::findNextBreakablePosition): Deleted.
2355         (WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
2356         (WebCore::SimpleLineLayout::FlowContents::findNextNonWhitespacePosition): Deleted.
2357         (WebCore::SimpleLineLayout::FlowContents::textWidth): Deleted.
2358         (WebCore::SimpleLineLayout::FlowContents::runWidth): Deleted.
2359         * rendering/SimpleLineLayoutFlowContents.h:
2360         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator):
2361         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
2362         (WebCore::SimpleLineLayout::FlowContents::begin):
2363         (WebCore::SimpleLineLayout::FlowContents::end):
2364         (WebCore::SimpleLineLayout::FlowContents::length):
2365         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++):
2366         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==):
2367         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=):
2368         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition):
2369         (WebCore::SimpleLineLayout::FlowContents::TextFragment::TextFragment): Deleted.
2370         (WebCore::SimpleLineLayout::FlowContents::TextFragment::isEmpty): Deleted.
2371         (WebCore::SimpleLineLayout::FlowContents::hasOneSegment): Deleted.
2372         (WebCore::SimpleLineLayout::FlowContents::style): Deleted.
2373         (WebCore::SimpleLineLayout::FlowContents::characterAt): Deleted.
2374         (WebCore::SimpleLineLayout::FlowContents::isLineBreak): Deleted.
2375         (WebCore::SimpleLineLayout::FlowContents::isEnd): Deleted.
2376         * rendering/SimpleLineLayoutFlowContentsIterator.cpp: Copied from Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp.
2377         (WebCore::SimpleLineLayout::FlowContentsIterator::Style::Style):
2378         (WebCore::SimpleLineLayout::FlowContentsIterator::FlowContentsIterator):
2379         (WebCore::SimpleLineLayout::FlowContentsIterator::nextTextFragment):
2380         (WebCore::SimpleLineLayout::FlowContentsIterator::textWidth):
2381         (WebCore::SimpleLineLayout::nextBreakablePosition):
2382         (WebCore::SimpleLineLayout::FlowContentsIterator::findNextBreakablePosition):
2383         (WebCore::SimpleLineLayout::findNextNonWhitespace):
2384         (WebCore::SimpleLineLayout::FlowContentsIterator::findNextNonWhitespacePosition):
2385         (WebCore::SimpleLineLayout::FlowContentsIterator::runWidth):
2386         * rendering/SimpleLineLayoutFlowContentsIterator.h: Copied from Source/WebCore/rendering/SimpleLineLayoutFlowContents.h.
2387         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::TextFragment):
2388         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isEmpty):
2389         (WebCore::SimpleLineLayout::FlowContentsIterator::style):
2390         (WebCore::SimpleLineLayout::FlowContentsIterator::segmentForPosition):
2391         (WebCore::SimpleLineLayout::FlowContentsIterator::characterAt):
2392         (WebCore::SimpleLineLayout::FlowContentsIterator::isLineBreak):
2393         (WebCore::SimpleLineLayout::FlowContentsIterator::isEnd):
2394
2395 2015-01-28  Beth Dakin  <bdakin@apple.com>
2396
2397         Remove Mountain Lion code from WebCore
2398         https://bugs.webkit.org/show_bug.cgi?id=141007
2399
2400         Reviewed by Sam Weinig.
2401
2402         * WebCore.exp.in:
2403         * page/AlternativeTextClient.h:
2404         * page/mac/SettingsMac.mm:
2405         (WebCore::Settings::initializeDefaultFontFamilies):
2406         * platform/cocoa/SystemVersion.mm:
2407         (WebCore::callGestalt): Deleted.
2408         (WebCore::createSystemMarketingVersion): Deleted.
2409         * platform/graphics/Font.cpp:
2410         (WebCore::Font::applyTransforms):
2411         * platform/graphics/WidthIterator.h:
2412         (WebCore::WidthIterator::supportsTypesettingFeatures):
2413         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2414         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
2415         * platform/graphics/ca/GraphicsLayerCA.cpp:
2416         (WebCore::supportsAcceleratedFilterAnimations):
2417         * platform/graphics/ca/PlatformCAFilters.h:
2418         * platform/graphics/mac/FontCacheMac.mm:
2419         (WebCore::FontCache::platformInit):
2420         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2421         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
2422         * platform/mac/PlatformEventFactoryMac.mm:
2423         (WebCore::phaseForEvent):
2424         * platform/mac/WebCoreSystemInterface.h:
2425         * platform/mac/WebCoreSystemInterface.mm:
2426         * platform/network/cf/SocketStreamHandleCFNet.cpp:
2427         (WebCore::SocketStreamHandle::createStreams):
2428         * platform/network/cocoa/CredentialCocoa.mm:
2429         (WebCore::toCredentialPersistence):
2430         * platform/spi/cocoa/CoreTextSPI.h:
2431
2432 2015-01-28  peavo@outlook.com  <peavo@outlook.com>
2433
2434         [WinCairo] Compile error in media player implementation.
2435         https://bugs.webkit.org/show_bug.cgi?id=141004
2436
2437         Reviewed by Brent Fulgham.
2438
2439         MediaPlayer::cachedResourceLoader() returns a pointer to the resource loader, not a reference.
2440
2441         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2442         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
2443         (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow):
2444
2445 2015-01-28  Jeremy Jones  <jeremyj@apple.com>
2446
2447         Prevent implicit animation when setting fullscreen background to clear.
2448         https://bugs.webkit.org/show_bug.cgi?id=140888
2449
2450         Reviewed by Eric Carlson.
2451
2452         This patch decreases flicker when exiting fullscreen by preventing
2453         an implicit animation when changing the background to clear.
2454
2455         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2456         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
2457
2458 2015-01-28  Dana Burkart  <dburkart@apple.com>
2459
2460         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
2461         https://bugs.webkit.org/show_bug.cgi?id=136765
2462
2463         Reviewed by Alexey Proskuryakov.
2464
2465         * Configurations/Base.xcconfig:
2466         * Configurations/DebugRelease.xcconfig:
2467         * WebCore.xcodeproj/project.pbxproj:
2468
2469 2015-01-28  Chris Dumez  <cdumez@apple.com>
2470
2471         Use an enum class for createFontFamilyValue()'s fromSystemFontID argument
2472         https://bugs.webkit.org/show_bug.cgi?id=140981
2473
2474         Reviewed by Darin Adler.
2475
2476         Use an enum class for createFontFamilyValue()'s fromSystemFontID argument
2477         instead of a simple enum, as suggested by Sam. This is a bit nicer.
2478
2479         Also, use a boolean type for CSSFontFamily.fromSystemFontID instead of
2480         the enum type to facilitate handling. Using a enum (class) for
2481         CSSFontFamily's fromSystemFontID member is not useful as it is always
2482         accessed by name.
2483
2484         * css/CSSFontFamily.h:
2485         * css/CSSParser.cpp:
2486         (WebCore::CSSParser::parseSystemFont):
2487         * css/CSSValuePool.cpp:
2488         (WebCore::CSSValuePool::createFontFamilyValue):
2489         * css/CSSValuePool.h:
2490
2491 2015-01-28  Chris Dumez  <cdumez@apple.com>
2492
2493         Fix typo in markPagesForVistedLinkStyleRecalc()
2494         https://bugs.webkit.org/show_bug.cgi?id=140977
2495
2496         Reviewed by Darin Adler.
2497
2498         * WebCore.exp.in:
2499         * history/CachedPage.h:
2500         (WebCore::CachedPage::markForVisitedLinkStyleRecalc):
2501         (WebCore::CachedPage::markForVistedLinkStyleRecalc): Deleted.
2502         * history/PageCache.cpp:
2503         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc):
2504         (WebCore::PageCache::markPagesForVistedLinkStyleRecalc): Deleted.
2505         * history/PageCache.h:
2506
2507 2015-01-28  Chris Dumez  <cdumez@apple.com>
2508
2509         Unreviewed. Remove duplicate friend class statement after r179255.
2510
2511         * history/PageCache.h:
2512
2513 2015-01-28  Darin Adler  <darin@apple.com>
2514
2515         Make SVGElement::instancesForElement point to elements in the shadow tree, not SVGElementInstance objects
2516         https://bugs.webkit.org/show_bug.cgi?id=140984
2517
2518         Reviewed by Anders Carlsson.
2519
2520         Refactoring of code that is pretty well covered by existing tests, so
2521         not adding new tests.
2522
2523         Inspired by work Rob Buis did in Blink:
2524
2525             http://src.chromium.org/viewvc/blink?view=revision&revision=173275
2526
2527         * page/EventHandler.cpp:
2528         (WebCore::EventHandler::clear): Removed code to zero m_lastInstanceUnderMouse.
2529         (WebCore::instanceAssociatedWithShadowTreeElement): Deleted.
2530         (WebCore::EventHandler::updateMouseEventTargetNode): Removed code that used
2531         m_lastInstanceUnderMouse to track events on an object after recloning.
2532         This behavior doesn't seem to be needed to pass any existing tests, and Rob
2533         removed it from Blink, so I'll take it out and we can bring if back, based
2534         on the original element rather than on the SVGElementInstance, if we find we
2535         need to restore the behavior in the future.
2536
2537         * page/EventHandler.h: Removed m_lastInstanceUnderMouse.
2538
2539         * svg/SVGAnimateElementBase.cpp:
2540         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType):
2541         Changed this function to take a reference and to call the updated version
2542         of the targetElement.animatedPropertyTypesForAttribute function.
2543         (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Updated to pass
2544         a reference rather than a pointer.
2545         (WebCore::SVGAnimateElementBase::resetAnimatedType): Updated to pass
2546         references rather than pointers.
2547         (WebCore::applyCSSPropertyToTarget): Updated to take a reference.
2548         (WebCore::removeCSSPropertyFromTarget): Ditto.
2549         (WebCore::applyCSSPropertyToTargetAndInstances): Ditto. Also use a modern
2550         for loop, and iterate over shadow tree instances, not over SVGElementInstance.
2551         (WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
2552         (WebCore::notifyTargetAboutAnimValChange): Ditto.
2553         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
2554         (WebCore::SVGAnimateElementBase::clearAnimatedType): More of the same.
2555         (WebCore::SVGAnimateElementBase::applyResultsToTarget): Ditto.
2556         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Ditto.
2557
2558         * svg/SVGAnimateElementBase.h: Changed determineAnimatedPropertyType to take
2559         a reference rahter than a pointer.
2560
2561         * svg/SVGAnimateMotionElement.cpp:
2562         (WebCore::SVGAnimateMotionElement::applyResultsToTarget): Updated to use the
2563         new instances instead of SVGElementInstance. Also added code to skip work if
2564         the transform is not changing, and use the assignment operator instead of
2565         breaking one matrix down and calling setMatrix on the other.
2566
2567         * svg/SVGAnimatedTypeAnimator.cpp:
2568         (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
2569         Changed to take a reference rather than a pointer, and rewrote to streamline,
2570         using modern for loops and using the new instances set.
2571
2572         * svg/SVGAnimatedTypeAnimator.h: Removed the constructors from the
2573         SVGElementAnimatedProperties struct since we can build them just fine without
2574         them. Changed findAnimatedPropertiesForAttributeName to take a reference.
2575
2576         * svg/SVGAnimationElement.cpp:
2577         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Pass a
2578         reference rather than a pointer. Also streamlined the code a bit and removed
2579         a comment that tried to say exactly what the code was doing, but was outdated.
2580
2581         * svg/SVGElement.cpp:
2582         (WebCore::SVGElement::~SVGElement): Disconnect all instances from this element
2583         and also disconnect the corresponding element from this element if it itself
2584         is an instance. This guarantees we have no dangling pointers.
2585         (WebCore::SVGElement::mapInstanceToElement): Deleted.
2586         (WebCore::SVGElement::removeInstanceMapping): Deleted.
2587         (WebCore::SVGElement::instances): Renamed from instancesForElement and changed
2588         to be a set of SVG element instances in the shadow tree, rather than
2589         SVGElementInstance objects.
2590         (WebCore::SVGElement::correspondingElement): Tweaked assertion a little and use
2591         nullptr instead of 0.
2592         (WebCore::SVGElement::correspondingUseElement): Added. Finds the use element
2593         that owns the shadow tree this element is in by following the host element
2594         pointer from the shadow root.
2595         (WebCore::SVGElement::setCorrespondingElement): Added code to insert or remove
2596         this element from the instances set of the corresponding element.
2597         (WebCore::SVGElement::animatedPropertyTypesForAttribute): Renamed from
2598         animatedPropertyTypeForAttribute and switched to use a return value instead of
2599         an out argument.
2600         (WebCore::SVGElement::addEventListener): Updated to use instances rather than
2601         the old instancesForElement.
2602         (WebCore::SVGElement::removeEventListener): Ditto.
2603         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): Pass a reference.
2604         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute): Ditto.
2605         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Updated to use the
2606         new function from AttributeToPropertyMap.
2607
2608         * svg/SVGElement.h: Changed animatedPropertyTypesForAttribute name to be plural
2609         since it returns a vector of types, and made it use a return value instead of
2610         an out argument. Added the correspondingUseElement function, and removed the
2611         mapInstanceToElement and removeInstanceMapping functions.
2612
2613         * svg/SVGElementInstance.cpp:
2614         (WebCore::SVGElementInstance::SVGElementInstance): Removed now-unneeded call to
2615         mapInstanceToElement. This is now handled entirely by the SVGElement itself.
2616         (WebCore::SVGElementInstance::detach): Removed now-unneeded call to
2617         removeInstanceMapping. This is now handled entirely by the SVGElement itself.
2618         (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Rewrote to be
2619         based on the instances set; logic is different now because we remove each
2620         element from that set as we go.
2621
2622         * svg/SVGElementRareData.h:
2623         (WebCore::SVGElementRareData::SVGElementRareData): Removed initialization of
2624         pointers since we can do that where they are defined instead.
2625         (WebCore::SVGElementRareData::instances): Renamed from elementInstances and
2626         changed the type.
2627         (WebCore::SVGElementRareData::destroyAnimatedSMILStyleProperties): Deleted.
2628         Unneeded since it was already called just before deleting the rare data.
2629
2630         * svg/SVGTests.cpp:
2631         (WebCore::SVGTests::SVGTests): Took advantage of using namespace.
2632         (WebCore::createSVGTestPropertyInfo): Added. Helper for function below.
2633         (WebCore::createSVGTextAttributeToPropertyMap): Ditto.
2634         (WebCore::SVGTests::attributeToPropertyMap): Changed to use the create function
2635         above. No longer allocates objects on the heap.
2636         (WebCore::SVGTests::hasExtension): Reworked #if code to make the MathML part
2637         independent rather than repeating the return statement.
2638         (WebCore::SVGTests::synchronizeAttribute): Added. Helper for functions below.
2639         (WebCore::SVGTests::synchronizeRequiredFeatures): Call synchronizeAttribute.
2640         (WebCore::SVGTests::synchronizeRequiredExtensions): Ditto.
2641         (WebCore::SVGTests::synchronizeSystemLanguage): Ditto.
2642
2643         * svg/SVGTests.h: Removed unneeded forward declarations. Mark the many functions
2644         that do not depend on object state as static so the call sites don't wastefully
2645         pass a this pointer. Removed the unneeded requiredFeaturesPropertyInfo,
2646         requiredExtensionsPropertyInfo, and systemLanguagePropertyInfo functions.
2647         Added synchronizeAttribute helper function.
2648
2649         * svg/SVGUseElement.cpp:
2650         (WebCore::SVGUseElement::invalidateDependentShadowTrees): Updated to use the
2651         new instances set and a modern for loop.
2652
2653         * svg/properties/SVGAnimatedPropertyMacros.h: Pass reference to addProperty and
2654         made a few other small refinements.
2655
2656         * svg/properties/SVGAttributeToPropertyMap.cpp:
2657         (WebCore::SVGAttributeToPropertyMap::addProperties): Fixed problems mentioned
2658         in FIXME where we did too much hashing and vector resizing.
2659         (WebCore::SVGAttributeToPropertyMap::addProperty): Streamlined to use a single
2660         hash table lookup.
2661         (WebCore::SVGAttributeToPropertyMap::properties): Renamed from
2662         animatedPropertiesForAttribute and changed to return a vector rather than using
2663         an out argument. Also had to change some since the vectors are in the hash table
2664         now rather than allocated on the heap.
2665         (WebCore::SVGAttributeToPropertyMap::types): Renamed from
2666         animatedPropertyTypeForAttribute and made changes just like the ones above.
2667         (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): Use modern for
2668         loops, take a reference rather than a pointer, and use the function pointer
2669         directly instead of calling through a helper with various assertions.
2670         (WebCore::SVGAttributeToPropertyMap::synchronizeProperty): Ditto.
2671
2672         * svg/properties/SVGAttributeToPropertyMap.h: Updated to match the changes
2673         above. Also changed the map to contain vectors instead of pointers to vectors.
2674
2675 2015-01-28  Darin Adler  <darin@apple.com>
2676
2677         REGRESSION (r173698): Leaks of selector lists in CSS parsing
2678         https://bugs.webkit.org/show_bug.cgi?id=140993
2679
2680         Reviewed by Anders Carlsson.
2681
2682         * css/CSSGrammar.y.in: Fixed logic in rules that were not moving a parser-
2683         owned pointer into a unique_ptr in all code paths. The magic value
2684         invalidSelectorVector makes this really messy. We might want to find a
2685         different seolution in the future.
2686
2687 2015-01-28  Brent Fulgham  <bfulgham@apple.com>
2688
2689         [Win] Unreviewed build fix after r179247.
2690
2691         * history/PageCache.h: Need to declare NeverDestroyed specialization as
2692         a friend.
2693
2694 2015-01-28  Joanmarie Diggs  <jdiggs@igalia.com>
2695
2696         AX: [ATK] Implement support for new AtkRole types for MathML
2697         https://bugs.webkit.org/show_bug.cgi?id=140916
2698
2699         Reviewed by Chris Fleizach.
2700
2701         Expose mfrac as ATK_ROLE_MATH_FRACTION, and both mroot and msqrt as
2702         ATK_ROLE_MATH_ROOT. In the case of script elements, expose the container
2703         (msub, msup, msubsup, and mmultiscripts) using the generic text block role
2704         ATK_ROLE_SECTION. Then expose the actual script child elements using role
2705         ATK_ROLE_SUBSCRIPT/ATK_ROLE_SUPERSCRIPT. In the case of mmultiscripts,
2706         expose whether it is a prescript or postscript via AtkObject attribute.
2707
2708         Test: accessibility/math-multiscript-attributes.html
2709         Also added additional test cases to accessibility/roles-exposed.html
2710
2711         * accessibility/AccessibilityObject.h:
2712         (WebCore::AccessibilityObject::isMathScriptObject): Added.
2713         (WebCore::AccessibilityObject::isMathMultiscriptObject): Added.
2714         * accessibility/AccessibilityRenderObject.cpp:
2715         (WebCore::AccessibilityRenderObject::isMathScriptObject): Added.
2716         (WebCore::AccessibilityRenderObject::isMathMultiscriptObject): Added.
2717         * accessibility/AccessibilityRenderObject.h:
2718         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2719         (webkitAccessibleGetAttributes): Expose whether a multiscript object is a prescript or postscript.
2720         (atkRole): Map WebCore Accessibility objects to the new ATK roles.
2721
2722 2015-01-28  Chris Dumez  <cdumez@apple.com>
2723
2724         Rename pageCache() to PageCache::shared() and return a reference
2725         https://bugs.webkit.org/show_bug.cgi?id=140983
2726
2727         Reviewed by Andreas Kling.
2728
2729         Rename pageCache() to PageCache::shared() as this is a singleton class
2730         and have it return a reference instead of a pointer.
2731
2732         * history/BackForwardList.cpp:
2733         (WebCore::BackForwardList::addItem):
2734         (WebCore::BackForwardList::setCapacity):
2735         (WebCore::BackForwardList::clearAllPageCaches):
2736         (WebCore::BackForwardList::close):
2737         * history/CachedFrame.cpp:
2738         (WebCore::CachedFrame::CachedFrame):
2739         * history/HistoryItem.cpp:
2740         (WebCore::HistoryItem::setURL):
2741         * history/PageCache.cpp:
2742         (WebCore::PageCache::shared):
2743         (WebCore::PageCache::get):
2744         (WebCore::pageCache): Deleted.
2745         * history/PageCache.h:
2746         * loader/FrameLoader.cpp:
2747         (WebCore::FrameLoader::commitProvisionalLoad):
2748         (WebCore::FrameLoader::loadDifferentDocumentItem):
2749         * loader/HistoryController.cpp:
2750         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
2751         (WebCore::HistoryController::updateForReload):
2752         * page/Frame.cpp:
2753         (WebCore::Frame::setPageAndTextZoomFactors):
2754         * page/Page.cpp:
2755         (WebCore::Page::setDeviceScaleFactor):
2756         (WebCore::Page::setPagination):
2757         (WebCore::Page::setVisitedLinkStore):
2758         * page/PageGroup.cpp:
2759         (WebCore::PageGroup::captionPreferencesChanged):
2760         * page/Settings.cpp:
2761         (WebCore::Settings::setUsesPageCache):
2762         * platform/MemoryPressureHandler.cpp:
2763         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2764
2765 2015-01-28  Darin Adler  <darin@apple.com>
2766
2767         Fix MediaPlayerEngine leaks
2768         https://bugs.webkit.org/show_bug.cgi?id=140992
2769
2770         Reviewed by Jer Noble.
2771
2772         * platform/graphics/MediaPlayer.cpp:
2773         (WebCore::mutableInstalledMediaEnginesVector): Added.
2774         (WebCore::buildMediaEnginesVector): Added.
2775         (WebCore::installedMediaEngines): Changed this to be a vector of factories
2776         instead of a vector of heap-allocated factories. The old code would leak
2777         all the factories when this was called with the ResetEngines option.
2778         (WebCore::addMediaEngine): Updated for above change.
2779         (WebCore::bestMediaEngineForSupportParameters): Ditto.
2780         (WebCore::nextMediaEngine): Ditto.
2781         (WebCore::MediaPlayer::nextBestMediaEngine): Ditto.
2782         (WebCore::MediaPlayer::loadWithNextMediaEngine): Ditto.
2783         (WebCore::MediaPlayer::supportsType): Ditto.
2784         (WebCore::MediaPlayer::getSupportedTypes): Ditto.
2785         (WebCore::MediaPlayer::getSitesInMediaCache): Ditto.
2786         (WebCore::MediaPlayer::clearMediaCache): Ditto.
2787         (WebCore::MediaPlayer::clearMediaCacheForSite): Ditto.
2788         (WebCore::MediaPlayer::supportsKeySystem): Ditto.
2789         (WebCore::MediaPlayer::resetMediaEngines): Ditto.
2790         * platform/graphics/MediaPlayer.h: Ditto.
2791
2792 2015-01-28  Jeongmin Kim  <jm86.kim@lge.com>
2793
2794         Rename descendentxxx to descendantxxxx in RenderLayerBacking
2795         https://bugs.webkit.org/show_bug.cgi?id=140979
2796
2797         Reviewed by Martin Robinson.
2798
2799         Rename descendentxxx to descendantxxxx in RenderLayerBacking
2800         for matching other variables and function names.
2801
2802         * rendering/RenderLayerBacking.cpp:
2803         (WebCore::RenderLayerBacking::updateConfiguration):
2804         (WebCore::RenderLayerBacking::updateAfterDescendants):
2805         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
2806         (WebCore::RenderLayerBacking::paintsChildren):
2807         (WebCore::descendantLayerPaintsIntoAncestor):
2808         (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
2809         (WebCore::descendentLayerPaintsIntoAncestor): Deleted.
2810         (WebCore::RenderLayerBacking::isPaintDestinationForDescendentLayers): Deleted.
2811
2812 2015-01-27  Chris Dumez  <cdumez@apple.com>
2813
2814         Use a Ref<CachedResourceLoader> in Document instead of a RefPtr
2815         https://bugs.webkit.org/show_bug.cgi?id=140971
2816
2817         Reviewed by Andreas Kling.
2818
2819         Use a Ref<CachedResourceLoader> in Document instead of a RefPtr as it
2820         can never be null. Also have Document::cachedResourceLoader() return a
2821         reference instead of a pointer. This gets rid of a lot of unnecessary
2822         null-checks.
2823
2824 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
2825
2826         More build fixes for newer clang.
2827
2828         Rubber-stamped by Anders Carlsson.
2829
2830         * loader/icon/IconDatabase.h: Added missing override keywords.
2831
2832 2015-01-27  Roger Fong  <roger_fong@apple.com>
2833
2834         WebGL2: Disable various extensions on WebGL2 context that have been promoted to core.
2835         https://bugs.webkit.org/show_bug.cgi?id=140907.
2836         <rdar://problem/19545857>
2837
2838         Reviewed by Brent Fulgham.
2839
2840         * html/canvas/WebGL2RenderingContext.cpp:
2841         (WebCore::WebGL2RenderingContext::getExtension):
2842         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
2843         * html/canvas/WebGL2RenderingContext.h:
2844         * html/canvas/WebGLRenderingContext.cpp:
2845         (WebCore::WebGLRenderingContext::getExtension):
2846         (WebCore::WebGLRenderingContext::getSupportedExtensions):
2847         * html/canvas/WebGLRenderingContext.h:
2848         * html/canvas/WebGLRenderingContextBase.cpp:
2849         (WebCore::WebGLRenderingContextBase::getSupportedExtensions): Deleted.
2850         * html/canvas/WebGLRenderingContextBase.h:
2851         * html/canvas/WebGLRenderingContextBase.idl: 
2852         Remove some extra extension enums that shouldn't have been declared on the context idl.
2853
2854 2015-01-27  Chris Dumez  <cdumez@apple.com>
2855
2856         Remove unnecessary m_cachedPage null-checks in PageCache
2857         https://bugs.webkit.org/show_bug.cgi?id=140965
2858
2859         Reviewed by Andreas Kling.
2860
2861         Remove unnecessary m_cachedPage null-checks in PageCache. We initialize
2862         m_cachedPage when inserting the HistoryItem in the page cache and clear
2863         it when removing it from the page cache. Therefore, it is guaranteed
2864         that HistoryItems currently in the page cache have m_cachedPage
2865         initialized and there is no need to null-check it.
2866
2867         * history/PageCache.cpp:
2868         (WebCore::PageCache::frameCount):
2869         (WebCore::PageCache::markPagesForVistedLinkStyleRecalc):
2870         (WebCore::PageCache::markPagesForFullStyleRecalc):
2871         (WebCore::PageCache::markPagesForDeviceScaleChanged):
2872         (WebCore::PageCache::markPagesForCaptionPreferencesChanged):
2873
2874 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
2875
2876         Some NSAccessibility methods we use are deprecated on 10.10
2877         https://bugs.webkit.org/show_bug.cgi?id=140966
2878
2879         Reviewed by Anders Carlsson.
2880
2881         * accessibility/mac/AccessibilityObjectMac.mm:
2882         (WebCore::AccessibilityObject::overrideAttachmentParent):
2883         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
2884         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2885         (-[WebAccessibilityObjectWrapper role]):
2886         (-[WebAccessibilityObjectWrapper roleDescription]):
2887         Silence the warnings for now.
2888
2889 2015-01-27  Chris Dumez  <cdumez@apple.com>
2890
2891         Rename isExpandedShorthand() to isShorthandCSSProperty() for clarity
2892         https://bugs.webkit.org/show_bug.cgi?id=140954
2893
2894         Reviewed by Andreas Kling.
2895
2896         Rename isExpandedShorthand() to isShorthandCSSProperty() for clarity as
2897         all CSS shorthand properties are now expanded during parsing (even
2898         'font').
2899
2900         * css/StylePropertyShorthand.cpp:
2901         (WebCore::isShorthandCSSProperty):
2902         (WebCore::isExpandedShorthand): Deleted.
2903         * css/StylePropertyShorthand.h:
2904         * css/StyleResolver.cpp:
2905         (WebCore::StyleResolver::applyProperty):
2906         * css/makeprop.pl:
2907
2908 2015-01-27  Eric Carlson  <eric.carlson@apple.com>
2909
2910         Simplify http/tests/media/video-play-stall.html
2911         https://bugs.webkit.org/show_bug.cgi?id=140630
2912
2913         Reviewed by Brent Fulgham.
2914
2915         Test: http/tests/media/video-play-waiting.html
2916
2917         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2918         (WebCore::MediaPlayerPrivateAVFoundation::play): Add more logging.
2919         (WebCore::MediaPlayerPrivateAVFoundation::updateStates): MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty
2920             always maps to HaveCurrentData.
2921         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): Don't log FunctionType,
2922             doing so it needlessly verbose.
2923         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Ditto.
2924         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2925         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Log KVO property 
2926             values and notification state.
2927
2928 2015-01-27  Commit Queue  <commit-queue@webkit.org>
2929
2930         Unreviewed, rolling out r179192.
2931         https://bugs.webkit.org/show_bug.cgi?id=140953
2932
2933         Caused numerous layout test failures (Requested by mattbaker_
2934         on #webkit).
2935
2936         Reverted changeset:
2937
2938         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
2939         pages"
2940         https://bugs.webkit.org/show_bug.cgi?id=140900
2941         http://trac.webkit.org/changeset/179192
2942
2943 2015-01-27  Benjamin Poulain  <bpoulain@apple.com>
2944
2945         Modernize some constructors of the CSS JIT
2946         https://bugs.webkit.org/show_bug.cgi?id=140903
2947
2948         Reviewed by Darin Adler.
2949
2950         Two constructors were still using the old style.
2951
2952         * cssjit/SelectorCompiler.cpp:
2953         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment): Deleted.
2954         (WebCore::SelectorCompiler::TagNamePattern::TagNamePattern): Deleted.
2955
2956 2015-01-27  Brent Fulgham  <bfulgham@apple.com>
2957
2958         [Win] Unreviewed build fix.
2959
2960         Lack of include guards in WebVTTElement.h caused a build failure once we started including
2961         this header file from more than one implementation file.
2962
2963         * html/track/WebVTTElement.h:
2964
2965 2015-01-26  Sylvain Galineau  <galineau@adobe.com>
2966
2967         CSSKeyframesRule::findRule() and deleteRule() should delete the last matching rule, not the first
2968         https://bugs.webkit.org/show_bug.cgi?id=139732
2969
2970         Reviewed by Dean Jackson and Darin Adler.
2971
2972         No new tests because existing tests have been updated to verify this behavior.
2973
2974         * css/CSSKeyframeRule.h:
2975         (WebCore::StyleKeyframe::getKeys): Deleted.
2976         * css/StyleResolver.cpp:
2977         (WebCore::StyleResolver::keyframeStylesForAnimation): use StyleKeyframe::keys().
2978         * css/CSSKeyframeRule.cpp:
2979         (WebCore::StyleKeyframe::parseKeyString): Deleted. Moved to CSSParser.
2980         (WebCore::StyleKeyframe::keyText): Build keyframe selector from Vector<double> representation.
2981         * css/CSSKeyframeRule.h:
2982         (WebCore::StyleKeyframe::setKeyText): parse keyframe selector into Vector<double>.
2983         (WebCore::StyleKeyframe::keys): Added. Returns vector representation of selector keys.
2984         (WebCore::StyleKeyframe::getKeys): Deleted. Now keys().
2985         * css/CSSKeyframesRule.cpp:
2986         (WebCore::StyleRuleKeyframes::findKeyframeIndex): Return last matching rule.
2987         * css/CSSParser.cpp:
2988         (WebCore::CSSParser::parseKeyframeSelector): Added. Moved from StyleKeyframe.
2989         * css/CSSParser.h:
2990         (WebCore::CSSParser::parseKeyframeSelector): Added. Moved from StyleKeyframe.
2991
2992 2015-01-26  Geoffrey Garen  <ggaren@apple.com>
2993
2994         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
2995         https://bugs.webkit.org/show_bug.cgi?id=140900
2996
2997         Reviewed by Mark Hahnenberg.
2998
2999         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3000         (WebCore::MemoryPressureHandler::install): Be sure to release other
3001         memory after GC and not before, since GC might contribute to free
3002         malloc pages now.
3003
3004 2015-01-27  Zalan Bujtas  <zalan@apple.com>
3005
3006         Simple line layout: Make FlowContents an iterator class.
3007         https://bugs.webkit.org/show_bug.cgi?id=140909
3008
3009         Reviewed by Antti Koivisto.
3010
3011         This patch transfers content position handling from createLineRuns()/LineState to
3012         FlowContents. FlowContents becomes a real iterator class.
3013         It tightens content and position information so that we can start supporting
3014         no textual content such as <br>.
3015
3016         No change in functionality.
3017
3018         * rendering/SimpleLineLayout.cpp:
3019         (WebCore::SimpleLineLayout::LineState::commitAndCreateRun): Remove redundant committedLogicalRight.
3020         (WebCore::SimpleLineLayout::LineState::addUncommitted): Now that we don't have current
3021         positon in LineState, we need to be able to figure out where we start the uncommitted content.
3022         This is mainly relevant after collapsed whitespace, when we start a new uncommitted segment.
3023         It was previously achieved through LineState::jumpTo().
3024         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3025         (WebCore::SimpleLineLayout::firstFragment): Return the first fragment for this line.
3026         (WebCore::SimpleLineLayout::createLineRuns): Renaming and removing position handling.
3027         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns): Renaming.
3028         (WebCore::SimpleLineLayout::createTextRuns):
3029         (WebCore::SimpleLineLayout::LineState::jumpTo): Deleted.
3030         (WebCore::SimpleLineLayout::initializeNewLine): Deleted. : Move overflow fragment functionality
3031         to firstFragment().
3032         * rendering/SimpleLineLayoutFlowContents.cpp:
3033         (WebCore::SimpleLineLayout::FlowContents::nextTextFragment):
3034         * rendering/SimpleLineLayoutFlowContents.h:
3035
3036 2015-01-27  Chris Dumez  <cdumez@apple.com>
3037
3038         HTMLElement.dir should only return known values
3039         https://bugs.webkit.org/show_bug.cgi?id=140925
3040
3041         Reviewed by Darin Adler.
3042
3043         HTMLElement.dir should only return known values according to the HTML
3044         specification:
3045         https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir
3046
3047         Chrome and Firefox 28 match the specification. IE11's behavior is
3048         slightly different:
3049         - When setting an unknown 'dir' value, an exception will be thrown.
3050         - Setting a known 'dir' value in a non-canonical case (e.g. "RTL"),
3051           the value will be directly converted to its canonical form (e.g.
3052           "rtl") before updating the DOM tree. (close to the spec but changing
3053           the case upon setting).
3054
3055         This patch is based on the following Blink revision by me:
3056         https://src.chromium.org/viewvc/blink?view=rev&revision=171861
3057
3058         Test: fast/dom/document-dir-property.html
3059
3060         * html/HTMLDocument.cpp:
3061         (WebCore::HTMLDocument::dir):
3062         (WebCore::HTMLDocument::setDir):
3063         * html/HTMLDocument.h:
3064         * html/HTMLElement.cpp:
3065         (WebCore::toValidDirValue):
3066         (WebCore::HTMLElement::dir):
3067         (WebCore::HTMLElement::setDir):
3068         * html/HTMLElement.h:
3069         * html/HTMLElement.idl:
3070
3071 2015-01-26  Chris Dumez  <cdumez@apple.com>
3072
3073         Introduce Document::body() for call sites interested in the <body> element
3074         https://bugs.webkit.org/show_bug.cgi?id=140920
3075
3076         Reviewed by Darin Adler.
3077
3078         Introduce Document::body() method for call sites interested only in the
3079         document's <body> element (not the <frameset>). Also clean up the call
3080         sites of Document::bodyOrFrameset() to cache the return value when
3081         suitable as this method does a tree traversal.
3082
3083         This patch does not change behavior, it merely ports calls sites that
3084         were calling Document::bodyOrFrameset() then checking if the tag was
3085         <body>, to call Document::body() instead. Doing so is more efficient
3086         and clearer.
3087
3088 2015-01-26  Brent Fulgham  <bfulgham@apple.com>
3089
3090         [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
3091         https://bugs.webkit.org/show_bug.cgi?id=87426
3092         <rdar://problem/11527899>
3093
3094         Reviewed by Darin Adler.
3095
3096         Revise COMPtr to work better with our HashMap implementation:
3097         (1) Add a specialization for IsSmartPtr.
3098         (2) Remove PtrHash specialization.
3099         (3) Refresh HashTrails specialization for COMPtr to match what we
3100         do for RefPtr.
3101
3102         * platform/win/COMPtr.h:
3103
3104 2015-01-26  Sylvain Galineau  <galineau@adobe.com>
3105
3106         The computed value of line-height:normal is incorrect
3107         https://bugs.webkit.org/show_bug.cgi?id=133744
3108
3109         Reviewed by Dean Jackson.
3110
3111         Use font's line spacing as computed line-height value when specified value is 'normal'.
3112         This behavior is compatible with all other engines.
3113
3114         No new tests; all existing tests are updated to reflect the new computed value.
3115
3116         * css/CSSComputedStyleDeclaration.cpp:
3117         (WebCore::lineHeightFromStyle): If line-height wasn't set, use the font's line spacing (same as Blink).
3118
3119 2015-01-26  Chris Dumez  <cdumez@apple.com>
3120
3121         Document.dir should reflect the 'dir' attribute of the root html element
3122         https://bugs.webkit.org/show_bug.cgi?id=140922
3123
3124         Reviewed by Darin Adler.
3125
3126         Document.dir should reflect the 'dir' content attribute of the root
3127         <html> element as per the specification:
3128         https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir
3129
3130         Previously, WebKit was reflecting the 'dir' content attribute of the
3131         body element. This patch aligns WebKit with the specification and the
3132         behavior of other browsers (tested Firefox 28, IE11 and Chrome).
3133
3134         This patch is based on the following Blink revision by me:
3135         https://src.chromium.org/viewvc/blink?revision=171734&view=revision
3136
3137         Test: fast/dom/document-dir-property.html
3138
3139         * html/HTMLDocument.cpp:
3140         (WebCore::HTMLDocument::dir):
3141         (WebCore::HTMLDocument::setDir):
3142         * html/HTMLDocument.h:
3143
3144 2015-01-26  Darin Adler  <darin@apple.com>
3145
3146         REGRESSION (r179101): SVGUseElement::expandUseElementsInShadowTree has an object lifetime mistake
3147         https://bugs.webkit.org/show_bug.cgi?id=140921
3148
3149         Reviewed by Alexey Proskuryakov.
3150
3151         Bug found by running regression tests with Address Sanitizer.
3152
3153         * svg/SVGUseElement.cpp:
3154         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Use a Ref to protect
3155         the original use element after it's been replaced in the tree; we use it for
3156         one more thing after that.
3157
3158 2015-01-26  Roger Fong  <roger_fong@apple.com>
3159
3160         WebGL 2.0: Actually allow for experimental-webgl2 context creation.
3161         https://bugs.webkit.org/show_bug.cgi?id=140906
3162         <rdar://problem/19606875>.
3163
3164         Reviewed by Brent Fulgham.
3165
3166         * html/HTMLCanvasElement.cpp:
3167         (WebCore::HTMLCanvasElement::is3dType): Include "experimental-webgl2" in the list of acceptable 3d context types.
3168
3169 2015-01-26  Chris Dumez  <cdumez@apple.com>
3170
3171         Rename Document::body() to Document::bodyOrFrameset() for clarity
3172         https://bugs.webkit.org/show_bug.cgi?id=140902
3173
3174         Reviewed by Andreas Kling.
3175
3176         Rename Document::body() to Document::bodyOrFrameset() for clarity. This
3177         method does not necessarily return an HTMLBodyElement, it can also
3178         return a frameset as per the specification:
3179         http://www.w3.org/TR/html5/dom.html#dom-tree-accessors
3180
3181         This method is often misused internally (the caller is only interested
3182         in the <body> element). I will fix these instances in a follow-up patch,
3183         this patch is only renaming mechanically.
3184
3185 2015-01-26  Byungseon Shin  <sun.shin@lge.com>
3186
3187         Fix Border-radius clipping issue on a composited descendants
3188         https://bugs.webkit.org/show_bug.cgi?id=138551 
3189
3190         Reviewed by Simon Fraser.
3191
3192         Fix assertion in RenderLayerBacking::paintIntoLayer
3193         by not checking out of sync with the GraphicsLayer heirarchy
3194         in GraphicsLayerPaintChildClippingMask phase.
3195
3196         Test: compositing/clipping/border-radius-overflow-hidden-stacking-context.html
3197
3198         * rendering/RenderLayerBacking.cpp:
3199         (WebCore::RenderLayerBacking::paintIntoLayer):
3200
3201 2015-01-26  Chris Dumez  <cdumez@apple.com>
3202
3203         Simplify RenderElement's shouldRepaintForImageAnimation()
3204         https://bugs.webkit.org/show_bug.cgi?id=140890
3205
3206         Reviewed by Darin Adler.
3207
3208         Simplify RenderElement's shouldRepaintForImageAnimation() by
3209         not calling rendererForRootBackground(). The previous code was
3210         doing a null-check on Document::documentElement() but failing
3211         to do a null-check on the renderer just after, which lead me
3212         to refactor this code.
3213
3214         Instead of calling document().documentElement.renderer(), we
3215         now call renderer.parent(). This is equivalent because we already
3216         know that renderer.isBody() returns true. The parent of the <body>
3217         has to be the <html> element, which has to be the documentElement.
3218         There is also no need to do a null-check on renderer.parent(). We
3219         already know that the <body> has a renderer (because |renderer| is
3220         its renderer), thus its parent <html> element has to have a renderer
3221         as well.
3222
3223         Finally, simply call !rootElement.hasBackground() instead of
3224         rootElement.rendererForRootBackground() == &bodyRenderer to determine
3225         if the background painted by the root. This is equivalent but more
3226         efficient because:
3227         - We already know that the root renderer's is an <html> element. We
3228           can thus avoid the check in rendererForRootBackground().
3229         - We already have the <body>'s renderer so we don't need to do the
3230           DOM tree traversal in rendererForRootBackground() to get it.
3231
3232         No new tests, already covered by:
3233         fast/images/animated-gif-body-delegated-background-image.html
3234         fast/images/animated-gif-html-background-image.html
3235
3236         * rendering/RenderElement.cpp:
3237         (WebCore::shouldRepaintForImageAnimation):
3238
3239 2015-01-26  Chris Dumez  <cdumez@apple.com>
3240
3241         First argument to DOM traversal functions should be a reference
3242         https://bugs.webkit.org/show_bug.cgi?id=140895
3243
3244         Reviewed by Antti Koivisto.
3245
3246         First argument to DOM traversal functions should be a reference instead
3247         of a pointer as it is dereferenced without null-check.
3248
3249 2015-01-26  Roger Fong  <roger_fong@apple.com>
3250
3251         [WebGL2] Update IDL for WebGL2.
3252         https://bugs.webkit.org/show_bug.cgi?id=126406
3253         <rdar://problem/15002268>.
3254
3255         Reviewed by Brent Fulgham.
3256
3257         Update WebGL2RenderingContext idl to match spec. Create method stubs as necessary.
3258
3259         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
3260         (WebCore::JSWebGL2RenderingContext::getFramebufferAttachmentParameter):
3261         (WebCore::JSWebGL2RenderingContext::getInternalformatParameter):
3262         (WebCore::JSWebGL2RenderingContext::getQueryParameter):
3263         (WebCore::JSWebGL2RenderingContext::getSamplerParameter):
3264         (WebCore::JSWebGL2RenderingContext::getSyncParameter):
3265         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
3266         (WebCore::JSWebGL2RenderingContext::getActiveUniformBlockParameter):
3267         (WebCore::JSWebGL2RenderingContext::getActiveUniformBlockName):
3268         * html/canvas/WebGL2RenderingContext.cpp:
3269         (WebCore::WebGL2RenderingContext::copyBufferSubData):
3270         (WebCore::WebGL2RenderingContext::getBufferSubData):
3271         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
3272         (WebCore::WebGL2RenderingContext::blitFramebuffer):
3273         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
3274         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
3275         (WebCore::WebGL2RenderingContext::invalidateFramebuffer):
3276         (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer):
3277         (WebCore::WebGL2RenderingContext::readBuffer):
3278         (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
3279         (WebCore::WebGL2RenderingContext::texStorage2D):
3280         (WebCore::WebGL2RenderingContext::texStorage3D):
3281         (WebCore::WebGL2RenderingContext::texImage3D):
3282         (WebCore::WebGL2RenderingContext::texSubImage3D):
3283         (WebCore::WebGL2RenderingContext::copyTexSubImage3D):
3284         (WebCore::WebGL2RenderingContext::compressedTexImage3D):
3285         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
3286         (WebCore::WebGL2RenderingContext::getFragDataLocation):
3287         (WebCore::WebGL2RenderingContext::uniform1ui):
3288         (WebCore::WebGL2RenderingContext::uniform2ui):
3289         (WebCore::WebGL2RenderingContext::uniform3ui):
3290         (WebCore::WebGL2RenderingContext::uniform4ui):
3291         (WebCore::WebGL2RenderingContext::uniform1uiv):
3292         (WebCore::WebGL2RenderingContext::uniform2uiv):
3293         (WebCore::WebGL2RenderingContext::uniform3uiv):
3294         (WebCore::WebGL2RenderingContext::uniform4uiv):
3295         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
3296         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
3297         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
3298         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
3299         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
3300         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
3301         (WebCore::WebGL2RenderingContext::vertexAttribI4i):
3302         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
3303         (WebCore::WebGL2RenderingContext::vertexAttribI4ui):
3304         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
3305         (WebCore::WebGL2RenderingContext::vertexAttribIPointer):
3306         (WebCore::WebGL2RenderingContext::vertexAttribDivisor):
3307         (WebCore::WebGL2RenderingContext::drawArraysInstanced):
3308         (WebCore::WebGL2RenderingContext::drawElementsInstanced):
3309         (WebCore::WebGL2RenderingContext::drawRangeElements):
3310         (WebCore::WebGL2RenderingContext::drawBuffers):
3311         (WebCore::WebGL2RenderingContext::clearBufferiv):
3312         (WebCore::WebGL2RenderingContext::clearBufferuiv):
3313         (WebCore::WebGL2RenderingContext::clearBufferfv):
3314         (WebCore::WebGL2RenderingContext::clearBufferfi):
3315         (WebCore::WebGL2RenderingContext::createQuery):
3316         (WebCore::WebGL2RenderingContext::deleteQuery):
3317         (WebCore::WebGL2RenderingContext::isQuery):
3318         (WebCore::WebGL2RenderingContext::beginQuery):
3319         (WebCore::WebGL2RenderingContext::endQuery):
3320         (WebCore::WebGL2RenderingContext::getQuery):
3321         (WebCore::WebGL2RenderingContext::getQueryParameter):
3322         (WebCore::WebGL2RenderingContext::createSampler):
3323         (WebCore::WebGL2RenderingContext::deleteSampler):
3324         (WebCore::WebGL2RenderingContext::isSampler):
3325         (WebCore::WebGL2RenderingContext::bindSampler):
3326         (WebCore::WebGL2RenderingContext::samplerParameteri):
3327         (WebCore::WebGL2RenderingContext::samplerParameterf):
3328         (WebCore::WebGL2RenderingContext::getSamplerParameter):
3329         (WebCore::WebGL2RenderingContext::fenceSync):
3330         (WebCore::WebGL2RenderingContext::isSync):
3331         (WebCore::WebGL2RenderingContext::deleteSync):
3332         (WebCore::WebGL2RenderingContext::clientWaitSync):
3333         (WebCore::WebGL2RenderingContext::waitSync):
3334         (WebCore::WebGL2RenderingContext::getSyncParameter):
3335         (WebCore::WebGL2RenderingContext::createTransformFeedback):
3336         (WebCore::WebGL2RenderingContext::deleteTransformFeedback):
3337         (WebCore::WebGL2RenderingContext::isTransformFeedback):
3338         (WebCore::WebGL2RenderingContext::bindTransformFeedback):
3339         (WebCore::WebGL2RenderingContext::beginTransformFeedback):
3340         (WebCore::WebGL2RenderingContext::endTransformFeedback):
3341         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
3342         (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
3343         (WebCore::WebGL2RenderingContext::pauseTransformFeedback):
3344         (WebCore::WebGL2RenderingContext::resumeTransformFeedback):
3345         (WebCore::WebGL2RenderingContext::bindBufferBase):
3346         (WebCore::WebGL2RenderingContext::bindBufferRange):
3347         (WebCore::WebGL2RenderingContext::getIndexedParameter):
3348         (WebCore::WebGL2RenderingContext::getUniformIndices):
3349         (WebCore::WebGL2RenderingContext::getActiveUniforms):
3350         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
3351         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
3352         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
3353         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
3354         (WebCore::WebGL2RenderingContext::createVertexArray):
3355         (WebCore::WebGL2RenderingContext::deleteVertexArray):
3356         (WebCore::WebGL2RenderingContext::isVertexArray):
3357         (WebCore::WebGL2RenderingContext::bindVertexArray):
3358         * html/canvas/WebGL2RenderingContext.h:
3359         * html/canvas/WebGL2RenderingContext.idl:
3360         * platform/graphics/GraphicsTypes3D.h:
3361
3362 2015-01-26  Andreas Kling  <akling@apple.com>
3363
3364         Don't let the CSSValuePool's font family cache grow unbounded.
3365         <https://webkit.org/b/140894>
3366
3367         Reviewed by Chris Dumez.
3368
3369         Darin pointed out to Chris who pointed out to me that the font family cache
3370         in CSSValuePool can grow unbounded until we get a system memory pressure
3371         notification. Put a limit on it like we did with the font face cache.
3372
3373         * css/CSSValuePool.cpp:
3374         (WebCore::CSSValuePool::createFontFamilyValue):
3375
3376 2015-01-26  Andreas Kling  <akling@apple.com>
3377
3378         Plug leak in jsValueWithDictionaryInContext().
3379         <https://webkit.org/b/140889>
3380
3381         Reviewed by Alexey Proskuryakov.
3382
3383         Add a missing JSStringRelease to plug leak that was showing up on leaks bot.
3384
3385         * platform/mac/SerializedPlatformRepresentationMac.mm:
3386         (WebCore::jsValueWithDictionaryInContext):
3387
3388 2015-01-26  Benjamin Poulain  <benjamin@webkit.org>
3389
3390         Fix CSS Selector's tag name matching when mixing HTML and XML
3391         https://bugs.webkit.org/show_bug.cgi?id=140878
3392
3393         Reviewed by Darin Adler.
3394
3395         Previsouly, WebKit was unable to match any XML element that had
3396         any uppercase character if the stylesheet was in a HTML document.
3397         This problem was most often reported due to the inability to style
3398         SVG-in-HTML.
3399
3400         The reason was that the tag local name was incorrectly transformed
3401         to lowercase at parsing time. Instead, we are supposed to only
3402         do case-insensitive match for HTML elements in a HTML document.
3403
3404         This fix is very similar with how we handle attributes:
3405         -Keep both the original and the lowercase versions of the name.
3406         -When matching, chose which version to use depending on the element being matched.
3407
3408         There is one major difference in the way the names are stored.
3409         Unlike attribute selectors, tag name selectors are common, and the uppercase
3410         version is not that uncommon. I wanted to preserve the dense representation
3411         so I specialized CSSSelector specifically for tag names.
3412
3413         To store the data, if the name is already lowercase, just use the m_data pointer
3414         as usual.
3415         If the name is not lowercase, allocate a new small structure in the union to store