iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-09-23  Antonio Gomes  <a1.gomes@sisa.samsung.com>
2
3         iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
4         https://bugs.webkit.org/show_bug.cgi?id=40981
5
6         Reviewed by Darin Adler.
7
8         RenderBox::calculateAutoscrollDirection does not properly translate
9         inner frames' coordinates in order to determine its auto-scrollability.
10         By coincidence, if the inner frame box it placed near to page's 0, 0 position
11         (upper left corner), it might work.
12
13         Patch fixes it by changing ::calculateAutoscrollDirection algorithm to operate
14         with window coordinates, taking inner frames offset and scroll position into account.
15         The behavior of auto-scrollable non-frame overflow boxes, including divs, still works
16         as it is used to.
17
18         Test: fast/events/drag-and-drop-autoscroll-inner-frame.html
19
20         * rendering/RenderBox.cpp:
21         (WebCore::RenderBox::calculateAutoscrollDirection):
22
23 2013-09-23  Brady Eidson  <beidson@apple.com>
24
25         Move LevelDB specific IDB files into their own subdirectory.
26         https://bugs.webkit.org/show_bug.cgi?id=121804
27
28         Rubberstamped by Alexey Proskuryakov.
29
30         * CMakeLists.txt:
31         * GNUmakefile.list.am:
32         * WebCore.xcodeproj/project.pbxproj:
33
34         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBBackingStore.cpp.
35         (WebCore::recordInternalError):
36         (WebCore::putBool):
37         (WebCore::getInt):
38         (WebCore::putInt):
39         (WebCore::getVarInt):
40         (WebCore::putVarInt):
41         (WebCore::getString):
42         (WebCore::putString):
43         (WebCore::putIDBKeyPath):
44         (WebCore::compareKeys):
45         (WebCore::compareIndexKeys):
46         (WebCore::Comparator::compare):
47         (WebCore::Comparator::name):
48         (WebCore::isSchemaKnown):
49         (WebCore::setUpMetadata):
50         (WebCore::getMaxObjectStoreId):
51         (WebCore::DefaultLevelDBFactory::openLevelDB):
52         (WebCore::DefaultLevelDBFactory::destroyLevelDB):
53         (WebCore::IDBBackingStore::IDBBackingStore):
54         (WebCore::IDBBackingStore::~IDBBackingStore):
55         (WebCore::IDBBackingStore::open):
56         (WebCore::IDBBackingStore::openInMemory):
57         (WebCore::IDBBackingStore::create):
58         (WebCore::IDBBackingStore::getDatabaseNames):
59         (WebCore::IDBBackingStore::getIDBDatabaseMetaData):
60         (WebCore::getNewDatabaseId):
61         (WebCore::IDBBackingStore::createIDBDatabaseMetaData):
62         (WebCore::IDBBackingStore::updateIDBDatabaseIntVersion):
63         (WebCore::IDBBackingStore::updateIDBDatabaseMetaData):
64         (WebCore::deleteRange):
65         (WebCore::IDBBackingStore::deleteDatabase):
66         (WebCore::checkObjectStoreAndMetaDataType):
67         (WebCore::IDBBackingStore::getObjectStores):
68         (WebCore::setMaxObjectStoreId):
69         (WebCore::IDBBackingStore::createObjectStore):
70         (WebCore::IDBBackingStore::deleteObjectStore):
71         (WebCore::IDBBackingStore::getRecord):
72         (WebCore::getNewVersionNumber):
73         (WebCore::IDBBackingStore::putRecord):
74         (WebCore::IDBBackingStore::clearObjectStore):
75         (WebCore::IDBBackingStore::deleteRecord):
76         (WebCore::IDBBackingStore::getKeyGeneratorCurrentNumber):
77         (WebCore::IDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber):
78         (WebCore::IDBBackingStore::keyExistsInObjectStore):
79         (WebCore::checkIndexAndMetaDataKey):
80         (WebCore::IDBBackingStore::getIndexes):
81         (WebCore::setMaxIndexId):
82         (WebCore::IDBBackingStore::createIndex):
83         (WebCore::IDBBackingStore::deleteIndex):
84         (WebCore::IDBBackingStore::putIndexDataForRecord):
85         (WebCore::findGreatestKeyLessThanOrEqual):
86         (WebCore::versionExists):
87         (WebCore::IDBBackingStore::findKeyInIndex):
88         (WebCore::IDBBackingStore::getPrimaryKeyViaIndex):
89         (WebCore::IDBBackingStore::keyExistsInIndex):
90         (WebCore::IDBBackingStore::Cursor::Cursor):
91         (WebCore::IDBBackingStore::Cursor::firstSeek):
92         (WebCore::IDBBackingStore::Cursor::advance):
93         (WebCore::IDBBackingStore::Cursor::continueFunction):
94         (WebCore::IDBBackingStore::Cursor::haveEnteredRange):
95         (WebCore::IDBBackingStore::Cursor::isPastBounds):
96         (WebCore::ObjectStoreKeyCursorImpl::create):
97         (WebCore::ObjectStoreKeyCursorImpl::clone):
98         (WebCore::ObjectStoreKeyCursorImpl::value):
99         (WebCore::ObjectStoreKeyCursorImpl::encodeKey):
100         (WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
101         (WebCore::ObjectStoreKeyCursorImpl::loadCurrentRow):
102         (WebCore::ObjectStoreCursorImpl::create):
103         (WebCore::ObjectStoreCursorImpl::clone):
104         (WebCore::ObjectStoreCursorImpl::value):
105         (WebCore::ObjectStoreCursorImpl::encodeKey):
106         (WebCore::ObjectStoreCursorImpl::ObjectStoreCursorImpl):
107         (WebCore::ObjectStoreCursorImpl::loadCurrentRow):
108         (WebCore::IndexKeyCursorImpl::create):
109         (WebCore::IndexKeyCursorImpl::clone):
110         (WebCore::IndexKeyCursorImpl::value):
111         (WebCore::IndexKeyCursorImpl::primaryKey):
112         (WebCore::IndexKeyCursorImpl::recordIdentifier):
113         (WebCore::IndexKeyCursorImpl::encodeKey):
114         (WebCore::IndexKeyCursorImpl::IndexKeyCursorImpl):
115         (WebCore::IndexKeyCursorImpl::loadCurrentRow):
116         (WebCore::IndexCursorImpl::create):
117         (WebCore::IndexCursorImpl::clone):
118         (WebCore::IndexCursorImpl::value):
119         (WebCore::IndexCursorImpl::primaryKey):
120         (WebCore::IndexCursorImpl::recordIdentifier):
121         (WebCore::IndexCursorImpl::encodeKey):
122         (WebCore::IndexCursorImpl::IndexCursorImpl):
123         (WebCore::IndexCursorImpl::loadCurrentRow):
124         (WebCore::objectStoreCursorOptions):
125         (WebCore::indexCursorOptions):
126         (WebCore::IDBBackingStore::openObjectStoreCursor):
127         (WebCore::IDBBackingStore::openObjectStoreKeyCursor):
128         (WebCore::IDBBackingStore::openIndexKeyCursor):
129         (WebCore::IDBBackingStore::openIndexCursor):
130         (WebCore::IDBBackingStore::Transaction::Transaction):
131         (WebCore::IDBBackingStore::Transaction::begin):
132         (WebCore::IDBBackingStore::Transaction::commit):
133         (WebCore::IDBBackingStore::Transaction::rollback):
134         * Modules/indexeddb/leveldb/IDBLevelDBCoding.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.cpp.
135         (WebCore::IDBLevelDBCoding::encodeByte):
136         (WebCore::IDBLevelDBCoding::decodeByte):
137         (WebCore::IDBLevelDBCoding::maxIDBKey):
138         (WebCore::IDBLevelDBCoding::minIDBKey):
139         (WebCore::IDBLevelDBCoding::encodeBool):
140         (WebCore::IDBLevelDBCoding::decodeBool):
141         (WebCore::IDBLevelDBCoding::encodeInt):
142         (WebCore::IDBLevelDBCoding::decodeInt):
143         (WebCore::IDBLevelDBCoding::compareInts):
144         (WebCore::IDBLevelDBCoding::encodeVarInt):
145         (WebCore::IDBLevelDBCoding::decodeVarInt):
146         (WebCore::IDBLevelDBCoding::encodeString):
147         (WebCore::IDBLevelDBCoding::decodeString):
148         (WebCore::IDBLevelDBCoding::encodeStringWithLength):
149         (WebCore::IDBLevelDBCoding::decodeStringWithLength):
150         (WebCore::IDBLevelDBCoding::compareEncodedStringsWithLength):
151         (WebCore::IDBLevelDBCoding::encodeDouble):
152         (WebCore::IDBLevelDBCoding::decodeDouble):
153         (WebCore::IDBLevelDBCoding::encodeIDBKey):
154         (WebCore::IDBLevelDBCoding::decodeIDBKey):
155         (WebCore::IDBLevelDBCoding::extractEncodedIDBKey):
156         (WebCore::IDBLevelDBCoding::keyTypeByteToKeyType):
157         (WebCore::IDBLevelDBCoding::compareEncodedIDBKeys):
158         (WebCore::IDBLevelDBCoding::encodeIDBKeyPath):
159         (WebCore::IDBLevelDBCoding::decodeIDBKeyPath):
160         (WebCore::IDBLevelDBCoding::compare):
161         (WebCore::IDBLevelDBCoding::KeyPrefix::KeyPrefix):
162         (WebCore::IDBLevelDBCoding::KeyPrefix::createWithSpecialIndex):
163         (WebCore::IDBLevelDBCoding::KeyPrefix::isValidDatabaseId):
164         (WebCore::IDBLevelDBCoding::KeyPrefix::isValidObjectStoreId):
165         (WebCore::IDBLevelDBCoding::KeyPrefix::isValidIndexId):
166         (WebCore::IDBLevelDBCoding::KeyPrefix::decode):
167         (WebCore::IDBLevelDBCoding::KeyPrefix::encodeEmpty):
168         (WebCore::IDBLevelDBCoding::KeyPrefix::encode):
169         (WebCore::IDBLevelDBCoding::KeyPrefix::encodeInternal):
170         (WebCore::IDBLevelDBCoding::KeyPrefix::compare):
171         (WebCore::IDBLevelDBCoding::KeyPrefix::type):
172         (WebCore::IDBLevelDBCoding::SchemaVersionKey::encode):
173         (WebCore::IDBLevelDBCoding::MaxDatabaseIdKey::encode):
174         (WebCore::IDBLevelDBCoding::DataVersionKey::encode):
175         (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::DatabaseFreeListKey):
176         (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::decode):
177         (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::encode):
178         (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::encodeMaxKey):
179         (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::databaseId):
180         (WebCore::IDBLevelDBCoding::DatabaseFreeListKey::compare):
181         (WebCore::IDBLevelDBCoding::DatabaseNameKey::decode):
182         (WebCore::IDBLevelDBCoding::DatabaseNameKey::encode):
183         (WebCore::IDBLevelDBCoding::DatabaseNameKey::encodeMinKeyForOrigin):
184         (WebCore::IDBLevelDBCoding::DatabaseNameKey::encodeStopKeyForOrigin):
185         (WebCore::IDBLevelDBCoding::DatabaseNameKey::compare):
186         (WebCore::IDBLevelDBCoding::DatabaseMetaDataKey::encode):
187         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::ObjectStoreMetaDataKey):
188         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::decode):
189         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::encode):
190         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::encodeMaxKey):
191         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::objectStoreId):
192         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::metaDataType):
193         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::compare):
194         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::IndexMetaDataKey):
195         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::decode):
196         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::encode):
197         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::encodeMaxKey):
198         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::compare):
199         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::indexId):
200         (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::ObjectStoreFreeListKey):
201         (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::decode):
202         (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::encode):
203         (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::encodeMaxKey):
204         (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::objectStoreId):
205         (WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::compare):
206         (WebCore::IDBLevelDBCoding::IndexFreeListKey::IndexFreeListKey):
207         (WebCore::IDBLevelDBCoding::IndexFreeListKey::decode):
208         (WebCore::IDBLevelDBCoding::IndexFreeListKey::encode):
209         (WebCore::IDBLevelDBCoding::IndexFreeListKey::encodeMaxKey):
210         (WebCore::IDBLevelDBCoding::IndexFreeListKey::compare):
211         (WebCore::IDBLevelDBCoding::IndexFreeListKey::objectStoreId):
212         (WebCore::IDBLevelDBCoding::IndexFreeListKey::indexId):
213         (WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::decode):
214         (WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::encode):
215         (WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::compare):
216         (WebCore::IDBLevelDBCoding::IndexNamesKey::IndexNamesKey):
217         (WebCore::IDBLevelDBCoding::IndexNamesKey::decode):
218         (WebCore::IDBLevelDBCoding::IndexNamesKey::encode):
219         (WebCore::IDBLevelDBCoding::IndexNamesKey::compare):
220         (WebCore::IDBLevelDBCoding::ObjectStoreDataKey::decode):
221         (WebCore::IDBLevelDBCoding::ObjectStoreDataKey::encode):
222         (WebCore::IDBLevelDBCoding::ObjectStoreDataKey::compare):
223         (WebCore::IDBLevelDBCoding::ObjectStoreDataKey::userKey):
224         (WebCore::IDBLevelDBCoding::ExistsEntryKey::decode):
225         (WebCore::IDBLevelDBCoding::ExistsEntryKey::encode):
226         (WebCore::IDBLevelDBCoding::ExistsEntryKey::compare):
227         (WebCore::IDBLevelDBCoding::ExistsEntryKey::userKey):
228         (WebCore::IDBLevelDBCoding::IndexDataKey::IndexDataKey):
229         (WebCore::IDBLevelDBCoding::IndexDataKey::decode):
230         (WebCore::IDBLevelDBCoding::IndexDataKey::encode):
231         (WebCore::IDBLevelDBCoding::IndexDataKey::encodeMinKey):
232         (WebCore::IDBLevelDBCoding::IndexDataKey::encodeMaxKey):
233         (WebCore::IDBLevelDBCoding::IndexDataKey::compare):
234         (WebCore::IDBLevelDBCoding::IndexDataKey::databaseId):
235         (WebCore::IDBLevelDBCoding::IndexDataKey::objectStoreId):
236         (WebCore::IDBLevelDBCoding::IndexDataKey::indexId):
237         (WebCore::IDBLevelDBCoding::IndexDataKey::userKey):
238         (WebCore::IDBLevelDBCoding::IndexDataKey::primaryKey):
239         * Modules/indexeddb/leveldb/IDBLevelDBCoding.h: Renamed from Source/WebCore/Modules/indexeddb/IDBLevelDBCoding.h.
240         (WebCore::IDBLevelDBCoding::encodeIntSafely):
241         (WebCore::IDBLevelDBCoding::KeyPrefix::validIds):
242         (WebCore::IDBLevelDBCoding::DatabaseNameKey::origin):
243         (WebCore::IDBLevelDBCoding::DatabaseNameKey::databaseName):
244         (WebCore::IDBLevelDBCoding::IndexMetaDataKey::metaDataType):
245         (WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::objectStoreName):
246         (WebCore::IDBLevelDBCoding::IndexNamesKey::indexName):
247
248 2013-09-23  Antti Koivisto  <antti@apple.com>
249
250         Try to fix GTK build.
251         
252         Not reviewed.
253
254         * accessibility/atk/AccessibilityObjectAtk.cpp:
255         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
256         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
257         (textForRenderer):
258
259 2013-09-23  Alexandru Chiculita  <achicu@adobe.com>
260
261         Web Inspector: [CSS Regions] Display CSS Regions flow name in the inspector overlay
262         https://bugs.webkit.org/show_bug.cgi?id=121794
263
264         Reviewed by Joseph Pecoraro.
265
266         No new tests, the previous test for CSS Regions highlighting covers the flow name.
267
268         This patch adds the "Flow" property in the inspector overlay. The region
269         chain is already displayed with numbers, so it makes sense to have the flow 
270         name around when a CSS region is highlighted.
271
272         I've consolidated the flow information into "elementInfo.flowInfo". 
273         Flow info has two properties: "name" and "regions".
274
275         * inspector/InspectorOverlay.cpp:
276         (WebCore::buildObjectForCSSRegionsHighlight):
277         (WebCore::InspectorOverlay::buildObjectForHighlightedNode):
278         * inspector/InspectorOverlayPage.css:
279         (.css-property): Added the CSS property font color that the Inspector uses.
280         * inspector/InspectorOverlayPage.html: Added a new element to be used to display the flow-from property.
281         * inspector/InspectorOverlayPage.js:
282         (_drawElementTitle):
283         (drawNodeHighlight):
284
285 2013-09-23  Simon Fraser  <simon.fraser@apple.com>
286
287         Rapidly loading pages can result in !needsLayout() assertions in FrameView::paintContents() and RenderView::paint()
288         https://bugs.webkit.org/show_bug.cgi?id=121725
289         <rdar://problem/13982161> ASSERT(!needsLayout()) in WebCore::RenderView::paint (121196)
290
291         Reviewed by Dean Jackson.
292         
293         Layout has to be up-to-date before we paint, and when composited we rely on a
294         CFRunLoopObserver owned by LayerFlushScheduler to enforce this. The contract is
295         that changes to GraphicsLayers accumulate in those layers, and are all pushed to
296         CALayers only inside of flushCompositingState(). CALayers must not be touched
297         directly outside of flushCompositingState(), since this may trigger a CA commit
298         and resultant painting without us having updated layout.
299         
300         In addition, we rely on the CA commits only happening after our runloop observer
301         has fired in order for LayerFlushScheduler's suspend/resume to work (these are used
302         for freezing the layer tree during page transitions).
303         
304         However, TileController was violating this contract. It called revalidateTiles()
305         at random times, and on a timer. This would result in CA commits happening when
306         layer flushing was suspended at the LayerFlushScheduler level, and thus before
307         we'd had a chance to do layout.
308         
309         Fix by only ever revalidatingTiles inside of flushCompositingState(). Calls
310         that used to result in revalidateTiles() at other times now just set a bit
311         on GraphicsLayerCA to indicate that revalidation is required, and this triggers
312         a later flush like any other GraphicsLayerCA change.
313         
314         There is one exception to the revalidate-inside-flush rule: when purging
315         files for background tabs on a timer, we are only dealing with an unparented
316         layer tree, so CALayer manipulation is safe at any time.
317
318         Very timing dependent, so hard to test.
319
320         * platform/graphics/TiledBacking.h: Expose revalidateTiles()
321         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Remove
322         platformCALayerDidCreateTiles() override.
323         * platform/graphics/ca/GraphicsLayerCA.h: Keep track of m_isCommittingChanges
324         so we can assert. Add TilingAreaChanged flag.
325         * platform/graphics/ca/GraphicsLayerCA.cpp:
326         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
327         (WebCore::GraphicsLayerCA::recursiveCommitChanges): noteSublayersChanged() is
328         used inside of a commit in some cases to trigger a parent layer to update
329         children after the children have been processed. To avoid trying to pointlessly
330         schedule the flusher inside a flush, and for strong assertions, use a new flag
331         that indicates that flushing is not required in this situation.
332         Set the m_isCommittingChanges flag around committing state.
333         (WebCore::GraphicsLayerCA::platformCALayerSetNeedsToRevalidateTiles): We used
334         to use platformCALayerDidCreateTiles() to ensure that we would flush after adding
335         new tiles to avoid garbage flashes. Now that we only ever create tiles inside
336         a flush, this is no longer necessary.
337         The new platformCALayerSetNeedsToRevalidateTiles() function just sets the
338         TilingAreaChanged flag and triggers a flush.
339         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): After updating
340         visible rect, we look for the TilingAreaChanged flag to tell us whether to
341         revalidate TiledBacking tiles.
342         (WebCore::GraphicsLayerCA::ensureStructuralLayer): Use DontScheduleFlush when 
343         telling a parent layer that it needs to reconsider sublayers.
344         (WebCore::GraphicsLayerCA::updateTiles): The caller of revalidateTiles().
345         (WebCore::GraphicsLayerCA::updateContentsRects): DontScheduleFlush again.
346         (WebCore::GraphicsLayerCA::noteSublayersChanged): Pass scheduleFlush along.
347         (WebCore::GraphicsLayerCA::noteLayerPropertyChanged): Handle scheduleFlush.
348         * platform/graphics/ca/PlatformCALayerClient.h:
349         (WebCore::PlatformCALayerClient::platformCALayerSetNeedsToRevalidateTiles): Added
350         so that TileController can call back out to GraphicsLayerCA.
351         (WebCore::PlatformCALayerClient::isCommittingChanges):
352         * platform/graphics/ca/mac/TileController.h: Need to keep track of secondary
353         coverage rects in m_secondaryTileCoverageRects.
354         * platform/graphics/ca/mac/TileController.mm:
355         (WebCore::TileController::tileCacheLayerBoundsChanged): Just trigger a tile revalidate,
356         which will happen later in this same commit.
357         (WebCore::TileController::setScale): This is called inside the commit. Does an extra
358         revalidate, which is needed to prune tiles. This could be optimized in future.
359         (WebCore::TileController::setVisibleRect): Assert that we're inside a commit,
360         and trigger a revalidate.
361         (WebCore::TileController::setExposedRect): Trigger a revalidate.
362         (WebCore::TileController::setClipsToExposedRect): Ditto.
363         (WebCore::TileController::prepopulateRect): Save the rect and trigger a revalidate.
364         (WebCore::TileController::setIsInWindow): If we're in the window, trigger a revalidate
365         otherwise schedule the timer.
366         (WebCore::TileController::revalidateTiles): Wrapper for the real revalidateTiles().
367         (WebCore::TileController::tileRevalidationTimerFired): If we're in the window,
368         schedule a revalidate. Otherwise our layer tree is disconnected, and it's OK to call revalidateTiles().
369         (WebCore::TileController::setNeedsRevalidateTiles): Call through the client to GraphicsLayerCA
370         which will schedule a layer tree flush.
371         (WebCore::TileController::revalidateTiles):
372         (WebCore::TileController::ensureTilesForRect): Move code from prepopulateRect
373         into here; ensureTilesForRect() for each secondary rect, then clear the rects.
374         No need to call platformCALayerDidCreateTiles() at the end.
375         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: Remove
376         platformCALayerDidCreateTiles() override.
377         * rendering/RenderLayerCompositor.cpp:
378         (WebCore::RenderLayerCompositor::scheduleLayerFlush): This should only be
379         called when we're not inside a flush, otherwise it will fail to schedule
380         another one.
381
382 2013-09-23  Sam Weinig  <sam@webkit.org>
383
384         CTTE: htmlediting.h Element creation function should take a Document&
385         https://bugs.webkit.org/show_bug.cgi?id=121800
386
387         Reviewed by Antti Koivisto.
388
389         Thread the Document&!
390
391 2013-09-23  Jacky Jiang  <zhajiang@blackberry.com>
392
393         [BlackBerry] Poor rendering opening a Google map short link
394         https://bugs.webkit.org/show_bug.cgi?id=121687
395
396         Reviewed by Yong Li.
397         Internally reviewed by Liam Quinn and Joe Mason.
398
399         Fix a regression. It turns out that LayerCompositingThread already has
400         an API named isVisible() which by default returns false. So rename the
401         one in the LayerData to isLayerVisible().
402
403         * platform/graphics/blackberry/LayerData.h:
404         (WebCore::LayerData::isLayerVisible):
405         * platform/graphics/blackberry/LayerRenderer.cpp:
406         (WebCore::LayerRenderer::compositeLayersRecursive):
407
408 2013-09-23  Antti Koivisto  <antti@apple.com>
409
410         Rename RenderObject::first/lastChild to RenderObject::first/lastChildSlow
411         https://bugs.webkit.org/show_bug.cgi?id=121784
412
413         Reviewed by Andreas Kling.
414
415         This will make it obvious in code where typing should be tightened.
416         Handled some simple cases by tightening the code instead of renaming.
417
418 2013-09-23  ChangSeok Oh  <changseok.oh@collabora.com>
419
420         [Texmap] Reloading a webgl page doesn't work
421         https://bugs.webkit.org/show_bug.cgi?id=120593
422
423         Reviewed by Noam Rosenthal.
424
425         Let GraphicsLayerTextureMapper know it needs to detach the platform layer when a GraphicsContext3D is destroyed.
426
427         Test: fast/canvas/webgl/webgl-reload-crash.html
428
429         * platform/graphics/GraphicsContext3DPrivate.cpp:
430         (WebCore::GraphicsContext3DPrivate::~GraphicsContext3DPrivate):
431         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
432         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
433
434 2013-09-23  Antti Koivisto  <antti@apple.com>
435
436         Remove RenderObjectChildList
437         https://bugs.webkit.org/show_bug.cgi?id=121771
438
439         Reviewed by Darin Adler.
440
441         Most RenderElement subclasses have m_children member (>90% of instances on typical page). It is not worth optimising
442         for memory for the few cases that don't (RenderImage, RenderLineBreak mostly) in expense of performance.
443         
444         This patch moves child handling to RenderElement. This gets rid of virtual children() calls and simplifies the code.
445
446 2013-09-23  Andreas Kling  <akling@apple.com>
447
448         Document::destroyRenderTree() shouldn't do anything but.
449         <https://webkit.org/b/121786>
450
451         Reviewed by Anders Carlsson.
452
453         Move everything in destroyRenderTree() that doesn't actually destroy
454         render trees to prepareForDestruction() instead.
455
456         Destroying the render tree is now a reparable operation.
457
458 2013-09-23  Allan Sandfeld Jensen  <allan.jensen@digia.com>
459
460         [Qt] Tiled backing-store causes wrong translation
461         https://bugs.webkit.org/show_bug.cgi?id=121789
462
463         Reviewed by Noam Rosenthal.
464
465         Move the translation inside save/restore of the GraphicsContext.
466
467         * platform/graphics/qt/TileQt.cpp:
468         (WebCore::TileQt::updateBackBuffer):
469
470 2013-09-23  Andreas Kling  <akling@apple.com>
471
472         Unify code paths leading to render tree teardown.
473         <https://webkit.org/b/121785>
474
475         Reviewed by Antti Koivisto.
476
477         Make Document::prepareForDestruction() fit all the call sites that were
478         doing destroyRenderTree() + disconnectFromFrame().
479
480         - disconnectDescendantFrames() is already a no-op if there are no frames.
481         - willDetachDocumentFromFrame() will only run if there is a frame.
482
483         This is another step towards making tree rebuild possible.
484
485         Removed some age-old FIXMEs about why we aren't calling willRemove(),
486         a long-gone function.
487
488 2013-09-23  Patrick Gansterer  <paroga@webkit.org>
489
490         Cleanup CMake files in WebCore
491         https://bugs.webkit.org/show_bug.cgi?id=119262
492
493         Reviewed by Gyuyoung Kim.
494
495         Sort files and unify style.
496
497         * CMakeLists.txt:
498         * PlatformBlackBerry.cmake:
499         * PlatformEfl.cmake:
500         * PlatformGTK.cmake:
501         * PlatformWin.cmake:
502         * PlatformWinCE.cmake:
503
504 2013-09-22  Commit Queue  <commit-queue@webkit.org>
505
506         Unreviewed, rolling out r156254.
507         http://trac.webkit.org/changeset/156254
508         https://bugs.webkit.org/show_bug.cgi?id=121779
509
510         Caused assertions in fast/regions tests (Requested by ap on
511         #webkit).
512
513         * CMakeLists.txt:
514         * GNUmakefile.list.am:
515         * Target.pri:
516         * WebCore.vcxproj/WebCore.vcxproj:
517         * WebCore.xcodeproj/project.pbxproj:
518         * rendering/AutoTableLayout.cpp:
519         (WebCore::AutoTableLayout::recalcColumn):
520         * rendering/RenderBlock.cpp:
521         (WebCore::RenderBlock::willBeDestroyed):
522         (WebCore::RenderBlock::addChildToAnonymousColumnBlocks):
523         (WebCore::RenderBlock::splitBlocks):
524         (WebCore::RenderBlock::splitFlow):
525         (WebCore::RenderBlock::makeChildrenAnonymousColumnBlocks):
526         (WebCore::RenderBlock::makeChildrenNonInline):
527         (WebCore::RenderBlock::removeLeftoverAnonymousBlock):
528         (WebCore::RenderBlock::collapseAnonymousBoxChild):
529         (WebCore::RenderBlock::removeChild):
530         (WebCore::RenderBlock::updateFirstLetterStyle):
531         * rendering/RenderBlock.h:
532         (WebCore::RenderBlock::firstChild):
533         (WebCore::RenderBlock::lastChild):
534         * rendering/RenderBox.cpp:
535         (WebCore::RenderBox::splitAnonymousBoxesAroundChild):
536         * rendering/RenderBoxModelObject.cpp:
537         (WebCore::RenderBoxModelObject::moveChildTo):
538         * rendering/RenderElement.cpp:
539         (WebCore::RenderElement::RenderElement):
540         (WebCore::RenderElement::addChild):
541         (WebCore::RenderElement::removeChild):
542         * rendering/RenderElement.h:
543         * rendering/RenderEmbeddedObject.cpp:
544         (WebCore::RenderEmbeddedObject::layout):
545         * rendering/RenderEmbeddedObject.h:
546         * rendering/RenderFrameSet.h:
547         * rendering/RenderInline.cpp:
548         (WebCore::RenderInline::willBeDestroyed):
549         (WebCore::RenderInline::splitInlines):
550         (WebCore::RenderInline::splitFlow):
551         (WebCore::RenderInline::childBecameNonInline):
552         * rendering/RenderInline.h:
553         (WebCore::RenderInline::firstChild):
554         (WebCore::RenderInline::lastChild):
555         * rendering/RenderLayerModelObject.cpp:
556         (WebCore::RenderLayerModelObject::willBeDestroyed):
557         * rendering/RenderLineBreak.h:
558         * rendering/RenderListMarker.h:
559         * rendering/RenderMedia.cpp:
560         (WebCore::RenderMedia::layout):
561         * rendering/RenderMedia.h:
562         (WebCore::RenderMedia::firstChild):
563         (WebCore::RenderMedia::lastChild):
564         * rendering/RenderObject.cpp:
565         (WebCore::RenderObject::handleDynamicFloatPositionChange):
566         (WebCore::RenderObject::willBeDestroyed):
567         (WebCore::RenderObject::removeFromRenderFlowThreadRecursive):
568         * rendering/RenderObject.h:
569         (WebCore::RenderObject::firstChild):
570         (WebCore::RenderObject::lastChild):
571         (WebCore::RenderObject::children):
572         (WebCore::RenderObject::canHaveChildren):
573         * rendering/RenderObjectChildList.cpp: Added.
574         (WebCore::RenderObjectChildList::destroyLeftoverChildren):
575         (WebCore::RenderObjectChildList::removeChildNode):
576         (WebCore::RenderObjectChildList::insertChildNode):
577         * rendering/RenderObjectChildList.h: Copied from Source/WebCore/rendering/RenderMedia.h.
578         (WebCore::RenderObjectChildList::RenderObjectChildList):
579         (WebCore::RenderObjectChildList::firstChild):
580         (WebCore::RenderObjectChildList::lastChild):
581         (WebCore::RenderObjectChildList::setFirstChild):
582         (WebCore::RenderObjectChildList::setLastChild):
583         (WebCore::RenderObjectChildList::appendChildNode):
584         * rendering/RenderReplaced.h:
585         (WebCore::RenderReplaced::canHaveChildren):
586         * rendering/RenderReplica.h:
587         * rendering/RenderRubyBase.cpp:
588         (WebCore::RenderRubyBase::moveInlineChildren):
589         (WebCore::RenderRubyBase::moveBlockChildren):
590         * rendering/RenderTableCol.h:
591         * rendering/RenderTableRow.h:
592         * rendering/RenderTableSection.h:
593         * rendering/RenderText.h:
594         * rendering/RenderingAllInOne.cpp:
595         * rendering/mathml/RenderMathMLOperator.cpp:
596         (WebCore::RenderMathMLOperator::updateFromElement):
597         * rendering/svg/RenderSVGContainer.h:
598         (WebCore::RenderSVGContainer::firstChild):
599         (WebCore::RenderSVGContainer::lastChild):
600         * rendering/svg/RenderSVGGradientStop.h:
601         * rendering/svg/RenderSVGImage.h:
602         * rendering/svg/RenderSVGModelObject.cpp:
603         (WebCore::RenderSVGModelObject::willBeDestroyed):
604         * rendering/svg/RenderSVGRoot.h:
605         * rendering/svg/RenderSVGShape.h:
606
607 2013-09-22  Commit Queue  <commit-queue@webkit.org>
608
609         Unreviewed, rolling out r156253.
610         http://trac.webkit.org/changeset/156253
611         https://bugs.webkit.org/show_bug.cgi?id=121778
612
613         Caused >20 tests to crash with assertion failures (Requested
614         by ap on #webkit).
615
616         * css/CSSAspectRatioValue.h:
617         * css/CSSBorderImageSliceValue.h:
618         * css/CSSCalculationValue.cpp:
619         (WebCore::CSSCalcExpressionNodeParser::parseValue):
620         * css/CSSCalculationValue.h:
621         * css/CSSCrossfadeValue.cpp:
622         (WebCore::subimageKnownToBeOpaque):
623         * css/CSSCrossfadeValue.h:
624         (WebCore::toCSSCrossfadeValue):
625         * css/CSSCursorImageValue.cpp:
626         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
627         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
628         (WebCore::CSSCursorImageValue::cachedImage):
629         (WebCore::CSSCursorImageValue::cachedOrPendingImage):
630         (WebCore::CSSCursorImageValue::isSVGCursor):
631         * css/CSSCursorImageValue.h:
632         * css/CSSFilterImageValue.h:
633         (WebCore::toCSSFilterImageValue):
634         * css/CSSFontSelector.cpp:
635         (WebCore::CSSFontSelector::addFontFaceRule):
636         * css/CSSGradientValue.h:
637         * css/CSSImageGeneratorValue.cpp:
638         (WebCore::CSSImageGeneratorValue::image):
639         (WebCore::CSSImageGeneratorValue::fixedSize):
640         (WebCore::CSSImageGeneratorValue::loadSubimages):
641         (WebCore::CSSImageGeneratorValue::subimageIsPending):
642         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
643         * css/CSSImageGeneratorValue.h:
644         * css/CSSImageSetValue.cpp:
645         (WebCore::CSSImageSetValue::fillImageSet):
646         * css/CSSImageSetValue.h:
647         * css/CSSImageValue.h:
648         * css/CSSInheritedValue.h:
649         * css/CSSInitialValue.h:
650         * css/CSSLineBoxContainValue.h:
651         * css/CSSParser.cpp:
652         (WebCore::CSSParser::parseColor):
653         (WebCore::CSSParser::addProperty):
654         (WebCore::CSSParser::parse3ValuesFillPosition):
655         (WebCore::CSSParser::parseFillPosition):
656         (WebCore::CSSParser::parseFillRepeat):
657         (WebCore::CSSParser::parseDeprecatedRadialGradient):
658         (WebCore::CSSParser::parseRadialGradient):
659         * css/CSSPrimitiveValue.h:
660         * css/CSSReflectValue.h:
661         * css/CSSToStyleMap.cpp:
662         (WebCore::CSSToStyleMap::mapFillAttachment):
663         (WebCore::CSSToStyleMap::mapFillClip):
664         (WebCore::CSSToStyleMap::mapFillComposite):
665         (WebCore::CSSToStyleMap::mapFillBlendMode):
666         (WebCore::CSSToStyleMap::mapFillOrigin):
667         (WebCore::CSSToStyleMap::mapFillRepeatX):
668         (WebCore::CSSToStyleMap::mapFillRepeatY):
669         (WebCore::CSSToStyleMap::mapFillSize):
670         (WebCore::CSSToStyleMap::mapFillXPosition):
671         (WebCore::CSSToStyleMap::mapFillYPosition):
672         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
673         (WebCore::CSSToStyleMap::mapAnimationDelay):
674         (WebCore::CSSToStyleMap::mapAnimationDirection):
675         (WebCore::CSSToStyleMap::mapAnimationDuration):
676         (WebCore::CSSToStyleMap::mapAnimationFillMode):
677         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
678         (WebCore::CSSToStyleMap::mapAnimationName):
679         (WebCore::CSSToStyleMap::mapAnimationPlayState):
680         (WebCore::CSSToStyleMap::mapAnimationProperty):
681         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
682         (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
683         (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
684         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
685         * css/CSSValue.cpp:
686         (WebCore::CSSValue::destroy):
687         * css/CSSValue.h:
688         (WebCore::CSSValue::isCSSLineBoxContainValue):
689         (WebCore::CSSValue::isCalculationValue):
690         * css/CSSValueList.h:
691         * css/CSSVariableValue.h:
692         * css/DeprecatedStyleBuilder.cpp:
693         (WebCore::ApplyPropertyDefault::applyValue):
694         (WebCore::ApplyPropertyNumber::applyValue):
695         (WebCore::ApplyPropertyAuto::applyValue):
696         (WebCore::ApplyPropertyClip::applyValue):
697         (WebCore::ApplyPropertyColor::applyValue):
698         (WebCore::ApplyPropertyLength::applyValue):
699         (WebCore::ApplyPropertyString::applyValue):
700         (WebCore::ApplyPropertyBorderRadius::applyValue):
701         (WebCore::ApplyPropertyComputeLength::applyValue):
702         (WebCore::ApplyPropertyFont::applyValue):
703         (WebCore::ApplyPropertyFontFamily::applyValue):
704         (WebCore::ApplyPropertyFontSize::applyValue):
705         (WebCore::ApplyPropertyFontWeight::applyValue):
706         (WebCore::ApplyPropertyFontVariantLigatures::applyValue):
707         (WebCore::ApplyPropertyCounter::applyValue):
708         (WebCore::ApplyPropertyCursor::applyValue):
709         (WebCore::ApplyPropertyTextAlign::applyValue):
710         (WebCore::ApplyPropertyTextDecoration::applyValue):
711         (WebCore::ApplyPropertyMarqueeIncrement::applyValue):
712         (WebCore::ApplyPropertyMarqueeRepetition::applyValue):
713         (WebCore::ApplyPropertyMarqueeSpeed::applyValue):
714         (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
715         (WebCore::ApplyPropertyLineHeight::applyValue):
716         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
717         (WebCore::ApplyPropertyPageSize::applyValue):
718         (WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
719         (WebCore::ApplyPropertyResize::applyValue):
720         (WebCore::ApplyPropertyVerticalAlign::applyValue):
721         (WebCore::ApplyPropertyAspectRatio::applyValue):
722         (WebCore::ApplyPropertyZoom::applyValue):
723         (WebCore::ApplyPropertyDisplay::applyValue):
724         (WebCore::ApplyPropertyClipPath::applyValue):
725         (WebCore::ApplyPropertyShape::applyValue):
726         (WebCore::ApplyPropertyImageResolution::applyValue):
727         (WebCore::ApplyPropertyTextIndent::applyValue):
728         * css/FontFeatureValue.h:
729         * css/FontValue.h:
730         * css/MediaList.cpp:
731         (WebCore::reportMediaQueryWarningIfNeeded):
732         * css/MediaQueryEvaluator.cpp:
733         (WebCore::compareAspectRatioValue):
734         (WebCore::numberValue):
735         (WebCore::orientationMediaFeatureEval):
736         (WebCore::evalResolution):
737         (WebCore::device_pixel_ratioMediaFeatureEval):
738         (WebCore::resolutionMediaFeatureEval):
739         (WebCore::computeLength):
740         (WebCore::view_modeMediaFeatureEval):
741         (WebCore::pointerMediaFeatureEval):
742         * css/SVGCSSStyleSelector.cpp:
743         (WebCore::StyleResolver::applySVGProperty):
744         * css/ShadowValue.h:
745         * css/StylePropertySet.cpp:
746         (WebCore::StylePropertySet::getLayeredShorthandValue):
747         * css/StyleResolver.cpp:
748         (WebCore::createGridTrackSize):
749         (WebCore::createGridTrackList):
750         (WebCore::createGridPosition):
751         (WebCore::hasVariableReference):
752         (WebCore::StyleResolver::applyProperty):
753         (WebCore::StyleResolver::styleImage):
754         (WebCore::StyleResolver::generatedOrPendingFromValue):
755         (WebCore::StyleResolver::styleShader):
756         (WebCore::StyleResolver::parseCustomFilterArrayParameter):
757         (WebCore::StyleResolver::parseCustomFilterColorParameter):
758         (WebCore::StyleResolver::parseCustomFilterNumberParameter):
759         (WebCore::StyleResolver::parseCustomFilterParameter):
760         (WebCore::StyleResolver::parseCustomFilterParameterList):
761         (WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
762         (WebCore::StyleResolver::createFilterOperations):
763         * css/TransformFunctions.cpp:
764         (WebCore::transformsForValue):
765         * css/ViewportStyleResolver.cpp:
766         (WebCore::ViewportStyleResolver::getViewportArgumentValue):
767         * css/WebKitCSSMatrix.cpp:
768         (WebCore::WebKitCSSMatrix::setMatrixValue):
769         * editing/ApplyStyleCommand.cpp:
770         (WebCore::ApplyStyleCommand::computedFontSize):
771         * editing/EditingStyle.cpp:
772         (WebCore::identifierForStyleProperty):
773         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
774         (WebCore::cssValueToRGBA):
775         (WebCore::EditingStyle::extractFontSizeDelta):
776         (WebCore::EditingStyle::textDirection):
777         (WebCore::EditingStyle::prepareToApplyAt):
778         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
779         (WebCore::EditingStyle::legacyFontSize):
780         (WebCore::EditingStyle::textDirectionForSelection):
781         (WebCore::StyleChange::extractTextStyles):
782         (WebCore::fontWeightIsBold):
783         (WebCore::isTransparentColorValue):
784         * editing/markup.cpp:
785         (WebCore::propertyMissingOrEqualToNone):
786         * page/PageSerializer.cpp:
787         (WebCore::PageSerializer::retrieveResourcesForProperties):
788         * rendering/style/StylePendingImage.h:
789         (WebCore::StylePendingImage::data):
790         (WebCore::StylePendingImage::cssImageValue):
791         (WebCore::StylePendingImage::cssImageGeneratorValue):
792         (WebCore::StylePendingImage::cssCursorImageValue):
793         (WebCore::StylePendingImage::cssImageSetValue):
794
795 2013-09-22  Commit Queue  <commit-queue@webkit.org>
796
797         Unreviewed, rolling out r156257.
798         http://trac.webkit.org/changeset/156257
799         https://bugs.webkit.org/show_bug.cgi?id=121777
800
801         The test from this patch fails (Requested by ap on #webkit).
802
803         * rendering/RenderBox.cpp:
804         (WebCore::RenderBox::calculateAutoscrollDirection):
805
806 2013-09-22  Antonio Gomes  <a1.gomes@sisa.samsung.com>
807
808         iframe and scrollbar with "overflow:auto" should support autoscroll with mousedrag
809         https://bugs.webkit.org/show_bug.cgi?id=40981
810
811         Reviewed by Darin Adler.
812
813         RenderBox::calculateAutoscrollDirection does not properly translate
814         inner frames' coordinates in order to determine its auto-scrollability.
815         By coincidence, if the inner frame box it placed near to page's 0, 0 position
816         (upper left corner), it might work.
817
818         Patch fixes it by changing ::calculateAutoscrollDirection algorithm to operate
819         with window coordinates, taking inner frames offset and scroll position into account.
820         The behavior of auto-scrollable non-frame overflow boxes, including divs, still works
821         as it is used to.
822
823         Test: fast/events/drag-and-drop-autoscroll-inner-frame.html
824
825         * rendering/RenderBox.cpp:
826         (WebCore::RenderBox::calculateAutoscrollDirection):
827
828 2013-09-22  Sam Weinig  <sam@webkit.org>
829
830         CTTE: Use references more in ContainerNode, ContainerNodeAlgorithms and related classes
831         https://bugs.webkit.org/show_bug.cgi?id=121772
832
833         Reviewed by Andreas Kling.
834
835         Use references for never null Nodes in ContainerNode and related classes.
836
837 2013-09-22  Antti Koivisto  <antti@apple.com>
838
839         Fix functions calling to RenderObject superclass to call RenderElement instead
840         https://bugs.webkit.org/show_bug.cgi?id=121773
841
842         Reviewed by Andreas Kling.
843
844         The class hierarchy has a new class. Superclass calls should be pointed there instead to
845         avoid future bugs.
846
847         * rendering/RenderBoxModelObject.cpp:
848         (WebCore::RenderBoxModelObject::setSelectionState):
849         * rendering/RenderLayerModelObject.cpp:
850         (WebCore::RenderLayerModelObject::styleWillChange):
851         (WebCore::RenderLayerModelObject::styleDidChange):
852         * rendering/svg/RenderSVGGradientStop.cpp:
853         (WebCore::RenderSVGGradientStop::styleDidChange):
854         * rendering/svg/RenderSVGModelObject.cpp:
855         (WebCore::RenderSVGModelObject::styleWillChange):
856         (WebCore::RenderSVGModelObject::styleDidChange):
857
858 2013-09-22  Antti Koivisto  <antti@apple.com>
859
860         Remove RenderObjectChildList
861         https://bugs.webkit.org/show_bug.cgi?id=121771
862
863         Reviewed by Darin Adler.
864
865         Most RenderElement subclasses have m_children member (>90% of instances on typical page). It is not worth optimising
866         for memory for the few cases that don't (RenderImage, RenderLineBreak mostly) in expense of performance.
867         
868         This patch moves child handling to RenderElement. This gets rid of virtual children() calls and simplifies the code.
869
870 2013-09-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
871
872         Introduce CSS_VALUE_TYPE_CASTS macro in order to cast CSSValue type
873         https://bugs.webkit.org/show_bug.cgi?id=121462
874
875         Reviewed by Andreas Kling.
876
877         As r155429 introduced ELEMENT_TYPE_CASTS, CSS_VALUE_TYPE_CASTS can be used
878         by css value type casting as well. This type cast macros will help to detect
879         bad-cast bugs as well as improve a code readibility.
880
881         This patch adds the following methods,
882
883         - CSSFooValue* toCSSFooValue(CSSValue*)
884         - const CSSFooValue* toCSSFooValue(const CSSValue*)
885
886         To be consistent with other is*Value() naming style, isCSSLineBoxContainValue() and isCalculationValue()
887         are changed with isLineBoxContainValue() and isCalcValue().
888
889         FontValue, FontFeatureValue, ShadowValue have a manual type case function because of different
890         class naming style. So, toFontValue(), toFontFeatureValue() and toShadowValue() are added manually.
891
892         This patch removes unnecessary local variables.
893
894         No new tests, no behavior change.
895
896         * css/CSSAspectRatioValue.h:
897         * css/CSSBorderImageSliceValue.h:
898         * css/CSSCalculationValue.cpp:
899         (WebCore::CSSCalcExpressionNodeParser::parseValue):
900         * css/CSSCalculationValue.h:
901         * css/CSSCrossfadeValue.cpp:
902         (WebCore::subimageKnownToBeOpaque):
903         * css/CSSCrossfadeValue.h:
904         * css/CSSCursorImageValue.cpp:
905         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
906         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
907         (WebCore::CSSCursorImageValue::cachedImage):
908         (WebCore::CSSCursorImageValue::cachedOrPendingImage):
909         (WebCore::CSSCursorImageValue::isSVGCursor):
910         * css/CSSCursorImageValue.h:
911         * css/CSSFilterImageValue.h:
912         * css/CSSFontSelector.cpp:
913         (WebCore::CSSFontSelector::addFontFaceRule):
914         * css/CSSGradientValue.h:
915         * css/CSSImageGeneratorValue.cpp:
916         (WebCore::CSSImageGeneratorValue::image):
917         (WebCore::CSSImageGeneratorValue::fixedSize):
918         (WebCore::CSSImageGeneratorValue::loadSubimages):
919         (WebCore::CSSImageGeneratorValue::subimageIsPending):
920         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
921         * css/CSSImageGeneratorValue.h:
922         * css/CSSImageSetValue.cpp:
923         (WebCore::CSSImageSetValue::fillImageSet):
924         * css/CSSImageSetValue.h:
925         * css/CSSImageValue.h:
926         * css/CSSInheritedValue.h:
927         * css/CSSInitialValue.h:
928         * css/CSSLineBoxContainValue.h:
929         * css/CSSParser.cpp:
930         (WebCore::CSSParser::parseColor):
931         (WebCore::CSSParser::addProperty):
932         (WebCore::CSSParser::parse3ValuesFillPosition):
933         (WebCore::CSSParser::parseFillPosition):
934         (WebCore::CSSParser::parseFillRepeat):
935         (WebCore::CSSParser::parseDeprecatedRadialGradient):
936         (WebCore::CSSParser::parseRadialGradient):
937         * css/CSSPrimitiveValue.h:
938         * css/CSSReflectValue.h:
939         * css/CSSToStyleMap.cpp:
940         (WebCore::CSSToStyleMap::mapFillAttachment):
941         (WebCore::CSSToStyleMap::mapFillClip):
942         (WebCore::CSSToStyleMap::mapFillComposite):
943         (WebCore::CSSToStyleMap::mapFillBlendMode):
944         (WebCore::CSSToStyleMap::mapFillOrigin):
945         (WebCore::CSSToStyleMap::mapFillRepeatX):
946         (WebCore::CSSToStyleMap::mapFillRepeatY):
947         (WebCore::CSSToStyleMap::mapFillSize):
948         (WebCore::CSSToStyleMap::mapFillXPosition):
949         (WebCore::CSSToStyleMap::mapFillYPosition):
950         (WebCore::CSSToStyleMap::mapFillMaskSourceType):
951         (WebCore::CSSToStyleMap::mapAnimationDelay):
952         (WebCore::CSSToStyleMap::mapAnimationDirection):
953         (WebCore::CSSToStyleMap::mapAnimationDuration):
954         (WebCore::CSSToStyleMap::mapAnimationFillMode):
955         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
956         (WebCore::CSSToStyleMap::mapAnimationName):
957         (WebCore::CSSToStyleMap::mapAnimationPlayState):
958         (WebCore::CSSToStyleMap::mapAnimationProperty):
959         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
960         (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
961         (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
962         (WebCore::CSSToStyleMap::mapNinePieceImageRepeat):
963         * css/CSSValue.cpp:
964         (WebCore::CSSValue::destroy):
965         * css/CSSValue.h:
966         (WebCore::CSSValue::isLineBoxContainValue):
967         (WebCore::CSSValue::isCalcValue):
968         * css/CSSValueList.h:
969         * css/CSSVariableValue.h:
970         * css/DeprecatedStyleBuilder.cpp:
971         (WebCore::ApplyPropertyDefault::applyValue):
972         (WebCore::ApplyPropertyNumber::applyValue):
973         (WebCore::ApplyPropertyAuto::applyValue):
974         (WebCore::ApplyPropertyClip::applyValue):
975         (WebCore::ApplyPropertyColor::applyValue):
976         (WebCore::ApplyPropertyLength::applyValue):
977         (WebCore::ApplyPropertyString::applyValue):
978         (WebCore::ApplyPropertyBorderRadius::applyValue):
979         (WebCore::ApplyPropertyComputeLength::applyValue):
980         (WebCore::ApplyPropertyFont::applyValue):
981         (WebCore::ApplyPropertyFontFamily::applyValue):
982         (WebCore::ApplyPropertyFontSize::applyValue):
983         (WebCore::ApplyPropertyFontWeight::applyValue):
984         (WebCore::ApplyPropertyFontVariantLigatures::applyValue):
985         (WebCore::ApplyPropertyCounter::applyValue):
986         (WebCore::ApplyPropertyCursor::applyValue):
987         (WebCore::ApplyPropertyTextAlign::applyValue):
988         (WebCore::ApplyPropertyTextDecoration::applyValue):
989         (WebCore::ApplyPropertyMarqueeIncrement::applyValue):
990         (WebCore::ApplyPropertyMarqueeRepetition::applyValue):
991         (WebCore::ApplyPropertyMarqueeSpeed::applyValue):
992         (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
993         (WebCore::ApplyPropertyLineHeight::applyValue):
994         (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue):
995         (WebCore::ApplyPropertyPageSize::applyValue):
996         (WebCore::ApplyPropertyTextEmphasisStyle::applyValue):
997         (WebCore::ApplyPropertyResize::applyValue):
998         (WebCore::ApplyPropertyVerticalAlign::applyValue):
999         (WebCore::ApplyPropertyAspectRatio::applyValue):
1000         (WebCore::ApplyPropertyZoom::applyValue):
1001         (WebCore::ApplyPropertyDisplay::applyValue):
1002         (WebCore::ApplyPropertyClipPath::applyValue):
1003         (WebCore::ApplyPropertyShape::applyValue):
1004         (WebCore::ApplyPropertyImageResolution::applyValue):
1005         (WebCore::ApplyPropertyTextIndent::applyValue):
1006         * css/FontFeatureValue.h:
1007         (WebCore::toFontFeatureValue):
1008         * css/FontValue.h:
1009         (WebCore::toFontValue):
1010         * css/MediaList.cpp:
1011         (WebCore::reportMediaQueryWarningIfNeeded):
1012         * css/MediaQueryEvaluator.cpp:
1013         (WebCore::compareAspectRatioValue):
1014         (WebCore::numberValue):
1015         (WebCore::orientationMediaFeatureEval):
1016         (WebCore::evalResolution):
1017         (WebCore::device_pixel_ratioMediaFeatureEval):
1018         (WebCore::resolutionMediaFeatureEval):
1019         (WebCore::computeLength):
1020         (WebCore::view_modeMediaFeatureEval):
1021         (WebCore::pointerMediaFeatureEval):
1022         * css/SVGCSSStyleSelector.cpp:
1023         (WebCore::StyleResolver::applySVGProperty):
1024         * css/ShadowValue.h:
1025         (WebCore::toShadowValue):
1026         * css/StylePropertySet.cpp:
1027         (WebCore::StylePropertySet::getLayeredShorthandValue):
1028         * css/StyleResolver.cpp:
1029         (WebCore::createGridTrackSize):
1030         (WebCore::createGridTrackList):
1031         (WebCore::createGridPosition):
1032         (WebCore::hasVariableReference):
1033         (WebCore::StyleResolver::applyProperty):
1034         (WebCore::StyleResolver::styleImage):
1035         (WebCore::StyleResolver::generatedOrPendingFromValue):
1036         (WebCore::StyleResolver::styleShader):
1037         (WebCore::StyleResolver::parseCustomFilterArrayParameter):
1038         (WebCore::StyleResolver::parseCustomFilterColorParameter):
1039         (WebCore::StyleResolver::parseCustomFilterNumberParameter):
1040         (WebCore::StyleResolver::parseCustomFilterParameter):
1041         (WebCore::StyleResolver::parseCustomFilterParameterList):
1042         (WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
1043         (WebCore::StyleResolver::createFilterOperations):
1044         * css/TransformFunctions.cpp:
1045         (WebCore::transformsForValue):
1046         * css/ViewportStyleResolver.cpp:
1047         (WebCore::ViewportStyleResolver::getViewportArgumentValue):
1048         * css/WebKitCSSMatrix.cpp:
1049         (WebCore::WebKitCSSMatrix::setMatrixValue):
1050         * css/WebKitCSSShaderValue.h:
1051         (WebCore::toWebKitCSSShaderValue):
1052         * editing/ApplyStyleCommand.cpp:
1053         (WebCore::ApplyStyleCommand::computedFontSize):
1054         * editing/EditingStyle.cpp:
1055         (WebCore::identifierForStyleProperty):
1056         (WebCore::HTMLElementEquivalent::valueIsPresentInStyle):
1057         (WebCore::cssValueToRGBA):
1058         (WebCore::EditingStyle::extractFontSizeDelta):
1059         (WebCore::EditingStyle::textDirection):
1060         (WebCore::EditingStyle::prepareToApplyAt):
1061         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1062         (WebCore::EditingStyle::legacyFontSize):
1063         (WebCore::EditingStyle::textDirectionForSelection):
1064         (WebCore::StyleChange::extractTextStyles):
1065         (WebCore::fontWeightIsBold):
1066         (WebCore::isTransparentColorValue):
1067         * editing/markup.cpp:
1068         (WebCore::propertyMissingOrEqualToNone):
1069         * page/PageSerializer.cpp:
1070         (WebCore::PageSerializer::retrieveResourcesForProperties):
1071         * rendering/style/StylePendingImage.h:
1072         (WebCore::StylePendingImage::data):
1073         (WebCore::StylePendingImage::cssImageValue):
1074         (WebCore::StylePendingImage::cssImageGeneratorValue):
1075         (WebCore::StylePendingImage::cssCursorImageValue):
1076         (WebCore::StylePendingImage::cssImageSetValue):
1077
1078 2013-09-22  Arunprasad Rajkumar  <ararunprasad@gmail.com>
1079
1080         Hiding a focused element should unfocus it and fire a blur event
1081         https://bugs.webkit.org/show_bug.cgi?id=29241
1082
1083         Reviewed by Darin Adler.
1084
1085         Test: fast/dom/HTMLDocument/active-element-gets-unfocusable.html
1086
1087         We check whether the current focus element is really focusable after
1088         the style recalculation and layout change. If it is not focusable then schedule a
1089         timer to reset it asynchronously.
1090
1091         * dom/Document.cpp:
1092         (WebCore::Document::Document):
1093         (WebCore::Document::recalcStyle): Check isFocusable() on the focus element after
1094         style recalculation.
1095         (WebCore::Document::updateLayout): Check isFocusable() on the focus element after
1096         layout.
1097         (WebCore::Document::resetHiddenFocusElementSoon):
1098         (WebCore::Document::resetHiddenFocusElementTimer):
1099         * dom/Document.h:
1100
1101 2013-09-22  Sam Weinig  <sam@webkit.org>
1102
1103         CTTE: StaticNodeLists often contain only Elements, we shouldn't store them as Vector<RefPtr<Node>> in those cases
1104         https://bugs.webkit.org/show_bug.cgi?id=121769
1105
1106         Reviewed by Andreas Kling.
1107
1108         Introduces StaticElementList and uses it.
1109
1110         * accessibility/AccessibilityRenderObject.cpp:
1111         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
1112         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1113         (WebCore::getNamedItems):
1114         * bindings/js/JSHTMLCollectionCustom.cpp:
1115         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
1116         (WebCore::getNamedItems):
1117         * bindings/js/JSHTMLFormElementCustom.cpp:
1118         (WebCore::JSHTMLFormElement::nameGetter):
1119         * dom/SelectorQuery.cpp:
1120         (WebCore::AllElementExtractorSelectorQueryTrait::appendOutputForElement):
1121         (WebCore::SelectorDataList::queryAll):
1122         * dom/StaticNodeList.cpp:
1123         (WebCore::StaticElementList::length):
1124         (WebCore::StaticElementList::item):
1125         (WebCore::StaticElementList::namedItem):
1126         * dom/StaticNodeList.h:
1127         * dom/WebKitNamedFlow.cpp:
1128         (WebCore::WebKitNamedFlow::getRegionsByContent):
1129         (WebCore::WebKitNamedFlow::getRegions):
1130         (WebCore::WebKitNamedFlow::getContent):
1131         (WebCore::WebKitNamedFlow::dispatchRegionLayoutUpdateEvent):
1132         (WebCore::WebKitNamedFlow::dispatchRegionOversetChangeEvent):
1133         * html/HTMLCollection.cpp:
1134         (WebCore::HTMLCollection::namedItems):
1135         * html/HTMLCollection.h:
1136         * html/HTMLFormElement.cpp:
1137         (WebCore::HTMLFormElement::getNamedElements):
1138         * html/HTMLFormElement.h:
1139         * svg/SVGSVGElement.cpp:
1140         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1141
1142 2013-09-22  Sam Weinig  <sam@webkit.org>
1143
1144         CTTE: RenderNamedFlowThread and FlowThreadController should operate on Elements, not Nodes
1145         https://bugs.webkit.org/show_bug.cgi?id=121768
1146
1147         Reviewed by Andreas Kling.
1148
1149         * dom/Element.cpp:
1150         (WebCore::Element::unregisterNamedFlowContentElement):
1151         (WebCore::Element::shouldMoveToFlowThread):
1152         (WebCore::Element::clearStyleDerivedDataBeforeDetachingRenderer):
1153         * dom/Element.h:
1154         Update to new names and to pass this as a reference to the FlowThreadController.
1155
1156         * dom/Node.cpp:
1157         * dom/Node.h:
1158         Move isRegisteredWithNamedFlow() to Element.
1159
1160         * dom/WebKitNamedFlow.cpp:
1161         (WebCore::WebKitNamedFlow::getRegionsByContent):
1162         (WebCore::WebKitNamedFlow::getRegions):
1163         (WebCore::WebKitNamedFlow::getContent):
1164         Update for contentNodes() -> contentElements() name change. Modernize the code a bit
1165         as well.
1166
1167         * rendering/FlowThreadController.cpp:
1168         (WebCore::FlowThreadController::registerNamedFlowContentElement):
1169         (WebCore::FlowThreadController::unregisterNamedFlowContentElement):
1170         (WebCore::FlowThreadController::isContentElementRegisteredWithAnyNamedFlow):
1171         * rendering/FlowThreadController.h:
1172         Change the Node* -> RenderNamedFlowThread* map to a Element* -> RenderNamedFlowThread*. Update
1173         functions taking Node*s to take Element&s.
1174
1175         * rendering/RenderNamedFlowThread.cpp:
1176         (WebCore::RenderNamedFlowThread::~RenderNamedFlowThread):
1177         (WebCore::RenderNamedFlowThread::clearContentElements):
1178         (WebCore::RenderNamedFlowThread::registerNamedFlowContentElement):
1179         (WebCore::RenderNamedFlowThread::unregisterNamedFlowContentElement):
1180         (WebCore::RenderNamedFlowThread::hasContentElement):
1181         (WebCore::isContainedInElements):
1182         (WebCore::nextNodeInsideContentElement):
1183         (WebCore::RenderNamedFlowThread::getRanges):
1184         * rendering/RenderNamedFlowThread.h:
1185         Change the NamedFlowContent set to store Elements rather than Nodes. Like with FlowThreadController,
1186         update registration functions to take Element&s instead of Node*s, removing asserts.
1187         
1188         * rendering/RenderRegion.cpp:
1189         (WebCore::RenderRegion::setRegionObjectsRegionStyle):
1190         Update for new names.
1191
1192         * style/StyleResolveTree.cpp:
1193         (WebCore::Style::moveToFlowThreadIfNeeded):
1194         Pass the Element and RenderNamedFlowThread as references.
1195
1196 2013-09-22  Andreas Kling  <akling@apple.com>
1197
1198         Give purity hints to compiler to avoid penalizing repeated calls to some functions.
1199         <https://webkit.org/b/121744>
1200
1201         Reviewed by Darin Adler.
1202
1203         Mark the following functions pure:
1204
1205             - gcController()
1206             - cssValuePool()
1207             - threadGlobalData()
1208
1209         I had this idea when I saw Darin's patch to cache cssValuePool() in a local.
1210         We know that this function will always return the same value, so we should just
1211         share this knowledge with the compiler and let it do the cleverness instead.
1212
1213 2013-09-21  Darin Adler  <darin@apple.com>
1214
1215         Fix too-strict type error exceptions introduced in WebGL bindings
1216         https://bugs.webkit.org/show_bug.cgi?id=121759
1217
1218         Reviewed by Alexey Proskuryakov.
1219
1220         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1221         (WebCore::JSWebGLRenderingContext::getAttachedShaders): Allow undefined
1222         or null without throwing type error.
1223         (WebCore::JSWebGLRenderingContext::getProgramParameter): Ditto.
1224         (WebCore::JSWebGLRenderingContext::getUniform): Ditto.
1225         (WebCore::dataFunctionf): Ditto.
1226         (WebCore::dataFunctioni): Ditto.
1227         (WebCore::dataFunctionMatrix): Ditto.
1228
1229 2013-09-21  Sam Weinig  <sam@webkit.org>
1230
1231         Event and EventTarget interfaces don't need to be store as AtomicStrings
1232         https://bugs.webkit.org/show_bug.cgi?id=121751
1233
1234         Reviewed by Andreas Kling.
1235
1236         Convert the Event and EventTarget interface identifiers from AtomicStrings to enums. They
1237         are not extensible and not exposed as Strings anywhere.
1238
1239         * Files elided *
1240
1241 2013-09-21  Darin Adler  <darin@apple.com>
1242
1243         Add ExecState::uncheckedArgument and use where possible to shrink a bit
1244         https://bugs.webkit.org/show_bug.cgi?id=121750
1245
1246         Reviewed by Andreas Kling.
1247
1248         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1249         (WebCore::JSHTMLCanvasElement::probablySupportsContext): Already checked count.
1250         (WebCore::JSHTMLCanvasElement::toDataURL): Ditto.
1251         * bindings/js/JSHTMLDocumentCustom.cpp:
1252         (WebCore::documentWrite): In a loop.
1253         * bindings/js/JSInjectedScriptHostCustom.cpp:
1254         (WebCore::JSInjectedScriptHost::inspectedObject): Already checked count.
1255         (WebCore::JSInjectedScriptHost::internalConstructorName): Ditto.
1256         (WebCore::JSInjectedScriptHost::isHTMLAllCollection): Ditto.
1257         (WebCore::JSInjectedScriptHost::type): Ditto.
1258         (WebCore::JSInjectedScriptHost::functionDetails): Ditto.
1259         (WebCore::JSInjectedScriptHost::getEventListeners): Ditto.
1260         (WebCore::JSInjectedScriptHost::inspect): Ditto.
1261         (WebCore::JSInjectedScriptHost::databaseId): Ditto.
1262         (WebCore::JSInjectedScriptHost::storageId): Ditto.
1263         * bindings/js/JSSQLTransactionSyncCustom.cpp:
1264         (WebCore::JSSQLTransactionSync::executeSql): Ditto.
1265         * bindings/js/JSSVGLengthCustom.cpp:
1266         (WebCore::JSSVGLength::convertToSpecifiedUnits): Ditto.
1267         * bindings/js/JSSharedWorkerCustom.cpp:
1268         (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): Ditto.
1269
1270         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1271         (WebCore::getObjectParameter): Already checked count.
1272         (WebCore::JSWebGLRenderingContext::getAttachedShaders): Removed tortured code
1273         to triply do the checking that the toWebGLProgram function already does, including
1274         spurious exception checking in code that can't create an exception. Also count is
1275         already checked.
1276         (WebCore::JSWebGLRenderingContext::getExtension): More of the same.
1277         (WebCore::JSWebGLRenderingContext::getFramebufferAttachmentParameter): Ditto.
1278         (WebCore::JSWebGLRenderingContext::getParameter): Ditto.
1279         (WebCore::JSWebGLRenderingContext::getProgramParameter): Ditto.
1280         (WebCore::JSWebGLRenderingContext::getShaderParameter): Ditto.
1281         (WebCore::JSWebGLRenderingContext::getUniform): Ditto.
1282         (WebCore::dataFunctionf): Ditto.
1283         (WebCore::dataFunctioni): Ditto.
1284         (WebCore::dataFunctionMatrix): Ditto.
1285
1286         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1287         (WebCore::JSWorkerGlobalScope::importScripts): In a loop.
1288         * bindings/js/JSXMLHttpRequestCustom.cpp:
1289         (WebCore::JSXMLHttpRequest::open): Already checked. Also removed some unneeded
1290         argument count checks.
1291         (WebCore::JSXMLHttpRequest::send): Removed unneeded special case for 0 argument
1292         count that does the same thing as the undefined case, since asking for an
1293         argument past the count yields undefined.
1294
1295         * bindings/js/JSXSLTProcessorCustom.cpp:
1296         (WebCore::JSXSLTProcessor::setParameter): Already checked.
1297         (WebCore::JSXSLTProcessor::getParameter): Already checked.
1298         (WebCore::JSXSLTProcessor::removeParameter): Already checked.
1299
1300         * bindings/js/ScheduledAction.cpp:
1301         (WebCore::ScheduledAction::ScheduledAction): In a loop.
1302         * bindings/js/ScriptCallStackFactory.cpp:
1303         (WebCore::createScriptArguments): Ditto.
1304
1305         * bindings/scripts/CodeGeneratorJS.pm:
1306         (GenerateParametersCheck): Removed some excess argumentCount checks.
1307         Used uncheckedArgument in a few places. More needs to be done, especially for
1308         overloaded functions.
1309
1310         * bridge/c/c_instance.cpp:
1311         (JSC::Bindings::CInstance::invokeMethod): In a loop.
1312         (JSC::Bindings::CInstance::invokeDefaultMethod): Ditto.
1313         * bridge/objc/objc_instance.mm:
1314         (ObjcInstance::invokeObjcMethod): Ditto.
1315         (ObjcInstance::invokeDefaultMethod): Ditto.
1316
1317         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1318         * bindings/scripts/test/JS/JSTestObj.cpp:
1319         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1320         Updated.
1321
1322 2013-09-21  Jon Lee  <jonlee@apple.com>
1323
1324         Fix Obj-C bindings test expectations.
1325         Unreviewed.
1326
1327         Bindings tests failed with r156232, from https://bugs.webkit.org/show_bug.cgi?id=121745.
1328
1329         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1330         (-[DOMTestObj reflectedStringAttr]): Update test expectations.
1331
1332 2013-09-21  Andreas Kling  <akling@apple.com>
1333
1334         Node: FINAL-ize EventTarget overrides.
1335         <https://webkit.org/b/121748>
1336
1337         Reviewed by Darin Adler.
1338
1339         Mark the following Node functions FINAL:
1340
1341             - scriptExecutionContext()
1342             - eventTargetData()
1343             - ensureEventTargetData()
1344
1345         This devirtualizes a myriad of generated calls in the JSC bindings.
1346
1347 2013-09-21  Andreas Kling  <akling@apple.com>
1348
1349         Don't bloat Obj-C bindings with inlined attribute retrieval.
1350         <https://webkit.org/b/121745>
1351
1352         Reviewed by Anders Carlsson.
1353
1354         Hack bindings generator to always use getAttribute() for Objective-C.
1355         Reduces WebCore binary size by 25120 bytes.
1356
1357 2013-09-20  Darin Adler  <darin@apple.com>
1358
1359         Shink attribute event listener code
1360         https://bugs.webkit.org/show_bug.cgi?id=121735
1361
1362         Reviewed by Antti Koivisto.
1363
1364         * GNUmakefile.list.am: Eliminate ScriptEventListener source files.
1365         * Target.pri: Ditto.
1366         * UseJSC.cmake: Ditto.
1367         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1368         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1369         * WebCore.xcodeproj/project.pbxproj: Ditto.
1370         * bindings/js/JSBindingsAllInOne.cpp: Ditto.
1371
1372         * bindings/js/JSDOMGlobalObject.h: Removed unneeded forward declarations
1373         of JSEventListener and JSLazyEventListener.
1374
1375         * bindings/js/JSLazyEventListener.cpp:
1376         (WebCore::JSLazyEventListener::JSLazyEventListener): Changed type to
1377         ContainerNode because the node pointer is only ever used for elements
1378         and documents.
1379         (WebCore::eventParameterName): Moved this function here from
1380         ScriptEventListener.cpp, but also rewrote to use NeverDestroyed.
1381         (WebCore::JSLazyEventListener::createForNode): Moved this function
1382         here from ScriptEventListener.cpp, cleaned up a bit.
1383         (WebCore::JSLazyEventListener::createForDOMWindow): Ditto.
1384
1385         * bindings/js/JSLazyEventListener.h: Replaced the old create function
1386         with two new create functions we can use directly. Also used some
1387         OVERRIDE, some FINAL, and a bit of WTF_DELETED_FUNCTION so we don't
1388         accidentally call create and create a non-lazy listener.
1389
1390         * bindings/js/ScriptEventListener.cpp: Removed.
1391         * bindings/js/ScriptEventListener.h: Removed.
1392
1393         * dom/ContainerNode.cpp:
1394         (WebCore::ContainerNode::setAttributeEventListener): Added.
1395         Calls JSLazyEventListener::createForNode and then calls the other
1396         overload of setAttributeEventListener, to obviate having more code
1397         at the call site.
1398         * dom/ContainerNode.h: Added overload of setAttributeEventListener
1399         for convenient use in Document and Element implementations.
1400
1401         * dom/Document.cpp:
1402         (WebCore::Document::prepareForDestruction): Use m_domWindow instead
1403         of the domWindow() function.
1404         (WebCore::Document::removeAllEventListeners): Ditto.
1405         (WebCore::Document::errorEventTarget): Ditto.
1406         (WebCore::Document::takeDOMWindowFrom): Ditto.
1407         (WebCore::Document::setWindowAttributeEventListener): Ditto. Also
1408         added an overload that calls JSLazyEventListener::createForDOMWindow.
1409         (WebCore::Document::getWindowAttributeEventListener): Use m_domWindow.
1410         (WebCore::Document::dispatchWindowEvent): Ditto.
1411         (WebCore::Document::dispatchWindowLoadEvent): Ditto.
1412         (WebCore::Document::enqueueWindowEvent): Ditto.
1413         (WebCore::Document::enqueuePopstateEvent): Ditto.
1414         * dom/Document.h: Added overload of setWindowAttributeEventListener.
1415
1416         * html/HTMLBodyElement.cpp: Removed unnneded include.
1417         (WebCore::HTMLBodyElement::parseAttribute): Removed all the calls to
1418         createAttributeEventListener, and use the setAttributeEventListener
1419         overloads instead.
1420         * html/HTMLButtonElement.cpp: Ditto.
1421         * html/HTMLElement.cpp:
1422         (WebCore::HTMLElement::parseAttribute): Ditto.
1423         * html/HTMLFormControlElement.cpp: Ditto.
1424         * html/HTMLFormElement.cpp: Ditto.
1425         * html/HTMLFrameElementBase.cpp:
1426         (WebCore::HTMLFrameElementBase::parseAttribute): Ditto.
1427         * html/HTMLFrameSetElement.cpp:
1428         (WebCore::HTMLFrameSetElement::parseAttribute): Ditto.
1429         * html/HTMLImageElement.cpp:
1430         (WebCore::HTMLImageElement::parseAttribute): Ditto.
1431         * html/HTMLInputElement.cpp:
1432         (WebCore::HTMLInputElement::parseAttribute): Ditto.
1433         * html/HTMLLinkElement.cpp:
1434         (WebCore::HTMLLinkElement::parseAttribute): Ditto.
1435         * html/HTMLMediaElement.cpp:
1436         (WebCore::HTMLMediaElement::parseAttribute): Ditto.
1437         * html/HTMLObjectElement.cpp:
1438         (WebCore::HTMLObjectElement::parseAttribute): Ditto.
1439         * html/HTMLScriptElement.cpp:
1440         (WebCore::HTMLScriptElement::parseAttribute): Ditto.
1441         * html/HTMLSelectElement.cpp: Ditto.
1442         * html/HTMLStyleElement.cpp: Ditto.
1443         * html/HTMLTextFormControlElement.cpp: Ditto.
1444         * html/HTMLTrackElement.cpp: Ditto.
1445         * html/track/LoadableTextTrack.cpp: Ditto.
1446         * svg/SVGElement.cpp:
1447         (WebCore::SVGElement::parseAttribute): Ditto.
1448         * svg/SVGSVGElement.cpp:
1449         (WebCore::SVGSVGElement::parseAttribute): Ditto.
1450         * svg/SVGScriptElement.cpp:
1451         (WebCore::SVGScriptElement::parseAttribute): Ditto.
1452
1453         * inspector/InspectorDOMAgent.cpp:
1454         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1455         Moved the code here to dig inside a JSEventListener for things like
1456         the source location. This used to be spread across multiple function
1457         calls in ScriptEventListener.h, which were doing and redoing the same
1458         things, so better to just get it all at once.
1459
1460         * html/parser/XSSAuditor.cpp:
1461         (WebCore::XSSAuditor::init): Fixed "minium" typo.
1462
1463 2013-09-21  Anders Carlsson  <andersca@apple.com>
1464
1465         Don't store the "processing-instruction" string for PI tokens in the XPath parser
1466         https://bugs.webkit.org/show_bug.cgi?id=121746
1467
1468         Reviewed by Antti Koivisto.
1469
1470         For PI tokens, the string is always going to be "processing-instruction", and it's never used so we don't need to save it.
1471
1472         * xml/XPathGrammar.y:
1473         * xml/XPathParser.cpp:
1474         (Parser::nextTokenInternal):
1475         (Parser::lex):
1476
1477 2013-09-21  Patrick Gansterer  <paroga@webkit.org>
1478
1479         Handle windows lineendings in makeprop.pl after r155511
1480         https://bugs.webkit.org/show_bug.cgi?id=121740
1481
1482         Reviewed by Ryosuke Niwa.
1483
1484         Check for an optinal \r at the end of a line in regular expressions
1485         to make it work again on native windows machines which use CRLF.
1486
1487         * css/makeprop.pl:
1488
1489 2013-09-21  Andreas Kling  <akling@apple.com>
1490
1491         Re-inline some hot ElementData functions.
1492         <https://webkit.org/b/121743>
1493
1494         Reviewed by Antti Koivisto.
1495
1496         Make the following functions inline again:
1497
1498             - deref()
1499             - addAttribute()
1500             - removeAttribute()
1501             - attributeAt()
1502
1503         They were out-of-lined in r154249 and perf.webkit.org reports a 1.4%
1504         regression on the html5 spec for that revision. This'll hopefully steer
1505         the graph back in the right direction.
1506
1507 2013-09-21  Tim Horton  <timothy_horton@apple.com>
1508
1509         GeneratorGeneratedImage should be called GradientImage
1510         https://bugs.webkit.org/show_bug.cgi?id=121085
1511
1512         Reviewed by Simon Fraser.
1513
1514         No new tests, just a refactor.
1515
1516         r150053 removed the concept of a Generator, making GeneratorGeneratedImage
1517         take a Gradient. This leaves GeneratorGeneratedImage's name not making a
1518         whole lot of sense, so let's rename it to GradientImage.
1519
1520         * CMakeLists.txt:
1521         * GNUmakefile.list.am:
1522         * Target.pri:
1523         * WebCore.vcxproj/WebCore.vcxproj:
1524         * WebCore.vcxproj/WebCore.vcxproj.filters:
1525         * WebCore.xcodeproj/project.pbxproj:
1526         * css/CSSGradientValue.cpp:
1527         (WebCore::CSSGradientValue::image):
1528         * platform/graphics/BitmapImage.h:
1529         * platform/graphics/GradientImage.cpp: Renamed from Source/WebCore/platform/graphics/GeneratorGeneratedImage.cpp.
1530         (WebCore::GradientImage::draw):
1531         (WebCore::GradientImage::drawPattern):
1532         * platform/graphics/GradientImage.h: Renamed from Source/WebCore/platform/graphics/GeneratorGeneratedImage.h.
1533         * platform/graphics/Image.h:
1534         * platform/graphics/ImageBuffer.h:
1535         Rename.
1536
1537         * css/CSSImageGeneratorValue.cpp:
1538         (WebCore::CSSImageGeneratorValue::cachedImageForSize):
1539         (WebCore::CSSImageGeneratorValue::saveCachedImageForSize):
1540         (WebCore::CSSImageGeneratorValue::CachedGeneratedImage::CachedGeneratedImage):
1541         * css/CSSImageGeneratorValue.h:
1542         (WebCore::CSSImageGeneratorValue::CachedGeneratedImage::image):
1543         Drive-by, the CSSImageGeneratorValue generated image cache should be
1544         in terms of GeneratedImage, not a random subclass, regardless
1545         of the fact that it's only used for GradientImage as of yet.
1546
1547 2013-09-21  Darin Adler  <darin@apple.com>
1548
1549         Shrink valueForBasicShape by removing repeated calls to cssValuePool()
1550         https://bugs.webkit.org/show_bug.cgi?id=121736
1551
1552         Reviewed by Sam Weinig.
1553
1554         * css/BasicShapeFunctions.cpp:
1555         (WebCore::valueForBasicShape): Put the pool into a local variable and use that.
1556
1557 2013-09-20  Darin Adler  <darin@apple.com>
1558
1559         Another CSS parser leak fix
1560         https://bugs.webkit.org/show_bug.cgi?id=121730
1561
1562         Reviewed by Alexey Proskuryakov.
1563
1564         * css/CSSGrammar.y.in: Added a missing adoptPtr.
1565
1566 2013-09-20  Alexey Proskuryakov  <ap@apple.com>
1567
1568         Handle panning gestures messages properly on Windows
1569         https://bugs.webkit.org/show_bug.cgi?id=121711
1570
1571         Follow-up fix: five regression tests started to crash on Mac.
1572
1573         Reviewed by Anders Carlsson.
1574
1575         * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollByRecursively):
1576         Added null checks, not all callers are interested in scrolled view pointer.
1577
1578 2013-09-20  Ryosuke Niwa  <rniwa@webkit.org>
1579
1580         Bad cast from CSSInitialValue to CSSValueList
1581         https://bugs.webkit.org/show_bug.cgi?id=121729
1582
1583         Reviewed by Beth Dakin.
1584
1585         Merge https://chromium.googlesource.com/chromium/blink/+/fcfaa51f9207b32cffe751c1a1380a921e464cbb
1586
1587         The issue was that we would cast to CSSValueList without checking
1588         the type of the CSSValue. After this change, we use the ASSERT'ing
1589         cast and explicitly check the type of the CSSValue before the cast.
1590
1591         Test: fast/css/crash-inherit-value-font-family.html
1592
1593         * css/CSSParser.cpp:
1594         (WebCore::CSSParser::parseFontFaceValue):
1595
1596 2013-09-20  Zoltan Horvath  <zoltan@webkit.org>
1597
1598         Remove includes from LineWidth.h
1599         https://bugs.webkit.org/show_bug.cgi?id=121716
1600
1601         Reviewed by Darin Adler.
1602
1603         In r156197 I removed logicalLineHeight from LineWidth.h, so we don't need to include RenderBlock.h
1604         and RenderRubyRun.h anymore in LineWidth.h.
1605
1606         No new tests, no behavior change.
1607
1608         * rendering/LineWidth.cpp:
1609         * rendering/LineWidth.h:
1610
1611 2013-09-20  Roger Fong  <roger_fong@apple.com>
1612
1613         Handle panning gestures messages properly on Windows.
1614         https://bugs.webkit.org/show_bug.cgi?id=121711.
1615
1616         Reviewed by Brent Fulgham.
1617
1618         This is needed by the Windows port to keep track to determine whether or not
1619         we need to overpan.
1620
1621         No new functionality added.
1622
1623         * rendering/RenderLayer.cpp:
1624         (WebCore::RenderLayer::scrollByRecursively):
1625         * rendering/RenderLayer.h: 
1626         Added an argument to keep track of which scrollview was actually scrolled
1627
1628 2013-09-20  Alexandru Chiculita  <achicu@adobe.com>
1629
1630         Web Inspector: [CSS Regions] Display CSS Regions chain when highlighting a CSS Region node
1631         https://bugs.webkit.org/show_bug.cgi?id=121719
1632
1633         Reviewed by Joseph Pecoraro.
1634
1635         Test: inspector/elements/highlight-node-regions.html
1636
1637         When a CSS Region node is highlighted through the WebInspector, it will also lookup all the regions
1638         that are part of the same flow and inject enough information into InspectorOverlayPage.js to get the other
1639         CSS Regions highlighted as well. A chain will also link the regions and a number will display the ordering
1640         of the content.
1641
1642         * WebCore.exp.in:
1643         * inspector/InspectorController.cpp:
1644         (WebCore::InspectorController::buildObjectForHighlightedNode):
1645         * inspector/InspectorController.h:
1646         * inspector/InspectorOverlay.cpp:
1647         (WebCore::buildObjectForRegionHighlight):
1648         (WebCore::buildObjectForCSSRegionsHighlight):
1649         (WebCore::InspectorOverlay::buildObjectForHighlightedNode):
1650         (WebCore::InspectorOverlay::drawNodeHighlight): Separated the InspectorObject building part out of this function,
1651         so that we can call buildObjectForHighlightedNode from the Internals APIs for testing.
1652         * inspector/InspectorOverlay.h:
1653         * inspector/InspectorOverlayPage.js:
1654         (_drawRegionNumber):
1655         (_quadMidPoint):
1656         (_drawRegionLink):
1657         (_fixQuadScrollPosition):
1658         (_drawRegionsHighlight):
1659         (drawNodeHighlight):
1660         * testing/Internals.cpp: Exposed the generated InspectorObject to the layout test.
1661         (WebCore::Internals::inspectorHighlightObject):
1662         * testing/Internals.h:
1663         * testing/Internals.idl:
1664
1665 2013-09-20  Commit Queue  <commit-queue@webkit.org>
1666
1667         Unreviewed, rolling out r156185.
1668         http://trac.webkit.org/changeset/156185
1669         https://bugs.webkit.org/show_bug.cgi?id=121727
1670
1671         Caused a lot of crashes in tests (Requested by ap on #webkit).
1672
1673         * dom/Document.cpp:
1674         (WebCore::Document::Document):
1675         (WebCore::Document::recalcStyle):
1676         (WebCore::Document::updateLayout):
1677         * dom/Document.h:
1678
1679 2013-09-20  Dean Jackson  <dino@apple.com>
1680
1681         Shaders that fail to compile should be marked as such
1682         https://bugs.webkit.org/show_bug.cgi?id=121721
1683
1684         Reviewed by Simon Fraser.
1685
1686         1. Add a new logging channel for WebGL.
1687
1688         2. If a translated shader fails to compile (technically
1689         this should never happen), mark it as invalid.
1690
1691         Test: https://www.khronos.org/registry/webgl/sdk/tests/conformance/glsl/misc/shader-with-non-reserved-words.html
1692
1693         * platform/Logging.h: New WebGL channel.
1694         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1695         (WebCore::GraphicsContext3D::compileShader): Log the raw and translated
1696         input to glCompileShader, but mark the entry as invalid.
1697
1698 2013-09-20  Mario Sanchez Prada  <mario.prada@samsung.com>
1699
1700         [ATK] Do not expose aria-help in ATK based platforms
1701         https://bugs.webkit.org/show_bug.cgi?id=121675
1702
1703         Reviewed by Chris Fleizach.
1704
1705         Stop exposing the value for the 'aria-help' attribute as an
1706         AtkObject attribute, based in AccessibilityObject::helpText().
1707
1708         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1709         (webkitAccessibleGetAttributes): Remove the mapping.
1710
1711 2013-09-20  Simon Fraser  <simon.fraser@apple.com>
1712
1713         Scrollbars don't appear on long pages after r155660
1714         https://bugs.webkit.org/show_bug.cgi?id=121714
1715         <rdar://problem/15042478>
1716
1717         Reviewed by Beth Dakin.
1718         
1719         After r155660, we don't do any additional layouts when scrollbars are 
1720         added or removed. That caused us to not enter the code that creates or
1721         destroys composting layers for scrollbars in RenderLayerCompositor, resulting
1722         in missing scrollbars.
1723         
1724         Fix by having ScrollView::updateScrollbars() call addedOrRemovedScrollbar()
1725         when a scrollbar was added or removed, which is overridden in FrameView
1726         to call through to RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars().
1727
1728         Not testable since scrollbar layers aren't contained in layer tree dumps
1729         (to reduce diffs between platforms).
1730
1731         * page/FrameView.cpp:
1732         (WebCore::FrameView::addedOrRemovedScrollbar): New function to tell the compositor
1733         that scrollbars changed.
1734         * page/FrameView.h:
1735         * platform/ScrollView.cpp:
1736         (WebCore::ScrollView::setHasHorizontalScrollbar): Change the meaning of the return
1737         value to say if the scrollbar was added or removed. Add an out param that indicates
1738         whether the scrollbar change affects content size (not true for overlay scrollbars).
1739         (WebCore::ScrollView::setHasVerticalScrollbar): Ditto.
1740         (WebCore::ScrollView::updateScrollbars): Keep track of whether scrollbars were
1741         added or removed, and call addedOrRemovedScrollbar() if true.
1742         * platform/ScrollView.h:
1743         * rendering/RenderLayerCompositor.cpp:
1744         (WebCore::RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars): Call updateOverflowControlsLayers().
1745         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1746         * rendering/RenderLayerCompositor.h:
1747
1748 2013-09-20  Simon Fraser  <simon.fraser@apple.com>
1749
1750         Ensure that TileController tile coverage is updated on scrolling even when we don't have scrollbars
1751         https://bugs.webkit.org/show_bug.cgi?id=121700
1752         <rdar://problem/15030589>
1753
1754         Reviewed by Dean Jackson.
1755
1756         r155660 introduced a bug where we wouldn't make scrollbars on long pages. However,
1757         that revealed a fundamental flaw in the TiledBacking update logic; it relied on the
1758         GraphicsLayer flushes triggered by scrollbars updates in order to update the main
1759         TileController's tile coverage. No scrollbars meant no tile coverage updates.
1760         
1761         Fix by explicitly triggering a flush when the FrameView is scrolled (we get
1762         notified about this on the main thread after the scrolling thread has moved
1763         layers around).
1764         
1765         No test since this will only be exposed for a short time while scrollbars are
1766         broken.
1767
1768         * rendering/RenderLayerCompositor.cpp:
1769         (WebCore::RenderLayerCompositor::frameViewDidScroll):
1770
1771 2013-09-20  Zoltan Horvath  <zoltan@webkit.org>
1772
1773         Refactoring LineBreaker and RenderTextInfo out of RenderBlock.h
1774         https://bugs.webkit.org/show_bug.cgi?id=121707
1775
1776         Reviewed by David Hyatt.
1777
1778         LineBreaker and RenderTextInfo are defined in RenderBlock.h, but only used in RenderBlockLineLayout.cpp.
1779         Moving them there (LineBreaker needs to be a friend class of RenderBlock) in the first step in the process
1780         of refactoring LineBreaker::NextSegmentBreak into more manageable chunks.
1781
1782         This change was reviewed and landed in Blink:
1783         https://src.chromium.org/viewvc/blink?revision=157402&view=revision
1784
1785         No new tests.
1786
1787         * rendering/RenderBlock.h:
1788         * rendering/RenderBlockLineLayout.cpp:
1789         (WebCore::LineBreaker::LineBreaker):
1790         (WebCore::LineBreaker::lineWasHyphenated):
1791         (WebCore::LineBreaker::positionedObjects):
1792         (WebCore::LineBreaker::clear):
1793         (WebCore::RenderTextInfo::RenderTextInfo):
1794         (WebCore::RenderTextInfo::~RenderTextInfo):
1795         (WebCore::LineBreaker::skipTrailingWhitespace):
1796         (WebCore::LineBreaker::skipLeadingWhitespace):
1797         (WebCore::LineBreaker::reset):
1798         (WebCore::LineBreaker::nextLineBreak):
1799         (WebCore::LineBreaker::nextSegmentBreak):
1800
1801 2013-09-20  Zoltan Horvath  <zoltan@webkit.org>
1802
1803         Move logicalHeightForLine out of LineWidth.h
1804         https://bugs.webkit.org/show_bug.cgi?id=121575
1805
1806         Reviewed by David Hyatt.
1807
1808         In bug #121107 (r155565), I moved logicalHeightForLine into LineWidth.h as part of LineWidth
1809         refactoring. LogicalHeightForLine without passing the second parameter uses RenderBlock::lineHeight
1810         anyway, except it doesn't take -line-box-contain CSS property into account. For Shapes we don't
1811         have implementation for variable-height lines (https://bugs.webkit.org/show_bug.cgi?id=95361) yet, so
1812         so I modified the affected functions to call lineHeight directly. I renamed logicalHeightForLine
1813         to minLineHeightForReplacedRenderer, and I made the second parameter a mandatory for that function.
1814
1815         No new tests, no behavior change.
1816
1817         * rendering/LineWidth.cpp:
1818         (WebCore::LineWidth::updateAvailableWidth):
1819         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
1820         * rendering/LineWidth.h:
1821         * rendering/RenderBlock.cpp: Move the definition here.
1822         (WebCore::RenderBlock::minLineHeightForReplacedRenderer):
1823         * rendering/RenderBlock.h: Move the function here and rename it.
1824         * rendering/RenderBlockLineLayout.cpp:
1825         (WebCore::RenderBlock::layoutShapeInsideInfo):
1826         (WebCore::updateLogicalInlinePositions):
1827         (WebCore::updateSegmentsForShapes):
1828
1829 2013-09-20  Alexey Proskuryakov  <ap@apple.com>
1830
1831         -[WebHTMLConveter _getFloat:forNode:property:] leaks
1832         https://bugs.webkit.org/show_bug.cgi?id=121709
1833
1834         Reviewed by Enrica Casucci.
1835
1836         * platform/mac/HTMLConverter.mm:
1837         (-[WebHTMLConverter _getFloat:forNode:property:]): Don't leak.
1838
1839 2013-09-20  Yongjun Zhang  <yongjun_zhang@apple.com>
1840
1841         Add an argument to ImageSource::createFrameAtIndex to hint a decoder that we expect a scaled image.
1842         https://bugs.webkit.org/show_bug.cgi?id=121696
1843
1844         Reviewed by Antti Koivisto.
1845
1846         Add an argument to ImageSource::createFrameAtIndex.  A platform image decoder can decide the optimal
1847         scale based on the hint and pass the real scale it used for decoding.
1848
1849         No new tests, no behavior change.
1850
1851         * platform/graphics/ImageSource.cpp:
1852         (WebCore::ImageSource::createFrameAtIndex):
1853         * platform/graphics/ImageSource.h:
1854         * platform/graphics/cg/ImageSourceCG.cpp:
1855         (WebCore::ImageSource::createFrameAtIndex):
1856
1857 2013-09-20  Andreas Kling  <akling@apple.com>
1858
1859         Make JSMainThreadNullState noncopyable.
1860
1861         Blindly rubber-stamped by Antti Koivisto.
1862
1863         * bindings/js/JSMainThreadExecState.h:
1864
1865 2013-09-20  Dan Bernstein  <mitz@apple.com>
1866
1867         Make extract-localizable-strings available to WebCore clients
1868         https://bugs.webkit.org/show_bug.cgi?id=121699
1869
1870         Reviewed by Darin Adler.
1871
1872         * WebCore.xcodeproj/project.pbxproj: Added a Scripts group with a reference to
1873         extract-localizable-strings.pl. Added a Copy Scripts build phase to the WebCore target that
1874         copies the script into PrivateHeaders/Scripts in the framework.
1875         * extract-localizable-strings.pl: Copied from Tools/Scripts/extract-localizable-strings.
1876
1877 2013-09-20  Antti Koivisto  <antti@apple.com>
1878
1879         Move layer hierarchy functions from RenderObject to RenderElement
1880         https://bugs.webkit.org/show_bug.cgi?id=121692
1881
1882         Reviewed by Andreas Kling.
1883
1884         * rendering/RenderElement.cpp:
1885         (WebCore::RenderElement::addLayers):
1886         (WebCore::RenderElement::removeLayers):
1887         (WebCore::RenderElement::moveLayers):
1888         (WebCore::RenderElement::findNextLayer):
1889         (WebCore::RenderElement::layerCreationAllowedForSubtree):
1890         
1891             Move these from RenderObject.
1892
1893         (WebCore::RenderElement::insertedIntoTree):
1894         (WebCore::RenderElement::willBeRemovedFromTree):
1895         
1896             Factor the layer related portion of these virtuals here.
1897
1898 2013-09-20  Benjamin Poulain  <benjamin@webkit.org>
1899
1900         Start cleaning the API of SelectorChecker
1901         https://bugs.webkit.org/show_bug.cgi?id=121654
1902
1903         Reviewed by Antti Koivisto.
1904
1905         Make the matching mode internal.
1906         Remove unused accessors.
1907         Make isFrameFocused() internal.
1908
1909         * css/ElementRuleCollector.cpp:
1910         (WebCore::ElementRuleCollector::ruleMatches):
1911         * css/SelectorChecker.cpp:
1912         (WebCore::SelectorChecker::matchRecursively):
1913         (WebCore::SelectorChecker::checkOne):
1914         (WebCore::isFrameFocused):
1915         * css/SelectorChecker.h:
1916         (WebCore::SelectorChecker::match):
1917         * css/StyleResolver.h:
1918         (WebCore::checkRegionSelector):
1919         * dom/SelectorQuery.cpp:
1920         (WebCore::SelectorDataList::selectorMatches):
1921
1922 2013-09-20  Benjamin Poulain  <benjamin@webkit.org>
1923
1924         Remove SelectorChecker's CrossesBoundary boundary mode
1925         https://bugs.webkit.org/show_bug.cgi?id=121653
1926
1927         Reviewed by Antti Koivisto.
1928
1929         This mode is an ancient vestige of shadow dom.
1930
1931         * css/SelectorChecker.cpp:
1932         (WebCore::SelectorChecker::match):
1933         (WebCore::SelectorChecker::checkOne):
1934         * css/SelectorChecker.h:
1935
1936 2013-09-20  Benjamin Poulain  <benjamin@webkit.org>
1937
1938         Move the SharingRules mode outside of SelectorChecker
1939         https://bugs.webkit.org/show_bug.cgi?id=121652
1940
1941         Reviewed by Antti Koivisto.
1942
1943         The SharingRules handling inside SelectorChecker is a weird hack
1944         to hit a specific branch of ElementRuleCollector.
1945
1946         This patch moves the exception to ElementRuleCollector, where it is easier
1947         to understand what it is for.
1948
1949         * css/ElementRuleCollector.cpp:
1950         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList):
1951         * css/SelectorChecker.cpp:
1952         (WebCore::SelectorChecker::match):
1953
1954 2013-09-20  Yoav Weiss  <yoav@yoav.ws>
1955
1956         Fixed img src URLS with multiple spaces
1957         https://bugs.webkit.org/show_bug.cgi?id=121592
1958
1959         Reviewed by Darin Adler.
1960
1961         Test: fast/loader/image-src-multiple-space.html
1962
1963         I've removed the simplifyWhiteSpace step from HTMLImageElement's src attribute during the srcset selection algorithm.
1964         That step prevented URLs with multiple spaces from being loaded as images, minimizing the multiple spaces into a single one.
1965
1966         * html/parser/HTMLParserIdioms.cpp:
1967         (WebCore::bestFitSourceForImageAttributes):
1968
1969 2013-09-20  Arunprasad Rajkumar  <ararunprasad@gmail.com>
1970
1971         Hiding a focused element should unfocus it and fire a blur event
1972         https://bugs.webkit.org/show_bug.cgi?id=29241
1973
1974         Reviewed by Darin Adler.
1975
1976         Test: fast/dom/HTMLDocument/active-element-gets-unfocusable.html
1977
1978         We check whether the current focus element is really focusable after
1979         the style recalculation and layout change. If it is not focusable then schedule a
1980         timer to reset it asynchronously.
1981
1982         * dom/Document.cpp:
1983         (WebCore::Document::Document):
1984         (WebCore::Document::recalcStyle): Check isFocusable() on the focus element after
1985         style recalculation.
1986         (WebCore::Document::updateLayout): Check isFocusable() on the focus element after
1987         layout.
1988         (WebCore::Document::resetHiddenFocusElementSoon):
1989         (WebCore::Document::resetHiddenFocusElementTimer):
1990         * dom/Document.h:
1991
1992 2013-09-20  Alexey Proskuryakov  <ap@apple.com>
1993
1994         REGRESSION (r156140): Srcset tests are frequently crashing
1995         https://bugs.webkit.org/show_bug.cgi?id=121695
1996
1997         Reviewed by Dean Jackson.
1998
1999         Returning a string created without copying bytes is not safe. It used to be OK
2000         because a new string was immediately created by decodeURLEscapeSequences().
2001         But even that was not great, because decodeURLEscapeSequences() could potentially
2002         return the same string, not a deep copy, if we decided to optimize it like that.
2003
2004         Also made a number of drive-by style fixes.
2005         - It's URL, not Url.
2006         - It's srcset, not srcSet.
2007         -  We don't add ".0" in floating point value initializers. It's particularly misleading
2008         to initialize a float with 1.0, which is a double value.
2009         - Renamed srcSetLength to srcsetAttributeLength to match srcsetAttribute variable
2010         whose length it caches.
2011
2012         * html/parser/HTMLParserIdioms.cpp:
2013         (WebCore::parseImagesWithScaleFromSrcsetAttribute):
2014         (WebCore::bestFitSourceForImageAttributes):
2015
2016 2013-09-19  Martin Robinson  <mrobinson@igalia.com>
2017
2018         [GTK] Clean up the Skip* functions in the GObject DOM bindings code generator
2019         https://bugs.webkit.org/show_bug.cgi?id=121633
2020
2021         Reviewed by Gustavo Noronha Silva.
2022
2023         * bindings/scripts/CodeGeneratorGObject.pm:
2024         (SkipAttribute): Fold in some skipping checks that are used by all callers.
2025         (SkipFunction): Ditto.
2026         (GenerateProperties): Rely on SkipAttribute more thoroughly.
2027         (GenerateFunction): Rely on SkipFunction more thoroughly.
2028         (GenerateFunctions): Rely on SkipAttribute more thoroughly.
2029
2030 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
2031
2032         Fix the build after r156144
2033
2034         * html/canvas/CanvasRenderingContext2D.cpp: Added missing include.
2035
2036 2013-09-20  Ryosuke Niwa  <rniwa@webkit.org>
2037
2038         renderStyleOfEnclosingTextNode should update style before using a renderer
2039         https://bugs.webkit.org/show_bug.cgi?id=121690
2040
2041         Reviewed by Enrica Casucci.
2042
2043         Merge https://chromium.googlesource.com/chromium/blink/+/65f089545e8c18cb268dfcbe56cba1cd8045527a
2044
2045         When accessing a renderer editing should always make sure that the style has been updated for the node.
2046         Editing calls splitTextNode in a number of places and then accesses the renderer later. This patch is
2047         the first of many to make sure editing always updates the style before attempting to access the renderer
2048         (or style) of a node after calling a mutation method.
2049
2050         * editing/ApplyBlockElementCommand.cpp:
2051         (WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode):
2052         * editing/ApplyBlockElementCommand.h:
2053
2054 2013-09-20  Darin Adler  <darin@apple.com>
2055
2056         Fix a couple more CSS leaks
2057         https://bugs.webkit.org/show_bug.cgi?id=121683
2058
2059         Reviewed by Alexey Proskuryakov.
2060
2061         * css/CSSDefaultStyleSheets.cpp:
2062         (WebCore::CSSDefaultStyleSheets::viewSourceStyle): Put the result of the
2063         parseUASheet into a global variable so it doesn't show up as a storage leak.
2064
2065         * css/CSSGrammar.y.in: Added a missing adoptRef. This was leaking any rule
2066         we parsed individually.
2067
2068 2013-09-20  Bem Jones-Bey  <bjonesbe@adobe.com>
2069
2070         Simplify the ShapeOutsideInfo and ShapeInfo interfaces
2071         https://bugs.webkit.org/show_bug.cgi?id=121685
2072
2073         Reviewed by Darin Adler.
2074
2075         With the creation ShapeInfo::computeSegmentsForLine, it became possible to
2076         simplify the ShapeInfo classes. ShapeOutsideInfo has no need to save the
2077         segments, and now that segment creation is in its own method, it doesn't have
2078         to save the segments anymore. This also simplifies the public interface of
2079         ShapeOutsideInfo, as it only has one method to do the computation.
2080
2081         Also, the methods in ShapeOutsideInfo have been renamed to reflect the fact
2082         that ShapeOutsideInfo isn't really interested in segments.
2083
2084         No new tests, no new behavior.
2085
2086         * rendering/FloatingObjects.cpp:
2087         (WebCore::FloatingObjects::logicalLeftOffset):
2088         (WebCore::FloatingObjects::logicalRightOffset):
2089         * rendering/LineWidth.cpp:
2090         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
2091         * rendering/shapes/ShapeInfo.cpp:
2092         * rendering/shapes/ShapeInfo.h:
2093         * rendering/shapes/ShapeInsideInfo.h:
2094         * rendering/shapes/ShapeOutsideInfo.cpp:
2095         (WebCore::ShapeOutsideInfo::updateDeltasForContainingBlockLine):
2096         * rendering/shapes/ShapeOutsideInfo.h:
2097
2098 2013-09-20  Antonio Gomes  <a1.gomes@sisa.samsung.com>
2099
2100         Making tests added in r156157 JS-only, given that other
2101         code generators are still broken.
2102
2103         Original bug 121305 (StrictTypeChecking extended attribute fails for methods with sequence<T>).
2104         https://bugs.webkit.org/show_bug.cgi?id=121305
2105
2106         Rubber stamped by Alexey Proskuryakov.
2107
2108         * bindings/scripts/test/TestObj.idl:
2109
2110 2013-09-20  Jacky Jiang  <zhajiang@blackberry.com>
2111
2112         [BlackBerry] Poor rendering opening a Google map short link
2113         https://bugs.webkit.org/show_bug.cgi?id=121687
2114
2115         Reviewed by Yong Li.
2116         Internally reviewed by Arvid Nilsson.
2117
2118         JIRA 495023
2119         Route lines on google map were shown even they were on a hidden canvas.
2120         Include visibility on LayerWebKitThread if it's a canvas layer and respect
2121         the visibility when compositing layers in LayerRenderer.
2122
2123         * platform/graphics/blackberry/LayerData.h:
2124         (WebCore::LayerData::isCanvasLayer):
2125         (WebCore::LayerData::isVisible):
2126         (WebCore::LayerData::includeVisibility):
2127         * platform/graphics/blackberry/LayerRenderer.cpp:
2128         (WebCore::LayerRenderer::compositeLayersRecursive):
2129
2130 2013-09-20  Sam White  <samuel_white@apple.com>
2131
2132         AX: WebArea claims to have a subrole, but always returns nil.
2133         https://bugs.webkit.org/show_bug.cgi?id=121658
2134
2135         Reviewed by Chris Fleizach.
2136
2137         No new tests, updated existing AXWebArea related test to reflect unused attribute removal.
2138
2139         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2140         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
2141
2142 2013-09-20  Andreas Kling  <akling@apple.com>
2143
2144         Add valueForLength/minimumValueForLength wrappers to RenderElement.
2145         <https://webkit.org/b/121676>
2146
2147         Reviewed by Antti Koivisto.
2148
2149         Add two inline wrappers for these functions so we don't have to pass
2150         the RenderView everywhere.
2151
2152 2013-09-20  Martin Robinson  <mrobinson@igalia.com>
2153
2154         [GTK] Fix some small style issues in the bindings
2155         https://bugs.webkit.org/show_bug.cgi?id=121613
2156
2157         Reviewed by Carlos Garcia Campos.
2158
2159         * bindings/scripts/CodeGeneratorGObject.pm: When printing the license
2160         header use the more common comment style within the WebKit project.
2161         (GenerateProperty): Indent property definitions according to WebKit style, improve
2162         the nick and blurb properties, and improve the various parameter spec argument layout.
2163         (GenerateFunction): Remove the newline from function signatures to match WebKit style.
2164         * bindings/scripts/test/GObject: Update bindings test results.
2165
2166 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
2167
2168         [CMake] Use COMPILE_DEFINITIONS target property for setting BUILDING_* defines
2169         https://bugs.webkit.org/show_bug.cgi?id=121672
2170
2171         Reviewed by Gyuyoung Kim.
2172
2173         Since the scope of add_definitions() is always a whole file, we need to use
2174         target properties instead to set definitions only for specific targets.
2175
2176         * CMakeLists.txt:
2177
2178 2013-09-18  Antonio Gomes  <a1.gomes@sisa.samsung.com>
2179
2180         Make "autoscroll for drag'n drop" a setting
2181         https://bugs.webkit.org/show_bug.cgi?id=121559
2182
2183         Reviewed by Ryosuke Niwa.
2184
2185         Currently, there is a ChromeClient hook to make the
2186         feature opt'ed-in or out. That makes it harder to test the
2187         feature on ports that do not enable it, e.g. Mac/WebKit2 port.
2188         However, Mac/WebKit2 is the port that has the best drag'n drop
2189         WTR implementation.
2190
2191         Patch changes the toggle on/off mechanism to be a setting,
2192         and exposes it through InternalSetting interface for testing.
2193
2194         * page/AutoscrollController.cpp:
2195         (WebCore::AutoscrollController::updateDragAndDrop):
2196         * page/ChromeClient.h:
2197         * page/Settings.in:
2198         * testing/InternalSettings.cpp:
2199         (WebCore::InternalSettings::Backup::Backup):
2200         (WebCore::InternalSettings::Backup::restoreTo):
2201         (WebCore::InternalSettings::setAutoscrollForDragAndDropEnabled):
2202         * testing/InternalSettings.h:
2203         * testing/InternalSettings.idl:
2204
2205 2013-09-16  Antonio Gomes  <a1.gomes@sisa.samsung.com>
2206
2207         StrictTypeChecking extended attribute fails for methods with sequence<T>
2208         https://bugs.webkit.org/show_bug.cgi?id=121305
2209
2210         Reviewed by Darin Adler.
2211
2212         The extended attribute StrictTypeChecking can not be set to methods if
2213         one of the parameters is a "sequence".
2214         Basically, since "sequence" is not considered a native type
2215         (see function IsNativeType) the Perl code generator tries to
2216         include its supposedly associated header, in this case "JSsequence.h"
2217         Compilation then fails.
2218
2219         It is a problem for bindings including WebGL, where all methods
2220         are supposed to be set as StrictTypeChecking (see bug 44202 [1]). Due to this restriction,
2221         it relaxed, but I would like to bring it back.
2222
2223         Patch fixes the issue by hardening the way includes are auto-added
2224         for methods where StrictTypeChecking extended attribute is present.
2225         Now, only wrapper types (see IsWrapperType) trigger header inclusion,
2226         excluding arrays, sequences, basic types, etc.
2227
2228         [1] https://bugs.webkit.org/show_bug.cgi?id=44202
2229
2230         * bindings/scripts/CodeGeneratorJS.pm:
2231         (GenerateParametersCheck):
2232         * bindings/scripts/test/JS/JSTestObj.cpp:
2233         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
2234         * bindings/scripts/test/JS/JSTestObj.h:
2235         * bindings/scripts/test/TestObj.idl:
2236
2237 2013-09-20  Andreas Kling  <akling@apple.com>
2238
2239         Optimize fetching the Node for never-anonymous renderers.
2240         <https://webkit.org/b/121627>
2241
2242         Reviewed by Antti Koivisto.
2243
2244         Add a RenderObject::nodeForNonAnonymous() that can be used instead
2245         of node() when a renderer is guaranteed non-anonymous.
2246
2247         Use this to implement reference element getters for the various
2248         renderers that are known at compile-time to correspond to a DOM node.
2249
2250         Also renamed existingElement() => element() since using an alternate
2251         name for a reference overload isn't actually necessary.
2252
2253 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
2254
2255         Remove duplicated secondsPerDay variables
2256         https://bugs.webkit.org/show_bug.cgi?id=121601
2257
2258         Reviewed by Andreas Kling.
2259
2260         Use secondsPerDay from DateMath.h instead of defining it again.
2261
2262         * history/HistoryItem.cpp:
2263         (WebCore::timeToDay):
2264
2265 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
2266
2267         Fix duplicated loop variable names after r155743
2268         https://bugs.webkit.org/show_bug.cgi?id=121667
2269
2270         Reviewed by Andreas Kling.
2271
2272         Do not use the same name for variables in nested loops to fix a compiler warning.
2273
2274         * page/animation/CSSPropertyAnimation.cpp:
2275         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2276
2277 2013-09-20  Antti Koivisto  <antti@apple.com>
2278
2279         Make RenderObject::parent() return RenderElement
2280         https://bugs.webkit.org/show_bug.cgi?id=121671
2281
2282         Reviewed by Andreas Kling.
2283
2284         Make RenderObject::parent() return RenderElement and adopt everywhere.
2285         Moved addChild/removeChild from RenderObject to RenderElement.
2286         Uninlined a few big RenderObject functions.
2287         Renamed RenderObject::remove() -> RenderObject::removeFromParent()
2288
2289 2013-09-20  Csaba Osztrogon√°c  <ossy@webkit.org>
2290
2291         Buildfix after r156133 for !ENABLE(WORKERS) platforms
2292         https://bugs.webkit.org/show_bug.cgi?id=121669
2293
2294         Reviewed by Antti Koivisto.
2295
2296         * platform/ThreadGlobalData.cpp:
2297         * platform/ThreadGlobalData.h:
2298
2299 2013-09-20  Antti Koivisto  <antti@apple.com>
2300
2301         Make createRenderer() return RenderElement
2302         https://bugs.webkit.org/show_bug.cgi?id=121666
2303
2304         Rubber-stamped by Andreas Kling.
2305         
2306         Tighter typing.
2307
2308 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
2309
2310         Buildfix for ENABLE(CSS_FILTERS) && !ENABLE(ACCELERATED_COMPOSITING) after r155131.
2311
2312         * rendering/RenderLayer.cpp:
2313         (WebCore::RenderLayer::enclosingFilterRepaintLayer):
2314
2315 2013-09-20  Patrick Gansterer  <paroga@webkit.org>
2316
2317         [WIN] Fix build without precompiled header after r154146.
2318
2319         * platform/win/WebCoreBundleWin.cpp:
2320
2321 2013-09-20  Antti Koivisto  <antti@apple.com>
2322
2323         Add covariant RenderElement* Element::renderer()
2324         https://bugs.webkit.org/show_bug.cgi?id=121638
2325
2326         Reviewed by Andreas Kling.
2327
2328         Also add isRenderElement() test and casting functions.
2329
2330 2013-09-19  Anders Carlsson  <andersca@apple.com>
2331
2332         Handle null font families.
2333
2334         Reviewed by Darin Adler.
2335
2336         * platform/graphics/Font.cpp:
2337         (WebCore::computeFontGlyphsCacheHash):
2338         Don't crash when trying to hash null strings.
2339
2340 2013-09-19  Darin Adler  <darin@apple.com>
2341
2342         Fix a couple mistakes in my recent CSS grammar leak patch
2343         https://bugs.webkit.org/show_bug.cgi?id=121659
2344
2345         Reviewed by Alexey Proskuryakov.
2346
2347         * css/CSSGrammar.y.in: Added initialization to nullptr for some error cases
2348         that were otherwise leaving a bad value for the result of the production.
2349         Also fixed a reversed logical expression.
2350
2351 2013-09-19  Yoav Weiss  <yoav@yoav.ws>
2352
2353         Remove URL decoding in srcset handling
2354         https://bugs.webkit.org/show_bug.cgi?id=121609
2355
2356         Reviewed by Benjamin Poulain.
2357
2358         Tests: fast/hidpi/image-srcset-question-mark.html
2359                fast/loader/image-src-question-mark.html
2360
2361         Removed URL decoding from src and srcset's handling algorithm, since they break encoded URLS.
2362
2363         * html/parser/HTMLParserIdioms.cpp:
2364         (WebCore::parseImagesWithScaleFromSrcSetAttribute):
2365         (WebCore::bestFitSourceForImageAttributes):
2366
2367 2013-09-19  Anders Carlsson  <andersca@apple.com>
2368
2369         Avoid calling AtomicString::lower() in makeFontGlyphsCacheKey
2370         https://bugs.webkit.org/show_bug.cgi?id=121656
2371
2372         Reviewed by Darin Adler.
2373
2374         Instead of lower casing AtomicStrings, store the strings as is and use the case folding
2375         hash and case insensitive compare to determine equality.
2376
2377         * platform/graphics/Font.cpp:
2378         (WebCore::operator==):
2379         (WebCore::makeFontGlyphsCacheKey):
2380         (WebCore::computeFontGlyphsCacheHash):
2381
2382 2013-09-19  Darin Adler  <darin@apple.com>
2383
2384         Fix leaks in CSS parser caused by overwriting owned raw pointers with 0
2385         https://bugs.webkit.org/show_bug.cgi?id=121655
2386
2387         Reviewed by Anders Carlsson.
2388
2389         * css/CSSGrammar.y.in: Use nullptr instead of 0. Use unique_ptr instead
2390         of a raw pointer in cases where we might or might not actually keep
2391         the allocated memory. This can still be cleaned up further, but this
2392         should fix the memory leaks we have been seeing.
2393
2394 2013-09-19  Eric Carlson  <eric.carlson@apple.com>
2395
2396         MediaStream API: update MediaStreamTrackEvent object to match spec
2397         https://bugs.webkit.org/show_bug.cgi?id=121624
2398
2399         Reviewed by Dean Jackson.
2400
2401         Test: fast/mediastream/MediaStreamTrackEvent-constructor.html
2402
2403         * Modules/mediastream/MediaStreamTrack.idl: Remove NoInterfaceObject.
2404
2405         * Modules/mediastream/MediaStreamTrackEvent.cpp: 
2406         (WebCore::MediaStreamTrackEventInit::MediaStreamTrackEventInit): New.
2407         (WebCore::MediaStreamTrackEvent::create): New form that takes an initialize.
2408         (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent): Ditto.
2409         * Modules/mediastream/MediaStreamTrackEvent.h:
2410         * Modules/mediastream/MediaStreamTrackEvent.idl:
2411
2412         * bindings/js/JSDictionary.cpp:
2413         (WebCore::JSDictionary::convertValue): New.
2414         * bindings/js/JSDictionary.h:
2415
2416 2013-09-19  Anders Carlsson  <andersca@apple.com>
2417
2418         Remove #if !ENABLE(WORKERS) code in ThreadGlobalData
2419         https://bugs.webkit.org/show_bug.cgi?id=121649
2420
2421         Reviewed by Sam Weinig.
2422
2423         This lets us remove a FIXME. Also, move threadGlobalData out of line; there's no need for it to be inline.
2424
2425         * WebCore.exp.in:
2426         * platform/ThreadGlobalData.cpp:
2427         (WebCore::threadGlobalData):
2428         * platform/ThreadGlobalData.h:
2429
2430 2013-09-19  Anders Carlsson  <andersca@apple.com>
2431
2432         Modernize Length setters/getters
2433         https://bugs.webkit.org/show_bug.cgi?id=121647
2434
2435         Reviewed by Andreas Kling.
2436
2437         Add a move constructor and move assignment operator to Length and fixup some of the getters and setters.
2438
2439         * css/CSSComputedStyleDeclaration.cpp:
2440         (WebCore::getBorderRadiusCornerValues):
2441         (WebCore::getBorderRadiusCornerValue):
2442         * css/DeprecatedStyleBuilder.cpp:
2443         (WebCore::ApplyPropertyLength::setValue):
2444         (WebCore::ApplyPropertyLength::createHandler):
2445         (WebCore::ApplyPropertyBorderRadius::setValue):
2446         (WebCore::ApplyPropertyBorderRadius::createHandler):
2447         (WebCore::ApplyPropertyLineHeight::createHandler):
2448         * page/animation/CSSPropertyAnimation.cpp:
2449         (WebCore::LengthPropertyWrapper::LengthPropertyWrapper):
2450         (WebCore::LengthPropertyWrapper::blend):
2451         (WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
2452         (WebCore::FillLayerPropertyWrapper::blend):
2453         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2454         * platform/CalculationValue.h:
2455         (WebCore::CalcExpressionLength::CalcExpressionLength):
2456         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
2457         * platform/Length.cpp:
2458         (WebCore::CalculationValueHandleMap::remove):
2459         (WebCore::CalculationValueHandleMap::find):
2460         (WebCore::Length::decrementCalculatedRef):
2461         * platform/Length.h:
2462         (WebCore::Length::Length):
2463         (WebCore::Length::operator=):
2464         (WebCore::Length::moveFromLength):
2465         * platform/LengthBox.cpp:
2466         (WebCore::LengthBox::logicalLeft):
2467         (WebCore::LengthBox::logicalRight):
2468         (WebCore::LengthBox::before):
2469         (WebCore::LengthBox::after):
2470         (WebCore::LengthBox::start):
2471         (WebCore::LengthBox::end):
2472         * platform/LengthBox.h:
2473         (WebCore::LengthBox::LengthBox):
2474         (WebCore::LengthBox::left):
2475         (WebCore::LengthBox::right):
2476         (WebCore::LengthBox::top):
2477         (WebCore::LengthBox::bottom):
2478         * platform/LengthSize.h:
2479         (WebCore::LengthSize::LengthSize):
2480         (WebCore::LengthSize::setWidth):
2481         (WebCore::LengthSize::width):
2482         (WebCore::LengthSize::setHeight):
2483         (WebCore::LengthSize::height):
2484         * platform/graphics/filters/FilterOperation.h:
2485         (WebCore::FilterOperation::BlurFilterOperation::create):
2486         (WebCore::FilterOperation::BlurFilterOperation::stdDeviation):
2487         (WebCore::FilterOperation::BlurFilterOperation::BlurFilterOperation):
2488         * rendering/style/BasicShapes.h:
2489         (WebCore::BasicShapeRectangle::x):
2490         (WebCore::BasicShapeRectangle::y):
2491         (WebCore::BasicShapeRectangle::width):
2492         (WebCore::BasicShapeRectangle::height):
2493         (WebCore::BasicShapeRectangle::cornerRadiusX):
2494         (WebCore::BasicShapeRectangle::cornerRadiusY):
2495         (WebCore::BasicShapeRectangle::setX):
2496         (WebCore::BasicShapeRectangle::setY):
2497         (WebCore::BasicShapeRectangle::setWidth):
2498         (WebCore::BasicShapeRectangle::setHeight):
2499         (WebCore::BasicShapeRectangle::setCornerRadiusX):
2500         (WebCore::BasicShapeRectangle::setCornerRadiusY):
2501         (WebCore::BasicShapeCircle::centerX):
2502         (WebCore::BasicShapeCircle::centerY):
2503         (WebCore::BasicShapeCircle::radius):
2504         (WebCore::BasicShapeCircle::setCenterX):
2505         (WebCore::BasicShapeCircle::setCenterY):
2506         (WebCore::BasicShapeCircle::setRadius):
2507         (WebCore::BasicShapeEllipse::centerX):
2508         (WebCore::BasicShapeEllipse::centerY):
2509         (WebCore::BasicShapeEllipse::radiusX):
2510         (WebCore::BasicShapeEllipse::radiusY):
2511         (WebCore::BasicShapeEllipse::setCenterX):
2512         (WebCore::BasicShapeEllipse::setCenterY):
2513         (WebCore::BasicShapeEllipse::setRadiusX):
2514         (WebCore::BasicShapeEllipse::setRadiusY):
2515         (WebCore::BasicShapePolygon::getXAt):
2516         (WebCore::BasicShapePolygon::getYAt):
2517         (WebCore::BasicShapePolygon::appendPoint):
2518         (WebCore::BasicShapeInsetRectangle::top):
2519         (WebCore::BasicShapeInsetRectangle::right):
2520         (WebCore::BasicShapeInsetRectangle::bottom):
2521         (WebCore::BasicShapeInsetRectangle::left):
2522         (WebCore::BasicShapeInsetRectangle::cornerRadiusX):
2523         (WebCore::BasicShapeInsetRectangle::cornerRadiusY):
2524         (WebCore::BasicShapeInsetRectangle::setTop):
2525         (WebCore::BasicShapeInsetRectangle::setRight):
2526         (WebCore::BasicShapeInsetRectangle::setBottom):
2527         (WebCore::BasicShapeInsetRectangle::setLeft):
2528         (WebCore::BasicShapeInsetRectangle::setCornerRadiusX):
2529         (WebCore::BasicShapeInsetRectangle::setCornerRadiusY):
2530         * rendering/style/FillLayer.h:
2531         (WebCore::FillSize::FillSize):
2532         (WebCore::FillLayer::xPosition):
2533         (WebCore::FillLayer::yPosition):
2534         (WebCore::FillLayer::sizeLength):
2535         (WebCore::FillLayer::setXPosition):
2536         (WebCore::FillLayer::setYPosition):
2537         * rendering/style/NinePieceImage.cpp:
2538         (WebCore::NinePieceImage::NinePieceImage):
2539         * rendering/style/NinePieceImage.h:
2540         (WebCore::NinePieceImage::setImageSlices):
2541         (WebCore::NinePieceImage::setBorderSlices):
2542         (WebCore::NinePieceImage::setOutset):
2543         (WebCore::NinePieceImage::computeOutset):
2544         * rendering/style/RenderStyle.cpp:
2545         (WebCore::RenderStyle::specifiedLineHeight):
2546         * rendering/style/RenderStyle.h:
2547         * rendering/style/StyleBoxData.h:
2548         (WebCore::StyleBoxData::width):
2549         (WebCore::StyleBoxData::height):
2550         (WebCore::StyleBoxData::minWidth):
2551         (WebCore::StyleBoxData::minHeight):
2552         (WebCore::StyleBoxData::maxWidth):
2553         (WebCore::StyleBoxData::maxHeight):
2554         (WebCore::StyleBoxData::verticalAlign):
2555         * rendering/style/StyleReflection.h:
2556         (WebCore::StyleReflection::offset):
2557         (WebCore::StyleReflection::setOffset):
2558
2559 2013-09-19  Andreas Kling  <akling@apple.com>
2560
2561         Out-of-line InspectorValues create() methods.
2562         <https://webkit.org/b/121639>
2563
2564         Reviewed by Joseph Pecoraro.
2565
2566         These functions are hardly performance-critical and are taking up
2567         quite a lot of space.
2568
2569         Shrinks the WebCore binary by 70500 bytes.
2570
2571 2013-09-19  Alexey Proskuryakov  <ap@apple.com>
2572
2573         Layout Test http/tests/security/canvas-remote-read-remote-image-redirect.html is flaky
2574         https://bugs.webkit.org/show_bug.cgi?id=121458
2575
2576         Reviewed by Sam Weinig.
2577
2578         The code to automagically produce line numbers is quite fragile. Added some FIXMEs,
2579         and added an issue that was making reporting flaky for code is JS event handlers
2580         executed while parsing was paused.
2581
2582         * page/PageConsole.cpp: (WebCore::PageConsole::addMessage): Use actual "script is
2583         running" check instead of "parsing a script element" one.
2584
2585 2013-09-18  Ryosuke Niwa  <rniwa@webkit.org>
2586
2587         Remove superfluous CSSLinearTimingFunctionValue and use switch on TimingFunction::type() in more places
2588         https://bugs.webkit.org/show_bug.cgi?id=121589
2589
2590         Reviewed by Dean Jackson.
2591  
2592         Replaced CSSLinearTimingFunctionValue by the identifier "linear" and used switch statements on
2593         TimingFunction::type() in more places where we were branching on every type.
2594
2595         Merge https://chromium.googlesource.com/chromium/blink/+/5454f20c71090c35bdd1053e5cc572d5c0bdede7
2596         Merge https://chromium.googlesource.com/chromium/blink/+/104ad42c523d32b67d108c6e59f4f27488fe38a5
2597
2598         * css/CSSComputedStyleDeclaration.cpp:
2599         (WebCore::createTimingFunctionValue):
2600         * css/CSSTimingFunctionValue.cpp:
2601         * css/CSSTimingFunctionValue.h:
2602         * css/CSSToStyleMap.cpp:
2603         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
2604         * css/CSSValue.cpp:
2605         (WebCore::CSSValue::equals):
2606         (WebCore::CSSValue::cssText):
2607         (WebCore::CSSValue::destroy):
2608         * css/CSSValue.h:
2609         (WebCore::CSSValue::isCubicBezierTimingFunctionValue):
2610         * page/animation/AnimationBase.cpp:
2611         (WebCore::AnimationBase::progress):
2612
2613 2013-09-19  Commit Queue  <commit-queue@webkit.org>
2614
2615         Unreviewed, rolling out r156119.
2616         http://trac.webkit.org/changeset/156119
2617         https://bugs.webkit.org/show_bug.cgi?id=121640
2618
2619         broke builds in various ways (Requested by anttik on #webkit).
2620
2621         * accessibility/AccessibilitySpinButton.cpp:
2622         * bindings/scripts/CodeGeneratorObjC.pm:
2623         (GenerateImplementation):
2624         * css/SelectorChecker.cpp:
2625         * dom/ContainerNode.h:
2626         * dom/Element.h:
2627         * dom/PseudoElement.cpp:
2628         (WebCore::PseudoElement::didAttachRenderers):
2629         * editing/SplitTextNodeContainingElementCommand.cpp:
2630         (WebCore::SplitTextNodeContainingElementCommand::doApply):
2631         * editing/TypingCommand.cpp:
2632         * html/ImageDocument.cpp:
2633         * page/PageSerializer.cpp:
2634         * rendering/RenderElement.h:
2635         * rendering/RenderObject.h:
2636         * svg/SVGAnimatedColor.cpp:
2637         (WebCore::adjustForCurrentColor):
2638         * svg/SVGLocatable.cpp:
2639         * svg/graphics/filters/SVGFEImage.cpp:
2640         (WebCore::FEImage::determineAbsolutePaintRect):
2641         (WebCore::FEImage::referencedRenderer):
2642         * svg/graphics/filters/SVGFEImage.h:
2643
2644 2013-09-19  Antti Koivisto  <antti@apple.com>
2645
2646         Add covariant RenderElement* Element::renderer()
2647         https://bugs.webkit.org/show_bug.cgi?id=121638
2648
2649         Reviewed by Andreas Kling.
2650
2651         Also add isRenderElement() test and casting functions.
2652
2653 2013-09-19  Andreas Kling  <akling@apple.com>
2654
2655         Streamline JSMainThreadNullState.
2656         <https://webkit.org/b/121636>
2657
2658         Reviewed by Anders Carlsson.
2659
2660         JSMainThreadNullState is only used by non-JavaScript bindings and
2661         thus won't ever call didLeaveScriptContext() on destruction.
2662         Specialize the class for its use-case instead of sharing code
2663         with JSMainThreadExecState.
2664
2665         Shrinks the WebCore binary by 82848 bytes.
2666
2667 2013-09-19  Bear Travis  <betravis@adobe.com>
2668
2669         CSS_SHAPES not supported on AppleWin port
2670         https://bugs.webkit.org/show_bug.cgi?id=118810
2671
2672         Reviewed by Brent Fulgham.
2673
2674         Enabling fast/shapes on windows.
2675
2676         * WebCore.vcxproj/WebCore.vcxproj: Add missing shape includes.
2677         * WebCore.vcxproj/WebCoreCommon.props: Include shapes source folder.
2678         * WebCore.vcxproj/copyForwardingHeaders.cmd: Copy shapes headers.
2679         * css/CSSPropertyNames.in: Tweak to ensure shapes properties are regenerated.
2680
2681 2013-09-19  Andreas Kling  <akling@apple.com>
2682
2683         Add SVGPropertyInfo.cpp
2684         <https://webkit.org/b/121622>
2685
2686         Reviewed by Anders Carlsson.
2687
2688         Add a cpp file for this class to make it more hackable.
2689
2690         * CMakeLists.txt:
2691         * GNUmakefile.list.am:
2692         * Target.pri:
2693         * WebCore.vcxproj/WebCore.vcxproj:
2694         * WebCore.vcxproj/WebCore.vcxproj.filters:
2695         * WebCore.xcodeproj/project.pbxproj:
2696         * svg/properties/SVGPropertyInfo.cpp: Added.
2697         (WebCore::SVGPropertyInfo::SVGPropertyInfo):
2698         * svg/properties/SVGPropertyInfo.h:
2699
2700 2013-09-19  Eric Carlson  <eric.carlson@apple.com>
2701
2702         MediaStream API: update NavigatorUserMediaError object to match spec
2703         https://bugs.webkit.org/show_bug.cgi?id=121584
2704
2705         Reviewed by Dean Jackson.
2706
2707         No new tests, updated getusermedia.html.
2708
2709         * CMakeLists.txt: Add NavigatorUserMediaError.cpp.
2710         * GNUmakefile.list.am: Ditto.
2711
2712         * Modules/mediastream/NavigatorUserMediaError.cpp: Added.
2713         * Modules/mediastream/NavigatorUserMediaError.h: Derive from DOMError, get rid of "message" attribute.
2714         * Modules/mediastream/NavigatorUserMediaError.idl: Ditto.
2715
2716         * Modules/mediastream/UserMediaRequest.cpp:
2717         (WebCore::UserMediaRequest::create): ASCIILiteral -> AtomicString. Rename constraint parameters.
2718         (WebCore::UserMediaRequest::UserMediaRequest): Rename constraint parameters.
2719         (WebCore::UserMediaRequest::audioConstraints): Return PassRefPtr<> instead of raw ptr.
2720         (WebCore::UserMediaRequest::videoConstraints): Ditto.
2721         (WebCore::UserMediaRequest::ownerDocument): Clean up style.
2722         (WebCore::UserMediaRequest::succeed): 
2723         (WebCore::UserMediaRequest::permissionFailure): Renamed from fail.
2724         (WebCore::UserMediaRequest::constraintFailure):  Renamed from failConstraint.
2725         (WebCore::UserMediaRequest::callSuccessHandler): New.
2726         (WebCore::UserMediaRequest::callErrorHandler): New.
2727         * Modules/mediastream/UserMediaRequest.h:
2728
2729         * WebCore.xcodeproj/project.pbxproj: Add NavigatorUserMediaError.cpp
2730
2731         * dom/DOMError.h: Make constructor protected.
2732
2733         * platform/mediastream/MediaStreamSourcesQueryClient.h: Make constraints available.
2734
2735 2013-09-19  Bem Jones-Bey  <bjonesbe@adobe.com>
2736
2737         Fix handling of top margin on float with shape-outside
2738         https://bugs.webkit.org/show_bug.cgi?id=121614
2739
2740         Reviewed by Alexandru Chiculita.
2741
2742         When a float has shape outside, the top margin should be treated as if
2743         there is no shape there, so inline content should be allowed to flow
2744         into that space. This patch fixes two issues:
2745         
2746         1) If the top margin is the same as the line height, a line should be
2747         able to fit into the margin. Before this patch, that line was being
2748         treated as if it intersected with the shape.
2749         
2750         2) The shape should be positioned (x, y) relative to the box sizing
2751         box of the float. While the x coordinate was being treated properly,
2752         the y coordinate was relative to the top of the margin box. This patch
2753         fixes this behavior.
2754         
2755         This patch also includes a simple test for right and left margins, as
2756         I wrote that test and then discovered the problems listed above.
2757         
2758         This patch also removes an unused override of the
2759         lineOverlapsShapeBounds method.
2760
2761         Tests: csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-000.html
2762                csswg/submitted/shapes/shape-outside/shape-outside-floats-margin-001.html
2763
2764         * rendering/FloatingObjects.cpp:
2765         (WebCore::FloatingObjects::logicalLeftOffset): 
2766         (WebCore::FloatingObjects::logicalRightOffset):
2767         * rendering/LineWidth.cpp:
2768         (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
2769         * rendering/shapes/ShapeInfo.h:
2770         * rendering/shapes/ShapeInsideInfo.h:
2771         * rendering/shapes/ShapeOutsideInfo.cpp:
2772         (WebCore::ShapeOutsideInfo::computeSegmentsForContainingBlockLine):
2773         * rendering/shapes/ShapeOutsideInfo.h:
2774
2775 2013-09-19  Antti Koivisto  <antti@apple.com>
2776
2777         Add RenderElement
2778         https://bugs.webkit.org/show_bug.cgi?id=121608
2779
2780         Reviewed by Dave Hyatt.
2781
2782         Add a common base class for all Element renderers. The class hierarchy will now look like this
2783         
2784         RenderObject
2785             RenderText
2786             RenderElement
2787                 RenderLayerModelObject
2788                     ...
2789                 RenderSVGModelObject
2790                     ...
2791                 RenderSVGGradientStop
2792                 
2793         This will allow tighter typing in both render and DOM trees.
2794         
2795         The patch also moves renderer factory function to RenderElement::createFor().
2796
2797 2013-09-19  Alexey Proskuryakov  <ap@apple.com>
2798
2799         REGRESSION (r149928): CanvasStyle::operator= leaks everything
2800         https://bugs.webkit.org/show_bug.cgi?id=121591
2801
2802         Reviewed by Andreas Kling.
2803
2804         * html/canvas/CanvasStyle.cpp: (WebCore::CanvasStyle::operator=): Don't leak.
2805
2806 2013-09-19  Andrei Parvu  <parvu@adobe.com>
2807
2808         [CSS Masking/Background] Position property should be ignored when using repeat: space
2809         https://bugs.webkit.org/show_bug.cgi?id=120623
2810
2811         The background/mask-position should be ignored when using repeat: space,
2812         unless there is not enough space for two copies of the image. In that case,
2813         only one image is placed and background/mask-position determines its position.
2814
2815         Reviewed by Dirk Schulze.
2816
2817         Test: css3/masking/mask-repeat-one-copy.html
2818
2819         * rendering/RenderBoxModelObject.cpp: Ignored position property if space value is positive, set no-repeat otherwise.
2820         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
2821
2822 2013-09-19  Andreas Kling  <akling@apple.com>
2823
2824         CTTE: EllipsisBox::renderer() should return RenderBlock&.
2825         <https://webkit.org/b/121604>
2826
2827         Reviewed by Antti Koivisto.
2828
2829         I missed adding a renderer() overload when fixing up EllipsisBox.
2830         Flushed out one unnecessary type check.
2831
2832 2013-09-19  Andreas Kling  <akling@apple.com>
2833
2834         CTTE: Tighten renderer types for InlineTextBox and SVGInlineTextBox.
2835         <https://webkit.org/b/121605>
2836
2837         Reviewed by Antti Koivisto.
2838
2839         Codify the following:
2840
2841         - InlineTextBox always has a RenderText.
2842         - SVGInlineTextBox always has a RenderSVGInlineText.
2843
2844         Removed InlineTextBox::textRenderer() and make renderer() simply
2845         return a RenderText&/RenderSVGInlineText& instead.
2846
2847         This turns some node() accessors into textNode() and removes a host
2848         of casts and assertions.
2849
2850 2013-09-19  Antti Koivisto  <antti@apple.com>
2851
2852         [CTTE] Hide nonPseudoNode and generatingNode, replace with Element versions
2853         https://bugs.webkit.org/show_bug.cgi?id=121606
2854
2855         Reviewed by Andreas Kling.
2856
2857 2013-09-19  Andreas Kling  <akling@apple.com>
2858
2859         CTTE: Tighten renderer types for InlineFlowBox and SVGInlineFlowBox.
2860         <https://webkit.org/b/121603>
2861
2862         Reviewed by Antti Koivisto.
2863
2864         Codify the following:
2865
2866         - InlineFlowBox always has a RenderBoxModelObject.
2867         - SVGInlineFlowBox always has a RenderSVGInline.
2868
2869         This turns some node() accessors into element(). Neato!
2870
2871 2013-09-19  Gurpreet Kaur  <k.gurpreet@samsung.com>
2872
2873         CSS Unit vmax and vmin in border-width not handled.
2874         https://bugs.webkit.org/show_bug.cgi?id=121421
2875
2876         Reviewed by Darin Adler.
2877
2878         Border properties were not applied incase its values 
2879         were given in vmax/vmin units.
2880
2881         Tests: fast/css/viewport-vmax-border.html
2882                fast/css/viewport-vmin-border.html
2883
2884         * css/CSSPrimitiveValue.cpp:
2885         (WebCore::CSSPrimitiveValue::computeLengthDouble):
2886         * css/CSSPrimitiveValue.h:
2887         (WebCore::CSSPrimitiveValue::isViewportPercentageMax):
2888         (WebCore::CSSPrimitiveValue::isViewportPercentageMin):
2889         * css/DeprecatedStyleBuilder.cpp:
2890         (WebCore::ApplyPropertyComputeLength::applyValue):
2891         Calculating the border values which has been specified in
2892         vmax/vmin units. 1vmax: 1vw or 1vh, whatever is largest.
2893         1vmin: 1vw or 1vh, whatever is smallest. The vh/vw units are 
2894         calcultated as percent of viewport height and viewport width respectively.
2895
2896 2013-09-19  Antti Koivisto  <antti@apple.com>
2897
2898         [CTTE] RenderText is always anonymous or associated with Text node
2899         https://bugs.webkit.org/show_bug.cgi?id=121596
2900
2901         Reviewed by Andreas Kling.
2902
2903         Tighten the node type of RenderText and its subclasses to Text.
2904         Switch to createAnonymous pattern.
2905         Switch a bunch of unnecessary StringImpl* use to Strings.
2906
2907 2013-09-18  Mihnea Ovidenie  <mihnea@adobe.com>
2908
2909         Unreviewed build fix after 156082. Guard SVG code with defines.
2910
2911         * rendering/RenderNamedFlowThread.cpp:
2912         (WebCore::nextNodeInsideContentNode):
2913
2914 2013-09-18  Mihnea Ovidenie  <mihnea@adobe.com>
2915
2916         [CSSRegions] Failed to retrieve named flow ranges for content with inline svg
2917         https://bugs.webkit.org/show_bug.cgi?id=121489
2918
2919         Reviewed by David Hyatt.
2920
2921         The inline SVG element behaves like a replaced element in HTML context. When computing the ranges
2922         that are displayed inside a region for a named flow that contains an inline SVG element, we have
2923         to treat the SVG as a replaced and run the checks only for the SVG root element, skipping the
2924         other SVG elements inside.
2925
2926         Test: fast/regions/get-region-flow-ranges-inline-svg.html
2927
2928         * rendering/RenderNamedFlowThread.cpp:
2929         (WebCore::nextNodeInsideContentNode): Add function to retrieve the next node in traversal
2930         under the contentNode subtree that should be used for getRanges inspection.
2931         (WebCore::RenderNamedFlowThread::getRanges): Replace NodeTravesal::next with nextNodeInsideContentNode.
2932
2933 2013-09-18  Bem Jones-Bey  <bjonesbe@adobe.com>
2934
2935         REGRESSION (r155854 - r155967) block with margin-left adjacent to floated block causes text of subsequent blocks to overlap the floated block.
2936         https://bugs.webkit.org/show_bug.cgi?id=121532
2937
2938         Reviewed by Andreas Kling.
2939
2940         When refactoring the code, I ended up adding the margin in instead of
2941         subtracting it in the case of an intruding float. This patch fixes
2942         that so that the margin is properly handled.
2943
2944         Test: fast/block/float/intruding-float-sibling-with-margin.html
2945
2946         * rendering/RenderBlock.cpp:
2947         (WebCore::RenderBlock::addIntrudingFloats):
2948
2949 2013-09-18  Ryosuke Niwa  <rniwa@webkit.org>
2950
2951         Merge HTMLBodyElement::didNotifySubtreeInsertions into HTMLBodyElement::insertedInto
2952         https://bugs.webkit.org/show_bug.cgi?id=121576
2953
2954         Reviewed by Andreas Kling.
2955
2956         Merge https://chromium.googlesource.com/chromium/blink/+/2a9cac908f4eceadfcf9d21bdf5b3e598075aa1f
2957
2958         The logic in didNotifySubtreeInsertions to set the marginwidth and marginheight attributes
2959         on the <body> of elements inside <iframe> and <frame> doesn't need to run after inserting
2960         all the children of the frame. In fact this means that when you have those attributes
2961         and then the script in the iframe touches offsetLeft or any layout dependent property
2962         we'll layout with the wrong values and then have to do another layout after these margin
2963         attributes are set.
2964
2965         I also remove the scheduleRelayout() call that was inside didNotifySubtreeInsertions. This
2966         call doesn't make any sense, inserting a <body> will always trigger a style recalc and
2967         a subsequent layout. The code is 9 years old: https://trac.webkit.org/changeset/8122
2968         and all tests run fine without it.
2969
2970         * html/HTMLBodyElement.cpp:
2971         (WebCore::HTMLBodyElement::insertedInto):
2972         * html/HTMLBodyElement.h:
2973         * html/HTMLFrameElementBase.h:
2974         (WebCore::isHTMLFrameElementBase):
2975         (WebCore::toHTMLFrameElementBase):
2976
2977 2013-09-18  Jer Noble  <jer.noble@apple.com>
2978
2979         [MSE] Throw exception when setting timestampOffset while 'updating' state is set.
2980         https://bugs.webkit.org/show_bug.cgi?id=121561
2981
2982         Reviewed by Eric Carlson.
2983
2984         Tests: Updated http/tests/media/media-source/mediasource-append-buffer.html.
2985
2986         Merge https://chromium.googlesource.com/chromium/blink/+/25285998be3d0edcd951d12d445a7375e50e512c
2987         by Changbin Shao.
2988
2989         The Media Source Extensions spec requires that an exception be thrown if the 'updating' attribute
2990         equals true while setting the timestampOffset of a SourceBuffer. 
2991
2992         * Modules/mediasource/SourceBuffer.cpp:
2993         (WebCore::SourceBuffer::setTimestampOffset):
2994
2995 2013-09-18  Anders Carlsson  <andersca@apple.com>
2996
2997         RefPtrHashMap should work with move only types
2998         https://bugs.webkit.org/show_bug.cgi?id=121564
2999
3000         Reviewed by Andreas Kling.
3001
3002         * bridge/IdentifierRep.cpp:
3003         (WebCore::IdentifierRep::get):
3004         * page/PageGroup.cpp:
3005         (WebCore::PageGroup::transientLocalStorage):
3006
3007 2013-09-18  Enrica Casucci  <enrica@apple.com>
3008
3009         Upstream changes to WebHTMLConverter to support HTML
3010         to NSAttributedString conversion on both iOS and OS X.
3011
3012         Reviewed by Benjamin Poulain.
3013
3014         This is a new submission of r156001 with the fix for the
3015         failing TestWebKitAPI test. The additional change has been
3016         reviewed by Tim Horton.
3017         
3018         * platform/mac/HTMLConverter.h:
3019         * platform/mac/HTMLConverter.mm:
3020         (WebDefaultFont):
3021         (_fontForNameAndSize):
3022         (+[WebHTMLConverter defaultParagraphStyle]):
3023         (-[WebHTMLConverter _computedStyleForElement:]):
3024         (-[WebHTMLConverter _specifiedStyleForElement:]):
3025         (-[WebHTMLConverter _computedStringForNode:property:]):
3026         (-[WebHTMLConverter _stringForNode:property:]):
3027         (-[WebHTMLConverter _getComputedFloat:forNode:property:]):
3028         (-[WebHTMLConverter _getFloat:forNode:property:]):
3029         (_NSFirstPathForDirectoriesInDomains):
3030         (_NSSystemLibraryPath):
3031         (-[WebHTMLConverter _webKitBundle]):
3032         (_colorForRGBColor):
3033         (_shadowForShadowStyle):
3034         (-[WebHTMLConverter _elementIsBlockLevel:]):
3035         (-[WebHTMLConverter _elementHasOwnBackgroundColor:]):
3036         (-[WebHTMLConverter _computedColorForNode:property:]):
3037         (-[WebHTMLConverter _colorForNode:property:]):
3038         (-[WebHTMLConverter _computedAttributesForElement:]):
3039         (-[WebHTMLConverter _attributesForElement:]):
3040         (-[WebHTMLConverter _newParagraphForElement:tag:allowEmpty:suppressTrailingSpace:]):
3041         (-[WebHTMLConverter _newLineForElement:]):
3042         (-[WebHTMLConverter _newTabForElement:]):
3043         (-[WebHTMLConverter _WebMessageDocumentClass]):
3044         (-[WebHTMLConverter _addAttachmentForElement:URL:needsParagraph:usePlaceholder:]):
3045         (-[WebHTMLConverter _addQuoteForElement:opening:level:]):
3046         (-[WebHTMLConverter _addValue:forElement:]):
3047         (-[WebHTMLConverter _fillInBlock:forElement:backgroundColor:extraMargin:extraPadding:isTable:]):
3048         (_dateForString):
3049         (_colCompare):
3050         (-[WebHTMLConverter _processMetaElementWithName:content:]):
3051         (-[WebHTMLConverter _processHeadElement:]):
3052         (-[WebHTMLConverter _enterElement:tag:display:embedded:]):
3053         (-[WebHTMLConverter _addTableForElement:]):
3054         (-[WebHTMLConverter _addTableCellForElement:]):
3055         (-[WebHTMLConverter _processElement:tag:display:depth:]):
3056         (-[WebHTMLConverter _addMarkersToList:range:]):
3057         (-[WebHTMLConverter _exitElement:tag:display:depth:startIndex:]):
3058         (-[WebHTMLConverter _processText:]):
3059         (-[WebHTMLConverter _traverseNode:depth:embedded:]):
3060         (-[WebHTMLConverter _traverseFooterNode:depth:]):
3061         (-[WebHTMLConverter _loadFromDOMRange]):
3062         (-[WebHTMLConverter dealloc]):
3063         (-[WebHTMLConverter init]):
3064         (-[WebHTMLConverter initWithDOMRange:]):
3065         (-[WebHTMLConverter attributedString]):
3066         (+[WebHTMLConverter editingAttributedStringFromRange:]):
3067
3068 2013-09-18  Antti Koivisto  <antti@apple.com>
3069
3070         Rename RenderBR to RenderLineBreak
3071         https://bugs.webkit.org/show_bug.cgi?id=121560
3072
3073         Reviewed by Sam Weinig.
3074
3075         It now represents both hard (br) and soft (wbr) line breaks.
3076
3077 2013-09-18  Robert Hogan  <robert@webkit.org>
3078
3079         Quirksmode: Break Tag Extra Space Bug
3080         https://bugs.webkit.org/show_bug.cgi?id=11943
3081
3082         Reviewed by David Hyatt.
3083
3084         Collapse away all space between text and a hard line-break when in a right-aligned
3085         container so that the trailing space doesn't push the text away from the container edge.
3086
3087         Test: fast/text/whitespace/trailing-space-before-br-in-right-aligned-text.html
3088
3089         * rendering/RenderBlockLineLayout.cpp:
3090         (WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
3091
3092 2013-09-18  Jer Noble  <jer.noble@apple.com>
3093
3094         Unreviewed build fix for Qt (and other) ports after 156049.
3095
3096         Wrap implementation of PublicURLManager in ENABLE(BLOB) check.
3097
3098         * html/PublicURLManager.cpp:
3099
3100 2013-09-18  Jer Noble  <jer.noble@apple.com>
3101
3102         Merge blink MediaSource changes since fork.
3103         https://bugs.webkit.org/show_bug.cgi?id=118752
3104
3105         Rubber-stamped by Eric Carlson.
3106
3107         Tests: http/tests/media/media-source/mediasource-addsourcebuffer.html
3108                http/tests/media/media-source/mediasource-append-buffer.html
3109                http/tests/media/media-source/mediasource-buffered.html
3110                http/tests/media/media-source/mediasource-closed.html
3111                http/tests/media/media-source/mediasource-config-change-mp4-a-bitrate.html
3112                http/tests/media/media-source/mediasource-config-change-mp4-av-audio-bitrate.html
3113                http/tests/media/media-source/mediasource-config-change-mp4-av-framesize.html
3114                http/tests/media/media-source/mediasource-config-change-mp4-av-video-bitrate.html
3115                http/tests/media/media-source/mediasource-config-change-mp4-v-bitrate.html
3116                http/tests/media/media-source/mediasource-config-change-mp4-v-framerate.html
3117                http/tests/media/media-source/mediasource-config-change-mp4-v-framesize.html
3118                http/tests/media/media-source/mediasource-config-change-webm-a-bitrate.html
3119                http/tests/media/media-source/mediasource-config-change-webm-av-audio-bitrate.html
3120                http/tests/media/media-source/mediasource-config-change-webm-av-framesize.html
3121                http/tests/media/media-source/mediasource-config-change-webm-av-video-bitrate.html
3122                http/tests/media/media-source/mediasource-config-change-webm-v-bitrate.html
3123                http/tests/media/media-source/mediasource-config-change-webm-v-framerate.html
3124                http/tests/media/media-source/mediasource-config-change-webm-v-framesize.html
3125                http/tests/media/media-source/mediasource-is-type-supported.html
3126                http/tests/media/media-source/mediasource-multiple-attach.html
3127                http/tests/media/media-source/mediasource-play.html
3128                http/tests/media/media-source/mediasource-sourcebufferlist.html
3129
3130         Add files to project. Fix compile errors exposed by enabling.
3131
3132         * WebCore.xcodeproj/project.pbxproj:
3133         * Modules/mediasource/MediaSourceRegistry.cpp:
3134         (WebCore::MediaSourceRegistry::lookupMediaSource):
3135         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3136         (WebCore::MediaPlayerPrivateAVFoundation::load):
3137         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3138         (WebCore::MediaPlayerPrivateQTKit::load):
3139         * platform/mac/MIMETypeRegistryMac.mm:
3140         (WebCore::MIMETypeRegistry::isSupportedMediaSourceMIMEType):
3141         * CMakeLists.txt:
3142         * DerivedSources.make:
3143         * DerivedSources.pri:
3144         * GNUmakefile.list.am:
3145
3146         Merge
3147         https://chromium.googlesource.com/chromium/blink/+/c38e2955db98a300a535b692869fea0e41501497
3148         https://chromium.googlesource.com/chromium/blink/+/8568015e9bee1de7fccee28163f9e4a4b51f9baf
3149         https://chromium.googlesource.com/chromium/blink/+/14417e8fa6294f4e7dbc1e0fac549398522b2f97
3150         https://chromium.googlesource.com/chromium/blink/+/f43a5496f233102f8861a067a9cf8053c010d401
3151         https://chromium.googlesource.com/chromium/blink/+/57771439806f7c6e6a272efb1ea72900f5f6a015
3152         https://chromium.googlesource.com/chromium/blink/+/8c77a790a9d225194db0a8832399d0f9e1fa54ec
3153         https://chromium.googlesource.com/chromium/blink/+/d33ae3fa7a8592e946503ed17f862a27c6d9dde1
3154         https://chromium.googlesource.com/chromium/blink/+/1caaa9c51f06e1b9341d58c994f77fd59fcd236d
3155         https://chromium.googlesource.com/chromium/blink/+/e95720393b0ebe67f19de39bb77cdf2926165512
3156         https://chromium.googlesource.com/chromium/blink/+/bad2c1b4b70faec731b2ad3cc8a4ccf28de6cc38
3157         https://chromium.googlesource.com/chromium/blink/+/a7873430c3d5c9373336c6f3993db3cb4228e9cd
3158         https://chromium.googlesource.com/chromium/blink/+/508966d5e32360b3cec058f9fbae0014542fbc52
3159         https://chromium.googlesource.com/chromium/blink/+/371dfe72f61ce6f73e6c242324da73c415d38be3
3160
3161 2013-09-18  Andreas Kling  <akling@apple.com>
3162
3163         CTTE: RenderBR always has an HTMLElement.
3164         <https://webkit.org/b/121557>
3165
3166         Reviewed by Antti Koivisto.
3167
3168         This renderer is never anonymous and always has a corresponding HTMLElement.
3169         Tighten this up by making the constructor take a HTMLElement& and remove
3170         RenderBR::createAnonymous().
3171
3172 2013-09-18  Andreas Kling  <akling@apple.com>
3173
3174         Avoid using RenderBR internally in RenderMenuList.
3175         <https://webkit.org/b/121550>
3176
3177         Reviewed by Antti Koivisto.
3178
3179         RenderMenuLists with an empty caption text were previously using a
3180         RenderBR as placeholder.
3181
3182         Switch to using a \n RenderText instead so we can tighten RenderBR.
3183
3184         This will change DRT dumps but actual metrics should not change.
3185
3186 2013-09-18  Antti Koivisto  <antti@apple.com>
3187
3188         Change one accidental "object->isText() || object->isLineBreak()" from previous patch back to "object->isTextOrLineBreak()"
3189         
3190         Not reviewed.
3191
3192         * rendering/InlineIterator.h:
3193         (WebCore::isIteratorTarget):
3194
3195 2013-09-18  Antti Koivisto  <antti@apple.com>
3196
3197         Remove RenderWordBreak
3198         https://bugs.webkit.org/show_bug.cgi?id=121549
3199
3200         Reviewed by Andreas Kling.
3201
3202         Remove RenderWordBreak and make it a bit in RenderBR instead.
3203         
3204         * CMakeLists.txt:
3205         * GNUmakefile.list.am:
3206         * Target.pri:
3207         * WebCore.vcxproj/WebCore.vcxproj:
3208         * WebCore.xcodeproj/project.pbxproj:
3209         * dom/Document.cpp:
3210         (WebCore::Document::updateHoverActiveState):
3211         * dom/Position.cpp:
3212         (WebCore::hasInlineBoxWrapper):
3213         (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
3214         * editing/Editor.cpp:
3215         (WebCore::findFirstMarkable):
3216         * editing/TextIterator.cpp:
3217         (WebCore::ignoresContainerClip):
3218         * html/HTMLElement.cpp:
3219         (WebCore::HTMLElement::createRenderer):
3220         * rendering/InlineBox.cpp:
3221         (WebCore::InlineBox::logicalHeight):
3222         (WebCore::InlineBox::baselinePosition):
3223         (WebCore::InlineBox::lineHeight):
3224         (WebCore::InlineBox::deleteLine):
3225         (WebCore::InlineBox::extractLine):
3226         (WebCore::InlineBox::attachLine):
3227         (WebCore::InlineBox::nodeAtPoint):
3228         * rendering/InlineBox.h:
3229         (WebCore::InlineBox::isLineBreak):
3230         * rendering/InlineFlowBox.cpp:
3231         (WebCore::InlineFlowBox::addToLine):
3232         (WebCore::InlineFlowBox::computeOverflow):
3233         * rendering/InlineIterator.h:
3234         (WebCore::InlineIterator::atTextParagraphSeparator):
3235         (WebCore::isIteratorTarget):
3236         * rendering/RenderBR.cpp:
3237         (WebCore::RenderBR::RenderBR):
3238         * rendering/RenderBR.h:
3239         (WebCore::toRenderBR):
3240     
3241             RenderBR now represents both hard and soft line breaks. It will be renamed to RenderLineBreak later.
3242
3243         * rendering/RenderBlock.cpp:
3244         (WebCore::InlineMinMaxIterator::next):
3245         (WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
3246         * rendering/RenderBlockLineLayout.cpp:
3247         (WebCore::createInlineBoxForRenderer):
3248         (WebCore::dirtyLineBoxesForRenderer):
3249         (WebCore::RenderBlock::computeBlockDirectionPositionsForLine):
3250         (WebCore::RenderBlockFlow::layoutInlineChildren):
3251         (WebCore::textBeginsWithBreakablePosition):
3252         (WebCore::canBreakAtThisPosition):
3253         (WebCore::RenderBlock::LineBreaker::nextSegmentBreak):
3254         * rendering/RenderInline.cpp:
3255         (WebCore::RenderInline::generateCulledLineBoxRects):
3256         (WebCore::RenderInline::culledInlineFirstLineBox):
3257         (WebCore::RenderInline::culledInlineLastLineBox):
3258         (WebCore::RenderInline::dirtyLineBoxes):
3259         * rendering/RenderLineBoxList.cpp:
3260         (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
3261         * rendering/RenderObject.h:
3262         (WebCore::RenderObject::isLineBreak):
3263         
3264             This bit covers both BR and WBR.
3265
3266         (WebCore::RenderObject::isBR):
3267         (WebCore::RenderObject::isLineBreakOpportunity):
3268         
3269             Rename isWordBreak to isLineBreakOpportunity. This matches HTML5 spec terminology.
3270
3271         (WebCore::RenderObject::isTextOrLineBreak):
3272         
3273             Since WBR used to be Text we want this check to still cover it too. Renamed from isTextOrBR.
3274
3275         (WebCore::RenderObject::setIsLineBreak):
3276         (WebCore::RenderObject::isWBR):
3277         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
3278         * rendering/RenderObjectChildList.cpp:
3279         (WebCore::RenderObjectChildList::removeChildNode):
3280         * rendering/RenderText.cpp:
3281         * rendering/RenderText.h:
3282         * rendering/RenderTreeAsText.cpp:
3283         (WebCore::RenderTreeAsText::writeRenderObject):
3284         * rendering/RenderWordBreak.cpp: Removed.
3285         * rendering/RenderWordBreak.h: Removed.
3286         * rendering/RenderingAllInOne.cpp:
3287         * rendering/RootInlineBox.cpp:
3288         (WebCore::RootInlineBox::ascentAndDescentForBox):
3289         (WebCore::RootInlineBox::verticalPositionForBox):
3290         (WebCore::RootInlineBox::includeLeadingForBox):
3291         (WebCore::RootInlineBox::includeFontForBox):
3292         (WebCore::RootInlineBox::includeGlyphsForBox):
3293         (WebCore::RootInlineBox::includeMarginForBox):
3294
3295 2013-09-18  Csaba Osztrogon√°c  <ossy@webkit.org>
3296
3297         ASSERT_NOT_REACHED is touched in WebCore::CSSPrimitiveValue::computeLengthDouble
3298         https://bugs.webkit.org/show_bug.cgi?id=120469
3299
3300         Tests: fast/css/outline-offset-parsing-assert.html
3301                fast/css/outline-offset-parsing.html
3302
3303         Reviewed by Dirk Schulze.
3304
3305         * css/CSSParser.cpp:
3306         (WebCore::CSSParser::parseValue): Fixed a typo after r66615, outline-offset can't be percentage.
3307
3308 2013-09-18  Gurpreet Kaur  <k.gurpreet@samsung.com>
3309
3310         [MathML] Implement the subscriptshift and superscriptshift attributes
3311         https://bugs.webkit.org/show_bug.cgi?id=120069
3312
3313         Reviewed by Darin Adler.
3314
3315         Added support for subscriptshift and superscriptshift attributes. The
3316         subscriptshift attribute is for msup element and superscriptshift for
3317         msup. msubsup can have both subscriptshift and superscriptshift. The
3318         subscriptshift attribute specifies the minimum amount to shift the
3319         baseline of subscript down. The superscriptshift attribute specifies
3320         the minimum amount to shift the baseline of superscript up.
3321
3322         Tests: mathml/presentation/msub-subscriptshift.html
3323                mathml/presentation/msubsup-subscriptshift.html
3324                mathml/presentation/msubsup-superscriptshift.html
3325                mathml/presentation/msup-superscriptshift.html
3326                mathml/presentation/multiscript-subscriptshift.html
3327                mathml/presentation/multiscript-superscriptshift.html
3328
3329         * mathml/mathattrs.in:
3330         * rendering/mathml/RenderMathMLScripts.cpp:
3331         (WebCore::RenderMathMLScripts::layout):
3332         For aligning the subscript and superscript padding is added to the base.
3333         So subscriptshift and superscriptshift attributes is set as padding bottom
3334         and padding top of base respectively.
3335
3336 2013-09-18  Mario Sanchez Prada  <mario.prada@samsung.com>
3337
3338         [ATK] Expose aria-haspopup and aria-sort without the 'aria-' prefix
3339         https://bugs.webkit.org/show_bug.cgi?id=121495
3340
3341         Reviewed by Chris Fleizach.
3342
3343         Removed the 'aria-' prefix from the exposed ATK object attributes
3344         for WAI-ARIA attributes 'aria-haspopup' and 'aria-sort'.
3345
3346         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3347         (webkitAccessibleGetAttributes): Removed the prefix.
3348
3349 2013-09-17  Antti Koivisto  <antti@apple.com>
3350
3351         Rename InlineBox::isText()
3352         <https://webkit.org/b/121525>
3353
3354         Reviewed by Andreas Kling.
3355
3356         The flag sounds like RenderObject::isText() yet it can be set for some inline boxes generated
3357         for non-text renderers too (br, list markers). This is pretty confusing.
3358         
3359         Rename to InlineBox::behavesLikeText().
3360
3361         * rendering/InlineBox.cpp:
3362         (WebCore::InlineBox::logicalHeight):
3363         (WebCore::InlineBox::baselinePosition):
3364         (WebCore::InlineBox::lineHeight):
3365         * rendering/InlineBox.h:
3366         (WebCore::InlineBox::behavesLikeText):
3367         (WebCore::InlineBox::setBehavesLikeText):
3368         (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
3369         * rendering/InlineFlowBox.cpp:
3370         (WebCore::InlineFlowBox::addToLine):
3371         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
3372         * rendering/InlineTextBox.cpp:
3373         (WebCore::InlineTextBox::baselinePosition):
3374         (WebCore::InlineTextBox::lineHeight):
3375         * rendering/RenderBlockLineLayout.cpp:
3376         (WebCore::createInlineBoxForRenderer):
3377         (WebCore::setLogicalWidthForTextRun):
3378         * rendering/RenderListMarker.cpp:
3379         (WebCore::RenderListMarker::createInlineBox):
3380         * rendering/RenderText.cpp:
3381         (WebCore::RenderText::createInlineTextBox):
3382         * rendering/RootInlineBox.cpp:
3383         (WebCore::RootInlineBox::includeLeadingForBox):
3384         (WebCore::RootInlineBox::includeFontForBox):
3385         (WebCore::RootInlineBox::includeGlyphsForBox):
3386         (WebCore::RootInlineBox::includeMarginForBox):
3387         
3388             Switch tests from isText() to isTextOrBR(). This matches the behavior before r155957.
3389             I don't know if there is a case where this actually makes any difference in behavior.
3390
3391 2013-09-17  Sam Weinig  <sam@webkit.org>
3392
3393         Shrink SVGPathStringBuilder
3394         https://bugs.webkit.org/show_bug.cgi?id=121536
3395
3396         Reviewed by Anders Carlsson.
3397
3398         - Use StringBuilder everywhere to avoid unnecessary temporary
3399           String objects and code size bloat.
3400         - Also did a drive by FINAL / OVERRIDE pass.
3401
3402         As an example of the win, the function SVGPathStringBuilder::arcTo
3403         went from being 6120 bytes down to just 378 bytes.
3404
3405         * svg/SVGPathStringBuilder.cpp:
3406         (WebCore::SVGPathStringBuilder::SVGPathStringBuilder):
3407         (WebCore::SVGPathStringBuilder::~SVGPathStringBuilder):
3408         (WebCore::SVGPathStringBuilder::cleanup):
3409         (WebCore::SVGPathStringBuilder::incrementPathSegmentCount):
3410         (WebCore::SVGPathStringBuilder::continueConsuming):
3411         It wasn't helpful for these to be inlined, so move them to
3412         the implementation file.
3413
3414         (WebCore::appendFlag):
3415         (WebCore::appendNumber):
3416         (WebCore::appendPoint):
3417         Added helpers.
3418
3419         (WebCore::SVGPathStringBuilder::moveTo):
3420         (WebCore::SVGPathStringBuilder::lineTo):
3421         (WebCore::SVGPathStringBuilder::lineToHorizontal):
3422         (WebCore::SVGPathStringBuilder::lineToVertical):
3423         (WebCore::SVGPathStringBuilder::curveToCubic):
3424         (WebCore::SVGPathStringBuilder::curveToCubicSmooth):
3425         (WebCore::SVGPathStringBuilder::curveToQuadratic):
3426         (WebCore::SVGPathStringBuilder::curveToQuadraticSmooth):
3427         (WebCore::SVGPathStringBuilder::arcTo):
3428         (WebCore::SVGPathStringBuilder::closePath):
3429         * svg/SVGPathStringBuilder.h:
3430         Stopped using operator+ and removed duplicate string building logic in each build
3431         type (e.g. both sides of the PathCoordinateMode condition were doing almost identical
3432         work).
3433
3434 2013-09-17  Sam Weinig  <sam@webkit.org>
3435
3436         CTTE: Convert some straggling Element subclasses constructors to take a Document&
3437         https://bugs.webkit.org/show_bug.cgi?id=121533
3438
3439         Reviewed by Anders Carlsson.
3440
3441         * html/HTMLMeterElement.cpp:
3442         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
3443         * html/HTMLProgressElement.cpp:
3444         (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
3445         * html/HTMLTextAreaElement.cpp:
3446         (WebCore::HTMLTextAreaElement::didAddUserAgentShadowRoot):
3447         * html/SearchInputType.cpp:
3448         (WebCore::SearchInputType::createShadowSubtree):
3449         * html/TextFieldInputType.cpp:
3450         (WebCore::TextFieldInputType::createShadowSubtree):
3451         * html/shadow/MeterShadowElement.cpp:
3452         (WebCore::MeterShadowElement::MeterShadowElement):
3453         (WebCore::MeterInnerElement::MeterInnerElement):
3454         * html/shadow/MeterShadowElement.h:
3455         (WebCore::MeterInnerElement::create):
3456         (WebCore::MeterBarElement::create):
3457         (WebCore::MeterValueElement::create):
3458         * html/shadow/ProgressShadowElement.cpp:
3459         (WebCore::ProgressShadowElement::ProgressShadowElement):
3460         (WebCore::ProgressInnerElement::ProgressInnerElement):
3461         (WebCore::ProgressBarElement::ProgressBarElement):
3462         (WebCore::ProgressValueElement::ProgressValueElement):
3463         * html/shadow/ProgressShadowElement.h:
3464         (WebCore::ProgressInnerElement::create):
3465         (WebCore::ProgressBarElement::create):
3466         (WebCore::ProgressValueElement::create):
3467    &nb