b56678c4fa0cdc1f31b59b2a850473532427c7d3
[WebKit.git] / Source / WebCore / ChangeLog
1 2015-01-30  Sam Weinig  <sam@webkit.org>
2
3         Merge SimpleFontDataIOS.mm and SimpleFontDataMac.mm into FontCocoa.mm
4         https://bugs.webkit.org/show_bug.cgi?id=141101
5
6         Rubber-stamped by Dan Bernstein.
7
8         * WebCore.xcodeproj/project.pbxproj:
9         Remove SimpleFontDataIOS.mm and SimpleFontDataMac.mm. Add FontCocoa.mm.
10
11         * platform/graphics/Font.h:
12         Remove a few CG only functions from the header that can be implemented as static functions
13         in the implementation file.
14
15         * platform/graphics/cocoa/FontCocoa.mm: Copied from Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm.
16         (WebCore::fontFamilyShouldNotBeUsedForArabic):
17         (WebCore::Font::platformInit):
18         (WebCore::Font::platformCharWidthInit):
19         (WebCore::Font::platformCreateScaledFont):
20         (WebCore::Font::determinePitch):
21         (WebCore::renderingStyle):
22         (WebCore::advanceForColorBitmapFont):
23         (WebCore::hasCustomTracking):
24         (WebCore::canUseFastGlyphAdvanceGetter):
25         (WebCore::Font::platformWidthForGlyph):
26         (WebCore::Font::compositeFontReferenceFont):
27         (WebCore::copyFontTableForTag): Deleted.
28         (WebCore::Font::renderingStyle): Deleted.
29         Merge in the iOS specific parts.
30
31         * platform/graphics/ios/SimpleFontDataIOS.mm: Removed.
32         * platform/graphics/mac/SimpleFontDataMac.mm: Removed.
33
34 2015-01-31  Zalan Bujtas  <zalan@apple.com>
35
36         Regression(r179438) Simple line layout: ASSERTION at SimpleLineLayout::FlowContentsIterator::runWidth().
37         https://bugs.webkit.org/show_bug.cgi?id=141121
38
39         Reviewed by Antti Koivisto.
40
41         When a breakable text fragment does not fit the current line, we split it.
42         The first part stays on the current line, while the second part gets pushed to the next line.
43         In certain cases, the first part could end up being empty.
44         This patch ensures that we don't measure empty fragments.
45
46         Covered by existing tests.
47
48         * rendering/SimpleLineLayout.cpp:
49         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
50
51 2015-01-31  Commit Queue  <commit-queue@webkit.org>
52
53         Unreviewed, rolling out r179426.
54         https://bugs.webkit.org/show_bug.cgi?id=141119
55
56         "caused a memory use regression" (Requested by Guest45 on
57         #webkit).
58
59         Reverted changeset:
60
61         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
62         pages"
63         https://bugs.webkit.org/show_bug.cgi?id=140900
64         http://trac.webkit.org/changeset/179426
65
66 2015-01-30  Zalan Bujtas  <zalan@apple.com>
67
68         Simple line layout: Improve FlowContentsIterator::TextFragment's encapsulation.
69         https://bugs.webkit.org/show_bug.cgi?id=141090
70
71         Reviewed by Andreas Kling.
72
73         Make members private to avoid accidental change in TextFragment.
74
75         No change in functionality.
76
77         * rendering/SimpleLineLayout.cpp:
78         (WebCore::SimpleLineLayout::LineState::addFragment):
79         (WebCore::SimpleLineLayout::LineState::addWhitespace):
80         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
81         (WebCore::SimpleLineLayout::firstFragment):
82         (WebCore::SimpleLineLayout::createLineRuns):
83         * rendering/SimpleLineLayoutFlowContentsIterator.cpp:
84         (WebCore::SimpleLineLayout::FlowContentsIterator::nextTextFragment):
85         * rendering/SimpleLineLayoutFlowContentsIterator.h:
86         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::TextFragment):
87         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::start):
88         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::end):
89         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::width):
90         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::type):
91         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isCollapsed):
92         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isBreakable):
93         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isEmpty):
94
95 2015-01-30  Zalan Bujtas  <zalan@apple.com>
96
97         Simple line layout: Make LineState fragment handling simpler.
98         https://bugs.webkit.org/show_bug.cgi?id=141100
99
100         Reviewed by Andreas Kling.
101
102         New fragments are appeneded to the Run's last entry
103         instead of accumulating them until after a new run is required. 
104         (whitespace collapse or line end)
105         LineState::appendFragment manages whitespace collapsing now.
106         This makes createLineRuns() logic lighter and no need to "flush"
107         the LineState when the line ends.
108
109         No change in functionality.
110
111         * rendering/SimpleLineLayout.cpp: Make LineState members private and introduce getters.
112         (WebCore::SimpleLineLayout::LineState::setAvailableWidth):
113         (WebCore::SimpleLineLayout::LineState::setLogicalLeftOffset):
114         (WebCore::SimpleLineLayout::LineState::setOverflowedFragment):
115         (WebCore::SimpleLineLayout::LineState::availableWidth):
116         (WebCore::SimpleLineLayout::LineState::logicalLeftOffset):
117         (WebCore::SimpleLineLayout::LineState::overflowedFragment):
118         (WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace):
119         (WebCore::SimpleLineLayout::LineState::isWhitespaceOnly):
120         (WebCore::SimpleLineLayout::LineState::fits):
121         (WebCore::SimpleLineLayout::LineState::firstCharacterFits):
122         (WebCore::SimpleLineLayout::LineState::width):
123         (WebCore::SimpleLineLayout::LineState::appendFragment): Append each fragment to the Run 
124         by either creating a new run or expanding the last one.
125         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace): Remove trailing whitespace from
126         the Run's and reset the trailing whitespace variables.
127         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
128         (WebCore::SimpleLineLayout::updateLineConstrains):
129         (WebCore::SimpleLineLayout::firstFragment):
130         (WebCore::SimpleLineLayout::createLineRuns):
131         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
132         (WebCore::SimpleLineLayout::createTextRuns):
133         (WebCore::SimpleLineLayout::LineState::createRun): Deleted.
134         (WebCore::SimpleLineLayout::LineState::addFragment): Deleted.
135         (WebCore::SimpleLineLayout::LineState::addWhitespace): Deleted.
136         (WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly): Deleted.
137
138 2015-01-30  Chris Dumez  <cdumez@apple.com>
139
140         Drop HistoryItem's m_prev / m_next
141         https://bugs.webkit.org/show_bug.cgi?id=141105
142
143         Reviewed by Zalan Bujtas.
144
145         Drop HistoryItem's m_prev / m_next. Those are no longer needed after
146         the PageCache refactoring in <http://trac.webkit.org/r179347>.
147
148         * history/HistoryItem.cpp:
149         (WebCore::HistoryItem::HistoryItem):
150         * history/HistoryItem.h:
151
152 2015-01-30  Jeongmin Kim  <jm86.kim@lge.com>
153
154         Update the comment in RenderLayer for clarity as related code location is changed
155         https://bugs.webkit.org/show_bug.cgi?id=141103
156
157         Reviewed by Simon Fraser.
158
159         Update the comment in RenderLayer for clarity as related code location is changed
160         The repainting in implicitClose() that is now called in setVisualUpdatesAllowed(bool) is removed
161
162         * rendering/RenderLayer.cpp:
163         (WebCore::shouldSuppressPaintingLayer):
164         * rendering/RenderLayerCompositor.cpp:
165         (WebCore::RenderLayerCompositor::updateCompositingLayers):
166
167 2015-01-30  Chris Dumez  <cdumez@apple.com>
168
169         Optimize MemoryCache::getSessionMap() a bit
170         https://bugs.webkit.org/show_bug.cgi?id=141069
171
172         Reviewed by Anders Carlsson.
173
174         Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
175         instead of previously 3. Also rename the method to
176         ensureSessionResourceMap() as we usually don't use "get" prefix for
177         getters and the implementation will also create the HashMap value if
178         the key is not found.
179
180         Also add a alternative sessionResourceMap() method which returns
181         the HashMap value if the key exists but doesn't try to create it if
182         missing. This is actually what we really want for some call sites.
183
184         * loader/cache/MemoryCache.cpp:
185         (WebCore::MemoryCache::add):
186         (WebCore::MemoryCache::revalidationSucceeded):
187         (WebCore::MemoryCache::resourceForRequest):
188         (WebCore::MemoryCache::removeImageFromCache):
189         (WebCore::MemoryCache::remove):
190         (WebCore::MemoryCache::getSessionMap): Deleted.
191         * loader/cache/MemoryCache.h:
192
193 2015-01-30  Chris Dumez  <cdumez@apple.com>
194
195         Unreviewed. Remove outdated comment.
196
197         * loader/cache/MemoryCache.cpp:
198
199 2015-01-30  Eric Carlson  <eric.carlson@apple.com>
200
201         Remove MediaPlayerProxy.h
202         https://bugs.webkit.org/show_bug.cgi?id=141087
203
204         Reviewed by Sam Weinig.
205
206         * WebCore.xcodeproj/project.pbxproj: Remove reference to MediaPlayerProxy.h.
207         * platform/graphics/mac/MediaPlayerProxy.h: Removed.
208
209 2015-01-30  Geoffrey Garen  <ggaren@apple.com>
210
211         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
212         https://bugs.webkit.org/show_bug.cgi?id=140900
213
214         Reviewed by Mark Hahnenberg.
215
216         Re-landing just the HandleBlock piece of this patch.
217
218         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
219         (WebCore::MemoryPressureHandler::install):
220
221 2015-01-30  Chris Dumez  <cdumez@apple.com>
222
223         Update MemoryCache code to use more references instead of pointers
224         https://bugs.webkit.org/show_bug.cgi?id=141099
225
226         Reviewed by Andreas Kling.
227
228 2015-01-30  Brian J. Burg  <burg@cs.washington.edu>
229
230         Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
231         https://bugs.webkit.org/show_bug.cgi?id=141039
232
233         Reviewed by Timothy Hatcher.
234
235         Don't unconditionally stop the environment stopwatch, since it could have
236         already stopped due to the debugger pausing.
237
238         * inspector/InspectorTimelineAgent.cpp:
239         (WebCore::InspectorTimelineAgent::internalStop):
240
241 2015-01-30  Chris Dumez  <cdumez@apple.com>
242
243         When no background-size is specified on the 2nd background layer, it takes the first instead of the initial value
244         https://bugs.webkit.org/show_bug.cgi?id=141059
245
246         Reviewed by Antti Koivisto.
247
248         This patch fixes fill size support for 'initial' value.
249
250         Test: fast/css/background-layers-initial-size.html
251
252         * css/CSSToStyleMap.cpp:
253         - Add check for initial values and set fill size to initialFillSize()
254           in this case (which is 'auto'). Previously, we were handling all
255           non CSSPrimitiveValues the same way and setting the fill size type
256           to SizeNone, which means no size (not 'auto').
257         - Clean up the rest of the function (no behavior change).
258
259         * rendering/style/FillLayer.cpp:
260         (WebCore::FillLayer::FillLayer):
261         - Initialize m_sizeLength to SizeNone instead of calling
262           initialFillSizeType(). There is no behavior change here. However,
263           initialFillSizeType() was not supposed to return SizeNone.
264         - Stop explicitly initializing m_sizeLength to LengthSize() as this
265           is already what happens implicitly.
266
267         * rendering/style/FillLayer.h:
268         (WebCore::FillLayer::initialFillSize):
269         Return FillSize() instead of FillSize(SizeNone, LengthSize()).
270         FillSize() is equivalent to FillSize(SizeLength, LengthSize())
271         which is resolved to 'auto'. SizeNone means no size which isn't
272         what we want as an initial value.
273
274         (WebCore::FillLayer::initialFillSizeType): Deleted.
275         (WebCore::FillLayer::initialFillSizeLength): Deleted.
276         Remove Individual initialFillSizeType() / initialFillSizeLength()
277         functions now that all caller use initialFillSize() instead.
278
279 2015-01-30  Commit Queue  <commit-queue@webkit.org>
280
281         Unreviewed, rolling out r179403.
282         https://bugs.webkit.org/show_bug.cgi?id=141091
283
284         Broke fast/files/workers/worker-apply-blob-url-to-xhr.html
285         (Requested by ap_ on #webkit).
286
287         Reverted changeset:
288
289         "Optimize MemoryCache::getSessionMap() a bit"
290         https://bugs.webkit.org/show_bug.cgi?id=141069
291         http://trac.webkit.org/changeset/179403
292
293 2015-01-30  Chris Dumez  <cdumez@apple.com>
294
295         Rename shared() static member functions to singleton() for singleton classes.
296         https://bugs.webkit.org/show_bug.cgi?id=141088
297
298         Reviewed by Ryosuke Niwa and Benjamin Poulain.
299
300         Rename shared() static member functions to singleton() for singleton
301         classes as per the recent coding style change.
302
303 2015-01-30  Matthew Mirman  <mmirman@apple.com>
304
305         Added ClientRect as an interface that requires attributes 
306         on instance for compatibility.
307         https://bugs.webkit.org/show_bug.cgi?id=141063
308         <rdar://problem/18437653>
309
310         Reviewed by Oliver Hunt.
311
312         Added a new test to LayoutTests/js/resources/JSON-stringify.js
313
314         * bindings/scripts/CodeGeneratorJS.pm:
315         (InterfaceRequiresAttributesOnInstanceForCompatibility):
316
317 2015-01-30  Chris Dumez  <cdumez@apple.com>
318
319         Optimize MemoryCache::getSessionMap() a bit
320         https://bugs.webkit.org/show_bug.cgi?id=141069
321
322         Reviewed by Anders Carlsson.
323
324         Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
325         instead of previously 3. Also rename the method to sessionResources()
326         as we usually don't use "get" prefix for getters.
327
328         * loader/cache/MemoryCache.cpp:
329         (WebCore::MemoryCache::sessionResources):
330         (WebCore::MemoryCache::add):
331         (WebCore::MemoryCache::revalidationSucceeded):
332         (WebCore::MemoryCache::resourceForRequest):
333         (WebCore::MemoryCache::removeImageFromCache):
334         (WebCore::MemoryCache::remove):
335         (WebCore::MemoryCache::getSessionMap): Deleted.
336         * loader/cache/MemoryCache.h:
337
338 2015-01-30  Chris Dumez  <cdumez@apple.com>
339
340         Store MemoryCache's live decoded resources in a ListHashSet
341         https://bugs.webkit.org/show_bug.cgi?id=141051
342
343         Reviewed by Antti Koivisto.
344
345         Store MemoryCache's live decoded resources in a ListHashSet instead of
346         a linked list. The frequent operations are:
347         1. Add items to one end
348         2. Remove items from the other end or anywhere in the container by value
349
350         Using a ListHashSet instead of a manual linked list results in *much*
351         simpler / shorter code and is fast for all operations (faster than
352         linked list even for removing an given element from the container given
353         its value). The previous implementation required us to keep a lot of
354         pointers up-to-date, which was error prone.
355
356         This is a first step towards simplifying the MemoryCache implementation.
357
358         * loader/cache/CachedResource.cpp:
359         (WebCore::CachedResource::CachedResource):
360         (WebCore::CachedResource::setDecodedSize):
361         (WebCore::CachedResource::didAccessDecodedData):
362         * loader/cache/CachedResource.h:
363         (WebCore::CachedResource::inLiveDecodedResourcesList): Deleted.
364         * loader/cache/MemoryCache.cpp:
365         (WebCore::MemoryCache::pruneLiveResourcesToSize):
366         (WebCore::MemoryCache::removeFromLiveDecodedResourcesList):
367         (WebCore::MemoryCache::insertInLiveDecodedResourcesList):
368         * loader/cache/MemoryCache.h:
369         (WebCore::MemoryCache::inLiveDecodedResourcesList):
370
371 2015-01-30  Csaba Osztrogonác  <ossy@webkit.org>
372
373         [cairo] Fix #if guards in platform/graphics/cairo directory
374         https://bugs.webkit.org/show_bug.cgi?id=141076
375
376         Reviewed by Sergio Villar Senin.
377
378         * platform/graphics/cairo/BackingStoreBackendCairo.h:
379         * platform/graphics/cairo/BitmapImageCairo.cpp:
380         * platform/graphics/cairo/CairoUtilities.cpp:
381         * platform/graphics/cairo/CairoUtilities.h:
382         * platform/graphics/cairo/DrawErrorUnderline.h:
383         * platform/graphics/cairo/DrawingBufferCairo.cpp:
384         * platform/graphics/cairo/FloatRectCairo.cpp:
385         * platform/graphics/cairo/FontCairo.cpp:
386         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
387         * platform/graphics/cairo/FontCustomPlatformData.h:
388         * platform/graphics/cairo/GradientCairo.cpp:
389         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
390         * platform/graphics/cairo/GraphicsContextCairo.cpp:
391         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
392         * platform/graphics/cairo/ImageBufferCairo.cpp:
393         * platform/graphics/cairo/ImageBufferDataCairo.h:
394         * platform/graphics/cairo/ImageCairo.cpp:
395         * platform/graphics/cairo/IntRectCairo.cpp:
396         * platform/graphics/cairo/OwnPtrCairo.cpp:
397         * platform/graphics/cairo/OwnPtrCairo.h:
398         * platform/graphics/cairo/PathCairo.cpp:
399         * platform/graphics/cairo/PatternCairo.cpp:
400         * platform/graphics/cairo/PlatformContextCairo.cpp:
401         * platform/graphics/cairo/PlatformContextCairo.h:
402         * platform/graphics/cairo/PlatformPathCairo.cpp:
403         * platform/graphics/cairo/PlatformPathCairo.h:
404         * platform/graphics/cairo/RefPtrCairo.cpp:
405         * platform/graphics/cairo/RefPtrCairo.h:
406         * platform/graphics/cairo/TileCairo.h:
407         * platform/graphics/cairo/TransformationMatrixCairo.cpp:
408
409 2015-01-29  Darin Adler  <darin@apple.com>
410
411         Remove SVGUseElement.instanceRoot and all tests that depend on it
412         https://bugs.webkit.org/show_bug.cgi?id=141025
413
414         Reviewed by Anders Carlsson.
415
416         * svg/SVGUseElement.cpp:
417         (WebCore::SVGUseElement::instanceRoot): Deleted.
418         * svg/SVGUseElement.h: Removed instanceRoot.
419         * svg/SVGUseElement.idl: Ditto.
420
421 2015-01-29  Tim Horton  <timothy_horton@apple.com>
422
423         Fix the build with newer Clang.
424
425         * platform/graphics/ca/GraphicsLayerCA.h:
426
427 2015-01-29  Sam Weinig  <sam@webkit.org>
428
429         Try to fix the iOS build.
430
431         * WebCore.exp.in:
432
433 2015-01-29  Brent Fulgham  <bfulgham@apple.com>
434
435         [Win] Build fix after r179368.
436
437         * platform/graphics/win/UniscribeController.cpp:
438         (WebCore::UniscribeController::shapeAndPlaceItem): Don't use the no longer
439         valid isPrinterFont method.
440
441 2015-01-29  Tim Horton  <timothy_horton@apple.com>
442
443         Fix the build after r179368
444
445         * platform/graphics/FontDescription.h:
446         (WebCore::FontDescription::equalForTextAutoSizing):
447
448 2015-01-29  Simon Fraser  <simon.fraser@apple.com>
449
450         Border-radius clipping on a stacking context causes descendants to not render
451         https://bugs.webkit.org/show_bug.cgi?id=140536
452
453         Reviewed by Zalan Bujtas.
454         
455         Fix one of the issues introduced in r178029. The changes in GraphicsLayerCA
456         failed to adhere to the "set a bit and flush later" pattern that this class uses,
457         instead poking the platform layers directly. This caused an issue where the bounds
458         of the clipping layer would later be set to 0x0, causing content to disappear.
459         
460         Fix by changing the "applyClippingBorder" function to "setMasksToBoundsRect"
461         and have it update via a new MasksToBoundsRectChanged dirty bit.
462
463         In order to avoid clobbering the mask layer used to clip contents, we need another
464         shape mask layer, so rename m_shapeMaskLayer to m_contentsShapeMaskLayer, then
465         introduce a new m_shapeMaskLayer which is used for masks-to-bounds clipping. Update
466         the reflection cloning code to correctly clone this layer.
467
468         Test: compositing/clipping/border-radius-stacking-context-clip.html
469
470         * WebCore.exp.in:
471         * platform/graphics/GraphicsLayer.h:
472         (WebCore::GraphicsLayer::maskToBoundsRect):
473         (WebCore::GraphicsLayer::setMasksToBoundsRect):
474         (WebCore::GraphicsLayer::applyClippingBorder): Deleted.
475         (WebCore::GraphicsLayer::clearClippingBorder): Deleted.
476         * platform/graphics/ca/GraphicsLayerCA.cpp:
477         (WebCore::GraphicsLayerCA::willBeDestroyed):
478         (WebCore::GraphicsLayerCA::setMasksToBoundsRect):
479         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
480         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
481         (WebCore::GraphicsLayerCA::updateContentsImage):
482         (WebCore::GraphicsLayerCA::updateContentsRects):
483         (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
484         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
485         (WebCore::GraphicsLayerCA::applyClippingBorder): Deleted.
486         (WebCore::GraphicsLayerCA::clearClippingBorder): Deleted.
487         * platform/graphics/ca/GraphicsLayerCA.h:
488         * rendering/RenderLayerBacking.cpp:
489         (WebCore::RenderLayerBacking::updateChildClippingStrategy): Add a FIXME since
490         this code is trying to access geometry and we may not have done layout yet.
491         Also, to clear the rounded rect, just set a non-rounded rect the size of the layer.
492
493 2015-01-29  Sam Weinig  <sam@webkit.org>
494
495         Remove support for screen font substitution
496         https://bugs.webkit.org/show_bug.cgi?id=141038
497
498         Reviewed by Tim Horton.
499
500         - Removes the screen font substitution setting (which was only on in Mountain Lion)
501         - Remove the concept of a printer font, from the family of Font related classes.
502
503         * WebCore.exp.in:
504         * css/StyleResolver.cpp:
505         (WebCore::StyleResolver::initializeFontStyle):
506         * page/Settings.cpp:
507         (WebCore::Settings::Settings):
508         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Deleted.
509         (WebCore::Settings::setScreenFontSubstitutionEnabled): Deleted.
510         * page/Settings.h:
511         (WebCore::Settings::screenFontSubstitutionEnabled): Deleted.
512         * page/mac/SettingsMac.mm:
513         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault): Deleted.
514         * platform/graphics/FontCache.h:
515         (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey):
516         * platform/graphics/FontCascade.cpp:
517         (WebCore::FontCascade::FontCascade):
518         * platform/graphics/FontCascade.h:
519         (WebCore::FontCascade::isPrinterFont): Deleted.
520         * platform/graphics/FontDescription.h:
521         (WebCore::FontDescription::FontDescription):
522         (WebCore::FontDescription::setWeight):
523         (WebCore::FontDescription::equalForTextAutoSizing):
524         (WebCore::FontDescription::operator==):
525         (WebCore::FontDescription::usePrinterFont): Deleted.
526         (WebCore::FontDescription::setUsePrinterFont): Deleted.
527         * platform/graphics/FontPlatformData.h:
528         (WebCore::FontPlatformData::isCompositeFontReference):
529         (WebCore::FontPlatformData::hash):
530         (WebCore::FontPlatformData::operator==):
531         (WebCore::FontPlatformData::isPrinterFont): Deleted.
532         * platform/graphics/WidthIterator.h:
533         (WebCore::WidthIterator::supportsTypesettingFeatures):
534         * platform/graphics/cocoa/FontCascadeCocoa.mm:
535         (WebCore::FontCascade::drawGlyphs):
536         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
537         (WebCore::FontPlatformData::FontPlatformData):
538         (WebCore::FontPlatformData::platformDataInit):
539         (WebCore::FontPlatformData::platformDataAssign):
540         * platform/graphics/ios/FontCacheIOS.mm:
541         (WebCore::FontCache::getSystemFontFallbackForCharacters):
542         (WebCore::FontCache::createFontPlatformData):
543         * platform/graphics/ios/SimpleFontDataIOS.mm:
544         (WebCore::Font::platformCreateScaledFont):
545         * platform/graphics/mac/ComplexTextController.cpp:
546         (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
547         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
548         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
549         * platform/graphics/mac/FontCacheMac.mm:
550         (WebCore::FontCache::systemFallbackForCharacters):
551         (WebCore::FontCache::createFontPlatformData):
552         * platform/graphics/mac/SimpleFontDataMac.mm:
553         (WebCore::Font::compositeFontReferenceFont):
554         (WebCore::Font::platformCreateScaledFont):
555         * platform/mac/DragImageMac.mm:
556         (WebCore::fontFromNSFont):
557         (WebCore::widthWithFont):
558         (WebCore::drawAtPoint):
559         * style/StyleResolveForDocument.cpp:
560         (WebCore::Style::resolveForDocument):
561
562 2015-01-20  David Hyatt  <hyatt@apple.com>
563
564         Japanese line breaking rules need to be respected before and after Ruby.
565         https://bugs.webkit.org/show_bug.cgi?id=91588
566         <rdar://problem/17306535>
567
568         Reviewed by Dean Jackson.
569
570         Added fast/ruby/ruby-punctuation-avoid-breaking.html.
571
572         This patch has to add support for following line breaking rules at both
573         sides of a Ruby boundary. For breaking before a Ruby, unfortunately we
574         just hard-code the rules (and apply this hard-coding only to Ruby and not
575         to other inline replaced elements).
576
577         For breaking after a Ruby we do better. The Ruby run caches its prior characters
578         and line layout is able to obtain them and use them when deciding whether or not
579         to break. This means for the "after" side of a Ruby, we're able to behave the same
580         as if no Ruby was used.
581
582         * rendering/RenderBlockFlow.h:
583         (WebCore::RenderBlockFlow::cachePriorCharactersIfNeeded):
584         * rendering/RenderBlockLineLayout.cpp:
585         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
586         * rendering/RenderRubyBase.cpp:
587         (WebCore::RenderRubyBase::cachePriorCharactersIfNeeded):
588         * rendering/RenderRubyBase.h:
589         * rendering/RenderRubyRun.cpp:
590         (WebCore::RenderRubyRun::RenderRubyRun):
591         (WebCore::RenderRubyRun::updatePriorContextFromCachedBreakIterator):
592         (WebCore::RenderRubyRun::canBreakBefore):
593         * rendering/RenderRubyRun.h:
594         * rendering/RenderRubyText.cpp:
595         (WebCore::RenderRubyText::canBreakBefore):
596         * rendering/RenderRubyText.h:
597         * rendering/line/BreakingContextInlineHeaders.h:
598         (WebCore::BreakingContext::handleReplaced):
599         (WebCore::BreakingContext::canBreakAtThisPosition):
600         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
601
602 2015-01-28  Beth Dakin  <bdakin@apple.com>
603
604         Remove more Mountain Lion code from WebCore
605         https://bugs.webkit.org/show_bug.cgi?id=141014
606
607         Reviewed by Anders Carlsson.
608
609         * WebCore.exp.in:
610         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
611         (AXAttributeStringSetSpelling):
612         (AXAttributedStringAppendText):
613         * crypto/CommonCryptoUtilities.h:
614         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
615         (WebCore::transformAES_CBC):
616         * editing/cocoa/HTMLConverter.mm:
617         (_dateForString):
618         * html/canvas/ANGLEInstancedArrays.cpp:
619         (WebCore::ANGLEInstancedArrays::supported):
620         * loader/cocoa/DiskCacheMonitorCocoa.mm:
621         * page/mac/SettingsMac.mm:
622         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
623         (WebCore::Settings::initializeDefaultFontFamilies):
624         * platform/audio/mac/MediaSessionManagerMac.cpp:
625         (MediaSessionManager::updateSessionState):
626         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
627         (WebCore::MemoryPressureHandler::install):
628         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
629         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage): Deleted.
630         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
631         (WebCore::AVTrackPrivateAVFObjCImpl::languageForAVMediaSelectionOption):
632         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
633         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
634         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
635         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
636         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
637         * platform/graphics/cocoa/IOSurface.mm:
638         (IOSurface::state):
639         (IOSurface::isVolatile):
640         (IOSurface::setIsVolatile):
641         * platform/graphics/mac/SimpleFontDataMac.mm:
642         (WebCore::Font::platformInit):
643         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
644         (WebCore::Extensions3DOpenGL::drawArraysInstanced):
645         (WebCore::Extensions3DOpenGL::drawElementsInstanced):
646         (WebCore::Extensions3DOpenGL::vertexAttribDivisor):
647         * platform/mac/WebCoreSystemInterface.h:
648         * platform/mac/WebCoreSystemInterface.mm:
649         * platform/network/cf/ResourceHandleCFNet.cpp:
650         (WebCore::ResourceHandle::createCFURLConnection):
651         * platform/network/cocoa/ProtectionSpaceCocoa.h:
652         (WebCore::ProtectionSpace::encodingRequiresPlatformData):
653         * platform/network/cocoa/ProtectionSpaceCocoa.mm:
654         (WebCore::ProtectionSpace::encodingRequiresPlatformData):
655         * platform/network/mac/ResourceHandleMac.mm:
656         (WebCore::ResourceHandle::createNSURLConnection):
657         * platform/network/mac/WebCoreURLResponse.mm:
658         (WebCore::synthesizeRedirectResponseIfNecessary):
659         * platform/spi/cf/CFNetworkSPI.h:
660         * platform/text/mac/LocaleMac.mm:
661         (WebCore::LocaleMac::LocaleMac):
662
663 2015-01-29  Benjamin Poulain  <bpoulain@apple.com>
664
665         Remove an extraneous check from the parser of :not()
666         https://bugs.webkit.org/show_bug.cgi?id=141021
667
668         Reviewed by Darin Adler.
669
670         * css/CSSGrammar.y.in:
671         :not() takes a selector list, it can be null if there selector list is invalid,
672         but there cannot be a invalid pointer.
673
674 2015-01-29  Tim Horton  <timothy_horton@apple.com>
675
676         Fix the iOS build after r179347
677
678         * loader/FrameLoader.cpp:
679         (WebCore::FrameLoader::commitProvisionalLoad):
680
681 2015-01-29  Andreas Kling  <akling@apple.com>
682
683         JavaScript bindings constructors should take Ref<ImplType>&&.
684         <https://webkit.org/b/140952>
685
686         Reviewed by Darin Adler.
687
688         When constructing a JS wrapper object, there is always going to be a
689         corresponding DOM object.
690
691         Tweak the JavaScript DOM bindings generator to spit out constructors
692         that take the DOM object by Ref&& rather than PassRefPtr.
693
694         This avoids generating unnecessary null checks around every instance
695         of wrapper construction.
696
697         * bindings/js/JSDOMBinding.h:
698         (WebCore::createWrapper):
699         * bindings/js/JSDOMWindowShell.cpp:
700         (WebCore::JSDOMWindowShell::setWindow):
701         * bindings/js/JSDocumentCustom.cpp:
702         (WebCore::JSDocument::location):
703         * bindings/scripts/CodeGeneratorJS.pm:
704         (GenerateHeader):
705         (GenerateImplementation):
706
707 2015-01-29  Chris Dumez  <cdumez@apple.com>
708
709         Clean up / modernize PageCache class
710         https://bugs.webkit.org/show_bug.cgi?id=141009
711
712         Reviewed by Darin Adler.
713
714         Clean up / modernize PageCache class:
715         - Use more references instead of pointers
716         - Use a ListHashSet<Ref<HistoryItem>> internally instead of a linked
717           list of HistoryItem*. This avoids having the ref/unref HistoryItems
718           manually and maintaining the list size separately. It also simplifies
719           the code dealing with the container and makes looking up HistoryItems
720           faster as a bonus. Similarly to the previous implementation, we are
721           adding elements to one end and removing from the opposite end when
722           pruning to drop old history items first. Note that even though the
723           previous implementation was called LRUList, it did not move items to
724           the front when accessed. The new implementation doesn't either.
725          - Rename "capacity" to "maxSize" to avoid confusing with containers'
726            capacity (which doesn't limit the size of the container).
727          - Use unsigned instead of int for all values that are supposed to be
728            positive.
729          - Do not explicitely define the default constructor and let the
730            compiler generate it for us (and use in-class initialization for
731            members)
732          - Fix indentation in the header.
733
734 2015-01-29  Julien Isorce  <j.isorce@samsung.com>
735
736         HTMLImageLoader: fix build failure on assert condition after r179340
737         https://bugs.webkit.org/show_bug.cgi?id=140722
738
739         Reviewed by Csaba Osztrogonác.
740
741         * html/HTMLImageLoader.cpp:
742         (WebCore::HTMLImageLoader::imageChanged): image() directly
743         returns a CachedImage*.
744
745 2015-01-29  Julien Isorce  <j.isorce@samsung.com>
746
747         CachedImage: ensure clients overrides imageChanged instead of notifyFinished
748         https://bugs.webkit.org/show_bug.cgi?id=140722
749
750         Reviewed by Tim Horton.
751
752         imageChanged is called whenever a frame of an image changes
753         because we got more data from the network.
754
755         notifyFinished was called when the image was entirely loaded.
756
757         The problem was that some clients were implementing only
758         imageChanged (ex: RenderBox), some only notifyFinished and
759         some both (ex: RenderImage) which made the situation difficult
760         to understand and to maintain.
761
762         For example when the image finished loading, both imageChanged
763         and notifyFinished were called with the difference that for the
764         first one isLoaded() returned false.
765         It could result in functions being called twice in a row,
766         ex: contentChanged(ImageChanged).
767
768         So this patch tries to simplify the situation by marking
769         CachedImageClient::notifyFinished final in order to prevent
770         clients from implementing it.
771         Indeed this patch ensure that CachedImage clients implement
772         and only implement imageChanged function.
773
774         Also Clients can now differentiate intermediate and end
775         calls by checking isLoaded() in imageChanged.
776
777         * html/HTMLImageLoader.cpp:
778         (WebCore::HTMLImageLoader::imageChanged): Added instead
779         of notifyFinished.
780         (WebCore::HTMLImageLoader::notifyFinished): Deleted.
781         * html/HTMLImageLoader.h:
782
783         * loader/ImageLoader.cpp:
784         (WebCore::ImageLoader::imageChanged): Added instead
785         of notifyFinished.
786         (WebCore::ImageLoader::notifyFinished): Deleted.
787         * loader/ImageLoader.h:
788
789         * loader/cache/CachedImage.cpp:
790         (WebCore::CachedImage::finishLoading): Explicilty mark image as
791         loaded and before notifying observers. So that it avoids to call
792         notifyFinished (from CachedResource::finishLoading).
793
794         * loader/cache/CachedImageClient.h:
795         Make CachedImageClient::notifyFinished final to make sure
796         sub classes implement imageChanged instead.
797
798         * rendering/RenderImage.cpp:
799         (WebCore::RenderImage::notifyFinished): Deleted.
800         ImageChanged already exists and is more clever than notifyFinished.
801         Indeed invalidateBackgroundObscurationStatus() will be called by
802         RenderReplaced::layout() upon call to setNeedsLayout() in
803         RenderImage::imageDimensionsChanged.
804         Also contentChanged(ImageChanged) is now called only when necessary.
805         * rendering/RenderImage.h:
806
807         * svg/SVGFEImageElement.cpp:
808         (WebCore::SVGFEImageElement::imageChanged): Added instead
809         of notifyFinished.
810         (WebCore::SVGFEImageElement::notifyFinished): Deleted.
811         * svg/SVGFEImageElement.h:
812
813 2015-01-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
814
815         Poor performance on IE's Chalkboard benchmark.
816         https://bugs.webkit.org/show_bug.cgi?id=140753.
817
818         Reviewed by Zalan Bujtas.
819
820         Test: PerformanceTests/SVG/UnderTheSeeBenchmark.html
821               PerformanceTests/SVG/WorldcupBenchmark.html
822               
823         The SVG rendering code was not skipping the SVG elements which are outside the
824         clipping rectangle. We were drawing all the SVG elements even if some of them
825         are completely outside the clipping rectangle. The fix is to pass the correct
826         dirty rectangle to the ScrollView which then gets propagated to the SVG renderers.
827
828         * svg/graphics/SVGImage.cpp:
829         (WebCore::SVGImage::draw):
830         SVGImage::draw() needs to pass the intersection of 'srcRect' and context->clipBounds(),
831         to ScrollView::paint(). This will ensure RenderSVGShape::paint() gets the correct
832         clipping rectangle. If there is no intersection between the boundingBox of the
833         RenderSVGShape and the clipping rectangle, the RenderSVGShape will not be drawn.
834
835 2015-01-28  Brent Fulgham  <bfulgham@apple.com>
836
837         Scroll snap points do not work in the vertical direction
838         https://bugs.webkit.org/show_bug.cgi?id=141001
839         <rdar://problem/19632089>
840
841         Reviewed by Beth Dakin.
842
843         New scroll snap tests are being prepared separately. A manual test case is attached to the issue.
844
845         * page/EventHandler.cpp:
846         (WebCore::handleWheelEventInAppropriateEnclosingBoxForSingleAxis): We want to consider momentum end phase
847         when dealing with Scroll Snap Points.
848         * platform/mac/AxisScrollSnapAnimator.mm:
849         (WebCore::AxisScrollSnapAnimator::handleWheelEvent): We do NOT want to bail out early here. In fact, it's strange
850         that this code was like this at all, since it meant a large number of cases were not being used. We also want to
851         trigger the scroll snap animation (when applicable) upon an inertia scroll end.
852         * platform/mac/ScrollAnimatorMac.mm:
853         (WebCore::gestureShouldBeginSnap): Added.
854         (WebCore::ScrollAnimatorMac::allowsVerticalStretching): If we have automatic elasticity, and we have active scroll
855         snap points, we want to let the scroll snap animator deal with the gesture.
856         (WebCore::ScrollAnimatorMac::allowsHorizontalStretching): Ditto.
857
858 2015-01-28  Benjamin Poulain  <bpoulain@apple.com>
859
860         Start fixing the handling of Element's attributes when they contain non-ASCII characters
861         https://bugs.webkit.org/show_bug.cgi?id=141016
862
863         Reviewed by Ryosuke Niwa.
864
865         Attribute handling does not work properly when the attribute name contains non-ASCII character.
866
867         The HTML parser tokenize those names as ASCII lowercase. Some of the code is CSS and Element use
868         unicode lowercase for the names. This breaks all the APIs as soon as a name contains a character
869         that is non-ASCII and uppercase since some APIs change it, other don't.
870
871         This patch is a first step toward fixing this mess, it only address the simple cases.
872         The HTML spec says the names should be compared ASCII case-insensitive, to I spread that behavior
873         to places that were using unicode.
874
875         Tests: fast/css/attribute-ascii-case-insensitive-html.html
876                fast/css/attribute-ascii-case-insensitive-xhtml-expected.xhtml
877                fast/css/attribute-ascii-case-insensitive-xhtml.xhtml
878                fast/css/attribute-ascii-case-insensitive-xml-in-html.html
879                fast/dom/Element/attribute-ascii-case-insensitive-1.html
880                fast/dom/Element/attribute-ascii-case-insensitive-2.html
881                fast/selectors/attribute-ascii-case-insensitive-style-update.html
882                fast/selectors/element-matches-attribute-ascii-case-insensitive-html.html
883                fast/selectors/querySelector-attribute-ascii-case-insensitive-html.html
884
885         * css/CSSSelector.cpp:
886         (WebCore::CSSSelector::setAttribute):
887         * dom/Element.cpp:
888         (WebCore::Element::synchronizeAttribute):
889         (WebCore::Element::setAttribute):
890         (WebCore::Element::removeAttribute):
891         (WebCore::Element::hasAttribute):
892         * dom/ElementData.cpp:
893         (WebCore::ElementData::findAttributeIndexByNameSlowCase):
894         * dom/ElementData.h:
895         (WebCore::ElementData::findAttributeIndexByName):
896
897 2015-01-28  Zalan Bujtas  <zalan@apple.com>
898
899         Simple line layout: Drop uncommitted/committed terms from LineState.
900         https://bugs.webkit.org/show_bug.cgi?id=141005
901
902         Reviewed by Antti Koivisto.
903
904         Fragments form segments and segments turn into runs on the lines.
905         We add fragments only when they fit so they should not be in 'uncommitted' state at all.
906
907         No change in functionality.
908
909         * rendering/SimpleLineLayout.cpp:
910         (WebCore::SimpleLineLayout::LineState::createRun):
911         (WebCore::SimpleLineLayout::LineState::addFragment):
912         (WebCore::SimpleLineLayout::LineState::addWhitespace):
913         (WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly):
914         (WebCore::SimpleLineLayout::LineState::width):
915         (WebCore::SimpleLineLayout::LineState::firstCharacterFits):
916         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
917         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
918         (WebCore::SimpleLineLayout::firstFragment):
919         (WebCore::SimpleLineLayout::createLineRuns):
920         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
921         (WebCore::SimpleLineLayout::createTextRuns): Unnecessary assert.
922         (WebCore::SimpleLineLayout::LineState::commitAndCreateRun): Deleted.
923         (WebCore::SimpleLineLayout::LineState::addUncommitted): Deleted.
924         (WebCore::SimpleLineLayout::LineState::addUncommittedWhitespace): Deleted.
925
926 2015-01-28  Chris Dumez  <cdumez@apple.com>
927
928         Regression(r177494): Bad cast to WebKitCSSResourceValue in StyleBuilderConverter::convertMaskImageOperations()
929         https://bugs.webkit.org/show_bug.cgi?id=140991
930         <rdar://problem/19625305>
931
932         Reviewed by Antti Koivisto.
933
934         convertMaskImageOperations() was assuming that the CSSValueList's values
935         were always WebKitCSSResourceValue values. However, they can be
936         CSSInitialValues as well so we should check before casting.
937
938         Test: css3/masking/mask-image-initial-value-crash.html
939
940         * css/StyleBuilderConverter.h:
941         (WebCore::maskImageValueFromIterator):
942         (WebCore::StyleBuilderConverter::convertMaskImageOperations):
943
944 2015-01-28  Chris Dumez  <cdumez@apple.com>
945
946         Remove dead code from MemoryCache
947         https://bugs.webkit.org/show_bug.cgi?id=140964
948
949         Reviewed by Andreas Kling.
950
951         Remove dead code from MemoryCache, make more things private and
952         clean up a little bit.
953
954         * WebCore.exp.in:
955         * inspector/InspectorResourceAgent.cpp:
956         * loader/cache/MemoryCache.cpp:
957         (WebCore::MemoryCache::MemoryCache):
958         (WebCore::MemoryCache::revalidationSucceeded):
959         (WebCore::MemoryCache::removeImageFromCache):
960         (WebCore::MemoryCache::pruneLiveResources):
961         (WebCore::MemoryCache::pruneDeadResources):
962         (WebCore::MemoryCache::pruneDeadResourcesToSize):
963         (WebCore::MemoryCache::remove):
964         (WebCore::MemoryCache::removeRequestFromSessionCaches):
965         (WebCore::MemoryCache::setDisabled):
966         (WebCore::MemoryCache::resourceForURL): Deleted.
967         (WebCore::MemoryCache::pruneLiveResourcesToPercentage): Deleted.
968         (WebCore::MemoryCache::pruneDeadResourcesToPercentage): Deleted.
969         (WebCore::MemoryCache::evict): Deleted.
970         (WebCore::MemoryCache::removeUrlFromCache): Deleted.
971         (WebCore::MemoryCache::removeRequestFromCache): Deleted.
972         (WebCore::MemoryCache::pruneToPercentage): Deleted.
973         * loader/cache/MemoryCache.h:
974         (WebCore::MemoryCache::LRUList::LRUList): Deleted.
975         (WebCore::MemoryCache::remove): Deleted.
976         (WebCore::MemoryCache::setPruneEnabled): Deleted.
977         (WebCore::MemoryCache::minDeadCapacity): Deleted.
978         (WebCore::MemoryCache::maxDeadCapacity): Deleted.
979         (WebCore::MemoryCache::capacity): Deleted.
980         (WebCore::MemoryCache::liveSize): Deleted.
981         (WebCore::MemoryCache::deadSize): Deleted.
982         * platform/MemoryPressureHandler.cpp:
983         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
984
985 2015-01-28  Brian J. Burg  <burg@cs.washington.edu>
986
987         Web Inspector: remove CSS.setPropertyText, CSS.toggleProperty and related dead code
988         https://bugs.webkit.org/show_bug.cgi?id=140961
989
990         Reviewed by Timothy Hatcher.
991
992         No new tests, no behavior changed.
993
994         * CMakeLists.txt:
995         * WebCore.vcxproj/WebCore.vcxproj:
996         * WebCore.vcxproj/WebCore.vcxproj.filters:
997         * WebCore.xcodeproj/project.pbxproj:
998         * inspector/InspectorAllInOne.cpp:
999         * inspector/InspectorCSSAgent.cpp:
1000         (WebCore::InspectorCSSAgent::setPropertyText): Deleted.
1001         (WebCore::InspectorCSSAgent::toggleProperty): Deleted.
1002         * inspector/InspectorCSSAgent.h:
1003         * inspector/InspectorStyleSheet.cpp:
1004         (WebCore::InspectorStyle::InspectorStyle):
1005         (WebCore::InspectorStyle::populateAllProperties):
1006         (WebCore::InspectorStyleSheet::InspectorStyleSheet):
1007         (WebCore::InspectorStyleSheet::reparseStyleSheet):
1008         (WebCore::InspectorStyleSheet::inspectorStyleForId):
1009         (WebCore::InspectorStyle::setPropertyText): Deleted.
1010         (WebCore::InspectorStyle::toggleProperty): Deleted.
1011         (WebCore::InspectorStyle::newLineAndWhitespaceDelimiters): Deleted.
1012         (WebCore::InspectorStyleSheet::setPropertyText): Deleted.
1013         (WebCore::InspectorStyleSheet::toggleProperty): Deleted.
1014         (WebCore::InspectorStyleSheet::rememberInspectorStyle): Deleted.
1015         (WebCore::InspectorStyleSheet::forgetInspectorStyle): Deleted.
1016         (WebCore::InspectorStyleSheet::revalidateStyle): Deleted.
1017         * inspector/InspectorStyleSheet.h:
1018         * inspector/InspectorStyleTextEditor.cpp: Removed.
1019         * inspector/InspectorStyleTextEditor.h: Removed.
1020
1021 2015-01-28  Zalan Bujtas  <zalan@apple.com>
1022
1023         Simple line layout: Move FlowContents iterator interface to FlowContentsIterator.
1024         https://bugs.webkit.org/show_bug.cgi?id=140944
1025
1026         Reviewed by Antti Koivisto.
1027
1028         This patch cleans up FlowContents's interface by moving the iterator functionality
1029         to this new FlowContentsIterator class.
1030
1031         No change in functionality.
1032
1033         * CMakeLists.txt:
1034         * WebCore.vcxproj/WebCore.vcxproj:
1035         * WebCore.vcxproj/WebCore.vcxproj.filters:
1036         * WebCore.xcodeproj/project.pbxproj:
1037         * rendering/SimpleLineLayout.cpp:
1038         (WebCore::SimpleLineLayout::LineState::addUncommitted):
1039         (WebCore::SimpleLineLayout::LineState::addUncommittedWhitespace):
1040         (WebCore::SimpleLineLayout::preWrap):
1041         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
1042         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
1043         (WebCore::SimpleLineLayout::firstFragment):
1044         (WebCore::SimpleLineLayout::createLineRuns):
1045         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
1046         (WebCore::SimpleLineLayout::splitRunsAtRendererBoundary):
1047         (WebCore::SimpleLineLayout::createTextRuns):
1048         * rendering/SimpleLineLayoutFlowContents.cpp:
1049         (WebCore::SimpleLineLayout::FlowContents::FlowContents):
1050         (WebCore::SimpleLineLayout::FlowContents::Style::Style): Deleted.
1051         (WebCore::SimpleLineLayout::FlowContents::nextTextFragment): Deleted.
1052         (WebCore::SimpleLineLayout::nextBreakablePosition): Deleted.
1053         (WebCore::SimpleLineLayout::FlowContents::findNextBreakablePosition): Deleted.
1054         (WebCore::SimpleLineLayout::findNextNonWhitespace): Deleted.
1055         (WebCore::SimpleLineLayout::FlowContents::findNextNonWhitespacePosition): Deleted.
1056         (WebCore::SimpleLineLayout::FlowContents::textWidth): Deleted.
1057         (WebCore::SimpleLineLayout::FlowContents::runWidth): Deleted.
1058         * rendering/SimpleLineLayoutFlowContents.h:
1059         (WebCore::SimpleLineLayout::FlowContents::Iterator::Iterator):
1060         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator*):
1061         (WebCore::SimpleLineLayout::FlowContents::begin):
1062         (WebCore::SimpleLineLayout::FlowContents::end):
1063         (WebCore::SimpleLineLayout::FlowContents::length):
1064         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator++):
1065         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator==):
1066         (WebCore::SimpleLineLayout::FlowContents::Iterator::operator!=):
1067         (WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition):
1068         (WebCore::SimpleLineLayout::FlowContents::TextFragment::TextFragment): Deleted.
1069         (WebCore::SimpleLineLayout::FlowContents::TextFragment::isEmpty): Deleted.
1070         (WebCore::SimpleLineLayout::FlowContents::hasOneSegment): Deleted.
1071         (WebCore::SimpleLineLayout::FlowContents::style): Deleted.
1072         (WebCore::SimpleLineLayout::FlowContents::characterAt): Deleted.
1073         (WebCore::SimpleLineLayout::FlowContents::isLineBreak): Deleted.
1074         (WebCore::SimpleLineLayout::FlowContents::isEnd): Deleted.
1075         * rendering/SimpleLineLayoutFlowContentsIterator.cpp: Copied from Source/WebCore/rendering/SimpleLineLayoutFlowContents.cpp.
1076         (WebCore::SimpleLineLayout::FlowContentsIterator::Style::Style):
1077         (WebCore::SimpleLineLayout::FlowContentsIterator::FlowContentsIterator):
1078         (WebCore::SimpleLineLayout::FlowContentsIterator::nextTextFragment):
1079         (WebCore::SimpleLineLayout::FlowContentsIterator::textWidth):
1080         (WebCore::SimpleLineLayout::nextBreakablePosition):
1081         (WebCore::SimpleLineLayout::FlowContentsIterator::findNextBreakablePosition):
1082         (WebCore::SimpleLineLayout::findNextNonWhitespace):
1083         (WebCore::SimpleLineLayout::FlowContentsIterator::findNextNonWhitespacePosition):
1084         (WebCore::SimpleLineLayout::FlowContentsIterator::runWidth):
1085         * rendering/SimpleLineLayoutFlowContentsIterator.h: Copied from Source/WebCore/rendering/SimpleLineLayoutFlowContents.h.
1086         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::TextFragment):
1087         (WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isEmpty):
1088         (WebCore::SimpleLineLayout::FlowContentsIterator::style):
1089         (WebCore::SimpleLineLayout::FlowContentsIterator::segmentForPosition):
1090         (WebCore::SimpleLineLayout::FlowContentsIterator::characterAt):
1091         (WebCore::SimpleLineLayout::FlowContentsIterator::isLineBreak):
1092         (WebCore::SimpleLineLayout::FlowContentsIterator::isEnd):
1093
1094 2015-01-28  Beth Dakin  <bdakin@apple.com>
1095
1096         Remove Mountain Lion code from WebCore
1097         https://bugs.webkit.org/show_bug.cgi?id=141007
1098
1099         Reviewed by Sam Weinig.
1100
1101         * WebCore.exp.in:
1102         * page/AlternativeTextClient.h:
1103         * page/mac/SettingsMac.mm:
1104         (WebCore::Settings::initializeDefaultFontFamilies):
1105         * platform/cocoa/SystemVersion.mm:
1106         (WebCore::callGestalt): Deleted.
1107         (WebCore::createSystemMarketingVersion): Deleted.
1108         * platform/graphics/Font.cpp:
1109         (WebCore::Font::applyTransforms):
1110         * platform/graphics/WidthIterator.h:
1111         (WebCore::WidthIterator::supportsTypesettingFeatures):
1112         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1113         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
1114         * platform/graphics/ca/GraphicsLayerCA.cpp:
1115         (WebCore::supportsAcceleratedFilterAnimations):
1116         * platform/graphics/ca/PlatformCAFilters.h:
1117         * platform/graphics/mac/FontCacheMac.mm:
1118         (WebCore::FontCache::platformInit):
1119         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1120         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
1121         * platform/mac/PlatformEventFactoryMac.mm:
1122         (WebCore::phaseForEvent):
1123         * platform/mac/WebCoreSystemInterface.h:
1124         * platform/mac/WebCoreSystemInterface.mm:
1125         * platform/network/cf/SocketStreamHandleCFNet.cpp:
1126         (WebCore::SocketStreamHandle::createStreams):
1127         * platform/network/cocoa/CredentialCocoa.mm:
1128         (WebCore::toCredentialPersistence):
1129         * platform/spi/cocoa/CoreTextSPI.h:
1130
1131 2015-01-28  peavo@outlook.com  <peavo@outlook.com>
1132
1133         [WinCairo] Compile error in media player implementation.
1134         https://bugs.webkit.org/show_bug.cgi?id=141004
1135
1136         Reviewed by Brent Fulgham.
1137
1138         MediaPlayer::cachedResourceLoader() returns a pointer to the resource loader, not a reference.
1139
1140         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
1141         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
1142         (WebCore::MediaPlayerPrivateMediaFoundation::createVideoWindow):
1143
1144 2015-01-28  Jeremy Jones  <jeremyj@apple.com>
1145
1146         Prevent implicit animation when setting fullscreen background to clear.
1147         https://bugs.webkit.org/show_bug.cgi?id=140888
1148
1149         Reviewed by Eric Carlson.
1150
1151         This patch decreases flicker when exiting fullscreen by preventing
1152         an implicit animation when changing the background to clear.
1153
1154         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1155         (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
1156
1157 2015-01-28  Dana Burkart  <dburkart@apple.com>
1158
1159         Move ASan flag settings from DebugRelease.xcconfig to Base.xcconfig
1160         https://bugs.webkit.org/show_bug.cgi?id=136765
1161
1162         Reviewed by Alexey Proskuryakov.
1163
1164         * Configurations/Base.xcconfig:
1165         * Configurations/DebugRelease.xcconfig:
1166         * WebCore.xcodeproj/project.pbxproj:
1167
1168 2015-01-28  Chris Dumez  <cdumez@apple.com>
1169
1170         Use an enum class for createFontFamilyValue()'s fromSystemFontID argument
1171         https://bugs.webkit.org/show_bug.cgi?id=140981
1172
1173         Reviewed by Darin Adler.
1174
1175         Use an enum class for createFontFamilyValue()'s fromSystemFontID argument
1176         instead of a simple enum, as suggested by Sam. This is a bit nicer.
1177
1178         Also, use a boolean type for CSSFontFamily.fromSystemFontID instead of
1179         the enum type to facilitate handling. Using a enum (class) for
1180         CSSFontFamily's fromSystemFontID member is not useful as it is always
1181         accessed by name.
1182
1183         * css/CSSFontFamily.h:
1184         * css/CSSParser.cpp:
1185         (WebCore::CSSParser::parseSystemFont):
1186         * css/CSSValuePool.cpp:
1187         (WebCore::CSSValuePool::createFontFamilyValue):
1188         * css/CSSValuePool.h:
1189
1190 2015-01-28  Chris Dumez  <cdumez@apple.com>
1191
1192         Fix typo in markPagesForVistedLinkStyleRecalc()
1193         https://bugs.webkit.org/show_bug.cgi?id=140977
1194
1195         Reviewed by Darin Adler.
1196
1197         * WebCore.exp.in:
1198         * history/CachedPage.h:
1199         (WebCore::CachedPage::markForVisitedLinkStyleRecalc):
1200         (WebCore::CachedPage::markForVistedLinkStyleRecalc): Deleted.
1201         * history/PageCache.cpp:
1202         (WebCore::PageCache::markPagesForVisitedLinkStyleRecalc):
1203         (WebCore::PageCache::markPagesForVistedLinkStyleRecalc): Deleted.
1204         * history/PageCache.h:
1205
1206 2015-01-28  Chris Dumez  <cdumez@apple.com>
1207
1208         Unreviewed. Remove duplicate friend class statement after r179255.
1209
1210         * history/PageCache.h:
1211
1212 2015-01-28  Darin Adler  <darin@apple.com>
1213
1214         Make SVGElement::instancesForElement point to elements in the shadow tree, not SVGElementInstance objects
1215         https://bugs.webkit.org/show_bug.cgi?id=140984
1216
1217         Reviewed by Anders Carlsson.
1218
1219         Refactoring of code that is pretty well covered by existing tests, so
1220         not adding new tests.
1221
1222         Inspired by work Rob Buis did in Blink:
1223
1224             http://src.chromium.org/viewvc/blink?view=revision&revision=173275
1225
1226         * page/EventHandler.cpp:
1227         (WebCore::EventHandler::clear): Removed code to zero m_lastInstanceUnderMouse.
1228         (WebCore::instanceAssociatedWithShadowTreeElement): Deleted.
1229         (WebCore::EventHandler::updateMouseEventTargetNode): Removed code that used
1230         m_lastInstanceUnderMouse to track events on an object after recloning.
1231         This behavior doesn't seem to be needed to pass any existing tests, and Rob
1232         removed it from Blink, so I'll take it out and we can bring if back, based
1233         on the original element rather than on the SVGElementInstance, if we find we
1234         need to restore the behavior in the future.
1235
1236         * page/EventHandler.h: Removed m_lastInstanceUnderMouse.
1237
1238         * svg/SVGAnimateElementBase.cpp:
1239         (WebCore::SVGAnimateElementBase::determineAnimatedPropertyType):
1240         Changed this function to take a reference and to call the updated version
1241         of the targetElement.animatedPropertyTypesForAttribute function.
1242         (WebCore::SVGAnimateElementBase::calculateAnimatedValue): Updated to pass
1243         a reference rather than a pointer.
1244         (WebCore::SVGAnimateElementBase::resetAnimatedType): Updated to pass
1245         references rather than pointers.
1246         (WebCore::applyCSSPropertyToTarget): Updated to take a reference.
1247         (WebCore::removeCSSPropertyFromTarget): Ditto.
1248         (WebCore::applyCSSPropertyToTargetAndInstances): Ditto. Also use a modern
1249         for loop, and iterate over shadow tree instances, not over SVGElementInstance.
1250         (WebCore::removeCSSPropertyFromTargetAndInstances): Ditto.
1251         (WebCore::notifyTargetAboutAnimValChange): Ditto.
1252         (WebCore::notifyTargetAndInstancesAboutAnimValChange): Ditto.
1253         (WebCore::SVGAnimateElementBase::clearAnimatedType): More of the same.
1254         (WebCore::SVGAnimateElementBase::applyResultsToTarget): Ditto.
1255         (WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Ditto.
1256
1257         * svg/SVGAnimateElementBase.h: Changed determineAnimatedPropertyType to take
1258         a reference rahter than a pointer.
1259
1260         * svg/SVGAnimateMotionElement.cpp:
1261         (WebCore::SVGAnimateMotionElement::applyResultsToTarget): Updated to use the
1262         new instances instead of SVGElementInstance. Also added code to skip work if
1263         the transform is not changing, and use the assignment operator instead of
1264         breaking one matrix down and calling setMatrix on the other.
1265
1266         * svg/SVGAnimatedTypeAnimator.cpp:
1267         (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
1268         Changed to take a reference rather than a pointer, and rewrote to streamline,
1269         using modern for loops and using the new instances set.
1270
1271         * svg/SVGAnimatedTypeAnimator.h: Removed the constructors from the
1272         SVGElementAnimatedProperties struct since we can build them just fine without
1273         them. Changed findAnimatedPropertiesForAttributeName to take a reference.
1274
1275         * svg/SVGAnimationElement.cpp:
1276         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation): Pass a
1277         reference rather than a pointer. Also streamlined the code a bit and removed
1278         a comment that tried to say exactly what the code was doing, but was outdated.
1279
1280         * svg/SVGElement.cpp:
1281         (WebCore::SVGElement::~SVGElement): Disconnect all instances from this element
1282         and also disconnect the corresponding element from this element if it itself
1283         is an instance. This guarantees we have no dangling pointers.
1284         (WebCore::SVGElement::mapInstanceToElement): Deleted.
1285         (WebCore::SVGElement::removeInstanceMapping): Deleted.
1286         (WebCore::SVGElement::instances): Renamed from instancesForElement and changed
1287         to be a set of SVG element instances in the shadow tree, rather than
1288         SVGElementInstance objects.
1289         (WebCore::SVGElement::correspondingElement): Tweaked assertion a little and use
1290         nullptr instead of 0.
1291         (WebCore::SVGElement::correspondingUseElement): Added. Finds the use element
1292         that owns the shadow tree this element is in by following the host element
1293         pointer from the shadow root.
1294         (WebCore::SVGElement::setCorrespondingElement): Added code to insert or remove
1295         this element from the instances set of the corresponding element.
1296         (WebCore::SVGElement::animatedPropertyTypesForAttribute): Renamed from
1297         animatedPropertyTypeForAttribute and switched to use a return value instead of
1298         an out argument.
1299         (WebCore::SVGElement::addEventListener): Updated to use instances rather than
1300         the old instancesForElement.
1301         (WebCore::SVGElement::removeEventListener): Ditto.
1302         (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute): Pass a reference.
1303         (WebCore::SVGElement::synchronizeAnimatedSVGAttribute): Ditto.
1304         (WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Updated to use the
1305         new function from AttributeToPropertyMap.
1306
1307         * svg/SVGElement.h: Changed animatedPropertyTypesForAttribute name to be plural
1308         since it returns a vector of types, and made it use a return value instead of
1309         an out argument. Added the correspondingUseElement function, and removed the
1310         mapInstanceToElement and removeInstanceMapping functions.
1311
1312         * svg/SVGElementInstance.cpp:
1313         (WebCore::SVGElementInstance::SVGElementInstance): Removed now-unneeded call to
1314         mapInstanceToElement. This is now handled entirely by the SVGElement itself.
1315         (WebCore::SVGElementInstance::detach): Removed now-unneeded call to
1316         removeInstanceMapping. This is now handled entirely by the SVGElement itself.
1317         (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Rewrote to be
1318         based on the instances set; logic is different now because we remove each
1319         element from that set as we go.
1320
1321         * svg/SVGElementRareData.h:
1322         (WebCore::SVGElementRareData::SVGElementRareData): Removed initialization of
1323         pointers since we can do that where they are defined instead.
1324         (WebCore::SVGElementRareData::instances): Renamed from elementInstances and
1325         changed the type.
1326         (WebCore::SVGElementRareData::destroyAnimatedSMILStyleProperties): Deleted.
1327         Unneeded since it was already called just before deleting the rare data.
1328
1329         * svg/SVGTests.cpp:
1330         (WebCore::SVGTests::SVGTests): Took advantage of using namespace.
1331         (WebCore::createSVGTestPropertyInfo): Added. Helper for function below.
1332         (WebCore::createSVGTextAttributeToPropertyMap): Ditto.
1333         (WebCore::SVGTests::attributeToPropertyMap): Changed to use the create function
1334         above. No longer allocates objects on the heap.
1335         (WebCore::SVGTests::hasExtension): Reworked #if code to make the MathML part
1336         independent rather than repeating the return statement.
1337         (WebCore::SVGTests::synchronizeAttribute): Added. Helper for functions below.
1338         (WebCore::SVGTests::synchronizeRequiredFeatures): Call synchronizeAttribute.
1339         (WebCore::SVGTests::synchronizeRequiredExtensions): Ditto.
1340         (WebCore::SVGTests::synchronizeSystemLanguage): Ditto.
1341
1342         * svg/SVGTests.h: Removed unneeded forward declarations. Mark the many functions
1343         that do not depend on object state as static so the call sites don't wastefully
1344         pass a this pointer. Removed the unneeded requiredFeaturesPropertyInfo,
1345         requiredExtensionsPropertyInfo, and systemLanguagePropertyInfo functions.
1346         Added synchronizeAttribute helper function.
1347
1348         * svg/SVGUseElement.cpp:
1349         (WebCore::SVGUseElement::invalidateDependentShadowTrees): Updated to use the
1350         new instances set and a modern for loop.
1351
1352         * svg/properties/SVGAnimatedPropertyMacros.h: Pass reference to addProperty and
1353         made a few other small refinements.
1354
1355         * svg/properties/SVGAttributeToPropertyMap.cpp:
1356         (WebCore::SVGAttributeToPropertyMap::addProperties): Fixed problems mentioned
1357         in FIXME where we did too much hashing and vector resizing.
1358         (WebCore::SVGAttributeToPropertyMap::addProperty): Streamlined to use a single
1359         hash table lookup.
1360         (WebCore::SVGAttributeToPropertyMap::properties): Renamed from
1361         animatedPropertiesForAttribute and changed to return a vector rather than using
1362         an out argument. Also had to change some since the vectors are in the hash table
1363         now rather than allocated on the heap.
1364         (WebCore::SVGAttributeToPropertyMap::types): Renamed from
1365         animatedPropertyTypeForAttribute and made changes just like the ones above.
1366         (WebCore::SVGAttributeToPropertyMap::synchronizeProperties): Use modern for
1367         loops, take a reference rather than a pointer, and use the function pointer
1368         directly instead of calling through a helper with various assertions.
1369         (WebCore::SVGAttributeToPropertyMap::synchronizeProperty): Ditto.
1370
1371         * svg/properties/SVGAttributeToPropertyMap.h: Updated to match the changes
1372         above. Also changed the map to contain vectors instead of pointers to vectors.
1373
1374 2015-01-28  Darin Adler  <darin@apple.com>
1375
1376         REGRESSION (r173698): Leaks of selector lists in CSS parsing
1377         https://bugs.webkit.org/show_bug.cgi?id=140993
1378
1379         Reviewed by Anders Carlsson.
1380
1381         * css/CSSGrammar.y.in: Fixed logic in rules that were not moving a parser-
1382         owned pointer into a unique_ptr in all code paths. The magic value
1383         invalidSelectorVector makes this really messy. We might want to find a
1384         different seolution in the future.
1385
1386 2015-01-28  Brent Fulgham  <bfulgham@apple.com>
1387
1388         [Win] Unreviewed build fix after r179247.
1389
1390         * history/PageCache.h: Need to declare NeverDestroyed specialization as
1391         a friend.
1392
1393 2015-01-28  Joanmarie Diggs  <jdiggs@igalia.com>
1394
1395         AX: [ATK] Implement support for new AtkRole types for MathML
1396         https://bugs.webkit.org/show_bug.cgi?id=140916
1397
1398         Reviewed by Chris Fleizach.
1399
1400         Expose mfrac as ATK_ROLE_MATH_FRACTION, and both mroot and msqrt as
1401         ATK_ROLE_MATH_ROOT. In the case of script elements, expose the container
1402         (msub, msup, msubsup, and mmultiscripts) using the generic text block role
1403         ATK_ROLE_SECTION. Then expose the actual script child elements using role
1404         ATK_ROLE_SUBSCRIPT/ATK_ROLE_SUPERSCRIPT. In the case of mmultiscripts,
1405         expose whether it is a prescript or postscript via AtkObject attribute.
1406
1407         Test: accessibility/math-multiscript-attributes.html
1408         Also added additional test cases to accessibility/roles-exposed.html
1409
1410         * accessibility/AccessibilityObject.h:
1411         (WebCore::AccessibilityObject::isMathScriptObject): Added.
1412         (WebCore::AccessibilityObject::isMathMultiscriptObject): Added.
1413         * accessibility/AccessibilityRenderObject.cpp:
1414         (WebCore::AccessibilityRenderObject::isMathScriptObject): Added.
1415         (WebCore::AccessibilityRenderObject::isMathMultiscriptObject): Added.
1416         * accessibility/AccessibilityRenderObject.h:
1417         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1418         (webkitAccessibleGetAttributes): Expose whether a multiscript object is a prescript or postscript.
1419         (atkRole): Map WebCore Accessibility objects to the new ATK roles.
1420
1421 2015-01-28  Chris Dumez  <cdumez@apple.com>
1422
1423         Rename pageCache() to PageCache::shared() and return a reference
1424         https://bugs.webkit.org/show_bug.cgi?id=140983
1425
1426         Reviewed by Andreas Kling.
1427
1428         Rename pageCache() to PageCache::shared() as this is a singleton class
1429         and have it return a reference instead of a pointer.
1430
1431         * history/BackForwardList.cpp:
1432         (WebCore::BackForwardList::addItem):
1433         (WebCore::BackForwardList::setCapacity):
1434         (WebCore::BackForwardList::clearAllPageCaches):
1435         (WebCore::BackForwardList::close):
1436         * history/CachedFrame.cpp:
1437         (WebCore::CachedFrame::CachedFrame):
1438         * history/HistoryItem.cpp:
1439         (WebCore::HistoryItem::setURL):
1440         * history/PageCache.cpp:
1441         (WebCore::PageCache::shared):
1442         (WebCore::PageCache::get):
1443         (WebCore::pageCache): Deleted.
1444         * history/PageCache.h:
1445         * loader/FrameLoader.cpp:
1446         (WebCore::FrameLoader::commitProvisionalLoad):
1447         (WebCore::FrameLoader::loadDifferentDocumentItem):
1448         * loader/HistoryController.cpp:
1449         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
1450         (WebCore::HistoryController::updateForReload):
1451         * page/Frame.cpp:
1452         (WebCore::Frame::setPageAndTextZoomFactors):
1453         * page/Page.cpp:
1454         (WebCore::Page::setDeviceScaleFactor):
1455         (WebCore::Page::setPagination):
1456         (WebCore::Page::setVisitedLinkStore):
1457         * page/PageGroup.cpp:
1458         (WebCore::PageGroup::captionPreferencesChanged):
1459         * page/Settings.cpp:
1460         (WebCore::Settings::setUsesPageCache):
1461         * platform/MemoryPressureHandler.cpp:
1462         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
1463
1464 2015-01-28  Darin Adler  <darin@apple.com>
1465
1466         Fix MediaPlayerEngine leaks
1467         https://bugs.webkit.org/show_bug.cgi?id=140992
1468
1469         Reviewed by Jer Noble.
1470
1471         * platform/graphics/MediaPlayer.cpp:
1472         (WebCore::mutableInstalledMediaEnginesVector): Added.
1473         (WebCore::buildMediaEnginesVector): Added.
1474         (WebCore::installedMediaEngines): Changed this to be a vector of factories
1475         instead of a vector of heap-allocated factories. The old code would leak
1476         all the factories when this was called with the ResetEngines option.
1477         (WebCore::addMediaEngine): Updated for above change.
1478         (WebCore::bestMediaEngineForSupportParameters): Ditto.
1479         (WebCore::nextMediaEngine): Ditto.
1480         (WebCore::MediaPlayer::nextBestMediaEngine): Ditto.
1481         (WebCore::MediaPlayer::loadWithNextMediaEngine): Ditto.
1482         (WebCore::MediaPlayer::supportsType): Ditto.
1483         (WebCore::MediaPlayer::getSupportedTypes): Ditto.
1484         (WebCore::MediaPlayer::getSitesInMediaCache): Ditto.
1485         (WebCore::MediaPlayer::clearMediaCache): Ditto.
1486         (WebCore::MediaPlayer::clearMediaCacheForSite): Ditto.
1487         (WebCore::MediaPlayer::supportsKeySystem): Ditto.
1488         (WebCore::MediaPlayer::resetMediaEngines): Ditto.
1489         * platform/graphics/MediaPlayer.h: Ditto.
1490
1491 2015-01-28  Jeongmin Kim  <jm86.kim@lge.com>
1492
1493         Rename descendentxxx to descendantxxxx in RenderLayerBacking
1494         https://bugs.webkit.org/show_bug.cgi?id=140979
1495
1496         Reviewed by Martin Robinson.
1497
1498         Rename descendentxxx to descendantxxxx in RenderLayerBacking
1499         for matching other variables and function names.
1500
1501         * rendering/RenderLayerBacking.cpp:
1502         (WebCore::RenderLayerBacking::updateConfiguration):
1503         (WebCore::RenderLayerBacking::updateAfterDescendants):
1504         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
1505         (WebCore::RenderLayerBacking::paintsChildren):
1506         (WebCore::descendantLayerPaintsIntoAncestor):
1507         (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
1508         (WebCore::descendentLayerPaintsIntoAncestor): Deleted.
1509         (WebCore::RenderLayerBacking::isPaintDestinationForDescendentLayers): Deleted.
1510
1511 2015-01-27  Chris Dumez  <cdumez@apple.com>
1512
1513         Use a Ref<CachedResourceLoader> in Document instead of a RefPtr
1514         https://bugs.webkit.org/show_bug.cgi?id=140971
1515
1516         Reviewed by Andreas Kling.
1517
1518         Use a Ref<CachedResourceLoader> in Document instead of a RefPtr as it
1519         can never be null. Also have Document::cachedResourceLoader() return a
1520         reference instead of a pointer. This gets rid of a lot of unnecessary
1521         null-checks.
1522
1523 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
1524
1525         More build fixes for newer clang.
1526
1527         Rubber-stamped by Anders Carlsson.
1528
1529         * loader/icon/IconDatabase.h: Added missing override keywords.
1530
1531 2015-01-27  Roger Fong  <roger_fong@apple.com>
1532
1533         WebGL2: Disable various extensions on WebGL2 context that have been promoted to core.
1534         https://bugs.webkit.org/show_bug.cgi?id=140907.
1535         <rdar://problem/19545857>
1536
1537         Reviewed by Brent Fulgham.
1538
1539         * html/canvas/WebGL2RenderingContext.cpp:
1540         (WebCore::WebGL2RenderingContext::getExtension):
1541         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
1542         * html/canvas/WebGL2RenderingContext.h:
1543         * html/canvas/WebGLRenderingContext.cpp:
1544         (WebCore::WebGLRenderingContext::getExtension):
1545         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1546         * html/canvas/WebGLRenderingContext.h:
1547         * html/canvas/WebGLRenderingContextBase.cpp:
1548         (WebCore::WebGLRenderingContextBase::getSupportedExtensions): Deleted.
1549         * html/canvas/WebGLRenderingContextBase.h:
1550         * html/canvas/WebGLRenderingContextBase.idl: 
1551         Remove some extra extension enums that shouldn't have been declared on the context idl.
1552
1553 2015-01-27  Chris Dumez  <cdumez@apple.com>
1554
1555         Remove unnecessary m_cachedPage null-checks in PageCache
1556         https://bugs.webkit.org/show_bug.cgi?id=140965
1557
1558         Reviewed by Andreas Kling.
1559
1560         Remove unnecessary m_cachedPage null-checks in PageCache. We initialize
1561         m_cachedPage when inserting the HistoryItem in the page cache and clear
1562         it when removing it from the page cache. Therefore, it is guaranteed
1563         that HistoryItems currently in the page cache have m_cachedPage
1564         initialized and there is no need to null-check it.
1565
1566         * history/PageCache.cpp:
1567         (WebCore::PageCache::frameCount):
1568         (WebCore::PageCache::markPagesForVistedLinkStyleRecalc):
1569         (WebCore::PageCache::markPagesForFullStyleRecalc):
1570         (WebCore::PageCache::markPagesForDeviceScaleChanged):
1571         (WebCore::PageCache::markPagesForCaptionPreferencesChanged):
1572
1573 2015-01-27  Alexey Proskuryakov  <ap@apple.com>
1574
1575         Some NSAccessibility methods we use are deprecated on 10.10
1576         https://bugs.webkit.org/show_bug.cgi?id=140966
1577
1578         Reviewed by Anders Carlsson.
1579
1580         * accessibility/mac/AccessibilityObjectMac.mm:
1581         (WebCore::AccessibilityObject::overrideAttachmentParent):
1582         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment):
1583         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1584         (-[WebAccessibilityObjectWrapper role]):
1585         (-[WebAccessibilityObjectWrapper roleDescription]):
1586         Silence the warnings for now.
1587
1588 2015-01-27  Chris Dumez  <cdumez@apple.com>
1589
1590         Rename isExpandedShorthand() to isShorthandCSSProperty() for clarity
1591         https://bugs.webkit.org/show_bug.cgi?id=140954
1592
1593         Reviewed by Andreas Kling.
1594
1595         Rename isExpandedShorthand() to isShorthandCSSProperty() for clarity as
1596         all CSS shorthand properties are now expanded during parsing (even
1597         'font').
1598
1599         * css/StylePropertyShorthand.cpp:
1600         (WebCore::isShorthandCSSProperty):
1601         (WebCore::isExpandedShorthand): Deleted.
1602         * css/StylePropertyShorthand.h:
1603         * css/StyleResolver.cpp:
1604         (WebCore::StyleResolver::applyProperty):
1605         * css/makeprop.pl:
1606
1607 2015-01-27  Eric Carlson  <eric.carlson@apple.com>
1608
1609         Simplify http/tests/media/video-play-stall.html
1610         https://bugs.webkit.org/show_bug.cgi?id=140630
1611
1612         Reviewed by Brent Fulgham.
1613
1614         Test: http/tests/media/video-play-waiting.html
1615
1616         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1617         (WebCore::MediaPlayerPrivateAVFoundation::play): Add more logging.
1618         (WebCore::MediaPlayerPrivateAVFoundation::updateStates): MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty
1619             always maps to HaveCurrentData.
1620         (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification): Don't log FunctionType,
1621             doing so it needlessly verbose.
1622         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification): Ditto.
1623         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1624         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Log KVO property 
1625             values and notification state.
1626
1627 2015-01-27  Commit Queue  <commit-queue@webkit.org>
1628
1629         Unreviewed, rolling out r179192.
1630         https://bugs.webkit.org/show_bug.cgi?id=140953
1631
1632         Caused numerous layout test failures (Requested by mattbaker_
1633         on #webkit).
1634
1635         Reverted changeset:
1636
1637         "Use FastMalloc (bmalloc) instead of BlockAllocator for GC
1638         pages"
1639         https://bugs.webkit.org/show_bug.cgi?id=140900
1640         http://trac.webkit.org/changeset/179192
1641
1642 2015-01-27  Benjamin Poulain  <bpoulain@apple.com>
1643
1644         Modernize some constructors of the CSS JIT
1645         https://bugs.webkit.org/show_bug.cgi?id=140903
1646
1647         Reviewed by Darin Adler.
1648
1649         Two constructors were still using the old style.
1650
1651         * cssjit/SelectorCompiler.cpp:
1652         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment): Deleted.
1653         (WebCore::SelectorCompiler::TagNamePattern::TagNamePattern): Deleted.
1654
1655 2015-01-27  Brent Fulgham  <bfulgham@apple.com>
1656
1657         [Win] Unreviewed build fix.
1658
1659         Lack of include guards in WebVTTElement.h caused a build failure once we started including
1660         this header file from more than one implementation file.
1661
1662         * html/track/WebVTTElement.h:
1663
1664 2015-01-26  Sylvain Galineau  <galineau@adobe.com>
1665
1666         CSSKeyframesRule::findRule() and deleteRule() should delete the last matching rule, not the first
1667         https://bugs.webkit.org/show_bug.cgi?id=139732
1668
1669         Reviewed by Dean Jackson and Darin Adler.
1670
1671         No new tests because existing tests have been updated to verify this behavior.
1672
1673         * css/CSSKeyframeRule.h:
1674         (WebCore::StyleKeyframe::getKeys): Deleted.
1675         * css/StyleResolver.cpp:
1676         (WebCore::StyleResolver::keyframeStylesForAnimation): use StyleKeyframe::keys().
1677         * css/CSSKeyframeRule.cpp:
1678         (WebCore::StyleKeyframe::parseKeyString): Deleted. Moved to CSSParser.
1679         (WebCore::StyleKeyframe::keyText): Build keyframe selector from Vector<double> representation.
1680         * css/CSSKeyframeRule.h:
1681         (WebCore::StyleKeyframe::setKeyText): parse keyframe selector into Vector<double>.
1682         (WebCore::StyleKeyframe::keys): Added. Returns vector representation of selector keys.
1683         (WebCore::StyleKeyframe::getKeys): Deleted. Now keys().
1684         * css/CSSKeyframesRule.cpp:
1685         (WebCore::StyleRuleKeyframes::findKeyframeIndex): Return last matching rule.
1686         * css/CSSParser.cpp:
1687         (WebCore::CSSParser::parseKeyframeSelector): Added. Moved from StyleKeyframe.
1688         * css/CSSParser.h:
1689         (WebCore::CSSParser::parseKeyframeSelector): Added. Moved from StyleKeyframe.
1690
1691 2015-01-26  Geoffrey Garen  <ggaren@apple.com>
1692
1693         Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
1694         https://bugs.webkit.org/show_bug.cgi?id=140900
1695
1696         Reviewed by Mark Hahnenberg.
1697
1698         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1699         (WebCore::MemoryPressureHandler::install): Be sure to release other
1700         memory after GC and not before, since GC might contribute to free
1701         malloc pages now.
1702
1703 2015-01-27  Zalan Bujtas  <zalan@apple.com>
1704
1705         Simple line layout: Make FlowContents an iterator class.
1706         https://bugs.webkit.org/show_bug.cgi?id=140909
1707
1708         Reviewed by Antti Koivisto.
1709
1710         This patch transfers content position handling from createLineRuns()/LineState to
1711         FlowContents. FlowContents becomes a real iterator class.
1712         It tightens content and position information so that we can start supporting
1713         no textual content such as <br>.
1714
1715         No change in functionality.
1716
1717         * rendering/SimpleLineLayout.cpp:
1718         (WebCore::SimpleLineLayout::LineState::commitAndCreateRun): Remove redundant committedLogicalRight.
1719         (WebCore::SimpleLineLayout::LineState::addUncommitted): Now that we don't have current
1720         positon in LineState, we need to be able to figure out where we start the uncommitted content.
1721         This is mainly relevant after collapsed whitespace, when we start a new uncommitted segment.
1722         It was previously achieved through LineState::jumpTo().
1723         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
1724         (WebCore::SimpleLineLayout::firstFragment): Return the first fragment for this line.
1725         (WebCore::SimpleLineLayout::createLineRuns): Renaming and removing position handling.
1726         (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns): Renaming.
1727         (WebCore::SimpleLineLayout::createTextRuns):
1728         (WebCore::SimpleLineLayout::LineState::jumpTo): Deleted.
1729         (WebCore::SimpleLineLayout::initializeNewLine): Deleted. : Move overflow fragment functionality
1730         to firstFragment().
1731         * rendering/SimpleLineLayoutFlowContents.cpp:
1732         (WebCore::SimpleLineLayout::FlowContents::nextTextFragment):
1733         * rendering/SimpleLineLayoutFlowContents.h:
1734
1735 2015-01-27  Chris Dumez  <cdumez@apple.com>
1736
1737         HTMLElement.dir should only return known values
1738         https://bugs.webkit.org/show_bug.cgi?id=140925
1739
1740         Reviewed by Darin Adler.
1741
1742         HTMLElement.dir should only return known values according to the HTML
1743         specification:
1744         https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir
1745
1746         Chrome and Firefox 28 match the specification. IE11's behavior is
1747         slightly different:
1748         - When setting an unknown 'dir' value, an exception will be thrown.
1749         - Setting a known 'dir' value in a non-canonical case (e.g. "RTL"),
1750           the value will be directly converted to its canonical form (e.g.
1751           "rtl") before updating the DOM tree. (close to the spec but changing
1752           the case upon setting).
1753
1754         This patch is based on the following Blink revision by me:
1755         https://src.chromium.org/viewvc/blink?view=rev&revision=171861
1756
1757         Test: fast/dom/document-dir-property.html
1758
1759         * html/HTMLDocument.cpp:
1760         (WebCore::HTMLDocument::dir):
1761         (WebCore::HTMLDocument::setDir):
1762         * html/HTMLDocument.h:
1763         * html/HTMLElement.cpp:
1764         (WebCore::toValidDirValue):
1765         (WebCore::HTMLElement::dir):
1766         (WebCore::HTMLElement::setDir):
1767         * html/HTMLElement.h:
1768         * html/HTMLElement.idl:
1769
1770 2015-01-26  Chris Dumez  <cdumez@apple.com>
1771
1772         Introduce Document::body() for call sites interested in the <body> element
1773         https://bugs.webkit.org/show_bug.cgi?id=140920
1774
1775         Reviewed by Darin Adler.
1776
1777         Introduce Document::body() method for call sites interested only in the
1778         document's <body> element (not the <frameset>). Also clean up the call
1779         sites of Document::bodyOrFrameset() to cache the return value when
1780         suitable as this method does a tree traversal.
1781
1782         This patch does not change behavior, it merely ports calls sites that
1783         were calling Document::bodyOrFrameset() then checking if the tag was
1784         <body>, to call Document::body() instead. Doing so is more efficient
1785         and clearer.
1786
1787 2015-01-26  Brent Fulgham  <bfulgham@apple.com>
1788
1789         [Win] ASSERTION FAILED !m_ptr under AccessibilityController::winAddNotificationListener
1790         https://bugs.webkit.org/show_bug.cgi?id=87426
1791         <rdar://problem/11527899>
1792
1793         Reviewed by Darin Adler.
1794
1795         Revise COMPtr to work better with our HashMap implementation:
1796         (1) Add a specialization for IsSmartPtr.
1797         (2) Remove PtrHash specialization.
1798         (3) Refresh HashTrails specialization for COMPtr to match what we
1799         do for RefPtr.
1800
1801         * platform/win/COMPtr.h:
1802
1803 2015-01-26  Sylvain Galineau  <galineau@adobe.com>
1804
1805         The computed value of line-height:normal is incorrect
1806         https://bugs.webkit.org/show_bug.cgi?id=133744
1807
1808         Reviewed by Dean Jackson.
1809
1810         Use font's line spacing as computed line-height value when specified value is 'normal'.
1811         This behavior is compatible with all other engines.
1812
1813         No new tests; all existing tests are updated to reflect the new computed value.
1814
1815         * css/CSSComputedStyleDeclaration.cpp:
1816         (WebCore::lineHeightFromStyle): If line-height wasn't set, use the font's line spacing (same as Blink).
1817
1818 2015-01-26  Chris Dumez  <cdumez@apple.com>
1819
1820         Document.dir should reflect the 'dir' attribute of the root html element
1821         https://bugs.webkit.org/show_bug.cgi?id=140922
1822
1823         Reviewed by Darin Adler.
1824
1825         Document.dir should reflect the 'dir' content attribute of the root
1826         <html> element as per the specification:
1827         https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir
1828
1829         Previously, WebKit was reflecting the 'dir' content attribute of the
1830         body element. This patch aligns WebKit with the specification and the
1831         behavior of other browsers (tested Firefox 28, IE11 and Chrome).
1832
1833         This patch is based on the following Blink revision by me:
1834         https://src.chromium.org/viewvc/blink?revision=171734&view=revision
1835
1836         Test: fast/dom/document-dir-property.html
1837
1838         * html/HTMLDocument.cpp:
1839         (WebCore::HTMLDocument::dir):
1840         (WebCore::HTMLDocument::setDir):
1841         * html/HTMLDocument.h:
1842
1843 2015-01-26  Darin Adler  <darin@apple.com>
1844
1845         REGRESSION (r179101): SVGUseElement::expandUseElementsInShadowTree has an object lifetime mistake
1846         https://bugs.webkit.org/show_bug.cgi?id=140921
1847
1848         Reviewed by Alexey Proskuryakov.
1849
1850         Bug found by running regression tests with Address Sanitizer.
1851
1852         * svg/SVGUseElement.cpp:
1853         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Use a Ref to protect
1854         the original use element after it's been replaced in the tree; we use it for
1855         one more thing after that.
1856
1857 2015-01-26  Roger Fong  <roger_fong@apple.com>
1858
1859         WebGL 2.0: Actually allow for experimental-webgl2 context creation.
1860         https://bugs.webkit.org/show_bug.cgi?id=140906
1861         <rdar://problem/19606875>.
1862
1863         Reviewed by Brent Fulgham.
1864
1865         * html/HTMLCanvasElement.cpp:
1866         (WebCore::HTMLCanvasElement::is3dType): Include "experimental-webgl2" in the list of acceptable 3d context types.
1867
1868 2015-01-26  Chris Dumez  <cdumez@apple.com>
1869
1870         Rename Document::body() to Document::bodyOrFrameset() for clarity
1871         https://bugs.webkit.org/show_bug.cgi?id=140902
1872
1873         Reviewed by Andreas Kling.
1874
1875         Rename Document::body() to Document::bodyOrFrameset() for clarity. This
1876         method does not necessarily return an HTMLBodyElement, it can also
1877         return a frameset as per the specification:
1878         http://www.w3.org/TR/html5/dom.html#dom-tree-accessors
1879
1880         This method is often misused internally (the caller is only interested
1881         in the <body> element). I will fix these instances in a follow-up patch,
1882         this patch is only renaming mechanically.
1883
1884 2015-01-26  Byungseon Shin  <sun.shin@lge.com>
1885
1886         Fix Border-radius clipping issue on a composited descendants
1887         https://bugs.webkit.org/show_bug.cgi?id=138551 
1888
1889         Reviewed by Simon Fraser.
1890
1891         Fix assertion in RenderLayerBacking::paintIntoLayer
1892         by not checking out of sync with the GraphicsLayer heirarchy
1893         in GraphicsLayerPaintChildClippingMask phase.
1894
1895         Test: compositing/clipping/border-radius-overflow-hidden-stacking-context.html
1896
1897         * rendering/RenderLayerBacking.cpp:
1898         (WebCore::RenderLayerBacking::paintIntoLayer):
1899
1900 2015-01-26  Chris Dumez  <cdumez@apple.com>
1901
1902         Simplify RenderElement's shouldRepaintForImageAnimation()
1903         https://bugs.webkit.org/show_bug.cgi?id=140890
1904
1905         Reviewed by Darin Adler.
1906
1907         Simplify RenderElement's shouldRepaintForImageAnimation() by
1908         not calling rendererForRootBackground(). The previous code was
1909         doing a null-check on Document::documentElement() but failing
1910         to do a null-check on the renderer just after, which lead me
1911         to refactor this code.
1912
1913         Instead of calling document().documentElement.renderer(), we
1914         now call renderer.parent(). This is equivalent because we already
1915         know that renderer.isBody() returns true. The parent of the <body>
1916         has to be the <html> element, which has to be the documentElement.
1917         There is also no need to do a null-check on renderer.parent(). We
1918         already know that the <body> has a renderer (because |renderer| is
1919         its renderer), thus its parent <html> element has to have a renderer
1920         as well.
1921
1922         Finally, simply call !rootElement.hasBackground() instead of
1923         rootElement.rendererForRootBackground() == &bodyRenderer to determine
1924         if the background painted by the root. This is equivalent but more
1925         efficient because:
1926         - We already know that the root renderer's is an <html> element. We
1927           can thus avoid the check in rendererForRootBackground().
1928         - We already have the <body>'s renderer so we don't need to do the
1929           DOM tree traversal in rendererForRootBackground() to get it.
1930
1931         No new tests, already covered by:
1932         fast/images/animated-gif-body-delegated-background-image.html
1933         fast/images/animated-gif-html-background-image.html
1934
1935         * rendering/RenderElement.cpp:
1936         (WebCore::shouldRepaintForImageAnimation):
1937
1938 2015-01-26  Chris Dumez  <cdumez@apple.com>
1939
1940         First argument to DOM traversal functions should be a reference
1941         https://bugs.webkit.org/show_bug.cgi?id=140895
1942
1943         Reviewed by Antti Koivisto.
1944
1945         First argument to DOM traversal functions should be a reference instead
1946         of a pointer as it is dereferenced without null-check.
1947
1948 2015-01-26  Roger Fong  <roger_fong@apple.com>
1949
1950         [WebGL2] Update IDL for WebGL2.
1951         https://bugs.webkit.org/show_bug.cgi?id=126406
1952         <rdar://problem/15002268>.
1953
1954         Reviewed by Brent Fulgham.
1955
1956         Update WebGL2RenderingContext idl to match spec. Create method stubs as necessary.
1957
1958         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1959         (WebCore::JSWebGL2RenderingContext::getFramebufferAttachmentParameter):
1960         (WebCore::JSWebGL2RenderingContext::getInternalformatParameter):
1961         (WebCore::JSWebGL2RenderingContext::getQueryParameter):
1962         (WebCore::JSWebGL2RenderingContext::getSamplerParameter):
1963         (WebCore::JSWebGL2RenderingContext::getSyncParameter):
1964         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
1965         (WebCore::JSWebGL2RenderingContext::getActiveUniformBlockParameter):
1966         (WebCore::JSWebGL2RenderingContext::getActiveUniformBlockName):
1967         * html/canvas/WebGL2RenderingContext.cpp:
1968         (WebCore::WebGL2RenderingContext::copyBufferSubData):
1969         (WebCore::WebGL2RenderingContext::getBufferSubData):
1970         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
1971         (WebCore::WebGL2RenderingContext::blitFramebuffer):
1972         (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
1973         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
1974         (WebCore::WebGL2RenderingContext::invalidateFramebuffer):
1975         (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer):
1976         (WebCore::WebGL2RenderingContext::readBuffer):
1977         (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
1978         (WebCore::WebGL2RenderingContext::texStorage2D):
1979         (WebCore::WebGL2RenderingContext::texStorage3D):
1980         (WebCore::WebGL2RenderingContext::texImage3D):
1981         (WebCore::WebGL2RenderingContext::texSubImage3D):
1982         (WebCore::WebGL2RenderingContext::copyTexSubImage3D):
1983         (WebCore::WebGL2RenderingContext::compressedTexImage3D):
1984         (WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
1985         (WebCore::WebGL2RenderingContext::getFragDataLocation):
1986         (WebCore::WebGL2RenderingContext::uniform1ui):
1987         (WebCore::WebGL2RenderingContext::uniform2ui):
1988         (WebCore::WebGL2RenderingContext::uniform3ui):
1989         (WebCore::WebGL2RenderingContext::uniform4ui):
1990         (WebCore::WebGL2RenderingContext::uniform1uiv):
1991         (WebCore::WebGL2RenderingContext::uniform2uiv):
1992         (WebCore::WebGL2RenderingContext::uniform3uiv):
1993         (WebCore::WebGL2RenderingContext::uniform4uiv):
1994         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
1995         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
1996         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
1997         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
1998         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
1999         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
2000         (WebCore::WebGL2RenderingContext::vertexAttribI4i):
2001         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
2002         (WebCore::WebGL2RenderingContext::vertexAttribI4ui):
2003         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
2004         (WebCore::WebGL2RenderingContext::vertexAttribIPointer):
2005         (WebCore::WebGL2RenderingContext::vertexAttribDivisor):
2006         (WebCore::WebGL2RenderingContext::drawArraysInstanced):
2007         (WebCore::WebGL2RenderingContext::drawElementsInstanced):
2008         (WebCore::WebGL2RenderingContext::drawRangeElements):
2009         (WebCore::WebGL2RenderingContext::drawBuffers):
2010         (WebCore::WebGL2RenderingContext::clearBufferiv):
2011         (WebCore::WebGL2RenderingContext::clearBufferuiv):
2012         (WebCore::WebGL2RenderingContext::clearBufferfv):
2013         (WebCore::WebGL2RenderingContext::clearBufferfi):
2014         (WebCore::WebGL2RenderingContext::createQuery):
2015         (WebCore::WebGL2RenderingContext::deleteQuery):
2016         (WebCore::WebGL2RenderingContext::isQuery):
2017         (WebCore::WebGL2RenderingContext::beginQuery):
2018         (WebCore::WebGL2RenderingContext::endQuery):
2019         (WebCore::WebGL2RenderingContext::getQuery):
2020         (WebCore::WebGL2RenderingContext::getQueryParameter):
2021         (WebCore::WebGL2RenderingContext::createSampler):
2022         (WebCore::WebGL2RenderingContext::deleteSampler):
2023         (WebCore::WebGL2RenderingContext::isSampler):
2024         (WebCore::WebGL2RenderingContext::bindSampler):
2025         (WebCore::WebGL2RenderingContext::samplerParameteri):
2026         (WebCore::WebGL2RenderingContext::samplerParameterf):
2027         (WebCore::WebGL2RenderingContext::getSamplerParameter):
2028         (WebCore::WebGL2RenderingContext::fenceSync):
2029         (WebCore::WebGL2RenderingContext::isSync):
2030         (WebCore::WebGL2RenderingContext::deleteSync):
2031         (WebCore::WebGL2RenderingContext::clientWaitSync):
2032         (WebCore::WebGL2RenderingContext::waitSync):
2033         (WebCore::WebGL2RenderingContext::getSyncParameter):
2034         (WebCore::WebGL2RenderingContext::createTransformFeedback):
2035         (WebCore::WebGL2RenderingContext::deleteTransformFeedback):
2036         (WebCore::WebGL2RenderingContext::isTransformFeedback):
2037         (WebCore::WebGL2RenderingContext::bindTransformFeedback):
2038         (WebCore::WebGL2RenderingContext::beginTransformFeedback):
2039         (WebCore::WebGL2RenderingContext::endTransformFeedback):
2040         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
2041         (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
2042         (WebCore::WebGL2RenderingContext::pauseTransformFeedback):
2043         (WebCore::WebGL2RenderingContext::resumeTransformFeedback):
2044         (WebCore::WebGL2RenderingContext::bindBufferBase):
2045         (WebCore::WebGL2RenderingContext::bindBufferRange):
2046         (WebCore::WebGL2RenderingContext::getIndexedParameter):
2047         (WebCore::WebGL2RenderingContext::getUniformIndices):
2048         (WebCore::WebGL2RenderingContext::getActiveUniforms):
2049         (WebCore::WebGL2RenderingContext::getUniformBlockIndex):
2050         (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
2051         (WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
2052         (WebCore::WebGL2RenderingContext::uniformBlockBinding):
2053         (WebCore::WebGL2RenderingContext::createVertexArray):
2054         (WebCore::WebGL2RenderingContext::deleteVertexArray):
2055         (WebCore::WebGL2RenderingContext::isVertexArray):
2056         (WebCore::WebGL2RenderingContext::bindVertexArray):
2057         * html/canvas/WebGL2RenderingContext.h:
2058         * html/canvas/WebGL2RenderingContext.idl:
2059         * platform/graphics/GraphicsTypes3D.h:
2060
2061 2015-01-26  Andreas Kling  <akling@apple.com>
2062
2063         Don't let the CSSValuePool's font family cache grow unbounded.
2064         <https://webkit.org/b/140894>
2065
2066         Reviewed by Chris Dumez.
2067
2068         Darin pointed out to Chris who pointed out to me that the font family cache
2069         in CSSValuePool can grow unbounded until we get a system memory pressure
2070         notification. Put a limit on it like we did with the font face cache.
2071
2072         * css/CSSValuePool.cpp:
2073         (WebCore::CSSValuePool::createFontFamilyValue):
2074
2075 2015-01-26  Andreas Kling  <akling@apple.com>
2076
2077         Plug leak in jsValueWithDictionaryInContext().
2078         <https://webkit.org/b/140889>
2079
2080         Reviewed by Alexey Proskuryakov.
2081
2082         Add a missing JSStringRelease to plug leak that was showing up on leaks bot.
2083
2084         * platform/mac/SerializedPlatformRepresentationMac.mm:
2085         (WebCore::jsValueWithDictionaryInContext):
2086
2087 2015-01-26  Benjamin Poulain  <benjamin@webkit.org>
2088
2089         Fix CSS Selector's tag name matching when mixing HTML and XML
2090         https://bugs.webkit.org/show_bug.cgi?id=140878
2091
2092         Reviewed by Darin Adler.
2093
2094         Previsouly, WebKit was unable to match any XML element that had
2095         any uppercase character if the stylesheet was in a HTML document.
2096         This problem was most often reported due to the inability to style
2097         SVG-in-HTML.
2098
2099         The reason was that the tag local name was incorrectly transformed
2100         to lowercase at parsing time. Instead, we are supposed to only
2101         do case-insensitive match for HTML elements in a HTML document.
2102
2103         This fix is very similar with how we handle attributes:
2104         -Keep both the original and the lowercase versions of the name.
2105         -When matching, chose which version to use depending on the element being matched.
2106
2107         There is one major difference in the way the names are stored.
2108         Unlike attribute selectors, tag name selectors are common, and the uppercase
2109         version is not that uncommon. I wanted to preserve the dense representation
2110         so I specialized CSSSelector specifically for tag names.
2111
2112         To store the data, if the name is already lowercase, just use the m_data pointer
2113         as usual.
2114         If the name is not lowercase, allocate a new small structure in the union to store
2115         both names.
2116
2117         Tests: fast/css/tagname-and-namespace-case-sensitivity-xml-in-html.html
2118                fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml-expected.xhtml
2119                fast/css/tagname-and-namespace-case-sensitivity-xml-in-xhtml.xhtml
2120                fast/css/tagname-case-sensitivity-svg-in-html.html
2121                fast/css/tagname-case-sensitivity-svg-in-xhtml-expected.xhtml
2122                fast/css/tagname-case-sensitivity-svg-in-xhtml.xhtml
2123                fast/css/tagname-case-sensitivity-xml-in-html.html
2124                fast/css/tagname-case-sensitivity-xml-in-xhtml-expected.xhtml
2125                fast/css/tagname-case-sensitivity-xml-in-xhtml.xhtml
2126                fast/selectors/element-closest-tagname-case-sensitivity-svg-in-html.html
2127                fast/selectors/element-closest-tagname-case-sensitivity-svg-in-xhtml.xhtml
2128                fast/selectors/element-matches-tagname-case-sensitivity-svg-in-html.html
2129                fast/selectors/element-matches-tagname-case-sensitivity-svg-in-xhtml.xhtml
2130                fast/selectors/querySelector-tagname-case-sensitivity-svg-in-html.html
2131                fast/selectors/querySelector-tagname-case-sensitivity-svg-in-xhtml.xhtml
2132                fast/selectors/querySelector-tagname-case-sensitivity-xml-in-html.html
2133                fast/selectors/querySelector-tagname-case-sensitivity-xml-in-xhtml.xhtml
2134                fast/selectors/tagname-adjacent-backtracking-case-sensitivity-html.html
2135                fast/selectors/tagname-descendant-backtracking-case-sensitivity-html.html
2136
2137         * css/CSSGrammar.y.in:
2138         The parser is unaware of anything case related. CSSSelector takes care of that.
2139
2140         * css/CSSSelector.cpp:
2141         (WebCore::CSSSelector::CSSSelector):
2142         (WebCore::CSSSelector::createRareData):
2143         * css/CSSSelector.h:
2144         (WebCore::CSSSelector::NameWithCase::NameWithCase):
2145         (WebCore::CSSSelector::CSSSelector):
2146         (WebCore::CSSSelector::~CSSSelector):
2147         (WebCore::CSSSelector::tagQName):
2148         (WebCore::CSSSelector::tagLowercaseLocalName):
2149         The new representation stores both the original form and the lower case
2150         form.
2151
2152         * css/RuleSet.cpp:
2153         (WebCore::RuleSet::addRule):
2154         (WebCore::RuleSet::shrinkToFit):
2155         * css/RuleSet.h:
2156         (WebCore::RuleSet::tagRules):
2157         * css/ElementRuleCollector.cpp:
2158         (WebCore::ElementRuleCollector::collectMatchingRules):
2159         The tag name partition is now split in two: lowercase and original case.
2160         If the matched element is HTML, the lowercase partition is used. 
2161
2162         * css/SelectorFilter.cpp:
2163         (WebCore::collectElementIdentifierHashes):
2164         (WebCore::collectDescendantSelectorIdentifierHashes):
2165         This is the most annoying part of the patch performance wise:
2166         the bloom filter knows the case of the real elements but it cannot know
2167         how selectors will match them.
2168
2169         To make it work, all names are now converted to lowercase.
2170         That implies that we can filter less on XML and we may have to pay for
2171         converting the tag name to lowercase.
2172
2173         I expect the performance hit to be small because:
2174         -Having two XML elements with the same name but different case is uncommon.
2175         -Most elements use lowercase names.
2176
2177         Still sad...that's the price to pay for correctness.
2178
2179         * css/SelectorChecker.cpp:
2180         (WebCore::tagMatches):
2181         (WebCore::SelectorChecker::checkOne):
2182         * css/SelectorChecker.h:
2183         (WebCore::SelectorChecker::tagMatches): Deleted.
2184         Update the legacy matcher, nothing special.
2185
2186         * cssjit/SelectorCompiler.cpp:
2187         (WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
2188         (WebCore::SelectorCompiler::TagNamePattern::TagNamePattern):
2189         (WebCore::SelectorCompiler::constructFragmentsInternal):
2190         (WebCore::SelectorCompiler::equalTagNames):
2191         (WebCore::SelectorCompiler::equalTagNamePatterns):
2192         (WebCore::SelectorCompiler::computeBacktrackingStartOffsetInChain):
2193         (WebCore::SelectorCompiler::computeBacktrackingHeightFromDescendant):
2194         (WebCore::SelectorCompiler::computeBacktrackingWidthFromIndirectAdjacent):
2195         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2196         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
2197         Tag names are used to optimize backtracking; this is quite common for descendant
2198         (e.g. div > ul > li).
2199         We have to differenciate one new case there: if two tag names are equal
2200         when compared case-insensitively but strictly different, they may still
2201         be equal if they don't match the same kind of elements or both matches
2202         and HTML element.
2203
2204         * dom/SelectorQuery.cpp:
2205         (WebCore::localNameMatches):
2206         (WebCore::elementsForLocalName):
2207         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
2208         Update the inline versions of SelectorQuery.
2209
2210 2015-01-26  Chris Dumez  <cdumez@apple.com>
2211
2212         Use std::forward() instead of WTF::move() in CSSPrimitiveValue::create(T&& value)
2213         https://bugs.webkit.org/show_bug.cgi?id=140891
2214
2215         Reviewed by Anders Carlsson.
2216
2217         Use std::forward() instead of WTF::move() in CSSPrimitiveValue::create(T&& value)
2218         to make sure the argument is not unexpectedly moved when it shouldn't (like I
2219         experienced yesterday in Bug 140577):
2220         <http://trac.webkit.org/changeset/179105>
2221
2222         * css/CSSPrimitiveValue.h:
2223         (WebCore::CSSPrimitiveValue::create):
2224         * css/CSSValuePool.h:
2225         (WebCore::CSSValuePool::createValue):
2226
2227 2015-01-26  Beth Dakin  <bdakin@apple.com>
2228
2229         Blacklist iBooks for WebKit's default immediate actions
2230         https://bugs.webkit.org/show_bug.cgi?id=140854
2231         -and corresponding-
2232         rdar://problem/19489518
2233
2234         Reviewed by Tim Horton.
2235
2236         Add a runtime check for iBooks.
2237         * WebCore.exp.in:
2238         * platform/RuntimeApplicationChecks.cpp:
2239         (WebCore::applicationIsIBooks):
2240         * platform/RuntimeApplicationChecks.h:
2241
2242 2015-01-26  Myles C. Maxfield  <mmaxfield@apple.com>
2243
2244         [iOS] [SVG -> OTF Converter] Flip the switch off on iOS
2245         https://bugs.webkit.org/show_bug.cgi?id=140860
2246
2247         Reviewed by Darin Adler.
2248
2249         No new tests because this simply reverts broken code.
2250
2251         The fonts it makes are grotesque. (See what I did there? Typographic
2252         humor is the best humor.)
2253
2254         * Configurations/FeatureDefines.xcconfig:
2255
2256 2015-01-26  Chris Dumez  <cdumez@apple.com>
2257
2258         Demote 'line-height' to a low priority property.
2259         https://bugs.webkit.org/show_bug.cgi?id=140817
2260
2261         Reviewed by Andreas Kling.
2262
2263         Our special handling of the 'line-height' property is no longer
2264         required, since the 'font' shorthand is now expanded in the parser
2265         in all cases (also for system fonts).
2266
2267         This patch is based on the following Blink revision:
2268         https://src.chromium.org/viewvc/blink?revision=184629&view=revision
2269
2270         No new tests, already covered by:
2271         fast/css/font-shorthand-line-height.html
2272         fast/css/line-height-font-order.html
2273
2274         * css/CSSPropertyNames.in:
2275         * css/StyleResolver.cpp:
2276         (WebCore::StyleResolver::styleForKeyframe):
2277         (WebCore::StyleResolver::styleForPage):
2278         (WebCore::StyleResolver::applyMatchedProperties):
2279         (WebCore::StyleResolver::initializeFontStyle):
2280         (WebCore::StyleResolver::CascadedProperties::Property::apply):
2281         * css/StyleResolver.h:
2282         (WebCore::StyleResolver::State::State):
2283         (WebCore::StyleResolver::State::setLineHeightValue): Deleted.
2284         (WebCore::StyleResolver::State::lineHeightValue): Deleted.
2285
2286 2015-01-26  Michael Catanzaro  <mcatanzaro@igalia.com>
2287
2288         [GTK] gtkdoc does not appear in DevHelp
2289         https://bugs.webkit.org/show_bug.cgi?id=139369
2290
2291         Reviewed by Philippe Normand.
2292
2293         * PlatformGTK.cmake: Include the API version in the gtkdoc filenames.
2294
2295 2015-01-25  Chris Dumez  <cdumez@apple.com>
2296
2297         Remove 'font' shorthand property special casing
2298         https://bugs.webkit.org/show_bug.cgi?id=140577
2299
2300         Reviewed by Darin Adler.
2301
2302         Mark CSSPrimitiveValue::m_value.fontFamily as const as it is not
2303         supposed to change. This also makes sure that m_value.fontFamily
2304         gets copied instead of moved when constructing a clone in
2305         CSSPrimitiveValue::cloneForCSSOM(). This was causing several tests
2306         to fail on the bots.
2307
2308         * css/CSSPrimitiveValue.h:
2309
2310 2015-01-25  Alexey Proskuryakov  <ap@apple.com>
2311
2312         Setting HTMLMarqueeElement.trueSpeed doesn't work
2313         https://bugs.webkit.org/show_bug.cgi?id=140863
2314
2315         Reviewed by Darin Adler.
2316
2317         Test: fast/html/marquee-set-truespeed.html
2318
2319         * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::minimumDelay):
2320         Check the boolean attribute properly - an empty value is true.
2321
2322 2015-01-25  Darin Adler  <darin@apple.com>
2323
2324         Streamline SVGUseElement shadow tree handling and make it use SVGElementInstance less
2325         https://bugs.webkit.org/show_bug.cgi?id=140875
2326
2327         Reviewed by Anders Carlsson.
2328
2329         Refactoring of code that is pretty well covered by existing tests, so
2330         not adding new tests.
2331
2332         Inspired by work Rob Buis did in Blink:
2333
2334             http://src.chromium.org/viewvc/blink?view=revision&revision=173273
2335
2336         Althgouh that is less than half of what ended up in this patch.
2337
2338         * dom/ContainerNode.h: Fixed NoEventDispatchAssertion so it can be
2339         copied without causing an underflow of NoEventDispatchAssertion::s_count.
2340         Made the copy constructor call the default constructor. Also changed it
2341         to be based on ASSERT_DISABLED rather than NDEBUG and tweaked it a bit.
2342
2343         * dom/ElementIteratorAssertions.h: Removed an unnecessary include and
2344         an unnecessary default constructor. Changed to use WTF::Optional instead
2345         of WTF::OwnPtr to handle NoEventDispatchAssertion, which makes this class
2346         copyable and assignable, which in turn makes the iterators based on this
2347         copyable and assignable, which is what I needed in SVGUseElement code.
2348         Also simplified code in a couple places.
2349
2350         * dom/TypedElementDescendantIterator.h:
2351         (WebCore::TypedElementDescendantIteratorAdapter<ElementType>::from):
2352         Fixed an error where the arguments to Traversal::next were passed backwards.
2353         This led to incomplete iteration in SVGUseElement code, and an immediate
2354         assertion failure. Probably could use some unit test coverage, too.
2355         (WebCore::TypedElementDescendantConstIteratorAdapter<ElementType>::from):
2356         Ditto.
2357
2358         * svg/SVGUseElement.cpp:
2359         (WebCore::SVGUseElement::animatedInstanceRoot): Deleted.
2360         (WebCore::SVGUseElement::transferSizeAttributesToShadowTreeTargetClone):
2361         Removed the originalElement argument, since we can use the correspondingElement
2362         to get back to it. Removed the useElement argument and changed this into a
2363         member function.
2364         (WebCore::SVGUseElement::svgAttributeChanged): Updated for above changes.
2365         (WebCore::subtreeContainsDisallowedElement): Deleted this function, because
2366         it was only used to optimize by not calling removeDisallowedElementsFromSubtree,
2367         but that function is already similarly efficient when called to do nothing, so
2368         the preflight was not useful.
2369         (WebCore::SVGUseElement::clearResourceReferences): Call userAgentShadowRoot
2370         instead of shadowRoot for clarity.
2371         (WebCore::SVGUseElement::buildPendingResource): Pass a reference instead of
2372         a pointer to buildShadowAndInstanceTree, since it's guaranteed to not be null.
2373         (WebCore::SVGUseElement::shadowTreeTargetClone): Added. Returns the SVG element
2374         inside the shadow tree that corresponds to the use element's target.
2375         (WebCore::SVGUseElement::buildShadowAndInstanceTree): Changed argument type
2376         to a reference instead of a pointer. Removed comments explaining why we have
2377         an instance tree, since soon we will not have one. Removed many comments that
2378         simply state the names of the functions they are commenting on and perhaps a tiny
2379         bit more. Changed to not use m_targetElementInstance as much, dealing with the
2380         shadow tree directly instead of through the instance tree.
2381         (WebCore::SVGUseElement::toClipPath): Use shadowTreeTargetClone instead of
2382         getting at the element through m_targetElementInstance.
2383         (WebCore::SVGUseElement::rendererClipChild): Ditto.
2384         (WebCore::removeDisallowedElementsFromSubtree): Removed the inline keyword,
2385         since there's no good reason to inline thif function's body. Improved local
2386         variable names and used a modern for loop. Also moved the comment about why
2387         this function is used here inside the function instead of repeating it at
2388         each call site.
2389         (WebCore::SVGUseElement::buildShadowTree): Changed to take a reference
2390         instead of a pointer. Moved the check to see if the target is disallowed
2391         out of this function and into buildShadowAndInstanceTree, which needs to
2392         handle that failure explicitly. Tightened up the code a bit, using Ref instead
2393         of RefPtr, putting the comment about removeDisallowedElementsFromSubtree into
2394         that function itself, and removing the unneeded subtreeContainsDisallowedElement
2395         check entirely.
2396         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Removed the argument,
2397         getting the shadow tree from the shadowTree function instead. Walk the tree
2398         iteratively instead of recursively, using the descendantsOfType function.
2399         Rearranged and streamlined the logic.
2400         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): Ditto.
2401         (WebCore::SVGUseElement::transferEventListenersToShadowTree): Ditto.
2402         (WebCore::SVGUseElement::transferAttributesToShadowTreeReplacement): Renamed
2403         this to avoid the term "replaced element", which is not a reasonable way to
2404         refer to the <g> element in the shadow tree that replaces the <use> element.
2405         Changed the argument type to SVGGElement to make it harder to misuse this
2406         function by accident, and made the use element be "this" instead of passing
2407         it as an argument.
2408         (WebCore::SVGUseElement::selfHasRelativeLengths): Call hasRelativeLengths
2409         on the target inside the shadow tree rather than the original target, which
2410         makes more sense anyway, and is straightforward now that we have the
2411         shadowTreeTargetClone function. Removes use of m_targetElementInstance here.
2412
2413         * svg/SVGUseElement.h: Updated for above changes.
2414
2415         * svg/SVGUseElement.idl: Removed animatedInstanceRoot and tweaked formatting.
2416
2417 2015-01-25  Chris Dumez  <cdumez@apple.com>
2418
2419         Remove 'font' shorthand property special casing
2420         https://bugs.webkit.org/show_bug.cgi?id=140577
2421
2422         Reviewed by Darin Adler.
2423
2424         Expand system font values during 'font' property parsing. The 'font'
2425         CSS property was the only shorthand that wasn't always expanded in
2426         the CSS parser, so it needed a lot of special handling that we can
2427         now get rid of.
2428
2429         This patch is inspired from the following Blink revision:
2430         https://src.chromium.org/viewvc/blink?view=rev&revision=184449
2431
2432         Tests:
2433         - fast/css/css2-system-fonts.html (existing)
2434         - fast/css/CSSPrimitiveValue-font-family-primitiveType.html (new)
2435         - fast/css/font-systemFontID-parsing.html (new)
2436         - fast/css/font-shorthand-line-height.html (rebased)
2437
2438         * WebCore.xcodeproj/project.pbxproj:
2439         * css/CSSCalculationValue.cpp:
2440         (WebCore::hasDoubleValue):
2441         Handle CSS_FONT_FAMILY similarly to CSS_STRING in the switch.
2442
2443         * css/CSSFontFamily.h: Added.
2444         Introduce new CSSFontFamily class to store font families inside
2445         CSSPrimitive, instead of using a simple String as previously. We need
2446         an additional 'fromSystemFontID' flag in addition to the font family
2447         name now that system font ID are expanded during parsing. This
2448         information is needed later on by the StyleBuilder (see comment below).
2449
2450         * css/CSSFontSelector.cpp:
2451         (WebCore::CSSFontSelector::addFontFaceRule):
2452         Update code dealing with font family CSSPrimitiveValues now that they
2453         hold a CSSFontFamily internally instead of a String.
2454
2455         * css/CSSParser.cpp:
2456         (WebCore::CSSParser::parseValue):
2457         (WebCore::CSSParser::parseSystemFont):
2458         Expand system font values for the 'font' property by asking the
2459         RenderTheme for the system font and using it to set the 'font'
2460         longhand properties.
2461
2462         * css/CSSParserValues.cpp:
2463         (WebCore::CSSParserValue::createCSSValue):
2464         Handle CSS_FONT_FAMILY value in the switch.
2465
2466         * css/CSSPrimitiveValue.cpp:
2467         (WebCore::CSSPrimitiveValue::primitiveType):
2468         Make sure we still expose font family CSSPrimitiveValues to the Web as
2469         CSS_STRING, even though we are using a slightly different representation
2470         internally. This is so that we don't change web-exposed behavior and I
2471         added a new layout test to cover this.
2472
2473         (WebCore::isValidCSSUnitTypeForDoubleConversion):
2474         (WebCore::CSSPrimitiveValue::cleanup):
2475         (WebCore::CSSPrimitiveValue::getStringValue):
2476         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
2477         (WebCore::CSSPrimitiveValue::cloneForCSSOM):
2478         (WebCore::CSSPrimitiveValue::equals):
2479         Handle CSS_FONT_FAMILY type in switches.
2480
2481         * css/CSSPrimitiveValue.h:
2482         (WebCore::CSSPrimitiveValue::isFontFamily):
2483         Add method to test if a CSSPrimitiveValue holds a CSSFontFamily
2484         internally.
2485
2486         (WebCore::CSSPrimitiveValue::fontFamily):
2487         Add a getter to retrieve the internal CSSFontFamily object if the
2488         primitive type is CSS_FONT_FAMILY.
2489
2490         * css/CSSPropertyNames.in:
2491         Treat 'font' as a regular shorthand property. Specify its longhand
2492         properties so that makeprop.pl can generate the shorthand code for
2493         us. Also demote 'font' to being a low-priority property as it is
2494         now always expanded during parsing.
2495
2496         * css/CSSValuePool.cpp:
2497         (WebCore::CSSValuePool::createFontFamilyValue):
2498         * css/CSSValuePool.h:
2499         * css/StyleBuilderCustom.h:
2500         (WebCore::StyleBuilderCustom::applyValueFontFamily):
2501         - Update the 'font-family' value setter in the StyleBuilder to reflect
2502         the changes in the CSS parser. The CSSPrimitiveValues in the list now
2503         have CSS_FONT_FAMILY type instead of CSS_STRING.
2504         - We also set the 'isGenericFamily' flag if the font-family was expanded
2505           from a system font ID (e.g. caption). The 'isGenericFamily' flag is
2506           used later on to property set the 'isSpecifiedFont' flag on the
2507           FontDescription object. If we don't do this, system font values will
2508           be treated as specified fonts, which means that we will no longer use
2509           the 'use backslash as Yen sign' hack for those. This is covered by the
2510           following layout tests:
2511           - fast/text/backslash-to-yen-sign-euc.html
2512           - editing/selection/find-yensign-and-backslash.html
2513
2514         (WebCore::StyleBuilderCustom::applyInitialFont): Deleted.
2515         (WebCore::StyleBuilderCustom::applyInheritFont): Deleted.
2516         (WebCore::StyleBuilderCustom::applyValueFont): Deleted.
2517         Remove StyleBuilder code dealing with the 'font' property. Now that
2518         the 'font' property is always expanded during parsing, this code can
2519         never be reached.
2520
2521         * css/StylePropertyShorthand.cpp:
2522         (WebCore::isExpandedShorthand):
2523         Stop returning false for 'font' as it is now expanded during parsing
2524         as well. We should probably consider renaming this method to something
2525         else now that all shorthands are expanded, maybe isCSSShorthand() or
2526         isShorthandProperty().
2527
2528         (WebCore::fontShorthand): Deleted.
2529         * css/StylePropertyShorthand.h:
2530         (WebCore::matchingCustomShorthandsForLonghand): Deleted.
2531         Remove custom shorthand code for the 'font' property as it is now
2532         generated by makeprop.pl, like other shorthands.
2533
2534         * css/StyleResolver.cpp:
2535         (WebCore::StyleResolver::applyFont): Deleted.
2536         This is unused now that the StyleBuilder code for 'font' has been
2537         removed.
2538
2539         * css/makeprop.pl:
2540         Remove custom shorthand code for 'font' as it no longer requires any
2541         special handling.
2542
2543 2015-01-25  Timothy Horton  <timothy_horton@apple.com>
2544
2545         Long spins under Frame::rangeForPoint when doing Lookup on feedly.com
2546         https://bugs.webkit.org/show_bug.cgi?id=140862
2547         <rdar://problem/19566089>
2548
2549         Reviewed by Dan Bernstein.
2550
2551         * page/Frame.cpp:
2552         (WebCore::Frame::rangeForPoint):
2553         If there isn't a selectable text node at the given point, rangeForPoint
2554         will eventually return null. However, we can make it fail much faster
2555         by checking the initial position's text-ness and selectability.
2556
2557 2015-01-24  Darin Adler  <darin@apple.com>
2558
2559         Move height/width implementation for use element from RenderSVGViewportContainer to SVGUseElement
2560         https://bugs.webkit.org/show_bug.cgi?id=140826
2561
2562         Reviewed by Anders Carlsson.
2563
2564         Tests: svg/animations/use-animate-width-and-height.html
2565                svg/custom/use-attribute-invalidations.html
2566                svg/custom/use-dynamic-attribute-setting.html
2567
2568         This is an adaptation of work Rob Buis did in Blink:
2569
2570             http://src.chromium.org/viewvc/blink?view=revision&revision=173258
2571
2572         The goal here is to reduce use of SVGElementInstance since we are going to
2573         remove it. The tests Rob added to Blink (which I believe I improved a bit here)
2574         meant we had to fix quite a few bugs in the implementation of the width/height
2575         logic rather than just moving it. Even so, this could use even more test coverage
2576         since there is separate logic for <symbol> and <svg>, three different code paths
2577         (animation/attribute setting, initial creation, and one other), and also
2578         distinct issues for attributes not set at all, attributes set to values that
2579         can't be parsed, and attributes set with different units.
2580
2581         * rendering/svg/RenderSVGViewportContainer.cpp:
2582         (WebCore::RenderSVGViewportContainer::calcViewport): Removed the old logic.
2583
2584         * svg/SVGSVGElement.cpp:
2585         (WebCore::SVGSVGElement::SVGSVGElement): Use ASCIILiteral to more efficiently
2586         create strings from ASCII literals here.
2587         (WebCore::SVGSVGElement::parseAttribute): Default to 100%, not 0, when the
2588         width or height property are either not set or not successfully parsed. Without
2589         this change, one of the SVG tests starts failing.
2590
2591         * svg/SVGUseElement.cpp:
2592         (WebCore::updateWidthAndHeight): Added. The tricky part here is that we have
2593         to copy width and height attributes only if they were successfully parsed, and
2594         also we need to copy the current animating values, not the original attribute
2595         strings. Kind of messy, but I wanted to adapt Rob's solution for the time being,
2596         rather than inventing something new.
2597         (WebCore::SVGUseElement::svgAttributeChanged): Call updateWidthAndHeight.
2598         This is used both when actual attribute changes occur and also when animation
2599         changes the current value.
2600         (WebCore::SVGUseElement::buildShadowAndInstanceTree): Call updateWidthAndHeight.
2601         This is used when the shadow elements are first created.
2602         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Call updateWidthAndHeight.
2603         This was in Rob's patch, but I am not sure we have sufficient test coverage.
2604
2605 2015-01-24  Chris Dumez  <cdumez@apple.com>
2606
2607         Provide implementation for WTF::DefaultHash<bool>
2608         https://bugs.webkit.org/show_bug.cgi?id=140848
2609
2610         Reviewed by Anders Carlsson.
2611
2612         Use HashMap<std::pair<UChar32, bool>> type in Font.cpp for
2613         CharacterFallbackMap instead of HashMap<std::pair<UChar32, unsigned>>.
2614         It builds now that WTF::DefaultHash<bool> is defined in WTF.
2615
2616         * platform/graphics/Font.cpp:
2617         (WebCore::Font::removeFromSystemFallbackCache):
2618
2619 2015-01-23  Brent Fulgham  <bfulgham@apple.com>
2620
2621         [Win] Cursor assignment operator is skipping scale factor
2622         https://bugs.webkit.org/show_bug.cgi?id=140852
2623
2624         Reviewed by Chris Dumez.
2625
2626         Found by fast/events/mouse-cursor-image-set.html
2627
2628         * platform/win/CursorWin.cpp:
2629         (WebCore::Cursor::operator=): Make sure to also assign the
2630         scale factor.
2631
2632 2015-01-23  David Kilzer  <ddkilzer@apple.com>
2633
2634         [iOS] Attempt to fix the build after AVValueTiming.h moved
2635
2636         * platform/spi/ios/AVKitSPI.h: The AVValueTiming.h header moved
2637         to an unexpected location, so work around it by using local SPI
2638         declarations.
2639
2640 2015-01-23  Alexey Proskuryakov  <ap@apple.com>
2641
2642         Try to fix the build after r179056.
2643
2644         * platform/Cursor.h: (WebCore::Cursor::Cursor): Initialize dadat members in correct order.
2645
2646 2015-01-23  Brent Fulgham  <bfulgham@apple.com>
2647
2648         [Win] Cursor copy constructor does not initialize scale factor
2649         https://bugs.webkit.org/show_bug.cgi?id=140849
2650
2651         Reviewed by Antti Koivisto.
2652
2653         Found by fast/events/mouse-cursor-image-set.html
2654
2655         Make sure the scale factor is captured during copy construction. Also make sure
2656         it is properly initialized in the default constructor, since it it used in the
2657         Windows port for some default cursors.
2658
2659         * platform/CursorWin.h:
2660         * platform/win/CursorWin.cpp:
2661         (WebCore::Cursor::Cursor): Make sure copy constructor captures
2662         the scale factor.
2663
2664 2015-01-23  Benjamin Poulain  <bpoulain@apple.com>
2665
2666         Add pointer/hover media queries
2667         https://bugs.webkit.org/show_bug.cgi?id=134822
2668
2669         Reviewed by Antti Koivisto.
2670
2671         Media Queries Level 4 introduces two types of Interaction Media Features:
2672         "pointer" and "hover". Those media features are useful for adapting the design
2673         to the type of input:
2674             http://dev.w3.org/csswg/mediaqueries-4/#mf-interaction
2675
2676         This implementation is trivial: just #ifdef the return value depending on
2677         the support for touch events.
2678         In the future we should move that to a client interface but let's start easy
2679         for now.
2680
2681         Tests: fast/media/mq-any-hover-cssom.html
2682                fast/media/mq-any-hover-invalid.html
2683                fast/media/mq-any-hover-matchMedia.html
2684                fast/media/mq-any-hover-styling.html
2685                fast/media/mq-any-pointer-cssom.html
2686                fast/media/mq-any-pointer-invalid.html
2687                fast/media/mq-any-pointer-matchMedia.html
2688                fast/media/mq-any-pointer-styling.html
2689                fast/media/mq-hover-cssom.html
2690                fast/media/mq-hover-invalid.html
2691                fast/media/mq-hover-matchMedia.html
2692                fast/media/mq-hover-styling.html
2693                fast/media/mq-pointer-cssom.html
2694                fast/media/mq-pointer-invalid.html
2695                fast/media/mq-pointer-matchMedia.html
2696                fast/media/mq-pointer-styling.html
2697
2698         * css/CSSValueKeywords.in:
2699         * css/MediaFeatureNames.h:
2700         * css/MediaQueryEvaluator.cpp:
2701         (WebCore::hoverMediaFeatureEval):
2702         (WebCore::any_hoverMediaFeatureEval):
2703         (WebCore::pointerMediaFeatureEval):
2704         (WebCore::any_pointerMediaFeatureEval):
2705         (WebCore::leastCapablePrimaryPointerDeviceType): Deleted.
2706         * css/MediaQueryExp.cpp:
2707         (WebCore::featureWithCSSValueID):
2708         (WebCore::featureWithZeroOrOne):
2709         (WebCore::featureWithoutValue):
2710         * page/EventHandler.cpp:
2711         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
2712         (WebCore::EventHandler::fakeMouseMoveEventTimerFired):
2713         * page/Settings.in:
2714
2715 2015-01-23  Commit Queue  <commit-queue@webkit.org>
2716
2717         Unreviewed, rolling out r179051.
2718         https://bugs.webkit.org/show_bug.cgi?id=140850
2719
2720         broke the 32-bit build (Requested by thorton on #webkit).
2721
2722         Reverted changeset:
2723
2724         "[Mac][EME] Support ClearKey encryption with AES128-encrypted
2725         HLS"
2726         https://bugs.webkit.org/show_bug.cgi?id=140825
2727         http://trac.webkit.org/changeset/179051
2728
2729 2015-01-23  Joseph Pecoraro  <pecoraro@apple.com>
2730
2731         Web Inspector: Rename InjectedScriptHost::type to subtype
2732         https://bugs.webkit.org/show_bug.cgi?id=140841
2733
2734         Reviewed by Timothy Hatcher.
2735
2736         * inspector/WebInjectedScriptHost.cpp:
2737         (WebCore::WebInjectedScriptHost::subtype):
2738         (WebCore::WebInjectedScriptHost::type): Deleted.
2739         * inspector/WebInjectedScriptHost.h:
2740
2741 2015-01-23  Jer Noble  <jer.noble@apple.com>
2742
2743         [Mac][EME] Support ClearKey encryption with AES128-encrypted HLS
2744         https://bugs.webkit.org/show_bug.cgi?id=140825
2745
2746         Reviewed by Eric Carlson.
2747
2748         Test: http/tests/media/clearkey/clear-key-hls-aes128.html
2749
2750         Add support for ClearKey encryption when used with an AES-128 encrypted HLS stream.
2751
2752         * Modules/encryptedmedia/CDM.cpp:
2753         (WebCore::installedCDMFactories): Add the CDMPrivateClearKey factory.
2754         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
2755         (WebCore::CDMPrivateClearKey::supportsKeySystem): Support the "org.w3c.clearkey" key system.
2756         (WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType): Ditto.
2757         (WebCore::CDMPrivateClearKey::supportsMIMEType): Ditto.
2758         (WebCore::CDMPrivateClearKey::createSession): Create a CDMSessionClearKey.
2759         * Modules/encryptedmedia/CDMPrivateClearKey.h:
2760         (WebCore::CDMPrivateClearKey::create): Simple factory.
2761         (WebCore::CDMPrivateClearKey::~CDMPrivateClearKey): Virtual destructor.
2762         (WebCore::CDMPrivateClearKey::CDMPrivateClearKey): Simple destructor.
2763         * Modules/encryptedmedia/CDMSessionClearKey.cpp: Added.
2764         (WebCore::clearKeyVM): Static method returning the VM to be used by JSON parsing.
2765         (WebCore::CDMSessionClearKey::CDMSessionClearKey): Simple constructor.
2766         (WebCore::CDMSessionClearKey::~CDMSessionClearKey): Simple destructor.
2767         (WebCore::CDMSessionClearKey::generateKeyRequest): Store the initData, ensure that it consists of a UTF8-encoded key
2768             URI, and return same.
2769         (WebCore::CDMSessionClearKey::releaseKeys): Purged all cached keys.
2770         (WebCore::CDMSessionClearKey::update): Parse raw JSON-encoded JWK keys, rejecting non-AES, non-oct keys.
2771         (WebCore::CDMSessionClearKey::cachedKeyForKeyID): Return cached keys.
2772         * Modules/encryptedmedia/CDMSessionClearKey.h:
2773
2774         Add support for the "org.w3c.clearkey" CDM to MediaPlayerPrivateAVFoundationObjC, and do so in a platform-agnostic
2775         way by simply asking for raw key data from MediaPlayerClient when notified that a key has been added.
2776
2777         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2778         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2779         (WebCore::keySystemIsSupported):
2780         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
2781         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
2782         (WebCore::fulfillRequestWithKeyData): Added utility method.
2783         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2784         (WebCore::MediaPlayerPrivateAVFoundationObjC::keyAdded):
2785
2786         Pipe a keyAdded() notification down to MediaPlayer and a cachedKeyForKeyId() request up to CDMSessionClearKey:
2787
2788         * Modules/encryptedmedia/MediaKeySession.cpp:
2789         (WebCore::MediaKeySession::cachedKeyForKeyId):
2790         (WebCore::MediaKeySession::addKeyTimerFired):
2791         * Modules/encryptedmedia/MediaKeySession.h:
2792         * Modules/encryptedmedia/MediaKeys.cpp:
2793         (WebCore::MediaKeys::keyAdded):
2794         (WebCore::MediaKeys::cachedKeyForKeyId):
2795         * Modules/encryptedmedia/MediaKeys.h:
2796         * html/HTMLMediaElement.cpp:
2797         (WebCore::HTMLMediaElement::keyAdded):
2798         * html/HTMLMediaElement.h:
2799         * platform/graphics/CDMSession.h:
2800         (WebCore::CDMSession::cachedKeyForKeyID):
2801         * platform/graphics/MediaPlayer.cpp:
2802         (WebCore::MediaPlayer::keyAdded):
2803         (WebCore::MediaPlayer::cachedKeyForKeyId):
2804         * platform/graphics/MediaPlayer.h:
2805         (WebCore::MediaPlayerClient::mediaPlayerCachedKeyForKeyId):
2806         * platform/graphics/MediaPlayerPrivate.h:
2807         (WebCore::MediaPlayerPrivateInterface::keyAdded):
2808
2809         Add new files to project:
2810
2811         * WebCore.xcodeproj/project.pbxproj:
2812         * CMakeLists.txt:
2813         * WebCore.vcxproj/WebCore.vcxproj:
2814         * WebCore.vcxproj/WebCore.vcxproj.filters:
2815
2816 2015-01-23  Chris Dumez  <cdumez@apple.com>
2817
2818         Implement system fonts FontDescription caching at RenderTheme level
2819         https://bugs.webkit.org/show_bug.cgi?id=140840
2820
2821         Reviewed by Andreas Kling.
2822
2823         Implement system fonts FontDescription caching at RenderTheme level
2824         instead of duplicating the logic in its subclasses for each platform.
2825         This reduces code / logic duplication and reduces the amount of
2826         platform-specific code. This will also make the refactoring at
2827         Bug 140577 a lot easier.
2828
2829         The caching logic remains in RenderThemeIOS class for iOS because:
2830         - It supports different system font values than all other platforms
2831         - It requires cache invalidation in some cases while other platforms
2832           do not.
2833
2834         This patch is inspired by the following Blink revision:
2835         https://src.chromium.org/viewvc/blink?view=rev&revision=184449
2836
2837         Test: fast/css/css2-system-fonts.html
2838
2839 2015-01-23  Zalan Bujtas  <zalan@apple.com>
2840
2841         Simple line layout: Refactor line wrapping logic.
2842         https://bugs.webkit.org/show_bug.cgi?id=140834
2843
2844         Reviewed by Antti Koivisto.
2845
2846         Use a more readable structure to deal with wrapping logic. 
2847
2848         No change in functionality.
2849
2850         * rendering/SimpleLineLayout.cpp:
2851         (WebCore::SimpleLineLayout::createLineRuns):
2852
2853 2015-01-23  Zalan Bujtas  <zalan@apple.com>
2854
2855         Simple line layout: Use only FlowContents::nextTextFragment() to read fragments from the text flow.
2856         https://bugs.webkit.org/show_bug.cgi?id=140842
2857
2858         Reviewed by Antti Koivisto.
2859
2860         This is in preparation to make FlowContents a content iterator class.
2861
2862         No change in functionality.
2863
2864         * rendering/SimpleLineLayout.cpp:
2865         (WebCore::SimpleLineLayout::initializeNewLine):
2866         * rendering/SimpleLineLayoutFlowContents.h:
2867
2868 2015-01-23  Bartlomiej Gajda  <b.gajda@samsung.com>
2869
2870         [MSE] Implement Range Removal algorithm.
2871         https://bugs.webkit.org/show_bug.cgi?id=140622.
2872
2873         Reviewed by Jer Noble.
2874
2875         This extract Range Removal algorithm (Editor's Draft version, bug:26316) from remove(),
2876         to separate function to deal with old FIXME since bug in spec was resolved.
2877         This should both guarantee good order of events, and prevent from switching to 'open' state
2878         during end of stream.
2879
2880         Test: media/media-source/media-source-end-of-stream-readyState.html
2881
2882         * Modules/mediasource/MediaSource.cpp:
2883         (WebCore::MediaSource::setDurationInternal): update to use rangeRemoval(), not remove()
2884         (WebCore::MediaSource::streamEndedWithError): remove FIXME, brigning back correct order of events.
2885         * Modules/mediasource/SourceBuffer.cpp:
2886         (WebCore::SourceBuffer::remove): comments up to spec, extract rangeRemoval algorithm.
2887         (WebCore::SourceBuffer::rangeRemoval):
2888         (WebCore::SourceBuffer::removeTimerFired): comments up to spec.
2889         * Modules/mediasource/SourceBuffer.h:
2890
2891 2015-01-23  Enrica Casucci  <enrica@apple.com>
2892
2893         Hit test returns incorrect results when performed in paginated content over the page gaps.
2894         https://bugs.webkit.org/show_bug.cgi?id=140837
2895         rdar://problem/17494390
2896
2897         Reviewed by Dave Hyatt.
2898
2899         Tests: fast/multicol/pagination/LeftToRight-tb-hittest.html
2900                fast/multicol/pagination/RightToLeft-rl-hittest.html
2901
2902         When hittesting reaches the RenderView we need to check if we are
2903         in paginated content and use the correct class to compute hittest results.
2904
2905         * rendering/RenderView.cpp:
2906         (WebCore::RenderView::updateHitTestResult):
2907
2908 2015-01-23  Andreas Kling  <akling@apple.com>
2909
2910         Document should be a FontSelectorClient.
2911         <https://webkit.org/b/140833>
2912
2913         Reviewed by Antti Koivisto.
2914
2915         Make Document a FontSelectorClient so it can listen to the invalidation
2916         callbacks from FontSelector instead of having code in FontSelector that
2917         calls out to Document on invalidation.
2918
2919         * css/CSSFontSelector.cpp:
2920         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
2921         * dom/Document.cpp:
2922         (WebCore::Document::fontsNeedUpdate):
2923         (WebCore::Document::fontSelector):
2924         (WebCore::Document::clearStyleResolver):
2925         * dom/Document.h:
2926
2927 2015-01-23  Chris Dumez  <cdumez@apple.com>
2928
2929         Leverage CSSValuePool's font family cache in CSSComputedStyleDeclaration
2930         https://bugs.webkit.org/show_bug.cgi?id=140829
2931
2932         Reviewed by Andreas Kling.
2933
2934         Leverage CSSValuePool's font family cache in CSSComputedStyleDeclaration
2935         by calling CSSValuePool::createFontFamilyValue() to create the font
2936         family CSSPrimitiveValue instead of cssValuePool().createValue().
2937
2938         * css/CSSComputedStyleDeclaration.cpp:
2939         (WebCore::valueForFamily):
2940
2941 2015-01-23  Timothy Horton  <timothy_horton@apple.com>
2942
2943         QLPreviewMenuItem popovers don't close when the page scrolls
2944         https://bugs.webkit.org/show_bug.cgi?id=140806
2945         <rdar://problem/19555618>
2946
2947         Reviewed by Beth Dakin.
2948
2949         * platform/spi/mac/QuickLookMacSPI.h:
2950         Add some SPI.
2951
2952 2015-01-23  Andreas Kling  <akling@apple.com>
2953
2954         Hang CSSFontSelector off Document instead of StyleResolver.
2955         <https://webkit.org/b/140820>
2956
2957         Reviewed by Antti Koivisto.
2958
2959         Move the CSSFontSelector from StyleResolver to Document. This is the first
2960         step towards making the CSSFontSelector be able to survive full style recalc.
2961
2962         Clearing a Document's StyleResolver will still nuke the CSSFontSelector,
2963         though that is done in Document::clearStyleResolver() now.
2964
2965         * css/CSSFontSelector.cpp:
2966         (WebCore::CSSFontSelector::CSSFontSelector):
2967         * css/CSSFontSelector.h:
2968
2969             Modernize CSSFontSelector construction a bit by having create() return
2970             a Ref and the constructor take a Document& instead of a Document*.
2971             Also made the constructor explicit.
2972
2973         (WebCore::StyleResolver::~StyleResolver):
2974         * dom/Document.cpp:
2975         (WebCore::Document::clearStyleResolver):
2976
2977             Nuke the current CSSFontSelector in clearStyleResolver() instead of
2978             in ~StyleResolver. It's a minor change, but shows the way forward.
2979             Added a FIXME about how CSSFontSelector should eventually survive
2980             this operation.
2981
2982         (WebCore::Document::fontSelector):
2983         * css/FontLoader.cpp:
2984         (WebCore::FontLoader::loadFont):
2985         (WebCore::FontLoader::checkFont):
2986         (WebCore::FontLoader::resolveFontStyle):
2987         * css/RuleSet.cpp:
2988         (WebCore::RuleSet::addChildRules):
2989         * css/StyleResolver.h:
2990         (WebCore::StyleResolver::fontSelector): Deleted.
2991         * css/StyleResolver.cpp:
2992         (WebCore::StyleResolver::StyleResolver):
2993         (WebCore::StyleResolver::appendAuthorStyleSheets):
2994         (WebCore::StyleResolver::styleForElement):
2995         (WebCore::StyleResolver::defaultStyleForElement):
2996         (WebCore::StyleResolver::updateFont):
2997         * dom/Document.h:
2998         * html/canvas/CanvasRenderingContext2D.cpp:
2999         (WebCore::CanvasRenderingContext2D::setFont):
3000         * rendering/RenderListBox.cpp:
3001         (WebCore::RenderListBox::updateFromElement):
3002         (WebCore::RenderListBox::paintItemForeground):
3003         * rendering/RenderMenuList.cpp:
3004         (RenderMenuList::fontSelector):
3005         * rendering/RenderSearchField.cpp:
3006         (WebCore::RenderSearchField::fontSelector):
3007         * rendering/TextAutoSizing.cpp:
3008         (WebCore::TextAutoSizingValue::adjustNodeSizes):
3009         (WebCore::TextAutoSizingValue::reset):
3010         * rendering/svg/RenderSVGInlineText.cpp:
3011         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
3012         * style/StyleResolveForDocument.cpp:
3013         (WebCore::Style::resolveForDocument):
3014         * style/StyleResolveTree.cpp:
3015         (WebCore::Style::resolveTree):
3016
3017             Move CSSFontSelector ownership from StyleResolver to Document.
3018
3019 2015-01-23  Jer Noble  <jer.noble@apple.com>
3020
3021         Layout Test http/tests/media/track-in-band-hls-metadata.html is flaky
3022         https://bugs.webkit.org/show_bug.cgi?id=140827
3023
3024         Reviewed by Eric Carlson.
3025
3026         Create the m_metadataTrack by calling prepareMetadataTrack() before deref-ing it.
3027
3028         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3029         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3030
3031 2015-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3032
3033         [GTK] Add initial database process support
3034         https://bugs.webkit.org/show_bug.cgi?id=139491
3035
3036         Reviewed by Sergio Villar Senin.
3037
3038         * platform/sql/SQLiteFileSystem.cpp:
3039         (WebCore::SQLiteFileSystem::openDatabase): Use
3040         WebCore::fileSystemRepresentation() for the database filename,
3041         otherwise sqlite3_open() fails when the filename contains "%2E".
3042
3043 2015-01-23  Byeongha Cho  <byeongha.cho@samsung.com>
3044
3045         Initialization for some member variable of FontPlatformData
3046         https://bugs.webkit.org/show_bug.cgi?id=136327
3047
3048         Reviewed by Myles C. Maxfield.
3049
3050         No new tests. There's no functional change.
3051
3052         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3053         (WebCore::FontPlatformData::FontPlatformData):
3054         (WebCore::FontPlatformData::operator=):
3055         (WebCore::FontPlatformData::~FontPlatformData):
3056
3057 2015-01-23  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
3058
3059         Rename ChildNodeRemovalNotifier::m_insertionPoint to m_removalPoint
3060         https://bugs.webkit.org/show_bug.cgi?id=140766
3061
3062         Reviewed by Andreas Kling.
3063
3064         ChildNodeRemovalNotifier::ChildNodeRemovalNotifier(...) should take
3065         a node as removal point.
3066         It's probably Copy/Paste from ChildNodeInsertionNotifier::m_insertionPoint.
3067
3068         No new tests. No behavior change.
3069
3070         * dom/ContainerNodeAlgorithms.h:
3071         (WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier):
3072         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument):
3073         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree):
3074
3075 2015-01-23  Hunseop Jeong  <hs85.jeong@samsung.com>
3076
3077         [GTK] Fix debug build after r178940
3078         https://bugs.webkit.org/show_bug.cgi?id=140814
3079
3080         Reviewed by Carlos Garcia Campos.
3081
3082         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
3083         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
3084
3085 2015-01-22  Zalan Bujtas  <zalan@apple.com>
3086
3087         Simple line layout: Move leading whitespace handling from removeTrailingWhitespace() to initializeNewLine().
3088         https://bugs.webkit.org/show_bug.cgi?id=140757
3089
3090         Reviewed by Antti Koivisto.
3091
3092         Checking if overflowed pre-wrap whitespace needs to be ignored should not be part of the trailing whitespace handling.
3093         Move it to initializeNewLine(). 
3094
3095         No change in functionality.
3096
3097         * rendering/SimpleLineLayout.cpp:
3098         (WebCore::SimpleLineLayout::preWrap):
3099         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
3100         (WebCore::SimpleLineLayout::initializeNewLine):
3101         * rendering/SimpleLineLayoutFlowContents.h:
3102         (WebCore::SimpleLineLayout::FlowContents::isLineBreak):
3103
3104 2015-01-22  Jer Noble  <jer.noble@apple.com>
3105
3106         [iOS] Media controls disappear when loading a HLS live stream
3107         https://bugs.webkit.org/show_bug.cgi?id=140792
3108         rdar://problem/19491658
3109
3110         Reviewed by Dean Jackson.
3111
3112         Overload reconnectControls to reconnect the "start playback" button
3113         if the control type has been set to "StartPlaybackButton".
3114
3115         * Modules/mediacontrols/mediaControlsiOS.js:
3116         (ControllerIOS.prototype.reconnectControls):
3117
3118 2015-01-22  peavo@outlook.com  <peavo@outlook.com>
3119
3120         [Win] No plugin content on some sites.
3121         https://bugs.webkit.org/show_bug.cgi?id=140780
3122
3123         Reviewed by Anders Carlsson.
3124
3125         Return script instance from ScriptController::createScriptInstanceForWidget(),
3126         instead of always returning null.
3127
3128         * bindings/js/ScriptController.cpp:
3129         (WebCore::ScriptController::createScriptInstanceForWidget):
3130         * plugins/PluginViewBase.h:
3131         (WebCore::PluginViewBase::bindingInstance):
3132
3133 2015-01-22  Jer Noble  <jer.noble@apple.com>
3134
3135         [Mac][EME] Adopt changes to AVStreamSession class methods
3136         https://bugs.webkit.org/show_bug.cgi?id=140778
3137         rdar://problem/19458200
3138
3139         Reviewed by Eric Carlson.
3140
3141         AVStreamSession class methods have added a "storageDirectoryAtURL:" parameter so as to be able to
3142         read and modify records stored at non-default storage locations.
3143
3144         * Modules/encryptedmedia/MediaKeySession.cpp:
3145         (WebCore::MediaKeySession::mediaKeysStorageDirectory): Implement client method by querying document and settings.
3146         * Modules/encryptedmedia/MediaKeySession.h:
3147         * platform/graphics/CDMSession.h:
3148         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
3149         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
3150         (WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys): Check whether the AVStreamSession class responds to new selector before calling.
3151         (WebCore::CDMSessionMediaSourceAVFObjC::update): Ditto.
3152         (WebCore::CDMSessionMediaSourceAVFObjC::generateKeyReleaseMessage): Ditto.
3153         (WebCore::CDMSessionMediaSourceAVFObjC::storagePath): Fetch the storage path from the client.
3154
3155 2015-01-22  Michael Saboff  <msaboff@apple.com>
3156
3157         REGRESSION (174847): can't view NHK(Japan's national public broadcasting organization)’s news pages
3158         https://bugs.webkit.org/show_bug.cgi?id=140794
3159
3160         Reviewed by Anders Carlsson.
3161
3162         If a document.open has been set, return it instead of always returning a new,
3163         non-cached instance of jsHTMLDocumentPrototypeFunctionOpen.
3164
3165         Test: js/dom/document-overwrite-open.html
3166
3167         * bindings/js/JSHTMLDocumentCustom.cpp:
3168         (WebCore::JSHTMLDocument::getOwnPropertySlot):
3169
3170 2015-01-22  Zalan Bujtas  <zalan@apple.com>
3171
3172         Simple line layout: Reset LineState when starting a new line.
3173         https://bugs.webkit.org/show_bug.cgi?id=140789
3174
3175         Reviewed by Antti Koivisto.
3176
3177         Reset LineState when starting a new line to ensure we always
3178         start with a clean state.
3179
3180         No change in functionality.
3181
3182         * rendering/SimpleLineLayout.cpp:
3183         (WebCore::SimpleLineLayout::updateLineConstrains):
3184         (WebCore::SimpleLineLayout::initializeNewLine):
3185         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
3186         (WebCore::SimpleLineLayout::createTextRuns):
3187
3188 2015-01-22  Roger Fong  <roger_fong@apple.com>
3189
3190         [WebGL2] Create empty interface files for new WebGL2 objects.
3191         https://bugs.webkit.org/show_bug.cgi?id=140779.
3192         <rdar://problem/15002288>
3193
3194         Reviewed by Dean Jackson.
3195
3196         * CMakeLists.txt:
3197         * DerivedSources.cpp:
3198         * DerivedSources.make:
3199         * WebCore.vcxproj/WebCore.vcxproj:
3200         * WebCore.vcxproj/WebCore.vcxproj.filters:
3201         * WebCore.xcodeproj/project.pbxproj:
3202         * html/canvas/WebGLQuery.cpp: Added.
3203         (WebCore::WebGLQuery::create):
3204         (WebCore::WebGLQuery::~WebGLQuery):
3205         (WebCore::WebGLQuery::WebGLQuery):
3206         (WebCore::WebGLQuery::deleteObjectImpl):
3207         * html/canvas/WebGLQuery.h: Added.
3208         * html/canvas/WebGLQuery.idl: Added.
3209         * html/canvas/WebGLSampler.cpp: Added.
3210         (WebCore::WebGLSampler::create):
3211         (WebCore::WebGLSampler::~WebGLSampler):
3212         (WebCore::WebGLSampler::WebGLSampler):
3213         (WebCore::WebGLSampler::deleteObjectImpl):
3214         * html/canvas/WebGLSampler.h: Added.
3215         * html/canvas/WebGLSampler.idl: Added.
3216         * html/canvas/WebGLSharedObject.h:
3217         (WebCore::WebGLSharedObject::isQuery):
3218         (WebCore::WebGLSharedObject::isSampler):
3219         (WebCore::WebGLSharedObject::isSync):
3220         (WebCore::WebGLSharedObject::isTransformFeedback):
3221         (WebCore::WebGLSharedObject::isVertexArrayObject):
3222         * html/canvas/WebGLSync.cpp: Added.
3223         (WebCore::WebGLSync::create):
3224         (WebCore::WebGLSync::~WebGLSync):
3225         (WebCore::WebGLSync::WebGLSync):
3226         (WebCore::WebGLSync::deleteObjectImpl):
3227         * html/canvas/WebGLSync.h: Added.
3228         * html/canvas/WebGLSync.idl: Added.
3229         * html/canvas/WebGLTransformFeedback.cpp: Added.
3230         (WebCore::WebGLTransformFeedback::create):
3231         (WebCore::WebGLTransformFeedback::~WebGLTransformFeedback):
3232         (WebCore::WebGLTransformFeedback::WebGLTransformFeedback):
3233         (WebCore::WebGLTransformFeedback::deleteObjectImpl):
3234         * html/canvas/WebGLTransformFeedback.h: Added.
3235         * html/canvas/WebGLTransformFeedback.idl: Added.
3236         * html/canvas/WebGLVertexArrayObject.cpp: Added.
3237         (WebCore::WebGLVertexArrayObject::create):
3238         (WebCore::WebGLVertexArrayObject::~WebGLVertexArrayObject):
3239         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
3240         (WebCore::WebGLVertexArrayObject::deleteObjectImpl):
3241         * html/canvas/WebGLVertexArrayObject.h: Added.
3242         * html/canvas/WebGLVertexArrayObject.idl: Added.
3243
3244 2015-01-22  Chris Dumez  <cdumez@apple.com>
3245
3246         Fix remaining multiple targets per rule issues in DerivedSources.make
3247         https://bugs.webkit.org/show_bug.cgi?id=140790
3248
3249         Reviewed by David Kilzer.
3250
3251         Fix remaining multiple target per rule issues in DerivedSources.make,
3252         similarly to Bug 140784 and Bug 140756.
3253
3254         This was causing us to run scripts several times to generate the same
3255         files and may lead to malformed files in case of concurrency.
3256
3257         * DerivedSources.make:
3258
3259 2015-01-22  Ryosuke Niwa  <rniwa@webkit.org>
3260
3261         Add a build flag for ES6 class syntax
3262         https://bugs.webkit.org/show_bug.cgi?id=140760
3263
3264         Reviewed by Michael Saboff.
3265
3266         * Configurations/FeatureDefines.xcconfig:
3267
3268 2015-01-22  Chris Dumez  <cdumez@apple.com>
3269
3270         SVGNames.cpp and HTMLNames.cpp are sometimes malformed
3271         https://bugs.webkit.org/show_bug.cgi?id=140784
3272         <rdar://problem/17701233>
3273
3274         Reviewed by David Kilzer.
3275
3276         Due to bad rules in DerivedSources.make, make_names.pl was called
3277         several times with the same arguments during build. This is because
3278         SVG/HTML/MathML each had several targets associated to the same
3279         command. This would cause the command (make_names.pl) to be called
3280         once per target. However, make_names.pl only needs to be executed
3281         once to generate all of the files currently marked as target.
3282
3283         Calling make_names.pl several times for the same files is not only
3284         wasteful, but it can also lead to malformed generated files if the
3285         scripts instances are executed in parallel as they will read / write
3286         from / to the same files.
3287
3288         This patch uses INTERMEDIATE targets instead so that we can still
3289         indicate which files are generated by make_names.pl but only run
3290         the script once.
3291
3292         This is a similar fix as for Bug 140756. There may several other
3293         similar issues in DerivedSources.make but this patch focuses on
3294         make_names.pl. I will take care of other in follow-ups if needed.
3295
3296         * DerivedSources.make:
3297
3298 2015-01-22  Chris Dumez  <cdumez@apple.com>
3299
3300         Have Counter::create() return a Ref<Counter>
3301         https://bugs.webkit.org/show_bug.cgi?id=140777
3302
3303         Reviewed by Andreas Kling.
3304
3305         Have Counter::create() return a Ref<Counter> instead of a PassRefPtr.
3306
3307         The CSSPrimitiveValue class needed some updates as well to support
3308         constructing a CSSPrimitiveValue object from a Ref<>.
3309
3310         * css/CSSPrimitiveValue.cpp:
3311         (WebCore::CSSPrimitiveValue::init):
3312         * css/CSSPrimitiveValue.h:
3313         (WebCore::CSSPrimitiveValue::create):
3314         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3315         * css/Counter.h:
3316         (WebCore::Counter::create):
3317         (WebCore::Counter::cloneForCSSOM):
3318
3319 2015-01-22  Chris Dumez  <cdumez@apple.com>
3320
3321         Drop the legacy FeatureCounter class
3322         https://bugs.webkit.org/show_bug.cgi?id=140749
3323
3324         Reviewed by Andreas Kling.
3325
3326         Drop the legacy FeatureCounter class and use DiagnosticLoggingClient
3327         instead.
3328
3329         * CMakeLists.txt:
3330         * Configurations/WebCore.xcconfig:
3331         * WebCore.exp.in:
3332         * WebCore.vcxproj/WebCore.vcxproj:
3333         * WebCore.vcxproj/WebCore.vcxproj.filters:
3334         * WebCore.xcodeproj/project.pbxproj:
3335         * html/HTMLMediaElement.cpp:
3336         (WebCore::HTMLMediaElement::parseAttribute):
3337         * loader/SubresourceLoader.cpp:
3338         (WebCore::SubresourceLoader::willSendRequest):
3339         (WebCore::SubresourceLoader::didReceiveResponse):
3340         * loader/cache/CachedResource.cpp:
3341         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders):
3342         * loader/cache/CachedResourceLoader.cpp:
3343         (WebCore::logMemoryCacheResourceRequest):
3344         (WebCore::CachedResourceLoader::requestResource):
3345         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
3346         * page/DiagnosticLoggingKeys.cpp:
3347         (WebCore::DiagnosticLoggingKeys::mustRevalidateIsExpiredKey):
3348         (WebCore::DiagnosticLoggingKeys::playedKey):
3349         (WebCore::DiagnosticLoggingKeys::noCacheKey):
3350         (WebCore::DiagnosticLoggingKeys::noStoreKey):
3351         (WebCore::DiagnosticLoggingKeys::notInMemoryCacheKey):
3352         (WebCore::DiagnosticLoggingKeys::mediaKey):
3353         (WebCore::DiagnosticLoggingKeys::isExpiredKey):
3354         (WebCore::DiagnosticLoggingKeys::loadingKey):
3355         (WebCore::DiagnosticLoggingKeys::inMemoryCacheKey):
3356         (WebCore::DiagnosticLoggingKeys::reasonKey):
3357         (WebCore::DiagnosticLoggingKeys::audioKey):
3358         (WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationKey):
3359         (WebCore::DiagnosticLoggingKeys::resourceRequestKey):
3360         (WebCore::DiagnosticLoggingKeys::revalidatingKey):
3361         (WebCore::DiagnosticLoggingKeys::unusedKey):
3362         (WebCore::DiagnosticLoggingKeys::unusedReasonCredentialSettingsKey):
3363         (WebCore::DiagnosticLoggingKeys::unusedReasonErrorKey):
3364         (WebCore::DiagnosticLoggingKeys::unusedReasonMustRevalidateNoValidatorKey):
3365         (WebCore::DiagnosticLoggingKeys::unusedReasonNoStoreKey):
3366         (WebCore::DiagnosticLoggingKeys::unusedReasonRedirectChainKey):
3367         (WebCore::DiagnosticLoggingKeys::unusedReasonReloadKey):
3368         (WebCore::DiagnosticLoggingKeys::unusedReasonTypeMismatchKey):
3369         (WebCore::DiagnosticLoggingKeys::usedKey):
3370         (WebCore::DiagnosticLoggingKeys::userKey):
3371         (WebCore::DiagnosticLoggingKeys::videoKey):
3372         (WebCore::DiagnosticLoggingKeys::webViewKey):
3373         (WebCore::DiagnosticLoggingKeys::zoomedKey):
3374         * page/DiagnosticLoggingKeys.h:
3375         * page/Settings.in:
3376         * platform/FeatureCounter.cpp: Removed.
3377         * platform/FeatureCounter.h: Removed.
3378         * platform/FeatureCounterKeys.h: Removed.
3379         * platform/ios/FeatureCounter.mm: Removed.
3380
3381 2015-01-22  Benjamin Poulain  <benjamin@webkit.org>
3382
3383         When extending the fallback transitions with their closure, we are modifying the Set while iterating it
3384         https://bugs.webkit.org/show_bug.cgi?id=140785
3385
3386         Reviewed by Andreas Kling.
3387
3388         * contentextensions/NFAToDFA.cpp:
3389         (WebCore::ContentExtensions::populateTransitions):
3390         Make that in two steps: accumulate the fallback transitions then add the closure
3391         of every element.
3392
3393 2015-01-21  Antti Koivisto  <antti@apple.com>
3394
3395         Rename SimpleFontData to Font
3396         https://bugs.webkit.org/show_bug.cgi?id=140496
3397
3398         Reviewed by Zalan Bujtas.
3399
3400         The fallback supporting Font type was renamed FontCascade.
3401         We can now rename SimpleFontData to Font matching the usual definition.
3402
3403 2015-01-22  Zalan Bujtas  <zalan@apple.com>
3404
3405         Simple line layout: Make trailing whitespace handling more explicit.
3406         https://bugs.webkit.org/show_bug.cgi?id=140776
3407
3408         Reviewed by Antti Koivisto.
3409
3410         Differentiate between committed and uncommitted trailing whitespace.
3411         This enables further cleanup in removeTrailingWhitespace().
3412
3413         No change in functionality.
3414
3415         * rendering/SimpleLineLayout.cpp:
3416         (WebCore::SimpleLineLayout::LineState::commitAndCreateRun):
3417         (WebCore::SimpleLineLayout::LineState::addUncommitted):
3418         (WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly):
3419         (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
3420         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
3421         (WebCore::SimpleLineLayout::LineState::LineState): Deleted.
3422         (WebCore::SimpleLineLayout::LineState::removeCommittedTrailingWhitespace): Deleted.
3423         (WebCore::SimpleLineLayout::LineState::resetTrailingWhitespace): Deleted.
3424
3425 2015-01-22  Alexey Proskuryakov  <ap@apple.com>
3426
3427         Crash in URL::protocol() after appcache load fails
3428         https://bugs.webkit.org/show_bug.cgi?id=140755
3429         rdar://problem/7881290
3430
3431         Reviewed by Dan Bates.
3432
3433         Test: http/tests/appcache/404-resource-with-slow-main-resource.php
3434
3435         Not every cache that isn't being updated is complete. It could also be in a zombie
3436         state after failing to load. We get rid of the cache once the main resource finishes
3437         loading, but while it's being loaded, the zombie still looks like a regular
3438         candidate application cache.
3439
3440         * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::isComplete):
3441         * loader/appcache/ApplicationCache.h:
3442         Removed const from isComplete(), because otherwise we couldn't use ApplicationCacheGroup::m_caches.contains().
3443         Constness doesn't make a lot of sense for these objects anyway.
3444
3445         * loader/appcache/ApplicationCacheGroup.cpp:
3446         (WebCore::ApplicationCacheGroup::failedLoadingMainResource): Toned down an assertion.
3447         We can fail a main resource load when the document has a zombie appcache, too.
3448
3449         * loader/appcache/ApplicationCacheGroup.h:
3450         (WebCore::ApplicationCacheGroup::cacheIsComplete):
3451         (WebCore::ApplicationCacheGroup::cacheIsBeingUpdated): Deleted.
3452         These functions are only used in ApplicationCache::isComplete().
3453
3454 2015-01-22  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
3455
3456         Avoid defining always empty Vector<TextCheckingResult>
3457         https://bugs.webkit.org/show_bug.cgi?id=140765
3458
3459         Reviewed by Alexey Proskuryakov.
3460
3461         Pass an empty vector direclty instead.
3462
3463         No new tests. No behavior change.
3464
3465         * editing/SpellChecker.cpp:
3466         (WebCore::SpellChecker::didCheckCancel):
3467
3468 2015-01-22  Chris Dumez  <cdumez@apple.com>
3469
3470         makeprop.pl script is called too many times during build
3471         https://bugs.webkit.org/show_bug.cgi?id=140756
3472         <rdar://problem/19467942>
3473
3474         Reviewed by David Kilzer.
3475
3476         The makeprop.pl script was called 4 times (instead of once) during
3477         build due to a bad Makefile rule in DerivedSources.make. makeprop.pl
3478         had 4 associated targets and thus was called 4 times (with the same
3479         parameter). Calling it once is sufficient to generate all 4 files
3480         that were marked as target. This patch uses an INTERMEDIATE target
3481         instead so that we can indicate that several files are generated
3482         by the same command.
3483
3484         I believe this may be the reason for the sporatic build failures
3485         that look like:
3486         """
3487         CSSPropertyNames.gperf: No keywords in input file!
3488         calling gperf failed: 256 at WebCore/css/makeprop.pl line 1036.
3489         """
3490         The makeprop.pl script is generating gperf's input file and calling the
3491         gperf executable on this file. If the script is executed several times
3492         in parallel, it would explain the build failures as several instances
3493         of makeprop.pl may be writing / reading from the same
3494         CSSPropertyNames.gperf file.
3495
3496         * DerivedSources.make:
3497
3498 2015-01-22  Commit Queue  <commit-queue@webkit.org>
3499
3500         Unreviewed, rolling out r178894.
3501         https://bugs.webkit.org/show_bug.cgi?id=140775
3502
3503         Broke JSC and bindings tests (Requested by ap_ on #webkit).
3504
3505         Reverted changeset:
3506
3507         "put_by_val_direct need to check the property is index or not
3508         for using putDirect / putDirectIndex"
3509         https://bugs.webkit.org/show_bug.cgi?id=140426
3510         http://trac.webkit.org/changeset/178894
3511
3512 2015-01-22  David Kilzer  <ddkilzer@apple.com>
3513
3514         [iOS] Fix iphoneos SDK builds for ios-ews queue
3515         <http://webkit.org/b/140748>
3516
3517         Reviewed by Daniel Bates.
3518
3519         * WebCore.xcodeproj/project.pbxproj: Add new SPI headers.
3520         * platform/graphics/cg/ImageBufferCG.cpp: Switch to using
3521         "IOSurfaceSPI.h" from <IOSurface/IOSurface.h>.
3522         * platform/graphics/cg/ImageBufferDataCG.cpp: Ditto.
3523         * platform/graphics/cocoa/IOSurface.mm: Ditto.  Move definitions
3524         in <IOSurface/IOSurfacePrivate.h> into "IOSurfaceSPI.h".
3525         * platform/spi/cg/CoreGraphicsSPI.h: Switch to
3526         WTF_EXTERN_C_{BEGIN,END}.  Add
3527         CGContextGetFontAntialiasingStyle() and
3528         CGContextSetFontAntialiasingStyle().
3529         * platform/spi/cocoa/IOPMLibSPI.h: Switch to use IOReturnSPI.h.
3530         * platform/spi/cocoa/IOReturnSPI.h: Add.
3531         * platform/spi/cocoa/IOSurfaceSPI.h: Add.
3532         * platform/spi/cocoa/IOTypesSPI.h: Add.
3533
3534 2015-01-21  Sergio Villar Senin  <svillar@igalia.com>
3535
3536         [CSS Grid Layout] Skip items spanning flex tracks when sizing content based tracks
3537         https://bugs.webkit.org/show_bug.cgi?id=140720
3538
3539         Reviewed by David Hyatt.
3540
3541         Section "11.5. Resolve Intrinsic Track Sizes" of the specs forces
3542         us to ignore items spanning tracks with flex sizing functions when
3543         resolving the content-based track sizing functions. Items with
3544         span < 2 are not affected by this rule (as they will belong to a
3545         single track). This way the algorithm ensures that min-content and
3546         max-content restrictions are fulfilled before distributing the
3547         extra space.
3548
3549         Test: fast/css-grid-layout/flex-and-content-sized-resolution-columns.html
3550
3551         * rendering/RenderGrid.cpp:
3552         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks):
3553         (WebCore::integerSpanForDirection):
3554         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3555         * rendering/RenderGrid.h:
3556
3557 2015-01-22  Yusuke Suzuki  <utatane.tea@gmail.com>
3558
3559         put_by_val_direct need to check the property is index or not for using putDirect / putDirectIndex
3560         https://bugs.webkit.org/show_bug.cgi?id=140426
3561
3562         Reviewed by Geoffrey Garen.
3563
3564         Test: js/dfg-put-by-val-direct-with-edge-numbers.html
3565
3566         * bindings/js/JSDOMWindowCustom.cpp:
3567         (WebCore::JSDOMWindow::getOwnPropertySlot):
3568         * bindings/js/JSHTMLAllCollectionCustom.cpp:
3569         (WebCore::callHTMLAllCollection):
3570         (WebCore::JSHTMLAllCollection::item):
3571         * bindings/scripts/CodeGeneratorJS.pm:
3572         (GenerateGetOwnPropertySlotBody):
3573         (GenerateImplementation):
3574         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3575         (WebCore::JSFloat64Array::getOwnPropertySlot):
3576         (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
3577         (WebCore::JSFloat64Array::put):
3578         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3579         (WebCore::JSTestEventTarget::getOwnPropertySlot):
3580         * bridge/runtime_array.cpp:
3581         (JSC::RuntimeArray::getOwnPropertySlot):
3582         (JSC::RuntimeArray::put):
3583
3584 2015-01-19  Sergio Villar Senin  <svillar@igalia.com>
3585
3586         [CSS Grid Layout] Size tracks using a list of all items sorted by span
3587         https://bugs.webkit.org/show_bug.cgi?id=140615
3588
3589         Reviewed by Andreas Kling.
3590
3591         In r173620 we fixed
3592         RenderGrid::resolveContentBasedTrackSizingFunctions() so that it
3593         now collects all items spanning content-sized tracks and process
3594         them one by one after sorting them by ascending span.
3595
3596         The problem is that it was incorrectly implemented, it has two
3597         important bugs. First one is that the hash table that collects
3598         items is regenerated after processing each track, so it's actually
3599         doing nothing. Secondly we're only sorting the items on each
3600         track, instead of all the items in the grid.
3601
3602         * rendering/RenderGrid.cpp:
3603         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3604
3605 2015-01-21  Daniel Bates  <dabates@apple.com>
3606
3607         Fix the iOS release build after <http://trac.webkit.org/changeset/178868>
3608         (https://bugs.webkit.org/show_bug.cgi?id=140742)
3609
3610         Substitute ASSERT_UNUSED() for ASSERT() since the parameter layer is used only in the assertion expression.
3611
3612         * rendering/RenderLayerBacking.cpp:
3613         (WebCore::RenderLayerBacking::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack):
3614
3615 2015-01-21  Daniel Bates  <dabates@apple.com>
3616
3617         [iOS] Many compositing tests fail in DumpRenderTree due to contentsOpaque difference
3618         https://bugs.webkit.org/show_bug.cgi?id=140742
3619
3620         Reviewed by Simon Fraser.
3621
3622         Make RenderLayerBacking::layerTreeAsText() (including internals.layerTreeAsText()) always
3623         report that the main frame's RenderView layer is opaque when running iOS DumpRenderTree to
3624         avoid test failures and the need to maintain for iOS WebKit1 an almost identical copy of the
3625         platform-independent compositing test results.
3626
3627         The main frame's RenderView layer is always transparent in iOS WebKit1 since it does
3628         not make use of a tiled cache layer and defers to UIKit to handle the final compositing
3629         of the web view, including applying the page scale factor.
3630
3631         * platform/RuntimeApplicationChecksIOS.mm:
3632         (WebCore::applicationIsDumpRenderTree): The app bundle identifier of DumpRenderTree has
3633         the form org.webkit.DumpRenderTreeX where X is some non-negative integer.
3634         * platform/graphics/GraphicsLayer.cpp:
3635         (WebCore::GraphicsLayer::dumpProperties): Modified to report that a layer is opaque when
3636         GraphicsLayerClient::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack() returns true.
3637         * platform/graphics/GraphicsLayerClient.h:
3638         (WebCore::GraphicsLayerClient::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack): Added
3639         default implementation (returns false).
3640         * rendering/RenderLayerBacking.cpp:
3641         (WebCore::RenderLayerBacking::needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack): Added;
3642         returns true when running in DumpRenderTree and the passed GraphicsLayer corresponds to the main frame's
3643         RenderView layer.
3644         * rendering/RenderLayerBacking.h:
3645
3646 2015-01-21  Roger Fong  <roger_fong@apple.com>
3647
3648         WebGL2 (spec section 3.1): Add new types to WebGL2 API.
3649         https://bugs.webkit.org/show_bug.cgi?id=140741.
3650         <rdar://problem/19552962>
3651
3652         Reviewed by Dean Jackson.
3653
3654         * html/canvas/WebGL2RenderingContext.idl:
3655
3656 2015-01-21  Zalan Bujtas  <zalan@apple.com>
3657
3658         Simple line layout: Move nextTextFragment() to FlowContents class.
3659         https://bugs.webkit.org/show_bug.cgi?id=140738
3660
3661         Reviewed by Antti Koivisto.
3662
3663         This is in preparation to make FlowContents an iterator class.
3664         
3665         No change in functionality.
3666
3667         * rendering/SimpleLineLayout.cpp:
3668         (WebCore::SimpleLineLayout::LineState::addUncommitted):
3669         (WebCore::SimpleLineLayout::LineState::addUncommittedWhitespace):
3670         (WebCore::SimpleLineLayout::removeTrailingWhitespace):
3671         (WebCore::SimpleLineLayout::initializeNewLine):
3672         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
3673         (WebCore::SimpleLineLayout::createLineRuns):
3674         (WebCore::SimpleLineLayout::TextFragment::TextFragment): Deleted.
3675         (WebCore::SimpleLineLayout::TextFragment::isEmpty): Deleted.
3676         (WebCore::SimpleLineLayout::nextFragment): Deleted.
3677         * rendering/SimpleLineLayoutFlowContents.cpp:
3678         (WebCore::SimpleLineLayout::FlowContents::nextTextFragment):
3679         * rendering/SimpleLineLayoutFlowContents.h:
3680         (WebCore::SimpleLineLayout::FlowContents::TextFragment::TextFragment):
3681         (WebCore::SimpleLineLayout::FlowContents::TextFragment::isEmpty):
3682
3683 2015-01-21  Andreas Kling  <akling@apple.com>
3684
3685         DocumentLoader::timing() should return a reference.
3686         <https://webkit.org/b/128272>
3687
3688         Reviewed by Antti Koivisto.
3689
3690         There is always a DocumentLoadTiming object, so return it by
3691         reference since it can never be null.
3692
3693         * Modules/gamepad/NavigatorGamepad.cpp:
3694         (WebCore::NavigatorGamepad::from):
3695         * dom/ScriptedAnimationController.cpp:
3696         (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
3697         * html/HTMLMediaElement.cpp:
3698         (WebCore::HTMLMediaElement::parseAttribute):
3699         * inspector/InspectorResourceAgent.cpp:
3700         (WebCore::buildObjectForTiming):
3701         * loader/DocumentLoader.cpp:
3702         (WebCore::DocumentLoader::finishedLoading):
3703         (WebCore::DocumentLoader::willSendRequest):
3704         (WebCore::DocumentLoader::continueAfterNavigationPolicy):
3705         (WebCore::DocumentLoader::startLoadingMainResource):
3706         * loader/DocumentLoader.h:
3707         (WebCore::DocumentLoader::timing):
3708         * loader/FrameLoader.cpp:
3709         (WebCore::FrameLoader::stopLoading):
3710         (WebCore::FrameLoader::commitProvisionalLoad):
3711         (WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
3712         * page/DOMWindow.cpp:
3713         (WebCore::DOMWindow::dispatchLoadEvent):
3714         * page/Performance.cpp:
3715         (WebCore::Performance::now):
3716         * page/PerformanceNavigation.cpp:
3717         (WebCore::PerformanceNavigation::redirectCount):
3718         * page/PerformanceResourceTiming.cpp:
3719         (WebCore::monotonicTimeToDocumentMilliseconds):
3720         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
3721         * page/PerformanceTiming.cpp:
3722         (WebCore::PerformanceTiming::documentLoadTiming):
3723
3724 2015-01-21  Benjamin Poulain  <benjamin@webkit.org>
3725
3726         Handle the transition on any character as a separate type of transition
3727         https://bugs.webkit.org/show_bug.cgi?id=140711
3728
3729         Reviewed by Andreas Kling.
3730
3731         Instead of considering the universal transition as 127 transitions, it is now
3732         handled as a separate type of transition.
3733
3734         The goal is to reduce the number of exit edge to consider for each node. Instead
3735         of having 127 for any partition containing one universal transition, we have
3736         as few exit edges as necessary + one universal transition.
3737
3738         In the NFA, the universal transition is stored directly on NFANode in a new
3739         HashSet (transitionsOnAnyCharacter).
3740         The target nodes are made exclusive between "transitionsOnAnyCharacter" and "transitions"
3741         by construction. That is not strictly needed but it simplify debugging at the moment.
3742
3743         When converting a NFA to a DFA, we first find all the node that transition on any character.
3744         Then, when we iterate over "real" transition, we also augment that set with the set on
3745         any character.
3746
3747         When creating the DFA node, we first consider each "real" transition, then we have a single
3748         "fallback" transition for any character that has not been handled yet.
3749
3750         When matching, we first search for any real transition. If there is none but a fallback exists,
3751         we take the fallback.
3752
3753         * contentextensions/DFA.cpp:
3754         (WebCore::ContentExtensions::DFA::nextState):
3755         (WebCore::ContentExtensions::printTransitions):
3756         (WebCore::ContentExtensions::DFA::debugPrintDot):
3757         (WebCore::ContentExtensions::printTransition): Deleted.
3758         * contentextensions/DFANode.h:
3759         * contentextensions/NFA.cpp:
3760         (WebCore::ContentExtensions::NFA::addTransition):
3761         (WebCore::ContentExtensions::NFA::addTransitionsOnAnyCharacter):
3762         (WebCore::ContentExtensions::printTransitions):
3763         (WebCore::ContentExtensions::NFA::debugPrintDot):
3764         (WebCore::ContentExtensions::printTransition): Deleted.
3765         * contentextensions/NFA.h:
3766         * contentextensions/NFANode.h:
3767         * contentextensions/NFAToDFA.cpp:
3768         (WebCore::ContentExtensions::populateTransitions):
3769         (WebCore::ContentExtensions::getOrCreateDFANode):
3770         (WebCore::ContentExtensions::NFAToDFA::convert):
3771         * contentextensions/URLFilterParser.cpp:
3772         (WebCore::ContentExtensions::GraphBuilder::generateTransition):
3773
3774 2015-01-20  Antti Koivisto  <antti@apple.com>
3775
3776         REGRESSION(r178180): Membuster regressed ~4%
3777         https://bugs.webkit.org/show_bug.cgi?id=140495
3778
3779         Reviewed by Andreas Kling.
3780
3781         After r178180 we keep system fallback fonts that are used on glyph pages alive.
3782         Previously we would traverse the glyph pages and remove entries referencing system fallbacks.
3783
3784         * platform/graphics/FontCache.cpp:
3785         (WebCore::FontCache::purgeInactiveFontData):
3786         * platform/graphics/FontCascade.cpp:
3787         (WebCore::pruneUnreferencedEntriesFromFontGlyphsCache):
3788         (WebCore::pruneSystemFallbackFonts):
3789         * platform/graphics/FontCascade.h:
3790         * platform/graphics/FontGlyphs.cpp:
3791         (WebCore::FontGlyphs::pruneSystemFallbacks):
3792
3793             When clearing the font cache also remove the cached glyph pages that may contain system fallback fonts
3794             and release the fallbacks.
3795
3796         * platform/graphics/FontGlyphs.h:
3797
3798 2015-01-21  Manuel Rego Casasnovas  <rego@igalia.com>
3799
3800         first-letter pseudo-element from ancestors is not being ignored in grids and flexboxes
3801         https://bugs.webkit.org/show_bug.cgi?id=138424
3802
3803         Reviewed by Benjamin Poulain.
3804
3805         Source/WebCore:
3806
3807         According to the grid and flexbox specs:
3808         "::first-letter pseudo-element do not apply to grid/flex containers".
3809         http://dev.w3.org/csswg/css-grid/#grid-containers
3810         http://dev.w3.org/csswg/css-flexbox/#flex-containers
3811
3812         Check also the CSS WG mailing list discussion:
3813         http://lists.w3.org/Archives/Public/www-style/2014Dec/0305.html
3814
3815         This was almost working right, except in the case that an ancestor was
3816         setting the ::first-letter pseudo-element.
3817
3818         Added a few more cases to the current tests in order to check this
3819         behavior.
3820         Also created some new tests to increase coverage
3821
3822         Tests: fast/css/first-letter-from-ancestors-not-apply-inline-elements.html
3823                fast/css/first-letter-ignores-display-property.html
3824
3825         * rendering/RenderBlock.cpp:
3826         (WebCore::RenderBlock::getFirstLetter): Go to the next sibling when
3827         looking for the first text child if you reach a grid or flexbox.
3828
3829 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
3830
3831         Fix cast-align warning in Source/WebCore/platform/efl/EflScreenUtilities.cpp
3832         https://bugs.webkit.org/show_bug.cgi?id=140670
3833
3834         Reviewed by Darin Adler.
3835
3836         * platform/efl/EflScreenUtilities.cpp:
3837         (WebCore::createCustomCursor):
3838
3839 2015-01-21  Csaba Osztrogonác  <ossy@webkit.org>
3840
3841         Remove ENABLE(INSPECTOR) ifdef guards
3842         https://bugs.webkit.org/show_bug.cgi?id=140668
3843
3844         Reviewed by Darin Adler.
3845
3846         * Configurations/FeatureDefines.xcconfig:
3847         * WebCore.exp.in:
3848         * bindings/js/JSCommandLineAPIHostCustom.cpp:
3849         * bindings/js/JSDOMWindowBase.cpp:
3850         (WebCore::JSDOMWindowBase::supportsProfiling):
3851         (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
3852         * bindings/js/JSInspectorFrontendHostCustom.cpp:
3853         * bindings/js/ScriptController.cpp:
3854         (WebCore::ScriptController::collectIsolatedContexts):
3855         * bindings/js/ScriptController.h:
3856         * bindings/js/ScriptGlobalObject.cpp:
3857         (WebCore::ScriptGlobalObject::set):
3858         * bindings/js/ScriptGlobalObject.h:
3859         * bindings/js/WorkerScriptDebugServer.cpp:
3860         * bindings/js/WorkerScriptDebugServer.h:
3861         * dom/Node.cpp:
3862         (WebCore::Node::inspect):
3863         * inspector/CommandLineAPIHost.cpp:
3864         * inspector/CommandLineAPIHost.idl:
3865         * inspector/CommandLineAPIModule.cpp:
3866         * inspector/CommandLineAPIModule.h:
3867         * inspector/DOMEditor.cpp:
3868         * inspector/DOMEditor.h:
3869         * inspector/DOMPatchSupport.cpp:
3870         * inspector/DOMPatchSupport.h:
3871         * inspector/InspectorApplicationCacheAgent.cpp:
3872         * inspector/InspectorApplicationCacheAgent.h:
3873         * inspector/InspectorCSSAgent.cpp:
3874         * inspector/InspectorCSSAgent.h:
3875         * inspector/InspectorClient.cpp:
3876         * inspector/InspectorConsoleInstrumentation.h:
3877         (WebCore::InspectorInstrumentation::addMessageToConsole):
3878         (WebCore::InspectorInstrumentation::consoleCount):
3879         (WebCore::InspectorInstrumentation::startConsoleTiming):
3880         (WebCore::InspectorInstrumentation::stopConsoleTiming):
3881         (WebCore::InspectorInstrumentation::consoleTimeStamp):
3882         (WebCore::InspectorInstrumentation::startProfiling):
3883         (WebCore::InspectorInstrumentation::stopProfiling):
3884         * inspector/InspectorController.cpp:
3885         * inspector/InspectorController.h:
3886         * inspector/InspectorDOMAgent.cpp:
3887         * inspector/InspectorDOMAgent.h:
3888         * inspector/InspectorDOMDebuggerAgent.cpp:
3889         * inspector/InspectorDOMDebuggerAgent.h:
3890         * inspector/InspectorDOMStorageAgent.cpp:
3891         * inspector/InspectorDatabaseAgent.cpp:
3892         * inspector/InspectorDatabaseAgent.h:
3893         * inspector/InspectorDatabaseInstrumentation.h:
3894         (WebCore::InspectorInstrumentation::didOpenDatabase):
3895         * inspector/InspectorDatabaseResource.cpp:
3896         * inspector/InspectorDatabaseResource.h:
3897         * inspector/InspectorFrontendClientLocal.cpp:
3898         * inspector/InspectorFrontendHost.cpp:
3899         * inspector/InspectorFrontendHost.idl:
3900         * inspector/InspectorHistory.cpp:
3901         * inspector/InspectorHistory.h:
3902         * inspector/InspectorIndexedDBAgent.cpp:
3903         * inspector/InspectorIndexedDBAgent.h:
3904         * inspector/InspectorInstrumentation.cpp:
3905         * inspector/InspectorInstrumentation.h:
3906         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
3907         (WebCore::InspectorInstrumentation::isDebuggerPaused):
3908         (WebCore::InspectorInstrumentation::willInsertDOMNode):
3909         (WebCore::InspectorInstrumentation::didInsertDOMNode):
3910         (WebCore::InspectorInstrumentation::willRemoveDOMNode):
3911         (WebCore::InspectorInstrumentation::didRemoveDOMNode):
3912         (WebCore::InspectorInstrumentation::willModifyDOMAttr):
3913         (WebCore::InspectorInstrumentation::didModifyDOMAttr):
3914         (WebCore::InspectorInstrumentation::didRemoveDOMAttr):
3915         (WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
3916         (WebCore::InspectorInstrumentation::frameWindowDiscarded):
3917         (WebCore::InspectorInstrumentation::mediaQueryResultChanged):
3918         (WebCore::InspectorInstrumentation::didPushShadowRoot):
3919         (WebCore::InspectorInstrumentation::willPopShadowRoot):
3920         (WebCore::InspectorInstrumentation::didCreateNamedFlow):
3921         (WebCore::InspectorInstrumentation::willRemoveNamedFlow):
3922         (WebCore::InspectorInstrumentation::didChangeRegionOverset):
3923         (WebCore::InspectorInstrumentation::didRegisterNamedFlowContentElement):
3924         (WebCore::InspectorInstrumentation::didUnregisterNamedFlowContentElement):
3925         (WebCore::InspectorInstrumentation::mouseDidMoveOverElement):
3926         (WebCore::InspectorInstrumentation::handleTouchEvent):
3927         (WebCore::InspectorInstrumentation::handleMousePress):
3928         (WebCore::InspectorInstrumentation::forcePseudoState):
3929         (WebCore::InspectorInstrumentation::characterDataModified):
3930         (WebCore::InspectorInstrumentation::willSendXMLHttpRequest):
3931         (WebCore::InspectorInstrumentation::didInstallTimer):
3932         (WebCore::InspectorInstrumentation::didRemoveTimer):
3933         (WebCore::InspectorInstrumentation::willCallFunction):
3934         (WebCore::InspectorInstrumentation::didCallFunction):
3935         (WebCore::InspectorInstrumentation::willDispatchXHRReadyStateChangeEvent):
3936         (WebCore::InspectorInstrumentation::didDispatchXHRReadyStateChangeEvent):
3937         (WebCore::InspectorInstrumentation::willDispatchEvent):
3938         (WebCore::InspectorInstrumentation::didDispatchEvent):
3939         (WebCore::InspectorInstrumentation::willHandleEvent):
3940         (WebCore::InspectorInstrumentation::didHandleEvent):
3941         (WebCore::InspectorInstrumentation::willDispatchEventOnWindow):
3942         (WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
3943         (WebCore::InspectorInstrumentation::willEvaluateScript):
3944         (WebCore::InspectorInstrumentation::didEvaluateScript):
3945         (WebCore::InspectorInstrumentation::scriptsEnabled):
3946         (WebCore::InspectorInstrumentation::willFireTimer):
3947         (WebCore::InspectorInstrumentation::didFireTimer):
3948         (WebCore::InspectorInstrumentation::didInvalidateLayout):
3949         (WebCore::InspectorInstrumentation::willLayout):
3950         (WebCore::InspectorInstrumentation::didLayout):
3951         (WebCore::InspectorInstrumentation::didScroll):
3952         (WebCore::InspectorInstrumentation::willDispatchXHRLoadEvent):
3953         (WebCore::InspectorInstrumentation::didDispatchXHRLoadEvent):
3954         (WebCore::InspectorInstrumentation::willPaint):
3955         (WebCore::InspectorInstrumentation::didPaint):
3956         (WebCore::InspectorInstrumentation::willScrollLayer):
3957         (WebCore::InspectorInstrumentation::didScrollLayer):
3958         (WebCore::InspectorInstrumentation::willRecalculateStyle):
3959         (WebCore::InspectorInstrumentation::didRecalculateStyle):
3960         (WebCore::InspectorInstrumentation::didScheduleStyleRecalculation):
3961         (WebCore::InspectorInstrumentation::applyEmulatedMedia):
3962         (WebCore::InspectorInstrumentation::willSendRequest):
3963         (WebCore::InspectorInstrumentation::continueAfterPingLoader):
3964         (WebCore::InspectorInstrumentation::markResourceAsCached):
3965         (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCache):
3966         (WebCore::InspectorInstrumentation::willReceiveResourceResponse):
3967         (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
3968         (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
3969         (WebCore::InspectorInstrumentation::continueWithPolicyDownload):
3970         (WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
3971         (WebCore::InspectorInstrumentation::didReceiveData):
3972         (WebCore::InspectorInstrumentation::didFinishLoading):
3973         (WebCore::InspectorInstrumentation::didFailLoading):
3974         (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient):
3975         (WebCore::InspectorInstrumentation::willLoadXHR):
3976         (WebCore::InspectorInstrumentation::didFailXHRLoading):
3977         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
3978         (WebCore::InspectorInstrumentation::didReceiveXHRResponse):
3979         (WebCore::InspectorInstrumentation::willLoadXHRSynchronously):
3980         (WebCore::InspectorInstrumentation::didLoadXHRSynchronously):
3981         (WebCore::InspectorInstrumentation::scriptImported):
3982         (WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP):
3983         (WebCore::InspectorInstrumentation::didReceiveScriptResponse):
3984         (WebCore::InspectorInstrumentation::domContentLoadedEventFired):
3985         (WebCore::InspectorInstrumentation::loadEventFired):
3986         (WebCore::InspectorInstrumentation::frameDetachedFromParent):
3987         (WebCore::InspectorInstrumentation::didCommitLoad):
3988         (WebCore::InspectorInstrumentation::frameDocumentUpdated):
3989         (WebCore::InspectorInstrumentation::loaderDetachedFromFrame):
3990         (WebCore::InspectorInstrumentation::frameStartedLoading):
3991         (WebCore::InspectorInstrumentation::frameStoppedLoading):
3992         (WebCore::InspectorInstrumentation::frameScheduledNavigation):
3993         (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
3994         (WebCore::InspectorInstrumentation::willRunJavaScriptDialog):
3995         (WebCore::InspectorInstrumentation::didRunJavaScriptDialog):
3996         (WebCore::InspectorInstrumentation::willDestroyCachedResource):
3997         (WebCore::InspectorInstrumentation::willWriteHTML):
3998         (WebCore::InspectorInstrumentation::didWriteHTML):
3999         (WebCore::InspectorInstrumentation::didDispatchDOMStorageEvent):
4000         (WebCore::InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart):
4001         (WebCore::InspectorInstrumentation::didStartWorkerGlobalScope):
4002         (WebCore::InspectorInstrumentation::workerGlobalScopeTerminated):
4003         (WebCore::InspectorInstrumentation::didCreateWebSocket):
4004         (WebCore::InspectorInstrumentation::willSendWebSocketHandshakeRequest):
4005         (WebCore::InspectorInstrumentation::didReceiveWebSocketHandshakeResponse):
4006         (WebCore::InspectorInstrumentation::didCloseWebSocket):
4007         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrame):
4008         (WebCore::InspectorInstrumentation::didReceiveWebSocketFrameError):
4009         (WebCore::InspectorInstrumentation::didSendWebSocketFrame):
4010         (WebCore::InspectorInstrumentation::sessionCreated):
4011         (WebCore::InspectorInstrumentation::sessionLoaded):
4012         (WebCore::InspectorInstrumentation::sessionModified):
4013         (WebCore::InspectorInstrumentation::segmentCreated):
4014         (WebCore::InspectorInstrumentation::segmentCompleted):
4015         (WebCore::InspectorInstrumentation::segmentLoaded):
4016         (WebCore::InspectorInstrumentation::segmentUnloaded):
4017         (WebCore::InspectorInstrumentation::captureStarted):
4018         (WebCore::InspectorInstrumentation::captureStopped):
4019         (WebCore::InspectorInstrumentation::playbackStarted):
4020         (WebCore::InspectorInstrumentation::playbackPaused):
4021         (WebCore::InspectorInstrumentation::playbackFinished):
4022         (WebCore::InspectorInstrumentation::playbackHitPosition):
4023         (WebCore::InspectorInstrumentation::networkStateChanged):
4024         (WebCore::InspectorInstrumentation::updateApplicationCacheStatus):
4025         (WebCore::InspectorInstrumentation::didRequestAnimationFrame):
4026         (WebCore::InspectorInstrumentation::didCancelAnimationFrame):
4027         (WebCore::InspectorInstrumentation::willFireAnimationFrame):
4028         (WebCore::InspectorInstrumentation::didFireAnimationFrame):
4029         (WebCore::InspectorInstrumentation::layerTreeDidChange):
4030         (WebCore::InspectorInstrumentation::renderLayerDestroyed):
4031         (WebCore::InspectorInstrumentation::pseudoElementDestroyed):
4032         (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
4033         (WebCore::InspectorInstrumentation::hasFrontends): Deleted.
4034         (WebCore::InspectorInstrumentation::consoleAgentEnabled): Deleted.
4035         (WebCore::InspectorInstrumentation::runtimeAgentEnabled): Deleted.
4036         (WebCore::InspectorInstrumentation::timelineAgentEnabled): Deleted.
4037         (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
4038         * inspector/InspectorLayerTreeAgent.cpp:
4039         * inspector/InspectorLayerTreeAgent.h:
4040         * inspector/InspectorOverlay.cpp:
4041         * inspector/InspectorPageAgent.cpp:
4042         * inspector/InspectorPageAgent.h:
4043         * inspector/InspectorReplayAgent.cpp:
4044         * inspector/InspectorReplayAgent.h:
4045         * inspector/InspectorResourceAgent.cpp:
4046         * inspector/InspectorResourceAgent.h:
4047         * inspector/InspectorStyleSheet.cpp:
4048         * inspector/InspectorStyleSheet.h:
4049         * inspector/InspectorStyleTextEditor.cpp:
4050         * inspector/InspectorStyleTextEditor.h:
4051         * inspector/InspectorTimelineAgent.cpp:
4052         * inspector/InspectorTimelineAgent.h:
4053         * inspector/InspectorWorkerAgent.cpp:
4054         * inspector/InspectorWorkerResource.h:
4055         * inspector/InstrumentingAgents.cpp:
4056         * inspector/NetworkResourcesData.cpp:
4057         * inspector/NetworkResourcesData.h:
4058         * inspector/PageConsoleAgent.cpp:
4059         * inspector/PageConsoleAgent.h:
4060         * inspector/PageDebuggerAgent.cpp:
4061         * inspector/PageDebuggerAgent.h:
4062         * inspector/PageRuntimeAgent.cpp:
4063         * inspector/PageRuntimeAgent.h:
4064         * inspector/PageScriptDebugServer.cpp:
4065         * inspector/PageScriptDebugServer.h:
4066         * inspector/TimelineRecordFactory.cpp:
4067         * inspector/WebConsoleAgent.cpp:
4068         * inspector/WebConsoleAgent.h:
4069         * inspector/WebDebuggerAgent.cpp:
4070         * inspector/WebDebuggerAgent.h:
4071         * inspector/WebInjectedScriptHost.cpp:
4072         * inspector/WebInjectedScriptHost.h:
4073         * inspector/WebInjectedScriptManager.cpp:
4074         * inspector/WebInjectedScriptManager.h:
4075         * inspector/WorkerConsoleAgent.cpp:
4076         * inspector/WorkerConsoleAgent.h:
4077         * inspector/WorkerDebuggerAgent.cpp:
4078         * inspector/WorkerDebuggerAgent.h:
4079         * inspector/WorkerInspectorController.cpp:
4080         * inspector/WorkerInspectorController.h:
4081         * inspector/WorkerRuntimeAgent.cpp:
4082         * inspector/WorkerRuntimeAgent.h:
4083         * loader/DocumentThreadableLoader.cpp:
4084         (WebCore::DocumentThreadableLoader::didReceiveResponse):
4085         (WebCore::DocumentThreadableLoader::loadRequest):
4086         * loader/FrameLoader.cpp:
4087         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
4088         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
4089         * loader/appcache/ApplicationCacheGroup.cpp:
4090         (WebCore::ApplicationCacheGroup::createResourceHandle):
4091         (WebCore::ApplicationCacheGroup::didReceiveResponse):
4092         * loader/appcache/ApplicationCacheHost.cpp:
4093         (WebCore::ApplicationCacheHost::applicationCacheInfo):
4094         * loader/appcache/ApplicationCacheHost.h:
4095         * loader/cache/CachedResourceLoader.cpp:
4096         (WebCore::CachedResourceLoader::shouldCon