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