7ffb16a70731067db5d27de5c0ed75a366bc7a10
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-11-08  Tim Horton  <timothy_horton@apple.com>
2
3         Remote Layer Tree: RemoteLayerBackingStore partial repaint is broken for the tile cache
4         https://bugs.webkit.org/show_bug.cgi?id=123944
5
6         Reviewed by Simon Fraser.
7
8         Ensure that the tile cache retrieves repaint rects from the tile layer,
9         not from the tiled backing layer.
10
11         * platform/graphics/ca/PlatformCALayer.h:
12         * platform/graphics/ca/mac/PlatformCALayerMac.h:
13         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
14         (PlatformCALayerMac::enumerateRectsBeingDrawn):
15         Allow the PlatformCALayer to decide how to enumerate rects to paint.
16
17         * WebCore.exp.in:
18         * platform/graphics/mac/WebLayer.h:
19         Add RepaintRectList, remove some unnecessary WebCore::s.
20
21         * platform/graphics/mac/WebLayer.mm:
22         (WebCore::collectRectsToPaint):
23         Factor collectRectsToPaint out; it just grabs the rects from
24         the layer and makes the decision whether to repaint the bounds
25         of the dirty region or just the subregions.
26
27         Move calls to collectRectsToPaint() to callers of drawLayerContents(),
28         so that TileController can collect rects from the appropriate source
29         (the Tile layer) and other layers just continue grabbing them from
30         their relevant layers.
31
32         Make sure that the list that comes from collectRectsToPaint() always
33         has at least one rect in it (appending the clip bounds if we don't
34         want to repaint subregions) so we can simplify logic in drawLayerContents.
35
36         (WebCore::drawLayerContents):
37         Remove code to support CompositingCoordinatesBottomUp, as it's only
38         used on Windows, so this Mac-specific code doesn't need to support it.
39
40         Simplify logic given that dirtyRects will always be non-empty.
41
42         (-[WebLayer drawInContext:]):
43         (-[WebSimpleLayer setNeedsDisplayInRect:]):
44         * platform/graphics/ca/mac/TileController.mm:
45         (WebCore::TileController::platformCALayerPaintContents):
46         Adopt collectRectsToPaint.
47
48 2013-11-08  Anders Carlsson  <andersca@apple.com>
49
50         Implement more KeyedEncoder functionality
51         https://bugs.webkit.org/show_bug.cgi?id=124089
52
53         Reviewed by Beth Dakin.
54
55         * bindings/js/SerializedScriptValue.h:
56         * history/HistoryItem.cpp:
57         (WebCore::HistoryItem::encodeBackForwardTreeNode):
58         * platform/KeyedCoding.h:
59         (WebCore::KeyedEncoder::encodeConditionalObject):
60
61 2013-11-08  Eric Carlson  <eric.carlson@apple.com>
62
63         getCueAsHTML() on an empty cue should return a document fragment
64         https://bugs.webkit.org/show_bug.cgi?id=124084
65
66         Reviewed by Darin Adler.
67
68         Test: media/track/track-cue-empty-cue-text.html
69
70         * html/track/WebVTTParser.cpp:
71         (WebCore::WebVTTParser::createDocumentFragmentFromCueText): Don't return early when the
72             passed an empty string.
73
74 2013-11-08  Anders Carlsson  <andersca@apple.com>
75
76         KeyedEncoder should be able to encoder objects
77         https://bugs.webkit.org/show_bug.cgi?id=124085
78
79         Reviewed by Sam Weinig.
80
81         * history/HistoryItem.cpp:
82         (WebCore::HistoryItem::encodeBackForwardTree):
83         Encode the root object.
84
85         (WebCore::HistoryItem::encodeBackForwardTreeNode):
86         Encode the target.
87
88         * history/HistoryItem.h:
89         Add new members.
90
91         * platform/KeyedCoding.h:
92         (WebCore::KeyedEncoder::encodeObject):
93         Call beginObject, call the functor and then call endObject().
94
95 2013-11-08  Sam Weinig  <sam@webkit.org>
96
97         Teach CanvasObserver about references
98         https://bugs.webkit.org/show_bug.cgi?id=124082
99
100         Reviewed by Anders Carlsson.
101
102         * css/CSSCanvasValue.cpp:
103         * css/CSSCanvasValue.h:
104         * html/HTMLCanvasElement.cpp:
105         * html/HTMLCanvasElement.h:
106
107 2013-11-08  Anders Carlsson  <andersca@apple.com>
108
109         Begin stubbing out a KeyedEncoder class in WebCore
110         https://bugs.webkit.org/show_bug.cgi?id=124079
111
112         Reviewed by Sam Weinig.
113
114         * WebCore.exp.in:
115         Add symbol needed by WebCore.
116
117         * WebCore.xcodeproj/project.pbxproj:
118         Add new header file.
119
120         * history/HistoryItem.cpp:
121         (WebCore::HistoryItem::encodeBackForwardTree):
122         * history/HistoryItem.h:
123         Add an encodeBackForwardTree overload that takes a KeyedEncoder object. Encode the version.
124
125         * platform/KeyedCoding.h:
126         Add a KeyedEncoder class that just has a single encodeUInt32 member function for now.
127
128 2013-11-08  Brady Eidson  <beidson@apple.com>
129
130         Merge IDBTransactionBackendInterface and IDBTransactionBackendImpl
131         https://bugs.webkit.org/show_bug.cgi?id=124077
132
133         Reviewed by Alexey Proskuryakov.
134
135         The abstraction is no longer needed.
136
137         * CMakeLists.txt:
138         * GNUmakefile.list.am:
139         * WebCore.xcodeproj/project.pbxproj:
140
141         * Modules/indexeddb/IDBTransactionBackendInterface.h: Removed.
142
143         * Modules/indexeddb/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp.
144         * Modules/indexeddb/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.h.
145
146         * Modules/indexeddb/IDBBackingStoreInterface.h:
147         * Modules/indexeddb/IDBCursorBackend.cpp:
148         * Modules/indexeddb/IDBCursorBackend.h:
149         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
150         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
151         * Modules/indexeddb/IDBFactoryBackendInterface.h:
152         * Modules/indexeddb/IDBTransactionBackendOperations.h:
153         * Modules/indexeddb/IDBTransactionCoordinator.cpp:
154         * Modules/indexeddb/IDBTransactionCoordinator.h:
155         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
156         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
157         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
158         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
159
160 2013-11-08  Simon Fraser  <simon.fraser@apple.com>
161
162         REGRESSION (r155660): Some Etherpad pages not scrollable with overlay scrollbars
163         https://bugs.webkit.org/show_bug.cgi?id=124075
164
165         Reviewed by Beth Dakin.
166         
167         In r155660 I removed some scrollbar-related layouts when scrollbars
168         are in overlay mode.
169         
170         However, ScrollView::updateScrollbars() has a case where we still need
171         to do multiple pases, related to its "Never ever try to both gain/lose a
172         scrollbar in the same pass" comment. When we avoid making a new scrollbar
173         because the other was removed, we need to do another pass to bring the
174         correct scrollbar back.
175
176         Can't test overlay scrollbars in tests.
177
178         * platform/ScrollView.cpp:
179         (WebCore::ScrollView::updateScrollbars):
180
181 2013-11-08  Hans Muller  <hmuller@adobe.com>
182
183         [CSS Shapes] Image valued shape-outside that extends vertically into the margin-box is top-clipped
184         https://bugs.webkit.org/show_bug.cgi?id=123769
185
186         Reviewed by Dirk Schulze.
187
188         Remove the assumption that Y coordinates are >= 0 from the RasterShapeIntervals class
189         and correct its computeShapeMarginIntervals() method. The computeShapeMarginIntervals()
190         method now generates intervals with Y coordinates that begin at the image shape's
191         bounds.y - shape-margin, which may be less than 0.
192
193         The RasterShapeIntervals::intervalsAt() method now offsets its Y coordinate parameter
194         by the shape-margin. A non-const overload of the method was added to centralize all
195         access to m_intervalLists.
196
197         Test: fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-004.html
198               fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-005.html
199
200         * rendering/shapes/RasterShape.cpp:
201         (WebCore::MarginIntervalGenerator::intervalAt): Don't clip X coordinates to 0 since they can extend into the margin-box.
202         (WebCore::RasterShapeIntervals::appendInterval): Use the non-const intervalsAt() method.
203         (WebCore::RasterShapeIntervals::uniteMarginInterval): Ditto.
204         (WebCore::RasterShapeIntervals::computeShapeMarginIntervals): See above.
205         * rendering/shapes/RasterShape.h:
206         (WebCore::RasterShapeIntervals::RasterShapeIntervals): Added a field for the margin.
207         (WebCore::RasterShapeIntervals::intervalsAt): Offset y coordinates by the margin; added a non-const overload.
208
209 2013-11-08  Piotr Grad  <p.grad@samsung.com>
210
211         Ended event should work also when playback rate is negative
212         https://bugs.webkit.org/show_bug.cgi?id=123879
213
214         Reviewed by Eric Carlson.
215
216         According to W3C specification playback is ended also when playback rate is
217         negative and position is the earliest possible position.
218
219         Test: media/video-ended-event-negative-playback.html
220
221         * html/HTMLMediaElement.cpp:
222         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
223
224 2013-11-08  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
225
226         Checking for TypeError in RTCPeerConnection object creation
227         https://bugs.webkit.org/show_bug.cgi?id=124049
228
229         Reviewed by Eric Carlson.
230
231         If invalid parameters are passed on RTCPeerConnection creation we must throw a TypeError exception.
232         According to the spec it requires a Dictionary argument, the RTCConfiguration, which is mandatory.
233
234         Please notice that this patch does not make every tests run as expected,
235         RTCPeerConnectionHandlerMock needs to be update to deal with contraints.
236
237         Existing tests were updated.
238
239         * GNUmakefile.list.am:
240         * Modules/mediastream/RTCPeerConnection.idl:
241         * UseJSC.cmake:
242         * WebCore.vcxproj/WebCore.vcxproj:
243         * WebCore.vcxproj/WebCore.vcxproj.filters:
244         * WebCore.xcodeproj/project.pbxproj:
245         * bindings/js/JSRTCPeerConnectionCustom.cpp: Added.
246         (WebCore::JSRTCPeerConnectionConstructor::constructJSRTCPeerConnection):
247
248 2013-11-08  Bem Jones-Bey  <bjonesbe@adobe.com>
249
250         Use references instead of pointers to RenderBlockFlow in FloatingObjects and ComputeFloatOffsetAdapter
251         https://bugs.webkit.org/show_bug.cgi?id=124074
252
253         Reviewed by Sam Weinig.
254
255         Just a straightforward conversion from const pointers to const references.
256
257         Also, remove unneeded argument from FloatingObjects constructor.
258
259         No new tests, no behavior change.
260
261         * rendering/FloatingObjects.cpp:
262         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
263         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelow):
264         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelowForBlock):
265         (WebCore::FloatingObjects::FloatingObjects):
266         (WebCore::FloatingObjects::clearLineBoxTreePointers):
267         (WebCore::FloatingObjects::computePlacedFloatsTree):
268         (WebCore::shapeInfoForFloat):
269         (WebCore::::updateOffsetIfNeeded):
270         (WebCore::::collectIfNeeded):
271         (WebCore::::heightRemaining):
272         * rendering/FloatingObjects.h:
273         * rendering/RenderBlockFlow.cpp:
274         (WebCore::RenderBlockFlow::createFloatingObjects):
275
276 2013-11-08  Sam Weinig  <sam@webkit.org>
277
278         Teach SubframeLoader a bit about references
279         https://bugs.webkit.org/show_bug.cgi?id=124076
280
281         Reviewed by Anders Carlsson.
282
283         * html/HTMLAppletElement.cpp:
284         * html/HTMLFrameElementBase.cpp:
285         * html/HTMLMediaElement.cpp:
286         * loader/SubframeLoader.cpp:
287         * loader/SubframeLoader.h:
288
289 2013-11-08  Brady Eidson  <beidson@apple.com>
290
291         Blind Windows build-fix attempt after r158959
292
293         * WebCore.vcxproj/WebCore.vcxproj:
294
295 2013-11-08  Brady Eidson  <beidson@apple.com>
296
297         Merge IDBCursorBackendInterface and IDBCursorBackendImpl
298         https://bugs.webkit.org/show_bug.cgi?id=124068
299
300         Reviewed by Anders Carlsson.
301
302         * CMakeLists.txt:
303         * GNUmakefile.list.am:
304         * WebCore.xcodeproj/project.pbxproj:
305
306         * Modules/indexeddb/IDBCursorBackendInterface.h: Removed.
307
308         * Modules/indexeddb/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.cpp.
309         * Modules/indexeddb/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendImpl.h.
310
311         * Modules/indexeddb/IDBCallbacks.h:
312         * Modules/indexeddb/IDBCursor.cpp:
313         * Modules/indexeddb/IDBCursor.h:
314         * Modules/indexeddb/IDBCursorWithValue.cpp:
315         * Modules/indexeddb/IDBCursorWithValue.h:
316         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
317         * Modules/indexeddb/IDBFactoryBackendInterface.h:
318         * Modules/indexeddb/IDBRequest.cpp:
319         * Modules/indexeddb/IDBRequest.h:
320         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
321         * Modules/indexeddb/IDBTransactionBackendImpl.h:
322         * Modules/indexeddb/IDBTransactionBackendInterface.h:
323         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
324         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
325         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
326
327 2013-11-08  Sam Weinig  <sam@webkit.org>
328
329         Modernize FrameLoader a bit
330         https://bugs.webkit.org/show_bug.cgi?id=124073
331
332         Reviewed by Anders Carlsson.
333
334         * loader/FrameLoader.cpp:
335         * loader/FrameLoader.h:
336         Use std::unique_ptrs rather than OwnPtrs.
337
338         * loader/MixedContentChecker.cpp:
339         * loader/MixedContentChecker.h:
340         Switch to hold a Frame& rather than Frame*.
341
342 2013-11-08  Zan Dobersek  <zdobersek@igalia.com>
343
344         Remove code guarded with ENABLE(STREAM)
345         https://bugs.webkit.org/show_bug.cgi?id=123667
346
347         Reviewed by Anders Carlsson.
348
349         Remove ENABLE(STREAM)-guarded code. This was added in the effort to provide Stream API support, but
350         no port enables the feature and the work on this feature has wound down after the Chromium port forked,
351         leaving this code unmaintained.
352
353         * fileapi/FileReaderLoader.cpp:
354         * fileapi/FileReaderLoader.h:
355
356 2013-11-08  Bem Jones-Bey  <bjonesbe@adobe.com>
357
358         RenderBlockFlow::nextFloatLogicalBottomBelow should not use ShapeOutsideFloatOffsetMode
359         https://bugs.webkit.org/show_bug.cgi?id=123931
360
361         Reviewed by Sam Weinig.
362
363         Rewrite nextFloatLogicalBottomBelow to use the placed floats tree for
364         the search and to not need ShapeOutsideFloatOffsetMode anymore. This
365         moves almost all of the logic into FloatingObjects, making a small
366         reduction in the amount that RenderBlockFlow needs to know about the
367         implementation of FloatingObjects.
368
369         In addition, change ComputeFloatOffsetAdapter to take in LayoutUnits
370         and roundToInt itself so that all of it's callers can be simplified.
371
372         No new tests, no new behavior.
373
374         * rendering/FloatingObjects.cpp:
375         (WebCore::rangesIntersect):
376         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
377         (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
378         (WebCore::FindNextFloatLogicalBottomAdapter::lowValue):
379         (WebCore::FindNextFloatLogicalBottomAdapter::highValue):
380         (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom):
381         (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom):
382         (WebCore::FindNextFloatLogicalBottomAdapter::collectIfNeeded):
383         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelow):
384         (WebCore::FloatingObjects::findNextFloatLogicalBottomBelowForBlock):
385         (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat):
386         (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat):
387         (WebCore::FloatingObjects::logicalLeftOffset):
388         (WebCore::FloatingObjects::logicalRightOffset):
389         * rendering/FloatingObjects.h:
390         * rendering/LineWidth.cpp:
391         (WebCore::LineWidth::fitBelowFloats):
392         * rendering/RenderBlockFlow.cpp:
393         (WebCore::RenderBlockFlow::nextFloatLogicalBottomBelow):
394         (WebCore::RenderBlockFlow::nextFloatLogicalBottomBelowForBlock):
395         (WebCore::RenderBlockFlow::getClearDelta):
396         * rendering/RenderBlockFlow.h:
397
398 2013-11-08  Alexey Proskuryakov  <ap@apple.com>
399
400         https://bugs.webkit.org/show_bug.cgi?id=124064
401         Some WebCrypto files are not in correct directories
402
403         Rubber-stamped by Anders Carlsson.
404
405         * WebCore.xcodeproj/project.pbxproj:
406         * crypto/CryptoAlgorithmAesCbcParams.h: Removed.
407         * crypto/CryptoAlgorithmAesKeyGenParams.h: Removed.
408         * crypto/CryptoKeyAES.cpp: Removed.
409         * crypto/CryptoKeyAES.h: Removed.
410         * crypto/CryptoKeyMac.cpp: Removed.
411         * crypto/keys/CryptoKeyAES.cpp: Copied from Source/WebCore/crypto/CryptoKeyAES.cpp.
412         * crypto/keys/CryptoKeyAES.h: Copied from Source/WebCore/crypto/CryptoKeyAES.h.
413         * crypto/mac/CryptoKeyMac.cpp: Copied from Source/WebCore/crypto/CryptoKeyMac.cpp.
414         * crypto/parameters/CryptoAlgorithmAesCbcParams.h: Copied from Source/WebCore/crypto/CryptoAlgorithmAesCbcParams.h.
415         * crypto/parameters/CryptoAlgorithmAesKeyGenParams.h: Copied from Source/WebCore/crypto/CryptoAlgorithmAesKeyGenParams.h.
416
417 2013-11-08  Alexey Proskuryakov  <ap@apple.com>
418
419         Implement JWK key import for HMAC and AES-CBC
420         https://bugs.webkit.org/show_bug.cgi?id=124059
421
422         Reviewed by Anders Carlsson.
423
424         Tests: crypto/subtle/aes-cbc-import-jwk.html
425                crypto/subtle/hmac-import-jwk.html
426                crypto/subtle/import-jwk.html
427
428         WebCrypto supports multiple key formats - raw, pkcs8, spki, jwk. The design is that
429         we'll transform these into parsed KeyData subclasses before passing to algorithms.
430
431         CryptoKeySerialization is a base class for handling all these formats.
432
433         * WebCore.xcodeproj/project.pbxproj: Added new files. Removed CryptoKeyFormat.h.
434         
435         * bindings/js/JSCryptoKeySerializationJWK.h: Added.
436         * bindings/js/JSCryptoKeySerializationJWK.cpp: Added.
437         (WebCore::getStringFromJSON): A helper. Note that we can rely on the object being
438         a nice freshly parsed JSON, no getters or anything.
439         (WebCore::getBooleanFromJSON): Ditto.
440         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
441         (WebCore::JSCryptoKeySerializationJWK::~JSCryptoKeySerializationJWK):
442         (WebCore::createHMACParameters): A simple helper.
443         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm): WebCrypto API is weird,
444         you can have algorithm parameters both inside a JWK key and passed as importKey()
445         arguments. They need to agree, whatever that means for specific serialization's
446         algorithm options (not all necessarily have a 1-1 matching to WebCrypto).
447         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages): Take an intersection of usages.
448         (WebCore::JSCryptoKeySerializationJWK::reconcileExtractable): Only extractable if
449         both JWK and the caller agree.
450         (WebCore::JSCryptoKeySerializationJWK::keySizeIsValid): Verify validity of JWK key.
451         (WebCore::JSCryptoKeySerializationJWK::keyData): Return an appropriate KeyData
452         subclass.
453
454         * bindings/js/JSSubtleCryptoCustom.cpp:
455         (WebCore::ENUM_CLASS): Moved CryptoKeyFormat here.
456         (WebCore::cryptoKeyFormatFromJSValue): Added a human readable string to an exception.
457         (WebCore::JSSubtleCrypto::importKey): Support multiple key formats, not just raw.
458
459         * crypto/CryptoAlgorithm.cpp: (WebCore::CryptoAlgorithm::importKey):
460         * crypto/CryptoAlgorithm.h:
461         Updated signature for importKey to one that makes more sense. Decoding formats all
462         the way from a binary blob is not something that CryptoAlgorithm subclasses should
463         do, we now pass a KeyData subclass instead.
464         Removed exportKey/wrapKey/unwrapKey altogether, because I don't yet know what the
465         signatures will be.
466
467         * crypto/CryptoKeyData.h: Added.
468         (WebCore::CryptoKeyData::ENUM_CLASS):
469         (WebCore::CryptoKeyData::CryptoKeyData):
470         (WebCore::CryptoKeyData::~CryptoKeyData):
471         (WebCore::CryptoKeyData::format):
472         A base class for passing key material to algorithms. Currently, only one type is
473         supported, that being OctetSequence for secret keys. Keys for RSA and EC are more
474         complicated, and secret/public ones are different too.
475
476         * crypto/CryptoKeyFormat.h: Removed. There are too many key format classes
477         confusingly floating around, and this was only needed in one file for parsing.
478
479         * crypto/CryptoKeySerialization.h: Added.
480         Base class for handling raw/pkcs8/spki/jwk keys.
481
482         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
483         (WebCore::CryptoAlgorithmAES_CBC::importKey):
484         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
485         Updated to use CryptoKeyData.
486
487         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
488         (WebCore::CryptoAlgorithmHMAC::importKey):
489         * crypto/algorithms/CryptoAlgorithmHMAC.h:
490         Updated to use CryptoKeyData.
491
492         * crypto/keys/CryptoKeyDataOctetSequence.cpp: Added.
493         (WebCore::CryptoKeyDataOctetSequence::CryptoKeyDataOctetSequence):
494         (WebCore::CryptoKeyDataOctetSequence::~CryptoKeyDataOctetSequence):
495         * crypto/keys/CryptoKeyDataOctetSequence.h: Added.
496         (WebCore::asCryptoKeyDataOctetSequence):
497         * crypto/keys/CryptoKeySerializationRaw.cpp: Added.
498         (WebCore::CryptoKeySerializationRaw::CryptoKeySerializationRaw):
499         (WebCore::CryptoKeySerializationRaw::~CryptoKeySerializationRaw):
500         (WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
501         (WebCore::CryptoKeySerializationRaw::reconcileUsages):
502         (WebCore::CryptoKeySerializationRaw::reconcileExtractable):
503         (WebCore::CryptoKeySerializationRaw::keyData):
504         * crypto/keys/CryptoKeySerializationRaw.h: Added.
505         Much code to pass around a Vector<char>.
506
507 2013-11-08  Mark Lam  <mark.lam@apple.com>
508
509         Move breakpoint (and exception break) functionality into JSC::Debugger.
510         https://bugs.webkit.org/show_bug.cgi?id=121796.
511
512         Reviewed by Geoffrey Garen.
513
514         No new tests.
515
516         - In ScriptDebugServer and JSC::Debugger, SourceID and BreakpointID are
517           now numeric tokens.
518
519         - JSC::Debugger now tracks user defined breakpoints in a JSC::Breakpoint
520           record. Previously, this info is tracked in the ScriptBreakpoint record
521           in ScriptDebugServer. The only element of ScriptBreakpoint that is not
522           being tracked by JSC::Breakpoint is the ScriptBreakpointAction.
523              The ScriptBreakpointAction is still tracked by the ScriptDebugServer
524           in a list keyed on the corresponding BreakpointID.
525              The ScriptBreakpoint record is now only used as a means of passing
526           breakpoint paramaters to the ScriptDebugServer.
527
528         - ScriptDebugServer now no longer accesses the JSC::CallFrame* directly.
529           It always goes through the DebuggerCallFrame.
530
531         * GNUmakefile.list.am:
532         * WebCore.vcxproj/WebCore.vcxproj:
533         * WebCore.vcxproj/WebCore.vcxproj.filters:
534         * WebCore.xcodeproj/project.pbxproj:
535         * bindings/js/BreakpointID.h: Added.
536         * bindings/js/ScriptDebugServer.cpp:
537         (WebCore::ScriptDebugServer::ScriptDebugServer):
538         (WebCore::ScriptDebugServer::setBreakpoint):
539         (WebCore::ScriptDebugServer::removeBreakpoint):
540         (WebCore::ScriptDebugServer::clearBreakpoints):
541         (WebCore::ScriptDebugServer::dispatchDidPause):
542         (WebCore::ScriptDebugServer::dispatchDidContinue):
543         (WebCore::ScriptDebugServer::dispatchDidParseSource):
544         (WebCore::ScriptDebugServer::notifyDoneProcessingDebuggerEvents):
545         (WebCore::ScriptDebugServer::needPauseHandling):
546         (WebCore::ScriptDebugServer::handleBreakpointHit):
547         (WebCore::ScriptDebugServer::handleExceptionInBreakpointCondition):
548         (WebCore::ScriptDebugServer::handlePause):
549         * bindings/js/ScriptDebugServer.h:
550         * bindings/js/SourceID.h: Added.
551         * bindings/js/WorkerScriptDebugServer.cpp:
552         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
553         * bindings/js/WorkerScriptDebugServer.h:
554         * inspector/InspectorDebuggerAgent.cpp:
555         (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
556         (WebCore::parseLocation):
557         (WebCore::InspectorDebuggerAgent::setBreakpoint):
558         (WebCore::InspectorDebuggerAgent::continueToLocation):
559         (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
560         (WebCore::InspectorDebuggerAgent::searchInContent):
561         (WebCore::InspectorDebuggerAgent::getScriptSource):
562         (WebCore::InspectorDebuggerAgent::didParseSource):
563         (WebCore::InspectorDebuggerAgent::didPause):
564         (WebCore::InspectorDebuggerAgent::clear):
565         * inspector/InspectorDebuggerAgent.h:
566         * inspector/ScriptDebugListener.h:
567
568 2013-11-08  László Langó  <lango@inf.u-szeged.hu>
569
570         InspectorConsoleAgent::didFinishXHRLoading ConsoleMessage should include a column number
571         https://bugs.webkit.org/show_bug.cgi?id=114316
572
573         Reviewed by Timothy Hatcher.
574
575         InspectorConsoleAgent::didFinishXHRLoading creates a ConsoleMessage with a line number, 
576         but it should also include a column number. It looks like ultimately the line number comes from
577         JSXMLHttpRequest::send, it should also be possible to get the column number at the time.
578         The column number would be needed by the Web Inspector to jump to the proper place in source code 
579         to show where the XHR originated from.
580
581         * bindings/js/JSXMLHttpRequestCustom.cpp:
582         (WebCore::SendFunctor::SendFunctor):
583         (WebCore::SendFunctor::column):
584         (WebCore::SendFunctor::operator()):
585         (WebCore::JSXMLHttpRequest::send):
586         * inspector/InspectorConsoleAgent.cpp:
587         (WebCore::InspectorConsoleAgent::didFinishXHRLoading):
588         * inspector/InspectorConsoleAgent.h:
589         * inspector/InspectorInstrumentation.cpp:
590         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
591         * inspector/InspectorInstrumentation.h:
592         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
593         * xml/XMLHttpRequest.cpp:
594         (WebCore::XMLHttpRequest::XMLHttpRequest):
595         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber):
596         (WebCore::XMLHttpRequest::didFinishLoading):
597         * xml/XMLHttpRequest.h:
598
599 2013-11-08  Simon Fraser  <simon.fraser@apple.com>
600
601         Left sidebar on cubic-bezier.com flickers
602         https://bugs.webkit.org/show_bug.cgi?id=123128
603
604         Reviewed by Dean Jackson.
605         
606         The logic that determined whether position:fixed elements outside the viewport
607         should be composited was incorrect if the fixed element also had a transform.
608         
609         layer.calculateLayerBounds() only takes into account painted transforms (since they
610         affect layer bounds). So we need to compute the bounds relative to the layer
611         itself, then use localToContainerQuad() to map them to document coordinates,
612         but only to the RenderView so that we don't hit the page scale transform.
613
614         Tests: compositing/layer-creation/fixed-position-transformed-into-view.html
615                compositing/layer-creation/fixed-position-transformed-outside-view.html
616
617         * rendering/RenderLayerCompositor.cpp:
618         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
619
620 2013-11-08  Martin Robinson  <mrobinson@igalia.com>
621
622         [MathML] Center of stretched curly bracket not always vertically centered
623         https://bugs.webkit.org/show_bug.cgi?id=123715
624
625         Reviewed by Brent Fulgham.
626
627         * rendering/mathml/RenderMathMLOperator.cpp:
628         (WebCore::RenderMathMLOperator::fillWithExtensionGlyph): Update an assertion and
629         handle the case where two glyph pieces abut.
630         (WebCore::RenderMathMLOperator::paint): Do not offset the center glyph by y().
631
632 2013-10-30  Jer Noble  <jer.noble@apple.com>
633
634         [MSE] Bring SourceBuffer.append up to the most recent spec.
635         https://bugs.webkit.org/show_bug.cgi?id=123377
636
637         Reviewed by Eric Carlson.
638
639         Test: media/media-source/media-source-append-failed.html
640
641         Bring the MediaSource append() implementation up to the current spec.
642
643         * Modules/mediasource/SourceBuffer.cpp:
644         (WebCore::SourceBuffer::appendBufferInternal):
645         (WebCore::SourceBuffer::appendBufferTimerFired):
646         * platform/graphics/SourceBufferPrivate.h:
647         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
648         (WebCore::MockSourceBufferPrivate::append):
649         (WebCore::MockSourceBufferPrivate::evictCodedFrames):
650         (WebCore::MockSourceBufferPrivate::isFull):
651         * platform/mock/mediasource/MockSourceBufferPrivate.h:
652
653 2013-11-07  Jer Noble  <jer.noble@apple.com>
654
655         [Mac] Crash at com.apple.WebCore: WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange + 26
656         https://bugs.webkit.org/show_bug.cgi?id=124031
657
658         Reviewed by Eric Carlson.
659
660         WTF::bind() causes errors when given a bare id pointer as a parameter,
661         when that parameter is casted to a specific NS type pointer (in this
662         case, a NSArray*) in order to pass it as a parameter to the bound
663         function.
664
665         Instead of passing around bare id pointers, wrap them in RetainPtr<>
666         objects before passing them to WTF::bind().
667
668         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
669         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
670         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
671         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
672         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
673         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
674
675 2013-11-08  Antti Koivisto  <antti@apple.com>
676
677         Templated LChar/UChar paths for simple line layout
678         https://bugs.webkit.org/show_bug.cgi?id=124035
679
680         Reviewed by Andreas Kling.
681
682         * rendering/SimpleLineLayout.cpp:
683         (WebCore::SimpleLineLayout::canUseForText):
684         (WebCore::SimpleLineLayout::canUseFor):
685         
686             Use a templated function to check for illegal characters.
687
688         (WebCore::SimpleLineLayout::skipWhitespaces):
689         
690             Make a template function.
691
692         (WebCore::SimpleLineLayout::textWidth):
693         
694             Make a template function plus some argument changes.
695
696         (WebCore::SimpleLineLayout::createTextRuns):
697         
698             Template function for creating runs while operating with either LChars or UChar.
699             Also simplified line breaking and text width measuring logic.
700
701         (WebCore::SimpleLineLayout::create):
702         
703             Pick the template.
704
705         * rendering/break_lines.cpp:
706         * rendering/break_lines.h:
707         
708             Move the implementation to the header (except for the table) so we can use the template
709             versions directly.
710
711         (WebCore::isBreakableSpace):
712         (WebCore::shouldBreakAfter):
713         (WebCore::needsLineBreakIterator):
714         (WebCore::nextBreakablePosition):
715         (WebCore::nextBreakablePositionIgnoringNBSP):
716
717 2013-11-08  Mario Sanchez Prada  <mario.prada@samsung.com>
718
719         AX: [ATK] <span> elements exposed through ATK when not needed
720         https://bugs.webkit.org/show_bug.cgi?id=123885
721
722         Reviewed by Chris Fleizach.
723
724         As per SVN r158195, the way it's decided whether <span> elements
725         should be ignored or not has slightly changed, causing that the
726         GTK/EFL ports expose them in cases that they should be ignored,
727         such as for text elements that neither are focusable (e.g. by
728         explicitly setting tabindex) nor have a meaningful accessible name
729         suggesting they should be exposed.
730
731         As a result, the flattening that ATK based ports normally do for
732         this kind of elements (by folding them into their parents) do not
733         work correctly anymore, making two tests to fail:
734
735             platform/gtk/accessibility/spans-paragraphs-and-divs.html
736             platform/gtk/accessibility/spans.html
737
738         This patch encapsulates the part of the logic that affects this in
739         the computeAccessibilityIsIgnored() method, placing it in a
740         new method of AccessibilityObject that we can call from ATK's
741         accessibilityPlatformIncludesObject() to ensure we hide those
742         <span> elements when they don't fulfill those requirements.
743
744         * accessibility/AccessibilityObject.cpp:
745         (WebCore::AccessibilityObject::hasAttributesRequiredForInclusion):
746         New virtual method encapsulating part of the logic from the function
747         that computes whether accessibility should be ignored or not.
748         * accessibility/AccessibilityObject.h:
749
750         * accessibility/AccessibilityNodeObject.cpp:
751         (WebCore::AccessibilityNodeObject::hasAttributesRequiredForInclusion):
752         Override of the new method adding additional checks, as extracted from
753         the original bits in computeAccessibilityIsIgnored().
754         * accessibility/AccessibilityNodeObject.h:
755
756         * accessibility/AccessibilityRenderObject.cpp:
757         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
758         Use the newly added function where we had the original code before.
759
760         * accessibility/atk/AccessibilityObjectAtk.cpp:
761         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
762         Make sure <span> elements are ignored if they are not focusable
763         and they don't have a meaningful accessible name.
764
765 2013-11-08  Carlos Garcia Campos  <cgarcia@igalia.com>
766
767         [GTK] Add missing symbols to WebKitDOMEventTarget.symbols
768         https://bugs.webkit.org/show_bug.cgi?id=123990
769
770         Reviewed by Philippe Normand.
771
772         Add webkit_dom_event_target_add_event_listener_with_closure and
773         webkit_dom_event_target_remove_event_listener_with_closure to the
774         symbols files.
775
776         * bindings/gobject/WebKitDOMEventTarget.symbols:
777         * bindings/gobject/webkitdom.symbols:
778
779 2013-11-07  Carlos Garcia Campos  <cgarcia@igalia.com>
780
781         [GTK] Use deprecation guards around deprecated API in GObject DOM bindings
782         https://bugs.webkit.org/show_bug.cgi?id=123899
783
784         Reviewed by Martin Robinson.
785
786         Do not include deprecated API when compiling with
787         WEBKIT_DISABLE_DEPRECATED option.
788
789         * bindings/scripts/CodeGeneratorGObject.pm:
790         (GenerateFunction):
791         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
792         * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h:
793
794 2013-11-07  Brady Eidson  <beidson@apple.com>
795
796         Enhance SQL journal_mode setting code to be less likely to log an error.
797         <rdar://problem/15418577> and https://bugs.webkit.org/show_bug.cgi?id=124018
798
799         Reviewed by Anders Carlsson.
800
801         Even though the docs says SQLITE_ROW will always be returned, apparently SQLITE_OK is sometimes returned.
802         Change the code to handle that.
803
804         * platform/sql/SQLiteDatabase.cpp:
805         (WebCore::SQLiteDatabase::open): Save the statement result value, and accept SQLITE_OK as a non-error condition.
806
807 2013-11-07  Brady Eidson  <beidson@apple.com>
808
809         Update an out-dated ASSERT in IconDatabase code.
810         <rdar://problem/15171118> and https://bugs.webkit.org/show_bug.cgi?id=124030.
811
812         Reviewed by Andreas Kling.
813
814         With the asynchronous interfaces that have been added and the support for WK2 that has been added, 
815         this ASSERT can incorrectly fire if an icon is asked for before database cleanup is allowed.
816
817         * loader/icon/IconDatabase.cpp:
818         (WebCore::IconDatabase::synchronousIconForPageURL): Update an invalid ASSERT.
819
820 2013-11-07  Andreas Kling  <akling@apple.com>
821
822         RenderSVGResource helpers should take RenderStyle by const reference.
823         <https://webkit.org/b/124029>
824
825         Take const RenderStyle& instead of RenderStyle* in a few more places
826         so we can get rid of some ampersands and assertions.
827
828         Reviewed by Anders Carlsson.
829
830 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
831
832         [AX] Generate toAccessibilityTableRow|Column|Cell to detect bad type casts
833         https://bugs.webkit.org/show_bug.cgi?id=123984
834
835         Reviewed by Mario Sanchez Prada.
836
837         As a step to let static_cast<> use TYPE_CASTS_BASE, AccessibilityTableRow|Column|Cell use
838         ACCESSIBILITY_OBJECT_TYPE_CASTS which can support more helper functions rather than manual
839         static_cast<>. This change will help to detect bad type casts further.
840
841         No new tests, no behavior changes.
842
843         * accessibility/AccessibilityARIAGrid.cpp:
844         (WebCore::AccessibilityARIAGrid::addTableCellChild):
845         (WebCore::AccessibilityARIAGrid::addChildren):
846         * accessibility/AccessibilityARIAGridCell.cpp:
847         (WebCore::AccessibilityARIAGridCell::rowIndexRange):
848         * accessibility/AccessibilityTable.cpp:
849         (WebCore::AccessibilityTable::addChildren):
850         (WebCore::AccessibilityTable::rowHeaders):
851         (WebCore::AccessibilityTable::columnHeaders):
852         (WebCore::AccessibilityTable::cellForColumnAndRow):
853         * accessibility/AccessibilityTableCell.h:
854         * accessibility/AccessibilityTableColumn.h:
855         * accessibility/AccessibilityTableRow.cpp:
856         (WebCore::AccessibilityTableRow::headerObject):
857         * accessibility/AccessibilityTableRow.h:
858         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
859         (cellAtIndex):
860         (webkitAccessibleTableGetColumnHeader):
861         (webkitAccessibleTableGetRowHeader):
862         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
863         (-[WebAccessibilityObjectWrapper tableCellParent]):
864         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
865         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
866
867 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
868
869         REGRESSION (r154375): Image is oriented incorrectly
870         https://bugs.webkit.org/show_bug.cgi?id=123831
871
872         Reviewed by Antonio Gomes.
873
874         r154375 made that shouldRespectImageOrientation() isn't used by drawImage().
875         It causes an image isn't oriented correctly. This patch sets shouldRespectImageOrientation()
876         value by default.
877
878         * rendering/RenderImage.cpp:
879         (WebCore::RenderImage::paintReplaced):
880         (WebCore::RenderImage::paintIntoRect):
881
882 2013-11-07  Hans Muller  <hmuller@adobe.com>
883
884         [CSS Shapes] Image shape-outside with vertical gaps is handled incorrectly
885         https://bugs.webkit.org/show_bug.cgi?id=123934
886
887         Reviewed by Andreas Kling.
888
889         RasterShapeIntervals::getExcludedIntervals() was returning an empty
890         list when the line overlapped any vertical gap in the image. This short-circuit
891         had been mistakenly copied from getIncludedIntervals(), where it makes sense.
892
893         Test: fast/shapes/shape-outside-floats/shape-outside-floats-image-vgap.html
894
895         * rendering/shapes/RasterShape.cpp:
896         (WebCore::RasterShapeIntervals::getExcludedIntervals):
897
898 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
899
900         Make contents layer borders more visible
901         https://bugs.webkit.org/show_bug.cgi?id=124025
902
903         Reviewed by Tim Horton.
904
905         Layer borders for contents layers are impossible to see when the
906         contentsLayer has the same bounds as its parent; make the contents
907         layer border 4px thick to make it more visible.
908
909         * platform/graphics/ca/GraphicsLayerCA.cpp:
910         (WebCore::GraphicsLayerCA::setupContentsLayer):
911
912 2013-11-07  Andreas Kling  <akling@apple.com>
913
914         InlineFlowBox always has a RenderBoxModelObject, take advantage.
915         <https://webkit.org/b/124024>
916
917         Since InlineFlowBox already has the branch-less renderer() returning
918         a RenderBoxModelObject&, avoid using InlineBox::boxModelObject()
919         wherever we have a tightly-typed box. One branch disappears from
920         every call site.
921
922         Deleted boxModelObject() on InlineFlowBox to prevent new code from
923         calling the less efficient function.
924
925         Reviewed by Anders Carlsson.
926
927 2013-11-07  Andreas Kling  <akling@apple.com>
928
929         CTTE: Scrolling tree nodes should always have a ScrollingTree&.
930         <https://webkit.org/b/124022>
931
932         Let ScrollingTreeNode and subclasses store the backpointer to the
933         tree as a ScrollingTree& reference.
934
935         Reviewed by Anders Carlsson.
936
937 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
938
939         Lots of layers get solid color but transparent contents layers now
940         https://bugs.webkit.org/show_bug.cgi?id=123537
941
942         Reviewed by Tim Horton.
943         
944         We call rendererBackgroundColor() to determine the layer's background color,
945         but on most elements this returns the transparent color (a valid color).
946         This caused us to allocate a contentsLayer, and use the transparent color as its
947         backgroundColor, which was wasteful.
948         
949         Fix by only making a background-color layer if the color is not transparent (zero alpha).
950         
951         Also avoid making a new contents layer on every color change, and make sure that
952         we don't do implicit animations for backgroundColor, and some other properties
953         that were omitted by mistake.
954
955         Layer tree dumps don't dump content layers, so no way to test easily.
956
957         * platform/graphics/ca/GraphicsLayerCA.cpp:
958         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
959         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
960         (nullActionsDictionary):
961
962 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
963
964         DOMTokenList::add can add duplicated values if arguments had duplicated values
965         https://bugs.webkit.org/show_bug.cgi?id=123962
966
967         Reviewed by Benjamin Poulain.
968
969         Merge https://chromium.googlesource.com/chromium/blink/+/bd3822ad4ae3fc5d8f89f433a7bf04f697334305
970
971         In case we do element.classList.add('a', 'a') we need to ensure that we do not add the same token twice.
972         See http://dom.spec.whatwg.org/#dom-domtokenlist-add
973
974         * html/DOMTokenList.cpp:
975         (WebCore::DOMTokenList::add): Make sure filtered tokens are unique among themselves.
976
977 2013-11-07  Eric Carlson  <eric.carlson@apple.com>
978
979         Remove npr.org specific hack in HTMLMediaElement
980         https://bugs.webkit.org/show_bug.cgi?id=123859
981
982         Reviewed by Jer Noble.
983
984         Remove the site specific hack added in r57820, it is no longer necessary.
985
986         * html/HTMLMediaElement.cpp:
987         (WebCore::HTMLMediaElement::HTMLMediaElement): Remove m_dispatchingCanPlayEvent.
988         (HTMLMediaElement::play): Don't special case npr.org.
989         * html/HTMLMediaElement.h:
990
991 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
992
993         Attempt to fix the 32-bit build. Virtual thunks seem to have different
994         symbol names between 32- and 64-bit.
995         
996         * WebCore.exp.in:
997
998 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
999
1000         Crash in HTMLMediaElement::contextDestroyed
1001         https://bugs.webkit.org/show_bug.cgi?id=123963
1002
1003         Reviewed by Eric Carlson.
1004
1005         Merge https://chromium.googlesource.com/chromium/blink/+/177999cdb34b707465670f0feff723922939f278
1006
1007         * html/HTMLMediaElement.cpp:
1008         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1009
1010 2013-11-07  Jer Noble  <jer.noble@apple.com>
1011
1012         [Mac] Crash at com.apple.WebCore: -[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:] + 2084 
1013         https://bugs.webkit.org/show_bug.cgi?id=124012
1014
1015         Reviewed by Eric Carlson.
1016
1017         The value of the 'duration' key is a NSConcreteValue wrapping a CMTime, not a NSNumber.
1018
1019         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1020         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1021
1022 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
1023
1024         Crash when submitting form in a document with null encoding
1025         https://bugs.webkit.org/show_bug.cgi?id=123975
1026
1027         Reviewed by Alexey Proskuryakov.
1028
1029         Merge https://chromium.googlesource.com/chromium/blink/+/bba01a7fff09e3053ada96ababac2a6e4261fe5f
1030         
1031         The CString object which is passed to normalizeLineEndingsToCRLF() can be
1032         a null string. It is created in FormDataList::appendString(), and it
1033         produces a null CString if FormDataList::m_encoding is a null encoding.
1034
1035         Test: fast/forms/form-submit-in-image-document.html
1036
1037         * platform/text/LineEnding.cpp:
1038         (internalNormalizeLineEndingsToCRLF):
1039
1040 2013-11-07  Anders Carlsson  <andersca@apple.com>
1041
1042         Use std::function for all policy continuation functions
1043         https://bugs.webkit.org/show_bug.cgi?id=124011
1044
1045         Reviewed by Sam Weinig.
1046
1047         * loader/DocumentLoader.cpp:
1048         (WebCore::DocumentLoader::willSendRequest):
1049         (WebCore::DocumentLoader::responseReceived):
1050         * loader/DocumentLoader.h:
1051         * loader/FrameLoader.cpp:
1052         (WebCore::FrameLoader::loadURL):
1053         (WebCore::FrameLoader::load):
1054         (WebCore::FrameLoader::loadWithDocumentLoader):
1055         (WebCore::FrameLoader::loadPostRequest):
1056         * loader/PolicyCallback.cpp:
1057         (WebCore::PolicyCallback::clear):
1058         (WebCore::PolicyCallback::set):
1059         (WebCore::PolicyCallback::call):
1060         (WebCore::PolicyCallback::clearRequest):
1061         (WebCore::PolicyCallback::cancel):
1062         * loader/PolicyCallback.h:
1063         * loader/PolicyChecker.cpp:
1064         (WebCore::PolicyChecker::checkNavigationPolicy):
1065         (WebCore::PolicyChecker::checkNewWindowPolicy):
1066         (WebCore::PolicyChecker::checkContentPolicy):
1067         * loader/PolicyChecker.h:
1068
1069 2013-11-07  Brady Eidson  <beidson@apple.com>
1070
1071         Use SQLite journal mode WAL (WriteAheadLogging)
1072         https://bugs.webkit.org/show_bug.cgi?id=124009
1073
1074         Reviewed by Anders Carlsson.
1075
1076         WriteAheadLogging journalling is better than the traditional rollback model.
1077
1078         * platform/sql/SQLiteDatabase.cpp:
1079         (WebCore::SQLiteDatabase::open): Use a PRAGMA to set journal_mode to WAL.
1080
1081 2013-11-07  Mark Lam  <mark.lam@apple.com>
1082
1083         Cosmetic: rename xxxId to xxxID for ScriptId, SourceId, and BreakpointId.
1084         https://bugs.webkit.org/show_bug.cgi?id=123945.
1085
1086         Reviewed by Geoffrey Garen.
1087
1088         No new tests.
1089
1090         * bindings/js/JSInjectedScriptHostCustom.cpp:
1091         (WebCore::JSInjectedScriptHost::functionDetails):
1092         * bindings/js/JavaScriptCallFrame.h:
1093         (WebCore::JavaScriptCallFrame::sourceID):
1094         * bindings/js/ScriptDebugServer.cpp:
1095         (WebCore::ScriptDebugServer::ScriptDebugServer):
1096         (WebCore::ScriptDebugServer::setBreakpoint):
1097         (WebCore::ScriptDebugServer::removeBreakpoint):
1098         (WebCore::ScriptDebugServer::hasBreakpoint):
1099         (WebCore::ScriptDebugServer::clearBreakpoints):
1100         (WebCore::ScriptDebugServer::updateCallFrame):
1101         (WebCore::ScriptDebugServer::pauseIfNeeded):
1102         * bindings/js/ScriptDebugServer.h:
1103         * inspector/InspectorConsoleAgent.cpp:
1104         (WebCore::InspectorConsoleAgent::addMessageToConsole):
1105         * inspector/InspectorConsoleAgent.h:
1106         * inspector/InspectorConsoleInstrumentation.h:
1107         (WebCore::InspectorInstrumentation::addMessageToConsole):
1108         * inspector/InspectorDOMAgent.cpp:
1109         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1110         * inspector/InspectorDebuggerAgent.cpp:
1111         (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
1112         (WebCore::parseLocation):
1113         (WebCore::InspectorDebuggerAgent::setBreakpoint):
1114         (WebCore::InspectorDebuggerAgent::removeBreakpoint):
1115         (WebCore::InspectorDebuggerAgent::continueToLocation):
1116         (WebCore::InspectorDebuggerAgent::resolveBreakpoint):
1117         (WebCore::InspectorDebuggerAgent::searchInContent):
1118         (WebCore::InspectorDebuggerAgent::setScriptSource):
1119         (WebCore::InspectorDebuggerAgent::getScriptSource):
1120         (WebCore::InspectorDebuggerAgent::compileScript):
1121         (WebCore::InspectorDebuggerAgent::runScript):
1122         (WebCore::InspectorDebuggerAgent::didParseSource):
1123         (WebCore::InspectorDebuggerAgent::didPause):
1124         (WebCore::InspectorDebuggerAgent::clear):
1125         (WebCore::InspectorDebuggerAgent::reset):
1126         * inspector/InspectorDebuggerAgent.h:
1127         * inspector/InspectorInstrumentation.cpp:
1128         (WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
1129         * inspector/InspectorInstrumentation.h:
1130         * inspector/ScriptDebugListener.h:
1131
1132 2013-11-07  Cidorvan Leite  <cidorvan.leite@openbossa.org>
1133
1134         Avoid invalid cairo matrix when drawing surfaces too small
1135         https://bugs.webkit.org/show_bug.cgi?id=123810
1136
1137         Drawing surfaces too small makes inverse matrix with values too big,
1138         when this happen, cairo context is not valid anymore and it stops to draw anything.
1139
1140         Reviewed by Martin Robinson.
1141
1142         Test: fast/canvas/drawImage-with-small-values.html
1143
1144         * platform/graphics/cairo/PlatformContextCairo.cpp:
1145         (WebCore::PlatformContextCairo::drawSurfaceToContext):
1146
1147 2013-11-07  Antti Koivisto  <antti@apple.com>
1148
1149         Simple line layout crashes with SVG fonts
1150         https://bugs.webkit.org/show_bug.cgi?id=124002
1151
1152         Reviewed by Simon Fraser.
1153         
1154         Don't use simple line layout for flows using SVG fonts. They crash if kerning is enabled.
1155
1156         Test: fast/text/svg-font-simple-line-crash.html
1157
1158         * platform/graphics/Font.h:
1159         (WebCore::Font::isSVGFont):
1160         
1161             Add isSVGFont() so callers don't need to go via primaryFont().
1162
1163         * rendering/InlineTextBox.cpp:
1164         (WebCore::InlineTextBox::constructTextRun):
1165         * rendering/RenderBlock.cpp:
1166         (WebCore::constructTextRunInternal):
1167         * rendering/SimpleLineLayout.cpp:
1168         (WebCore::SimpleLineLayout::canUseFor):
1169         
1170             Disallow SVG fonts.
1171
1172         * rendering/svg/SVGInlineTextBox.cpp:
1173         (WebCore::SVGInlineTextBox::constructTextRun):
1174         * rendering/svg/SVGTextMetrics.cpp:
1175         (WebCore::SVGTextMetrics::constructTextRun):
1176         (WebCore::SVGTextMetrics::SVGTextMetrics):
1177         * rendering/svg/SVGTextRunRenderingContext.h:
1178         
1179             Get rid of the abstract textRunNeedsRenderingContext in favor of just testing isSVGFont().
1180
1181 2013-11-07  Simon Fraser  <simon.fraser@apple.com>
1182
1183         Allow customization of the contentsScale of TileController tiles
1184         https://bugs.webkit.org/show_bug.cgi?id=124004
1185
1186         Reviewed by Tim Horton.
1187
1188         On some platorms, zooming out on pages with TiledBacking compositing
1189         layers can cause very high memory use, because the TiledBacking retains
1190         the original page scale while the zoom is in flight, but can be asked
1191         to cover a large area.
1192         
1193         Make it possible to reduce memory use in this case by allowing RenderLayerCompositor
1194         to provide an additional scale factor for newly created tiles. Platforms can
1195         then customize this to create low-res tiles when necessary.
1196
1197         * WebCore.exp.in:
1198         * platform/graphics/GraphicsLayerClient.h:
1199         (WebCore::GraphicsLayerClient::contentsScaleMultiplierForNewTiles):
1200         * platform/graphics/ca/GraphicsLayerCA.cpp:
1201         (WebCore::GraphicsLayerCA::platformCALayerContentsScaleMultiplierForNewTiles):
1202         * platform/graphics/ca/GraphicsLayerCA.h:
1203         * platform/graphics/ca/PlatformCALayerClient.h:
1204         (WebCore::PlatformCALayerClient::platformCALayerContentsScaleMultiplierForNewTiles):
1205         * platform/graphics/ca/mac/TileController.h:
1206         * platform/graphics/ca/mac/TileController.mm:
1207         (WebCore::TileController::TileController):
1208         (WebCore::TileController::setScale):
1209         (WebCore::TileController::createTileLayer):
1210         * rendering/RenderLayerBacking.cpp:
1211         (WebCore::RenderLayerBacking::contentsScaleMultiplierForNewTiles):
1212         * rendering/RenderLayerBacking.h:
1213         * rendering/RenderLayerCompositor.cpp:
1214         (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles):
1215         * rendering/RenderLayerCompositor.h:
1216
1217 2013-11-07  Jer Noble  <jer.noble@apple.com>
1218
1219         Unreviewed Win build fix after r158855; wrap shapeInfoForFloat() in an ENABLE(CSS_SHAPES) guard.
1220
1221         * rendering/FloatingObjects.cpp:
1222
1223 2013-11-07  Bem Jones-Bey  <bjonesbe@adobe.com>
1224
1225         Refactor logical left/right offset for line methods
1226         https://bugs.webkit.org/show_bug.cgi?id=123898
1227
1228         Reviewed by David Hyatt.
1229
1230         Simplify the logical left/right offset for line methods and their
1231         implementation, including the ComputeFloatOffsetAdapter. This also
1232         reduces the number of line offset methods in RenderBlock.
1233
1234         No new tests, no behavior change.
1235
1236         * rendering/FloatingObjects.cpp:
1237         (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
1238         (WebCore::ComputeFloatOffsetAdapter::offset): Add a method to return
1239             the offset instead of using a confusing out parameter.
1240         (WebCore::::shapeOffset): Method to return the offset modified by the
1241             shape delta. Moving the computation to this method allowed for
1242             simplification of the users of ComputeFloatOffsetAdapter.
1243         (WebCore::FloatingObjects::logicalLeftOffsetForPositioningFloat): Added this
1244             method so that ShapeOutsideFloatOffsetMode isn't needed. Returns the
1245             offset based on the float margin box.
1246         (WebCore::FloatingObjects::logicalRightOffsetForPositioningFloat): Ditto.
1247         (WebCore::FloatingObjects::logicalLeftOffset): This now only returns
1248             the offset based on the shape's contour.
1249         (WebCore::FloatingObjects::logicalRightOffset): Ditto.
1250         (WebCore::::heightRemaining): Rename to properly follow the getter
1251             naming convention.
1252         * rendering/FloatingObjects.h:
1253         * rendering/RenderBlock.h:
1254         (WebCore::RenderBlock::logicalRightOffsetForLine): Update to remove
1255             use of ShapeOutsideFloatOffsetMode and heightRemaining.
1256         (WebCore::RenderBlock::logicalLeftOffsetForLine): Ditto.
1257         (WebCore::RenderBlock::logicalRightFloatOffsetForLine): Ditto.
1258         (WebCore::RenderBlock::logicalLeftFloatOffsetForLine): Ditto.
1259         * rendering/RenderBlockFlow.cpp:
1260         (WebCore::RenderBlockFlow::logicalLeftOffsetForPositioningFloat):
1261             Positioning a float is the only case where the float margin box
1262             should be used, and also the only case where heightRemaining is
1263             needed. This handles that case.
1264         (WebCore::RenderBlockFlow::logicalRightOffsetForPositioningFloat):
1265             Ditto.
1266         (WebCore::RenderBlockFlow::computeLogicalLocationForFloat): Update to
1267             use logical(Left|Right)OffsetForPositioningFloatOnLine.
1268         (WebCore::RenderBlockFlow::logicalLeftFloatOffsetForLine): Update to
1269             remove use for ShapeOutsideFloatOffsetMode and heightRemaining.
1270         (WebCore::RenderBlockFlow::logicalRightFloatOffsetForLine): Ditto.
1271         * rendering/RenderBlockFlow.h:
1272
1273 2013-11-07  Alexandru Chiculita  <achicu@adobe.com>
1274
1275         Web Inspector: CSS Regions: Removing a content node of a ContentFlow from the DOM will send a 0 nodeId
1276         https://bugs.webkit.org/show_bug.cgi?id=123577
1277
1278         Reviewed by Timothy Hatcher.
1279
1280         Test: inspector-protocol/model/content-flow-content-removal.html
1281
1282         Do not send unregister events for the content nodes of a flow when the element is not part of the DOM
1283         anymore. We already send an unbind event, so the inspector is already notified that the node was removed.
1284
1285         * inspector/InspectorCSSAgent.cpp:
1286         (WebCore::InspectorCSSAgent::didUnregisterNamedFlowContentElement):
1287
1288 2013-10-30  Jer Noble  <jer.noble@apple.com>
1289
1290         [MSE] Add mock MediaSource classes for testing.
1291         https://bugs.webkit.org/show_bug.cgi?id=123322
1292
1293         Reviewed by Eric Carlson.
1294
1295         Tests: media/media-source/media-source-addsourcebuffer.html
1296                media/media-source/media-source-append-buffer.html
1297                media/media-source/media-source-canplaythrough.html
1298                media/media-source/media-source-closed.html
1299                media/media-source/media-source-play.html
1300                media/media-source/media-source-track-enabled.html
1301                media/media-source/media-source-tracks.html
1302
1303
1304         Add mock implementation of platform MediaSource classes, allowing ports to test the
1305         MediaSource API without having a platform implementation.
1306
1307         The MockMediaSource will support a byteformat defined in MockBox.h: a simple box-style media
1308         format with an initialization segment containing a number of tracks, followed by a list of
1309         samples.
1310
1311         Add a means to insert a new media engine factory at runtime, so the internals object can add
1312         a MockMediaSourceMediaPlayer:
1313         * platform/graphics/MediaPlayer.cpp:
1314         (WebCore::MediaPlayerFactorySupport::callRegisterMediaEngine):
1315         * platform/graphics/MediaPlayer.h:
1316         * testing/Internals.cpp:
1317         (WebCore::Internals::initializeMockMediaSource):
1318         * testing/Internals.h:
1319         * testing/Internals.idl:
1320
1321         For non-media-source supporting media engines, fail immediately when asked to load a media
1322         source, so that the MockMediaSourceMediaPlayer will be instantiated as a fall-back:
1323         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1324         (WebCore::MediaPlayerPrivateAVFoundation::load):
1325         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1326         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1327         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1328         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
1329         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1330         (WebCore::MediaPlayerPrivateQTKit::load):
1331         (WebCore::MediaPlayerPrivateQTKit::supportsType):
1332
1333         Add new files to the project:
1334         * WebCore.xcodeproj/project.pbxproj:
1335         * Source/WebCore/WebCore.exp.in:
1336
1337         Update the MediaSource implementation:
1338         * Modules/mediasource/MediaSource.cpp:
1339         (WebCore::MediaSource::monitorSourceBuffers): Add a link to the spec.
1340         * Modules/mediasource/SourceBuffer.cpp:
1341         (WebCore::SourceBuffer::buffered): Ditto.
1342         (WebCore::SourceBuffer::setTimestampOffset): Ditto.
1343         (WebCore::SourceBuffer::validateInitializationSegment): Ditto.
1344         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto. Also,
1345             bring the implementation up to date with part of the spec.
1346         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Remove "Predicate" from
1347             SampleIsRandomAccessPredicate.
1348
1349         Add utility classes to parse and represent the bytestream supported by the MockMediaSource:
1350         * platform/mock/mediasource/MockBox.cpp: Added.
1351         (WebCore::MockBox::MockBox):
1352         (WebCore::MockBox::peekType):
1353         (WebCore::MockBox::peekLength):
1354         (WebCore::MockTrackBox::MockTrackBox):
1355         (WebCore::MockTrackBox::type):
1356         (WebCore::MockInitializationBox::MockInitializationBox):
1357         (WebCore::MockInitializationBox::type):
1358         (WebCore::MockSampleBox::MockSampleBox):
1359         (WebCore::MockSampleBox::type):
1360         * platform/mock/mediasource/MockBox.h: Added.
1361         (WebCore::MockBox::length):
1362         (WebCore::MockBox::type):
1363         (WebCore::MockTrackBox::trackID):
1364         (WebCore::MockTrackBox::codec):
1365         (WebCore::MockTrackBox::kind):
1366         (WebCore::MockInitializationBox::duration):
1367         (WebCore::MockInitializationBox::tracks):
1368         (WebCore::MockSampleBox::presentationTimestamp):
1369         (WebCore::MockSampleBox::decodeTimestamp):
1370         (WebCore::MockSampleBox::duration):
1371         (WebCore::MockSampleBox::trackID):
1372         (WebCore::MockSampleBox::flags):
1373         (WebCore::MockSampleBox::isSync):
1374
1375         Add a MediaPlayerPrivate implementation which uses MockMediaSource:
1376         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: Added.
1377         (WebCore::MockMediaPlayerMediaSource::registerMediaEngine):
1378         (WebCore::MockMediaPlayerMediaSource::create):
1379         (WebCore::mimeTypeCache):
1380         (WebCore::MockMediaPlayerMediaSource::getSupportedTypes):
1381         (WebCore::MockMediaPlayerMediaSource::supportsType):
1382         (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
1383         (WebCore::MockMediaPlayerMediaSource::~MockMediaPlayerMediaSource):
1384         (WebCore::MockMediaPlayerMediaSource::load):
1385         (WebCore::MockMediaPlayerMediaSource::cancelLoad):
1386         (WebCore::MockMediaPlayerMediaSource::play):
1387         (WebCore::MockMediaPlayerMediaSource::pause):
1388         (WebCore::MockMediaPlayerMediaSource::naturalSize):
1389         (WebCore::MockMediaPlayerMediaSource::hasVideo):
1390         (WebCore::MockMediaPlayerMediaSource::hasAudio):
1391         (WebCore::MockMediaPlayerMediaSource::setVisible):
1392         (WebCore::MockMediaPlayerMediaSource::seeking):
1393         (WebCore::MockMediaPlayerMediaSource::paused):
1394         (WebCore::MockMediaPlayerMediaSource::networkState):
1395         (WebCore::MockMediaPlayerMediaSource::readyState):
1396         (WebCore::MockMediaPlayerMediaSource::buffered):
1397         (WebCore::MockMediaPlayerMediaSource::didLoadingProgress):
1398         (WebCore::MockMediaPlayerMediaSource::setSize):
1399         (WebCore::MockMediaPlayerMediaSource::paint):
1400         (WebCore::MockMediaPlayerMediaSource::currentTimeDouble):
1401         (WebCore::MockMediaPlayerMediaSource::durationDouble):
1402         (WebCore::MockMediaPlayerMediaSource::seekDouble):
1403         (WebCore::MockMediaPlayerMediaSource::advanceCurrentTime):
1404         (WebCore::MockMediaPlayerMediaSource::updateDuration):
1405         (WebCore::MockMediaPlayerMediaSource::setReadyState):
1406         * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Added.
1407
1408         Add a mock implementation of MediaSourcePrivate, which uses MockSourceBuffer:
1409         * platform/mock/mediasource/MockMediaSourcePrivate.cpp: Added.
1410         (WebCore::MockMediaSourcePrivate::create):
1411         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
1412         (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate):
1413         (WebCore::MockMediaSourcePrivate::addSourceBuffer):
1414         (WebCore::MockMediaSourcePrivate::removeSourceBuffer):
1415         (WebCore::MockMediaSourcePrivate::duration):
1416         (WebCore::MockMediaSourcePrivate::setDuration):
1417         (WebCore::MockMediaSourcePrivate::markEndOfStream):
1418         (WebCore::MockMediaSourcePrivate::unmarkEndOfStream):
1419         (WebCore::MockMediaSourcePrivate::readyState):
1420         (WebCore::MockMediaSourcePrivate::setReadyState):
1421         (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState):
1422         (WebCore::MockSourceBufferPrivateHasAudio):
1423         (WebCore::MockMediaSourcePrivate::hasAudio):
1424         (WebCore::MockSourceBufferPrivateHasVideo):
1425         (WebCore::MockMediaSourcePrivate::hasVideo):
1426         * platform/mock/mediasource/MockMediaSourcePrivate.h: Added.
1427         (WebCore::MockMediaSourcePrivate::activeSourceBuffers):
1428         (WebCore::MockMediaSourcePrivate::player):
1429
1430         Add a mock implementation of SourceBufferPrivate, which uses MockBoxes to parse the
1431         bytestream provided by SourceBuffer:
1432         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Added.
1433         (WebCore::MockMediaSample::create):
1434         (WebCore::MockMediaSample::~MockMediaSample):
1435         (WebCore::MockMediaSample::MockMediaSample):
1436         (WebCore::MockMediaSample::platformSample):
1437         (WebCore::MockMediaDescription::create):
1438         (WebCore::MockMediaDescription::~MockMediaDescription):
1439         (WebCore::MockMediaDescription::MockMediaDescription):
1440         (WebCore::MockSourceBufferPrivate::create):
1441         (WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate):
1442         (WebCore::MockSourceBufferPrivate::~MockSourceBufferPrivate):
1443         (WebCore::MockSourceBufferPrivate::setClient):
1444         (WebCore::MockSourceBufferPrivate::append):
1445         (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
1446         (WebCore::MockSourceBufferPrivate::didReceiveSample):
1447         (WebCore::MockSourceBufferPrivate::abort):
1448         (WebCore::MockSourceBufferPrivate::removedFromMediaSource):
1449         (WebCore::MockSourceBufferPrivate::readyState):
1450         (WebCore::MockSourceBufferPrivate::setReadyState):
1451         (WebCore::MockSourceBufferPrivate::hasVideo):
1452         (WebCore::MockSourceBufferPrivate::hasAudio):
1453         * platform/mock/mediasource/MockSourceBufferPrivate.h: Added.
1454
1455         Create mock implementations of AudioTrackPrivate, VideoTrackPrivate, and TextTrackPrivate
1456         which wrap the MockTrackBox class:
1457         * platform/mock/mediasource/MockTracks.cpp: Added.
1458         * platform/mock/mediasource/MockTracks.h: Added.
1459         (WebCore::MockAudioTrackPrivate::create):
1460         (WebCore::MockAudioTrackPrivate::~MockAudioTrackPrivate):
1461         (WebCore::MockAudioTrackPrivate::id):
1462         (WebCore::MockAudioTrackPrivate::MockAudioTrackPrivate):
1463         (WebCore::MockTextTrackPrivate::create):
1464         (WebCore::MockTextTrackPrivate::~MockTextTrackPrivate):
1465         (WebCore::MockTextTrackPrivate::id):
1466         (WebCore::MockTextTrackPrivate::MockTextTrackPrivate):
1467         (WebCore::MockVideoTrackPrivate::create):
1468         (WebCore::MockVideoTrackPrivate::~MockVideoTrackPrivate):
1469         (WebCore::MockVideoTrackPrivate::id):
1470         (WebCore::MockVideoTrackPrivate::MockVideoTrackPrivate):
1471
1472 2013-11-07  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
1473
1474         Changing MediaStreamDescriptor to MediaStreamPrivate
1475         https://bugs.webkit.org/show_bug.cgi?id=123935
1476
1477         Reviewed by Eric Carlson.
1478
1479         No new tests needed.
1480
1481         * CMakeLists.txt:
1482         * GNUmakefile.list.am:
1483         * Modules/mediastream/MediaStream.cpp:
1484         (WebCore::MediaStream::create):
1485         (WebCore::MediaStream::MediaStream):
1486         (WebCore::MediaStream::~MediaStream):
1487         (WebCore::MediaStream::ended):
1488         (WebCore::MediaStream::setEnded):
1489         (WebCore::MediaStream::addTrack):
1490         (WebCore::MediaStream::removeTrack):
1491         (WebCore::MediaStream::removeRemoteSource):
1492         * Modules/mediastream/MediaStream.h:
1493         * Modules/mediastream/MediaStreamRegistry.cpp:
1494         (WebCore::MediaStreamRegistry::registerURL):
1495         (WebCore::MediaStreamRegistry::unregisterURL):
1496         (WebCore::MediaStreamRegistry::lookupMediaStreamPrivate):
1497         * Modules/mediastream/MediaStreamRegistry.h:
1498         * Modules/mediastream/MediaStreamTrack.cpp:
1499         * Modules/mediastream/MediaStreamTrack.h:
1500         * Modules/mediastream/RTCPeerConnection.cpp:
1501         (WebCore::RTCPeerConnection::addStream):
1502         (WebCore::RTCPeerConnection::removeStream):
1503         (WebCore::RTCPeerConnection::didAddRemoteStream):
1504         (WebCore::RTCPeerConnection::didRemoveRemoteStream):
1505         * Modules/mediastream/RTCPeerConnection.h:
1506         * Modules/mediastream/UserMediaRequest.cpp:
1507         (WebCore::UserMediaRequest::didCreateStream):
1508         (WebCore::UserMediaRequest::callSuccessHandler):
1509         * Modules/mediastream/UserMediaRequest.h:
1510         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
1511         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
1512         * WebCore.xcodeproj/project.pbxproj:
1513         * html/HTMLMediaElement.cpp:
1514         (HTMLMediaElement::loadResource):
1515         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
1516         (WebCore::toWebMediaStreamPrivate):
1517         (WebCore::MediaPlayerPrivate::lookupMediaStream):
1518         * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.h:
1519         * platform/mediastream/MediaStreamCenter.cpp:
1520         * platform/mediastream/MediaStreamCreationClient.h:
1521         * platform/mediastream/MediaStreamPrivate.cpp: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.cpp.
1522         (WebCore::MediaStreamPrivate::create):
1523         (WebCore::MediaStreamPrivate::addSource):
1524         (WebCore::MediaStreamPrivate::removeSource):
1525         (WebCore::MediaStreamPrivate::addRemoteSource):
1526         (WebCore::MediaStreamPrivate::removeRemoteSource):
1527         (WebCore::MediaStreamPrivate::addRemoteTrack):
1528         (WebCore::MediaStreamPrivate::removeRemoteTrack):
1529         (WebCore::MediaStreamPrivate::MediaStreamPrivate):
1530         (WebCore::MediaStreamPrivate::setEnded):
1531         (WebCore::MediaStreamPrivate::addTrack):
1532         (WebCore::MediaStreamPrivate::removeTrack):
1533         * platform/mediastream/MediaStreamPrivate.h: Renamed from Source/WebCore/platform/mediastream/MediaStreamDescriptor.h.
1534         (WebCore::MediaStreamPrivateClient::~MediaStreamPrivateClient):
1535         (WebCore::MediaStreamPrivate::~MediaStreamPrivate):
1536         (WebCore::MediaStreamPrivate::client):
1537         (WebCore::MediaStreamPrivate::setClient):
1538         (WebCore::MediaStreamPrivate::id):
1539         (WebCore::MediaStreamPrivate::numberOfAudioSources):
1540         (WebCore::MediaStreamPrivate::audioSources):
1541         (WebCore::MediaStreamPrivate::numberOfVideoSources):
1542         (WebCore::MediaStreamPrivate::videoSources):
1543         (WebCore::MediaStreamPrivate::numberOfAudioTracks):
1544         (WebCore::MediaStreamPrivate::audioTracks):
1545         (WebCore::MediaStreamPrivate::numberOfVideoTracks):
1546         (WebCore::MediaStreamPrivate::videoTracks):
1547         (WebCore::MediaStreamPrivate::ended):
1548         * platform/mediastream/MediaStreamSource.cpp:
1549         * platform/mediastream/MediaStreamSource.h:
1550         * platform/mediastream/RTCPeerConnectionHandler.h:
1551         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
1552         * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.cpp:
1553         * platform/mediastream/blackberry/MediaStreamCenterBlackBerry.h:
1554         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp:
1555         * platform/mediastream/gstreamer/MediaStreamCenterGStreamer.h:
1556         * platform/mediastream/mac/MediaStreamCenterMac.cpp:
1557         (WebCore::MediaStreamCenterMac::createMediaStream):
1558         * platform/mock/MockMediaStreamCenter.cpp:
1559         (WebCore::MockMediaStreamCenter::createMediaStream):
1560         * platform/mock/RTCPeerConnectionHandlerMock.cpp:
1561         (WebCore::RTCPeerConnectionHandlerMock::addStream):
1562         (WebCore::RTCPeerConnectionHandlerMock::removeStream):
1563         * platform/mock/RTCPeerConnectionHandlerMock.h:
1564
1565 2013-11-07  Denis Nomiyama  <d.nomiyama@samsung.com>
1566
1567         [GTK] Glyphs in vertical text tests are rotated 90 degrees clockwise
1568         https://bugs.webkit.org/show_bug.cgi?id=50619
1569
1570         Reviewed by Martin Robinson.
1571
1572         Implemented the OPENTYPE_VERTICAL feature for the GTK+ port. It resolves
1573         the 90 degrees rotation problem of CJK characters when displaying
1574         vertical text.
1575
1576         New tests are not required as the existing tests for vertical text will
1577         work properly now.
1578
1579         * GNUmakefile.list.am: Added OpenTypeVerticalData.cpp and
1580         OpenTypeVerticalData.h to platformgtk_sources.
1581         * PlatformEfl.cmake: Added OpenTypeVerticalData.cpp.
1582         * PlatformGTK.cmake: Added OpenTypeVerticalData.cpp.
1583         * platform/graphics/FontCache.cpp: Originally the HashMap for
1584         OpenTypeVerticalData was designed with FontFileKey as integer in the
1585         Chromium port, which was an unique number provided by Skia. Since other
1586         ports use FontFileKey as string, new generic hash functions had to be
1587         implemented instead of using the specific ones for integers.
1588         (WebCore::FontVerticalDataCacheKeyHash::hash): New hash function for
1589         HashMap of OpenTypeVerticalData.
1590         (WebCore::FontVerticalDataCacheKeyHash::equal): New function for
1591         comparing hash indexes in the HashMap of OpenTypeVerticalData.
1592         (WebCore::FontVerticalDataCacheKeyTraits::emptyValue): New function for
1593         giving an empty FontFileKey.
1594         (WebCore::FontVerticalDataCacheKeyTraits::constructDeletedValue): New
1595         function to create a FontFileKey for deleted values.
1596         (WebCore::FontVerticalDataCacheKeyTraits::isDeletedValue): New function
1597         to check if a HashMap entry is available.
1598         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1599         (WebCore::FontCustomPlatformData::fontPlatformData): Added font
1600         orientation as a parameter to the FontPlatformData constructor.
1601         * platform/graphics/freetype/FontPlatformData.h: Added m_orientation to
1602         store the font orientation and m_horizontalOrientationMatrix to store
1603         the Cairo matrix for horizontal orientation, which can be restored in
1604         setOrientation().
1605         (WebCore::FontPlatformData::FontPlatformData): Added font orientation as
1606         a parameter.
1607         (WebCore::FontPlatformData::orientation): Implemented this function
1608         based on m_orientation.
1609         * platform/graphics/freetype/FontPlatformDataFreeType.cpp: Added new
1610         helper function rotateCairoMatrixForVerticalOrientation() to rotate the
1611         Cairo matrix in case of vertical orientation.
1612         (WebCore::FontPlatformData::FontPlatformData): Initialized
1613         m_orientation.
1614         (WebCore::FontPlatformData::operator=): Added m_orientation and
1615         m_horizontalOrientationMatrix to the assignment operator.
1616         (WebCore::FontPlatformData::operator==): Added m_orientation to the
1617         equal operator.
1618         (WebCore::FontPlatformData::initializeWithFontFace): Rotated and
1619         translated fonts if orientation is vertical. Also stored the horizontal
1620         Cairo matrix.
1621         (WebCore::FontPlatformData::verticalData): Returned the vertical data
1622         from the font cache.
1623         (WebCore::FontPlatformData::openTypeTable): Loaded the font table into
1624         a shared buffer.
1625         (WebCore::FontPlatformData::setOrientation): Replaced the scaled font
1626         data by rotating fonts according to the new orientation.
1627         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1628         (WebCore::SimpleFontData::platformInit): Set the glyph's height and
1629         width according to the font orientation. It also sets EM.
1630         (WebCore::SimpleFontData::platformCreateScaledFontData): Added
1631         orientation to the FontPlatformData constructor.
1632         (WebCore::SimpleFontData::platformWidthForGlyph): Returned the glyph's
1633         width according the orientation.
1634         * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
1635         (WebCore::CairoGetGlyphWidthAndExtents): Obtained the character advance
1636         and extents according to the font orientation.
1637
1638 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1639
1640         [AX] Use toAccessibilityRenderObject() instead of using static_cast<>
1641         https://bugs.webkit.org/show_bug.cgi?id=123986
1642
1643         Reviewed by Mario Sanchez Prada.
1644
1645         Though there is toAccessibilityRenderObject(), static_cast<> are being used by many places.
1646         To use toAccessibilityRenderObject() is more helpful to find bad type cast.
1647
1648         No new tests, no behavior changes.
1649
1650         * accessibility/AXObjectCache.cpp:
1651         (WebCore::AXObjectCache::notificationPostTimerFired):
1652         * accessibility/AccessibilityImageMapLink.cpp:
1653         (WebCore::AccessibilityImageMapLink::imageMapLinkRenderer):
1654         * accessibility/AccessibilityRenderObject.cpp:
1655         (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
1656         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
1657         * accessibility/ios/AccessibilityObjectIOS.mm:
1658         (WebCore::AccessibilityObject::accessibilityPasswordFieldLength):
1659         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1660         (AXAttributeStringSetElement):
1661         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1662
1663 2013-11-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1664
1665         [AX] Use toAccessibilityTable() instead of using manual static_cast<>
1666         https://bugs.webkit.org/show_bug.cgi?id=123982
1667
1668         Reviewed by Mario Sanchez Prada.
1669
1670         Though there is toAccessibilityTable(), static_cast<> are being used by many places.
1671         We need to use toAccessibilityTable().
1672
1673         No new tests, no behavior changes.
1674
1675         * accessibility/AccessibilityARIAGridRow.cpp:
1676         (WebCore::AccessibilityARIAGridRow::disclosedRows):
1677         (WebCore::AccessibilityARIAGridRow::disclosedByRow):
1678         * accessibility/AccessibilityTableHeaderContainer.cpp:
1679         (WebCore::AccessibilityTableHeaderContainer::addChildren):
1680         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
1681         (cell):
1682         (cellAtIndex):
1683         (webkitAccessibleTableGetIndexAt):
1684         (webkitAccessibleTableGetNColumns):
1685         (webkitAccessibleTableGetNRows):
1686         (webkitAccessibleTableGetColumnHeader):
1687         (webkitAccessibleTableGetRowHeader):
1688         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1689         (-[WebAccessibilityObjectWrapper tableParent]):
1690         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1691         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
1692         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1693         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1694
1695 2013-11-07  Andreas Kling  <akling@apple.com>
1696
1697         Use tighter InlineBox subtypes in some places.
1698         <https://webkit.org/b/123980>
1699
1700         RenderLineBreak and RenderBox line box wrappers are always going to
1701         be InlineElementBox, so codify this with tighter types. Also made
1702         the various positionLine() functions take tighter reference types.
1703
1704         All the casting to renderer-appropriate box types happens inside of
1705         RenderBlockFlow::computeBlockDirectionPositionsForLine() and
1706         propagates from there.
1707
1708         Reviewed by Antti Koivisto.
1709
1710 2013-11-07  Mario Sanchez Prada  <mario.prada@samsung.com>
1711
1712         AX: [ATK] Video and audio elements are not properly exposed
1713         https://bugs.webkit.org/show_bug.cgi?id=123894
1714
1715         Reviewed by Chris Fleizach.
1716
1717         Expose <audio> and <video> elements with ATK_ROLE_EMBEDDED, so we
1718         can identify them properly from ATK/AT-SPI based ATs.
1719
1720         Tests: platform/gtk/accessibility/media-controls-panel-title.html
1721                platform/efl/accessibility/media-emits-object-replacement.html
1722                platform/gtk/accessibility/media-emits-object-replacement.html
1723
1724         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1725         (atkRole): Add the new mapping.
1726
1727 2013-11-07  Laszlo Vidacs  <lac@inf.u-szeged.hu>
1728         
1729         Fix crash in BitmapImage::destroyDecodedData()
1730         https://bugs.webkit.org/show_bug.cgi?id=116494
1731
1732         Reviewed by Csaba Osztrogonác.
1733
1734         Merge from https://chromium.googlesource.com/chromium/blink/+/6b6887bf53068f8537908e501fdc7317ad2c6d86
1735
1736         * platform/graphics/BitmapImage.cpp:
1737         (WebCore::BitmapImage::destroyDecodedData):
1738
1739 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
1740
1741         [CSS Grid Layout] CSSParser should reject <track-list> without a <track-size>
1742         https://bugs.webkit.org/show_bug.cgi?id=118025
1743
1744         Reviewed by Andreas Kling.
1745
1746         From Blink r152914 by <jchaffraix@chromium.org>
1747
1748         Make sure that we parse at least 1 <track-size> inside each
1749         <track-list>. The old parser code allowed track-lists exclusively
1750         made of <track-name>. The way it was implemented eases the future
1751         addition of parsing for the repeat() function.
1752
1753         * css/CSSParser.cpp:
1754         (WebCore::CSSParser::parseGridTrackList):
1755         * css/StyleResolver.cpp:
1756         (WebCore::createGridTrackList): ASSERT if we don't find any
1757         <track-size> now that we detect their absence in the parser.
1758
1759 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
1760
1761         [CSS Grid Layout] Fix handling of 'inherit' and 'initial' for grid lines
1762         https://bugs.webkit.org/show_bug.cgi?id=115401
1763
1764         Reviewed by Andreas Kling.
1765
1766         From Blink r150585 by <jchaffraix@chromium.org>
1767
1768         Added support for 'inherit' and 'initial' special values to
1769         grid-auto-{columns|rows} and grid-definition-{columns|rows}.
1770
1771         * css/StyleResolver.cpp:
1772         (WebCore::StyleResolver::applyProperty): Resolve 'initial' and 'inherit'.
1773         * rendering/style/RenderStyle.h: Added initialNamedGrid{Column|Row}Lines().
1774         * rendering/style/StyleGridData.cpp:
1775         (WebCore::StyleGridData::StyleGridData): Initialize m_namedGrid{Column|Row}Lines.
1776
1777 2013-11-07  Andreas Kling  <akling@apple.com>
1778
1779         Clean up BidiRun a little bit.
1780         <https://webkit.org/b/123964>
1781
1782         Make BidiRun's member variables private and add accessors for them.
1783         In doing so, codify the following:
1784
1785             - BidiRun always has a corresponding RenderObject.
1786             - The inline box is never cleared after being set.
1787
1788         Reviewed by Antti Koivisto.
1789
1790 2013-11-07  Andreas Kling  <akling@apple.com>
1791
1792         More CSSPrimitiveValue constructors should return PassRef.
1793         <https://webkit.org/b/123953>
1794
1795         Make some more CSSPrimitiveValue constructor helpers (that are
1796         known to never return null) return PassRef instead of PassRefPtr.
1797
1798         Reviewed by Antti Koivisto.
1799
1800 2013-11-07  Andreas Kling  <akling@apple.com>
1801
1802         Generate type casting helpers for line boxes and use them.
1803         <https://webkit.org/b/123976>
1804
1805         Semi-automatically generate the full set of toFooInlineBox()
1806         helpers with macros instead of having them (partially) hand-coded.
1807         Replaced static_casts with the new helpers across the codebase.
1808
1809         Also made the isFooInlineBox() overrides private since they should
1810         never be called when the type is already known.
1811
1812         Reviewed by Antti Koivisto.
1813
1814 2013-11-07  Ryosuke Niwa  <rniwa@webkit.org>
1815
1816         Simplify Attr by removing m_specified member variable and setter
1817         https://bugs.webkit.org/show_bug.cgi?id=123965
1818
1819         Reviewed by Andreas Kling.
1820
1821         Merge https://chromium.googlesource.com/chromium/blink/+/597f44ec928e08820574728889adabc6d8ecd746
1822
1823         m_specified is always true in WebKit so simply return true in Attr::specified().
1824
1825         * dom/Attr.cpp:
1826         (WebCore::Attr::Attr):
1827         * dom/Attr.h:
1828         * dom/Document.cpp:
1829         (WebCore::Document::adoptNode):
1830
1831 2013-10-25  Jer Noble  <jer.noble@apple.com>
1832
1833         [MSE] Add MediaSource extensions to AudioTrack, VideoTrack, and TextTrack.
1834         https://bugs.webkit.org/show_bug.cgi?id=123374
1835
1836         Reviewed by Eric Carlson.
1837
1838         No tests added; tests will be added when Mock implementations are added in a future patch.
1839
1840         Add new partial interfaces for added methods on AudioTrack, TextTrack, and VideoTrack:
1841         * Modules/mediasource/AudioTrackMediaSource.idl: Add read-only sourceBuffer attribute.
1842         * Modules/mediasource/TextTrackMediaSource.idl: Ditto.
1843         * Modules/mediasource/VideoTrackMediaSource.idl: Ditto.
1844         * Modules/mediasource/AudioTrackMediaSource.h:
1845         (WebCore::AudioTrackMediaSource::sourceBuffer): Added static wrapper around non-static sourceBuffer().
1846         * Modules/mediasource/TextTrackMediaSource.h:
1847         (WebCore::TextTrackMediaSource::sourceBuffer): Ditto.
1848         * Modules/mediasource/VideoTrackMediaSource.h:
1849         (WebCore::VideoTrackMediaSource::sourceBuffer): Ditto.
1850
1851         Add support for writable kind & language attributes through a custom setter:
1852         * bindings/js/JSAudioTrackCustom.cpp:
1853         (WebCore::JSAudioTrack::setKind):
1854         (WebCore::JSAudioTrack::setLanguage):
1855         * bindings/js/JSTextTrackCustom.cpp:
1856         (WebCore::JSTextTrack::setKind):
1857         (WebCore::JSTextTrack::setLanguage):
1858         * bindings/js/JSVideoTrackCustom.cpp:
1859         (WebCore::JSVideoTrack::setKind):
1860         (WebCore::JSVideoTrack::setLanguage):
1861         * html/track/AudioTrack.idl:
1862         * html/track/TextTrack.idl:
1863         * html/track/VideoTrack.idl:
1864
1865         Add setter methods to the implementation classes:
1866         * html/track/TextTrack.cpp:
1867         (WebCore::TextTrack::TextTrack):
1868         (WebCore::TextTrack::setKind):
1869         (WebCore::TextTrack::setLanguage):
1870         * html/track/TextTrack.h:
1871         * html/track/TrackBase.cpp:
1872         (WebCore::TrackBase::TrackBase):
1873         (WebCore::TrackBase::setKind):
1874         (WebCore::TrackBase::setKindInternal):
1875         * html/track/TrackBase.h:
1876         (WebCore::TrackBase::setLanguage):
1877         (WebCore::TrackBase::sourceBuffer):
1878         (WebCore::TrackBase::setSourceBuffer):
1879         * html/track/VideoTrack.cpp:
1880         (WebCore::VideoTrack::VideoTrack):
1881         (WebCore::VideoTrack::setKind):
1882         (WebCore::VideoTrack::setLanguage):
1883         * html/track/VideoTrack.h:
1884
1885         Implement the unimplemented portions of MediaSource and SourceBuffer:
1886         * Modules/mediasource/MediaSource.cpp:
1887         (WebCore::MediaSource::removeSourceBuffer):
1888         * Modules/mediasource/MediaSourceBase.cpp:
1889         (WebCore::MediaSourceBase::MediaSourceBase):
1890         (WebCore::MediaSourceBase::setPrivateAndOpen):
1891         (WebCore::MediaSourceBase::setReadyState):
1892         (WebCore::MediaSourceBase::attachToElement):
1893         * Modules/mediasource/MediaSourceBase.h:
1894         (WebCore::MediaSourceBase::mediaElement):
1895         * Modules/mediasource/SourceBuffer.cpp:
1896         (WebCore::SourceBuffer::videoTracks):
1897         (WebCore::SourceBuffer::audioTracks):
1898         (WebCore::SourceBuffer::textTracks):
1899         (WebCore::SourceBuffer::sourceBufferPrivateDidAddAudioTrack):
1900         (WebCore::SourceBuffer::sourceBufferPrivateDidAddVideoTrack):
1901         (WebCore::SourceBuffer::sourceBufferPrivateDidAddTextTrack):
1902         (WebCore::SourceBuffer::sourceBufferPrivateDidChangeActiveState):
1903         * Modules/mediasource/SourceBuffer.h:
1904         * Modules/mediasource/SourceBuffer.idl:
1905
1906         Add new files to the project:
1907         * DerivedSources.make:
1908         * WebCore.xcodeproj/project.pbxproj:
1909
1910         And a smorgasbord of other utility changes:
1911         * html/HTMLMediaElement.cpp:
1912         (WebCore::HTMLMediaElement::loadResource): Pass this when attaching.
1913         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Ditto.
1914         * html/HTMLMediaSource.h:
1915         * html/track/TextTrackList.cpp:
1916         (TextTrackList::item): Make const.
1917         * html/track/TextTrackList.h:
1918         (WebCore::TextTrackList::lastItem): Added.
1919         * platform/graphics/InbandTextTrackPrivate.h:
1920         (WebCore::InbandTextTrackPrivate::create): Added.
1921         (WebCore::MockSourceBufferPrivate::trackDidChangeEnabled):
1922
1923 2013-11-06  Vani Hegde  <vani.hegde@samsung.com>
1924
1925         Applied background color is not retained after typing a characters
1926         https://bugs.webkit.org/show_bug.cgi?id=117337
1927
1928         Reviewed by Ryosuke Niwa.
1929
1930         While deleting a selection, only the inheritable style properties
1931         applied on the selection were saved.
1932         Since background color is considered as noninheritable style property,
1933         on deleting the selection, background color set on it was being lost.
1934         Hence on typing in new text, it would not have the applied
1935         background color set.
1936         Fixed by saving editing preoperties that are already in effect
1937         on a selection before deleting it.
1938
1939         Test: editing/style/background-color-retained.html
1940
1941         * editing/DeleteSelectionCommand.cpp:
1942         (WebCore::DeleteSelectionCommand::saveTypingStyleState):
1943         Modified as to save EditingPropertiesInEffect on a selection before
1944         deleting it.
1945
1946 2013-11-06  Andreas Kling  <akling@apple.com>
1947
1948         InlineBox: Make paint() and nodeAtPoint() pure virtuals.
1949         <https://webkit.org/b/123937>
1950
1951         ...and move the current implementations to InlineElementBox.
1952         All subclasses were already overriding these functions so the move
1953         is completely natural.
1954
1955         Reviewed by Anders Carlsson.
1956
1957 2013-11-06  Andreas Kling  <akling@apple.com>
1958
1959         Nothing should return std::unique_ptr<InlineBox>.
1960         <https://webkit.org/b/123936>
1961
1962         Made RenderBox, RenderLineBreak and RenderListMarker return tightly
1963         typed InlineElementBoxes instead.
1964
1965         Reviewed by Anders Carlsson.
1966
1967 2013-11-06  Daniel Bates  <dabates@apple.com>
1968
1969         [iOS] Upstream Letterpress effect
1970         https://bugs.webkit.org/show_bug.cgi?id=123932
1971
1972         Reviewed by Sam Weinig.
1973
1974         Test: platform/iphone-simulator/iphone/getComputedStyle-text-decoration-letterpress.html
1975
1976         * Configurations/FeatureDefines.xcconfig: Add feature define ENABLE_LETTERPRESS disabled
1977         by default. We only enable letterpress on iOS.
1978         * css/CSSComputedStyleDeclaration.cpp:
1979         (WebCore::renderTextDecorationFlagsToCSSValue): Add support for CSS value -webkit-letterpress.
1980         * css/CSSParser.cpp:
1981         (WebCore::CSSParser::parseTextDecoration): Ditto.
1982         * css/CSSPrimitiveValueMappings.h:
1983         (WebCore::CSSPrimitiveValue::operator TextDecoration): Ditto.
1984         * css/CSSValueKeywords.in: Added CSS value -webkit-letterpress.
1985         * platform/graphics/GraphicsContext.h:
1986         * platform/graphics/mac/FontMac.mm:
1987         (WebCore::fillVectorWithHorizontalGlyphPositions): Added.
1988         (WebCore::shouldUseLetterpressEffect): Added.
1989         (WebCore::showLetterpressedGlyphsWithAdvances): Added.
1990         (WebCore::showGlyphsWithAdvances): Modified to call showLetterpressedGlyphsWithAdvances()
1991         to show a letterpressed glyph. I also included additional iOS-specific changes.
1992         (WebCore::Font::drawGlyphs):
1993         * rendering/TextPaintStyle.cpp:
1994         (WebCore::TextPaintStyle::TextPaintStyle): 
1995         (WebCore::computeTextPaintStyle): Modified to compute letterpress effect style.
1996         (WebCore::updateGraphicsContext): Modified to apply/unapply letterpress effect drawing mode.
1997         * rendering/TextPaintStyle.h:
1998         * rendering/style/RenderStyleConstants.h:
1999
2000 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
2001
2002         Crash in SliderThumbElement::dragFrom
2003         https://bugs.webkit.org/show_bug.cgi?id=123873
2004
2005         Reviewed by Sam Weinig.
2006
2007         Moved Ref.
2008
2009         * html/RangeInputType.cpp:
2010         (WebCore::RangeInputType::handleMouseDownEvent):
2011         * html/shadow/SliderThumbElement.cpp:
2012         (WebCore::SliderThumbElement::dragFrom):
2013
2014 2013-11-06  Daniel Bates  <dabates@apple.com>
2015
2016         Cleanup FontMac.mm
2017         https://bugs.webkit.org/show_bug.cgi?id=123928
2018
2019         Reviewed by Andy Estes.
2020
2021         * platform/graphics/mac/FontMac.mm:
2022         (WebCore::showGlyphsWithAdvances): Inline the value of variable isVertical as we
2023         reference it exactly once and its value is sufficiently clear.
2024         (WebCore::Font::drawGlyphs): Remove default case in switch block so that the compiler
2025         checks that all cases are covered. Move definition of platformData to the top of the
2026         function and use it whenever we want to access the platform font data
2027
2028 2013-11-06  Brent Fulgham  <bfulgham@apple.com>
2029
2030         [WebGL] We should not allow generateMipMap on compressed textures
2031         https://bugs.webkit.org/show_bug.cgi?id=123915
2032         <rdar://problem/15201274>
2033
2034         Reviewed by Dean Jackson.
2035
2036         Found by existing conformance/extensions/webgl-compressed-texture-s3tc.html
2037
2038         * html/canvas/WebGLRenderingContext.cpp:
2039         (WebCore::WebGLRenderingContext::compressedTexImage2D): Set compressed flag.
2040         (WebCore::WebGLRenderingContext::compressedTexSubImage2D): Ditto.
2041         (WebCore::WebGLRenderingContext::generateMipmap): For Apple builds, check state
2042         of compressed flag and generate appropriate WebGL error if necessary.
2043         * html/canvas/WebGLTexture.cpp:
2044         (WebCore::WebGLTexture::WebGLTexture): Set compressed flag to false by default
2045         (WebCore::WebGLTexture::isCompressed): Added
2046         (WebCore::WebGLTexture::setCompressed): Added
2047         * html/canvas/WebGLTexture.h:
2048         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2049         (WebCore::GraphicsContext3D::generateMipmap): Switch implementation to use proper
2050         glGenerateMipmaps, rather than the glGenerateMipmapsEXT method.
2051
2052 2013-11-06  Joseph Pecoraro  <pecoraro@apple.com>
2053
2054         Web Inspector: Changes to CodeGeneratorInspectorStrings.py should rebuild inspector generated files
2055         https://bugs.webkit.org/show_bug.cgi?id=123925
2056
2057         Reviewed by Timothy Hatcher.
2058
2059         * CMakeLists.txt:
2060         * DerivedSources.make:
2061         * GNUmakefile.am:
2062
2063 2013-11-06  Bem Jones-Bey  <bjonesbe@adobe.com>
2064
2065         Rename region line offset methods
2066         https://bugs.webkit.org/show_bug.cgi?id=123897
2067
2068         Reviewed by Sam Weinig.
2069
2070         Because of the large number of overloads on the line offset methods,
2071         it is very hard to read code using them, which also makes it harder to
2072         move them out of RenderBlock. This patch renames the methods that take
2073         a region as an argument to make it clearer when looking at the code
2074         how the differ from the ones that don't.
2075
2076         No new tests, no behavior change.
2077
2078         * rendering/RenderBlock.cpp:
2079         (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
2080         * rendering/RenderBlock.h:
2081         (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
2082         (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
2083         (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
2084         (WebCore::RenderBlock::startOffsetForLineInRegion):
2085         (WebCore::RenderBlock::endOffsetForLineInRegion):
2086         (WebCore::RenderBlock::availableLogicalWidthForLine):
2087         * rendering/RenderBox.cpp:
2088         (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
2089         (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
2090
2091 2013-11-06  Antti Koivisto  <antti@apple.com>
2092
2093         HTMLCollection should use CollectionIndexCache
2094         https://bugs.webkit.org/show_bug.cgi?id=123906
2095
2096         Reviewed by Ryosuke Niwa.
2097         
2098         More code sharing.
2099
2100         * bindings/js/JSDOMWindowCustom.cpp:
2101         (WebCore::namedItemGetter):
2102         * bindings/js/JSHTMLDocumentCustom.cpp:
2103         (WebCore::JSHTMLDocument::nameGetter):
2104         * dom/ChildNodeList.h:
2105         * dom/CollectionIndexCache.h:
2106         (WebCore::::nodeBeforeCached):
2107         (WebCore::::nodeAfterCached):
2108         (WebCore::::nodeAt):
2109             
2110             Add a mechanism for disabling use of backward traversal.
2111
2112         * dom/LiveNodeList.h:
2113         (WebCore::LiveNodeList::collectionCanTraverseBackward):
2114         * html/HTMLCollection.cpp:
2115         (WebCore::HTMLCollection::HTMLCollection):
2116         (WebCore::isMatchingElement):
2117         (WebCore::HTMLCollection::iterateForPreviousElement):
2118         (WebCore::firstMatchingElement):
2119         (WebCore::nextMatchingElement):
2120         (WebCore::HTMLCollection::length):
2121         (WebCore::HTMLCollection::item):
2122         (WebCore::nameShouldBeVisibleInDocumentAll):
2123         (WebCore::firstMatchingChildElement):
2124         (WebCore::nextMatchingSiblingElement):
2125         (WebCore::HTMLCollection::firstElement):
2126         (WebCore::HTMLCollection::traverseForward):
2127         (WebCore::HTMLCollection::collectionFirst):
2128         (WebCore::HTMLCollection::collectionLast):
2129         (WebCore::HTMLCollection::collectionTraverseForward):
2130         (WebCore::HTMLCollection::collectionTraverseBackward):
2131         (WebCore::HTMLCollection::invalidateCache):
2132         (WebCore::HTMLCollection::namedItem):
2133         (WebCore::HTMLCollection::updateNameCache):
2134         * html/HTMLCollection.h:
2135         (WebCore::HTMLCollection::collectionCanTraverseBackward):
2136         
2137             Disable use of backward traversal for collections that use custom traversal.
2138
2139 2013-11-06  Brendan Long  <b.long@cablelabs.com>
2140
2141         Add "id" attribute to TextTrack
2142         https://bugs.webkit.org/show_bug.cgi?id=123825
2143
2144         Reviewed by Eric Carlson.
2145
2146         Test: media/track/track-id.html
2147
2148         * html/HTMLMediaElement.cpp:
2149         (HTMLMediaElement::addTextTrack): Add emptyString() for track id.
2150         * html/track/AudioTrack.cpp:
2151         (WebCore::AudioTrack::AudioTrack): Pass trackPrivate->id() to TrackBase.
2152         (WebCore::AudioTrack::idChanged): Added, set id.
2153         * html/track/AudioTrack.h: Move m_id to TrackBase.
2154         * html/track/InbandTextTrack.cpp:
2155         (WebCore::InbandTextTrack::InbandTextTrack): Pass trackPrivate->id() to TrackBase.
2156         (WebCore::InbandTextTrack::idChanged): Added, set id.
2157         * html/track/InbandTextTrack.h: Add idChanged().
2158         * html/track/LoadableTextTrack.cpp:
2159         (WebCore::LoadableTextTrack::LoadableTextTrack): Add emptyString() for track id.
2160         (WebCore::LoadableTextTrack::id): Override to return the track element's id.
2161         * html/track/TextTrack.cpp:
2162         (WebCore::TextTrack::captionMenuOffItem): Add empty string for track id.
2163         (WebCore::TextTrack::captionMenuAutomaticItem): Add empty string for track id.
2164         (WebCore::TextTrack::TextTrack): Pass id to TrackBase.
2165         * html/track/TextTrack.h:
2166         (WebCore::TextTrack::create): Add id parameter.
2167         * html/track/TextTrack.idl: Add id attribute.
2168         * html/track/TrackBase.cpp:
2169         (WebCore::TrackBase::TrackBase): Add m_id.
2170         * html/track/TrackBase.h: Add id attribute / m_id.
2171         * html/track/VideoTrack.cpp:
2172         (WebCore::VideoTrack::VideoTrack): Pass trackPrivate->id() to TrackBase.
2173         (WebCore::VideoTrack::idChanged): Added, set id.
2174         * html/track/VideoTrack.h: Move m_id to TrackBase.
2175         * platform/graphics/TrackPrivateBase.h: Add idChanged() callback.
2176
2177 2013-11-06  Antti Koivisto  <antti@apple.com>
2178
2179         Move array position caching out from HTMLCollection
2180         https://bugs.webkit.org/show_bug.cgi?id=123895
2181
2182         Reviewed by Darin Adler.
2183
2184         This caching complicates the logic but is used by a single subclass
2185         (HTMLFormControlsCollection) only. The subclass can do the caching itself.
2186
2187         * html/HTMLAllCollection.cpp:
2188         (WebCore::HTMLAllCollection::HTMLAllCollection):
2189         * html/HTMLCollection.cpp:
2190         (WebCore::HTMLCollection::HTMLCollection):
2191         (WebCore::HTMLCollection::create):
2192         (WebCore::HTMLCollection::item):
2193         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
2194         (WebCore::HTMLCollection::firstElement):
2195         
2196             Renamed from traverseFirstElement.
2197
2198         (WebCore::HTMLCollection::traverseForwardToOffset):
2199         (WebCore::HTMLCollection::invalidateCache):
2200         
2201             Make cache invalidation virtual so we can clear HTMLTableRowsCollection index cache.
2202
2203         (WebCore::HTMLCollection::namedItem):
2204         (WebCore::HTMLCollection::updateNameCache):
2205         
2206             Use traverseForwardToOffset instead traverseNextElement. This allows removal of traverseNextElement.
2207
2208         * html/HTMLCollection.h:
2209         (WebCore::HTMLCollection::usesCustomForwardOnlyTraversal):
2210         
2211             Renamed the enum and the accessor to be more informative.
2212
2213         (WebCore::HTMLCollection::setCachedElement):
2214         (WebCore::HTMLCollection::customElementAfter):
2215         
2216             Renamed from virtualItemAfter.
2217
2218         * html/HTMLFormControlsCollection.cpp:
2219         (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
2220         (WebCore::findFormAssociatedElement):
2221         (WebCore::HTMLFormControlsCollection::customElementAfter):
2222         
2223             Move the array position caching logic here.
2224
2225         (WebCore::HTMLFormControlsCollection::invalidateCache):
2226         * html/HTMLFormControlsCollection.h:
2227         * html/HTMLNameCollection.cpp:
2228         (WebCore::HTMLNameCollection::HTMLNameCollection):
2229         * html/HTMLOptionsCollection.cpp:
2230         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2231         * html/HTMLTableRowsCollection.cpp:
2232         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection):
2233         (WebCore::HTMLTableRowsCollection::customElementAfter):
2234         * html/HTMLTableRowsCollection.h:
2235
2236 2013-11-06  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
2237
2238         [ATK] accessibility/title-ui-element-correctness.html fails
2239         https://bugs.webkit.org/show_bug.cgi?id=99825
2240
2241         Reviewed by Mario Sanchez Prada.
2242
2243         When calling setAtkRelationSetFromCoreObject a new ATK_LABELLED_BY_RELATION
2244         is added, adding proper label element as a relation. When the document structure
2245         has been changed and a different label should be linked as a relation, current ATK
2246         implementation adds it as a next target on relation's target list, while
2247         WTR/DumpRenderTree implementation takes only first one into account.
2248         This patch adds a new function removing current relations before adding new ones.
2249
2250         Covered by existing tests.
2251
2252         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2253         (removeAtkRelationFromRelationSetByType):
2254         (setAtkRelationSetFromCoreObject):
2255
2256 2013-11-06  Daniel Bates  <dabates@apple.com>
2257
2258         Add ENABLE(TEXT_SELECTION)
2259         https://bugs.webkit.org/show_bug.cgi?id=123827
2260
2261         Reviewed by Ryosuke Niwa.
2262
2263         Add compile-time guard, ENABLE(TEXT_SELECTION), to enable or
2264         disable selection painting in WebCore (enabled by default).
2265
2266         On iOS we disable WebCore selection painting and have UIKit
2267         paint the selection.
2268
2269         * rendering/InlineTextBox.cpp:
2270         (WebCore::InlineTextBox::paintSelection): Only paint selection when
2271         TEXT_SELECTION is enabled.
2272         * rendering/LogicalSelectionOffsetCaches.h:
2273         (WebCore::LogicalSelectionOffsetCaches::LogicalSelectionOffsetCaches):
2274         For now, add a ENABLE(TEXT_SELECTION)-guard around an assertion. Added
2275         a FIXME comment to investigate the callers and either move the assertion
2276         to the appropriate callers or structure the code such that we can remove
2277         the assertion.
2278         * rendering/RenderBlock.cpp:
2279         (WebCore::RenderBlock::paintSelection): Only paint selection when
2280         TEXT_SELECTION is enabled.
2281         * rendering/TextPaintStyle.cpp:
2282         (WebCore::computeTextSelectionPaintStyle): Only compute the selection
2283         paint style when TEXT_SELECTION is enabled. Otherwise, return a paint
2284         style identical to the text paint style. Also, substitute nullptr for 0.
2285
2286 2013-11-06  Jer Noble  <jer.noble@apple.com>
2287
2288         Unrevewied Windows build fix after r158736; add InlineElementBox.cpp to the RenderingAllInOne.cpp file.
2289
2290         * rendering/RenderingAllInOne.cpp:
2291
2292 2013-11-06  Sergio Villar Senin  <svillar@igalia.com>
2293
2294         Unreviewed build fix, style() return type is now a reference.
2295
2296         * rendering/RenderGrid.cpp:
2297         (WebCore::RenderGrid::resolveGridPositionFromStyle):
2298
2299 2013-11-06  Jer Noble  <jer.noble@apple.com>
2300
2301         Unreviewed 32-bit Mac build fix; use an explicit FloatSize -> IntSize conversion function.
2302
2303         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2304         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
2305
2306 2013-11-04  Jer Noble  <jer.noble@apple.com>
2307
2308         Playing many sounds with HTML5 Audio makes WebKit unresponsive
2309         https://bugs.webkit.org/show_bug.cgi?id=116145
2310
2311         Reviewed by Eric Carlson.
2312
2313         Cache as much information as possible from AVPlayerItem to eliminate unneccesary
2314         calls into AVFoundation.
2315
2316         Add WillChange/DidChange functions to handle the results of KVO notifications
2317         from AVPlayerItem and AVPlayer:
2318         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2319         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
2320         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
2321         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateRate):
2322         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatusDidChange):
2323         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpWillChange):
2324         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackLikelyToKeepUpDidChange):
2325         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyWillChange):
2326         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferEmptyDidChange):
2327         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullWillChange):
2328         (WebCore::MediaPlayerPrivateAVFoundationObjC::playbackBufferFullDidChange):
2329         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
2330         (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
2331         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
2332         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasEnabledAudioDidChange):
2333         (WebCore::MediaPlayerPrivateAVFoundationObjC::presentationSizeDidChange):
2334         (WebCore::MediaPlayerPrivateAVFoundationObjC::durationDidChange):
2335         (WebCore::MediaPlayerPrivateAVFoundationObjC::rateDidChange):
2336         (WebCore::itemKVOProperties):
2337         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2338
2339         Instruct the HTMLMediaElement to cache the currentTime value for 5 seconds:
2340         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2341         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime):
2342
2343         Add and initialize member variables to hold these cached values:
2344         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2345         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2346         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2347         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
2348
2349         Add a new Notification type which can take (and call) a Function object:
2350         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2351         (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
2352         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
2353         (WebCore::MediaPlayerPrivateAVFoundation::Notification::Notification):
2354         (WebCore::MediaPlayerPrivateAVFoundation::Notification::function):
2355
2356         Implement queries in terms of the cached values of AVPlayerItem and AVPlayer
2357         properties:
2358         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2359         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2360         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
2361         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
2362         (WebCore::MediaPlayerPrivateAVFoundationObjC::playerItemStatus):
2363         (WebCore::MediaPlayerPrivateAVFoundationObjC::rate):
2364         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges):
2365         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable):
2366         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable):
2367         (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded):
2368         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes):
2369         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
2370         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateAudioTracks):
2371         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoTracks):
2372         (WebCore::MediaPlayerPrivateAVFoundationObjC::sizeChanged):
2373         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
2374
2375         Invalidate the cached currentTime before calling scheduleTimeUpdate so that the
2376         correct movieTime is saved in m_clockTimeAtLastUpdateEvent:
2377         * html/HTMLMediaElement.cpp:
2378         (HTMLMediaElement::setReadyState):
2379
2380 2013-10-24  Sergio Villar Senin  <svillar@igalia.com>
2381
2382         [CSS Grid Layout] Add support for named grid areas
2383         https://bugs.webkit.org/show_bug.cgi?id=120045
2384
2385         Reviewed by Andreas Kling.
2386
2387         From Blink r155555, r155850 and r155889 by <jchaffraix@chromium.org>
2388
2389         Added support for named grid areas. Basically a named grid area is
2390         now a valid grid position. The shorthand parsing of grid-area was
2391         split from the grid-{row|column} as the rules for expanding are
2392         slightly different.
2393
2394         Unknown grid area names are treated as 'auto' as per the
2395         specification. This means that for those cases we need to trigger
2396         the auto-placement algorithm.
2397
2398         Tests: fast/css-grid-layout/grid-item-bad-named-area-auto-placement.html
2399                fast/css-grid-layout/grid-item-named-grid-area-resolution.html
2400
2401         * css/CSSComputedStyleDeclaration.cpp:
2402         (WebCore::valueForGridPosition):
2403         * css/CSSParser.cpp:
2404         (WebCore::CSSParser::parseValue):
2405         (WebCore::CSSParser::parseGridPosition):
2406         (WebCore::gridMissingGridPositionValue):
2407         (WebCore::CSSParser::parseGridItemPositionShorthand):
2408         (WebCore::CSSParser::parseGridAreaShorthand):
2409         (WebCore::CSSParser::parseSingleGridAreaLonghand):
2410         * css/CSSParser.h:
2411         * css/StyleResolver.cpp:
2412         (WebCore::StyleResolver::adjustRenderStyle):
2413         (WebCore::StyleResolver::adjustGridItemPosition):
2414         (WebCore::createGridPosition):
2415         * css/StyleResolver.h:
2416         * rendering/RenderGrid.cpp:
2417         (WebCore::RenderGrid::resolveGridPositionFromStyle):
2418         * rendering/style/GridPosition.h:
2419         (WebCore::GridPosition::isNamedGridArea):
2420         (WebCore::GridPosition::setNamedGridArea):
2421         (WebCore::GridPosition::namedGridLine):
2422
2423 2013-11-06  Chris Fleizach  <cfleizach@apple.com>
2424
2425         AX: Audio and Video attachments are not output to VoiceOver
2426         https://bugs.webkit.org/show_bug.cgi?id=123479
2427
2428         Reviewed by Mario Sanchez Prada.
2429
2430         Video and audio elements don't appear as distinct objects in the AX hierarchy,
2431         nor are they treated as replaceable objects when emitting the text. We should
2432         treat these characters like attachments, for one. On the Mac platform, we should
2433         also identify them with special subroles.
2434
2435         Tests: platform/mac/accessibility/media-emits-object-replacement.html
2436                platform/mac/accessibility/media-role-descriptions.html
2437
2438         * accessibility/AccessibilityNodeObject.cpp:
2439         (WebCore::AccessibilityNodeObject::isGenericFocusableElement):
2440         * accessibility/AccessibilityObject.h:
2441         * accessibility/AccessibilityRenderObject.cpp:
2442         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
2443         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2444         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2445         (createAccessibilityRoleMap):
2446         (-[WebAccessibilityObjectWrapper subrole]):
2447         (-[WebAccessibilityObjectWrapper roleDescription]):
2448         * editing/TextIterator.cpp:
2449         (WebCore::isRendererReplacedElement):
2450
2451
2452 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
2453
2454         Notify nodes removal to Range/Selection after dispatching blur and mutation event
2455         https://bugs.webkit.org/show_bug.cgi?id=123880
2456
2457         Reviewed by Andreas Kling.
2458
2459         Merge https://chromium.googlesource.com/chromium/blink/+/b60576a0560d14f8757e58d55d37b7cefa48a6ac
2460
2461         In willRemoveChildren in ContainerNode.cpp, call Document::nodeChildrenWillBeRemoved after instead of
2462         before dispatching mutation events because we need to update ranges created by those mutation event
2463         listeners. willRemoveChild was fixed in r115686.
2464
2465         Tests: editing/selection/selection-change-in-blur-event-by-remove-children.html
2466                editing/selection/selection-change-in-mutation-event-by-remove-children.html
2467                fast/dom/Range/range-created-during-remove-children.html
2468
2469         * dom/ContainerNode.cpp:
2470         (WebCore::willRemoveChildren):
2471
2472 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
2473
2474         Fix out-of-date offset in selection range code in range.surroundContents
2475         https://bugs.webkit.org/show_bug.cgi?id=123871
2476
2477         Reviewed by Andreas Kling.
2478         
2479         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
2480
2481         The code in Range::insertNode assumeed that the start offset of the selection range within its container
2482         doesn't change across a call to insertBefore on the container but this is wrong. This patch recomputes
2483         the start offset when it is used after the insertBefore call.
2484
2485         Test: editing/selection/range-surroundContents-with-preceding-node.html
2486
2487         * dom/Range.cpp:
2488         (WebCore::Range::insertNode):
2489
2490 2013-11-06  Andreas Kling  <akling@apple.com>
2491
2492         Add InlineElementBox and stop instantiating InlineBox directly.
2493         <https://webkit.org/b/123882>
2494
2495         Make the InlineBox constructors protected and add a new class
2496         called InlineElementBox on top. This is somewhat analogous to the
2497         split between RenderText and RenderElement, and allows us to make
2498         renderer() return a far tighter RenderBoxModelObject& instead
2499         of a RenderObject&.
2500
2501         Moved over attachLine(), deleteLine() and extractLine() to start
2502         things off. More things will follow.
2503
2504         Reviewed by Antti Koivisto.
2505
2506 2013-11-06  Piotr Grad  <p.grad@samsung.com>
2507
2508         Seek for video doesn't work when playback rate is negative
2509         https://bugs.webkit.org/show_bug.cgi?id=123791
2510
2511         In MediaPlayerPrivateGStreamer::seek negative playback rate was not taken to account.
2512
2513         Reviewed by Philippe Normand.
2514
2515         Test: media/video-seek-with-negative-playback.html
2516
2517         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2518         (WebCore::MediaPlayerPrivateGStreamer::seek):
2519
2520 2013-11-06  Andreas Kling  <akling@apple.com>
2521
2522         Reinstate an annoying assertion that I accidentally commented out.
2523
2524         * loader/icon/IconDatabase.cpp:
2525         (WebCore::IconDatabase::synchronousIconForPageURL):
2526
2527 2013-11-06  Brendan Long  <b.long@cablelabs.com>
2528
2529         [GStreamer] Override label() and language() in Audio and VideoTrackPrivateGStreamer
2530         https://bugs.webkit.org/show_bug.cgi?id=123836
2531
2532         The tests are currently flakey because we only get the label and language if we get
2533         tags after the track client is set.
2534
2535         Reviewed by Philippe Normand.
2536
2537         No new tests because the tests already exist (this fixes flakeyness).
2538
2539         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Override label() and language() to use m_label and m_language.
2540         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Same.
2541         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h: Make m_label and m_language protected so they can be used in the functions above.
2542
2543 2013-11-05  Andreas Kling  <akling@apple.com>
2544
2545         RenderBlockFlow should only expose its line boxes as RootInlineBox.
2546         <https://webkit.org/b/123878>
2547
2548         The line boxes attached directly to a RenderBlockFlow are always
2549         RootInlineBox objects, so call sites should always use the tightly
2550         typed firstRootBox() and lastRootBox().
2551
2552         This allows the compiler to devirtualize calls to member functions
2553         of RootInlineBox that are marked FINAL.
2554
2555         Reviewed by Antti Koivisto.
2556
2557 2013-11-06  Ryosuke Niwa  <rniwa@webkit.org>
2558
2559         Assertion failure end < m_runCount in WebCore::BidiRunList<WebCore::BidiRun>::reverseRuns
2560         https://bugs.webkit.org/show_bug.cgi?id=123863
2561
2562         Reviewed by Andreas Kling.
2563
2564         Merge https://chromium.googlesource.com/chromium/blink/+/cbaa92c763a37d89eeabd01658e522219299290c
2565
2566         Test: fast/text/bidi-reverse-runs-crash.html
2567
2568         * platform/text/BidiResolver.h:
2569         (WebCore::BidiResolver<Iterator, Run>::createBidiRunsForLine): Don't reverse the runs if there's
2570         nothing to be reversed.
2571
2572 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2573
2574         Address the review comment after r158724.
2575
2576         * html/RangeInputType.cpp:
2577         (WebCore::RangeInputType::handleMouseDownEvent):
2578
2579 2013-11-05  Zalan Bujtas  <zalan@apple.com>
2580
2581         Widget's position change should not initiate layout, only when its size changes.
2582         https://bugs.webkit.org/show_bug.cgi?id=123860
2583
2584         Reviewed by Andreas Kling.
2585
2586         RenderWidgets initiate unnecessary layouts while scrolling when they are embedded to
2587         overflow:scroll containers. Scroll position change doesn't dirty the render tree
2588         so it should not trigger layout either.
2589
2590         Manual test added. Unfortunately we can't test against the number of layouts yet.
2591
2592         * rendering/RenderWidget.cpp:
2593         (WebCore::RenderWidget::setWidgetGeometry):
2594         (WebCore::RenderWidget::updateWidgetGeometry):
2595         (WebCore::RenderWidget::updateWidgetPosition):
2596
2597 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2598
2599         Use-after-free in SliderThumbElement::dragFrom
2600         https://bugs.webkit.org/show_bug.cgi?id=123873
2601
2602         Reviewed by Andreas Kling.
2603
2604         Ref the SliderThumbElement since it could go away inside dragFrom.
2605
2606         Test: fast/forms/range/range-type-change-onchange-2.html
2607
2608         * html/RangeInputType.cpp:
2609         (WebCore::RangeInputType::handleMouseDownEvent):
2610
2611 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2612
2613         Change the order of conditions to avoid computing rendererIsEditable()
2614         https://bugs.webkit.org/show_bug.cgi?id=123868
2615
2616         Reviewed by Andreas Kling.
2617
2618         Merge https://chromium.googlesource.com/chromium/blink/+/c89b413ff0fc4aafa0c71d180b0b1e131bb37707
2619
2620         When we need both Node::renderer() and Node::rendererIsEditable() conditions to be true to perform
2621         some operation, it is more effective to check for renderer() first, so that if this condition fails
2622         we can avoid unnecessary computation of rendererIsEditable().
2623
2624         * dom/Position.cpp:
2625         (WebCore::nextRenderedEditable):
2626         (WebCore::previousRenderedEditable):
2627         * page/EventHandler.cpp:
2628         (WebCore::EventHandler::handleMouseReleaseEvent):
2629
2630 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2631
2632         simpleUserAgentStyleSheet doesn't have focus ring on anchor element
2633         https://bugs.webkit.org/show_bug.cgi?id=123867
2634
2635         Reviewed by Andreas Kling.
2636
2637         Merge https://chromium.googlesource.com/chromium/blink/+/08ecc23c4d80be9969918c4baf0ac83dc6cb6cbd
2638
2639         * css/CSSDefaultStyleSheets.cpp:
2640
2641 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2642
2643         valueForBorderRadiusShorthand returns wrong values in some case
2644         https://bugs.webkit.org/show_bug.cgi?id=123866
2645
2646         Reviewed by Andreas Kling.
2647
2648         Merge https://chromium.googlesource.com/chromium/blink/+/0933728126f2db06ab8e945efc98bffa2d42af1c
2649
2650         Because valueForBorderRadiusShorthand misses the followings:
2651         - showHorizontalBottomRight depends on showHorizontalBottomLeft.
2652         - showHorizontalTopRight depends on showHorizontalBottomRight (including showHorizontalBottomLeft).
2653
2654         See also http://dev.w3.org/csswg/css-backgrounds/#the-border-radius
2655
2656         Test: fast/css/getComputedStyle/getComputedStyle-borderRadius-2.html
2657
2658         * css/CSSComputedStyleDeclaration.cpp:
2659         (WebCore::getBorderRadiusShorthandValue):
2660
2661 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2662
2663         Protect DOM nodes in IndentOutdentCommand::tryIndentingAsListItem()
2664         https://bugs.webkit.org/show_bug.cgi?id=123861
2665
2666         Reviewed by Benjamin Poulain.
2667
2668         Merge https://chromium.googlesource.com/chromium/blink/+/297442eb539a2b764fdad323de79099a70179186 partially.
2669
2670         * editing/IndentOutdentCommand.cpp:
2671         (WebCore::IndentOutdentCommand::tryIndentingAsListItem): Make selectedListItem, previousList, and nextList
2672         RefPtr since they're are used after calling insertNodeBefore.
2673
2674 2013-11-05  Andreas Kling  <akling@apple.com>
2675
2676         Apply more unique_ptr to line box management.
2677         <https://webkit.org/b/123857>
2678
2679         Make all of the functions that return newly-created line boxes
2680         return them packed up in std::unique_ptrs.
2681
2682         There is one exception in RenderBlockLineLayout where the function
2683         createInlineBoxForRenderer() is inconsistent about the ownership of
2684         the returned object. This will be addressed by a subsequent patch.
2685
2686         We now "release" the line boxes into their various home structures,
2687         so the pointer smartness doesn't go end-to-end just yet.
2688
2689         Reviewed by Anders Carlsson.
2690
2691 2013-11-05  Ryosuke Niwa  <rniwa@webkit.org>
2692
2693         getComputedStyle(x).lineHeight is affected by zooming
2694         https://bugs.webkit.org/show_bug.cgi?id=123847
2695
2696         Reviewed by Benjamin Poulain.
2697
2698         Merge https://chromium.googlesource.com/chromium/blink/+/7957097afbab2899ababd0d9c8acbf6e3eddb870
2699
2700         Test: fast/css/line-height-zoom-get-computed-style.html
2701
2702         * css/CSSComputedStyleDeclaration.cpp:
2703         (WebCore::lineHeightFromStyle): Don't round line-height values.
2704         * css/DeprecatedStyleBuilder.cpp:
2705         (WebCore::ApplyPropertyLineHeight::applyValue): Use the computed value instead of the used value.
2706
2707 2013-11-05  James Craig  <jcraig@apple.com>
2708
2709         AX: media controls accessibility needs more work
2710         https://bugs.webkit.org/show_bug.cgi?id=123749
2711
2712         Reviewed by Jer Noble.
2713
2714         Updated some of the control labels/roles to improve accessibility.
2715           - Volume slider is now keyboard/screenreader accessible.
2716           - muteButton was a checkbox toggling checked state, now a button that toggles label "mute/unmute"
2717           - fullscreenButton was a checkbox toggling checked state, now a button that toggles label "display/exit full screen"
2718           - captionButton was a checkbox, now a popup button that launches the newly accessible menu.
2719         Subtitles menu is now keyboard/screenreader accessible (uses roaming tabindex).
2720         Render dump expectations changed because volume slider is now hidden via... 
2721         ...opacity/size (to make accessible without hover) instead of display:none.
2722
2723         Updated existing test coverage.
2724
2725         * Modules/mediacontrols/mediaControlsApple.css:
2726         (audio::-webkit-media-controls-panel .volume-box):
2727         (audio::-webkit-media-controls-panel .volume-box:active):
2728         (audio::-webkit-media-controls-toggle-closed-captions-button):
2729         (audio::-webkit-media-controls-closed-captions-container .list):
2730         (audio::-webkit-media-controls-closed-captions-container li:focus):
2731         * Modules/mediacontrols/mediaControlsApple.js:
2732         (Controller.prototype.createControls):
2733         (Controller.prototype.handleFullscreenChange):
2734         (Controller.prototype.handleMuteButtonClicked):
2735         (Controller.prototype.handleMinButtonClicked):
2736         (Controller.prototype.handleMaxButtonClicked):
2737         (Controller.prototype.handleVolumeSliderChange):
2738         (Controller.prototype.buildCaptionMenu):
2739         (Controller.prototype.focusSiblingCaptionItem):
2740         (Controller.prototype.handleCaptionItemKeyUp):
2741
2742 2013-11-05  Andreas Kling  <akling@apple.com>
2743
2744         Move some plugin-specific code from RenderWidget to RenderEmbeddedObject.
2745         <https://webkit.org/b/123845>
2746
2747         All RenderWidgets representing plugins will be RenderEmbeddedObjects.
2748         Move some of the plugin-specific logic to RenderEmbeddedObject since it
2749         doesn't make sense for all RenderWidgets (frames, embedded documents)
2750         to care about this.
2751
2752         Reviewed by Anders Carlsson.
2753
2754 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2755
2756         Fix the 32-bit build.
2757
2758         * WebCore.exp.in:
2759
2760 2013-11-05  Alexandru Chiculita  <achicu@adobe.com>
2761
2762         Web Inspector: Moving an element while in the DOMNodeRemoved handler will hide it in the inspector
2763         https://bugs.webkit.org/show_bug.cgi?id=123516
2764
2765         Reviewed by Timothy Hatcher.
2766
2767         InspectorInstrumentation::willRemoveDOMNode was actually calling both willRemoveDOMNodeImpl and
2768         didRemoveDOMNodeImpl, making the DOMAgent unbind the element even if it was still part of the DOM.
2769
2770         Because of that the DOMAgent was sending two events:
2771         1. When the element was about to be removed, just before JS "DOMNodeRemoved" was triggered.
2772         2. When the element was actually removed.
2773
2774         Note that inspector's event #2 will not know about the node, as it just removed it from the
2775         internal hashmap, so it will just use a nodeID == 0 for it.
2776
2777         This patch adds a separate call to InspectorInstrumentation::didRemoveDOMNode, just before the
2778         element is about to be removed. The InspectorInstrumentation::willRemoveDOMNode call is now only used
2779         by the DOMDebugger to trigger the DOM breakpoints in the Web Inspector. That feature is not exposed
2780         in the new Inspector UI, but can be used/tested using the protocol directly.
2781
2782         Tests: inspector-protocol/dom-debugger/node-removed.html
2783                inspector-protocol/dom/dom-remove-events.html
2784                inspector-protocol/dom/remove-multiple-nodes.html
2785
2786         * dom/ContainerNode.cpp:
2787         (WebCore::ContainerNode::removeBetween):
2788         * inspector/InspectorInstrumentation.h:
2789         (WebCore::InspectorInstrumentation::willRemoveDOMNode):
2790         (WebCore::InspectorInstrumentation::didRemoveDOMNode):
2791
2792 2013-11-05  Ryuan Choi  <ryuan.choi@samsung.com>
2793
2794         Unreviewed build fix on CMake based ports with GLES.
2795
2796         * CMakeLists.txt:
2797         Added OPENGLES2_LIBRARIES and OPENGLES2_INCLUDE_DIR into the includes and
2798         libraries list.
2799
2800 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2801
2802         platformCALayerDeviceScaleFactor should be const
2803         https://bugs.webkit.org/show_bug.cgi?id=123842
2804
2805         Reviewed by Simon Fraser.
2806
2807         * WebCore.exp.in:
2808         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2809         (WebCore::LayerClient::platformCALayerDeviceScaleFactor):
2810         * platform/graphics/ca/GraphicsLayerCA.cpp:
2811         (WebCore::GraphicsLayerCA::platformCALayerDeviceScaleFactor):
2812         * platform/graphics/ca/GraphicsLayerCA.h:
2813         * platform/graphics/ca/PlatformCALayerClient.h:
2814         * platform/graphics/ca/mac/TileController.h:
2815         * platform/graphics/ca/mac/TileController.mm:
2816         (WebCore::TileController::platformCALayerDeviceScaleFactor):
2817         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
2818         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerDeviceScaleFactor):
2819         Constify PlatformCALayerClient::platformCALayerDeviceScaleFactor.
2820
2821 2013-11-05  Gavin Barraclough  <barraclough@apple.com>
2822
2823         Subresource loads should not prevent page throttling
2824         https://bugs.webkit.org/show_bug.cgi?id=123757
2825
2826         Reviewed by Alexey Proskuryakov.
2827
2828         The page-is-loading test for inhibiting process supression is currently
2829         too conservative, preventing supression of pages with infinitely loading
2830         resources (commonly XHRs). Instead, just rely on the FrameLoader being
2831         active (with hysteresis).
2832
2833         * loader/SubresourceLoader.cpp:
2834         (WebCore::SubresourceLoader::init):
2835         (WebCore::SubresourceLoader::checkForHTTPStatusCodeError):
2836         (WebCore::SubresourceLoader::didFinishLoading):
2837         (WebCore::SubresourceLoader::didFail):
2838         (WebCore::SubresourceLoader::willCancel):
2839         * loader/SubresourceLoader.h:
2840             - remove m_activityAssertion from SubresourceLoader.
2841
2842 2013-11-05  Tim Horton  <timothy_horton@apple.com>
2843
2844         [mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
2845         https://bugs.webkit.org/show_bug.cgi?id=123840
2846         <rdar://problem/15308765>
2847
2848         Reviewed by Alexey Proskuryakov.
2849
2850         Test: fast/images/pdf-as-image-crop-box.html
2851
2852         * platform/graphics/cg/PDFDocumentImage.cpp:
2853         (WebCore::PDFDocumentImage::size):
2854         Use the crop box when determining the size of the image.
2855
2856         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
2857         * platform/graphics/cg/PDFDocumentImage.h:
2858         * platform/graphics/mac/PDFDocumentImageMac.mm:
2859         (WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
2860         Get rid of m_mediaBox, since we don't need it anymore.
2861
2862         (WebCore::PDFDocumentImage::drawPDFPage):
2863         PDFKit does the translation by the crop box origin for us;
2864         if we do it additionally, we'll be painting the wrong part of the image.
2865         So, don't do the translation here.
2866
2867 2013-11-05  Antti Koivisto  <antti@apple.com>
2868
2869         Factor index cache for NodeLists and HTMLCollections to a class
2870         https://bugs.webkit.org/show_bug.cgi?id=123823
2871
2872         Reviewed by Ryosuke Niwa.
2873
2874         Implement index cache class that can used by NodeLists and HTMLCollections that currently
2875         each have implementations of their own.
2876         
2877         This patch also implements ChildNodeList and LiveNodeList using CollectionIndexCache.
2878         HTMLCollection is will be transitioned later.
2879
2880         * GNUmakefile.list.am:
2881         * WebCore.vcxproj/WebCore.vcxproj:
2882         * WebCore.xcodeproj/project.pbxproj:
2883         * dom/ChildNodeList.cpp:
2884         (WebCore::ChildNodeList::ChildNodeList):
2885         (WebCore::ChildNodeList::length):
2886         (WebCore::ChildNodeList::item):
2887         
2888             The client calls to cache to for indexed and size access.
2889
2890         (WebCore::ChildNodeList::collectionFirst):
2891         (WebCore::ChildNodeList::collectionLast):
2892         (WebCore::ChildNodeList::collectionTraverseForward):
2893         (WebCore::ChildNodeList::collectionTraverseBackward):
2894         
2895             Cache calls back to these as needed to do the actual traversal.
2896
2897         (WebCore::ChildNodeList::invalidateCache):
2898         * dom/ChildNodeList.h:
2899         * dom/CollectionIndexCache.h: Added.
2900         
2901             Templated cache class itself.
2902
2903         (WebCore::::CollectionIndexCache):
2904         (WebCore::::nodeCount):
2905         (WebCore::::nodeBeforeCached):
2906         (WebCore::::nodeAfterCached):
2907         (WebCore::::nodeAt):
2908         (WebCore::::invalidate):
2909         * dom/LiveNodeList.cpp:
2910         (WebCore::firstMatchingElement):
2911         (WebCore::nextMatchingElement):
2912         (WebCore::traverseMatchingElementsForward):
2913         (WebCore::LiveNodeList::collectionFirst):
2914         (WebCore::LiveNodeList::collectionLast):
2915         (WebCore::LiveNodeList::collectionTraverseForward):
2916         (WebCore::LiveNodeList::collectionTraverseBackward):
2917         (WebCore::LiveNodeList::length):
2918         (WebCore::LiveNodeList::item):
2919         (WebCore::LiveNodeList::invalidateCache):
2920         * dom/LiveNodeList.h:
2921         (WebCore::LiveNodeList::LiveNodeList):
2922
2923 2013-11-05  Enrica Casucci  <enrica@apple.com>
2924
2925         Full width semicolon is wrong in vertical text.
2926         https://bugs.webkit.org/show_bug.cgi?id=123814
2927         <rdar://problem/15312541>
2928
2929         Reviewed by Benjamin Poulain.
2930
2931         The full width semicolon should always be upright.
2932         Adding it to the list of characters that should
2933         ignore rotation.
2934
2935         * platform/graphics/FontGlyphs.cpp:
2936         (WebCore::shouldIgnoreRotation):
2937
2938 2013-11-05  Andreas Kling  <akling@apple.com>
2939
2940         Remove unused RenderWidget::notifyWidget().
2941
2942         Rubber-stamped by Anders Carlsson.
2943
2944 2013-11-05  Commit Queue  <commit-queue@webkit.org>
2945
2946         Unreviewed, rolling out r158678.
2947         http://trac.webkit.org/changeset/158678
2948         https://bugs.webkit.org/show_bug.cgi?id=123820
2949
2950         Causes a new debug assertion failure on the Mavericks test
2951         system. (Requested by bfulgham on #webkit).
2952
2953         * rendering/mathml/RenderMathMLOperator.cpp:
2954
2955 2013-11-05  Renata Hodovan  <reni@webkit.org>
2956
2957         ASSERTION FAILED: isHTMLTitleElement(m_titleElement.get()) in WebCore::Document::setTitle
2958         https://bugs.webkit.org/show_bug.cgi?id=122092
2959
2960         Reviewed by Darin Adler.
2961
2962         Remove a bogus assert in Document::setTitle().
2963         m_titleElement can be either of HTMLTitleElement or SVGTitleElement. The assertion was wrong.
2964         
2965         Backported from Blink:
2966         https://src.chromium.org/viewvc/blink?revision=158620&view=revision
2967
2968         Test: svg/custom/title-assertion.html
2969
2970         * dom/Document.cpp:
2971         (WebCore::Document::setTitle):
2972         * svg/SVGTitleElement.cpp:
2973         (WebCore::SVGTitleElement::insertedInto):
2974
2975 2013-11-05  Martin Robinson  <mrobinson@igalia.com>
2976
2977         [MathML] Poor spacing around delimiters in MathML Torture Test 14
2978         https://bugs.webkit.org/show_bug.cgi?id=122837
2979
2980         Reviewed by Brent Fulgham.
2981
2982         Instead of stretching the vertical bar with the stretchable version, just repeat
2983         the normal vertical bar. This follows what Gecko does when rendering tall vertical
2984         bars and also works around an issue with STIX fonts leading to poor spacing in
2985         formulas.
2986
2987         * rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the
2988         normal variant.
2989
2990 2013-11-05  Daniel Bates  <dabates@apple.com>
2991
2992         XSSAuditor should catch reflected srcdoc properties even without a <frame> tag injection
2993
2994         From Blink r160615 by <tsepez@chromium.org>
2995         https://src.chromium.org/viewvc/blink?view=rev&revision=160615
2996
2997         Test: http/tests/security/xssAuditor/iframe-srcdoc-property-blocked.html
2998
2999         * html/parser/XSSAuditor.cpp:
3000         (WebCore::XSSAuditor::filterIframeToken):
3001
3002 2013-11-05  Éva Balázsfalvi  <balazsfalvi.eva@stud.u-szeged.hu>
3003
3004         Delete maketokenizer.
3005         https://bugs.webkit.org/show_bug.cgi?id=115155
3006
3007         Reviewed by Zoltan Herczeg.
3008
3009         This script was used to generate the old flex based CSS tokenizer. It
3010         was replaced by a custom tokenizer in r106217 but the script wasn't
3011         removed. Since there is no mention of it in the original bug nor any
3012         reference to maketokenizer in our build files, it's probably an
3013         oversight.
3014
3015         Merge from blink:
3016         https://chromium.googlesource.com/chromium/blink/+/2a1c8aaf867f707ccdcd8893446e907e2aa2e1c2
3017
3018         * css/maketokenizer: Removed.
3019
3020 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
3021
3022         Unreviewed. Unbreaking GCC builds.
3023
3024         * html/HTMLCollection.cpp:
3025         (WebCore::isMatchingElement): This inline function is not a template anymore.
3026
3027 2013-11-05  Antti Koivisto  <antti@apple.com>
3028
3029         Make it compile.
3030
3031         * dom/LiveNodeList.h:
3032         (WebCore::LiveNodeList::LiveNodeList):
3033         (WebCore::LiveNodeList::~LiveNodeList):
3034         * dom/NodeRareData.h:
3035         (WebCore::NodeListsNodeData::adoptDocument):
3036         * html/HTMLCollection.cpp:
3037         (WebCore::HTMLCollection::HTMLCollection):
3038         (WebCore::HTMLCollection::~HTMLCollection):
3039
3040 2013-11-05  Antti Koivisto  <antti@apple.com>
3041
3042         HTMLCollection should not be NodeList
3043         https://bugs.webkit.org/show_bug.cgi?id=123794
3044
3045         Reviewed by Andreas Kling.
3046
3047         HTMLCollection and NodeList are unrelated types in DOM yet our HTMLCollection inherits NodeList
3048         for code sharing reasons. While some code does get shared the types are sufficiently different 
3049         that this results in lots of unnecessary branches, complexity and general awkwardness. Code sharing 
3050         can be better achieved by means other than inheritance.
3051         
3052         This patch splits HTMLCollection from NodeList by copy-pasting and eliminating resulting redundancies. 
3053         Sharing comes later.
3054
3055         * dom/Attr.cpp:
3056         (WebCore::Attr::setValue):
3057         (WebCore::Attr::childrenChanged):
3058         * dom/ClassNodeList.cpp:
3059         (WebCore::ClassNodeList::~ClassNodeList):
3060         * dom/ContainerNode.cpp:
3061         (WebCore::ContainerNode::childrenChanged):
3062         (WebCore::ContainerNode::getElementsByTagName):
3063         (WebCore::ContainerNode::getElementsByName):
3064         (WebCore::ContainerNode::getElementsByClassName):
3065         (WebCore::ContainerNode::radioNodeList):
3066         * dom/Document.cpp:
3067         (WebCore::Document::Document):
3068         (WebCore::Document::~Document):
3069         (WebCore::Document::registerNodeList):
3070         (WebCore::Document::unregisterNodeList):
3071         (WebCore::Document::registerCollection):
3072         (WebCore::Document::unregisterCollection):
3073         (WebCore::Document::ensureCachedCollection):
3074         
3075             Add separate functions and map for registering HTMLCollections.
3076
3077         (WebCore::Document::all):
3078         (WebCore::Document::windowNamedItems):
3079         (WebCore::Document::documentNamedItems):
3080         * dom/Document.h:
3081         * dom/Element.cpp:
3082         (WebCore::Element::attributeChanged):
3083         (WebCore::Element::ensureCachedHTMLCollection):
3084         (WebCore::Element::cachedHTMLCollection):
3085         * dom/LiveNodeList.cpp:
3086         (WebCore::LiveNodeList::rootNode):
3087         (WebCore::isMatchingElement):
3088         (WebCore::LiveNodeList::iterateForPreviousElement):
3089         (WebCore::LiveNodeList::itemBefore):
3090         (WebCore::firstMatchingElement):
3091         (WebCore::nextMatchingElement):
3092         (WebCore::traverseMatchingElementsForwardToOffset):
3093         (WebCore::LiveNodeList::traverseLiveNodeListFirstElement):
3094         (WebCore::LiveNodeList::traverseLiveNodeListForwardToOffset):
3095         (WebCore::LiveNodeList::isLastItemCloserThanLastOrCachedItem):
3096         (WebCore::LiveNodeList::isFirstItemCloserThanCachedItem):
3097         (WebCore::LiveNodeList::length):
3098         (WebCore::LiveNodeList::item):
3099         (WebCore::LiveNodeList::elementBeforeOrAfterCachedElement):
3100         
3101             This code used to live in HTMLCollection.cpp. Copy-paste here and remove all branches not needed for NodeLists.
3102
3103         (WebCore::LiveNodeList::invalidateCache):
3104         
3105             NodeLists have no name caches.
3106
3107         * dom/LiveNodeList.h:
3108         (WebCore::LiveNodeList::LiveNodeList):
3109         (WebCore::LiveNodeList::~LiveNodeList):
3110         (WebCore::LiveNodeList::isRootedAtDocument):
3111         (WebCore::LiveNodeList::type):
3112         (WebCore::LiveNodeList::invalidateCache):
3113         (WebCore::LiveNodeList::setCachedElement):
3114         
3115             Merge LiveNodeListBase and LiveNodeList.
3116             Remove fields and code supporting HTMLCollection.
3117
3118         (WebCore::shouldInvalidateTypeOnAttributeChange):
3119         
3120             Move to global scope. This function is used both HTMLCollections and LiveNodeLists.
3121
3122         * dom/NameNodeList.cpp:
3123         (WebCore::NameNodeList::~NameNodeList):
3124         * dom/NameNodeList.h:
3125         (WebCore::NameNodeList::create):
3126         * dom/Node.cpp:
3127         (WebCore::shouldInvalidateNodeListCachesForAttr):
3128         (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
3129         (WebCore::Document::invalidateNodeListAndCollectionCaches):
3130         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
3131         (WebCore::NodeListsNodeData::invalidateCaches):
3132         * dom/Node.h:
3133         * dom/NodeRareData.h:
3134         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
3135         (WebCore::NodeListsNodeData::addCacheWithName):
3136         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
3137         (WebCore::NodeListsNodeData::addCachedCollection):
3138         (WebCore::NodeListsNodeData::cachedCollection):
3139         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
3140         (WebCore::NodeListsNodeData::removeCacheWithName):
3141         (WebCore::NodeListsNodeData::removeCachedCollection):
3142         (WebCore::NodeListsNodeData::isEmpty):
3143         (WebCore::NodeListsNodeData::adoptDocument):
3144         (WebCore::NodeListsNodeData::namedCollectionKey):
3145         (WebCore::NodeListsNodeData::namedNodeListKey):
3146         (WebCore::NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLastList):
3147         
3148             Add separate cache for HTMLCollections.
3149
3150         * dom/TagNodeList.cpp:
3151         (WebCore::TagNodeList::TagNodeList):
3152         (WebCore::TagNodeList::~TagNodeList):
3153         * dom/TagNodeList.h:
3154         (WebCore::TagNodeList::create):
3155         (WebCore::HTMLTagNodeList::create):
3156         * html/CollectionType.h:
3157         
3158             Remove NodeList types.
3159
3160         * html/HTMLCollection.cpp:
3161         (WebCore::shouldOnlyIncludeDirectChildren):
3162         (WebCore::rootTypeFromCollectionType):
3163         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
3164         (WebCore::HTMLCollection::HTMLCollection):
3165         (WebCore::HTMLCollection::~HTMLCollection):
3166         (WebCore::HTMLCollection::rootNode):
3167         (WebCore::isMatchingElement):
3168         (WebCore::HTMLCollection::iterateForPreviousElement):
3169         (WebCore::HTMLCollection::itemBefore):
3170         (WebCore::firstMatchingElement):
3171         (WebCore::nextMatchingElement):
3172         (WebCore::traverseMatchingElementsForwardToOffset):
3173         (WebCore::HTMLCollection::isLastItemCloserThanLastOrCachedItem):
3174         (WebCore::HTMLCollection::isFirstItemCloserThanCachedItem):
3175         (WebCore::HTMLCollection::setCachedElement):
3176         (WebCore::HTMLCollection::length):
3177         (WebCore::HTMLCollection::item):
3178         (WebCore::HTMLCollection::elementBeforeOrAfterCachedElement):
3179         (WebCore::HTMLCollection::traverseFirstElement):
3180         (WebCore::HTMLCollection::traverseNextElement):
3181         (WebCore::HTMLCollection::traverseForwardToOffset):
3182         (WebCore::HTMLCollection::invalidateCache):
3183         (WebCore::HTMLCollection::invalidateIdNameCacheMaps):
3184         (WebCore::HTMLCollection::namedItem):
3185         
3186             Remove NodeList specific branches and functions.
3187             LiveNodeListBase functions are now HTMLCollection functions.
3188
3189         * html/HTMLCollection.h:
3190         (WebCore::HTMLCollection::isRootedAtDocument):
3191         (WebCore::HTMLCollection::invalidationType):
3192         (WebCore::HTMLCollection::type):
3193         (WebCore::HTMLCollection::ownerNode):
3194         (WebCore::HTMLCollection::invalidateCache):
3195         (WebCore::HTMLCollection::document):
3196         (WebCore::HTMLCollection::overridesItemAfter):
3197         (WebCore::HTMLCollection::isElementCacheValid):
3198         (WebCore::HTMLCollection::cachedElement):
3199         (WebCore::HTMLCollection::cachedElementOffset):
3200         (WebCore::HTMLCollection::isLengthCacheValid):
3201         (WebCore::HTMLCollection::cachedLength):
3202         (WebCore::HTMLCollection::setLengthCache):
3203         (WebCore::HTMLCollection::setCachedElement):
3204         (WebCore::HTMLCollection::isItemRefElementsCacheValid):
3205         (WebCore::HTMLCollection::setItemRefElementsCacheValid):
3206         (WebCore::HTMLCollection::rootType):
3207         (WebCore::HTMLCollection::hasNameCache):
3208         (WebCore::HTMLCollection::setHasNameCache):
3209         
3210             Copy-paste functions and fields from former LiveNodeListBase.
3211
3212         * html/HTMLNameCollection.cpp:
3213         (WebCore::HTMLNameCollection::~HTMLNameCollection):
3214         * html/LabelableElement.cpp:
3215         (WebCore::LabelableElement::labels):
3216         * html/LabelsNodeList.cpp:
3217         (WebCore::LabelsNodeList::~LabelsNodeList):
3218         * html/LabelsNodeList.h:
3219         * html/RadioNodeList.cpp:
3220         (WebCore::RadioNodeList::~RadioNodeList):
3221         * html/RadioNodeList.h:
3222         (WebCore::RadioNodeList::create):
3223
3224 2013-11-05  Emilio Pozuelo Monfort  <pochu27@gmail.com>
3225
3226         [GTK] Add stubs for missing symbols in dom bindings
3227         https://bugs.webkit.org/show_bug.cgi?id=123663
3228
3229         Reviewed by Carlos Garcia Campos.
3230
3231         * bindings/gobject/WebKitDOMCustom.cpp:
3232         (webkit_dom_html_head_element_get_profile):
3233         (webkit_dom_html_head_element_set_profile):
3234         (webkit_dom_processing_instruction_get_data):
3235         (webkit_dom_processing_instruction_set_data):
3236         * bindings/gobject/WebKitDOMCustom.h:
3237         * bindings/gobject/WebKitDOMCustom.symbols:
3238
3239 2013-11-05  Zan Dobersek  <zdobersek@igalia.com>
3240
3241         Main thread tasks in ThreadableBlobRegistry should use std::unique_ptr
3242         https://bugs.webkit.org/show_bug.cgi?id=122946
3243
3244         Reviewed by Darin Adler.
3245
3246         The new BlobRegistryContext objects don't have to be adopted into OwnPtr and then have OwnPtr's leaked pointer
3247         passed into the WTF::callOnMainThread call - the pointer to the new heap-allocated object is passed in directly,
3248         with the object ending up being managed by std::unique_ptr in the designated main thread task.
3249
3250         * fileapi/ThreadableBlobRegistry.cpp:
3251         (WebCore::registerBlobURLTask):
3252         (WebCore::ThreadableBlobRegistry::registerBlobURL):
3253         (WebCore::registerBlobURLFromTask):
3254         (WebCore::unregisterBlobURLTask):
3255         (WebCore::ThreadableBlobRegistry::unregisterBlobURL):
3256
3257 2013-11-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3258
3259         [CSS] Enable css-image-orientation on EFL and GTK ports.
3260         https://bugs.webkit.org/show_bug.cgi?id=123698
3261
3262         Reviewed by Beth Dakin.
3263
3264         r157909 added wrong early return for css-image-orientation. It causes about 20 regressions in layout test
3265         when enabling css-image-orientation. This fixes those wrong implementation as well as enables it on EFL
3266         and GTK ports by default.
3267
3268         Test: fast/css/image-orientation/image-orientation.html
3269
3270         * loader/cache/CachedImage.cpp:
3271         (WebCore::CachedImage::imageSizeForRenderer):
3272         * platform/graphics/BitmapImage.cpp:
3273         (WebCore::BitmapImage::updateSize):
3274
3275 2013-11-05  Andreas Kling  <akling@apple.com>
3276
3277         RenderEmbeddedObject shouldn't know about fallback content.
3278         <https://webkit.org/b/123781>
3279
3280         Stop caching the presence of fallback (DOM) content in a flag on
3281         RenderEmbeddedObject and have SubframeLoader fetch it directly from
3282         HTMLObjectElement instead.
3283
3284         Also made SubframeLoader::requestObject() take the owner element
3285         by reference since we don't support owner-less embedded objects.
3286
3287         Reviewed by Antti Koivisto.
3288
3289 2013-11-05  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3290
3291         [GStreamer] Remove NATIVE_FULLSCREEN_VIDEO support
3292         https://bugs.webkit.org/show_bug.cgi?id=123437
3293
3294         Reviewed by Philippe Normand.
3295
3296         Removed some dead code as no GStreamer port is using the native
3297         fullscreen video support.
3298
3299         * GNUmakefile.list.am:
3300         * PlatformEfl.cmake:
3301         * PlatformGTK.cmake: Removed compilation of deleted files.
3302         * platform/graphics/MediaPlayer.h: Removed structures related to
3303         GStreamer and NATIVE_FULLSCREEN_VIDEO.
3304         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.cpp: Removed.
3305         * platform/graphics/gstreamer/FullscreenVideoControllerGStreamer.h: Removed.
3306         * platform/graphics/gstreamer/GStreamerGWorld.cpp: Removed.
3307         * platform/graphics/gstreamer/GStreamerGWorld.h: Removed.
3308         * platform/graphics/gstreamer/ImageGStreamerCairo.cpp: Removed
3309         gst/video/video.h include.
3310         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3311         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3312         (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia):
3313         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
3314         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3315         Removed code related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
3316         * platform/graphics/gstreamer/PlatformVideoWindow.h: Removed.
3317         * platform/graphics/gstreamer/PlatformVideoWindowEfl.cpp: Removed.
3318         * platform/graphics/gstreamer/PlatformVideoWindowGtk.cpp: Removed.
3319         * platform/graphics/gstreamer/PlatformVideoWindowMac.mm: Removed.
3320         * platform/graphics/gstreamer/PlatformVideoWindowNix.cpp: Removed.
3321         * platform/graphics/gstreamer/PlatformVideoWindowPrivate.h: Removed.
3322         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3323         (webkitVideoSinkRender):
3324         (webkitVideoSinkNew):
3325         * platform/graphics/gstreamer/VideoSinkGStreamer.h: Removed code
3326         related to GStreamer and NATIVE_FULLSCREEN_VIDEO.
3327         * platform/graphics/gtk/FullscreenVideoControllerGtk.cpp: Removed.
3328         * platform/graphics/gtk/FullscreenVideoControllerGtk.h: Removed.
3329
3330 2013-11-05  Andreas Kling  <akling@apple.com>
3331
3332         Remove RenderWidget::viewCleared().
3333         <https://webkit.org/b/123777>
3334
3335         This was some ancient hand-waving code from the KHTML era.
3336
3337         It was obviously confused (e.g RenderEmbeddedObject trying to handle
3338         iframe owners, even though that setup is impossible.)
3339
3340         Reviewed by Anders Carlsson.
3341
3342 2013-11-04  Brady Eidson  <beidson@apple.com>
3343
3344         IDB: Split backend Cursors and Transactions into their own files
3345         https://bugs.webkit.org/show_bug.cgi?id=123789
3346
3347         Reviewed by Alexey Proskuryakov.
3348
3349         No new tests (Rename, no change in behavior).
3350
3351         * CMakeLists.txt:
3352         * GNUmakefile.list.am:
3353         * WebCore.xcodeproj/project.pbxproj:
3354
3355         * Modules/indexeddb/IDBBackingStoreCursorInterface.h:
3356         (WebCore::IDBBackingStoreCursorInterface::~IDBBackingStoreCursorInterface):
3357
3358         * Modules/indexeddb/IDBBackingStoreInterface.h:
3359
3360         * Modules/indexeddb/IDBBackingStoreTransactionInterface.h: Added.
3361         (WebCore::IDBBackingStoreTransactionInterface::~IDBBackingStoreTransactionInterface):
3362
3363         * Modules/indexeddb/IDBCursorBackendImpl.cpp:
3364         (WebCore::IDBCursorBackendImpl::IDBCursorBackendImpl):
3365         * Modules/indexeddb/IDBCursorBackendImpl.h:
3366         (WebCore::IDBCursorBackendImpl::create):
3367
3368         * Modules/indexeddb/IDBFactoryBackendInterface.h:
3369
3370         * Modules/indexeddb/IDBIndexWriter.cpp:
3371         (WebCore::IDBIndexWriter::writeIndexKeys):
3372         (WebCore::IDBIndexWriter::verifyIndexKeys):
3373         (WebCore::IDBIndexWriter::addingKeyAllowed):
3374         * Modules/indexeddb/IDBIndexWriter.h:
3375
3376         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
3377         (WebCore::IDBTransactionBackendImpl::createCursorBackend):
3378         * Modules/indexeddb/IDBTransactionBackendImpl.h:
3379         * Modules/indexeddb/IDBTransactionBackendInterface.h:
3380
3381         * Modules/indexeddb/IDBTransactionBackendOperations.cpp:
3382         (WebCore::GetOperation::perform):
3383         (WebCore::OpenCursorOperation::perform):
3384         (WebCore::CountOperation::perform):
3385         (WebCore::DeleteRangeOperation::perform):
3386
3387         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.cpp: Added.
3388         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
3389         (WebCore::IDBBackingStoreCursorLevelDB::firstSeek):
3390         (WebCore::IDBBackingStoreCursorLevelDB::advance):
3391         (WebCore::IDBBackingStoreCursorLevelDB::continueFunction):
3392         (WebCore::IDBBackingStoreCursorLevelDB::haveEnteredRange):
3393         (WebCore::IDBBackingStoreCursorLevelDB::isPastBounds):
3394         * Modules/indexeddb/leveldb/IDBBackingStoreCursorLevelDB.h: Added.
3395         (WebCore::IDBBackingStoreCursorLevelDB::~IDBBackingStoreCursorLevelDB):
3396         (WebCore::IDBBackingStoreCursorLevelDB::IDBBackingStoreCursorLevelDB):
3397
3398         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
3399         (WebCore::IDBBackingStoreLevelDB::compareIndexKeys):
3400         (WebCore::IDBBackingStoreLevelDB::updateIDBDatabaseVersion):
3401         (WebCore::IDBBackingStoreLevelDB::createObjectStore):
3402         (WebCore::IDBBackingStoreLevelDB::deleteObjectStore):
3403         (WebCore::IDBBackingStoreLevelDB::getRecord):
3404         (WebCore::IDBBackingStoreLevelDB::putRecord):
3405         (WebCore::IDBBackingStoreLevelDB::clearObjectStore):
3406         (WebCore::IDBBackingStoreLevelDB::deleteRecord):
3407         (WebCore::IDBBackingStoreLevelDB::getKeyGeneratorCurrentNumber):
3408         (WebCore::IDBBackingStoreLevelDB::maybeUpdateKeyGeneratorCurrentNumber):
3409         (WebCore::IDBBackingStoreLevelDB::keyExistsInObjectStore):
3410         (WebCore::IDBBackingStoreLevelDB::createIndex):
3411         (WebCore::IDBBackingStoreLevelDB::deleteIndex):
3412         (WebCore::IDBBackingStoreLevelDB::putIndexDataForRecord):
3413         (WebCore::findGreatestKeyLessThanOrEqual):
3414         (WebCore::IDBBackingStoreLevelDB::findKeyInIndex):
3415         (WebCore::IDBBackingStoreLevelDB::getPrimaryKeyViaIndex):
3416         (WebCore::IDBBackingStoreLevelDB::keyExistsInIndex):
3417         (WebCore::ObjectStoreKeyCursorImpl::create):
3418         (WebCore::ObjectStoreKeyCursorImpl::clone):
3419         (WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
3420         (WebCore::ObjectStoreCursorImpl::create):
3421         (WebCore::ObjectStoreCursorImpl::clone):
3422         (WebCore::ObjectStoreCursorImpl::ObjectStoreCursorImpl):
3423         (WebCore::objectStoreCursorOptions):
3424         (WebCore::indexCursorOptions):
3425         (WebCore::IDBBackingStoreLevelDB::openObjectStoreCursor):
3426         (WebCore::IDBBackingStoreLevelDB::openObjectStoreKeyCursor):
3427         (WebCore::IDBBackingStoreLevelDB::openIndexKeyCursor):
3428         (WebCore::IDBBackingStoreLevelDB::openIndexCursor):
3429         (WebCore::IDBBackingStoreLevelDB::createBackingStoreTransaction):
3430         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
3431  
3432        * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.cpp: Added.
3433         (WebCore::IDBBackingStoreTransactionLevelDB::IDBBackingStoreTransactionLevelDB):
3434         (WebCore::IDBBackingStoreTransactionLevelDB::begin):
3435         (WebCore::IDBBackingStoreTransactionLevelDB::commit):
3436         (WebCore::IDBBackingStoreTransactionLevelDB::rollback):
3437         * Modules/indexeddb/leveldb/IDBBackingStoreTransactionLevelDB.h:
3438
3439         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.cpp:
3440         (WebCore::IDBFactoryBackendLevelDB::createCursorBackend):
3441         * Modules/indexeddb/leveldb/IDBFactoryBackendLevelDB.h:
3442
3443 2013-11-04  Zalan Bujtas  <zalan@apple.com>
3444
3445         Do not call setFrameRect on Widget unless its boundaries changed.
3446         https://bugs.webkit.org/show_bug.cgi?id=123781
3447
3448         Reviewed by Andreas Kling.
3449
3450         Call Widget:setFrameRect only when the frame's rect actually changes. It also
3451         cleans up the related weak reference code a bit.
3452         
3453         Covered by existing tests.
3454
3455         * rendering/RenderWidget.cpp:
3456         (WebCore::RenderWidget::setWidgetGeometry): 
3457
3458 2013-11-04  Santosh Mahto  <santosh.ma@samsung.com>
3459
3460         [webcore/html] remove extra header includes from cpp files.
3461         https://bugs.webkit.org/show_bug.cgi?id=123740
3462
3463         Reviewed by Darin Adler.
3464
3465         Removing redundant headers.
3466
3467         * html/BaseDateAndTimeInputType.cpp:
3468         * html/ColorInputType.cpp:
3469         * html/DOMFormData.cpp:
3470         * html/DOMURL.cpp:
3471         * html/DateInputType.cpp:
3472         * html/DateTimeInputType.cpp:
3473         * html/DateTimeLocalInputType.cpp:
3474         * html/FTPDirectoryDocument.cpp:
3475         * html/FileInputType.cpp:
3476         * html/FormController.cpp:
3477         * html/HTMLAnchorElement.cpp:
3478         * html/HTMLAreaElement.cpp:
3479         * html/HTMLCanvasElement.cpp:
3480         * html/HTMLCollection.cpp:
3481         * html/HTMLDetailsElement.cpp:
3482         * html/HTMLDocument.cpp:
3483         * html/HTMLElement.cpp:
3484         * html/HTMLFormControlsCollection.cpp:
3485         * html/HTMLFormElement.cpp:
3486         * html/HTMLImageElement.cpp:
3487         * html/HTMLInputElement.cpp:
3488         * html/HTMLLegendElement.cpp:
3489         * html/HTMLMapElement.cpp:
3490         * html/HTMLMediaElement.cpp:
3491         * html/HTMLOptionElement.cpp:
3492         * html/HTMLOptionsCollection.cpp:
3493         * html/HTMLPlugInImageElement.cpp:
3494         * html/HTMLProgressElement.cpp:
3495         * html/HTMLSummaryElement.cpp:
3496         * html/HTMLTemplateElement.cpp:
3497         * html/HTMLVideoElement.cpp:
3498         * html/HTMLViewSourceDocument.cpp:
3499         * html/MediaController.cpp:
3500         * html/MediaKeyEvent.cpp:
3501         * html/MonthInputType.cpp:
3502         * html/RangeInputType.cpp:
3503         * html/StepRange.cpp:
3504         * html/TextFieldInputType.cpp:
3505         * html/TimeInputType.cpp:
3506         * html/WeekInputType.cpp:
3507         * html/canvas/CanvasRenderingContext.cpp:
3508         * html/canvas/CanvasRenderingContext2D.cpp:
3509         * html/canvas/CanvasStyle.cpp:
3510         * html/canvas/OESVertexArrayObject.cpp:
3511         * html/parser/BackgroundHTMLParser.cpp:
3512         * html/parser/CSSPreloadScanner.cpp:
3513         * html/parser/CompactHTMLToken.cpp:
3514         * html/parser/HTMLConstructionSite.cpp:
3515         * html/parser/HTMLDocumentParser.cpp:
3516         * html/parser/HTMLElementStack.cpp:
3517         * html/parser/HTMLFormattingElementList.cpp:
3518         * html/parser/HTMLMetaCharsetParser.cpp:
3519         * html/parser/HTMLParserIdioms.cpp:
3520         * html/parser/HTMLPreloadScanner.cpp:
3521         * html/parser/HTMLTokenizer.cpp:
3522         * html/parser/HTMLTreeBuilder.cpp:
3523         * html/parser/HTMLTreeBuilderSimulator.cpp:
3524         * html/parser/HTMLViewSourceParser.cpp:
3525         * html/parser/TextDocumentParser.cpp:
3526         * html/parser/XSSAuditor.cpp:
3527         * html/shadow/ContentDistributor.cpp:
3528         * html/shadow/InsertionPoint.cpp:
3529         * html/shadow/MediaControlElements.cpp:
3530         * html/shadow/MediaControlsApple.cpp:
3531         * html/shadow/MediaControlsBlackBerry.cpp:
3532         * html/shadow/MediaControlsGtk.cpp:
3533         * html/shadow/SliderThumbElement.cpp:
3534         * html/track/AudioTrack.cpp:
3535         * html/track/InbandGenericTextTrack.cpp:
3536         * html/track/InbandTextTrack.cpp:
3537         * html/track/InbandWebVTTTextTrack.cpp:
3538         * html/track/TextTrack.cpp:
3539         * html/track/TextTrackCueGeneric.cpp:
3540         * html/track/TextTrackList.cpp:
3541         * html/track/TextTrackRegion.cpp:
3542         * html/track/TrackListBase.cpp:
3543         * html/track/VideoTrack.cpp:
3544         * html/track/WebVTTParser.cpp:
3545
3546 2013-11-04  Brady Eidson  <beidson@apple.com>
3547
3548         IDB: deleteDatabase() interface should be asynchronous
3549         https://bugs.webkit.org/show_bug.cgi?id=123787
3550
3551         Reviewed by Tim Horton.
3552
3553         No new tests (No behavior change for a tested port).
3554
3555         deleteDatabase now has no return value, but calls back to a bool function:
3556         * Modules/indexeddb/IDBBackingStoreInterface.h:
3557         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
3558         (WebCore::IDBBackingStoreLevelDB::deleteDatabase):
3559         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
3560
3561         Refactor to account for the new async deleteDatabase:
3562         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
3563         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
3564         (WebCore::IDBDatabaseBackendImpl::deleteDatabase):
3565         (WebCore::IDBDatabaseBackendImpl::deleteDatabaseAsync):
3566         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
3567
3568 2013-11-04  Brady Eidson  <beidson@apple.com>
3569
3570         Add Modules/indexeddb/leveldb to the WebCore.xcodeproj
3571
3572         Rubberstamped by Andreas Kling.
3573
3574         This will make hacking on IDB much easier for Mac developers as they won’t have
3575         to constantly add and then subtract the leveldb subdirectory.
3576
3577         The USE(LEVELDB) flag is still disabled so these files won’t actually build by default.
3578
3579         * WebCore.xcodeproj/project.pbxproj:
3580
3581 2013-11-04  Brady Eidson  <beidson@apple.com>
3582
3583         Address review feedback I forgot to commit in r158641
3584
3585         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
3586         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls):
3587
3588 2013-11-04  Brady Eidson  <beidson@apple.com>
3589
3590         IDB: Make opening/establishing a database asynchronous.
3591         https://bugs.webkit.org/show_bug.cgi?id=123775
3592
3593         Reviewed by Andreas Kling.
3594
3595         No new tests (No behavior change for a tested port).
3596
3597         * Modules/indexeddb/IDBBackingStoreInterface.h: Add getOrEstablishIDBDatabaseMetadata with a callback,
3598           removing getIDBDatabaseMetaData, getObjectStores, and createIDBDatabaseMetaData in the process.
3599
3600         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.cpp:
3601         (WebCore::IDBBackingStoreLevelDB::getOrEstablishIDBDatabaseMetadata): Adapted from getIDBDatabaseMetaData,
3602           implement the asynchronous interface in terms of other LevelDB methods, always calling back synchronously.
3603         (WebCore::IDBBackingStoreLevelDB::createIDBDatabaseMetaData):
3604         * Modules/indexeddb/leveldb/IDBBackingStoreLevelDB.h:
3605
3606         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
3607         (WebCore::IDBDatabaseBackendImpl::create):
3608         (WebCore::IDBDatabaseBackendImpl::openInternalAsync): Broken off from openInternal.
3609         (WebCore::IDBDatabaseBackendImpl::didOpenInternalAsync): Broken off from openInternal.
3610         (WebCore::IDBDatabaseBackendImpl::processPendingCalls):
3611         (WebCore::IDBDatabaseBackendImpl::processPendingOpenCalls): Broken off to allow didOpenInternalAsync
3612           to perform open callbacks in the failure case.
3613         (WebCore::IDBDatabaseBackendImpl::openConnection): Always queue open connection calls, then immediately processPendingCalls.
3614         (WebCore::IDBDatabaseBackendImpl::openConnectionInternal): Actually perform open connection calls.
3615         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
3616
3617
3618 2013-11-04  Andreas Kling  <akling@apple.com>
3619
3620         CTTE: RenderFrameBase's widget is always a FrameView.
3621         <https://webkit.org/b/123771>
3622
3623         Delete widget() from RenderFrameBase and supplant a childView()
3624         that returns FrameView*. Strip away unnecessary casts and asserts.
3625
3626         Reviewed by Antti Koivisto.
3627
3628 2013-11-04  Zoltan Horvath  <zoltan@webkit.org>
3629
3630         [CSS Regions][CSS Shapes] Content in region doesn't respect shape-outside after initial layout pass
3631         <https://webkit.org/b/114829>
3632
3633         Although we set the size of a shape for shape-outside in RenderBlockFlow::insertFloatingObject based on the
3634         float's size, the actual height of the float is not always resolved at that point. (Look at cases when the shape
3635         has percentage based height or percentage based radius.) ShapeInfo::setShapeSize triggers a layout for 0 height
3636         value, which will be overriden later, when RenderBlockFlow::positionNewFloats sets the actual size of the float (shape).
3637         Thus it doesn't make sense to set the shape's size in insertFloatingObject and run those extra unnecessary layout passes,
3638         since it'll be overriden anyways. I moved the shape size setting logic into RenderBlockFlow::positionNewFloats.
3639
3640         The problem showed up when we had a shape-outside ellipse with percentage based radius, and we inserted the content
3641         with JavaScript into a region flow. The content has been layed out based on the 0 border radius, and relayout hasn't been
3642         triggered when it flew into the flow. This change sets the shape size only when we already have the height of the float,
3643         so the radius(es) can be resolved correctly, thus no unnecessary layout passes will happen and the layout will be correct as well.
3644
3645         Reviewed by David Hyatt.
3646
3647         Test: fast/shapes/shape-outside-floats/shape-outside-floats-layout-after-initial-layout-pass.html
3648
3649         * rendering/RenderBlockFlow.cpp:
3650         (WebCore::RenderBlockFlow::insertFloatingObject): Remove setting the size of the shape.
3651         (WebCore::RenderBlockFlow::positionNewFloats): Set the size of the shape here.
3652
3653 2013-11-04  Samuel White  <samuel_white@apple.com>
3654
3655         AX: AXShowMenu doesn't always work.
3656         https://bugs.webkit.org/show_bug.cgi?id=123649
3657
3658         Reviewed by Chris Fleizach.
3659
3660         No new tests, the change occurs in a code path that forces the context menu to show which
3661         locks up DRT if we try to test it (platform menu is shown). The change itself gives the mouse
3662         event handler a chance to handle our platform mouse event BEFORE the event ends up in the show
3663         context menu machinery. This is necessary because without it, the element will not become
3664         focused. Without focus, accessibility shows different/less menu items than a mouse click. The
3665         end result is that context menus shown via accessibility are consistent with menus shown via click.
3666
3667         * page/ContextMenuController.cpp:
3668         (WebCore::ContextMenuController::showContextMenuAt):
3669
3670 2013-11-04  Jeffrey Pfau  <jpfau@apple.com>
3671
3672         SMIL timers can still fire after the containing document has been torn down
3673         <https://webkit.org/b/123291>
3674
3675         Reviewed by Darin Adler.
3676
3677         Ensure that the timers get paused when the document is preparing to be torn down.
3678
3679         Test: svg/animations/smil-timers-not-disabled-crash.html
3680
3681         * dom/Document.cpp:
3682         (WebCore::Document::dropChildren):
3683         (WebCore::Document::commonTeardown):
3684         (WebCore::Document::prepareForDestruction):
3685         * dom/Document.h:
3686
3687 2013-11-04  Brendan Long  <b.long@cablelabs.com>
3688
3689         Move duplicate code in TrackPrivate classes to a common base class
3690         https://bugs.webkit.org/show_bug.cgi?id=123619
3691
3692         Reviewed by Darin Adler.
3693
3694         No new tests because this is just refactoring.
3695
3696         * GNUmakefile.list.am: Add TrackPrivateBase.
3697         * WebCore.vcxproj/WebCore.vcxproj: Same.
3698         * WebCore.vcxproj/WebCore.vcxproj.filters: Same.
3699         * WebCore.xcodeproj/project.pbxproj: Same.
3700         * html/track/AudioTrack.cpp:
3701         (WebCore::AudioTrack::inbandTrackIndex): Renamed audioTrackIndex() to trackIndex().
3702         (WebCore::AudioTrack::labelChanged): First argument is now a TrackPrivateBase*.
3703         (WebCore::AudioTrack::languageChanged): Same.
3704         (WebCore::AudioTrack::willRemove): Same.
3705         * html/track/AudioTrack.h: Update TrackPrivateBaseClient function signatures.
3706         * html/track/InbandTextTrack.cpp:
3707         (WebCore::InbandTextTrack::inbandTrackIndex): Renamed textTrackIndex() to trackIndex().
3708         (WebCore::InbandTextTrack::labelChanged): First argument is now a TrackPrivateBase*.
3709         (WebCore::InbandTextTrack::languageChanged): Same.
3710         (WebCore::InbandTextTrack::willRemove): Same.
3711         * html/track/InbandTextTrack.h: Update TrackPrivateBaseClient function signatures.
3712         * html/track/VideoTrack.cpp:
3713         (WebCore::VideoTrack::inbandTrackIndex): Renamed videoTrackIndex() to trackIndex().
3714         (WebCore::VideoTrack::labelChanged): First argument is now a TrackPrivateBase*.
3715         (WebCore::VideoTrack::languageChanged): Same.
3716         (WebCore::VideoTrack::willRemove): Same.
3717         * html/track/VideoTrack.h: Update TrackPrivateBaseClient function signatures.
3718         * platform/graphics/AudioTrackPrivate.h: Remove code that was moved to TrackPrivateBase.
3719         * platform/graphics/InbandTextTrackPrivate.h: Same.
3720         * platform/graphics/InbandTextTrackPrivateClient.h: Same.
3721         * platform/graphics/VideoTrackPrivate.h: Same.
3722         * platform/graphics/TrackPrivateBase.h: Refactored out duplicate code in AudioTrackPrivate, InbandTextTrackPrivate and VideoTrackPrivate.
3723         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: Renamed textTrackIndex() to trackIndex().
3724         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h: Same.
3725         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h: Renamed audioTrackIndex() to trackIndex().
3726         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h: Renamed videoTrackIndex() to trackIndex90.
3727
3728 2013-11-04  Andreas Kling  <akling@apple.com>
3729
3730         FrameView destructor is worried about being retained by a renderer.
3731         <https://webkit.org/b/123763>
3732
3733         There's no way we can be in ~FrameView() while also being owned by
3734         a RenderWidget. Remove some overly paranoid code that was making sure
3735         the renderer didn't have a reference on us.
3736
3737         Reviewed by Anders Carlsson.
3738
3739 2013-11-04  Eric Carlson  <eric.carlson@apple.com>
3740
3741         REGRESSION(r158311): media/media-fragments/TC0054.html and TC0061.html hit assertions
3742         https://bugs.webkit.org/show_bug.cgi?id=123555
3743
3744         Reviewed by Darin Adler.
3745
3746         No new tests, covered by existing tests.
3747
3748         * html/MediaFragmentURIParser.cpp:
3749         (WebCore::MediaFragmentURIParser::parseFragments): Don't add a fragment with empty key or value as
3750             they will not processed.
3751         (WebCore::MediaFragmentURIParser::parseNPTFragment): Remove excess whitespace.
3752
3753 2013-11-04  Patrick Gansterer  <paroga@webkit.org>
3754
3755         Remove code duplications in createFontCustomPlatformData()
3756         https://bugs.webkit.org/show_bug.cgi?id=123706
3757
3758         Reviewed by Darin Adler.
3759
3760         Move OpenTypeSanitizer and WOFF handling from the port specific
3761         implementations in createFontCustomPlatformData() into the only
3762         caller of this function CachedFont::ensureCustomFontData().
3763         Also change the parameter passing the SharedBuffer from a
3764         pointer to a reference since it is never null.
3765
3766         * loader/cache/CachedFont.cpp:
3767         (WebCore::CachedFont::ensureCustomFontData):
3768         * platform/graphics/blackberry/FontCustomPlatformData.h:
3769         * platform/graphics/blackberry/FontCustomPlatformDataBlackBerry.cpp:
3770         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
3771         (WebCore::createFontCustomPlatformData):
3772         * platform/graphics/cairo/FontCustomPlatformData.h:
3773         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
3774         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
3775         (WebCore::createFontCustomPlatformData):
3776         * platform/graphics/mac/FontCustomPlatformData.cpp:
3777         (WebCore::createFontCustomPlatformData):
3778         * platform/graphics/mac/FontCustomPlatformData.h:
3779         * platform/graphics/win/FontCustomPlatformData.cpp:
3780         (WebCore::createFontCustomPlatformData):
3781         * platform/graphics/win/FontCustomPlatformData.h:
3782         * platform/graphics/win/FontCustomPlatformDataCairo.cpp:
3783         (WebCore::createFontCustomPlatformData):
3784         * platform/graphics/wince/FontCustomPlatformData.cpp:
3785         (WebCore::createFontCustomPlatformData):
3786         * platform/graphics/wince/FontCustomPlatformData.h:
3787
3788 2013-11-04  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
3789
3790         Fixing MediaStreamDescriptor addSource and addTrack methods
3791         https://bugs.webkit.org/show_bug.cgi?id=123755
3792
3793         Reviewed by Eric Carlson.
3794
3795         We must store the track and source that is passed as parameter in a RefPtr,
3796         otherwise we will refer to a null pointer.
3797
3798         No new tests needed.
3799
3800         * platform/mediastream/MediaStreamDescriptor.cpp:
3801         (WebCore::MediaStreamDescriptor::addSource):
3802         (WebCore::MediaStreamDescriptor::addTrack):
3803
3804 2013-11-04  Tim Horton  <timothy_horton@apple.com>
3805
3806         Remove PlatformCALayer::playerLayer
3807         https://bugs.webkit.org/show_bug.cgi?id=123764
3808
3809         Reviewed by Sam Weinig.
3810
3811         * platform/graphics/ca/PlatformCALayer.h:
3812         * platform/graphics/ca/mac/PlatformCALayerMac.h:
3813         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
3814         (PlatformCALayerMac::clone):
3815         Remove playerLayer(), fold it into clone().
3816
3817 2013-11-04  Chris Fleizach  <cfleizach@apple.com>
3818
3819         AX: Mail attachments at the start of an email are not output by VoiceOver
3820         https://bugs.webkit.org/show_bug.cgi?id=123697
3821
3822         Reviewed by Ryosuke Niwa.
3823
3824         VoiceOver is expecting that "replaced elements" (attachments in a Mail message in this case) to be
3825         represented by the replacement character when asking for a stringForRange.
3826
3827         However, when that replaced element is at the beginning of the document, the logic does not work because
3828         there is a few code places that will take that first Position and advance it forward, not accounting for replaced elements.
3829         When using the TextIterator normally, it does account for these, so that's why it's only affecting as at the beginning of the document.
3830
3831         Also a "replaced element" can be more than just renderer->isReplaced(), hence the externing of the isRendererReplacedElement method
3832         and using that it in pertinent places.
3833
3834         Tests: platform/mac/accessibility/object-replacement-with-no-rendered-children-at-node-start.html
3835                platform/mac/accessibility/object-replacement-with-rendered-children-at-node-start.html
3836
3837         * accessibility/AccessibilityObject.cpp:
3838         (WebCore::replacedNodeNeedsCharacter):
3839         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3840         (nsStringForReplacedNode):
3841         * dom/Position.cpp:
3842         (WebCore::Position::isCandidate):
3843         * dom/PositionIterator.cpp:
3844         * dom/Range.cpp:
3845         (WebCore::Range::firstNode):
3846         * editing/TextIterator.cpp:
3847         (WebCore::isRendererReplacedElement):
3848         * editing/TextIterator.h:
3849
3850 2013-11-04  Andreas Kling  <akling@apple.com>
3851
3852         Use RenderAncestorIterator in a couple of places.
3853         <https://webkit.org/b/123725>
3854
3855         Take the ancestorsOfType<RenderMoo>() thingy out for a spin.
3856
3857         Found a bunch of parent chain walking loops that were really just
3858         looking for the first ancestor renderer of a certain type.
3859         They were a perfect fit for this pattern:
3860
3861             if (auto svgRoot = ancestorsOfType<RenderSVGRoot>(renderer).first())
3862                 svgRoot->shakeMoneyMaker();
3863
3864         Quite a bit clearer than the previous:
3865
3866             for (auto ancestor = renderer.parent(); ancestor; ancestor = ancestor->parent()) {
3867                 if (ancestor->isSVGRoot())
3868                     toRenderSVGRoot(ancestor)->makeMoneyShaker();
3869             }
3870
3871         Reviewed by Antti Koivisto.
3872
3873 2013-10-25  Jer Noble  <jer.noble@apple.com>
3874
3875         [MSE] Add a SourceBufferPrivateClient interface for platform -> html communication.
3876         https://bugs.webkit.org/show_bug.cgi?id=123373
3877
3878         Reviewed by Eric Carlson.
3879
3880         To enable communication between SourceBuffer and SourceBufferPrivate without introducing
3881         layering violations, add a new interface class SourceBufferPrivateInterface from which
3882         SourceBuffer will inherit.
3883
3884         * Modules/mediasource/SourceBuffer.cpp:
3885         (WebCore::SourceBuffer::SourceBuffer): Set the private's client.
3886         (WebCore::SourceBuffer::~SourceBuffer): Clear the private's client.
3887         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Added stub.
3888         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Hinno.
3889         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Ditto.
3890         (WebCore::SourceBuffer::sourceBufferPrivateHasAudio): Ditto.
3891         (WebCore::SourceBuffer::sourceBufferPrivateHasVideo): Ditto.
3892         * Modules/mediasource/SourceBuffer.h:
3893         * WebCore.xcodeproj/project.pbxproj: Add new files to project.
3894         * platform/graphics/SourceBufferPrivate.h:
3895         * platform/graphics/SourceBufferPrivateClient.h: Added.
3896         (WebCore::SourceBufferPrivateClient::~SourceBufferPrivateClient): Empty destructor.
3897
3898 2013-11-01  Jer Noble  <jer.noble@apple.com>
3899
3900         [PluginProxy] Add a setting to disable video plugin proxy support in HTMLMediaElement.
3901         https://bugs.webkit.org/show_bug.cgi?id=123621
3902
3903         Reviewed by Eric Carlson.
3904
3905         Add a new Setting which will disable the video plugin proxy. Enable support for AVFoundation
3906         in iOS (which requries fixing a few compile errors resulting from classes and methods which
3907         are not available on iOS.
3908
3909         * WebCore.exp.in: Export wkAVAssetResolvedURL.
3910         * css/StyleResolver.cpp:
3911         (WebCore::StyleResolver::canShareStyleWithElement): Make conditional upon
3912             new isVideoPluginProxyEnabled() setting.
3913         * html/HTMLMediaElement.cpp:
3914         (WebCore::HTMLMediaElement::parseAttribute): Ditto.
3915         * html/HTMLMediaElement.h:
3916         * html/HTMLVideoElement.cpp:
3917         (WebCore::HTMLVideoElement::createRenderer): Ditto.
3918         (WebCore::HTMLVideoElement::attach): Ditto.
3919         (WebCore::HTMLVideoElement::parseAttribute): Ditto.
3920         (HTMLVideoElement::setDisplayMode): Ditto.
3921         * html/HTMLVideoElement.h:
3922         * page/Settings.cpp:
3923         (WebCore::Settings::setVideoPluginProxyEnabled): Simple setter.
3924         * page/Settings.h:
3925         (WebCore::Settings::isVideoPluginProxyEnabled): Simple getter.
3926         * platform/graphics/MediaPlayer.cpp:
3927         (WebCore::installedMediaEngines): Conditionally add MediaPlayerPrivateIOS and always add
3928             MediaPlayerPriateAVFoundationObjC.
3929         * platform/graphics/MediaPlayerPrivate.h:
3930         (WebCore::MediaPlayerPrivateInterface::deliverNotification): Add default implementation.
3931         (WebCore::MediaPlayerPrivateInterface::setMediaPlayerProxy): Ditto.
3932         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3933         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3934         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Use new
3935             HAS_ and USE_ macros instead of __MAC_OS_MIN_VERNSION_REQUIRED.
3936         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Ditto.
3937         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasContextRenderer): Ditto.
3938         (WebCore::MediaPlayerPrivateAVFoundationObjC::createContextVideoRenderer): Ditto.
3939         (WebCore::MediaPlayerPrivateAVFoundationObjC::destroyContextVideoRenderer): Ditto.
3940         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
3941         (WebCore::MediaPlayerPrivateAVFoundationObjC::paint): Ditto.
3942         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer): Use cachedCGColor instead
3943             of CGColorGetConstantColor.
3944         (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput): Use CVPixelBuffer pixel
3945             format constant instead of QuickDraw constant.
3946         (WebCore::MediaPlayerPrivateAVFoundationObjC::createPixelBuffer): Ditto.
3947         (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): Draw to intermediary
3948             CGImage on iOS.
3949         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
3950         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3951         * platform/ios/WebCoreSystemInterfaceIOS.mm:
3952         * platform/mac/WebCoreSystemInterface.h:
3953
3954 2013-11-04  Andreas Kling  <akling@apple.com>
3955
3956         REGRESSION(r158561): fast/block/float/float-append-child-crash.html asserting.
3957
3958         The non-const ancestor iterator was walking siblings, not ancestors.
3959
3960         Rubber-stamped by Antti Koivisto.
3961
3962 2013-10-31  Jer Noble  <jer.noble@apple.com>
3963
3964         [MSE] [Mac] Disclaim support for MSE in AVFoundation and QTKit engines
3965         https://bugs.webkit.org/show_bug.cgi?id=123593
3966
3967         Reviewed by Eric Carlson.
3968
3969         Immediately fail if asked to load a Media Source in engines which do not support
3970         them.
3971
3972         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3973         (WebCore::MediaPlayerPrivateAVFoundation::load):
3974         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3975         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3976         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
3977         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3978         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3979         (WebCore::MediaPlayerPrivateQTKit::load):
3980         (WebCore::MediaPlayerPrivateQTKit::supportsType):
3981
3982 2013-11-04  Hans Muller  <hmuller@adobe.com>
3983
3984         [CSS Shapes] image valued shape element margin can cause an ASSERT fail
3985         https://bugs.webkit.org/show_bug.cgi?id=123743
3986
3987         Reviewed by Andreas Kling.
3988
3989         When margin-top is specified for a shape's element, the Y coordinates passed
3990         to RasterShapeIntervals::getExcludedIntervals() may be negative. This is
3991         because the incoming logical coordinates are relative to the content or
3992         padding box, depending on the box-sizing property. The RasterShape::getExcludedIntervals()
3993         method now clips the incoming Y coordinates to the shape's bounds before
3994         accessing the shape's intervals.
3995
3996         Test: fast/shapes/shape-outside-floats/shape-outside-floats-margin-crash.html
3997
3998         * rendering/shapes/RasterShape.cpp:
3999         (WebCore::RasterShapeIntervals::getExcludedIntervals):
4000
4001 2013-11-04  Antti Koivisto  <antti@apple.com>
4002
4003         Make LiveNodeListBase use Elements instead of Nodes
4004         https://bugs.webkit.org/show_bug.cgi?id=123745
4005
4006         Reviewed by Anders Carlsson.
4007
4008         * WebCore.exp.in:
4009         * dom/Element.cpp:
4010         (WebCore::Element::firstElementChild):
4011         (WebCore::Element::lastElementChild):
4012         
4013             Switch to correct calls. ElementTraversal::previous and previousChild are no longer equivalent.
4014
4015         * dom/ElementTraversal.h:
4016         (WebCore::::lastWithinTemplate):
4017         (WebCore::::previousTemplate):
4018         
4019             Fix ElementTraversal::lastWithin and previous. They had no real clients and didn't work correctly.
4020             With LiveNodeListBase starting to use these they get excellent test coverage.
4021
4022         * dom/LiveNodeList.cpp:
4023         (WebCore::LiveNodeListBase::invalidateCache):
4024         * dom/LiveNodeList.h:
4025         (WebCore::LiveNodeListBase::LiveNodeListBase):
4026         (WebCore::LiveNodeListBase::isElementCacheValid):
4027         (WebCore::LiveNodeListBase::cachedElement):
4028         (WebCore::LiveNodeListBase::cachedElementOffset):
4029         (WebCore::LiveNodeListBase::setCachedElement):
4030         
4031             Make the cache Element based.
4032             Switch to Elements in all helpers.
4033             Rename item -> element for clarity.
4034
4035         * dom/NodeIterator.cpp:
4036         (WebCore::NodeIterator::NodePointer::moveToPrevious):
4037         (WebCore::NodeIterator::updateForNodeRemoval):
4038         
4039             This code expected the old inconsistent NodeTraversal::previous behavior where the traversal includes
4040             the root as the last item. Drop the stayWithin parameter and handle the one case where it is needed here.
4041
4042         * dom/NodeTraversal.cpp:
4043         (WebCore::NodeTraversal::last):
4044         (WebCore::NodeTraversal::deepLastChild):