0b45f75a7675b30a50c8f1a358cae32277ba2d41
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-02-18  Chris Dumez  <cdumez@apple.com>
2
3         Evict dead resources in MemoryCache in MemoryPressureHandler::releaseNoncriticalMemory()
4         https://bugs.webkit.org/show_bug.cgi?id=141723
5
6         Reviewed by Andreas Kling.
7
8         Evict dead resources from the MemoryCache on non-critical memory
9         pressure. On critical memory pressure, we already evict ALL resources
10         from the MemoryCache. It is a good idea to start by evicting resources
11         we care less about on non-critical warning to decrease the chances of
12         getting a critical warning and thus having to clear the whole
13         MemoryCache.
14
15         * loader/cache/MemoryCache.h:
16         * platform/MemoryPressureHandler.cpp:
17         (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
18         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
19         (WebCore::MemoryPressureHandler::releaseMemory):
20         Call releaseCriticalMemory() before releaseNoncriticalMemory()
21         as releaseCriticalMemory() is more aggressive. Doing it the
22         other way around would mean that on critical warning, we would
23         first evict dead resources, then evict all resources. It is
24         more efficient to evict all resources first, as it makes the
25         non-critical operation (evict dead resources) a no-op.
26
27 2015-02-18  Eric Carlson  <eric.carlson@apple.com>
28
29         [iOS] pause video when a tab moves to the background on some devices
30         https://bugs.webkit.org/show_bug.cgi?id=141753
31         <rdar://problem/19814562>
32
33         Reviewed by Jer Noble.
34
35         Test: media/video-background-tab-playback.html
36
37         * platform/audio/MediaSession.cpp:
38         (WebCore::MediaSession::clientDataBufferingTimerFired): Pause video when the element becomes
39             hidden if the BackgroundTabPlaybackRestricted is set.
40
41         * platform/audio/MediaSessionManager.cpp:
42         (WebCore::MediaSessionManager::applicationWillEnterBackground): Rename BackgroundPlaybackNotPermitted
43              to BackgroundProcessPlaybackRestricted.
44         (WebCore::MediaSessionManager::applicationWillEnterForeground): Ditto.
45         * platform/audio/MediaSessionManager.h:
46
47         * platform/audio/ios/MediaSessionManagerIOS.mm:
48         (WebCore::MediaSessionManageriOS::resetRestrictions): Set BackgroundTabPlaybackRestricted on
49             devices with restricted memory. BackgroundPlaybackNotPermitted -> BackgroundProcessPlaybackRestricted.
50
51         * testing/Internals.cpp:
52         (WebCore::Internals::setMediaSessionRestrictions): Add support for BackgroundTabPlaybackRestricted.
53             BackgroundPlaybackNotPermitted -> BackgroundProcessPlaybackRestricted.
54
55 2015-02-16  David Hyatt  <hyatt@apple.com>
56
57         Wrong element's style is used for text-decoration-style.
58         https://bugs.webkit.org/show_bug.cgi?id=141673
59         <rdar://problem/19876774>
60
61         Reviewed by Dean Jackson.
62
63         Added fast/text/text-underline-style.html
64
65         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
66         (AXAttributeStringSetStyle):
67         Add arguments for fetching styles.
68
69         * rendering/InlineTextBox.cpp:
70         (WebCore::InlineTextBox::paint):
71         (WebCore::InlineTextBox::paintDecoration):
72         * rendering/InlineTextBox.h:
73         Remove the passed in TextDecorationStyle and instead patch the code to fetch the styles in the same
74         way it fetches the colors.
75
76         * rendering/RenderObject.cpp:
77         (WebCore::RenderObject::getTextDecorationColorsAndStyles):
78         (WebCore::RenderObject::getTextDecorationColors): Deleted.
79         * rendering/RenderObject.h:
80         Add style fetching to the same function that fetches colors and rename it.
81
82 2015-02-18  David Kilzer  <ddkilzer@apple.com>
83
84         REGRESSION (r180260): Try to fix incremental builds by changing UserContentController.cpp
85
86         Attempt to fix this linker error by making a non-coding change:
87
88             Undefined symbols for architecture i386:
89               "__ZN7WebCore17ContentExtensions24ContentExtensionsBackendC1Ev", referenced from:
90                   __ZN7WebCore21UserContentController20addUserContentFilterERKN3WTF6StringES4_ in UserContentController.o
91             ld: symbol(s) not found for architecture i386
92
93         This should have been fixed by r180266, but perhaps Xcode didn't
94         recognize that it needed to rebuild this source file.
95
96         * page/UserContentController.cpp: Update copyright.
97
98 2015-02-18  Andreas Kling  <akling@apple.com>
99
100         Purge PassRefPtr from CanvasRenderingContext2D.
101         <https://webkit.org/b/141749>
102
103         Reviewed by Gyuyoung Kim.
104
105         Switch from using PassRefPtr to RefPtr/Ref in CanvasRenderingContext2D.
106
107         * html/TextMetrics.h:
108         (WebCore::TextMetrics::create): Changed create() helper to return Ref.
109
110         * html/canvas/CanvasRenderingContext2D.h:
111         * html/canvas/CanvasRenderingContext2D.cpp:
112         (WebCore::CanvasRenderingContext2D::prepareGradientForDashboard): Changed to take a reference.
113
114         (WebCore::CanvasRenderingContext2D::createLinearGradient):
115         (WebCore::CanvasRenderingContext2D::createRadialGradient):
116         (WebCore::CanvasRenderingContext2D::createPattern):
117         (WebCore::createEmptyImageData):
118         (WebCore::CanvasRenderingContext2D::createImageData):
119         (WebCore::CanvasRenderingContext2D::getImageData):
120         (WebCore::CanvasRenderingContext2D::webkitGetImageDataHD): Made these return RefPtr. Also did
121         a bunch of 0 -> nullptr conversion, removed a bunch of unnecessary RefPtr::release() calls,
122         and changed a PassRefPtr argument to RefPtr&&.
123
124         (WebCore::CanvasRenderingContext2D::measureText): Made this return Ref.
125
126 2015-02-18  Commit Queue  <commit-queue@webkit.org>
127
128         Unreviewed, rolling out r180260.
129         https://bugs.webkit.org/show_bug.cgi?id=141757
130
131         Broke the 32-bit builders (Requested by jessieberlin on
132         #webkit).
133
134         Reverted changeset:
135
136         "Add a trivial code generator for the DFA"
137         https://bugs.webkit.org/show_bug.cgi?id=141017
138         http://trac.webkit.org/changeset/180260
139
140 2015-02-17  Anders Carlsson  <andersca@apple.com>
141
142         Add API for clearing in-memory caches to WKWebsiteDataStore
143         https://bugs.webkit.org/show_bug.cgi?id=141724
144
145         Reviewed by Tim Horton.
146
147         Add a version of evictResources that takes a session id.
148
149         * loader/cache/MemoryCache.cpp:
150         (WebCore::MemoryCache::evictResources):
151
152 2015-02-18  Timothy Horton  <timothy_horton@apple.com>
153
154         Remove more references to WebCore.exp.in
155         https://bugs.webkit.org/show_bug.cgi?id=141747
156
157         Reviewed by Alexey Proskuryakov.
158
159         * WebCore.xcodeproj/project.pbxproj:
160
161 2015-02-17  Benjamin Poulain  <benjamin@webkit.org>
162
163         Add a trivial code generator for the DFA
164         https://bugs.webkit.org/show_bug.cgi?id=141017
165
166         Reviewed by Andreas Kling.
167
168         Nothing fancy yet, this is just doing a literal translation from the DFA
169         to machine code. It is extremely inefficient at the moment.
170
171         * WebCore.xcodeproj/project.pbxproj:
172         * contentextensions/ContentExtensionsBackend.cpp:
173         (WebCore::ContentExtensions::ContentExtensionsBackend::ContentExtensionsBackend):
174         (WebCore::ContentExtensions::ContentExtensionsBackend::setRuleList):
175         (WebCore::ContentExtensions::addActionToHashSet):
176         (WebCore::ContentExtensions::ContentExtensionsBackend::shouldBlockURL):
177         * contentextensions/ContentExtensionsBackend.h:
178         * contentextensions/DFA.cpp:
179         (WebCore::ContentExtensions::DFA::nextState): Deleted.
180         (WebCore::ContentExtensions::DFA::actions): Deleted.
181         * contentextensions/DFA.h:
182         (WebCore::ContentExtensions::DFA::size):
183         (WebCore::ContentExtensions::DFA::nodeAt):
184         * contentextensions/DFACompiler.cpp: Added.
185         (WebCore::ContentExtensions::compileDFA):
186         (WebCore::ContentExtensions::DFACodeGenerator::DFACodeGenerator):
187         (WebCore::ContentExtensions::DFACodeGenerator::compile):
188         (WebCore::ContentExtensions::DFACodeGenerator::lowerStateMachine):
189         (WebCore::ContentExtensions::DFACodeGenerator::lowerNode):
190         (WebCore::ContentExtensions::DFACodeGenerator::getNextCharacter):
191         (WebCore::ContentExtensions::DFACodeGenerator::callAddActionFunction):
192         * contentextensions/DFACompiler.h: Copied from Source/WebCore/contentextensions/DFA.h.
193
194 2015-02-17  Chris Dumez  <cdumez@apple.com>
195
196         Rename ScopedEventQueue::instance() to singleton()
197         https://bugs.webkit.org/show_bug.cgi?id=141738
198
199         Reviewed by Daniel Bates.
200
201         Rename ScopedEventQueue::instance() to singleton(), as per coding
202         style. Also modernize the code a little bit.
203
204         * dom/EventDispatcher.cpp:
205         (WebCore::EventDispatcher::dispatchScopedEvent):
206         * dom/ScopedEventQueue.cpp:
207         (WebCore::ScopedEventQueue::singleton):
208         (WebCore::ScopedEventQueue::dispatchAllEvents):
209         (WebCore::ScopedEventQueue::incrementScopingLevel):
210         (WebCore::ScopedEventQueue::decrementScopingLevel):
211         (WebCore::ScopedEventQueue::ScopedEventQueue): Deleted.
212         (WebCore::ScopedEventQueue::~ScopedEventQueue): Deleted.
213         (WebCore::ScopedEventQueue::instance): Deleted.
214         * dom/ScopedEventQueue.h:
215         (WebCore::EventQueueScope::EventQueueScope):
216         (WebCore::EventQueueScope::~EventQueueScope):
217
218 2015-02-17  Chris Dumez  <cdumez@apple.com>
219
220         Remove dead code from FontCache
221         https://bugs.webkit.org/show_bug.cgi?id=141741
222
223         Reviewed by Daniel Bates.
224
225         Remove dead code from FontCache:
226         - getFontFamilyForCharacters() has no implementation.
227         - SimpleFontFamily is unused.
228
229         * platform/graphics/FontCache.h:
230
231 2015-02-17  Chris Dumez  <cdumez@apple.com>
232
233         Rename CSSPropertyAnimationWrapperMap::instance() to singleton()
234         https://bugs.webkit.org/show_bug.cgi?id=141739
235
236         Reviewed by Simon Fraser.
237
238         Rename CSSPropertyAnimationWrapperMap::instance() to singleton(), as
239         per coding style.
240
241         * page/animation/CSSPropertyAnimation.cpp:
242         (WebCore::CSSPropertyAnimationWrapperMap::singleton):
243         (WebCore::CSSPropertyAnimation::blendProperties):
244         (WebCore::CSSPropertyAnimation::animationOfPropertyIsAccelerated):
245         (WebCore::CSSPropertyAnimation::animatableShorthandsAffectingProperty):
246         (WebCore::CSSPropertyAnimation::propertiesEqual):
247         (WebCore::CSSPropertyAnimation::getPropertyAtIndex):
248         (WebCore::CSSPropertyAnimation::getNumProperties):
249         (WebCore::CSSPropertyAnimationWrapperMap::instance): Deleted.
250
251 2015-02-17  David Kilzer  <ddkilzer@apple.com>
252
253         REGRESSION (r180224): Remove unused generate-export-file script
254         <http://webkit.org/b/141491>
255
256         * generate-export-file: Removed.  This was the script used to
257         create WebCore.exp files for iOS since we couldn't compile a
258         host-side tool to run like we did on Mac OS X.  Dont't tell
259         anyone, but this was an epic hack I created while merging open
260         source changes to the internal iOS WebKit repository around the
261         time that the WebCore.exp.in file was created.  End of an era.
262
263 2015-02-17  David Kilzer  <ddkilzer@apple.com>
264
265         SoftLinking.h: Update copyright and license; clean up whitespace
266
267         * platform/win/SoftLinking.h:
268
269 2015-02-17  Chris Dumez  <cdumez@apple.com>
270
271         Slight CachedPage class clean up
272         https://bugs.webkit.org/show_bug.cgi?id=141693
273
274         Reviewed by Andreas Kling.
275
276         Slight CachedPage class clean up:
277         - Drop unnecessary m_timeStamp data member
278         - Protect m_needsCaptionPreferencesChanged data member with
279           #if ENABLE(VIDEO_TRACK)
280         - Merge destroy() method into the destructor as this is the
281           only caller
282         - Update clear() to reset 2 data members that were missing
283
284 2015-02-17  Anders Carlsson  <andersca@apple.com>
285
286         Silence two -Wcast-qual warnings.
287         rdar://problem/19758266
288
289         * platform/ios/wak/WKUtilities.c:
290         (WKRetain):
291         (WKRelease):
292
293 2015-02-17  Zalan Bujtas  <zalan@apple.com>
294
295         Minor RenderTable* class cleanups.
296         https://bugs.webkit.org/show_bug.cgi?id=141707
297
298         Reviewed by Andreas Kling.
299
300         Use in-class initializer where possible.
301         Remove redundant code.
302         Move multiline implementations out of class declaration.
303
304         No change in functionality.
305
306         * rendering/RenderTableCaption.cpp:
307         (WebCore::RenderTableCaption::insertedIntoTree):
308         (WebCore::RenderTableCaption::willBeRemovedFromTree):
309         (WebCore::RenderTableCaption::containingBlockLogicalWidthForContent): Deleted.
310         * rendering/RenderTableCaption.h:
311         * rendering/RenderTableCell.cpp:
312         (WebCore::RenderTableCell::RenderTableCell):
313         * rendering/RenderTableCell.h:
314         (WebCore::RenderTableCell::colSpan):
315         (WebCore::RenderTableCell::rowSpan):
316         (WebCore::RenderTableCell::setCol):
317         (WebCore::RenderTableCell::col):
318         (WebCore::RenderTableCell::section):
319         (WebCore::RenderTableCell::table):
320         (WebCore::RenderTableCell::rowIndex):
321         (WebCore::RenderTableCell::styleOrColLogicalWidth):
322         (WebCore::RenderTableCell::logicalHeightForRowSizing):
323         (WebCore::RenderTableCell::isBaselineAligned):
324         (WebCore::RenderTableCell::borderAdjoiningTableStart):
325         (WebCore::RenderTableCell::borderAdjoiningTableEnd):
326         (WebCore::RenderTableCell::borderAdjoiningCellBefore):
327         (WebCore::RenderTableCell::borderAdjoiningCellAfter):
328         * rendering/RenderTableCol.cpp:
329         (WebCore::RenderTableCol::RenderTableCol):
330         * rendering/RenderTableCol.h:
331         (WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentBefore):
332         (WebCore::RenderTableCol::enclosingColumnGroupIfAdjacentAfter):
333         * rendering/RenderTableRow.h:
334         (WebCore::RenderTableRow::setRowIndex):
335         (WebCore::RenderTableRow::rowIndex):
336         (WebCore::RenderTableRow::borderAdjoiningTableStart):
337         (WebCore::RenderTableRow::borderAdjoiningTableEnd):
338         (WebCore::RenderTableRow::table):
339         (WebCore::RenderTableSection::firstRow):
340         (WebCore::RenderTableSection::lastRow):
341         * rendering/RenderTableSection.cpp:
342         (WebCore::RenderTableSection::RenderTableSection):
343         (WebCore::RenderTableSection::dirtiedRows):
344         (WebCore::RenderTableSection::dirtiedColumns):
345         (WebCore::RenderTableSection::paintObject):
346         (WebCore::RenderTableSection::nodeAtPoint):
347         * rendering/RenderTableSection.h:
348         (WebCore::CellSpan::CellSpan):
349         (WebCore::RenderTableSection::borderAdjoiningTableStart):
350         (WebCore::RenderTableSection::borderAdjoiningTableEnd):
351         (WebCore::RenderTableSection::cellAt):
352         (WebCore::RenderTableSection::primaryCellAt):
353         (WebCore::RenderTableSection::rowRendererAt):
354         (WebCore::RenderTableSection::outerBorderLeft):
355         (WebCore::RenderTableSection::outerBorderRight):
356         (WebCore::RenderTableSection::outerBorderTop):
357         (WebCore::RenderTableSection::outerBorderBottom):
358         (WebCore::RenderTableSection::numRows):
359         (WebCore::RenderTableSection::recalcCellsIfNeeded):
360         (WebCore::RenderTableSection::rowBaseline):
361         (WebCore::RenderTableSection::fullTableRowSpan):
362         (WebCore::CellSpan::start): Deleted.
363         (WebCore::CellSpan::end): Deleted.
364
365 2015-02-16  Dean Jackson  <dino@apple.com>
366
367         REGRESSION: Video control fails to hide after playback begins in reflowable EPUB files
368         https://bugs.webkit.org/show_bug.cgi?id=141689
369         <rdar://problem/19689286>
370
371         Reviewed by Eric Carlson.
372
373         The iBooks app turns off the requirement for a user gesture
374         before triggering playback. When we moved to script-based
375         media controls there were a few regressions in this setup.
376         This makes them behave a lot more like iOS 7.
377
378         * Modules/mediacontrols/mediaControlsApple.js:
379         (Controller.prototype.setPlaying): We don't want to hide the controls
380         yet, just start a hiding timer.
381         * Modules/mediacontrols/mediaControlsiOS.js:
382         (ControllerIOS.prototype.shouldHaveStartPlaybackButton): If we've ever
383         played before, we don't want to show the big start button. If we
384         are in the middle of construction, we do want to show it. We no
385         longer care about the case where you're not in setup and have
386         the relaxed restrictions (we still want to show the start button
387         in that case).
388         (ControllerIOS.prototype.showControls): When we show the controls,
389         make sure our timeline is up to date. This is necessary for the
390         cases where we automatically show the controls, such as when we hit
391         the end of a video.
392         (ControllerIOS.prototype.updateTime): Make sure to pass the forceUpdate
393         parameter on to the super-method.
394         (ControllerIOS.prototype.setPlaying):
395         (ControllerIOS.prototype.progressFillStyle): Deleted.
396
397 2015-02-17  Chris Dumez  <cdumez@apple.com>
398
399         Access MemoryPressureHandler global instance via a singleton() static member function
400         https://bugs.webkit.org/show_bug.cgi?id=141691
401
402         Reviewed by Andreas Kling.
403
404         Access MemoryPressureHandler global instance via a singleton() static
405         member function as per coding style. Also make all other member
406         functions non-static as callers can just use singleton() to get the
407         instance and access methods. This avoid having to call
408         MemoryPressureHandler::singleton() from member functions.
409
410         * bindings/js/ScriptController.cpp:
411         (WebCore::collectGarbageAfterWindowShellDestruction):
412         * history/PageCache.cpp:
413         (WebCore::PageCache::canCache):
414         * loader/FrameLoader.cpp:
415         (WebCore::FrameLoader::commitProvisionalLoad):
416         * page/FrameView.cpp:
417         (WebCore::FrameView::willPaintContents):
418         (WebCore::FrameView::didPaintContents):
419         (WebCore::FrameView::computeCoverageRect):
420         * platform/MemoryPressureHandler.cpp:
421         (WebCore::MemoryPressureHandler::singleton):
422         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
423         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
424         (WebCore::memoryPressureHandler): Deleted.
425         * platform/MemoryPressureHandler.h:
426         (WebCore::MemoryPressureHandler::setLowMemoryHandler):
427         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
428         (WebCore::MemoryPressureHandler::platformReleaseMemory):
429         (WebCore::MemoryPressureHandler::install):
430         (WebCore::MemoryPressureHandler::holdOff):
431         (WebCore::respondToMemoryPressureCallback):
432         * platform/graphics/FontCache.cpp:
433         (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
434         * platform/ios/LegacyTileCache.mm:
435         (WebCore::LegacyTileCache::createTilesInActiveGrid):
436         * platform/ios/LegacyTileGrid.mm:
437         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage):
438         * platform/ios/LegacyTileLayerPool.mm:
439         (WebCore::LegacyTileLayerPool::addLayer):
440         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
441         (WebCore::TileControllerMemoryHandler::tileControllerGainedUnparentedTiles):
442         * platform/linux/MemoryPressureHandlerLinux.cpp:
443         (WebCore::MemoryPressureHandler::waitForMemoryPressureEvent):
444
445 2015-02-17  Alex Christensen  <achristensen@webkit.org>
446
447         Remove WebCore.exp.in and clean up.
448         https://bugs.webkit.org/show_bug.cgi?id=141491
449
450         Reviewed by Andreas Kling.
451
452         * Configurations/WebCore.xcconfig:
453         Don't use exported symbols files.
454         * DerivedSources.make:
455         Don't generate export files.
456         * WebCore.exp.in: Removed.
457         * WebCore.xcodeproj/project.pbxproj:
458         Removed WebCoreExportFileGenerator targets.
459         * make-export-file-generator: Removed.
460
461 2015-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
462
463         Use HashMap::add instead of get/contains + set in DOMObjectCache
464         https://bugs.webkit.org/show_bug.cgi?id=141558
465
466         Rubber-stamped by Žan Doberšek.
467
468         * bindings/gobject/DOMObjectCache.cpp:
469         (WebKit::getOrCreateDOMObjectCacheFrameObserver):
470         (WebKit::DOMObjectCache::put):
471
472 2015-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
473
474         [GTK] GObject DOM bindings object are cached forever
475         https://bugs.webkit.org/show_bug.cgi?id=141558
476
477         Reviewed by Sergio Villar Senin.
478
479         Rework the DOMObjectCache to avoid having to manually clear the
480         objects when the frame is destroyed, using a FrameDestructionObserver
481         instead. When a new object associated to a Frame is added to the
482         cache, a FrameDestructionObserver is created for the frame if
483         needed, and the DOM object is tracked by the observer too. When
484         the frame is detached from the page all its objects are cleared,
485         and if the aren't additional references, the object is finalized
486         and removed from the cache normally.
487         This patch also simplifies and modernizes the code to make it
488         easier to read an maintain.
489
490         * bindings/gobject/DOMObjectCache.cpp:
491         (WebKit::DOMObjectCacheData::DOMObjectCacheData): Add constructor
492         to initialize its members and simplify the callers.
493         (WebKit::DOMObjectCacheData::clearObject): Remove the references
494         added by the cache, ensuring the GObject is not finalized until
495         the method returns.
496         (WebKit::DOMObjectCacheData::refObject): Adds a reference owned by
497         the cache.
498         (WebKit::domObjectCacheFrameObservers): Map a frame to a FrameDestructionObserver.
499         (WebKit::getOrCreateDOMObjectCacheFrameObserver): Create a new
500         FrameDestructionObserver for the given Frame or return the
501         existing one.
502         (WebKit::domObjects): Map wrapped object to wrapper object.
503         (WebKit::DOMObjectCache::forget): Remove the wrapped object from
504         the cache.
505         (WebKit::DOMObjectCache::get): Return the wrapped object if it is
506         in the cache, increasing the cache references.
507         (WebKit::DOMObjectCache::put): Add the wrapper object to the cache
508         for the given wrapped object. If it's a Node and has a frame add
509         the node to the FrameDestructionObserver corresponding to the frame.
510         (WebKit::getFrameFromHandle): Deleted.
511         (WebKit::weakRefNotify): Deleted.
512         (WebKit::DOMObjectCache::clearByFrame): Deleted.
513         (WebKit::DOMObjectCache::~DOMObjectCache): Deleted.
514         * bindings/gobject/DOMObjectCache.h:
515
516 2015-02-17  ChangSeok Oh  <changseok.oh@collabora.com>
517
518         REGRESSION(r180050): It broke the !ENABLE(CSS_GRID_LAYOUT) build
519         https://bugs.webkit.org/show_bug.cgi?id=141647
520
521         Reviewed by Csaba Osztrogonác.
522
523         No new tests since this just fixes a build break.
524
525         * dom/Position.cpp: Add a build guard ENABLE(CSS_GRID_LAYOUT) for RenderGrid.
526         (WebCore::Position::isCandidate):
527
528 2015-02-16  Chris Dumez  <cdumez@apple.com>
529
530         Keep all memory cache resources in ListHashSets
531         https://bugs.webkit.org/show_bug.cgi?id=141667
532
533         Reviewed by Andreas Kling.
534
535         Keep all memory cache resources in ListHashSets instead of manual linked
536         lists. This simplifies the code a lot and is also more efficient for
537         retrieving / removing particular CachedResources.
538
539         * loader/cache/CachedResource.cpp:
540         (WebCore::CachedResource::CachedResource):
541         * loader/cache/CachedResource.h:
542         * loader/cache/MemoryCache.cpp:
543         (WebCore::MemoryCache::pruneDeadResourcesToSize):
544         (WebCore::MemoryCache::removeFromLRUList):
545         (WebCore::MemoryCache::insertInLRUList):
546         (WebCore::MemoryCache::dumpLRULists):
547         (WebCore::MemoryCache::lruListFor): Deleted.
548         * loader/cache/MemoryCache.h:
549
550 2015-02-16  Benjamin Poulain  <benjamin@webkit.org>
551
552         CSS JIT: finish :nth-last-child()
553         https://bugs.webkit.org/show_bug.cgi?id=141629
554
555         Reviewed by Andreas Kling.
556
557         This patch adds the matcher for :nth-child(An+B of selector list) and
558         fix a small bug I discovered while working on it.
559
560         The matcher is straightforward: count the next siblings matching the selector,
561         nothing fancy.
562
563         While working on it I noticed I forgot the test for IsParsingChildrenFinished
564         on the simple version of :nth-last-child(). I add it in both matcher, write
565         a couple of tests, the first part of the tests now succeed, but the second part
566         fails...
567
568         What happened is:
569         1) We interupt the parsing to execute the JavaScript.
570            From there, we force the style resolution to get the computed style.
571         2) When resolving the style, the early check for isFinishedParsingChildren()
572            quits the function early. This is done *before* we marked the parent
573            for :nth-last-child() style resolution.
574         3) After the script, parsing resume and the following elements are added.
575         4) When resolving the style, only the new elements are marked dirty,
576            the elements pending their :nth-last-child() style never get udpated.
577
578         To fix the problem, I moved the test for FinishedParsingChildren after
579         the parent marking.
580
581         Honestly, those early return for FinishedParsingChildren need to be refined
582         and they should be tested properly. We should not do this kind of things
583         for Query for example.
584
585         Tests: fast/selectors/nth-last-child-cannot-match-during-parsing-1.html
586                fast/selectors/nth-last-child-cannot-match-during-parsing-2.html
587                fast/selectors/nth-last-child-of-cannot-match-during-parsing-1.html
588                fast/selectors/nth-last-child-of-cannot-match-during-parsing-2.html
589                fast/selectors/nth-last-child-of-register-requirement.html
590
591         * css/SelectorChecker.cpp:
592         (WebCore::SelectorChecker::checkOne):
593         Fix the tree marking.
594
595         * cssjit/SelectorCompiler.cpp:
596         (WebCore::SelectorCompiler::addPseudoClassType):
597         The fragment creation was already done, all I had to do was
598         accept the compile.
599
600         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
601         :nth-child() and :nth-last-child() with a selector list are heavier than :not()
602         and :matches(), move them accordingly.
603
604         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
605         More the early return after the tree marking.
606
607         (WebCore::SelectorCompiler::setParentAffectedByLastChildOf):
608         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
609         New matcher, nothing optimized yet.
610
611 2015-02-16  Tim Horton  <timothy_horton@apple.com>
612
613         Adopt CAMachPort-as-layer-contents
614         https://bugs.webkit.org/show_bug.cgi?id=141687
615         <rdar://problem/19393233>
616
617         Reviewed by Simon Fraser.
618
619         No new tests, just a performance bump.
620
621         * platform/cocoa/MachSendRight.h:
622         (WebCore::MachSendRight::operator bool):
623         Add an operator bool() that checks if the underlying port is nonnull.
624
625         * platform/spi/cocoa/QuartzCoreSPI.h:
626         Add some SPI.
627
628 2015-02-15  Sam Weinig  <sam@webkit.org>
629
630         Add experimental <attachment> element support
631         https://bugs.webkit.org/show_bug.cgi?id=141626
632
633         Reviewed by Tim Horton.
634
635         Adds scaffolding for an experimental implementation of an <attachment> element
636         which can represent a file attachment (e.g. NSTextAttachment in NSAttributedString
637         parlance).
638
639         The implementation is guarded by both an #ifdef (ENABLE(ATTACHMENT_ELEMENT)) and 
640         a setting (Settings::attachmentElementEnabled()).
641
642         Tests: fast/attachment/attachment-disabled-dom.html
643                fast/attachment/attachment-disabled-rendering.html
644                fast/attachment/attachment-dom.html
645                fast/attachment/attachment-rendering.html
646
647         * Configurations/FeatureDefines.xcconfig:
648         Add new ENABLE_ATTACHMENT_ELEMENT macro.
649
650         * CMakeLists.txt:
651         * WebCore.vcxproj/WebCore.vcxproj:
652         * WebCore.xcodeproj/project.pbxproj:
653         Add new files.
654
655         * dom/make_names.pl:
656         Add support for checking a setting to determine if a particular tag should be exposed.
657
658         * html/HTMLAttachmentElement.cpp: Added.
659         * html/HTMLAttachmentElement.h: Added.
660         Stub out the basics of the new element.
661
662         * html/HTMLElementsAllInOne.cpp:
663         Add HTMLAttachmentElement.cpp.
664
665         * html/HTMLTagNames.in:
666         Add 'attachment'.
667
668         * page/Settings.in:
669         Add attachmentElementEnabled setting.
670
671         * rendering/RenderAttachment.cpp: Added.
672         * rendering/RenderAttachment.h: Added.
673         Stub out the basics of the new render. We will probably want to replace this with
674         a non-replaced render, but this will do as a placeholder for now.
675
676         * rendering/RenderObject.h:
677         (WebCore::RenderObject::isAttachment):
678         Add predicate for type casting.
679
680         * rendering/RenderingAllInOne.cpp:
681         Add RenderAttachment.cpp.
682
683 2015-02-16  Andreas Kling  <akling@apple.com>
684
685         GC (almost) immediately when navigating under memory pressure.
686         <https://webkit.org/b/141663>
687
688         Reviewed by Geoffrey Garen.
689
690         Since the PageCache is already disabled in memory pressure situations,
691         we know that detaching the old window shell on navigation is basically
692         guaranteed to generate a bunch of garbage, we can soften the memory
693         peak a bit by doing a GC right away instead of scheduling one for soon(tm).
694
695         * bindings/js/GCController.cpp:
696         (WebCore::GCController::GCController):
697         (WebCore::GCController::garbageCollectSoon):
698         (WebCore::GCController::garbageCollectOnNextRunLoop):
699         (WebCore::GCController::gcTimerFired):
700         * bindings/js/GCController.h:
701
702             Add a GCController::garbageCollectOnNextRunLoop() complement to the
703             "soon" and "now" options. There was already a zero timer in here for
704             non-CF builds, so I just used that same timer to implement this
705             and have the non-CF code path call garbageCollectOnNextRunLoop().
706
707         * bindings/js/ScriptController.cpp:
708         (WebCore::collectGarbageAfterWindowShellDestruction):
709         (WebCore::ScriptController::~ScriptController):
710         (WebCore::ScriptController::clearWindowShell):
711
712             Under system memory pressure conditions, schedule a full GC on next
713             runloop iteration instead of just asking for it to happen soon.
714             We do it on next runloop to ensure that there's no pointer to the
715             window object on the stack.
716
717 2015-02-16  Enrica Casucci  <enrica@apple.com>
718
719         Emoji sequences do not render properly.
720         https://bugs.webkit.org/show_bug.cgi?id=141661
721         rdar://problem/19820463
722
723         Reviewed by Sam Weinig.
724
725         Emoji sequences and emoji with variations should be rendered
726         using the Complex code path and should be treated as graphemes.
727         This change modifies advanceByCombiningCharacterSequence to add
728         this logic.
729
730         Test: fast/text/emoji.html
731
732         * WebCore.xcodeproj/project.pbxproj:
733         * platform/graphics/FontCascade.cpp:
734         (WebCore::FontCascade::characterRangeCodePath):
735         * platform/graphics/mac/ComplexTextController.cpp:
736         (WebCore::advanceByCombiningCharacterSequence): Implements a simple
737         logic to treat emoji sequences and emoji with variations as graphemes.
738         * platform/text/CharacterProperties.h: Added.
739         (WebCore::isEmojiGroupCandidate):
740         (WebCore::isEmojiModifier):
741         (WebCore::isVariationSelector):
742         * rendering/RenderText.cpp:
743         (WebCore::isEmojiGroupCandidate): Deleted.
744         (WebCore::isEmojiModifier): Deleted.
745
746 2015-02-16  Zalan Bujtas  <zalan@apple.com>
747
748         RenderTableRow should check if it has access to its ancestor chain.
749         https://bugs.webkit.org/show_bug.cgi?id=141668
750
751         Reviewed by Andreas Kling.
752
753         Preventive fix.
754
755         * rendering/RenderTableRow.cpp:
756         (WebCore::RenderTableRow::styleDidChange):
757         (WebCore::RenderTableRow::addChild):
758         * rendering/RenderTableRow.h:
759
760 2015-02-16  Jer Noble  <jer.noble@apple.com>
761
762         [iOS] Build fix: declare undeclared identifier 'credential'.
763
764         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
765         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential):
766
767 2015-02-16  Jer Noble  <jer.noble@apple.com>
768
769         [iOS] Unable to play .mp4 file over http with basic http authentication
770         https://bugs.webkit.org/show_bug.cgi?id=141503
771         rdar://problem/15799844
772
773         Reviewed by Alexey Proskuryakov.
774
775         On iOS, CFNetwork is used for authentication, so the NSURLAuthenticationChallenge
776         provided by AVAssetResourceLoader needs to be shoehorned into a AuthenticationChallenge
777         object by way of CFURLAuthChallengeRef.
778
779         Create a new class, WebCoreNSURLAuthenticationChallengeClient, whose sole purpose
780         is to take AuthenticationChallengeClient callbacks and pass them along to a
781         NSURLAuthenticationChallenge sender.
782
783         Create a NSURLAuthenticationChallenge out of the CF version through an SPI, and add
784         that SPI to a new header. Drive-by fix: take two of our existing SPI calls and move
785         them into that same header.
786
787         * WebCore.xcodeproj/project.pbxproj: Add CFNSURLConnectionSPI.h to project.
788         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
789         (WebCore::WebCoreNSURLAuthenticationChallengeClient::create): Factory.
790         (WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient): Simple constructor.
791         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCredential): Pass to m_challenge.
792         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToContinueWithoutCredential): Ditto.
793         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedCancellation): Ditto.
794         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedRequestToPerformDefaultHandling): Ditto.
795         (WebCore::WebCoreNSURLAuthenticationChallengeClient::receivedChallengeRejection): Ditto.
796         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
797             Create an AuthenticationChallenge out of the nsChallenge and client and pass it up
798             to the HTMLMediaElement.
799         * platform/network/mac/AuthenticationMac.mm:
800         * platform/spi/cocoa/CFNSURLConnectionSPI.h: Added.
801
802 2015-02-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
803
804         Revert a change in SVGRenderSupport::mapLocalToContainer committed for fixing <https://bugs.webkit.org/show_bug.cgi?id=119626>.
805         https://bugs.webkit.org/show_bug.cgi?id=138439
806
807         Reviewed by Darin Adler.
808
809         The change http://trac.webkit.org/changeset/164861 was ported from Blink
810         but it was was revert later because it broke Chrome SVG rendering. It also
811         broke the WebKit SVG text search highlighting.
812         
813         Tests: svg/transforms/svg-geometry-crash.html: This test was added by the
814         blamed change. A new but correct solution is required to fix the assertion.
815
816         * rendering/svg/SVGRenderSupport.h:
817         * rendering/svg/SVGRenderSupport.cpp:
818         Notice that TransformState.applyTransform() does matrix-left-multiplication,
819         i.e. state = transform * state. But operator*() of AffineTransform and
820         MatrixTransform  does right multiply, i.e. this = this * transform.
821         
822         (WebCore::SVGRenderSupport::localToParentTransform): Have the calculation
823         of the SVG localToParentTransform in one shared function.
824         
825         (WebCore::SVGRenderSupport::mapLocalToContainer): Revert the Blink change.
826         If the parent is the SVG root, the transform state should be equal to
827         transform = svg_to_css_mapping * local_to_parent_mapping * transform.
828         
829         (WebCore::SVGRenderSupport::pushMappingToContainer): Get the localToParent
830         transform to be pushed in the geometryMap. If the parent is the SVG root,
831         localToParent = svg_to_css_mapping * local_to_parent_mapping. The original
832         code was doing the opposite and this is the cause of the assertion which 
833         was fixed wrongly by reversing the correct multiplication order in 
834         SVGRenderSupport::mapLocalToContainer().
835
836 2015-02-16  Zalan Bujtas  <zalan@apple.com>
837
838         RenderTableCell can't access its parent while in detached state.
839         https://bugs.webkit.org/show_bug.cgi?id=141639
840         rdar://problem/19850760
841
842         Reviewed by Simon Fraser.
843
844         Null check against ancestor chain so that certain methods in RenderTableCell can
845         be called even if the renderer is not yet attached.
846
847         Test: fast/table/table-cell-crash-when-detached-state.html
848
849         * rendering/RenderTableCell.cpp:
850         (WebCore::RenderTableCell::borderLeft):
851         (WebCore::RenderTableCell::borderRight):
852         (WebCore::RenderTableCell::borderTop):
853         (WebCore::RenderTableCell::borderBottom):
854         (WebCore::RenderTableCell::borderStart):
855         (WebCore::RenderTableCell::borderEnd):
856         (WebCore::RenderTableCell::borderBefore):
857         (WebCore::RenderTableCell::borderAfter):
858         * rendering/RenderTableCell.h:
859
860 2015-02-16  David Hyatt  <hyatt@apple.com>
861
862         Add ifdefs to avoid adjusting Ruby selection rects to avoid overlap on iOS.
863         https://bugs.webkit.org/show_bug.cgi?id=141651
864         <rdar://problem/19182526>
865         
866         Reviewed by Simon Fraser.
867
868         * rendering/RootInlineBox.cpp:
869         (WebCore::RootInlineBox::selectionTop):
870         (WebCore::RootInlineBox::selectionBottom):
871
872 2015-02-16  David Kilzer  <ddkilzer@apple.com>
873
874         SoftLinking.h: Update copyright and license; clean up whitespace
875
876         * platform/mac/SoftLinking.h:
877
878 2015-02-12  David Hyatt  <hyatt@apple.com>
879
880         text-underline-position:under has multiple correctness issues
881         https://bugs.webkit.org/show_bug.cgi?id=141528
882
883         Reviewed by Dean Jackson.
884
885         Added a bunch of new tests in fast/text
886
887         * rendering/InlineFlowBox.cpp:
888         (WebCore::InlineFlowBox::maxLogicalBottomForTextDecorationLine):
889         (WebCore::InlineFlowBox::minLogicalTopForTextDecorationLine):
890         (WebCore::InlineFlowBox::computeMaxLogicalBottom): Deleted.
891         * rendering/InlineFlowBox.h:
892         These functions have been re-written to take an enclosing renderer that specified the
893         decoration. This way they can properly limit the bottom/top computation to only line boxes
894         that are contained inside the renderer.
895
896         * rendering/InlineTextBox.cpp:
897         (WebCore::InlineTextBox::paintDecoration):
898         Tweak the call to get the decoration colors now that quirks mode has been removed.
899
900         * rendering/RenderElement.cpp:
901         (WebCore::RenderElement::enclosingRendererWithTextDecoration):
902         * rendering/RenderElement.h:
903         New function that finds the enclosing renderer that specified a text decoration. For now
904         this is only used in the "under" position computation, but soon we'll be using it
905         everywhere.
906
907         * rendering/RenderObject.cpp:
908         (WebCore::RenderObject::getTextDecorationColors):
909         * rendering/RenderObject.h:
910         Remove the quirks mode argument, since we were always passing true anyway (making the argument dead).
911
912         * rendering/RootInlineBox.cpp:
913         (WebCore::RootInlineBox::maxLogicalBottom): Deleted.
914         * rendering/RootInlineBox.h:
915         Get rid of these functions and just have InlineTextBoxStyle's computeUnderLineOffset function call
916         the InlineFlowBox functions directly.
917
918         * style/InlineTextBoxStyle.cpp:
919         (WebCore::computeUnderlineOffset):
920         Re-written to fetch the enclosingRendererWithTextDecoration so that it can be passed to the logical top/bottom
921         computation to limit which line boxes get included.
922
923 2015-02-16  Brent Fulgham  <bfulgham@apple.com>
924
925         FEGaussianBlur::calculateUnscaledKernelSize does unspeakable things with signed and unsigned values
926         https://bugs.webkit.org/show_bug.cgi?id=141596
927         <rdar://problem/19837103>
928
929         Reviewed by Zalan Bujtas.
930
931         No new tests. Covered by css3/filters/huge-blur-value.html
932
933         Avoid overflowing the signed integer values by not converting from unsigned
934         until the maximum size has been clamped to the expected max.
935
936         * platform/graphics/filters/FEGaussianBlur.cpp:
937         (WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
938
939 2015-02-13  Sergio Villar Senin  <svillar@igalia.com>
940
941         [CSS Grid Layout] Invalid initialization of track sizes with non spanning grid items
942         https://bugs.webkit.org/show_bug.cgi?id=140763
943
944         Reviewed by Antti Koivisto.
945
946         Content sized tracks with non-spanning grid items were not
947         properly sized because the growth limit was sometimes infinity
948         (-1) after calling resolveContentBasedTrackSizingFunctions() when
949         it should not. This patch adds an special initialization phase for
950         non-spanning grid items as the new track sizing algorithm
951         describes.
952
953         Granted, that was handled in the old algorithm in
954         distributeSpaceToTracks() as a special case. The problem is that
955         it regressed after the optimization added in r173868 because that
956         method is no longer called when the space to distribute is 0.
957
958         That's why we could fix this by allowing calls to
959         distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing
960         it with an explicit initialization our implementation becomes
961         closer to the new algorithm and the initialization is now explicit
962         in the code instead of a side effect of calling
963         distributeSpaceToTracks() with no space to be distributed. It also
964         brings a slight performance improvement as we save sorts and hash
965         lookups.
966
967         I also took the change to add caching to several GridTrackSize
968         methods that were hot on the profiler (each one accounted for ~1%
969         of the total time, now they account for ~0.3% each).
970
971         Test: fast/css-grid-layout/grid-initialize-span-one-items.html
972
973         * rendering/RenderGrid.cpp:
974         (WebCore::GridItemWithSpan::span): New helper method for ASSERTs.
975         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
976         Exclude non spanning grid items from the calls to
977         resolveContentBasedTrackSizingFunctionsForItems().
978         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
979         New method to resolve track sizes only using non-spanning grid
980         items.
981         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
982         Ensure that it isn't called for non-spanning grid items.
983         * rendering/RenderGrid.h:
984         * rendering/style/GridTrackSize.h:
985         (WebCore::GridTrackSize::GridTrackSize): Cache return values.
986         (WebCore::GridTrackSize::setLength): Ditto.
987         (WebCore::GridTrackSize::setMinMax): Ditto.
988         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes): New method
989         that caches the return values for hasXXXTrackBreadth() methods.
990         (WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth): Use
991         the cached return value.
992         (WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth): Ditto.
993         (WebCore::GridTrackSize::hasMinContentMaxTrackBreadth): Ditto.
994         (WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth): Ditto.
995         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadth): Ditto.
996         (WebCore::GridTrackSize::hasMinContentMinTrackBreadth): Ditto.
997         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
998         Ditto.
999         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
1000         Ditto.
1001
1002 2015-02-16  Milan Crha  <mcrha@redhat.com>
1003
1004         [GTK] Loading page into WebView shows g_closure_unref warning
1005         https://bugs.webkit.org/show_bug.cgi?id=127474
1006
1007         Reviewed by Carlos Garcia Campos.
1008
1009         * bindings/gobject/GObjectEventListener.cpp:
1010         (WebCore::GObjectEventListener::gobjectDestroyed):
1011
1012 2015-02-13  Sergio Villar Senin  <svillar@igalia.com>
1013
1014         [CSS Grid Layout] Remove the usage of Length(Undefined) in GridLength
1015         https://bugs.webkit.org/show_bug.cgi?id=141562
1016
1017         Reviewed by Chris Dumez.
1018
1019         From Blink r164154 by <timloh@chromium.org>
1020
1021         The patch simplifies some of the logic in creating and applying
1022         GridLength and GridTrackSize values to RenderStyles by using the
1023         constructors for initialisation instead of deferring to setters.
1024
1025         The rationale behind this change is that neither of
1026         createGridTrackSize() nor createGridTrackBreadth() should be able
1027         to fail, so these are changed to return objects directly instead
1028         of taking an out reference (note that in general failing in
1029         applying properties is incorrect and we should catch these in the
1030         parser).
1031
1032         The quirk value across to the Lengths was also removed because it
1033         doesn't apply to Grid.
1034
1035         * css/CSSPropertyNames.in:
1036         * css/StyleBuilderConverter.h:
1037         (WebCore::StyleBuilderConverter::createGridTrackBreadth): Return a
1038         GridLength instead of a bool.
1039         (WebCore::StyleBuilderConverter::createGridTrackSize): Return a
1040         GridTrackSize instead of a bool.
1041         (WebCore::StyleBuilderConverter::createGridTrackList): Do not
1042         create temporary GridTrackSizes with undefined Lengths.
1043         (WebCore::StyleBuilderConverter::convertGridTrackSize): Ditto.
1044         * rendering/style/GridLength.h:
1045         (WebCore::GridLength::GridLength): It now requires a mandatory
1046         Length argument.
1047         (WebCore::GridLength::length): Deleted.
1048         (WebCore::GridLength::setFlex): Deleted.
1049         * rendering/style/GridTrackSize.h:
1050         (WebCore::GridTrackSize::GridTrackSize): It now requires a
1051         mandatory GridLength argument.
1052         (WebCore::GridTrackSize::length): Removed no longer valid ASSERTs.
1053         (WebCore::GridTrackSize::minTrackBreadth): Ditto.
1054         (WebCore::GridTrackSize::maxTrackBreadth): Ditto.
1055         (WebCore::GridTrackSize::setLength): Deleted.
1056         (WebCore::GridTrackSize::setMinMax): Deleted.
1057         * rendering/style/RenderStyle.h:
1058
1059 2015-02-13  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
1060
1061         Removing text node does not remove its associated markers
1062         https://bugs.webkit.org/show_bug.cgi?id=140999
1063
1064         Reviewed by Ryosuke Niwa.
1065
1066         Removing text node via script does not remove its markers.
1067         For example, running the following script:
1068
1069         <script>
1070             var div = document.getElementById("testElement");
1071             div.focus();
1072             document.execCommand("InsertText", false, "welllcome ");
1073
1074             // Give a time async spellchecker to show its markers and
1075             // remove the node.
1076             setTimeout(function() { div.removeChild(div.firstChild); }, 100);
1077         </script>
1078
1079         will cause that DocumentMarkerController still stores the markers for
1080         detached node.
1081
1082         The same issue occurs when the text gets cleared, for example,
1083         <script>
1084             input.value = ""; // for HTMLTextAreaElement, HTMLInputElement
1085             // or
1086             div.innerHTML = ""; // for content editable
1087         </script>
1088
1089         No new tests. Internals marker APIs operate on text node attached
1090         to the element. To test it we could expose document().markers().hasMarkers()
1091         but there is no more useful cases where it could be used.
1092         Another obstacle is that we are in isInShadowTree() so that there is
1093         no possible to register on "DOMSubtreeModified" event.
1094         Test cases attached to the bug:
1095         1. input.value = ""  https://bug-140999-attachments.webkit.org/attachment.cgi?id=245704
1096         2. elem.removeChild(textNode) https://bug-140999-attachments.webkit.org/attachment.cgi?id=246515
1097
1098         Remove markers when text nodes are about to remove.
1099         * dom/Document.cpp:
1100         (WebCore::Document::nodeChildrenWillBeRemoved):
1101         Fixes input.value = ""
1102         (WebCore::Document::nodeWillBeRemoved):
1103         Fixes elem.removeChild(textNode)
1104
1105 2015-02-15  David Kilzer  <ddkilzer@apple.com>
1106
1107         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
1108         <http://webkit.org/b/141607>
1109
1110         This should fix the build, but leaves a FIXME list in
1111         WebCore.unexp.
1112
1113         * Configurations/WebCore.unexp: Add weak externals with a FIXME
1114         statement so they can be removed later.  It's more important to
1115         fix the build first.
1116
1117         * Configurations/WebCore.xcconfig: Change XCODE_VERSION_MINOR to
1118         XCODE_VERSION_MAJOR since the internal bots use version 5.1.1
1119         which still has the error.
1120
1121 2015-02-15  Brian J. Burg  <burg@cs.washington.edu>
1122
1123         Web Inspector: remove unused XHR replay code
1124         https://bugs.webkit.org/show_bug.cgi?id=141622
1125
1126         Reviewed by Timothy Hatcher.
1127
1128         XHR Replay functionality became unused with the last frontend rewrite.
1129         Remove instrumentation and data storage classes only used by this feature.
1130
1131         * inspector/InspectorInstrumentation.cpp:
1132         (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClientImpl): Deleted.
1133         (WebCore::InspectorInstrumentation::willLoadXHRImpl): Deleted.
1134         (WebCore::InspectorInstrumentation::didFailXHRLoadingImpl): Deleted.
1135         * inspector/InspectorInstrumentation.h:
1136         (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient): Deleted.
1137         (WebCore::InspectorInstrumentation::willLoadXHR): Deleted.
1138         (WebCore::InspectorInstrumentation::didFailXHRLoading): Deleted.
1139         * inspector/InspectorResourceAgent.cpp:
1140         (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
1141         (WebCore::InspectorResourceAgent::didFinishXHRLoading):
1142         (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): Deleted.
1143         (WebCore::InspectorResourceAgent::willLoadXHR): Deleted.
1144         (WebCore::InspectorResourceAgent::didFailXHRLoading): Deleted.
1145         (WebCore::InspectorResourceAgent::replayXHR): Deleted.
1146         * inspector/InspectorResourceAgent.h:
1147         * inspector/NetworkResourcesData.cpp:
1148         (WebCore::NetworkResourcesData::clear):
1149         (WebCore::XHRReplayData::create): Deleted.
1150         (WebCore::XHRReplayData::XHRReplayData): Deleted.
1151         (WebCore::NetworkResourcesData::xhrReplayData): Deleted.
1152         (WebCore::NetworkResourcesData::setXHRReplayData): Deleted.
1153         (WebCore::NetworkResourcesData::reuseXHRReplayData): Deleted.
1154         * inspector/NetworkResourcesData.h:
1155         (WebCore::XHRReplayData::method): Deleted.
1156         (WebCore::XHRReplayData::url): Deleted.
1157         (WebCore::XHRReplayData::async): Deleted.
1158         (WebCore::XHRReplayData::formData): Deleted.
1159         (WebCore::XHRReplayData::headers): Deleted.
1160         (WebCore::XHRReplayData::includeCredentials): Deleted.
1161         (WebCore::NetworkResourcesData::ResourceData::xhrReplayData): Deleted.
1162         (WebCore::NetworkResourcesData::ResourceData::setXHRReplayData): Deleted.
1163         * loader/DocumentThreadableLoader.cpp:
1164         (WebCore::DocumentThreadableLoader::loadRequest):
1165         * xml/XMLHttpRequest.cpp:
1166         (WebCore::XMLHttpRequest::createRequest):
1167         (WebCore::XMLHttpRequest::internalAbort):
1168         (WebCore::XMLHttpRequest::sendForInspectorXHRReplay): Deleted.
1169         * xml/XMLHttpRequest.h:
1170
1171 2015-02-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1172
1173         Crash when accessing an item in SVGTransformList and then removing a previous item from this list.
1174         https://bugs.webkit.org/show_bug.cgi?id=141550.
1175
1176         Reviewed by David Kilzer.
1177
1178         * svg/properties/SVGMatrixTearOff.h:
1179         (WebCore::SVGMatrixTearOff::create): Fix a compilation error on the release build.
1180         The ASSERT() here references a parameter which is not used anywhere else. We need 
1181         to change it to ASSERT_UNUSED(). 
1182
1183 2015-02-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1184
1185         Crash when accessing an item in SVGTransformList and then removing a previous item from this list.
1186         https://bugs.webkit.org/show_bug.cgi?id=141550.
1187
1188         Reviewed by Darin Adler.
1189
1190         Tests: LayoutTests/svg/dom/SVGTransformList-basics.xhtml: This test is modified to
1191         include a new test case.
1192
1193         * svg/properties/SVGMatrixTearOff.h: m_value of SVGMatrixTearOff will be a null
1194         pointer. There is no point in having SVGMatrixTearOff points to the parent and
1195         the property of the parent at the same time.
1196         
1197         (WebCore::SVGMatrixTearOff::create): SVGMatrixTearOff will hold a pointer to
1198         the parent SVGPropertyTearOff<SVGTransform>. But it should overrides setValue()
1199         and propertyReference() so it can set and get the SVGMatrix from the SVGTransform
1200         parent.
1201         
1202         (WebCore::SVGMatrixTearOff::SVGMatrixTearOff): Pass a nullptr to the base class.
1203         SVGMatrixTearOff will act as a proxy of the parent. It does not hold any data by
1204         itself but it knows what property to set and get from the parent.
1205         
1206         * svg/properties/SVGPropertyTearOff.h:
1207         (WebCore::SVGPropertyTearOff::create): Add a create method which can take a pointer value.
1208         
1209         (WebCore::SVGPropertyTearOff::propertyReference):
1210         (WebCore::SVGPropertyTearOff::setValue): Make these functions virtual so concrete classes
1211         like SVGMatrixTearOff can override them.
1212         
1213         (WebCore::SVGPropertyTearOff::SVGPropertyTearOff): Add a new constructor.
1214
1215 2015-02-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
1216
1217         Crash when accessing an item in SVGLengthList and then replacing it with a previous item in the list.
1218         https://bugs.webkit.org/show_bug.cgi?id=141552.
1219
1220         Reviewed by Darin Adler.
1221
1222         Tests: LayoutTests/svg/dom/SVGLengthList-basics.xhtml: This test is modified to
1223         include a new test case.
1224
1225         * svg/properties/SVGListPropertyTearOff.h: Commit the removal of the replacing item
1226         before trying to detach the wrapper of the item which going to be replaced.
1227
1228 2015-02-15  David Kilzer  <ddkilzer@apple.com>
1229
1230         CoreText only needs to be soft-linked on Windows
1231
1232         More work towards the Maverick Debug build fix:
1233
1234         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
1235         <http://webkit.org/b/141607>
1236
1237         * page/CaptionUserPreferencesMediaAF.cpp:
1238
1239 2015-02-15  Alexey Proskuryakov  <ap@apple.com>
1240
1241         More build fixing.
1242
1243         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
1244
1245 2015-02-14  Alexey Proskuryakov  <ap@apple.com>
1246
1247         More internal build fixing.
1248
1249         DDDFACache.h is not an actual private header, so we were using open source
1250         redeclaration of DDDFACacheRef with an internal function prototype from DDDFAScanner.h.
1251
1252         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
1253         (WebCore::TelephoneNumberDetector::phoneNumbersScanner):
1254
1255 2015-02-14  Benjamin Poulain  <benjamin@webkit.org>
1256
1257         Add the initial matching implementation for attribute selectors with case-insensitive value
1258         https://bugs.webkit.org/show_bug.cgi?id=141615
1259
1260         Reviewed by Andreas Kling.
1261
1262         Tests: fast/css/case-insensitive-attribute-selector-specificity.html
1263                fast/css/case-insensitive-attribute-selector-styling-html-1.html
1264                fast/css/case-insensitive-attribute-selector-styling-html-2.html
1265                fast/css/case-insensitive-attribute-selector-styling-html-3.html
1266                fast/css/case-insensitive-attribute-selector-styling-xhtml-1.xhtml
1267                fast/css/case-insensitive-attribute-selector-styling-xhtml-2.xhtml
1268                fast/css/case-insensitive-attribute-selector-styling-xhtml-3.xhtml
1269                fast/selectors/case-insensitive-attribute-bascis.html
1270                fast/selectors/case-insensitive-attribute-matching-style-attribute.html
1271                fast/selectors/case-insensitive-attribute-style-update.html
1272                fast/selectors/case-insensitive-attribute-with-case-sensitive-name.html
1273
1274         * css/SelectorChecker.cpp:
1275         (WebCore::SelectorChecker::checkOne):
1276         We already had case-insensitive value matching due to some legacy HTML
1277         behaviors where some attribute values would be matched case-insensitively
1278         depending on the attribute name.
1279
1280         For this patch, I just re-use the same mechanism. I used branches to try
1281         to convey the idea that matching is case sensitive by default unless
1282         the selector has a flag or we are in the weird HTML exception.
1283
1284         * cssjit/SelectorCompiler.cpp:
1285         (WebCore::SelectorCompiler::constructFragmentsInternal):
1286         Disable that case in the CSS JIT for now, I'll implement it later.
1287
1288 2015-02-14  David Kilzer  <ddkilzer@apple.com>
1289
1290         Declare soft-linked functions with extern "C" linkage
1291
1292         More work towards the Maverick Debug build fix:
1293
1294         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
1295         <http://webkit.org/b/141607>
1296
1297         * platform/mac/SoftLinking.h: Try declaring soft-linked
1298         functions with extern "C" linkage to see if they stop appearing
1299         as weak externals.  This has the added benefit that if the
1300         function signature changes, we'll get a build failure.
1301
1302 2015-02-14  Joseph Pecoraro  <pecoraro@apple.com>
1303
1304         [Mac] RetainPtr member cleanup, possible leaks
1305         https://bugs.webkit.org/show_bug.cgi?id=141616
1306
1307         Reviewed by Andreas Kling.
1308
1309         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1310         (-[WebSpeechSynthesisWrapper speakUtterance:]):
1311         Adopt the allocated object to avoid a possible leak.
1312
1313         * platform/mac/ScrollAnimatorMac.mm:
1314         (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
1315         Adopt to avoid unnecessary retain/autorelease.
1316
1317 2015-02-14  Joseph Pecoraro  <pecoraro@apple.com>
1318
1319         IncompleteMetaDataCue leak seen on leaks bot
1320         https://bugs.webkit.org/show_bug.cgi?id=141611
1321
1322         Reviewed by Eric Carlson.        
1323
1324         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
1325         (WebCore::IncompleteMetaDataCue::IncompleteMetaDataCue): Deleted.
1326         (WebCore::IncompleteMetaDataCue::~IncompleteMetaDataCue): Deleted.
1327         (WebCore::IncompleteMetaDataCue::cueData): Deleted.
1328         (WebCore::IncompleteMetaDataCue::startTime): Deleted.
1329         Convert to a struct and hold a list of structs instead of pointers.
1330
1331         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
1332         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
1333         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
1334         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
1335         Update use of IncompleteMetaDataCue and modernize related code.
1336
1337 2015-02-09  Brian J. Burg  <burg@cs.washington.edu>
1338
1339         Web Inspector: remove some unnecessary Inspector prefixes from class names in Inspector namespace
1340         https://bugs.webkit.org/show_bug.cgi?id=141372
1341
1342         Reviewed by Joseph Pecoraro.
1343
1344         * WebCore.exp.in:
1345         * inspector/InspectorApplicationCacheAgent.cpp:
1346         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
1347         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
1348         * inspector/InspectorApplicationCacheAgent.h:
1349         * inspector/InspectorCSSAgent.cpp:
1350         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
1351         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
1352         * inspector/InspectorCSSAgent.h:
1353         * inspector/InspectorController.cpp:
1354         (WebCore::InspectorController::InspectorController):
1355         (WebCore::InspectorController::inspectedPageDestroyed):
1356         (WebCore::InspectorController::connectFrontend):
1357         (WebCore::InspectorController::disconnectFrontend):
1358         (WebCore::InspectorController::show):
1359         (WebCore::InspectorController::close):
1360         (WebCore::InspectorController::dispatchMessageFromFrontend):
1361         * inspector/InspectorController.h:
1362         * inspector/InspectorDOMAgent.cpp:
1363         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1364         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
1365         * inspector/InspectorDOMAgent.h:
1366         * inspector/InspectorDOMDebuggerAgent.cpp:
1367         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
1368         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
1369         (WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
1370         (WebCore::InspectorDOMDebuggerAgent::willInsertDOMNode):
1371         (WebCore::InspectorDOMDebuggerAgent::willRemoveDOMNode):
1372         (WebCore::InspectorDOMDebuggerAgent::willModifyDOMAttr):
1373         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
1374         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
1375         * inspector/InspectorDOMDebuggerAgent.h:
1376         * inspector/InspectorDOMStorageAgent.cpp:
1377         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
1378         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
1379         * inspector/InspectorDOMStorageAgent.h:
1380         * inspector/InspectorDatabaseAgent.cpp:
1381         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
1382         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
1383         * inspector/InspectorDatabaseAgent.h:
1384         * inspector/InspectorDatabaseResource.cpp:
1385         (WebCore::InspectorDatabaseResource::bind):
1386         * inspector/InspectorDatabaseResource.h:
1387         * inspector/InspectorForwarding.h:
1388         * inspector/InspectorIndexedDBAgent.cpp:
1389         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
1390         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
1391         * inspector/InspectorIndexedDBAgent.h:
1392         * inspector/InspectorLayerTreeAgent.cpp:
1393         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
1394         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
1395         * inspector/InspectorLayerTreeAgent.h:
1396         * inspector/InspectorPageAgent.cpp:
1397         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
1398         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
1399         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
1400         * inspector/InspectorPageAgent.h:
1401         * inspector/InspectorReplayAgent.cpp:
1402         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
1403         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
1404         * inspector/InspectorReplayAgent.h:
1405         * inspector/InspectorResourceAgent.cpp:
1406         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
1407         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
1408         * inspector/InspectorResourceAgent.h:
1409         * inspector/InspectorStyleSheet.cpp:
1410         (WebCore::InspectorStyle::styleWithProperties):
1411         * inspector/InspectorTimelineAgent.cpp:
1412         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
1413         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
1414         * inspector/InspectorTimelineAgent.h:
1415         * inspector/InspectorWorkerAgent.cpp:
1416         (WebCore::InspectorWorkerAgent::WorkerFrontendChannel::WorkerFrontendChannel):
1417         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
1418         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
1419         * inspector/InspectorWorkerAgent.h:
1420         * inspector/PageRuntimeAgent.cpp:
1421         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
1422         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
1423         * inspector/PageRuntimeAgent.h:
1424         * inspector/WorkerInspectorController.cpp:
1425         (WebCore::WorkerInspectorController::~WorkerInspectorController):
1426         (WebCore::WorkerInspectorController::connectFrontend):
1427         (WebCore::WorkerInspectorController::disconnectFrontend):
1428         * inspector/WorkerInspectorController.h:
1429         * inspector/WorkerRuntimeAgent.cpp:
1430         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
1431         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
1432         * inspector/WorkerRuntimeAgent.h:
1433         * loader/EmptyClients.h:
1434         * page/PageDebuggable.cpp:
1435         (WebCore::PageDebuggable::connect):
1436         (WebCore::PageDebuggable::disconnect):
1437         * page/PageDebuggable.h:
1438         * testing/Internals.cpp:
1439         (WebCore::Internals::closeDummyInspectorFrontend):
1440         * workers/WorkerMessagingProxy.cpp:
1441         (WebCore::WorkerMessagingProxy::disconnectFromInspector):
1442
1443 2015-02-14  David Kilzer  <ddkilzer@apple.com>
1444
1445         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols
1446         <http://webkit.org/b/141607>
1447
1448         Work towards fixing the Mavericks Debug build.
1449
1450         * dom/Document.h:
1451         (WebCore::Document::setAnnotatedRegionsDirty):
1452         * dom/Event.h:
1453         (WebCore::Event::create):
1454         * dom/Node.h:
1455         (WebCore::Node::hasEditableStyle):
1456         * dom/Position.h:
1457         (WebCore::Position::Position):
1458         * editing/FrameSelection.h:
1459         (WebCore::DragCaretController::clear):
1460         * loader/ResourceLoader.h:
1461         (WebCore::ResourceLoader::originalRequest):
1462         - Do not mark inline methods for export.
1463
1464 2015-02-14  Alexey Proskuryakov  <ap@apple.com>
1465
1466         rel="noreferrer" should make window.opener null
1467         https://bugs.webkit.org/show_bug.cgi?id=141579
1468
1469         Reviewed by Darin Adler.
1470
1471         Tests: http/tests/navigation/target-blank-opener-post.html
1472                http/tests/navigation/target-blank-opener.html
1473
1474         We used to avoid passing window.opener policy by temporarily storing it in a FrameLoader
1475         member variable. This works for some clients - ones that invoke delegate callbacks
1476         synchronously - but not in the general case.
1477
1478         So, changed to passing the policy explicitly.
1479
1480         * WebCore.exp.in:
1481         * loader/FrameLoader.cpp:
1482         (WebCore::FrameLoader::FrameLoader):
1483         (WebCore::FrameLoader::urlSelected):
1484         (WebCore::FrameLoader::loadURLIntoChildFrame):
1485         (WebCore::FrameLoader::loadFrameRequest):
1486         (WebCore::FrameLoader::loadURL):
1487         (WebCore::FrameLoader::load):
1488         (WebCore::FrameLoader::loadPostRequest):
1489         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1490         * loader/FrameLoader.h:
1491         (WebCore::FrameLoader::suppressOpenerInNewFrame): Deleted.
1492         * loader/FrameLoaderTypes.h:
1493         * loader/NavigationScheduler.cpp:
1494         * page/ContextMenuController.cpp:
1495         (WebCore::openNewWindow):
1496         (WebCore::ContextMenuController::contextMenuItemSelected):
1497
1498 2015-02-14  David Kilzer  <ddkilzer@apple.com>
1499
1500         REGRESSION (r180082): WebCore build on Mountain Lion fails due to weak export for i386
1501         <rdar://problem/19838127>
1502
1503         * Configurations/WebCore.unexp: Add missing symbol.
1504
1505 2015-02-13  Chris Dumez  <cdumez@apple.com>
1506
1507         RenderListItem resets its marker's style on style change even if the diff is StyleDifferenceEqual
1508         https://bugs.webkit.org/show_bug.cgi?id=141572
1509         <rdar://problem/19759818>
1510
1511         Reviewed by Simon Fraser.
1512
1513         Do not unnecessarily update the marker's style in RenderListItem::styleDidChange()
1514         if the RenderStyle diff is StyleDifferenceEqual. Doing so can cause unnecessary
1515         layouts.
1516
1517         This was causing high cpu usage on
1518         http://www.nokogiri.org/tutorials/searching_a_xml_html_document.html because there
1519         is an animation that changes the style every second (but the diff is equal) and the
1520         RenderListItem keeps resetting its marker's margin, which triggers a layout and the
1521         RenderListMarker re-computes its margin during layout and updates its style again.
1522
1523         With this change, CPU usage on the page goes from 150% to 20%. There is only a style
1524         recalc happening every second, no more relayouts and repaints.
1525
1526         Test: fast/repaint/list-item-equal-style-change-no-repaint.html
1527
1528         * rendering/RenderListItem.cpp:
1529         (WebCore::RenderListItem::styleDidChange):
1530
1531 2015-02-13  Timothy Horton  <timothy_horton@apple.com>
1532
1533         Make WebCore::IOSurface have single ownership instead of refcounting
1534         https://bugs.webkit.org/show_bug.cgi?id=141578
1535
1536         Reviewed by Anders Carlsson.
1537
1538         In the interests of making it harder to misuse and to make it more like
1539         ImageBuffer, our IOSurface wrapper should have single ownership.
1540
1541         This will also allow future changes which depend on temporarily
1542         consuming an IOSurface to more easily enforce correct usage.
1543
1544         * WebCore.exp.in:
1545         * platform/graphics/cg/IOSurfacePool.cpp:
1546         (WebCore::IOSurfacePool::takeSurface):
1547         (WebCore::IOSurfacePool::addSurface):
1548         (WebCore::IOSurfacePool::insertSurfaceIntoPool):
1549         (WebCore::IOSurfacePool::tryEvictInUseSurface):
1550         (WebCore::IOSurfacePool::tryEvictOldestCachedSurface):
1551         (WebCore::IOSurfacePool::collectInUseSurfaces):
1552         * platform/graphics/cg/IOSurfacePool.h:
1553         * platform/graphics/cocoa/IOSurface.h:
1554         * platform/graphics/cocoa/IOSurface.mm:
1555         (IOSurface::create):
1556         (IOSurface::createFromSendRight):
1557         (IOSurface::createFromSurface):
1558         (IOSurface::createFromImage):
1559         Make IOSurface::create()s return a unique_ptr, and adjust everywhere.
1560
1561 2015-02-12  Enrica Casucci  <enrica@apple.com>
1562
1563         Additional emoji group support.
1564         https://bugs.webkit.org/show_bug.cgi?id=141539
1565         rdar://problem/19727527
1566
1567         Reviewed by Sam Weinig.
1568
1569         Adding some new emoji ligatures.
1570         Updated existing test to include the new sequences.
1571
1572         * platform/text/TextBreakIterator.cpp:
1573         (WebCore::cursorMovementIterator):
1574         * rendering/RenderText.cpp:
1575         (WebCore::isEmojiGroupCandidate):
1576
1577 2015-02-13  Alex Christensen  <achristensen@webkit.org>
1578
1579         Really stop using export files.
1580         https://bugs.webkit.org/show_bug.cgi?id=141521
1581
1582         Reviewed by Mark Rowe.
1583
1584         * Configurations/WebCore.xcconfig:
1585         Don't use exported symbols files.
1586         * Configurations/WebCore.unexp:
1587         Added list of symbols not to export (needed by Xcode 5.0.2).
1588
1589 2015-02-13  Zalan Bujtas  <zalan@apple.com>
1590
1591         Simplify ASSERT in lastRubyRun().
1592         https://bugs.webkit.org/show_bug.cgi?id=141574
1593
1594         Reviewed by Daniel Bates.
1595
1596         r180064 made some of the conditions in the ASSERT redundant.
1597
1598         Covered by existing tests.
1599
1600         * rendering/RenderRuby.cpp:
1601         (WebCore::lastRubyRun):
1602
1603 2015-02-13  Brent Fulgham  <bfulgham@apple.com>
1604
1605         [Mac, iOS] Adjust pagination behavior for Mail.app printing use
1606         https://bugs.webkit.org/show_bug.cgi?id=141569
1607         <rdar://problem/14912763>
1608
1609         Reviewed by Anders Carlsson.
1610
1611         * page/Settings.in: Add new pagination setting flag.
1612         * rendering/RenderBlockFlow.cpp:
1613         (WebCore::messageContainerName): Added.
1614         (WebCore::needsPaginationQuirk): Added.
1615         (WebCore::RenderBlockFlow::adjustLinePositionForPagination): Don't move the message content
1616         div to a new page when using this special printing mode.
1617
1618 2015-02-13  Daniel Bates  <dabates@apple.com>
1619
1620         [iOS] DumpRenderTree.app fails to link due to undefined classes
1621         <rdar://problem/19831228>
1622
1623         Following r179945, DumpRenderTree.app fails to link due to undefined symbols:
1624
1625         Undefined symbols for architecture x86_64:
1626           "_OBJC_CLASS_$_WebEvent", referenced from:
1627               objc-class-ref in libDumpRenderTree.a(EventSendingController.o)
1628           "_OBJC_CLASS_$_WebUndefined", referenced from:
1629               objc-class-ref in libDumpRenderTree.a(ObjCController.o)
1630
1631         We need to export the classes WebScriptObject and WebEvent.
1632
1633         * bindings/objc/WebScriptObject.h:
1634         * platform/ios/WebEvent.h:
1635
1636 2015-02-13  Andreas Kling  <akling@apple.com>
1637
1638         CachedResource::clearLoader() should self-destruct if nothing else retains the CachedResource.
1639         <https://webkit.org/b/141568>
1640         <rdar://problem/19800310>
1641
1642         Reviewed by Antti Koivisto.
1643
1644         Anything that may cause CachedResource::canDelete() to return true must also make sure
1645         to call CachedResource::deleteIfPossible(), or we risk leaking the CachedResource.
1646         This is because CachedResource employs an extremely convoluted lifetime mechanism that
1647         depends on its presence in a number of collections, as well as internal counters and
1648         state.
1649
1650         This is a speculative fix for a potential CachedResource leak that I'm not sure exists
1651         in practice, but let's be good citizens here.
1652
1653         * loader/cache/CachedResource.cpp:
1654         (WebCore::CachedResource::clearLoader):
1655
1656 2015-02-13  Jer Noble  <jer.noble@apple.com>
1657
1658         [MSE][Mac] Crash at WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset + 2357
1659         https://bugs.webkit.org/show_bug.cgi?id=141566
1660         rdar://problem/19826075
1661
1662         Reviewed by Andreas Kling.
1663
1664         Null check m_mediaSource before dereferencing.
1665
1666         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1667         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
1668
1669 2015-02-13  Zalan Bujtas  <zalan@apple.com>
1670
1671         REGRESSION (r174761): Invalid cast in WebCore::lastRubyRun / WebCore::RenderRubyAsBlock::addChild
1672         https://bugs.webkit.org/show_bug.cgi?id=137929
1673         rdar://problem/18723492
1674
1675         Reviewed by Chris Dumez.
1676
1677         Ensure that the child renderer is a RenderRubyRun.
1678
1679         Test: fast/ruby/crash-with-before-after-on-ruby.html
1680
1681         * rendering/RenderRuby.cpp:
1682         (WebCore::lastRubyRun):
1683
1684 2015-02-13  Simon Fraser  <simon.fraser@apple.com>
1685
1686         Crashes under RenderLayer::hitTestLayer under determinePrimarySnapshottedPlugIn()
1687         https://bugs.webkit.org/show_bug.cgi?id=141551
1688
1689         Reviewed by Zalan Bujtas.
1690         
1691         It's possible for a layout to dirty the parent frame's state, via the calls to
1692         ownerElement()->scheduleSetNeedsStyleRecalc() that RenderLayerCompositor does when
1693         iframes toggle their compositing mode.
1694         
1695         That could cause FrameView::updateLayoutAndStyleIfNeededRecursive() to fail to 
1696         leave all the frames in a clean state. Later on, we could enter hit testing,
1697         which calls document().updateLayout() on each frame's document. Document::updateLayout()
1698         does layout on all ancestor documents, so in the middle of hit testing, we could
1699         layout a subframe (dirtying an ancestor frame), then layout another frame, which
1700         would forcing that ancestor to be laid out while we're hit testing it, thus
1701         corrupting the RenderLayer tree while it's being iterated over.
1702         
1703         Fix by having FrameView::updateLayoutAndStyleIfNeededRecursive() do a second
1704         layout after laying out subframes, which most of the time will be a no-op.
1705         
1706         Also add a stronger assertion, that this frame and all subframes are clean
1707         at the end of FrameView::updateLayoutAndStyleIfNeededRecursive() for the
1708         main frame.
1709
1710         Various existing frames tests hit the new assertion if the code change is removed,
1711         so this is covered by existing tests.
1712
1713         * page/FrameView.cpp:
1714         (WebCore::FrameView::needsStyleRecalcOrLayout):
1715         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
1716         * page/FrameView.h:
1717         * rendering/RenderWidget.cpp:
1718         (WebCore::RenderWidget::willBeDestroyed):
1719
1720 2015-02-12  Simon Fraser  <simon.fraser@apple.com>
1721
1722         determinePrimarySnapshottedPlugIn() should only traverse visible Frames
1723         https://bugs.webkit.org/show_bug.cgi?id=141547
1724         Part of rdar://problem/18445733.
1725
1726         Reviewed by Anders Carlsson.
1727
1728         There's an expectation from clients that FrameView::updateLayoutAndStyleIfNeededRecursive()
1729         updates layout in all frames, but it uses the widget tree, so only hits frames
1730         that are parented via renderers (i.e. not display:none frames or their descendants).
1731         
1732         Moving towards a future where we remove Widgets, fix by adding a FrameTree 
1733         traversal function that only finds rendered frames (those with an ownerRenderer).
1734         
1735         Not testable.
1736
1737         * page/FrameTree.cpp:
1738         (WebCore::FrameTree::firstRenderedChild):
1739         (WebCore::FrameTree::nextRenderedSibling):
1740         (WebCore::FrameTree::traverseNextRendered):
1741         (printFrames):
1742         * page/FrameTree.h:
1743         * page/FrameView.cpp:
1744         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
1745
1746 2015-02-13  Alexey Proskuryakov  <ap@apple.com>
1747
1748         TimerBase::m_heapInsertionOrder calculation is racy
1749         https://bugs.webkit.org/show_bug.cgi?id=141554
1750
1751         Reviewed by Anders Carlsson.
1752
1753         Use an atomic increment.
1754
1755         * platform/Timer.cpp: (WebCore::TimerBase::setNextFireTime):
1756
1757 2015-02-13  Andreas Kling  <akling@apple.com>
1758
1759         [iOS] Refine GC behavior in response to process suspension and memory pressure.
1760         <https://webkit.org/b/141543>
1761         <rdar://problem/19738024>
1762
1763         Reviewed by Geoffrey Garen.
1764
1765         Do an immediate full garbage collection when the web process is about to
1766         be suspended (when another tab is moving to the foreground on iOS.)
1767         This ensures that we make a best effort to reduce the process footprint
1768         before we lose the ability to execute code.
1769
1770         When receiving a memory pressure warning, tell the garbage collector to
1771         accelerate its next collection (by calling garbageCollectSoon().)
1772         This gives us some confidence that a collection will happen within a
1773         reasonable timeframe, but doesn't risk dooming us to a loop of endless
1774         garbage collections.
1775
1776         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1777         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1778
1779 2015-02-13  Antti Koivisto  <antti@apple.com>
1780
1781         Add some RELEASE_ASSERTs to try to catch crashes in StyleResolver::loadPendingImages
1782         https://bugs.webkit.org/show_bug.cgi?id=141561
1783
1784         Reviewed by Simon Fraser.
1785
1786         One possibility is that loads triggered by loadPendingImages end up synchronously destroying or re-entering
1787         style resolver. Try to catch these in release builds.
1788
1789         * css/StyleResolver.cpp:
1790         (WebCore::StyleResolver::~StyleResolver):
1791         (WebCore::StyleResolver::styleForElement):
1792         (WebCore::StyleResolver::styleForKeyframe):
1793         (WebCore::StyleResolver::styleForPage):
1794         (WebCore::StyleResolver::loadPendingImages):
1795         * css/StyleResolver.h:
1796
1797 2015-02-13  ChangSeok Oh  <changseok.oh@collabora.com>
1798
1799         Div having contentEditable and display:grid cannot be edited if it is empty.
1800         https://bugs.webkit.org/show_bug.cgi?id=141465
1801
1802         Reviewed by Ryosuke Niwa.
1803
1804         This bug is quite similar to webkit.org/b/141218. RenderGrid should be also treated as a candidate
1805         for visible position as like RenderFlexibleBox. The only different situation between them is
1806         that RenderGrid has a bug setting "0px" for logicalHeight when it is empty. RenderGrid should also have
1807         a minimum height of a single line if it is editable as well as RenderFlexibleBox does.
1808
1809         Test: fast/events/key-events-in-editable-gridbox.html
1810
1811         * dom/Position.cpp:
1812         (WebCore::Position::isCandidate):
1813         (WebCore::Position::isRenderedCharacter):
1814         * rendering/RenderGrid.cpp:
1815         (WebCore::RenderGrid::layoutGridItems):
1816
1817 2015-02-12  Zalan Bujtas  <zalan@apple.com>
1818
1819         REGRESSION (r176262): Invalid cast in WebCore`WebCore::RootInlineBox::selectionTop
1820         https://bugs.webkit.org/show_bug.cgi?id=138992
1821
1822         Reviewed by Dave Hyatt.
1823
1824         RenderRubyText requires the ancestor chain to be (RenderRubyAsInline | RenderRubyAsBlock) -> RenderRubyRun -> RenderRubyText.
1825         This patch ensures that we create RenderRubyText for an <rt> element only when
1826         the expected ancestor chain is guaranteed.
1827
1828         Test: fast/ruby/crash-when-ruby-is-set-to-inline-block.html
1829
1830         * rendering/RenderElement.cpp:
1831         (WebCore::RenderElement::createFor): treat inline-block <ruby> as block.
1832         * rendering/RenderObject.h:
1833         (WebCore::RenderObject::isRubyInline):
1834         (WebCore::RenderObject::isRubyBlock):
1835         (WebCore::RenderObject::isRuby): Deleted.
1836         * rendering/RenderRuby.cpp:
1837         (WebCore::isAnonymousRubyInlineBlock):
1838         * rendering/RenderRuby.h: add support for is<RenderRubyAsBlock>(renderer) and for is<RenderRubyAsInline>(renderer)
1839         The isRuby() method does not follow the is*() -> maps to one class pattern.
1840         (WebCore::isRuby):
1841         * rendering/RenderRubyRun.cpp:
1842         (WebCore::RenderRubyRun::addChild):
1843         (WebCore::RenderRubyRun::staticCreateRubyRun):
1844
1845 2015-02-13  Csaba Osztrogonac  <ossy@webkit.org>
1846
1847         Fix the gperf related build issue on the WinCairo bot
1848         https://bugs.webkit.org/show_bug.cgi?id=141507
1849
1850         Reviewed by Alex Christensen.
1851
1852         * platform/ColorData.gperf: Modified property svn:eol-style.
1853
1854 2015-02-13  Csaba Osztrogonác  <ossy@webkit.org>
1855
1856         Unreviewed, remove empty directories.
1857
1858         * loader/icon/wince: Removed.
1859         * platform/graphics/wince: Removed.
1860         * storage/wince: Removed.
1861
1862 2015-02-12  Timothy Horton  <timothy_horton@apple.com>
1863
1864         Crashes under detectItemAroundHitTestResult when DataDetectors is not available
1865         https://bugs.webkit.org/show_bug.cgi?id=141549
1866         <rdar://problem/19180955>
1867
1868         Reviewed by Dan Bernstein.
1869
1870         * editing/mac/DataDetection.mm:
1871         (WebCore::DataDetection::detectItemAroundHitTestResult):
1872         Bail out from data detection if either of the relevant frameworks aren't loaded.
1873
1874 2015-02-12  Dean Jackson  <dino@apple.com>
1875
1876         [iOS Media] Audio should hide timeline scrubber until playback starts
1877         https://bugs.webkit.org/show_bug.cgi?id=141542
1878         <rdar://problem/19820685>
1879
1880         Reviewed by Eric Carlson.
1881
1882         We regressed from the system behaviour in iOS 7, where the timeline
1883         scrubber for an audio element is not shown until the user starts
1884         playback.
1885
1886         * Modules/mediacontrols/mediaControlsiOS.css:
1887         (video::-webkit-media-controls-panel): Fix the alignment of the flexbox.
1888         (audio::-webkit-media-controls-status-display): Add the style for the status display.
1889         * Modules/mediacontrols/mediaControlsiOS.js:
1890         (ControllerIOS.prototype.configureInlineControls): Start hidden if we are an <audio>.
1891         (ControllerIOS.prototype.configureFullScreenControls): Drive by comment change.
1892         (ControllerIOS.prototype.setPlaying): Unhide the timeline.
1893
1894 2015-02-12  Chris Dumez  <cdumez@apple.com>
1895
1896         Drop the quirks-mode exception for CSS MIME types
1897         https://bugs.webkit.org/show_bug.cgi?id=141501
1898
1899         Reviewed by Alexey Proskuryakov.
1900
1901         Drop the quirks-mode exception for CSS MIME types.
1902         This matches Firefox's behavior.
1903
1904         This patch is based on the following Blink revision:
1905         http://src.chromium.org/viewvc/blink?view=revision&revision=189669
1906
1907         Tests:
1908         - http/tests/misc/css-accept-any-type.html
1909         - http/tests/security/cross-origin-css.html
1910
1911         * css/StyleSheetContents.cpp:
1912         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1913         * dom/ProcessingInstruction.cpp:
1914         (WebCore::ProcessingInstruction::setCSSStyleSheet):
1915         * inspector/InspectorPageAgent.cpp:
1916         (WebCore::InspectorPageAgent::cachedResourceContent):
1917         * loader/cache/CachedCSSStyleSheet.cpp:
1918         (WebCore::CachedCSSStyleSheet::sheetText):
1919         (WebCore::CachedCSSStyleSheet::canUseSheet):
1920         * loader/cache/CachedCSSStyleSheet.h:
1921
1922 2015-02-12  Beth Dakin  <bdakin@apple.com>
1923
1924         REGRESSION: Should not send wheel events with a delta of 0
1925         https://bugs.webkit.org/show_bug.cgi?id=141537
1926         -and corresponding-
1927         rdar://problem/18903118
1928
1929         Reviewed by Simon Fraser.
1930
1931         This code should not have been removed entirely to accommodate rubber-banding, it 
1932         just needs to return false instead of true in order to allow the MayBegin and 
1933         Ended phases to be handled by the ElasticityController.
1934         * dom/Element.cpp:
1935         (WebCore::Element::dispatchWheelEvent):
1936
1937 2015-02-12  Dean Jackson  <dino@apple.com>
1938
1939         [iOS Media] Implement 3-style media timeline (buffered, played, unavailable)
1940         https://bugs.webkit.org/show_bug.cgi?id=141526
1941         <rdar://problem/19603337>
1942
1943         Reviewed by Eric Carlson and Antoine Quint.
1944
1945         Implement a 3-style media scrubber for iOS. This draws white for
1946         the region that has been played (before the playhead), black
1947         for the region that is buffered, and is hollow for the rest.
1948
1949         * Modules/mediacontrols/mediaControlsApple.js:
1950         (Controller.prototype.updateProgress): Update progress is now completely
1951         shared between OS X and iOS. This calls the implementation specific
1952         drawTimelineBackground.
1953         (Controller.prototype.drawTimelineBackground): Move the OS X code to here.
1954         * Modules/mediacontrols/mediaControlsiOS.css:
1955         (audio::-webkit-media-controls-timeline): New styles for the timeline. Updated thumb image, etc.
1956         (video::-webkit-media-controls-timeline::-webkit-slider-runnable-track):
1957         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb):
1958         (audio::-webkit-media-controls-timeline::-webkit-slider-thumb:active):
1959         (video::-webkit-media-controls-time-remaining-display):
1960         * Modules/mediacontrols/mediaControlsiOS.js:
1961         (ControllerIOS): Create a globally unique canvas context name in the constructor.
1962         (ControllerIOS.prototype.createControls): Set the background of the timeline to a canvas.
1963         (ControllerIOS.prototype.addRoundedRect): Helper function.
1964         (ControllerIOS.prototype.drawTimelineBackground): Draw the 3-style content.
1965         (ControllerIOS.prototype.updateProgress): Deleted.
1966
1967 2015-02-12  Daniel Bates  <dabates@apple.com>
1968
1969         Fix some Mac linker warnings
1970         https://bugs.webkit.org/show_bug.cgi?id=141522
1971
1972         Reviewed by Alex Christensen.
1973
1974         Following <https://trac.webkit.org/changeset/179945>, the linker warns about the following hidden WebCore symbols:
1975         
1976         ld: warning: cannot export hidden symbol __ZN7WebCore20LogNotYetImplementedE from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/Logging.o
1977         ld: warning: cannot export hidden symbol _wkCreateURLPasteboardFlavorTypeName from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCoreSystemInterface.o
1978         ld: warning: cannot export hidden symbol _wkCreateURLNPasteboardFlavorTypeName from /.../OpenSource/WebKitBuild/WebCore.build/Debug/WebCore.build/Objects-normal/x86_64/WebCoreSystemInterface.o
1979
1980         * WebCore.exp.in: Remove symbols for functions wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName.
1981         * platform/Logging.h: Export WTFLogChannel for LogNotYetImplemented, which is referenced from
1982         notImplementedLoggingChannel() in file NotImplemented.cpp. We make use of the associated
1983         header, NotImplemented.h, in both WebKit and WebKit2.
1984         * platform/mac/WebCoreSystemInterface.mm: Remove declarations for functions
1985         wkCreateURLPasteboardFlavorTypeName and wkCreateURLNPasteboardFlavorTypeName that
1986         were inadvertently not removed in r25494.
1987
1988 2015-02-12  Joseph Pecoraro  <pecoraro@apple.com>
1989
1990         Web Inspector: Crash inspecting styles of element with mutated stylesheet
1991         https://bugs.webkit.org/show_bug.cgi?id=141451
1992
1993         Reviewed by Timothy Hatcher.
1994
1995         Test: inspector/css/stylesheet-with-mutations.html
1996
1997         * css/CSSStyleSheet.h:
1998         * css/CSSStyleSheet.cpp:
1999         (WebCore::CSSStyleSheet::CSSStyleSheet):
2000         (WebCore::CSSStyleSheet::didMutateRules):
2001         Keep a flag on the CSSStyleSheet to know when it has had a rule
2002         mutation from the contents.
2003
2004         * inspector/InspectorStyleSheet.h:
2005         * inspector/InspectorStyleSheet.cpp:
2006         (WebCore::InspectorStyleSheet::reparseStyleSheet):
2007         When completely replacing the stylesheet's contents, we will have
2008         destroyed any previous rules, so clear the has mutations flag.
2009
2010         (WebCore::selectorsFromSource):
2011         Previously there was a mismatch between the rules the parsed
2012         SourceData had, and the actual CSSSelectors we were iterating.
2013         We use the SourceData so we can get the exact user authored
2014         text instead of generated longhands from actualy selector objects.
2015         Add an ASSERT and bail to catch and more gracefully handle
2016         any possible mismatches in the future.
2017
2018         (WebCore::InspectorStyleSheet::styleSheetMutated):
2019         (WebCore::InspectorStyleSheet::ensureParsedDataReady):
2020         When a CSSStyleSheet has been mutated beyond the inspector's
2021         knowledge right now, fall back to readonly generated selectors.
2022         We should better handle this in the future:
2023         <https://webkit.org/b/141450> Web Inspector: Better support for CSSOM StyleSheet mutations (insertRule/deleteRule)
2024
2025 2015-02-12  Commit Queue  <commit-queue@webkit.org>
2026
2027         Unreviewed, rolling out r179987.
2028         https://bugs.webkit.org/show_bug.cgi?id=141525
2029
2030         caused debug tests to fail (Requested by alexchristensen on
2031         #webkit).
2032
2033         Reverted changeset:
2034
2035         "[CSS Grid Layout] Invalid initialization of track sizes with
2036         non spanning grid items"
2037         https://bugs.webkit.org/show_bug.cgi?id=140763
2038         http://trac.webkit.org/changeset/179987
2039
2040 2015-02-12  Brian J. Burg  <burg@cs.washington.edu>
2041
2042         REGRESSION(r178060): empty arguments are passed when logging to system console
2043         https://bugs.webkit.org/show_bug.cgi?id=141511
2044
2045         Reviewed by Timothy Hatcher.
2046
2047         * page/PageConsoleClient.cpp:
2048         (WebCore::PageConsoleClient::messageWithTypeAndLevel): Change premature move to copyRef.
2049
2050 2015-02-12  Alex Christensen  <achristensen@webkit.org>
2051
2052         [Win] Unreviewed debug build fix after r179980.
2053
2054         * svg/SVGSVGElement.cpp:
2055         (WebCore::SVGSVGElement::currentViewportSize):
2056         Explicitly call constructor.
2057
2058 2015-01-23  Sergio Villar Senin  <svillar@igalia.com>
2059
2060         [CSS Grid Layout] Invalid initialization of track sizes with non spanning grid items
2061         https://bugs.webkit.org/show_bug.cgi?id=140763
2062
2063         Reviewed by Antti Koivisto.
2064
2065         Content sized tracks with non-spanning grid items were not
2066         properly sized because the growth limit was sometimes infinity
2067         (-1) after calling resolveContentBasedTrackSizingFunctions() when
2068         it should not. This patch adds an special initialization phase for
2069         non-spanning grid items as the new track sizing algorithm
2070         describes.
2071
2072         Granted, that was handled in the old algorithm in
2073         distributeSpaceToTracks() as a special case. The problem is that
2074         it regressed after the optimization added in r173868 because that
2075         method is no longer called when the space to distribute is 0.
2076
2077         That's why we could fix this by allowing calls to
2078         distributeSpaceToTracks() with spaceToDistribute>=0 but by fixing
2079         it with an explicit initialization our implementation becomes
2080         closer to the new algorithm and the initialization is now explicit
2081         in the code instead of a side effect of calling
2082         distributeSpaceToTracks() with no space to be distributed. It also
2083         brings a slight performance improvement as we save sorts and hash
2084         lookups.
2085
2086         I also took the change to add caching to several GridTrackSize
2087         methods that were hot on the profiler (each one accounted for ~1%
2088         of the total time, now they account for ~0.3% each).
2089
2090         Test: fast/css-grid-layout/grid-initialize-span-one-items.html
2091
2092         * rendering/RenderGrid.cpp:
2093         (WebCore::GridItemWithSpan::span): New helper method for ASSERTs.
2094         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2095         Exclude non spanning grid items from the calls to
2096         resolveContentBasedTrackSizingFunctionsForItems().
2097         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
2098         New method to resolve track sizes only using non-spanning grid
2099         items.
2100         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
2101         Ensure that it isn't called for non-spanning grid items.
2102         * rendering/RenderGrid.h:
2103         * rendering/style/GridTrackSize.h:
2104         (WebCore::GridTrackSize::GridTrackSize): Cache return values.
2105         (WebCore::GridTrackSize::setLength): Ditto.
2106         (WebCore::GridTrackSize::setMinMax): Ditto.
2107         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes): New method
2108         that caches the return values for hasXXXTrackBreadth() methods.
2109         (WebCore::GridTrackSize::hasMinOrMaxContentMinTrackBreadth): Use
2110         the cached return value.
2111         (WebCore::GridTrackSize::hasMaxContentMaxTrackBreadth): Ditto.
2112         (WebCore::GridTrackSize::hasMinContentMaxTrackBreadth): Ditto.
2113         (WebCore::GridTrackSize::hasMinOrMaxContentMaxTrackBreadth): Ditto.
2114         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadth): Ditto.
2115         (WebCore::GridTrackSize::hasMinContentMinTrackBreadth): Ditto.
2116         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth):
2117         Ditto.
2118         (WebCore::GridTrackSize::hasMaxContentMinTrackBreadthAndMaxContentMaxTrackBreadth):
2119         Ditto.
2120
2121 2015-02-12  Zan Dobersek  <zdobersek@igalia.com>
2122
2123         Remove the USE(ACCELERATED_COMPOSITING) guard from the
2124         MediaPlayerPrivateGStreamerBase destructor.
2125
2126         The guard was removed in r163079. It was still defined through CMake
2127         for the EFL and GTK ports when the guarded code was introduced in
2128         r172828. In r171741 the macro was finally removed for the GTK and EFL
2129         ports as well, but the guards for the affected code weren't updated
2130         so TextureMapperPlatformLayer::Client::platformLayerWillBeDestroyed()
2131         wasn't being called anymore.
2132
2133         Rubber-stamped by Philippe Normand.
2134
2135         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2136         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2137
2138 2015-02-11  Darin Adler  <darin@apple.com>
2139
2140         Streamline and simplify SVGSVGElement and related classes
2141         https://bugs.webkit.org/show_bug.cgi?id=141463
2142
2143         Reviewed by Antti Koivisto.
2144
2145         * dom/Document.cpp: Removed unneeded include of SVGSVGElement.h.
2146         * loader/FrameLoader.cpp: Ditto.
2147         * rendering/RenderBoxModelObject.cpp: Ditto.
2148         * rendering/svg/RenderSVGForeignObject.cpp: Ditto.
2149         * svg/SVGImageElement.cpp: Ditto.
2150         * svg/SVGMarkerElement.cpp: Ditto.
2151         * svg/SVGPathElement.cpp: Ditto.
2152         * svg/SVGPatternElement.cpp: Ditto.
2153         * svg/SVGTransform.cpp: Ditto.
2154
2155         * page/FrameView.cpp:
2156         (WebCore::FrameView::scrollToAnchor): Updated to call the SVGSVGElement function
2157         named scrollToAnchor (was setupInitialView). Also refactored to avoid repeating
2158         the expression frame().document() so often.
2159
2160         * platform/graphics/FloatSize.h: Added operator/.
2161
2162         * svg/SVGDocument.cpp:
2163         (WebCore::SVGDocument::rootElement): Rearranged to use early return.
2164         (WebCore::SVGDocument::zoomAndPanEnabled): Ditto.
2165         (WebCore::SVGDocument::startPan): Ditto. Also used FloatPoint math instead
2166         of breaking things apart into x and y.
2167         (WebCore::SVGDocument::updatePan): Ditto.
2168
2169         * svg/SVGDocument.h: Removed some unneeded includes and forward declarations.
2170         Moved function bodies out of the class to make it more readable. Renamed
2171         m_translate to m_panningOffset and made it a FloatSize instead of FloatPoint.
2172
2173         * svg/SVGDocumentExtensions.cpp:
2174         (WebCore::SVGDocumentExtensions::startAnimations): Use a modern for loop
2175         and update since timeContainer() now returns a reference.
2176
2177         * svg/SVGSVGElement.cpp: Removed many unneeded includes.
2178         (WebCore::SVGSVGElement::SVGSVGElement): Moved initialization of scalars to
2179         the class definition. Updated since m_timerContainer is a Ref (later should
2180         change it to be a std::unique_ptr or just directly contained in SVGSVGElement).
2181         (WebCore::SVGSVGElement::~SVGSVGElement): Removed comment that doesn't say much,
2182         but is worded in a confusing way.
2183         (WebCore::SVGSVGElement::contentScriptType): Use NeverDestroyed instead of
2184         DEPRECATED_DEFINE_STATIC_LOCAL.
2185         (WebCore::SVGSVGElement::contentStyleType): Ditto.
2186         (WebCore::SVGSVGElement::viewport): Streamlined a bit.
2187         (WebCore::SVGSVGElement::pixelUnitToMillimeterX): Ditto.
2188         (WebCore::SVGSVGElement::pixelUnitToMillimeterY): Ditto.
2189         (WebCore::SVGSVGElement::currentView): Changed to return a reference.
2190         (WebCore::SVGSVGElement::frameForCurrentScale): Added. Helper for the two
2191         functions below.
2192         (WebCore::SVGSVGElement::currentScale): Updated to use frameForCurrentScale.
2193         (WebCore::SVGSVGElement::setCurrentScale): Ditto.
2194         (WebCore::SVGSVGElement::setCurrentTranslate): Optimized the case where there
2195         is no change to the translation. Also changed the data member's name to
2196         m_currentTranslate to more directly match the DOM API naming.
2197         (WebCore::SVGSVGElement::parseAttribute): Simplified the parsing a bit, and
2198         changed to pass a reference to SVGZoomAndPan::parseAttribute.
2199         (WebCore::SVGSVGElement::svgAttributeChanged): Tweaked formatting and removed
2200         code that converts the renderer pointer to a RenderObject* unnecessarily.
2201         (WebCore::SVGSVGElement::suspendRedraw): Removed FIXME about implementing this,
2202         since we don't really plan to do that.
2203         (WebCore::SVGSVGElement::unsuspendRedraw): Ditto.
2204         (WebCore::SVGSVGElement::unsuspendRedrawAll): Ditto.
2205         (WebCore::SVGSVGElement::forceRedraw): Ditto.
2206         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList): Changed return
2207         type to Ref, and pass in a function instead of an enumeration value.
2208         (WebCore::SVGSVGElement::getIntersectionList): Updated for above.
2209         (WebCore::SVGSVGElement::getEnclosureList): Ditto.
2210         (WebCore::SVGSVGElement::checkIntersection): Use && instead of early return
2211         for the null check.
2212         (WebCore::SVGSVGElement::checkEnclosure): Ditto.
2213         (WebCore::SVGSVGElement::createSVGLength): Use initialization list syntax
2214         for greater brevity.
2215         (WebCore::SVGSVGElement::createSVGAngle): Ditto.
2216         (WebCore::SVGSVGElement::createSVGPoint): Ditto.
2217         (WebCore::SVGSVGElement::createSVGMatrix): Ditto.
2218         (WebCore::SVGSVGElement::createSVGRect): Ditto.
2219         (WebCore::SVGSVGElement::createSVGTransform): Removed unneeded explicit
2220         constructor invocation.
2221         (WebCore::SVGSVGElement::createSVGTransformFromMatrix): Removed unneeded cast.
2222         (WebCore::SVGSVGElement::insertedInto): Updated since timeContainer() now
2223         returns a reference.
2224         (WebCore::SVGSVGElement::setCurrentTime): Use isfinite instead of isnan, so
2225         we won't store infinity as the current time.
2226         (WebCore::SVGSVGElement::currentViewBoxRect): Renamed locals and changed
2227         to use initializer lists for brevity.
2228         (WebCore::SVGSVGElement::currentViewportSize): Streamlined code by using
2229         initializer lists, using local variables only for things used more than once,
2230         and using the / operator defined above.
2231         (WebCore::SVGSVGElement::viewBoxToViewTransform): Use the concatenate function
2232         in a way that is more straightforward, rather than doing it with a temporary.
2233         (WebCore::SVGSVGElement::scrollToAnchor): Renamed this from
2234         setupInitialView.
2235         (WebCore::SVGSVGElement::inheritViewAttributes): Changed this to work with
2236         references rather than pointers.
2237         (WebCore::SVGSVGElement::getElementById): Use getAllElementsById as the
2238         FIXME comment suggested for better efficiency when there are a lot of descendants
2239         of the <svg> element at the cost of making it less efficient if there are
2240         a lot of elements all with the desired ID, but not inside the <svg> element.
2241         (WebCore::SVGSVGElement::isValid): Moved here from the header.
2242
2243         * svg/SVGSVGElement.h: Removed unneeded forward declarations. Moved the
2244         animated properties to the top of the file, then other DOM, the other
2245         public members. Changed return types to references and Ref. Moved
2246         function bodies out of the class definition. Made createSVGNumber inline.
2247
2248         * svg/SVGViewElement.cpp: Removed unneeded includes.
2249         (WebCore::SVGViewElement::isSupportedAttribute): Deleted.
2250         (WebCore::SVGViewElement::parseAttribute): Changed to not rely on
2251         isSupportedAttribute. Eventually I will do this in all the SVG classes.
2252
2253         * svg/SVGViewSpec.cpp: Removed unneeded include of SVGSVGElement.h.
2254         (WebCore::SVGViewSpec::parseViewSpec): Updated for change in the name
2255         of the parse function in the SVGZoomAndPan class.
2256
2257         * svg/SVGZoomAndPan.cpp:
2258         (WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
2259         (WebCore::SVGZoomAndPan::addSupportedAttributes): Deleted.
2260         (WebCore::SVGZoomAndPan::parse): Renamed from parseZoomAndPan since
2261         this is a member of the SVGZoomAndPan class and also has an argument
2262         of SVGZoomAndPanType.
2263         (WebCore::SVGZoomAndPan::parseAttributeValue): Added. Helper so the
2264         template function is not so big. Also write it in a simpler way.
2265         (WebCore::SVGZoomAndPan::ref): Deleted.
2266         (WebCore::SVGZoomAndPan::deref): Deleted.
2267         (WebCore::SVGZoomAndPan::setZoomAndPan): Deleted.
2268
2269         * svg/SVGZoomAndPan.h: Removed unneeded includes. Reformatted the enum.
2270         Moved function bodies out of the class definition. Removed many unneeded
2271         functions.
2272
2273         * svg/animation/SVGSMILElement.cpp:
2274         (WebCore::SVGSMILElement::insertedInto): Updated since timeContainer
2275         now returns a reference rather than a pointer.
2276
2277 2015-02-11  Darin Adler  <darin@apple.com>
2278
2279         SVGUseElement follow-up improvements
2280         https://bugs.webkit.org/show_bug.cgi?id=141382
2281
2282         Reviewed by Antti Koivisto.
2283
2284         * loader/cache/CachedSVGDocumentClient.h: Removed unneeded forward declaration.
2285
2286         * page/EventHandler.cpp: Removed unneeded include of SVGUseElement.h.
2287         * rendering/svg/RenderSVGViewportContainer.cpp: Ditto.
2288
2289         * svg/SVGDocumentExtensions.cpp:
2290         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Removed too-specific
2291         check that assumed that SVG elements in shadow trees are always for <use> elements.
2292         This amounted to an unneeded optimization that could be removed with no bad effect.
2293
2294         * svg/SVGElement.cpp:
2295         (WebCore::SVGElement::correspondingElement): Removed the assertions so this could
2296         be used more freely outside of cases where the shadow tree state is fully consistent.
2297         It's fine to have this just be a mechanical getter; there's nothing super-tricky
2298         here that needs to be caught by the assertion.
2299         (WebCore::SVGElement::title): Removed unneeded special handling for titles inside
2300         the shadow tree.
2301
2302         * svg/SVGGElement.cpp:
2303         (WebCore::SVGGElement::create): Added an overload that doesn't require explicitly
2304         passing in the tag name.
2305         * svg/SVGGElement.h: Ditto.
2306         * svg/SVGSVGElement.cpp:
2307         (WebCore::SVGSVGElement::create): Ditto.
2308         * svg/SVGSVGElement.h: Ditto.
2309
2310         * svg/SVGUseElement.cpp: Removed a lot of unneeded includes.
2311         (WebCore::SVGUseElement::SVGUseElement): Removed code to initialize some booleans.
2312         We do that in the class definition now.
2313         (WebCore::SVGUseElement::create): Removed the code that calls the
2314         ensureUserAgentShadowRoot function unconditionally. That's properly done when
2315         needed; no need to do it here.
2316         (WebCore::SVGUseElement::~SVGUseElement): Removed unneeded code to destroy the
2317         shadow tree (that happens automatically) and simplified the code to stop loading
2318         the external document.
2319         (WebCore::SVGUseElement::isSupportedAttribute): Deleted.
2320         (WebCore::SVGUseElement::parseAttribute): Simplified this. Removed assumptions
2321         about the intersection of various sets of attributes, and also removed the
2322         isSupportedAttribute function. This seems to serve no purpose here, or in any
2323         other SVG element class. I plan to remove it everywhere over time.
2324         (WebCore::isWellFormedDocument): Deleted.
2325         (WebCore::SVGUseElement::insertedInto): Simplified code by removing all the
2326         special cases during initial parsing, and did the invalidation here rather than
2327         deferring it to didNotifySubtreeInsertions. Added a call to the new function,
2328         updateExternalDocument, since that won't do anything when the element is not
2329         in a document.
2330         (WebCore::SVGUseElement::didNotifySubtreeInsertions): Deleted.
2331         (WebCore::SVGUseElement::removedFrom): Added code to call clearShadowTree and
2332         updateExternalDocument. Both are efficient when doing nothing, and both are
2333         appropriate since the element is no longer in a document.
2334         (WebCore::SVGUseElement::referencedDocument): Deleted. No longer needed.
2335         (WebCore::SVGUseElement::externalDocument): Streamlined the logic here, removing
2336         multiple unneeded checks.
2337         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone): Renamed since
2338         "target clone" is clear enough within this class, without explicitly stating
2339         "shadow tree". All the clones are in the shadow tree.
2340         (WebCore::SVGUseElement::svgAttributeChanged): Removed unneeded code calling
2341         isSupportedAttribute. Changed the code that detects changes in href to just
2342         call updateExternalDocument (for the document URL) and invalidateShadowTree
2343         (for the fragment). Also updated the transferSizeAttributesToTargetClone logic
2344         to only trigger on width and height and updated names.
2345         (WebCore::SVGUseElement::willAttachRenderers): Updated for the new name of
2346         m_shouldRebuildShadowTree and added a call through to the base class.
2347         (WebCore::createAllowedElementSet): Added. A more efficient way to implement
2348         the initialization of the set for isDisallowedElement.
2349         (WebCore::isDisallowedElement): Simplified this by using the function above,
2350         and also overloaded for both SVGElement and Element for a tiny efficiency boost.
2351         (WebCore::SVGUseElement::clearShadowTree): Renamed form clearResourceReferences.
2352         This is a much more straightforward name. Also deleted the code that sets the
2353         m_needsShadowTreeRecreation flag to false. That should be done by the build
2354         function, not here.
2355         (WebCore::SVGUseElement::buildPendingResource): Made this just invalidate the
2356         shadow tree now instead of explicitly building it.
2357         (WebCore::SVGUseElement::updateShadowTree): Moved the code to create a shadow
2358         tree here from buildPendingResource. ALso changed the logic so that we
2359         always blow away the old shadow tree. Moved the comment about rebuilding things
2360         every time here. Updated the code to use the findTarget and cloneTarget functions,
2361         eliminating the buildShadowTree function entirely. Moved the call to
2362         transferSizeAttributesToShadowTreeTargetClone inside cloneTarget. Also updated
2363         for the name change for m_shouldRebuildShadowTree.
2364         (WebCore::SVGUseElement::targetClone): Renamed from shadowTreeTargetClone.
2365         No need to emphasize "shadow tree" since that's where all clones are.
2366         (WebCore::isDirectReference): Streamlined a bit using "using namespace".
2367         (WebCore::SVGUseElement::toClipPath): Rewrote to use early return and updated
2368         for name changes. Also used ASCIILiteral.
2369         (WebCore::SVGUseElement::rendererClipChild): Changed local variable names.
2370         (WebCore::removeDisallowedElementsFromSubtree): Wrote the iteration in a
2371         slightly more idiomatic style.
2372         (WebCore::SVGUseElement::findTarget): Added. This new function implements
2373         the rule for finding a valid target for a use element. This replaces logic
2374         that was duplicated in two different places and it also includes all the
2375         rules that were formerly in the isValidTarget function. Also, this implements
2376         a correct check for a cycle that handles cases the code in isValidTarget did not.
2377         (WebCore::SVGUseElement::isValidTarget): Deleted.
2378         (WebCore::SVGUseElement::cloneTarget): Added. Helper function used both when
2379         cloning the target of the top level <use> elements and for other <use> elements
2380         inside the shadow tree.
2381         (WebCore::cloneDataAndChildren): Added. Helper function that allows both the
2382         <use> and <symbol> element expanding functions to be shorter and share more code.
2383         (WebCore::SVGUseElement::expandUseElementsInShadowTree): Removed unneeded checks
2384         of cachedDocumentIsStillLoading. Used the new findTarget function, which handles
2385         finding the target cross-document correctly. Removed the incorrect use of
2386         referencedDocument when creating new elements and finding targets. Refactored
2387         to use the new cloneDataAndChildren function and also moved the code that removes
2388         the special attributes here, replacing the transferAttributesToShadowTreeReplacement
2389         function. Made a few other simplifications.
2390         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): Ditto, just like the
2391         <use> changes only simpler.
2392         (WebCore::SVGUseElement::transferEventListenersToShadowTree): Made this const.
2393         Removed unneeded assertions.
2394         (WebCore::SVGUseElement::invalidateShadowTree): Updated for name change.
2395         (WebCore::SVGUseElement::invalidateDependentShadowTrees): Removed assertion.
2396         (WebCore::SVGUseElement::transferAttributesToShadowTreeReplacement): Deleted.
2397         (WebCore::SVGUseElement::selfHasRelativeLengths): Tweaked names.
2398         (WebCore::SVGUseElement::notifyFinished): Removed the inDocument check, since
2399         this function will only be called for elements that are in a document.
2400         (WebCore::SVGUseElement::cachedDocumentIsStillLoading): Deleted.
2401         (WebCore::SVGUseElement::finishParsingChildren): Removed the code that calls
2402         buildPendingResource here. Shadow tree updating is driven solely by renderer
2403         generation now.
2404         (WebCore::SVGUseElement::updateExternalDocument): Replaced setCachedDocument
2405         with this. This function knows how to load a different document if the URL
2406         has changed, or leave it alone if not, and also stop the load if it should.
2407         (WebCore::SVGUseElement::isValid): Moved this here from the header, since it's
2408         always being called virtually.
2409         (WebCore::SVGUseElement::haveLoadedRequiredResources): Ditto.
2410         (WebCore::SVGUseElement::setHaveFiredLoadEvent): Ditto.
2411         (WebCore::SVGUseElement::haveFiredLoadEvent): Ditto.
2412         (WebCore::SVGUseElement::svgLoadEventTimer): Ditto.
2413
2414         * svg/SVGUseElement.h: Removed unneeded include. Moved the animated properties
2415         to the top of the class because they are public DOM API and so are logical to
2416         list first. I'd like to do that for other classes too over time. Changed to
2417         derive privately from CachedSVGDocumentClient. Made the function
2418         invalidateDependentShadowTrees private. Removed didNotifySubtreeInsertions,
2419         isSupportedAttribute, clearResourceReferences, buildShadowTree,
2420         transferAttributesToShadowTreeReplacement, isParserInserted, and
2421         m_wasInsertedByParser. Added updateExternalDocument, cloneTarget, targetClone,
2422         updateShadowTree, and clearShadowTree. Also did a couple other renames,
2423         including renaming m_cachedDocument to m_externalDocument.
2424
2425         * svg/svgtags.in: Removed constructorNeedsCreatedByParser from the <use>
2426         element since we don't have to handle constructing by the parser specially.
2427
2428 2015-02-11  Dhi Aurrahman  <diorahman@rockybars.com>
2429
2430         CSS selector JIT compilation support for :lang()
2431         https://bugs.webkit.org/show_bug.cgi?id=140818
2432
2433         Reviewed by Benjamin Poulain.
2434
2435         Add the JIT support for :lang(), to ensure :lang() no longer force the engine to
2436         the slow path.
2437
2438         Test: fast/selectors/lang-chained-multiple.html
2439
2440         * cssjit/SelectorCompiler.cpp:
2441         (WebCore::SelectorCompiler::addPseudoClassType):
2442         Get rid of the FunctionType::CannotCompile
2443         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2444         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsInLanguage):
2445
2446 2015-02-11  Alex Christensen  <achristensen@webkit.org>
2447
2448         Fix more weak external symbol errors.
2449
2450         * bindings/scripts/CodeGeneratorJS.pm:
2451         (GenerateHeader):
2452         * page/make_settings.pl:
2453         (printGetterAndSetter):
2454         Remove some WEBCORE_EXPORT macros.
2455
2456 2015-02-11  Alex Christensen  <achristensen@webkit.org>
2457
2458         Do not export functions defined in headers.
2459         This prevents weak external symbol errors in some configurations.
2460
2461         * dom/Range.h:
2462         (WebCore::Range::startContainer):
2463         (WebCore::Range::startOffset):
2464         (WebCore::Range::endContainer):
2465         (WebCore::Range::endOffset):
2466         * inspector/InspectorController.h:
2467         * page/Settings.h:
2468         (WebCore::Settings::setMediaKeysStorageDirectory):
2469         * page/make_settings.pl:
2470         (printGetterAndSetter):
2471         * platform/network/cocoa/ProtectionSpaceCocoa.h:
2472         (WebCore::ProtectionSpace::encodingRequiresPlatformData):
2473         * platform/text/TextEncoding.h:
2474         (WebCore::TextEncoding::decode):
2475         Removed WEBCORE_EXPORT macros.
2476
2477 2015-02-11  Chris Dumez  <cdumez@apple.com>
2478
2479         [WK2] Add logging to validate the network cache efficacy (Part 2)
2480         https://bugs.webkit.org/show_bug.cgi?id=141345
2481         <rdar://problem/19632080>
2482
2483         Reviewed by Sam Weinig.
2484
2485         Add a few more diagnostic logging keys for the network cache efficacy
2486         logging.
2487
2488 2015-02-11  Sam Weinig  <sam@webkit.org>
2489
2490         REGRESSION(r179166): Crash when accessing document.dir on a document with no elements
2491         <rdar://problem/19804351>
2492         https://bugs.webkit.org/show_bug.cgi?id=141480
2493
2494         Reviewed by Chris Dumez.
2495
2496         Test: fast/dom/document-dir-empty-document-crash.html
2497
2498         * html/HTMLDocument.cpp:
2499         (WebCore::HTMLDocument::dir):
2500         Don't unnecessarily dereference the documentElement. is<HTMLHtmlElement>() will handle null just fine.
2501
2502 2015-02-11  Mark Rowe  <mrowe@apple.com>
2503
2504         <https://webkit.org/b/141492> extract-localizable-strings.pl shouldn't update the target file if the contents haven't changed
2505
2506         Avoid updating the target file if the contents haven't changed. This prevents Xcode from copying the identical
2507         file into the framework and resigning it, which avoids the resulting relinking of all targets that depend on
2508         the framework.
2509
2510         Reviewed by Dan Bernstein.
2511
2512         * extract-localizable-strings.pl: Write our output to a temporary file. If the output differs from the
2513         existing contents of the target file, move the temporary file over the target file. Otherwise, delete
2514         the temporary file.
2515
2516 2015-02-11  Chris Dumez  <cdumez@apple.com>
2517
2518         Turn recent assertions into release assertions to help track down crash in DocumentLoader::stopLoadingForPolicyChange()
2519         https://bugs.webkit.org/show_bug.cgi?id=141484
2520         <rdar://problem/13811738>
2521
2522         Reviewed by Andy Estes.
2523
2524         Turn recent assertions into release assertions to help track down crash in
2525         DocumentLoader::stopLoadingForPolicyChange(). This should increase the
2526         likelyhood of tripping them so that we better understand why this happens.
2527
2528         * loader/DocumentLoader.cpp:
2529         (WebCore::DocumentLoader::~DocumentLoader):
2530         (WebCore::DocumentLoader::detachFromFrame):
2531
2532 2015-02-11  Jer Noble  <jer.noble@apple.com>
2533
2534         [MSE] SampleMap::addRange() returns an inverted iterator_range, possibly causing a crash when that iterator_range is traversed.
2535         https://bugs.webkit.org/show_bug.cgi?id=141479
2536         rdar://problem/19067597
2537
2538         Reviewed by Chris Dumez.
2539
2540         When looking backwards through a presentationOrder map to find samples, we then reverse our iterators
2541         and put them in an iterator_range to return to the caller. But in addition to reversing the iterators
2542         themselves, we also need to put them in the iterator_range in reverse order, so that when the caller
2543         iterates from iterator_range.first -> iterator_range.second, they don't end up off the end of the
2544         the underlying storage.
2545
2546         * Modules/mediasource/SampleMap.cpp:
2547         (WebCore::PresentationOrderSampleMap::findSamplesWithinPresentationRangeFromEnd):
2548
2549 2015-02-11  Simon Fraser  <simon.fraser@apple.com>
2550
2551         Improve the showFrameTree() output slightly
2552         https://bugs.webkit.org/show_bug.cgi?id=141482
2553
2554         Reviewed by Zalan Bujtas.
2555
2556         Have showFrameTree() show the Frame's RenderView so it can be correlated with
2557         layer dumps, and show styleRecalc and needsLayout state.
2558
2559         * page/FrameTree.cpp:
2560         (printFrames):
2561         * page/FrameView.cpp:
2562         (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): Add an explanatory
2563         comment about why we don't walk the Frame tree.
2564
2565 2015-02-11  Alex Christensen  <achristensen@webkit.org>
2566
2567         Stop using WebCore.exp.in on Mac and iOS.
2568         https://bugs.webkit.org/show_bug.cgi?id=141413
2569
2570         Reviewed by Dan Bates.
2571
2572         * Configurations/Base.xcconfig:
2573         Make symbols hidden by default unless exported by WEBCORE_EXPORT macros.
2574         * platform/PlatformExportMacros.h:
2575         Start using WEBCORE_EXPORT on Mac and iOS (but not Windows yet).
2576
2577 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
2578
2579         Div having contentEditable and display:flex cannot be edited if it is empty.
2580         https://bugs.webkit.org/show_bug.cgi?id=141218
2581
2582         Reviewed by Ryosuke Niwa.
2583
2584         RenderFlexibleBox should be treated as a candidate for visible position. Visible selection
2585         in an editable area is recalculated whenever an inner value of div is changed. If the inner value
2586         is empty, the visible selection recalculated with DeleteSelectionCommand::m_endingPostion
2587         is not correct. Because RenderBlockFlow is only considered but not RenderFlexibleBox
2588         in Position::isCandidate so that a calculated ending VisiblePosition for an editable div
2589         having "display : flex" goes weird and VisibleSelection is empty accordingly.
2590
2591         Test: fast/events/key-events-in-editable-flexbox.html
2592
2593         * dom/Position.cpp:
2594         (WebCore::Position::isCandidate):
2595
2596 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
2597
2598         Activate ReliefLogger of a memory pressure handler for linux system.
2599         https://bugs.webkit.org/show_bug.cgi?id=123611
2600
2601         Reviewed by Anders Carlsson.
2602
2603         Put more logs for the time when a system goes under memory pressure or viceversa.
2604
2605         No new tests since no engine behavior changed.
2606
2607         * platform/linux/MemoryPressureHandlerLinux.cpp:
2608         (WebCore::MemoryPressureHandler::waitForMemoryPressureEvent): Wait a memory pressure event
2609         from cgroup in a seperated thread. Once a pressure event happens, respondToMemoryPressure()
2610         would be called to get back some resources.
2611         (WebCore::MemoryPressureHandler::install): Install memoryPressureHandler module
2612         to make it work.
2613
2614 2015-02-11  Alex Christensen  <achristensen@webkit.org>
2615
2616         Final preparations to switch to WEBCORE_EXPORT.
2617
2618         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
2619         Export the vtable and a function.
2620
2621 2015-02-11  Sam Weinig  <sam@webkit.org>
2622
2623         performance.now can crash if accessed from a window that has navigated
2624         <rdar://problem/16892506>
2625         https://bugs.webkit.org/show_bug.cgi?id=141478
2626
2627         Reviewed by Alexey Proskuryakov.
2628
2629         Test: fast/performance/performance-now-crash-on-navigated-window.html
2630
2631         * page/Performance.cpp:
2632         (WebCore::Performance::now):
2633         Check for a null frame, which can happen when the window has been navigated.
2634
2635 2015-02-10  Alexey Proskuryakov  <ap@apple.com>
2636
2637         URL::setUser and URL::setPass don't percent encode
2638         https://bugs.webkit.org/show_bug.cgi?id=141453
2639         rdar://problem/14844503&16551802&19623145
2640
2641         Reviewed by Darin Adler.
2642
2643         Tests: fast/url/url-credentials-escaping.html
2644                http/tests/xmlhttprequest/basic-auth-credentials-escaping.html
2645
2646         Start adding some code that performs escaping in a way that matches the URL Standard.
2647         Right now, it's only used where we failed to do any escaping at all, and over time,
2648         we'll be moving towards a new implementation.
2649
2650         * html/URLUtils.h:
2651         (WebCore::URLUtils<T>::username):
2652         (WebCore::URLUtils<T>::password):
2653         * platform/URL.cpp:
2654         (WebCore::isSchemeFirstChar):
2655         (WebCore::URL::user):
2656         (WebCore::URL::pass):
2657         (WebCore::URL::encodedUser):
2658         (WebCore::URL::encodedPass):
2659         (WebCore::URL::setUser):
2660         (WebCore::URL::setPass):
2661         (WebCore::encodeWithURLEscapeSequences):
2662         * platform/URL.h:
2663
2664 2015-02-11  Alex Christensen  <achristensen@webkit.org>
2665
2666         Add a few more WEBCORE_EXPORT macros for debug and iOS builds.
2667
2668         * page/EventHandler.h:
2669         * page/ios/WebEventRegion.h:
2670         * platform/sql/SQLiteDatabaseTracker.h:
2671
2672 2015-02-11  Darin Adler  <darin@apple.com>
2673
2674         REGRESSION(r179476): It broke the !ENABLE(PICTURE_SIZES) build
2675         https://bugs.webkit.org/show_bug.cgi?id=141327
2676
2677         Reviewed by Csaba Osztrogonác.
2678
2679         * html/parser/HTMLPreloadScanner.cpp:
2680         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2681         Put #if around use of m_sizesAttribute.
2682
2683 2015-02-11  Commit Queue  <commit-queue@webkit.org>
2684
2685         Unreviewed, rolling out r179921.
2686         https://bugs.webkit.org/show_bug.cgi?id=141473
2687
2688         caused about 30 test failures on yosemite and mavericks
2689         (Requested by alexchristensen on #webkit).
2690
2691         Reverted changeset:
2692
2693         "Div having contentEditable and display:flex cannot be edited
2694         if it is empty."
2695         https://bugs.webkit.org/show_bug.cgi?id=141218
2696         http://trac.webkit.org/changeset/179921
2697
2698 2015-02-11  ChangSeok Oh  <changseok.oh@collabora.com>
2699
2700         Div having contentEditable and display:flex cannot be edited if it is empty.
2701         https://bugs.webkit.org/show_bug.cgi?id=141218
2702
2703         Reviewed by Ryosuke Niwa.
2704
2705         RenderFlexibleBox should be treated as a candidate for visible position. Visible selection
2706         in an editable area is recalculated whenever an inner value of div is changed. If the inner value
2707         is empty, the visible selection recalculated with DeleteSelectionCommand::m_endingPostion
2708         is not correct. Because RenderBlockFlow is only considered but not RenderFlexibleBox
2709         in Position::isCandidate so that a calculated ending VisiblePosition for an editable div
2710         having "display : flex" goes weird and VisibleSelection is empty accordingly.
2711
2712         Test: fast/events/key-events-in-editable-flexbox.html
2713
2714         * dom/Position.cpp:
2715         (WebCore::Position::isCandidate):
2716
2717 2015-02-11  Commit Queue  <commit-queue@webkit.org>
2718
2719         Unreviewed, rolling out r179910.
2720         https://bugs.webkit.org/show_bug.cgi?id=141464
2721
2722         Caused assertions on debug bots (Requested by ap on #webkit).
2723
2724         Reverted changeset:
2725
2726         "[WK2] Add logging to validate the network cache efficacy
2727         (Part 2)"
2728         https://bugs.webkit.org/show_bug.cgi?id=141345
2729         http://trac.webkit.org/changeset/179910
2730
2731 2015-02-10  Chris Dumez  <cdumez@apple.com>
2732
2733         Optimize MutableStyleProperties::removePropertiesInSet()
2734         https://bugs.webkit.org/show_bug.cgi?id=141460
2735
2736         Reviewed by Andreas Kling.
2737
2738         Optimize MutableStyleProperties::removePropertiesInSet() by doing an
2739         in-place removal of the vector properties, using the new and efficient
2740         Vector::removalAllMatching().
2741
2742         I see a ~11% speed-up on CSS/CSSPropertySetterGetter.html performance
2743         test.
2744
2745         This change was inspired by the following Blink revision:
2746         https://src.chromium.org/viewvc/blink?view=rev&revision=189387
2747
2748         Test: PerformanceTests/CSS/CSSPropertySetterGetter.html
2749
2750         * css/StyleProperties.cpp:
2751         (WebCore::MutableStyleProperties::removePropertiesInSet):
2752
2753 2015-02-10  Alex Christensen  <achristensen@webkit.org>
2754
2755         [Win] Fix debug build after r179807.
2756         https://bugs.webkit.org/show_bug.cgi?id=141461
2757
2758         Reviewed by Benjamin Poulain.
2759
2760         * dom/TypedElementDescendantIterator.h:
2761         Explicitly call Iterator constructor to reduce complexity when iterating descendantsOfType.
2762
2763 2015-02-10  Chris Dumez  <cdumez@apple.com>
2764
2765         [WK2] Add logging to validate the network cache efficacy (Part 2)
2766         https://bugs.webkit.org/show_bug.cgi?id=141345
2767
2768         Reviewed by Antti Koivisto.
2769
2770         Add a few more diagnostic logging keys for the network cache efficacy
2771         logging.
2772
2773 2015-02-10  Commit Queue  <commit-queue@webkit.org>
2774
2775         Unreviewed, rolling out r179896.
2776         https://bugs.webkit.org/show_bug.cgi?id=141452
2777
2778         broke linking debug builds (Requested by thorton on #webkit).
2779
2780         Reverted changeset:
2781
2782         "Stop using WebCore.exp.in on Mac and iOS."
2783         https://bugs.webkit.org/show_bug.cgi?id=141413
2784         http://trac.webkit.org/changeset/179896
2785
2786 2015-02-10  Alex Christensen  <achristensen@webkit.org>
2787
2788         Fix bindings tests after r179886.
2789
2790         * bindings/scripts/test/ObjC/DOMFloat64Array.h:
2791         * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h:
2792         * bindings/scripts/test/ObjC/DOMTestCallback.h:
2793         * bindings/scripts/test/ObjC/DOMTestCustomNamedGetter.h:
2794         * bindings/scripts/test/ObjC/DOMTestEventConstructor.h:
2795         * bindings/scripts/test/ObjC/DOMTestEventTarget.h:
2796         * bindings/scripts/test/ObjC/DOMTestException.h:
2797         * bindings/scripts/test/ObjC/DOMTestGenerateIsReachable.h:
2798         * bindings/scripts/test/ObjC/DOMTestInterface.h:
2799         * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.h:
2800         * bindings/scripts/test/ObjC/DOMTestNamedConstructor.h:
2801         * bindings/scripts/test/ObjC/DOMTestNode.h:
2802         * bindings/scripts/test/ObjC/DOMTestNondeterministic.h:
2803         * bindings/scripts/test/ObjC/DOMTestObj.h:
2804         * bindings/scripts/test/ObjC/DOMTestOverloadedConstructors.h:
2805         * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
2806         * bindings/scripts/test/ObjC/DOMTestTypedefs.h:
2807         * bindings/scripts/test/ObjC/DOMattribute.h:
2808         * bindings/scripts/test/ObjC/DOMreadonly.h:
2809
2810 2015-02-10  Alex Christensen  <achristensen@webkit.org>
2811
2812         Stop using WebCore.exp.in on Mac and iOS.
2813         https://bugs.webkit.org/show_bug.cgi?id=141413
2814
2815         Reviewed by Dan Bates.
2816
2817         * Configurations/Base.xcconfig:
2818         Make symbols hidden by default unless exported by WEBCORE_EXPORT macros.
2819         * platform/PlatformExportMacros.h:
2820         Start using WEBCORE_EXPORT on Mac and iOS (but not Windows yet).
2821
2822 2015-02-10  Chris Dumez  <cdumez@apple.com>
2823
2824         Add another assertion to help track down crash in DocumentLoader::stopLoadingForPolicyChange()
2825         https://bugs.webkit.org/show_bug.cgi?id=141447
2826         <rdar://problem/13811738>
2827
2828         Reviewed by Alexey Proskuryakov.
2829
2830         Add another assertion to help track down crash in
2831         DocumentLoader::stopLoadingForPolicyChange().
2832
2833         The trace seems to hint that frameLoader() returns null when
2834         stopLoadingForPolicyChange() is called. frameLoader() can only return
2835         null after DocumentLoader::detachFromFrame() has been called.
2836         Also, stopLoadingForPolicyChange() here is called from the
2837         DocumentLoader::continueAfterContentPolicy() policy callback which
2838         requires m_waitingForContentPolicy to be true. Therefore, we should
2839         assert that m_waitingForContentPolicy is false when m_frame is cleared
2840         in DocumentLoader::detachFromFrame().
2841
2842         * loader/DocumentLoader.cpp:
2843         (WebCore::DocumentLoader::detachFromFrame):
2844
2845 2015-02-10  Alex Christensen  <achristensen@webkit.org>
2846
2847         Stop using WebCore.exp.in on Mac and iOS.
2848         https://bugs.webkit.org/show_bug.cgi?id=141413
2849
2850         Reviewed by Dan Bates.
2851
2852         * Configurations/Base.xcconfig:
2853         Make symbols hidden by default unless exported by WEBCORE_EXPORT macros.
2854         * platform/PlatformExportMacros.h:
2855         Start using WEBCORE_EXPORT on Mac and iOS (but not Windows yet).
2856
2857 2015-02-10  Alex Christensen  <achristensen@webkit.org>
2858
2859         Add more WEBCORE_EXPORT macros for iOS.
2860         https://bugs.webkit.org/show_bug.cgi?id=141430
2861
2862         Reviewed by Tim Horton.
2863
2864         * bindings/objc/WebScriptObject.h:
2865         * bindings/scripts/CodeGeneratorObjC.pm:
2866         (GenerateHeader):
2867         * dom/Event.h:
2868         * dom/Node.h:
2869         * editing/FrameSelection.h:
2870         * html/HTMLFormControlElement.h:
2871         * html/HTMLMediaSession.h:
2872         * page/Frame.h:
2873         * page/FrameView.h:
2874         * platform/ScrollView.h:
2875         * platform/ios/PasteboardIOS.mm:
2876         * platform/ios/wak/WAKAppKitStubs.h:
2877         * platform/ios/wak/WAKClipView.h:
2878         * platform/ios/wak/WAKScrollView.h:
2879         * platform/ios/wak/WAKView.h:
2880         * platform/ios/wak/WAKWindow.h:
2881         * platform/ios/wak/WAKWindow.mm:
2882         * platform/ios/wak/WKContentObservation.h:
2883         * platform/ios/wak/WKGraphics.h:
2884         * platform/ios/wak/WebCoreThread.h:
2885         * platform/ios/wak/WebCoreThread.mm:
2886         * platform/ios/wak/WebCoreThreadRun.h:
2887         * platform/ios/wak/WebCoreThreadSystemInterface.h:
2888         * platform/network/ios/QuickLook.h:
2889         * platform/text/TextBreakIterator.h:
2890
2891 2015-02-09  David Hyatt  <hyatt@apple.com>
2892
2893         text-underline-position: under is broken
2894         https://bugs.webkit.org/show_bug.cgi?id=141400
2895         <rdar://problem/18569583>
2896
2897         Reviewed by Simon Fraser.
2898
2899         Added fast/text/text-underline-position-under.html
2900
2901         * rendering/InlineFlowBox.cpp:
2902         (WebCore::InlineFlowBox::computeMaxLogicalBottom):
2903         (WebCore::InlineFlowBox::computeMaxLogicalTop): Deleted.
2904         * rendering/InlineFlowBox.h:
2905         Switch to using the bottom to compute the offset. Using the top is incorrect, since
2906         the heights of boxes can vary.
2907
2908         Fix a bug where the y() of the box was being used instead of the logical value, making the result
2909         wrong for vertical text.
2910
2911         * rendering/RootInlineBox.cpp:
2912         (WebCore::RootInlineBox::maxLogicalBottom):
2913         (WebCore::RootInlineBox::maxLogicalTop): Deleted.
2914         Switch to using the bottom instead of the top. Make sure the root box contributes its own bottom,
2915         since the old code just ignored the root's placement.
2916
2917         * rendering/RootInlineBox.h:
2918         * style/InlineTextBoxStyle.cpp:
2919         (WebCore::computeUnderlineOffset):
2920         Call the bottom function now instead of the top.
2921
2922 2015-02-10  Chris Dumez  <cdumez@apple.com>
2923
2924         Add assertion to help track down WebCore::DocumentLoader::stopLoadingForPolicyChange() crash
2925         https://bugs.webkit.org/show_bug.cgi?id=141441
2926         <rdar://problem/13811738>
2927
2928         Reviewed by Alexey Proskuryakov.
2929
2930         Add assertion to help track down a crash in
2931         WebCore::DocumentLoader::stopLoadingForPolicyChange().
2932
2933         * loader/DocumentLoader.cpp:
2934         (WebCore::DocumentLoader::~DocumentLoader):
2935         Make sure the DocumentLoader is not waiting for a content policy
2936         response when it is destroyed. If this were to happen, then the
2937         lambda function passed to PolicyChecker::checkContentPolicy()
2938         would outlive the DocumentLoader. This is an issue because
2939         that lambda function captures [this], which is the DocumentLoader.
2940         This would cause DocumentLoader::continueAfterContentPolicy() to
2941         be called after the DocumentLoader has been destroyed, which would
2942         explain the crash.
2943
2944 2015-02-07  Zalan Bujtas  <zalan@apple.com>
2945
2946         REGRESSION (r168046): Crash in WebCore::InlineBox::renderer / WebCore::RenderFlowThread::checkLinesConsistency
2947         https://bugs.webkit.org/show_bug.cgi?id=133462
2948
2949         Reviewed by David Hyatt.
2950
2951         RenderFlowThread::m_lineToRegionMap stores pointers to the root inlineboxes in the block flow.
2952         Normally root inlineboxes remove themselves from this map in their dtors. However when collapsing an anonymous block,
2953         we detach the inline tree first and destroy them after. The detached root boxes can't access
2954         the flowthread containing block and we end up with dangling pointers in this map.
2955         Call removeFlowChildInfo() before detaching the subtree to ensure proper pointer removal.
2956
2957         Test: fast/multicol/newmulticol/crash-when-switching-to-floating.html
2958
2959         * rendering/RenderBlock.cpp:
2960         (WebCore::RenderBlock::collapseAnonymousBoxChild):
2961
2962 2015-02-10  Julien Isorce  <j.isorce@samsung.com>
2963
2964         Render: properly update body's background image
2965         https://bugs.webkit.org/show_bug.cgi?id=140183
2966
2967         When HTML and BODY renderers are both composited the
2968         skipBodyBackground condition should also take into account
2969         if the HTML's layer can draw its contents.
2970
2971         Reviewed by Darin Adler.
2972
2973         Test: animations/animation-background-image.html
2974
2975         * rendering/RenderBox.cpp:
2976         (WebCore::skipBodyBackground): Do not skip
2977         if document's layer cannot draw its content.
2978         Previously both body and html did not paint the background
2979         when they are both composited.
2980
2981         * rendering/RenderLayerBacking.cpp:
2982         (WebCore::RenderLayerBacking::contentChanged): Also redisplay
2983         the content.
2984
2985 2015-02-10  Eric Carlson  <eric.carlson@apple.com>
2986
2987         [iOS] don't get out of sync when interrupt/resume calls are not balanced
2988         https://bugs.webkit.org/show_bug.cgi?id=141310
2989
2990         Reviewed by Jer Noble.
2991
2992         No new tests, updated media/video-interruption-with-resume-allowing-play.html.
2993
2994         * platform/audio/MediaSession.cpp:
2995         (WebCore::MediaSession::beginInterruption): Count interruptions.
2996         (WebCore::MediaSession::endInterruption): Ignore calls when m_interruptionCount is already zero.
2997         * platform/audio/MediaSession.h:
2998
2999 2015-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3000
3001         [GTK] GMutexLocker build issue
3002         https://bugs.webkit.org/show_bug.cgi?id=141381
3003
3004         Reviewed by Žan Doberšek.
3005
3006         Use always WTF::GMutexLocker because newer glib versions have a
3007         GMutexLocker in the public API.
3008
3009         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
3010         (WebCore::AudioSourceProviderGStreamer::provideInput):
3011         (WebCore::AudioSourceProviderGStreamer::handleAudioBuffer):
3012         (WebCore::AudioSourceProviderGStreamer::clearAdapters):
3013         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3014         (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize):
3015         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
3016         (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
3017         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
3018         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3019         (webkitVideoSinkTimeoutCallback):
3020         (webkitVideoSinkRender):
3021         (unlockSampleMutex):
3022         (webkitVideoSinkUnlockStop):
3023         (webkitVideoSinkStart):
3024         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3025         (webKitWebSrcGetProperty):
3026         (webKitWebSrcStop):
3027         (webKitWebSrcStart):
3028         (webKitWebSrcChangeState):
3029         (webKitWebSrcQueryWithParent):
3030         (webKitWebSrcGetUri):
3031         (webKitWebSrcSetUri):
3032         (webKitWebSrcNeedDataMainCb):
3033         (webKitWebSrcNeedDataCb):
3034         (webKitWebSrcEnoughDataMainCb):
3035         (webKitWebSrcEnoughDataCb):
3036         (webKitWebSrcSeekDataCb):
3037         (webKitWebSrcSetMediaPlayer):
3038         (StreamingClient::createReadBuffer):
3039         (StreamingClient::handleResponseReceived):
3040         (StreamingClient::handleDataReceived):
3041         (StreamingClient::handleNotifyFinished):
3042         (ResourceHandleStreamingClient::wasBlocked):
3043         (ResourceHandleStreamingClient::cannotShowURL):
3044
3045 2015-02-09  Alex Christensen  <achristensen@webkit.org>
3046
3047         Update WEBCORE_EXPORT to prepare to start using it.
3048         https://bugs.webkit.org/show_bug.cgi?id=141409
3049
3050         Reviewed by Tim Horton.
3051
3052         * bindings/js/JSDOMGlobalObject.h:
3053         * bindings/objc/DOMInternal.h:
3054         * bindings/objc/ExceptionHandlers.mm:
3055         * bindings/objc/WebScriptObjectPrivate.h:
3056         * bindings/scripts/CodeGeneratorJS.pm:
3057         (GenerateHeader):
3058         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3059         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3060         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3061         * bindings/scripts/test/JS/JSTestEventTarget.h:
3062         * bindings/scripts/test/JS/JSTestException.h:
3063         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3064         * bindings/scripts/test/JS/JSTestInterface.h:
3065         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3066         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3067         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3068         * bindings/scripts/test/JS/JSTestObj.h:
3069         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3070         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3071         * bindings/scripts/test/JS/JSTestTypedefs.h:
3072         * bindings/scripts/test/JS/JSattribute.h:
3073         * bindings/scripts/test/JS/JSreadonly.h:
3074         * css/StyleProperties.h:
3075         * dom/DeviceMotionData.h:
3076         * dom/Node.h:
3077         * dom/Position.h:
3078         * dom/ScriptExecutionContext.h:
3079         * editing/Editor.h:
3080         * editing/htmlediting.h:
3081         * html/HTMLInputElement.h:
3082         * html/TimeRanges.h:
3083         * loader/FrameLoader.h:
3084         * loader/cache/CacheValidation.h:
3085         * loader/cache/MemoryCache.h:
3086         * loader/icon/IconDatabase.h:
3087         * page/DatabaseProvider.h:
3088         * page/DiagnosticLoggingKeys.h:
3089         * page/EventHandler.h:
3090         * page/FrameSnapshotting.h:
3091         * page/MainFrame.h:
3092         * page/PageConsoleClient.h:
3093         * page/PageOverlay.h:
3094         * platform/CrossThreadCopier.h:
3095         * platform/FileSystem.h:
3096         * platform/PlatformSpeechSynthesizer.h:
3097         * platform/RemoteCommandListener.h:
3098         * platform/RuntimeApplicationChecks.h:
3099         * platform/graphics/Font.h:
3100         * platform/graphics/FontCache.h:
3101         * platform/graphics/FontGlyphs.h:
3102         * platform/graphics/FontRanges.h:
3103         * platform/graphics/GeometryUtilities.h:
3104         * platform/graphics/GlyphPage.h:
3105         * platform/graphics/Region.h:
3106         * platform/graphics/ca/PlatformCALayer.h:
3107         * platform/graphics/ca/TileController.h:
3108         * platform/graphics/transforms/TransformationMatrix.h:
3109         * platform/mac/WebCoreFullScreenWarningView.h:
3110         * platform/network/BlobDataFileReference.h:
3111         * platform/network/ResourceRequestBase.h:
3112         * platform/network/ResourceResponseBase.h:
3113         * platform/network/create-http-header-name-table:
3114         * platform/network/mac/WebCoreURLResponse.h:
3115         * platform/sql/SQLiteDatabaseTracker.h:
3116         * platform/sql/SQLiteStatement.h:
3117         * rendering/HitTestLocation.h:
3118         * rendering/HitTestResult.h:
3119         * storage/StorageEventDispatcher.h:
3120         Added WEBCORE_EXPORT macros.
3121
3122 2015-02-09  Chris Dumez  <cdumez@apple.com>
3123
3124         Check for self-assignment in Length::operator=(const Length&)
3125         https://bugs.webkit.org/show_bug.cgi?id=141402
3126
3127         Reviewed by Andreas Kling.
3128
3129         Check for self-assignment in Length::operator=(const Length&) as
3130         calling memcpy() with the same source and destination addresses has
3131         undefined behavior.
3132
3133         * platform/Length.h:
3134         (WebCore::Length::operator=):
3135
3136 2015-02-09  Roger Fong  <roger_fong@apple.com>
3137
3138         WebGL: Update 1.0.2 conformance layout tests and address new failure.
3139         https://bugs.webkit.org/show_bug.cgi?id=141408.
3140         <rdar://problem/19773236>
3141
3142         Reviewed by Dean Jackson.
3143
3144         Tests covered by updated 1.0.2 conformance tests.
3145
3146         * html/canvas/WebGLRenderingContextBase.cpp: 
3147         Return null string instead of empty string if parameter validation fails.
3148         (WebCore::WebGLRenderingContextBase::getProgramInfoLog):
3149         (WebCore::WebGLRenderingContextBase::getShaderInfoLog):
3150         (WebCore::WebGLRenderingContextBase::getShaderSource):
3151
3152 2015-02-09  Timothy Horton  <timothy_horton@apple.com>
3153
3154         Avoid using a HashMap for DisplayRefreshMonitorManager, which rarely has more than one item
3155         https://bugs.webkit.org/show_bug.cgi?id=141353
3156
3157         Reviewed by Anders Carlsson.
3158
3159         No new tests, because there's no behavior change.
3160
3161         * platform/graphics/DisplayRefreshMonitorManager.cpp:
3162         (WebCore::DisplayRefreshMonitorManager::ensureMonitorForClient):
3163         (WebCore::DisplayRefreshMonitorManager::unregisterClient):
3164         (WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
3165         * platform/graphics/DisplayRefreshMonitorManager.h:
3166         Use a Vector of RefPtr<DisplayRefreshMonitor> instead of a HashMap
3167         from uint64_t to RefPtr<DisplayRefreshMonitor>. There's usually only one
3168         display, so there's usually only one DisplayRefreshMonitor. Linear search
3169         on the Vector will be faster than the hash lookup in all conceivable cases.
3170         This also avoids the situation mentioned in the comments in DisplayRefreshMonitorManager.h
3171         where we don't know enough about PlatformDisplayID to safely hash it.
3172
3173 2015-02-09  Jer Noble  <jer.noble@apple.com>
3174
3175         [Mac] Disable the currentTime estimation code in HTMLMediaElement for Yosemite+
3176         https://bugs.webkit.org/show_bug.cgi?id=141399
3177
3178         Reviewed by Eric Carlson.
3179
3180         Apparenty -[AVPlayer rate] means different things for HLS and progressive content; for progressive,
3181         the -rate is the actual rate of playback. For HLS, the -rate is the requested rate, and will return
3182         the requested value even if time is not progressing.
3183
3184         We added the currentTime estimation engine because asking AVFoundation for its -currentTime used to
3185         be expensive, but we've been assured that in recent iOS and OS X releases, -currentTime should be
3186         very fast. That, in combination with the HLS behavior of -rate and how it breaks the currentTime
3187         estimation, means we should probably turn it off for iOS and Yosemite.
3188
3189         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3190         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime): Move implementation to .mm.
3191         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3192         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime): Disable on iOS and >=10.10.
3193
3194 2015-02-07  Roger Fong  <roger_fong@apple.com>
3195
3196         WebGL 2: Texture call format, internal format, and type validation.
3197         https://bugs.webkit.org/show_bug.cgi?id=141318.
3198         <rdar://problem/19733828>
3199
3200         Reviewed by Brent Fulgham.
3201
3202         Tests will be covered by WebGL2 conformance tests.
3203
3204         * html/canvas/WebGL2RenderingContext.cpp:
3205         (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter): Add missing ExceptionCode argument.
3206         (WebCore::WebGL2RenderingContext::copyTexImage2D): Validate texture formats based on GLES3 spec.
3207         (WebCore::WebGL2RenderingContext::texSubImage2DBase): Validate using internal format from texture target.
3208         (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Validate using internal format from texture target.
3209         (WebCore::WebGL2RenderingContext::texSubImage2D): Validate using internal format from texture target.
3210         (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Do extra validation for copyTexImage2D.
3211         (WebCore::WebGL2RenderingContext::validateTexFuncFormatAndType): Validate internal format, format and type combination.
3212         (WebCore::WebGL2RenderingContext::validateTexFuncData): Validate new data types.
3213         This method now accepts an internal format argument.
3214         (WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
3215         Helper method to convert internal format to base internal format.
3216         * html/canvas/WebGL2RenderingContext.h:
3217
3218         * html/canvas/WebGLRenderingContext.cpp:
3219         (WebCore::WebGLRenderingContext::copyTexImage2D): Moved from WebGLRenderingContextBase.
3220         (WebCore::WebGLRenderingContext::texSubImage2DBase): Ditto.
3221         (WebCore::WebGLRenderingContext::texSubImage2DImpl): Ditto.
3222         (WebCore::WebGLRenderingContext::texSubImage2D): Ditto.
3223         (WebCore::WebGLRenderingContext::validateTexFuncParameters): Ditto.
3224         (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType): Ditto.
3225         (WebCore::WebGLRenderingContext::validateTexFuncData): Ditto.
3226         * html/canvas/WebGLRenderingContext.h:
3227
3228         * html/canvas/WebGLRenderingContextBase.cpp:
3229         (WebCore::WebGLRenderingContextBase::texImage2DBase):
3230         (WebCore::WebGLRenderingContextBase::validateTexFunc):
3231         (WebCore::WebGLRenderingContextBase::texImage2D):
3232         (WebCore::WebGLRenderingContextBase::copyTexImage2D): Deleted.
3233         (WebCore::WebGLRenderingContextBase::texSubImage2DBase): Deleted.
3234         (WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Deleted.
3235         (WebCore::WebGLRenderingContextBase::texSubImage2D): Deleted.
3236         (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): Deleted.
3237         (WebCore::WebGLRenderingContextBase::validateTexFuncParameters): Deleted.
3238         (WebCore::WebGLRenderingContextBase::validateTexFuncData): Deleted.
3239         * html/canvas/WebGLRenderingContextBase.h: Modify validation type enums to differentiate between CopyImage, TexImage and TexSubImage calls.
3240         (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder):  Moved from WebGLRenderingContextBase.
3241         (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Ditto.
3242         (WebCore::clip1D): Ditto.
3243         (WebCore::clip2D): Ditto.
3244         * platform/graphics/GraphicsContext3D.h: Rename a typo'ed enum.
3245
3246 2015-02-09  Commit Queue  <commit-queue@webkit.org>
3247
3248         Unreviewed, rolling out r179494.
3249         https://bugs.webkit.org/show_bug.cgi?id=141395
3250
3251         Caused slowdown in a WebKit client test scenario (Requested by
3252         kling on #webkit).
3253
3254         Reverted changeset:
3255
3256         "[Cocoa] Make decoded image data purgeable ASAP."
3257         https://bugs.webkit.org/show_bug.cgi?id=140298
3258         http://trac.webkit.org/changeset/179494
3259
3260 2015-02-09  Jer Noble  <jer.noble@apple.com>
3261
3262         [WebAudio] AudioBufferSourceNodes should accurately play backwards if given a negative playbackRate.
3263         https://bugs.webkit.org/show_bug.cgi?id=140955
3264
3265         Reviewed by Eric Carlson.
3266
3267         Tests: webaudio/audiobuffersource-negative-playbackrate-interpolated.html
3268                webaudio/audiobuffersource-negative-playbackrate.html
3269
3270         Add support for playing an AudioBufferSourceNode at a negative playbackRate. Change the meaning of
3271         start() to set the initial playback position at the end of the play range if the rate of playback
3272         is negtive.
3273
3274         * Modules/webaudio/AudioBufferSourceNode.cpp:
3275         (WebCore::AudioBufferSourceNode::AudioBufferSourceNode): Allow the playbackRate AudioParam to range from [-32, 32].
3276         (WebCore::AudioBufferSourceNode::renderFromBuffer): Change variable names from "start" and "end" to "min" and "max"
3277             for clarity. Add a non-interpolated and interpolated render step for negative playback.
3278         (WebCore::AudioBufferSourceNode::start): Drive-by fix: default value of grainDuration is not 0.02.
3279         (WebCore::AudioBufferSourceNode::startPlaying): Start playing at the end of the buffer for negative playback.
3280         (WebCore::AudioBufferSourceNode::totalPitchRate): Allow the pitch to be negative.
3281
3282 2015-02-09  Darin Adler  <darin@apple.com>
3283
3284         Try to fix build on platforms that use SVG "all in one" file (Windows).
3285
3286         * svg/SVGAElement.cpp: Don't do "using namespace HTMLNames;" outside of
3287         function boundaries, because that will be inherited by other files.
3288         (WebCore::SVGAElement::isURLAttribute): Use XLinkNames directly here
3289         instead of using HTMLNames implicitly.
3290
3291         * svg/SVGElement.cpp: Don't do "using namespace HTMLNames;" outside of
3292         function boundaries, because that will be inherited by other files.
3293         (WebCore::populateAttributeNameToCSSPropertyIDMap): Instead do it in here.
3294         (WebCore::populateAttributeNameToAnimatedPropertyTypeMap): And here.
3295         (WebCore::populateCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): And here.
3296         (WebCore::SVGElement::parseAttribute): And use HTMLNames directly here
3297         instead of implicitly.
3298
3299 2015-02-09  Eric Carlson  <eric.carlson@apple.com>
3300
3301         [iOS] exit from fullscreen when player view controller calls delegate
3302         https://bugs.webkit.org/show_bug.cgi?id=141350
3303
3304         Reviewed by Jer Noble.
3305
3306         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3307         (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscree:]): New, ask delegate
3308             to exit from fullscreen.
3309
3310 2015-02-06  Sergio Villar Senin  <svillar@igalia.com>
3311
3312         ASSERTION FAILED: resolvedInitialPosition <= resolvedFinalPosition in WebCore::GridSpan::GridSpan
3313         https://bugs.webkit.org/show_bug.cgi?id=141328
3314
3315         Reviewed by Darin Adler.
3316
3317         Whenever
3318         GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition()
3319         was trying to place an item with span, it was completely ignoring
3320         the resolvedInitialPosition returned by
3321         GridResolvedPosition::resolveGridPositionAgainstOppositePosition()
3322         and only using the finalResolvedPosition. This works with an
3323         unlimited grid which can indefinitely grow. But if the item spans
3324         over the grid track limits, then it might happen that the final
3325         resolved position is placed before the initial resolved position,
3326         something that is forbidden.
3327
3328         The solution is to directly use the GridSpan returned by
3329         GridResolvedPosition::resolveGridPositionAgainstOppositePosition(), if the item
3330         does not surpass the track limits then the returned initialResolvedPosition
3331         is identical to the provided one, otherwise it's properly corrected to respect
3332         track boundaries.
3333
3334         * rendering/style/GridResolvedPosition.cpp:
3335         (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
3336
3337 2015-01-22  Sergio Villar Senin  <svillar@igalia.com>
3338
3339         [CSS Grid Layout] Tracks' growth limits must be >= base sizes
3340         https://bugs.webkit.org/show_bug.cgi?id=140540
3341
3342         Reviewed by Antti Koivisto.
3343
3344         The track sizing algorithm is supposed to avoid those situations
3345         but they easily (specially when we mix absolute lengths and
3346         intrinsic lengths in min and max track sizing functions) and
3347         frequently appear. In those cases the outcome from the algorithm
3348         is wrong, tracks are not correctly sized.
3349
3350         In order to fulfill the restriction, m_usedBreadth and
3351         m_maxBreadth are now private members of GridTrack and the class
3352         now provides a couple of methods to modify them respecting the
3353         growthLimit >= baseSize precondition.
3354
3355         Apart from that, the members and methods of GridTrack were also
3356         renamed to match the ones used in the recent algorithm rewrite:
3357         usedBreadth became baseSize and maxBreadth is now growthLimit.
3358
3359         Although the algorithm was not modified at all, this change
3360         detected and fixed several invalid results (tracks and/or grids
3361         bigger than expected).
3362
3363         * rendering/RenderGrid.cpp:
3364         (WebCore::GridTrack::GridTrack): Renamed fields and methods. Added
3365         assertions.
3366         (WebCore::GridTrack::baseSize): Renamed from usedBreadth.
3367         (WebCore::GridTrack::growthLimit): Renamed from maxBreadth.
3368         (WebCore::GridTrack::setBaseSize):
3369         (WebCore::GridTrack::setGrowthLimit):
3370         (WebCore::GridTrack::growBaseSize): Renamed from growUsedBreadth.
3371         (WebCore::GridTrack::growGrowthLimit): Renamed from growMaxBreadth.
3372         (WebCore::GridTrack::growthLimitIsInfinite): New helper method.
3373         (WebCore::GridTrack::growthLimitIfNotInfinite): Renamed from
3374         maxBreadthIfNotInfinite.
3375         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): New helper
3376         method to verify ASSERTs are true.
3377         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Ditto.
3378         (WebCore::GridTrackForNormalization::GridTrackForNormalization):
3379         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
3380         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
3381         (WebCore::RenderGrid::computeNormalizedFractionBreadth):
3382         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
3383         (WebCore::sortByGridTrackGrowthPotential):
3384         (WebCore::RenderGrid::distributeSpaceToTracks):
3385         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
3386         (WebCore::RenderGrid::layoutGridItems):
3387         (WebCore::RenderGrid::gridAreaBreadthForChild):
3388         (WebCore::RenderGrid::populateGridPositions):
3389         (WebCore::GridTrack::growUsedBreadth): Renamed to growBaseSize.
3390         (WebCore::GridTrack::usedBreadth): Renamed to baseSize.
3391         (WebCore::GridTrack::growMaxBreadth): Renamed to growGrowthLimit.
3392         (WebCore::GridTrack::maxBreadthIfNotInfinite): Renamed to
3393         growthLimitIfNotInfinite.
3394         * rendering/RenderGrid.h:
3395
3396 2015-02-08  Chris Fleizach  <cfleizach@apple.com>
3397
3398         AX: VoiceOver appears unresponsive when JavaScript alerts are triggered via focus or blur events
3399         https://bugs.webkit.org/show_bug.cgi?id=140485
3400
3401         Reviewed by Anders Carlsson.
3402
3403         If setting an accessibility attribute results in a modal alert being displayed, it can cause VoiceOver
3404         to hang. A simple solution is perform the actual work after a short delay, which will ensure the call
3405         returns without hanging.
3406
3407         Test: platform/mac/accessibility/setting-attributes-is-asynchronous.html
3408
3409         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3410         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3411         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):