2008-04-17 Anders Carlsson <andersca@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-04-17  Anders Carlsson  <andersca@apple.com>
2
3         Reviewed by Sam.
4
5         Add JS bindings for the DOMApplicationCache object.
6         
7         * bindings/js/JSDOMApplicationCacheCustom.cpp:
8         (WebCore::JSDOMApplicationCache::add):
9         (WebCore::JSDOMApplicationCache::remove):
10         (WebCore::JSDOMApplicationCache::addEventListener):
11         (WebCore::JSDOMApplicationCache::removeEventListener):
12         (WebCore::JSDOMApplicationCache::dispatchEvent):
13         (WebCore::JSDOMApplicationCache::setOnchecking):
14         (WebCore::JSDOMApplicationCache::onchecking):
15         (WebCore::JSDOMApplicationCache::setOnerror):
16         (WebCore::JSDOMApplicationCache::onerror):
17         (WebCore::JSDOMApplicationCache::setOnnoupdate):
18         (WebCore::JSDOMApplicationCache::onnoupdate):
19         (WebCore::JSDOMApplicationCache::setOndownloading):
20         (WebCore::JSDOMApplicationCache::ondownloading):
21         (WebCore::JSDOMApplicationCache::setOnprogress):
22         (WebCore::JSDOMApplicationCache::onprogress):
23         (WebCore::JSDOMApplicationCache::setOnupdateready):
24         (WebCore::JSDOMApplicationCache::onupdateready):
25         (WebCore::JSDOMApplicationCache::setOncached):
26         (WebCore::JSDOMApplicationCache::oncached):
27         (WebCore::JSDOMApplicationCache::mark):
28         * bindings/js/JSDOMWindowCustom.cpp:
29         (WebCore::JSDOMWindow::mark):
30         * bindings/js/JSEventTargetBase.cpp:
31         (WebCore::toJS):
32         * loader/appcache/DOMApplicationCache.idl:
33         * page/DOMWindow.idl:
34
35 2008-04-17 Eric Carlson  <eric.carlson@apple.com> 
36
37         Reviewed by Adele. 
38
39         Fix for <rdar://problem/5861642> QTMovieWin returns uninitialized values
40
41         * platform/graphics/win/QTMovieWin.cpp:
42         (QTMovieWin::rate):
43         (QTMovieWin::setRate):
44         (QTMovieWin::setVolume):
45         (QTMovieWin::getNaturalSize):
46
47 2008-04-17  Marco Barisione  <marco.barisione@collabora.co.uk>
48
49         Reviewed by Alp Toker.
50
51         http://bugs.webkit.org/show_bug.cgi?id=18335
52         Pango font backend unable to display japanese properly
53
54         Different fonts can have different glyph indices, so we need to pass
55         the right font when retrieving a glyph index.
56
57         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp:
58         (WebCore::pango_font_get_glyph): Temporarily override the font in the
59         PangoAnalysis passed to pango_shape.
60
61 2008-04-17  Anders Carlsson  <andersca@apple.com>
62
63         According to Sam and David, it's "topLevel", not "toplevel".
64         
65         * loader/DocumentLoader.cpp:
66         (WebCore::DocumentLoader::topLevelApplicationCache):
67         * loader/DocumentLoader.h:
68         * loader/appcache/DOMApplicationCache.cpp:
69         (WebCore::DOMApplicationCache::associatedCache):
70
71 2008-04-17  Anders Carlsson  <andersca@apple.com>
72
73         Reviewed by Sam.
74
75         Add DOMApplicationCache implementation.
76         
77         * dom/EventNames.h:
78         Add new event names.
79         
80         * dom/EventTarget.cpp:
81         (WebCore::EventTarget::toDOMApplicationCache):
82         * dom/EventTarget.h:
83         Add EventTarget conversion method.
84         
85         * loader/appcache/ApplicationCacheGroup.h:
86         (WebCore::ApplicationCacheGroup::):
87         (WebCore::ApplicationCacheGroup::status):
88         (WebCore::ApplicationCacheGroup::update):
89         (WebCore::ApplicationCacheGroup::newestCache):
90         Add more stubs.
91         
92         * loader/appcache/DOMApplicationCache.cpp:
93         * loader/appcache/DOMApplicationCache.h:
94
95         * page/DOMWindow.cpp:
96         (WebCore::DOMWindow::clear):
97         (WebCore::DOMWindow::applicationCache):
98         * page/DOMWindow.h:
99         (WebCore::DOMWindow::optionalApplicationCache):
100         Add ApplicationCache member.
101         
102 2008-04-17  Anders Carlsson  <andersca@apple.com>
103
104         Build fix.
105
106         * WebCore.vcproj/WebCore.vcproj:
107
108 2008-04-17  Dean Jackson  <dino@apple.com>
109
110         Reviewed by Hyatt.
111
112         Fix for <rdar://problem/5849968> translate method should have Y=0 when only X is present
113
114         Test: fast/css/transform-default-parameter.html
115
116         * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::applyProperty):
117         translate function with only X parameter now leaves the Y parameter as zero.
118
119 2008-04-17  Anders Carlsson  <andersca@apple.com>
120
121         Reviewed by Sam.
122         
123         Add plumbing for associating document loaders with application caches.
124         
125         * loader/DocumentLoader.cpp:
126         (WebCore::DocumentLoader::DocumentLoader):
127         (WebCore::DocumentLoader::~DocumentLoader):
128         (WebCore::DocumentLoader::originalURL):
129         (WebCore::DocumentLoader::requestURL):
130         (WebCore::DocumentLoader::responseURL):
131         (WebCore::DocumentLoader::responseMIMEType):
132         (WebCore::DocumentLoader::setCandidateApplicationCacheGroup):
133         (WebCore::DocumentLoader::setApplicationCache):
134         (WebCore::DocumentLoader::toplevelApplicationCache):
135         * loader/DocumentLoader.h:
136         (WebCore::DocumentLoader::candidateApplicationCacheGroup):
137         (WebCore::DocumentLoader::applicationCache):
138         * loader/appcache/ApplicationCacheGroup.h:
139         (WebCore::ApplicationCacheGroup::documentLoaderDestroyed):
140
141 2008-04-17  Adam Roben  <aroben@apple.com>
142
143         Fix Bug 18544: REGRESSION (r31951): Two fast/xsl tests crash
144
145         <https://bugs.webkit.org/show_bug.cgi?id=18544>
146
147         r31951 changed XSLTProcessor::parseErrorFunc to expect a Console* as
148         the context parameter. The caller in XSLTProcessor was changed, but
149         the one in XSLStyleSheet was missed.
150
151         Reviewed by Alexey Proskuryakov.
152
153         * xml/XSLStyleSheet.cpp:
154         (WebCore::XSLStyleSheet::parseString): Pass the Console as the context
155         to parseErrorFunc.
156
157 2008-04-17  Adam Roben  <aroben@apple.com>
158
159         Windows build fix after r31981
160
161         * dom/Document.idl: Omit getCSSCanvasContext from the COM bindings.
162
163 2008-04-17  Ariya Hidayat  <ariya.hidayat@trolltech.com>
164
165         Reviewed by Simon.
166
167         Implemented getFileModificationTime and pathGetFileName for the Qt port.
168
169         * platform/qt/FileSystemQt.cpp:
170         (WebCore::getFileModificationTime):
171
172 2008-04-17  Mark Rowe  <mrowe@apple.com>
173
174         Fix the non-Mac builds that I broke with my Mac build fix.
175
176         * css/CSSMutableStyleDeclaration.cpp:
177         (WebCore::CSSMutableStyleDeclaration::getLayeredShorthandValue): Explicitly use the size_t version of max
178         to avoid making assumptions about sizeof(size_t).
179
180 2008-04-17  Mark Rowe  <mrowe@apple.com>
181
182         Rubber-stamped by Dan Bernstein.
183
184         Fix the Mac build.
185
186         * css/CSSMutableStyleDeclaration.cpp:
187         (WebCore::CSSMutableStyleDeclaration::getLayeredShorthandValue): Update to use size_t in place of unsigned.
188         * dom/NamedNodeMap.h: Ditto.
189         * page/AccessibilityObject.h: Forward-declare AccessibilityObjectWrapper in the non-Objective-C case too.
190
191 2008-04-16  Jon Honeycutt  <jhoneycutt@apple.com>
192
193         Reviewed by Darin.
194
195         Use size_t instead of unsigned where appropriate.
196
197         * css/CSSValueList.h:
198         * dom/NamedAttrMap.h:
199         * rendering/RenderStyle.h:
200
201 2008-04-15  Jon Honeycutt  <jhoneycutt@apple.com>
202
203         Reviewed by Darin.
204
205         Add some methods to check AccessibilityObject state.
206
207         * page/AccessibilityObject.cpp:
208         (WebCore::AccessibilityObject::AccessibilityObject): Assert that the
209         passed renderer is not null.
210         (WebCore::AccessibilityObject::isPasswordField): Refactored to use early
211         return.
212         (WebCore::AccessibilityObject::isPressed): Return true if this is a
213         button in the pressed state.
214         (WebCore::AccessibilityObject::isIndeterminate): Return true if this is
215         a tri-state checkbox in the indeterminate state.
216         (WebCore::AccessibilityObject::isChecked): True if this is a radio
217         button or checkbox in the checked state.
218         (WebCore::AccessibilityObject::isHovered): True if object is currently
219         under the mouse cursor.
220         (WebCore::AccessibilityObject::isMultiSelect): True if this is a select
221         element capable of multi-select.
222         (WebCore::AccessibilityObject::isReadOnly): False if this object has
223         editable content.
224         (WebCore::AccessibilityObject::isOffScreen): True if this object is not
225         in the visible portion of the view.
226         * page/AccessibilityObject.h: Grouped methods into is-state and is-kind.
227
228 2008-04-15  Jon Honeycutt  <jhoneycutt@apple.com>
229
230         Reviewed by Darin.
231
232         Add AccessibilityObjectWrapper to Windows.
233
234         * WebCore.vcproj/WebCore.vcproj: Add AccessibilityObjectWrapperWin.h
235         * page/AccessibilityObject.h: Include COMPtr.h,
236         AccessibilityObjectWrapperWin.h on Windows. Define wrapper() and
237         setWrapper() if accessibility is present. Add an m_wrapper on Windows.
238         * page/AccessibilityObject.cpp:
239         (WebCore::AccessibilityObject::detach): Clear m_wrapper if
240         accessibility is present.
241         * page/win/AccessibilityObjectWrapperWin.h: Added; defines a wrapper for
242         AccessibilityObjects on Windows.
243         (WebCore::AccessibilityObjectWrapper::attached): Return true if attached
244         to an object.
245         (WebCore::AccessibilityObjectWrapper::accessibilityObject): Return the
246         wrapped object.
247         (WebCore::AccessibilityObjectWrapper::AccessibilityObjectWrapper):
248
249 2008-04-15  Jon Honeycutt  <jhoneycutt@apple.com>
250
251         Reviewed by Darin.
252
253         Add AXObjectCache to Windows.
254
255         * WebCore.vcproj/WebCore.vcproj: Add AXObjectCacheWin.cpp.
256         * page/AXObjectCache.h: Add handleFocusedUIElementChanged definition to
257         non-Mac platforms, and added stub for it. Replace PLATFORM(MAC)
258         conditional with HAVE(ACCESSIBILITY) for stubs.
259         (WebCore::AXObjectCache::enableAccessibility):
260         (WebCore::AXObjectCache::accessibilityEnabled):
261         * page/win/AXObjectCacheWin.cpp: Added; contains stubs for the methods
262         below.
263         (WebCore::AXObjectCache::detachWrapper):
264         (WebCore::AXObjectCache::attachWrapper):
265         (WebCore::AXObjectCache::postNotification):
266         (WebCore::AXObjectCache::postNotificationToElement):
267         * config.h: Define HAVE_ACCESSIBILITY on Mac and Windows.
268
269 2008-04-15  Jon Honeycutt  <jhoneycutt@apple.com>
270
271         Reviewed by Darin.
272
273         * WebCore.vcproj/WebCore.vcproj: Fix path to AXObjectCache.h.
274
275 2008-04-16  Brady Eidson  <beidson@apple.com>
276
277         Reviewed by Darin Adler
278
279         Merge the StorageAreaClient into the StorageArea class itself as pure virtual methods.
280         Add "LocalStorageArea" and "SessionStorageArea" implementations, and have SessionStorage
281         and LocalStorage instantiate the appropriate type of StorageArea object.
282
283         This purpose of this change is because while adding the persistent store to LocalStorage,
284         it became obvious that the client approach wasn't scaling well.  Additionally, a StorageArea
285         backing a local storage area required vastly different data members compared to one backing
286         a session storage area.
287
288         This will be much cleaner going forward.
289
290         * GNUmakefile.am:
291         * WebCore.pro:
292         * WebCore.vcproj/WebCore.vcproj:
293         * WebCore.xcodeproj/project.pbxproj:
294         * WebCoreSources.bkl:
295
296         * storage/LocalStorage.cpp:
297         (WebCore::LocalStorage::storageArea):
298         * storage/LocalStorage.h:
299
300         * storage/LocalStorageArea.cpp: Added.
301         (WebCore::LocalStorageArea::LocalStorageArea):
302         (WebCore::LocalStorageArea::itemChanged):
303         (WebCore::LocalStorageArea::itemRemoved):
304         (WebCore::LocalStorageArea::dispatchStorageEvent):
305         * storage/LocalStorageArea.h: Added.
306         (WebCore::LocalStorageArea::create):
307
308         * storage/SessionStorage.cpp:
309         (WebCore::SessionStorage::copy):
310         (WebCore::SessionStorage::storageArea):
311         * storage/SessionStorage.h:
312
313         * storage/SessionStorageArea.cpp: Added.
314         (WebCore::SessionStorageArea::copy):
315         (WebCore::SessionStorageArea::SessionStorageArea):
316         (WebCore::SessionStorageArea::itemChanged):
317         (WebCore::SessionStorageArea::itemRemoved):
318         (WebCore::SessionStorageArea::dispatchStorageEvent):
319         * storage/SessionStorageArea.h: Added.
320         (WebCore::SessionStorageArea::create):
321         (WebCore::SessionStorageArea::page):
322
323         * storage/StorageArea.cpp:
324         (WebCore::StorageArea::StorageArea):
325         (WebCore::StorageArea::setItem):
326         (WebCore::StorageArea::removeItem):
327         (WebCore::StorageArea::storageMap):
328         * storage/StorageArea.h:
329
330         * storage/StorageAreaClient.h: Removed.
331
332 2008-04-16  David Hyatt  <hyatt@apple.com>
333
334         Add support for the ability to draw directly into CSS images using CanvasRenderingContext2D.
335
336         Reviewed by olliej
337
338         Added fast/canvas/canvas-bg.html
339
340         * GNUmakefile.am:
341         * WebCore.pro:
342         * WebCore.vcproj/WebCore.vcproj:
343         * WebCore.xcodeproj/project.pbxproj:
344         * WebCoreSources.bkl:
345         * css/CSSCanvasValue.cpp: Added.
346         (WebCore::CSSCanvasValue::~CSSCanvasValue):
347         (WebCore::CSSCanvasValue::cssText):
348         (WebCore::CSSCanvasValue::canvasChanged):
349         (WebCore::CSSCanvasValue::canvasResized):
350         (WebCore::CSSCanvasValue::fixedSize):
351         (WebCore::CSSCanvasValue::element):
352         (WebCore::CSSCanvasValue::image):
353         * css/CSSCanvasValue.h: Added.
354         (WebCore::CSSCanvasValue::CSSCanvasValue):
355         (WebCore::CSSCanvasValue::isFixedSize):
356         (WebCore::CSSCanvasValue::setName):
357         * css/CSSGradientValue.cpp:
358         * css/CSSGradientValue.h:
359         * css/CSSImageGeneratorValue.cpp:
360         (WebCore::CSSImageGeneratorValue::generatedImage):
361         * css/CSSImageGeneratorValue.h:
362         (WebCore::CSSImageGeneratorValue::isFixedSize):
363         (WebCore::CSSImageGeneratorValue::fixedSize):
364         * css/CSSParser.cpp:
365         (WebCore::CSSParser::parseContent):
366         (WebCore::CSSParser::parseBackgroundImage):
367         (WebCore::CSSParser::parseBorderImage):
368         (WebCore::CSSParser::parseCanvas):
369         * css/CSSParser.h:
370         * dom/Document.cpp:
371         (WebCore::Document::getCSSCanvasContext):
372         (WebCore::Document::getCSSCanvasElement):
373         * dom/Document.h:
374         * dom/Document.idl:
375         * html/HTMLCanvasElement.cpp:
376         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
377         (WebCore::HTMLCanvasElement::reset):
378         * html/HTMLCanvasElement.h:
379         (WebCore::HTMLCanvasElement::setSize):
380         * rendering/RenderBox.cpp:
381         (WebCore::RenderBox::calculateBackgroundSize):
382         (WebCore::RenderBox::imageChanged):
383         * rendering/RenderBox.h:
384         * rendering/RenderImage.cpp:
385         (WebCore::RenderImage::imageChanged):
386         * rendering/RenderImage.h:
387         (WebCore::RenderImage::imagePtr):
388         (WebCore::RenderImage::intrinsicSizeChanged):
389         * rendering/RenderImageGeneratedContent.h:
390         (WebCore::RenderImageGeneratedContent::imageSize):
391         (WebCore::RenderImageGeneratedContent::imagePtr):
392         * rendering/RenderListMarker.cpp:
393         (WebCore::RenderListMarker::layout):
394         (WebCore::RenderListMarker::imageChanged):
395         (WebCore::RenderListMarker::calcPrefWidths):
396         (WebCore::RenderListMarker::getRelativeMarkerRect):
397         * rendering/RenderListMarker.h:
398         * rendering/RenderObject.cpp:
399         (WebCore::RenderObject::paintBorderImage):
400         (WebCore::RenderObject::imageChanged):
401         * rendering/RenderObject.h:
402         (WebCore::RenderObject::imageChanged):
403         * rendering/RenderSVGImage.cpp:
404         (WebCore::RenderSVGImage::imageChanged):
405         * rendering/RenderSVGImage.h:
406         * rendering/RenderStyle.cpp:
407         (WebCore::StyleCachedImage::imageSize):
408         (WebCore::StyleGeneratedImage::imageSize):
409         * rendering/RenderStyle.h:
410         (WebCore::StyleCachedImage::data):
411         (WebCore::StyleGeneratedImage::StyleGeneratedImage):
412         (WebCore::StyleGeneratedImage::data):
413         (WebCore::StyleGeneratedImage::imageHasRelativeWidth):
414         (WebCore::StyleGeneratedImage::imageHasRelativeHeight):
415         (WebCore::StyleGeneratedImage::usesImageContainerSize):
416         * rendering/RenderTableCol.cpp:
417         (WebCore::RenderTableCol::imageChanged):
418         * rendering/RenderTableCol.h:
419         * rendering/RenderTableRow.cpp:
420         (WebCore::RenderTableRow::imageChanged):
421         * rendering/RenderTableRow.h:
422         * rendering/RenderTableSection.cpp:
423         (WebCore::RenderTableSection::imageChanged):
424         * rendering/RenderTableSection.h:
425
426 2008-04-16  Anders Carlsson  <andersca@apple.com>
427
428         Reviewed by Darin.
429
430         Add manifest parser.
431
432         * loader/appcache/ManifestParser.cpp:
433         (WebCore::):
434         (WebCore::parseManifest):
435         * loader/appcache/ManifestParser.h:
436         * platform/text/CharacterNames.h:
437
438 2008-04-16  Darin Adler  <darin@apple.com>
439
440         Reviewed by Mitz.
441
442         - fix <rdar://problem/5858617> REGRESSION (r21452-Safari 3.1):
443           Safari does not find words containing ß (German letter sharp-s)
444
445         Test: fast/text/find-case-folding.html
446
447         * platform/text/StringImpl.cpp:
448         (WebCore::StringImpl::foldCase):
449         Pass the folded length to foldCase rather than the original string length.
450         Without this, we get an error code every time.
451
452 2008-04-16  Anders Carlsson  <andersca@apple.com>
453
454         Fix build.
455         
456         * loader/appcache/ApplicationCache.cpp:
457         (WebCore::ApplicationCache::ApplicationCache):
458         (WebCore::ApplicationCache::setManifestResource):
459         (WebCore::ApplicationCache::addResource):
460
461 2008-04-16  Anders Carlsson  <andersca@apple.com>
462
463         Reviewed by Darin.
464
465         Add new protocolHostAndPortAreEqual function.
466         
467         * platform/KURL.cpp:
468         (WebCore::KURL::host):
469         (WebCore::KURL::setHost):
470         (WebCore::KURL::setHostAndPort):
471         (WebCore::protocolHostAndPortAreEqual):
472         * platform/KURL.h:
473         (WebCore::KURL::hostStart):
474
475 2008-04-16  Anders Carlsson  <andersca@apple.com>
476
477         Reviewed by Sam.
478         
479         Fix some style nits.
480         
481         * loader/appcache/ApplicationCache.cpp:
482         (WebCore::ApplicationCache::ApplicationCache):
483         (WebCore::ApplicationCache::setManifestResource):
484         (WebCore::ApplicationCache::addResource):
485         (WebCore::ApplicationCache::removeResource):
486         (WebCore::ApplicationCache::dump):
487         * loader/appcache/ApplicationCacheGroup.h:
488
489 2008-04-16  Anders Carlsson  <andersca@apple.com>
490
491         Reviewed by Brady and Sam.
492
493         Add ApplicationCache implementation. Stub out ApplicationCacheGroup methods
494         needed by ApplicationCache.
495         
496         * loader/appcache/ApplicationCache.cpp:
497         (WebCore::ApplicationCache::ApplicationCache):
498         (WebCore::ApplicationCache::~ApplicationCache):
499         (WebCore::ApplicationCache::setManifestResource):
500         (WebCore::ApplicationCache::addResource):
501         (WebCore::ApplicationCache::removeResource):
502         (WebCore::ApplicationCache::resourceForURL):
503         (WebCore::ApplicationCache::resourceForRequest):
504         (WebCore::ApplicationCache::numDynamicEntries):
505         (WebCore::ApplicationCache::dynamicEntry):
506         (WebCore::ApplicationCache::addDynamicEntry):
507         (WebCore::ApplicationCache::removeDynamicEntry):
508         (WebCore::ApplicationCache::setOnlineWhitelist):
509         (WebCore::ApplicationCache::isURLInOnlineWhitelist):
510         (WebCore::ApplicationCache::dump):
511         * loader/appcache/ApplicationCache.h:
512         (WebCore::ApplicationCache::create):
513         (WebCore::ApplicationCache::manifestResource):
514         (WebCore::ApplicationCache::group):
515         (WebCore::ApplicationCache::begin):
516         (WebCore::ApplicationCache::end):
517         * loader/appcache/ApplicationCacheGroup.h:
518         (WebCore::ApplicationCacheGroup::manifestURL):
519         (WebCore::ApplicationCacheGroup::cacheDestroyed):
520
521 2008-04-16  Adam Roben  <aroben@apple.com>
522
523         Fix Bug 18505: REGRESSION: Search is disabled and not functional
524
525         <https://bugs.webkit.org/show_bug.cgi?id=18505>
526
527         Reviewed by Tim Hatcher.
528
529         * page/inspector/ResourcesPanel.js:
530         (WebInspector.ResourcesPanel.sourceFrameForResource): Added.
531         * page/inspector/inspector.css: Added back rules for the search field
532         that were removed in r31736.
533         * page/inspector/inspector.html:
534           - Removed the disabled attribute from the search field
535           - Added back the #searchResults and #searchResultsResizer divs which
536             were removed in r31736
537         * page/inspector/inspector.js:
538         (WebInspector.set showingSearchResults): Updated for class rename
539         panels -> main-panels.
540         (WebInspector.loaded): Added back the mousedown event listener for the
541         search results resizer that was removed in r31736.
542         (WebInspector.searchResultsResizerDrag): Updated for class rename
543         panels -> main-panels.
544         (WebInspector.performSearch):
545           - Changed to use sourceFrameForResource
546           - Changed to use showResource
547           - Changed to save/restore the focused element around the setting of
548             the current panel
549           - Changed to get the source document from the match range instead of
550             by crawling back up to the source view
551           - Changed to bind the onselect handlers to this so that we can
552             access the Elements/Resources panels
553
554 2008-04-16  Brady Eidson  <beidson@apple.com>
555
556         Reviewed by Sam Weinig
557
558         Changing ThreadSafeShared to start with a ref count of 1, so updating all users to
559         adoptRef() that initial reference.
560
561         * bindings/js/JSCustomSQLStatementCallback.h:
562         (WebCore::JSCustomSQLStatementCallback::create):
563         * bindings/js/JSCustomSQLStatementErrorCallback.h:
564         (WebCore::JSCustomSQLStatementErrorCallback::create):
565         * bindings/js/JSCustomSQLTransactionCallback.h:
566         (WebCore::JSCustomSQLTransactionCallback::create):
567         * bindings/js/JSCustomSQLTransactionErrorCallback.h:
568         (WebCore::JSCustomSQLTransactionErrorCallback::create):
569
570         * bindings/js/JSDatabaseCustom.cpp:
571         (WebCore::JSDatabase::changeVersion):
572         (WebCore::JSDatabase::transaction):
573
574         * bindings/js/JSSQLTransactionCustom.cpp:
575         (WebCore::JSSQLTransaction::executeSql):
576
577         * dom/Document.cpp:
578         (WebCore::Document::databaseThread):
579
580         * platform/SecurityOrigin.cpp:
581         (WebCore::SecurityOrigin::create):
582
583         * platform/sql/SQLiteAuthorizer.h:
584         (WebCore::SQLiteAuthorizer::create):
585         (WebCore::SQLiteAuthorizer::SQLiteAuthorizer):
586
587         * storage/ChangeVersionWrapper.cpp:
588         (WebCore::ChangeVersionWrapper::performPreflight):
589         (WebCore::ChangeVersionWrapper::performPostflight):
590         * storage/ChangeVersionWrapper.h:
591         (WebCore::ChangeVersionWrapper::create):
592
593         * storage/Database.cpp:
594         (WebCore::Database::openAndVerifyVersion):
595         (WebCore::Database::markAsDeletedAndClose):
596         (WebCore::Database::changeVersion):
597         (WebCore::Database::transaction):
598         (WebCore::Database::scheduleTransaction):
599         (WebCore::Database::scheduleTransactionStep):
600         (WebCore::Database::tableNames):
601
602         * storage/DatabaseAuthorizer.h:
603         (WebCore::DatabaseAuthorizer::create):
604
605         * storage/DatabaseTask.h:
606         (WebCore::DatabaseOpenTask::create):
607         (WebCore::DatabaseCloseTask::create):
608         (WebCore::DatabaseTransactionTask::create):
609         (WebCore::DatabaseTableNamesTask::create):
610
611         * storage/DatabaseThread.cpp:
612         (WebCore::DatabaseThread::scheduleTask): Change to take a PassRefPtr instead of raw
613         (WebCore::DatabaseThread::scheduleImmediateTask): Ditto
614         * storage/DatabaseThread.h:
615         (WebCore::DatabaseThread::create):
616
617         * storage/SQLError.h:
618         (WebCore::SQLError::create):
619         (WebCore::SQLError::SQLError):
620
621         * storage/SQLResultSet.h:
622         (WebCore::SQLResultSet::create):
623
624         * storage/SQLStatement.cpp:
625         (WebCore::SQLStatement::create):
626         (WebCore::SQLStatement::execute):
627         (WebCore::SQLStatement::setDatabaseDeletedError):
628         (WebCore::SQLStatement::setVersionMismatchedError):
629         (WebCore::SQLStatement::setFailureDueToQuota):
630         * storage/SQLStatement.h:
631
632         * storage/SQLTransaction.cpp:
633         (WebCore::SQLTransaction::create):
634         (WebCore::SQLTransaction::executeSQL):
635         (WebCore::SQLTransaction::openTransactionAndPreflight):
636         (WebCore::SQLTransaction::deliverTransactionCallback):
637         (WebCore::SQLTransaction::handleCurrentStatementError):
638         (WebCore::SQLTransaction::deliverStatementCallback):
639         (WebCore::SQLTransaction::postflightAndCommit):
640         * storage/SQLTransaction.h:
641
642 2008-04-16  Anders Carlsson  <andersca@apple.com>
643
644         Reviewed by Adam and Brady.
645         
646         Add implementation of ApplicationCacheResource.
647         
648         * loader/appcache/ApplicationCacheResource.cpp:
649         (WebCore::ApplicationCacheResource::ApplicationCacheResource):
650         (WebCore::ApplicationCacheResource::dumpType):
651         * loader/appcache/ApplicationCacheResource.h:
652         (WebCore::ApplicationCacheResource::):
653         (WebCore::ApplicationCacheResource::create):
654         (WebCore::ApplicationCacheResource::type):
655         (WebCore::ApplicationCacheResource::addType):
656
657 2008-04-16  Timothy Hatcher  <timothy@apple.com>
658
659         Fixes an issue where the source for a resource that had errors would
660         not be shown because the view was created before the resource load
661         finished. The right view is now created, even if the resource isn't 
662         finished. The SourceView just makes sure to not load the source until
663         the resource is finished. Only if the category changes, does the view
664         need to be recreated.
665
666         Reviewed by Adam Roben.
667
668         * page/inspector/Resource.js:
669         (WebInspector.Resource.prototype.set category): Call recreateViewForResourceIfNeeded.
670         * page/inspector/ResourcesPanel.js:
671         (WebInspector.ResourcesPanel.prototype.recreateViewForResourceIfNeeded):
672         Added. Tries to make a new view, if the view is the same prototype of the
673         previous view, return early. If they differ, close and detach the old view
674         and associate the resource with the new view. Calling updateErrorsAndWarnings
675         is needed, because the errors and warnings that might have been added to the
676         previous view will be lost, so make the tree element match.
677         (WebInspector.Resource.prototype._createResourceView): Always create a view
678         that matches the resource category. Ignore the loading and failed status.
679         * page/inspector/SourceView.js:
680         (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded): Don't setup the
681         frame if the resource hasn't finished or if the load failed.
682
683 2008-04-16  Timothy Hatcher  <timothy@apple.com>
684
685         Adds a console formatter for Error objects. So typing a expression in the
686         console that ends in an exception will print meaningful info. Also calling
687         console.{log,error,warn,info} with an error object will output nicely.
688
689         Reviewed by Adam Roben.
690
691         * page/inspector/Console.js:
692         (WebInspector.Console.prototype._formaterror): Added. Formats an error
693         object by showing it like other exceptions, with a clickable file URL.
694
695 2008-04-16  Timothy Hatcher  <timothy@apple.com>
696
697         Refactors code that updates the errors and warnings count in the
698         resources sidebar so other functions can easily trigger updates.
699
700         Reviewed by Adam Roben.
701
702         * page/inspector/ResourcesPanel.js:
703         (WebInspector.ResourcesPanel.prototype.addMessageToResource): Call updateErrorsAndWarnings.
704         Removes code that updates the bubbleText and class names.
705         (WebInspector.ResourcesPanel.prototype.clearMessages): Ditto.
706         (WebInspector.ResourceSidebarTreeElement.prototype.updateErrorsAndWarnings):
707         Added. Updates the bubbleText and adds or removes the class names
708         depending on if the values are zero.
709
710 2008-04-16  Antti Koivisto  <antti@apple.com>
711
712         Reviewed by Alexey.
713         
714         Fix <rdar://problem/5863728>
715         REGRESSION: Garbage character shown in temperatures in the Weather widget (encoding issue with degree symbol)
716         
717         Parse the encoding attribute in PreloadScanner.
718
719         Test: fast/encoding/script-preload-encoding.html
720
721         * html/PreloadScanner.cpp:
722         (WebCore::PreloadScanner::processAttribute):
723         (WebCore::PreloadScanner::emitTag):
724         (WebCore::PreloadScanner::emitCSSRule):
725         * html/PreloadScanner.h:
726         * loader/DocLoader.cpp:
727         (WebCore::DocLoader::preload):
728         * loader/DocLoader.h:
729
730 2008-04-16  Anders Carlsson  <andersca@apple.com>
731
732         Reviewed by Adam.
733
734         Generate the DOMApplicationCache JS wrapper, add JSDOMApplicationCacheCustom.cpp and 
735         fix typos in the #if line.
736         
737         * DerivedSources.make:
738         * WebCore.vcproj/WebCore.vcproj:
739         * WebCore.xcodeproj/project.pbxproj:
740         * bindings/js/JSDOMApplicationCacheCustom.cpp: Added.
741         * loader/appcache/ApplicationCache.cpp:
742         * loader/appcache/ApplicationCache.h:
743         * loader/appcache/ApplicationCacheGroup.cpp:
744         * loader/appcache/ApplicationCacheGroup.h:
745         * loader/appcache/ApplicationCacheResource.cpp:
746         * loader/appcache/ApplicationCacheResource.h:
747         * loader/appcache/DOMApplicationCache.cpp:
748         * loader/appcache/DOMApplicationCache.h:
749         * loader/appcache/DOMApplicationCache.idl:
750         * loader/appcache/ManifestParser.cpp:
751         * loader/appcache/ManifestParser.h:
752
753 2008-04-16  Sam Weinig  <sam@webkit.org>
754
755         Reviewed by Geoffrey Garen.
756
757         - To keep the behavior of the WebKit and JavaScriptCore API's the same,
758           we need to hide the fact that the global object and the window object
759           are no longer the same thing, and the the global object now changes on
760           navigations.  To do this, only the wrapper should ever be exposed.  This
761           fixes the two remaining spots where the internal global object is exposed,
762           the windowScriptObject returned from [WebFrame windowObject] and the object
763           return by calling JSContextGetGlobalObject on [WebFrame globalContext]
764
765         * bindings/js/JSDOMWindowWrapper.cpp:
766         (WebCore::JSDOMWindowWrapper::putWithAttributes):
767         * bindings/js/JSDOMWindowWrapper.h:
768         Forward this new method so that JSObjectSetProperty doesn't set properties on the 
769         wrapper.
770
771         * page/mac/FrameMac.mm:
772         (WebCore::Frame::windowScriptObject):
773         Return the wrapper instead of the global object.
774
775 2008-04-16  David Hyatt  <hyatt@apple.com>
776
777         Eliminate the paintBuffer and drawImage(ImageBuffer*) methods from GraphicsContext* in favor of just
778         snagging an Image* from the ImageBuffer and drawing that instead.
779
780         Enhance canvas with a CanvasObserver so that notifications of dirtying or resizing can be tracked by
781         a consumer.
782
783         Reviewed by olliej
784
785         * html/CanvasRenderingContext2D.cpp:
786         (WebCore::CanvasRenderingContext2D::drawImage):
787         * html/HTMLCanvasElement.cpp:
788         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
789         (WebCore::HTMLCanvasElement::willDraw):
790         (WebCore::HTMLCanvasElement::reset):
791         (WebCore::HTMLCanvasElement::paint):
792         * html/HTMLCanvasElement.h:
793         (WebCore::CanvasObserver::~CanvasObserver):
794         (WebCore::HTMLCanvasElement::setSize):
795         (WebCore::HTMLCanvasElement::setObserver):
796         * platform/graphics/GraphicsContext.cpp:
797         (WebCore::GraphicsContext::drawImage):
798         (WebCore::GraphicsContext::drawTiledImage):
799         * platform/graphics/GraphicsContext.h:
800         * platform/graphics/ImageBuffer.h:
801         (WebCore::ImageBuffer::clearImage):
802         * platform/graphics/cairo/GraphicsContextCairo.cpp:
803         * platform/graphics/cg/GraphicsContextCG.cpp:
804         * platform/graphics/cg/ImageCG.cpp:
805         (WebCore::BitmapImage::draw):
806         (WebCore::Image::drawPattern):
807         * platform/graphics/cg/ImageSourceCG.cpp:
808         (WebCore::ImageSource::createFrameAtIndex):
809         * platform/graphics/qt/GraphicsContextQt.cpp:
810         * platform/graphics/wx/GraphicsContextWx.cpp:
811
812 2008-04-16  Steve Falkenburg  <sfalken@apple.com>
813
814         Improve timer latency/resolution.
815                 
816         The primary timing mechanism is now CreateTimerQueueTimer, with a PostMessage from
817         the callback proc.  This event will be delivered sooner than if we used SetTimer(),
818         since it is higher priority than other messages.
819         
820         If there is an input message pending, we'll use we SetTimer() based timers to avoid
821         starving user input.
822
823         Don't call PostMessage immediately on all timers < 10ms.  Only call immediately if
824         timer is already expired.  This avoids the case where no timers would be processed,
825         causing the timer to be re-posted via the slower SetTimer method.
826
827         Don't call PostMessage immediately if there's a pending WM_PAINT, since
828         we don't want to starve all paints when bombarded with a continuous stream of low
829         duration timers.
830
831         Removed reentrancy check, since we're now looking for specific starvation cases,
832         and will typically defer non-expired timers through CreateTimerQueueTimer.
833
834         The reason Windows wouldn't starve paints in favor of timers with the old code:
835         When we went to reset the timer when it fired, the timer reset code treated this as a
836         reentrant timer, causing us to hit the slow SetTimer code rather than calling PostMessage,
837         even for timers expiring in < 10ms.  I corrected that, exposing the paint starvation problem.
838
839         Use timeBeginPeriod/timeEndPeriod to improve resolution of system timers.
840         Limit this resolution change to within 20ms of the last high resolution timer request.
841                         
842         Corrected GetQueueStatus to check for specific input (and paint) messages rather than
843         checking QS_ALLINPUT.  Contrary to its name, QS_ALLINPUT actually indicates interest
844         in ALL queued messages, not just input messages.
845         
846         Fix SetTimer/KillTimer calls to pass our window handle.
847
848         Reviewed by Brady.
849
850         * platform/win/SharedTimerWin.cpp:
851         (WebCore::):
852         (WebCore::TimerWindowWndProc):
853         (WebCore::queueTimerProc):
854         (WebCore::setSharedTimerFireTime):
855         (WebCore::stopSharedTimer):
856
857 2008-04-16  Adam Roben  <aroben@apple.com>
858
859         Fix console-log-formatting to truly test formatting an undefined value
860
861         Exceptions thrown by the test will also now be shown as errors.
862
863         Reviewed by Tim Hatcher.
864
865         * manual-tests/inspector/console-log-formatting.html:
866         (test): Use console.error to report exceptions.
867         (runTests): Use window.noSuchVariable instead of just noSuchVariable
868         to avoid an exception.
869
870 2008-04-16  Anatoli Papirovski  <apapirovski@mac.com>
871
872         Reviewed by David.
873
874         Optimized the calculation of background-size.
875
876         * rendering/RenderBox.cpp:
877         (WebCore::RenderBox::calculateBackgroundSize):
878
879 2008-04-16  Adam Roben  <aroben@apple.com>
880
881         Fix Bug 17228: console.{log,warn,info,error} should support format
882         strings, variable arguments
883
884         <https://bugs.webkit.org/show_bug.cgi?id=17228>
885         <rdar://problem/5732828>
886
887         Reviewed by Tim Hatcher.
888
889         Test: manual-tests/inspector/console-log-formatting.html
890
891         * page/inspector/Console.js:
892         (WebInspector.ConsoleMessage): Pass any extra arguments down to
893         _format.
894         (WebInspector.ConsoleMessage._format): This method constructs
895         this.formattedMessage. We treat the first parameter as a format
896         string. Any parameters that have not been used after substituting into
897         the format string are concatenated together, separated by spaces.
898         (WebInspector.ConsoleMessage.toMessageElement): Updated to use
899         this.formattedMessage.
900         (WebInspector.ConsoleMessage.toString): Ditto.
901
902 2008-04-15  Adam Roben  <aroben@apple.com>
903
904         Make String.format return an array of unused substitutions
905
906         String.format now returns an object with two properties:
907         formattedResult and unusedSubstitutions.
908
909         Reviewed by Tim Hatcher.
910
911         * page/inspector/utilities.js:
912         (String.vsprintf): Updated for changes to String.format. We throw away
913         the array of unused substitutions.
914         (String.format): Changed to keep track of which substitutions are used
915         when formatting. We then return both the formatted result and the
916         array of unused substitutions.
917
918 2008-04-15  Adam Roben  <aroben@apple.com>
919
920         Generalize String.format some more
921
922         String.format now takes an initial value and an append function which
923         it uses to build the result. Each time a token is processed,
924         append(valueSoFar, newValue) is called.
925
926         Reviewed by Tim Hatcher.
927
928         * page/inspector/utilities.js:
929         (String.vsprintf): Pass the empty string for the initial value, and
930         a function that concatenates two strings as the append function.
931         (String.format): Use initialValue and append to build the result
932         instead of only working with strings.
933
934 2008-04-15  Adam Roben  <aroben@apple.com>
935
936         Add String.format
937
938         String.format is a more generic form of String.vsprintf that takes a
939         set of formatter functions, one for each supported format specifier.
940         Each formatter function is passed the relevant token and substitution
941         value, and returns the formatted result.
942
943         Reviewed by Tim Hatcher.
944
945         * page/inspector/utilities.js:
946         (String.standardFormatters): Added.
947         (String.vsprintf): Changed to call through to String.format.
948         (String.format): Added. Most of the code came from String.vsprintf,
949         except that we use the passed-in formatters to format the
950         substitutions rather than hard-coding how to handle each format
951         specifier.
952
953 2008-04-15  Adam Roben  <aroben@apple.com>
954
955         Refactor String.vsprintf to separate tokenizing and substituting
956
957         This will eventually be useful for the various console methods that
958         take a format string.
959
960         Reviewed by Tim Hatcher.
961
962         * page/inspector/utilities.js:
963         (String.tokenizeFormatString): Added. This uses the format parsing
964         code from String.vsprintf but just returns an array of "string" and
965         "specifier" tokens.
966         (String.vsprintf): Now calls String.tokenizeFormatString and processes
967         the tokens one at a time.
968
969 2008-04-15  Adam Roben  <aroben@apple.com>
970
971         Pass all arguments to console.{log,warn,info,error} into the Inspector's JS
972
973         Part of Bug 17228: console.{log,warn,info,error} should support format
974         strings, variable arguments
975         <http://bugs.webkit.org/show_bug.cgi?id=17228>
976         <rdar://problem/5732828>
977
978         We don't use the extra arguments yet.
979
980         Reviewed by Tim Hatcher.
981
982         * page/Console.cpp:
983         (WebCore::Console::error): Pass the arguments list to
984         InspectorController.
985         (WebCore::Console::info): Ditto.
986         (WebCore::Console::log): Ditto.
987         (WebCore::Console::warn): Ditto.
988         * page/InspectorController.cpp:
989         (WebCore::ConsoleMessage::ConsoleMessage): Added a new constructor
990         that takes an ExecState and a List instead of a String. We wrap and
991         store the JSValues from the List in a Vector<ProtectedPtr<JSValue> >.
992         (WebCore::InspectorController::addMessageToConsole): Added an overload
993         that takes an ExecState and a List.
994         (WebCore::InspectorController::addConsoleMessage): Moved code here
995         from addMessageToConsole. Both overloads of addMessageToConsole now
996         call this helper method.
997         (WebCore::InspectorController::addScriptConsoleMessage): Updated for
998         the new parameter order of WebInspector.ConsoleMessage. If the
999         ConsoleMessage has a non-empty wrappedArguments Vector, we use that
1000         instead of the ConsoleMessage's message String.
1001         * page/InspectorController.h:
1002         * page/inspector/Console.js:
1003         (WebInspector.ConsoleMessage): Removed the explicit message parameter.
1004         We now get the message from the unnamed 5th parameter.
1005         * page/inspector/Resource.js: Updated for the change to
1006         WebInspector.ConsoleMessage's parameter order.
1007
1008 2008-04-15  Adam Roben  <aroben@apple.com>
1009
1010         Change calls to Chrome::addMessageToConsole to use Console::addMessage
1011
1012         Part of Bug 17228: console.{log,warn,info,error} should support format
1013         strings, variable arguments
1014         <http://bugs.webkit.org/show_bug.cgi?id=17228>
1015         <rdar://problem/5732828>
1016
1017         Console now takes care of calling ChromeClient::addMessageToConsole
1018         for the appropriate messages (i.e., just messages from JavaScript). If
1019         you ever want to add a message to the console, Console is the place to
1020         do it.
1021
1022         Reviewed by Darin Adler.
1023
1024         * WebCore.xcodeproj/project.pbxproj: Mark Console.h Private.
1025         * page/Chrome.cpp: Removed addMessageToConsole
1026         * page/Chrome.h: Moved MessageSource/MessageLevel to Console.h.
1027         * page/Console.cpp:
1028         (WebCore::Console::addMessage): Added. Calls
1029         ChromeClient::addMessageToConsole for JS messages, and calls
1030         InspectorController::addMessageToConsole for all messages.
1031         (WebCore::Console::error): Changed to call directly to
1032         InspectorController in addition to ChromeClient.
1033         (WebCore::Console::info): Ditto.
1034         (WebCore::Console::log): Ditto.
1035         (WebCore::Console::warn): Ditto.
1036         * page/Console.h: Added MessageSource/MessageLevel enums from Chrome.h.
1037
1038 2008-04-15  Adam Roben  <aroben@apple.com>
1039
1040         Pass JSConsole's arguments unmodified to Console
1041
1042         Part of Bug 17228: console.{log,warn,info,error} should support format
1043         strings, variable arguments
1044         <http://bugs.webkit.org/show_bug.cgi?id=17228>
1045         <rdar://problem/5732828>
1046
1047         All of JSConsole's methods are now custom, so that we can pass the
1048         arguments unmodified to Console. Console now handles calling
1049         toString() on the first argument. Later it will pass the arguments off
1050         to InspectorController.
1051
1052         There should be no behavioral changes caused by this patch.
1053
1054         Reviewed by Darin Adler.
1055
1056         * ForwardingHeaders/kjs/list.h: Added.
1057         * GNUmakefile.am: Added JSConsoleCustom.cpp to the project.
1058         * WebCore.pro: Ditto.
1059         * WebCore.vcproj/WebCore.vcproj: Ditto.
1060         * WebCore.xcodeproj/project.pbxproj: Ditto.
1061         * WebCoreSources.bkl: Ditto.
1062         * bindings/js/JSConsoleCustom.cpp: Added.
1063         (WebCore::JSConsole::error):
1064         (WebCore::JSConsole::info):
1065         (WebCore::JSConsole::log):
1066         (WebCore::JSConsole::warn):
1067         * page/Console.cpp: Changed all methods to take an ExecState* and a
1068         const List&. The first item in the List is toString()ed and passed to
1069         Chrome.
1070         (WebCore::Console::error):
1071         (WebCore::Console::info):
1072         (WebCore::Console::log):
1073         (WebCore::Console::warn):
1074         * page/Console.h:
1075         * page/Console.idl:
1076
1077 2008-04-16  Sam Weinig  <sam@webkit.org>
1078
1079         Reviewed by Darin Adler.
1080
1081         Rename kjs_strtod to KJS::strtod.
1082
1083         * platform/text/String.cpp:
1084         (WebCore::charactersToDouble):
1085
1086 2008-04-16  Alexey Proskuryakov  <ap@webkit.org>
1087
1088         Reviewed by Adam.
1089
1090         http://bugs.webkit.org/show_bug.cgi?id=18259
1091         XML+XSLT pages in iframe contains document.location of a parent window
1092
1093         Test: fast/xsl/subframe-location.html
1094
1095         * xml/XSLTProcessor.cpp:
1096         (WebCore::XSLTProcessor::createDocumentFromSource): Set resulting document URL before opening
1097         it, so that the document loader picks a correct URL, too.
1098
1099 2008-04-16  Dan Bernstein  <mitz@apple.com>
1100
1101         Rubber-stamped by John Sullivan.
1102
1103         - remove unreachable code which was added in r8802
1104
1105         * rendering/RenderText.cpp:
1106         (WebCore::RenderText::caretRect):
1107
1108 2008-04-15  Timothy Hatcher  <timothy@apple.com>
1109
1110         Adds a script resource icon. Update the CSS icon to better match the script icon.
1111
1112         https://bugs.webkit.org/show_bug.cgi?id=18499
1113
1114         Rubber-stamped by Adele Peterson.
1115
1116         * page/inspector/Images/resourceCSSIcon.png: Updated.
1117         * page/inspector/Images/resourceJSIcon.png: Added.
1118         * page/inspector/inspector.css: Changed the script icon rule to reference the new image.
1119
1120 2008-04-16  Eric Seidel  <eric@webkit.org>
1121
1122         Reviewed by hyatt.
1123
1124         Fix leaky ImageBuffer code.
1125
1126         * platform/graphics/GeneratedImage.cpp:
1127         (WebCore::GeneratedImage::drawPattern):
1128         * platform/graphics/ImageBuffer.h:
1129         * platform/graphics/cg/ImageBufferCG.cpp:
1130         (WebCore::ImageBuffer::image):
1131
1132 2008-04-15  Justin Garcia  <justin.garcia@apple.com>
1133
1134         Reviewed by Oliver.
1135
1136         <rdar://problem/5665299> REGRESSION (r27369): Paste text into a contenteditable div creates a contenteditable div for each line (16661)
1137
1138         * editing/markup.cpp:
1139         (WebCore::createFragmentFromText): Don't use clones of the enclosing block to hold
1140         paragraphs if the enclosing block is the root editable element.
1141
1142 2008-04-15  Mark Rowe  <mrowe@apple.com>
1143
1144         Reviewed by Jon Honeycutt.
1145
1146         Don't treat the misnamed NSAccessibilitySortButtonRole as an accessibility role.  It is really
1147         a subrole of NSAccessibilityButtonRole.  As it is not used inside WebCore there is no change in
1148         behaviour as a result of doing this.  This fixes <rdar://problem/5866444>.
1149
1150         * page/AccessibilityObject.cpp:
1151         (WebCore::AccessibilityObject::canSetFocusAttribute): Remove SortButtonRole as it is unused.
1152         * page/AccessibilityObject.h: Ditto.
1153         (WebCore::):
1154         * page/mac/AccessibilityObjectWrapper.mm:
1155         (RoleEntry::):
1156
1157 2008-04-15  Anders Carlsson  <andersca@apple.com>
1158
1159         Fix leaks seen on bot.
1160         
1161         * loader/SubstituteResource.h:
1162         (WebCore::SubstituteResource::~SubstituteResource):
1163         Add a virtual destructor.
1164
1165 2008-04-15  Brady Eidson  <beidson@apple.com>
1166
1167         Reviewed by Anders Carlsson
1168
1169         Fix for <rdar://problem/5820819> - Crash sometime occurs when interrupting a load.
1170
1171         Each SubresourceLoader has a client.  That client is often a Loader::Host object.  
1172         The Loader/Host/CachedResource system predates our ref-counting and ownership models, and therefore manages
1173         object lifetime manually.
1174
1175         The cause of this crash was that we would sometimes call "didFail()" on a Host object twice - Once when 
1176         beginning the new navigation, and once when the new navigation is committed.
1177
1178         The problem is after the first time Host::didFail() gets called, the Host is almost always deleted shortly 
1179         thereafter.  But the SubresourceLoader had a dangling pointer to the Host which is now invalid.
1180
1181         I explored a few options to fix this bug.  The one that was most obviously "clean" was to call cancel() on
1182         the SubresourceLoader itself, which would end up calling Host::didFail() and doing the appropriate cache
1183         cleanup.
1184
1185         This problem with that approach was that it had other side effects - when you cut off a load that had already
1186         partially displayed in the WebView, images that hadn't finished loading would be invalidated and immediately
1187         turn into broken image icons.  This was visually jarring and pretty unacceptable. 
1188
1189         So I decided to follow a much simpler approach, which was to have the Host clear the client pointer from each
1190         SubresourceLoader before it forgets about it.  This leaves things the same visually and fixes the crash.
1191
1192         Note that the layout test for this - if possible - will require other enhancements to DRT including possibly 
1193         adding support for window.stop(). That task is non-trivial, and is documented in <rdar://problem/5061826> 
1194
1195         * loader/SubresourceLoader.h:
1196         (WebCore::SubresourceLoader::clearClient): Add a method to clear the SubresourceLoaderClient.  This is 
1197           perfectly safe to do on an in-flight SubresourceLoader as they are already designed to be client-less,
1198           and already null-check the client before calling it.
1199
1200         * loader/loader.cpp:
1201         (WebCore::Loader::Host::didFail): The SubresourceLoader itself might not be finished loading and might decide 
1202           to call into its client later.  Since the client has no guaranteed lifetime and is liable to be deleted 
1203           after didFail() is called, call clearClient() on the SubresourceLoader so such an invalid call can't happen.
1204
1205 2008-04-15  Anders Carlsson  <andersca@apple.com>
1206
1207         Reviewed by Adam.
1208
1209         Add empty files for the application cache.
1210         
1211         * Configurations/WebCore.xcconfig:
1212         * WebCore.vcproj/WebCore.vcproj:
1213         * WebCore.vcproj/build-generated-files.sh:
1214         Add ENABLE_OFFLINE_WEB_APPLICATIONS to FEATURE_DEFINES.
1215         
1216         * WebCore.xcodeproj/project.pbxproj:
1217         * loader/appcache: Added.
1218         * loader/appcache/ApplicationCache.cpp: Added.
1219         * loader/appcache/ApplicationCache.h: Added.
1220         * loader/appcache/ApplicationCacheGroup.cpp: Added.
1221         * loader/appcache/ApplicationCacheGroup.h: Added.
1222         * loader/appcache/ApplicationCacheResource.cpp: Added.
1223         * loader/appcache/ApplicationCacheResource.h: Added.
1224         * loader/appcache/DOMApplicationCache.cpp: Added.
1225         * loader/appcache/DOMApplicationCache.h: Added.
1226         * loader/appcache/DOMApplicationCache.idl: Added.
1227         * loader/appcache/ManifestParser.cpp: Added.
1228         * loader/appcache/ManifestParser.h: Added.
1229
1230 2008-04-15  Kevin McCullough  <kmccullough@apple.com>
1231
1232         Reviewed by Tim.
1233
1234         - <rdar://problem/5792587> AJAX (XMLHttpRequest) support for the Inspector (17776)
1235         - Add XMLHttpRequest support to the inspector.
1236
1237         * English.lproj/InspectorLocalizedStrings.js: Specify capitalization
1238         instead of using text-transform because XHR must capitalize all the letters.
1239         * page/inspector/Resource.js: Assume XHRs are textType even though this
1240         may not always be true.
1241         Also add the XHR category and let all mime types be consistent with it.
1242         * page/inspector/ResourcesPanel.js: Set the XHR category color.
1243         * page/inspector/inspector.css: Make XHRs yellow and fonts red because
1244         XHRs are more common than fonts and yellow next to orange (scripts) is
1245         not as harsh on the eyes as red next to orange.
1246         * page/inspector/inspector.js: Specify capitalization again.
1247
1248 2008-04-15  David Hyatt  <hyatt@apple.com>
1249
1250         Fix the zoom property so that it works properly with font-size.
1251
1252         Reviewed by John Sullivan
1253
1254         Added fast/css/zoom-font-size.html
1255
1256         * css/CSSStyleSelector.cpp:
1257         (WebCore::CSSStyleSelector::updateFont):
1258         (WebCore::CSSStyleSelector::applyProperty):
1259         (WebCore::CSSStyleSelector::checkForZoomChange):
1260         * css/CSSStyleSelector.h:
1261
1262 2008-04-15  Timothy Hatcher  <timothy@apple.com>
1263
1264         Fixes the bug where a resource view could still be shown after the inspected
1265         page navigates to another page.
1266
1267         https://bugs.webkit.org/show_bug.cgi?id=18517
1268
1269         Reviewed by Adam Roben.
1270
1271         * page/inspector/ResourcesPanel.js:
1272         (WebInspector.ResourcesPanel.prototype.reset): Close the visible resource.
1273         Iterate over all the resources and zero errors and warnings and delete the
1274         resource view and tree element. Removes all children of resourceViews. Passes
1275         true to _updateGraphDividersIfNeeded to force an immediate update.
1276         (WebInspector.ResourcesPanel.prototype.removeResource): Added. Closes
1277         the resource view if it is visible. Removes the resource from the _resources
1278         array. Removes the tree element from the outline tree. Zeros out the errors
1279         and warnings properties. Deletes the tree element and resource view properties.
1280         (WebInspector.ResourcesPanel.prototype.closeVisibleResource): Null check
1281         this._calculator for times when reset is called before the calculator is set.
1282         * page/inspector/inspector.js:
1283         (WebInspector.removeResource): Call ResourcesPanel.removeResource.
1284
1285 2008-04-15  Anders Carlsson  <andersca@apple.com>
1286
1287         Reviewed by Adam.
1288
1289         Rename "archive" to "substitute" in a couple of places.
1290         
1291         * loader/DocumentLoader.cpp:
1292         (WebCore::DocumentLoader::DocumentLoader):
1293         (WebCore::DocumentLoader::clearArchiveResources):
1294         (WebCore::DocumentLoader::deliverSubstituteResourcesAfterDelay):
1295         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
1296         (WebCore::DocumentLoader::isSubstituteLoadPending):
1297         (WebCore::DocumentLoader::cancelPendingSubstituteLoad):
1298         (WebCore::DocumentLoader::scheduleArchiveLoad):
1299         (WebCore::DocumentLoader::setDefersLoading):
1300         * loader/DocumentLoader.h:
1301         * loader/ResourceLoader.cpp:
1302         (WebCore::ResourceLoader::load):
1303         (WebCore::ResourceLoader::didCancel):
1304
1305 2008-04-15  Anders Carlsson  <andersca@apple.com>
1306
1307         Reviewed by Adam.
1308
1309         Move the URL, response and data to SubstituteResource.
1310         
1311         * loader/SubstituteResource.h:
1312         (WebCore::SubstituteResource::url):
1313         (WebCore::SubstituteResource::response):
1314         (WebCore::SubstituteResource::data):
1315         (WebCore::SubstituteResource::SubstituteResource):
1316         * loader/archive/ArchiveResource.cpp:
1317         (WebCore::ArchiveResource::ArchiveResource):
1318         * loader/archive/ArchiveResource.h:
1319         (WebCore::ArchiveResource::frameName):
1320
1321 2008-04-15  David Hyatt  <hyatt@apple.com>
1322
1323         https://bugs.webkit.org/show_bug.cgi?id=18467
1324
1325         Make sure to ignore zoom:0.  That is not supposed to actually do anything.  It's a hack in IE
1326         to cause an element to set "hasLayout."
1327
1328         Reviewed by Anders
1329
1330         Added fast/css/zoom-property-parsing.html
1331
1332         * css/CSSParser.cpp:
1333         (WebCore::CSSParser::parseValue):
1334         * css/CSSStyleSelector.cpp:
1335         (WebCore::CSSStyleSelector::applyProperty):
1336
1337 2008-04-15  Anders Carlsson  <andersca@apple.com>
1338
1339         Reviewed by Adam.
1340
1341         Add a (currently empty) SubstituteResource class and make ArchiveResource inherit from it.
1342         
1343         * WebCore.vcproj/WebCore.vcproj:
1344         * WebCore.xcodeproj/project.pbxproj:
1345         * loader/SubstituteResource.h: Added.
1346         * loader/archive/ArchiveResource.h:
1347
1348 2008-04-15  Antti Koivisto  <antti@apple.com>
1349
1350         Reviewed by Geoff.
1351
1352         Fix <rdar://problem/5862921>
1353         REGRESSION: Leak in SVGSVGElement::SVGSVGElement
1354         
1355         In these strange days RefCounted starts with count of one.
1356
1357         * svg/SVGSVGElement.cpp:
1358         (WebCore::SVGSVGElement::SVGSVGElement):
1359         * svg/animation/SMILTimeContainer.h:
1360         (WebCore::SMILTimeContainer::create):
1361
1362 2008-04-15  Anatoli Papirovski  <apapirovski@mac.com>
1363
1364         Reviewed by hyatt
1365
1366         [CSS1, CSS3] Fixed the background-origin calculation for root elements
1367         (background-size and background-position are affected), r10794
1368         [CSS3] Fixed the background-size transformation where width is specified in percentage and height is left to auto
1369
1370         Test: fast/backgrounds/background-origin-root-element.html
1371
1372         * rendering/RenderBox.cpp:
1373         (WebCore::RenderBox::calculateBackgroundSize):
1374         (WebCore::RenderBox::calculateBackgroundImageGeometry):
1375
1376 2008-04-15  Timothy Hatcher  <timothy@apple.com>
1377
1378         Fixes the regression where the error and warning counts did not show up in the Resources
1379         sidebar next to resources.
1380
1381         https://bugs.webkit.org/show_bug.cgi?id=18494
1382
1383         Reviewed by Adam Roben.
1384
1385         * page/inspector/ResourcesPanel.js:
1386         (WebInspector.ResourcesPanel.prototype.addMessageToResource): Increment errors or warnings
1387         on the resource. Set the bubbleText to the total of the errors and warnings. Add a error
1388         or warning class to the bubble.
1389         (WebInspector.ResourcesPanel.prototype.clearMessages): Zero out the errors and warnings
1390         properties on each resource. Set the bubbleText back to an empty string.
1391         * page/inspector/SidebarTreeElement.js:
1392         (WebInspector.SidebarTreeElement): Create a statusElement.
1393         (WebInspector.SidebarTreeElement.prototype.get bubbleText): Return _bubbleText.
1394         (WebInspector.SidebarTreeElement.prototype.set bubbleText): Create bubbleElement if needed.
1395         Assign the value to _bubbleText and bubbleElement.textContent.
1396         (WebInspector.SidebarTreeElement.prototype.onattach): Append statusElement to _listItemNode.
1397         * page/inspector/inspector.css: Style rules for bubbles and status elements.
1398
1399 2008-04-15  Timothy Hatcher  <timothy@apple.com>
1400
1401         Fixes the regression where error and warning bubbles would not be added
1402         to the source view of a resource.
1403
1404         https://bugs.webkit.org/show_bug.cgi?id=18495
1405
1406         Reviewed by Adam Roben.
1407
1408         * css/view-source.css:
1409         (.webkit-html-message-bubble): Add a min-height to make sure the border-radius
1410         has enough room to apply.
1411         * page/inspector/Console.js:
1412         (WebInspector.Console.prototype.addMessage): Removed code that added messages
1413         to resource panels and incremented error and warning counts on resources.
1414         Now just call ResourcesPanel.addMessageToResource after assigning the resource
1415         to the console message.
1416         (WebInspector.Console.prototype.clearMessages): Removed code that cleared error
1417         and warning counts from resources an call ResourcesPanel.clearMessages.
1418         * page/inspector/ResourcesPanel.js:
1419         (WebInspector.ResourcesPanel.prototype.addMessageToResource): Call addMessage
1420         on the resource's view, if it is implemented.
1421         (WebInspector.ResourcesPanel.prototype.clearMessages): Call clearMessages
1422         on all the resource views for the ones that implement it.
1423         (WebInspector.ResourcesPanel.prototype.refreshResource): Call _resourceView
1424         to make the resource's view if needed. Use a local view variable.
1425         (WebInspector.ResourcesPanel.prototype._resourceView): Added helper function
1426         to create a resource view if needed.
1427         * page/inspector/SourceView.js:
1428         (WebInspector.SourceView.prototype.setupSourceFrameIfNeeded): Delete the 
1429         _frameNeedsSetup property at the beginning to prevent recursion. Get the
1430         length of the messages array when assigning the local length variable.
1431         (WebInspector.SourceView.prototype.addMessage): Renamed from addMessageToSource.
1432         (WebInspector.SourceView.prototype.clearMessages): Added. Clear all the message
1433         bubbles that might be sprinkled in the source. Also clears the messages array.
1434         (WebInspector.SourceView.prototype._addMessageToSource): Create the image
1435         element in the Inspector's document so we can use relative image URLs. Then
1436         adopt the image element into the frame's document.
1437
1438 2008-04-15  Brady Eidson  <beidson@apple.com>
1439
1440         Reviewed by Anders
1441
1442         Hook up event dispatching for window.localStorage changes.
1443
1444         Tests: storage/domstorage/localstorage/enumerate-storage.html
1445                storage/domstorage/localstorage/iframe-events.html
1446                storage/domstorage/localstorage/index-get-and-set.html
1447                storage/domstorage/localstorage/onstorage-attribute-markup.html
1448                storage/domstorage/localstorage/onstorage-attribute-setattribute.html
1449                storage/domstorage/localstorage/simple-events.html
1450                storage/domstorage/localstorage/simple-usage.html
1451                storage/domstorage/localstorage/window-open.html
1452
1453         * storage/LocalStorage.cpp:
1454         (WebCore::LocalStorage::dispatchStorageEvent): Walk every Page in the PageGroup, adding
1455           each Frame that matches the storage area's security origin to a Vector.  Then dispatch
1456           the StorageEvent to each Frame in the Vector
1457
1458         * storage/SessionStorage.cpp:
1459         (WebCore::SessionStorage::dispatchStorageEvent): Adopt the technique used in LocalStorage,
1460           which is to only add the Frames to the Vector if their security origin matches
1461
1462 2008-04-15  Olivier Goffart  <ogoffart@trolltech.com>
1463
1464         Reviewed by Simon.
1465
1466         Fixes: copy to clipboard when selecting, and paste when clicking with the middle button
1467
1468         * platform/Pasteboard.h: Added Qt-specific selection mode
1469         * platform/qt/PasteboardQt.cpp: Choose the clipboard or the selecton
1470         according to the selection mode
1471         (WebCore::Pasteboard::writeSelection):
1472         (WebCore::Pasteboard::plainText):
1473         (WebCore::Pasteboard::documentFragment):
1474         (WebCore::Pasteboard::writeURL):
1475         (WebCore::Pasteboard::clear):
1476         (WebCore::Pasteboard::isSelectionMode):
1477
1478 2008-04-15  Andre Poenitz  <andre.poenitz@trolltech.com>
1479
1480         Reviewed by Simon.
1481
1482         Fix compilation with Qt namespaces
1483
1484         Qt can be configured to have all of its classes inside a specified namespaces.
1485         This is for example used in plugin/component environments like Eclipse.
1486
1487         This change makes it possible to let the Qt port compile against a namespaced
1488         Qt by the use of macros Qt provides to properly forward declare Qt classes in
1489         the namespace.
1490
1491         * WebCore.pro:
1492         * bridge/qt/qt_class.h:
1493         * bridge/qt/qt_instance.h:
1494         * html/HTMLCanvasElement.h:
1495         * platform/DragData.h:
1496         * platform/DragImage.h:
1497         * platform/KURL.h:
1498         * platform/PlatformKeyboardEvent.h:
1499         * platform/PlatformMouseEvent.h:
1500         * platform/PlatformWheelEvent.h:
1501         * platform/Widget.h:
1502         * platform/graphics/Color.h:
1503         * platform/graphics/FloatPoint.h:
1504         * platform/graphics/FloatRect.h:
1505         * platform/graphics/Gradient.h:
1506         * platform/graphics/GraphicsContext.h:
1507         * platform/graphics/ImageBuffer.h:
1508         * platform/graphics/ImageSource.h:
1509         * platform/graphics/IntPoint.h:
1510         * platform/graphics/IntRect.h:
1511         * platform/graphics/IntSize.h:
1512         * platform/graphics/Path.h:
1513         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
1514         * platform/graphics/qt/MediaPlayerPrivatePhonon.h:
1515         * platform/network/qt/QNetworkReplyHandler.h:
1516         * platform/network/qt/ResourceRequest.h:
1517         * platform/qt/ClipboardQt.h:
1518         * platform/qt/RenderThemeQt.h:
1519         * platform/text/PlatformString.h:
1520         * platform/text/qt/TextCodecQt.h:
1521         * svg/graphics/SVGPaintServer.h:
1522         * svg/graphics/SVGPaintServerGradient.h:
1523
1524 2008-04-14  Brady Eidson  <beidson@apple.com>
1525
1526         Reviewed by Anders
1527
1528         Lay the underpinnings for LocalStorage.
1529
1530         For now, this just exposes window.localStorage to the dom which returns an in-memory Storage object, much
1531         like SessionStorage.  The primary difference at this point is that the object returned is shared globally,
1532         and isn't copied for new top-level browsing contexts like SessionStorage.
1533
1534         Later, I'll add proper event dispatch and a persistent storage backing.
1535
1536         * GNUmakefile.am:
1537         * WebCore.base.exp:
1538         * WebCore.pro:
1539         * WebCore.vcproj/WebCore.vcproj:
1540         * WebCore.xcodeproj/project.pbxproj:
1541         * WebCoreSources.bkl:
1542
1543         * bindings/js/JSDOMWindowCustom.cpp:
1544         (WebCore::JSDOMWindow::mark): Mark the optionalLocalStorage
1545
1546         * page/DOMWindow.cpp:
1547         (WebCore::DOMWindow::clear):
1548         (WebCore::DOMWindow::localStorage):
1549         * page/DOMWindow.h:
1550         (WebCore::DOMWindow::optionalLocalStorage):
1551
1552         * storage/LocalStorage.cpp: Added.
1553         (WebCore::LocalStorage::sharedLocalStorage):
1554         (WebCore::LocalStorage::LocalStorage):
1555         (WebCore::LocalStorage::storageArea):
1556         (WebCore::LocalStorage::itemChanged):
1557         (WebCore::LocalStorage::itemRemoved):
1558         (WebCore::LocalStorage::dispatchStorageEvent):
1559         * storage/LocalStorage.h: Added.
1560
1561         * storage/SessionStorage.cpp: Refactor to use the client interface for event dispatching for sessionStorage objects
1562         (WebCore::SessionStorage::SessionStorage):
1563         (WebCore::SessionStorage::copy):
1564         (WebCore::SessionStorage::storageArea):
1565         (WebCore::SessionStorage::itemChanged):
1566         (WebCore::SessionStorage::itemRemoved):
1567         (WebCore::SessionStorage::dispatchStorageEvent):
1568         * storage/SessionStorage.h:
1569
1570         * storage/StorageArea.cpp: Add a client parameter, and call to the client when an item is changed or removed.
1571         (WebCore::StorageArea::create):
1572         (WebCore::StorageArea::StorageArea):
1573         (WebCore::StorageArea::copy):
1574         (WebCore::StorageArea::setItem):
1575         (WebCore::StorageArea::removeItem):
1576         (WebCore::StorageArea::setClient):
1577         * storage/StorageArea.h:
1578         (WebCore::StorageArea::page):
1579         (WebCore::StorageArea::securityOrigin):
1580
1581         * storage/StorageAreaClient.h: Added.  Break out "itemChanged" and "itemRemoved" to a StorageAreaClient
1582           This way, both SessionStorage and LocalStorage areas can have different behavior on changes with
1583           that behavior managed from a central location.
1584         (WebCore::StorageAreaClient::~StorageAreaClient):
1585         (WebCore::StorageAreaClient::StorageAreaClient):
1586         (WebCore::StorageAreaClient::itemChanged):
1587         (WebCore::StorageAreaClient::itemRemoved):
1588
1589 2008-04-14  Brady Eidson  <beidson@apple.com>
1590
1591         Reviewed by Anders
1592
1593         Add a hidden pref to debug WebArchive loading.  With this pref on, when loading a WebArchive,
1594         if the resource isn't in the ArchiveResourceCollection, the loader will not fall back to the 
1595         network and will instead fail the load with a "cannot show URL" error.
1596
1597         * loader/ResourceLoader.cpp:
1598         (WebCore::ResourceLoader::load): Do the check here.
1599
1600         * page/Settings.cpp:
1601         (WebCore::Settings::Settings):
1602         (WebCore::Settings::setWebArchiveDebugModeEnabled):
1603         * page/Settings.h:
1604         (WebCore::Settings::webArchiveDebugModeEnabled):
1605
1606 2008-04-14  Antti Koivisto  <antti@apple.com>
1607
1608         Reviewed by Eric.
1609
1610         Some preparations for additive animations and animations in <use>.
1611         - Disallow animation elements in instance trees.
1612         - Fix buggy SVGUseElement::removeDisallowedElementsFromSubtree(), make it 
1613           public and static
1614         - Invoke it from SVGElementInstance::updateInstance() to clean up the instance tree
1615           there as well.
1616         - Add mechanism for blocking instance updates when an animation changes
1617           the referenced tree.
1618         
1619         The added assert in SVGSMILElement::insertedIntoDocument() verifies the fixes
1620         with the existing test cases.
1621
1622         * svg/SVGAElement.cpp:
1623         (WebCore::SVGAElement::defaultEventHandler):
1624         * svg/SVGElementInstance.cpp:
1625         (WebCore::SVGElementInstance::updateInstance):
1626         * svg/SVGStyledElement.cpp:
1627         (WebCore::SVGStyledElement::updateElementInstance):
1628         (WebCore::SVGStyledElement::setInstanceUpdatesBlocked):
1629         * svg/SVGStyledElement.h:
1630         * svg/SVGUseElement.cpp:
1631         (WebCore::isDisallowedElement):
1632         (WebCore::SVGUseElement::removeDisallowedElementsFromSubtree):
1633         * svg/SVGUseElement.h:
1634         * svg/animation/SVGSMILElement.cpp:
1635         (WebCore::SVGSMILElement::insertedIntoDocument):
1636         (WebCore::SVGSMILElement::isSMILElement):
1637         (WebCore::SVGSMILElement::connectConditions):
1638         (WebCore::SVGSMILElement::disconnectConditions):
1639         * svg/animation/SVGSMILElement.h:
1640
1641 2008-04-14  Adam Roben  <aroben@apple.com>
1642
1643         Don't let the inspected page overwrite properties of JS objects in the
1644         Inspector
1645
1646         <https://bugs.webkit.org/show_bug.cgi?id=16011>
1647         <rdar://problem/5604409>
1648
1649         <https://bugs.webkit.org/show_bug.cgi?id=16837>
1650         <rdar://problem/5813850>
1651
1652         Reviewed by Sam Weinig and Geoff Garen.
1653
1654         Tests (contributed by Adam Barth and Collin Jackson):
1655         manual-tests/inspector-wrappers
1656
1657         * GNUmakefile.am:
1658         * WebCore.pro:
1659         * WebCore.vcproj/WebCore.vcproj:
1660         * WebCore.xcodeproj/project.pbxproj:
1661         * WebCoreSources.bkl:
1662         Added new files to the projects.
1663
1664         * bindings/js/JSQuarantinedObjectWrapper.cpp: Added.
1665         (WebCore::):
1666         (WebCore::JSQuarantinedObjectWrapper::asWrapper): Converts a JSValue
1667         into a JSQuarantinedObjectWrapper, if the JSValue is in fact a
1668         JSQuarantinedObjectWrapper.
1669         (WebCore::JSQuarantinedObjectWrapper::cachedValueGetter): Callback to
1670         be used with PropertySlot.
1671         (WebCore::JSQuarantinedObjectWrapper::JSQuarantinedObjectWrapper):
1672         Hold onto the object we're wrapping and its global object. Pass the
1673         wrapped prototype up to the JSObject constructor.
1674         (WebCore::JSQuarantinedObjectWrapper::~JSQuarantinedObjectWrapper):
1675         (WebCore::JSQuarantinedObjectWrapper::unwrappedExecStateMatches):
1676         Returns true if our underlying object originated from the same global
1677         object as the passed-in ExecState.
1678         (WebCore::JSQuarantinedObjectWrapper::unwrappedExecState):
1679         (WebCore::JSQuarantinedObjectWrapper::transferExceptionToExecState):
1680         Wraps and moves an exception from our underlying ExecState to the
1681         passed-in one.
1682         (WebCore::JSQuarantinedObjectWrapper::mark): Marks ourselves and the
1683         objects we're holding references to.
1684
1685         (WebCore::JSQuarantinedObjectWrapper::getOwnPropertySlot):
1686         (WebCore::JSQuarantinedObjectWrapper::put):
1687         (WebCore::JSQuarantinedObjectWrapper::deleteProperty):
1688         (WebCore::JSQuarantinedObjectWrapper::implementsConstruct):
1689         (WebCore::JSQuarantinedObjectWrapper::construct):
1690         (WebCore::JSQuarantinedObjectWrapper::implementsHasInstance):
1691         (WebCore::JSQuarantinedObjectWrapper::hasInstance):
1692         (WebCore::JSQuarantinedObjectWrapper::implementsCall):
1693         (WebCore::JSQuarantinedObjectWrapper::callAsFunction):
1694         (WebCore::JSQuarantinedObjectWrapper::getPropertyNames):
1695         JSObject overrides. These each check the appropriate permission before
1696         allowing the call to proceed. We wrap all outgoing values using
1697         m_wrapOutgoingValue, and we prepare all incoming values with the
1698         virtual prepareIncomingValue function. If an exception is raised when
1699         calling the underlying object, we transfer the exception in wrapped
1700         form to the passed-in ExecState.
1701
1702         * bindings/js/JSQuarantinedObjectWrapper.h: Added.
1703         (WebCore::JSQuarantinedObjectWrapper::unwrappedObject):
1704         (WebCore::JSQuarantinedObjectWrapper::className): We return the
1705         underlying object's class name so that we can successfully masquerade
1706         as that underlying object when, e.g., Object.prototype.toString is
1707         called on us.
1708         (WebCore::JSQuarantinedObjectWrapper::classInfo):
1709
1710         (WebCore::JSQuarantinedObjectWrapper::allowsGetProperty):
1711         (WebCore::JSQuarantinedObjectWrapper::allowsSetProperty):
1712         (WebCore::JSQuarantinedObjectWrapper::allowsDeleteProperty):
1713         (WebCore::JSQuarantinedObjectWrapper::allowsConstruct):
1714         (WebCore::JSQuarantinedObjectWrapper::allowsHasInstance):
1715         (WebCore::JSQuarantinedObjectWrapper::allowsCallAsFunction):
1716         (WebCore::JSQuarantinedObjectWrapper::allowsGetPropertyNames):
1717         These virtual methods let subclasses define the allowed operations on
1718         the wrapped object. By default all operations are disabled.
1719
1720         * bindings/js/JSInspectedObjectWrapper.cpp: Added. This subclass of
1721         JSQuarantinedObjectWrapper is used to wrap objects from the inspected
1722         page being passed to the Inspector.
1723         (WebCore::wrappers):
1724         (WebCore::):
1725         (WebCore::JSInspectedObjectWrapper::wrap): Wraps the passed-in object
1726         if needed and returns the wrapper. If this object has been wrapped
1727         previously we'll return the old wrapper rather than make a new one.
1728         (WebCore::JSInspectedObjectWrapper::JSInspectedObjectWrapper): Add
1729         ourselves to the wrapper map.
1730         (WebCore::JSInspectedObjectWrapper::~JSInspectedObjectWrapper): Remove
1731         ourselves from the wrapper map.
1732         (WebCore::JSInspectedObjectWrapper::prepareIncomingValue): Ensure that
1733         any objects passed to the inspected object are either wrappers around
1734         objects from the inspected page (in which case we unwrap them so that
1735         the inspected page never sees the wrapper), or wrapped callbacks from
1736         the Inspector.
1737         * bindings/js/JSInspectedObjectWrapper.h: Added.
1738         (WebCore::JSInspectedObjectWrapper::classInfo):
1739         (WebCore::JSInspectedObjectWrapper::allowsGetProperty):
1740         (WebCore::JSInspectedObjectWrapper::allowsSetProperty):
1741         (WebCore::JSInspectedObjectWrapper::allowsDeleteProperty):
1742         (WebCore::JSInspectedObjectWrapper::allowsConstruct):
1743         (WebCore::JSInspectedObjectWrapper::allowsHasInstance):
1744         (WebCore::JSInspectedObjectWrapper::allowsCallAsFunction):
1745         (WebCore::JSInspectedObjectWrapper::allowsGetPropertyNames):
1746         These all return true so that the Inspector can use objects from the
1747         inspected page however it needs.
1748         (WebCore::JSInspectedObjectWrapper::wrapOutgoingValue): Wrap all
1749         outgoing values as JSInspectedObjectWrappers.
1750
1751         * bindings/js/JSInspectorCallbackWrapper.cpp: Added. This subclass of
1752         JSQuarantinedObjectWrapper is used to wrap callbacks that the
1753         Inspector passes to the inspected page (e.g., for event listeners or
1754         client-side storage callbacks).
1755         (WebCore::wrappers):
1756         (WebCore::):
1757         (WebCore::JSInspectorCallbackWrapper::wrap): Wraps the passed-in
1758         object if needed and returns the wrapper. If this object has been
1759         wrapped previously we'll return the old wrapper rather than make a new
1760         one.
1761         (WebCore::JSInspectorCallbackWrapper::JSInspectorCallbackWrapper): Add
1762         ourselves to the wrapper map.
1763         (WebCore::JSInspectorCallbackWrapper::~JSInspectorCallbackWrapper):
1764         Remove ourselves from the wrapper map.
1765         (WebCore::JSInspectorCallbackWrapper::prepareIncomingValue): Ensure
1766         that values passed from the inspected page to an Inspector callback
1767         are wrapped in JSInspectedObjectWrappers. We also allow the inspected
1768         page to pass ourselves in (which will happen in the case of a
1769         client-side storage callback, where the callback itself is passed as
1770         the `this` object). In this case we unwrap ourselves so that the
1771         Inspector doesn't have to deal with the wrapper.
1772         * bindings/js/JSInspectorCallbackWrapper.h: Added.
1773         (WebCore::JSInspectorCallbackWrapper::classInfo):
1774         (WebCore::JSInspectorCallbackWrapper::allowsCallAsFunction):
1775         This is the only allowed operation on a JSInspectorCallbackWrapper.
1776         (WebCore::JSInspectorCallbackWrapper::wrapOutgoingValue): Wrap all
1777         outgoing values as JSInspectorCallbackWrappers.
1778
1779         * page/InspectorController.cpp:
1780         (WebCore::getResourceDocumentNode): Wrap the Document before passing
1781         it to the Inspector.
1782         (WebCore::highlightDOMNode): Unwrap the Node that the Inspector passed
1783         to us.
1784         (WebCore::databaseTableNames): Unwrap the Database that the Inspector
1785         passed to us.
1786         (WebCore::inspectedWindow): Wrap the Window before passing it to the
1787         Inspector.
1788         (WebCore::InspectorController::focusNode): Wrap the Node before
1789         passing it to the Inspector.
1790         (WebCore::wrapCallback): Wraps the passed-in callback in a
1791         JSInspectorCallbackWrapper.
1792         (WebCore::InspectorController::addDatabaseScriptResource): Wrap the
1793         Database beore pasing it to the Inspector.
1794         (WebCore::InspectorController::windowScriptObjectAvailable): Add the
1795         new wrapCallback function to the InspectorController JS object.
1796
1797         * page/inspector/ElementsPanel.js:
1798         (WebInspector.ElementsPanel.reset): Wrap the contentLoaded callback.
1799
1800         * page/inspector/DatabaseQueryView.js:
1801         (WebInspector.DatabaseQueryView._enterKeyPressed):
1802         * page/inspector/DatabaseTableView.js:
1803         (WebInspector.DatabaseTableView.update):
1804         Pass null instead of an empty array to executeSql since we're no
1805         longer allowed to pass any unwrapped objects to the inspected page.
1806         We now wrap all callbacks being passed to the inspected page using
1807         InspectorController.wrapCallback.
1808
1809 2008-04-14  Adam Roben  <aroben@apple.com>
1810
1811         Use prototypes/constructors from the inspected page when operating on
1812         objects from the inspected page
1813
1814         Reviewed by Tim Hatcher.
1815
1816         * page/inspector/Console.js:
1817         (WebInspector.ConsolePanel._format): Use the Node constructor from the
1818         inspected Window with the instanceof operator.
1819         * page/inspector/ElementsPanel.js:
1820         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Use the
1821         Element prototype from the inspected Window instead of the Element
1822         prototype from this Window.
1823         * page/inspector/inspector.js:
1824         (WebInspector.performSearch): Ditto for Document prototype.
1825         * page/inspector/utilities.js:
1826         (Object.type): Now takes an optional Window parameter that is used to
1827         find the built-in constructors.
1828
1829 2008-04-14  Adam Roben  <aroben@apple.com>
1830
1831         Don't store objects from the Inspector on CSSStyleRules from the
1832         inspected page
1833
1834         Reviewed by Tim Hatcher.
1835
1836         * page/inspector/StylesSidebarPane.js:
1837         (WebInspector.StylesSidebarPane.update): Don't store raw CSSStyleRules
1838         from the inspected page in the styleRules array. Instead, always use a
1839         wrapper object. This will keep us from setting Inspector objects as
1840         properties of inspected objects.
1841
1842 2008-04-14  Timothy Hatcher  <timothy@apple.com>
1843
1844         Fixes a regression where clicking a resource URL in the Console would not
1845         show the resource in the Resources panel.
1846
1847         https://bugs.webkit.org/show_bug.cgi?id=18493
1848
1849         Reviewed by Adam Roben.
1850
1851         * page/inspector/Console.js:
1852         (WebInspector.Console.prototype._messagesClicked): Removed console-message-url
1853         handling to show resources. This is now handled by WebInspector.showResourceForURL.
1854         (WebInspector.ConsoleMessage.prototype.toMessageElement): Add the webkit-html-resource-link
1855         class name to the URL anchor. Also add the line number as a property to the anchor.
1856         * page/inspector/ResourcesPanel.js:
1857         (WebInspector.ResourcesPanel): Add a reference to the tree element to each calculator.
1858         (WebInspector.ResourcesPanel.prototype.showResource): Select and reveal the resource in
1859         the sidebar. Call showLine on the resource view if it is implemented.
1860         (WebInspector.ResourcesPanel.prototype.closeVisibleResource): Select the current calculator's
1861         tree element in the sidebar.
1862         (WebInspector.ResourcesPanel.prototype._graphSelected): Call closeVisibleResource after
1863         the calculator changes since closeVisibleResource uses the calculator.
1864         * page/inspector/SourceView.js:
1865         (WebInspector.SourceView.prototype.sourceRow): Early return if the line is null/zero.
1866         (WebInspector.SourceView.prototype.showLine):  Renamed from showSourceLine.
1867         * page/inspector/inspector.css:
1868         (body.console-visible #main-panels): Made the bottom 24px to match
1869         the height of #main-status-bar.
1870         (.console-message-url): Make the color important so it wins over
1871         the .webkit-html-resource-link rule.
1872         (.resource-view .resource-view-content): Made more generic from .image
1873         so all resource views get sized correctly.
1874         (.resource-view.image .resource-view-content): Removed.
1875         * page/inspector/inspector.js:
1876         (WebInspector.documentClick): Pass the line number from the anchor to
1877         WebInspector.showResourceForURL.
1878         (WebInspector.showResourceForURL): Add line number support. Pass the line
1879         to ResourcesPanel.showResource.
1880         (WebInspector.addMainEventListeners): Use bind for the event listeners.
1881
1882 2008-04-14  Xan Lopez  <xan@gnome.org>
1883
1884         Reviewed by Alp Toker.
1885
1886         http://bugs.webkit.org/show_bug.cgi?id=17917
1887         Bug 17917: Cookie support for HTTP soup backend
1888
1889         Initial implementation of cookies for the http soup backend.
1890
1891         Moved CookieJarGtk to CookieJarSoup in network/soup and left the original
1892         one as CookieJarCurl in network/curl.
1893
1894         * GNUmakefile.am:
1895         * platform/CookieJar.h:
1896         * platform/network/curl/CookieJarCurl.cpp: Renamed from WebCore/platform/gtk/CookieJarGtk.cpp.
1897         (WebCore::setCookies):
1898         (WebCore::cookies):
1899         * platform/network/soup/CookieJarSoup.cpp: Added.
1900         (WebCore::getCookieJar):
1901         (WebCore::setCookies):
1902         (WebCore::cookies):
1903         * platform/network/soup/ResourceHandleSoup.cpp:
1904         (WebCore::ResourceHandle::start):
1905
1906 2008-04-14  Holger Freyther  <zecke@selfish.org>
1907
1908         Reviewed by Alp Toker.
1909
1910         https://bugs.webkit.org/show_bug.cgi?id=18411
1911         Enable Page caching and create FrameViews on the fly
1912
1913         Create the FrameView on the fly and cache pages
1914
1915         - Keep a copy of the GtkAdjustment to be able to reuse it for the
1916           FrameViews
1917         - Do not initially create a FrameView and update the WebKit code to
1918           cope with not having a view.
1919         - Cache seven pages by default.
1920
1921         * platform/gtk/ScrollViewGtk.cpp:
1922         (WebCore::ScrollView::setGtkAdjustments):
1923
1924 2008-04-14  David Hyatt  <hyatt@apple.com>
1925
1926         Add a new optimized layout path for positioned objects that move.  Also avoid always marking the <html>
1927         object for layout when it has a percentage height, since the RenderView already does that when its size
1928         changes.
1929
1930         Reviewed by mjs
1931
1932         * rendering/RenderBlock.cpp:
1933         (WebCore::RenderBlock::layoutBlockChildren):
1934         (WebCore::RenderBlock::layoutPositionedObjects):
1935         * rendering/RenderBox.h:
1936         (WebCore::RenderBox::layoutDoingPositionedMovementOnly):
1937         * rendering/RenderObject.cpp:
1938         (WebCore::RenderObject::RenderObject):
1939         (WebCore::RenderObject::setNeedsLayout):
1940         (WebCore::RenderObject::setChildNeedsLayout):
1941         (WebCore::RenderObject::setNeedsPositionedMovementLayout):
1942         (WebCore::RenderObject::setStyle):
1943         * rendering/RenderObject.h:
1944         (WebCore::RenderObject::needsLayout):
1945         (WebCore::RenderObject::needsPositionedMovementLayoutOnly):
1946         (WebCore::RenderObject::layoutDoingPositionedMovementOnly):
1947         * rendering/RenderStyle.cpp:
1948         (WebCore::positionedObjectMoved):
1949         (WebCore::RenderStyle::diff):
1950         * rendering/RenderStyle.h:
1951         (WebCore::RenderStyle::):
1952
1953 2008-04-14  David Hyatt  <hyatt@apple.com>
1954
1955         Add support for gradients in the CSS content property.
1956
1957         Reviewed by olliej
1958
1959         Added fast/gradients/generated-gradients.html
1960
1961         * GNUmakefile.am:
1962         * WebCore.pro:
1963         * WebCore.vcproj/WebCore.vcproj:
1964         * WebCore.xcodeproj/project.pbxproj:
1965         * WebCoreSources.bkl:
1966         * css/CSSParser.cpp:
1967         (WebCore::CSSParser::parseContent):
1968         * css/CSSStyleSelector.cpp:
1969         (WebCore::CSSStyleSelector::applyProperty):
1970         (WebCore::CSSStyleSelector::styleImage):
1971         (WebCore::CSSStyleSelector::mapBackgroundImage):
1972         * css/CSSStyleSelector.h:
1973         * html/HTMLImageElement.cpp:
1974         (WebCore::HTMLImageElement::attach):
1975         * rendering/RenderContainer.cpp:
1976         (WebCore::RenderContainer::updateBeforeAfterContentForContainer):
1977         * rendering/RenderImage.cpp:
1978         (WebCore::RenderImage::RenderImage):
1979         (WebCore::RenderImage::setCachedImage):
1980         (WebCore::RenderImage::paintReplaced):
1981         (WebCore::RenderImage::calcReplacedWidth):
1982         (WebCore::RenderImage::calcReplacedHeight):
1983         (WebCore::RenderImage::calcAspectRatioWidth):
1984         (WebCore::RenderImage::calcAspectRatioHeight):
1985         * rendering/RenderImage.h:
1986         (WebCore::RenderImage::hasImage):
1987         (WebCore::RenderImage::image):
1988         (WebCore::RenderImage::errorOccurred):
1989         (WebCore::RenderImage::usesImageContainerSize):
1990         (WebCore::RenderImage::setImageContainerSize):
1991         (WebCore::RenderImage::imageHasRelativeWidth):
1992         (WebCore::RenderImage::imageHasRelativeHeight):
1993         (WebCore::RenderImage::imageSize):
1994         * rendering/RenderImageGeneratedContent.cpp: Added.
1995         (WebCore::RenderImageGeneratedContent::RenderImageGeneratedContent):
1996         (WebCore::RenderImageGeneratedContent::~RenderImageGeneratedContent):
1997         (WebCore::RenderImageGeneratedContent::setStyleImage):
1998         * rendering/RenderImageGeneratedContent.h: Added.
1999         (WebCore::RenderImageGeneratedContent::hasImage):
2000         (WebCore::RenderImageGeneratedContent::image):
2001         (WebCore::RenderImageGeneratedContent::errorOccurred):
2002         (WebCore::RenderImageGeneratedContent::usesImageContainerSize):
2003         (WebCore::RenderImageGeneratedContent::setImageContainerSize):
2004         (WebCore::RenderImageGeneratedContent::imageHasRelativeWidth):
2005         (WebCore::RenderImageGeneratedContent::imageHasRelativeHeight):
2006         (WebCore::RenderImageGeneratedContent::imageSize):
2007         * rendering/RenderObject.cpp:
2008         (WebCore::RenderObject::createObject):
2009         * rendering/RenderStyle.cpp:
2010         (WebCore::StyleCachedImage::imageHasRelativeWidth):
2011         (WebCore::StyleCachedImage::imageHasRelativeHeight):
2012         (WebCore::StyleCachedImage::usesImageContainerSize):
2013         (WebCore::RenderStyle::contentDataEquivalent):
2014         (WebCore::RenderStyle::setContent):
2015         (WebCore::ContentData::clear):
2016         * rendering/RenderStyle.h:
2017         (WebCore::StyleGeneratedImage::imageHasRelativeWidth):
2018         (WebCore::StyleGeneratedImage::imageHasRelativeHeight):
2019         (WebCore::StyleGeneratedImage::usesImageContainerSize):
2020         (WebCore::BackgroundLayer::setBackgroundImage):
2021         (WebCore::ContentData::):
2022         (WebCore::RenderStyle::setListStyleImage):
2023
2024 2008-04-14  Brady Eidson  <beidson@apple.com>
2025
2026         Reviewed by Sam, but Anders too, and he was more thorough in his review
2027         and thats the only reason Sam beat him
2028
2029         Swap the Page and SecurityOrigin arguments when creating a StorageArea.
2030
2031         SecurityOrigin is really the primary identifying characteristic of a StorageArea,
2032         and StorageAreas that represent LocalStorage won't have an owner Page.
2033
2034         * storage/SessionStorage.cpp:
2035         (WebCore::SessionStorage::copy):
2036         (WebCore::SessionStorage::storageArea):
2037
2038         * storage/StorageArea.cpp:
2039         (WebCore::StorageArea::create):
2040         (WebCore::StorageArea::StorageArea):
2041         (WebCore::StorageArea::copy):
2042         (WebCore::StorageArea::dispatchStorageEvent): Null check m_page here, as in the future
2043           it might be null
2044         * storage/StorageArea.h:
2045
2046 2008-04-14  Timothy Hatcher  <timothy@apple.com>
2047
2048         Add support for changing the sort order of the resources. The two sorting
2049         methods supported current are Time and Size.
2050
2051         Reviewed by Adam Roben.
2052
2053         * page/inspector/Images/statusbarMenuButton.png: Added.
2054         * page/inspector/Images/statusbarMenuButtonSelected.png: Added.
2055         * page/inspector/ResourcesPanel.js:
2056         (WebInspector.ResourcesPanel): Create the status bar menu button and
2057         setup the event listener to call _changeSortingFunction. Each option in
2058         the select references a sorting function.
2059         (WebInspector.ResourcesPanel.get statusBarItems): Add the sorting menu to the
2060         items returned.
2061         (WebInspector.ResourcesPanel._changeSortingFunction): Set the sorting function
2062         to the selected option's function in the sorting menu.
2063         * page/inspector/inspector.css: Added CSS rules for select elements in status bars.
2064
2065 2008-04-14  Timothy Hatcher  <timothy@apple.com>
2066
2067         Add support for toggling between small and large resource rows
2068         in the Resources panel.
2069
2070         Reviewed by Adam Roben.
2071
2072         * English.lproj/InspectorLocalizedStrings.js: Added new tooltip string.
2073         * page/inspector/Images/largerResourcesButtons.png: Added.
2074         * page/inspector/Images/resourceDocumentIconSmall.png: Added.
2075         * page/inspector/Images/resourcePlainIconSmall.png: Added.
2076         * page/inspector/ResourcesPanel.js:
2077         (WebInspector.ResourcesPanel): Create the status bar button and
2078         setup the event listener to call _toggleLargerResources.
2079         (WebInspector.ResourcesPanel.get statusBarItems): Return the status bar button.
2080         (WebInspector.ResourcesPanel._toggleLargerResources): Toggle the class names
2081         for the resources children list and the status bar button.
2082         * page/inspector/inspector.css: New style rules for small resources
2083         and the status bar item.
2084
2085 2008-04-14  Chris Fleizach  <cfleizach@apple.com>
2086
2087         Reviewed by Darin Adler
2088
2089         <rdar://problem/5854572> REGRESSION: AXPosition seems to be flipped in nightly build
2090         AX was using the wrong method to determine the view to use to create the screen position 
2091
2092         * page/AccessibilityObject.cpp:
2093         (WebCore::AccessibilityObject::documentFrameView):
2094         * page/mac/AccessibilityObjectWrapper.mm:
2095         (-[AccessibilityObjectWrapper position]):
2096
2097 2008-04-14  David Smith  <catfish.man@gmail.com>
2098
2099         Reviewed by Timothy Hatcher.
2100         
2101         - Fix https://bugs.webkit.org/show_bug.cgi?id=14258
2102         Response time vs. download time should be shown in the network profile
2103
2104         * page/inspector/Resource.js: Change the sorting function to sort by response received time.
2105         * page/inspector/ResourcesPanel.js: Hook up the existing infrastructure to two bars instead of one; one for the total time, one for the time post-response.
2106         * page/inspector/inspector.css: Add a new rule to make the waiting bar have a lower opacity, and change the total bar opacity to handle the overlap
2107
2108 2008-04-14  Julien Chaffraix  <jchaffraix@webkit.org>
2109
2110         Reviewed by Ap.
2111
2112         Bug 17403: WebKit Creates Invalid Xhtml Links with Ajax
2113         http://bugs.webkit.org/show_bug.cgi?id=17403
2114
2115         The previous code had callbacks for the normal parsing (full document) and fragment parsing.
2116         The difference was induced by the method we were using which did not accept a xmlParserCtxt.
2117         The code has been refactored to allow us to share the callbacks between the different cases.
2118         A drawback is that we have to use xmlParseContent which is an internal libxml method and thus
2119         some internal intialization is done in WebCore.
2120
2121         Test: fast/parser/ampersand-escaped-parseXMLFragment.xhtml
2122
2123         * dom/XMLTokenizer.cpp:
2124         (WebCore::createStringParser): Moved didInit in the global scope as it is shared by the
2125         2 create methods.
2126
2127         (WebCore::createMemoryParser): Create a memory parser similar to the previous code.
2128         Initialize the xmlParserContext to call xmlParseContent in parseXMLDocumentFragment.
2129
2130         (WebCore::XMLTokenizer::initializeParserContext): Check m_parsingFragment to know
2131         which create method to call.
2132
2133         * dom/XMLTokenizer.h: Added parseXMLDocumentFragment as a friend of XMLTokenizer.
2134
2135 2008-04-14  Rob Buis  <buis@kde.org>
2136
2137         Reviewed by Eric.
2138
2139         http://bugs.webkit.org/show_bug.cgi?id=18230
2140         tspan in link not working
2141
2142         Implement SVG Errata: "The 'a' element may contain any
2143         element that its parent may contain, except itself."
2144
2145         * svg/SVGAElement.cpp:
2146         (WebCore::SVGAElement::childShouldCreateRenderer):
2147
2148 2008-04-13  David Hyatt  <hyatt@apple.com>
2149
2150         Fix for bug 18466, WebKit exhibits slow performance on Opera DHTML benchmark.  Improve layout's rect
2151         invalidation code to only invalidate a single unioned rect once enough individual little rects have
2152         been detected.
2153
2154         Reviewed by olliej
2155
2156         * page/FrameView.cpp:
2157         (WebCore::FrameViewPrivate::reset):
2158         (WebCore::FrameView::layout):
2159         (WebCore::FrameView::repaintRectangle):
2160         (WebCore::FrameView::beginDeferredRepaints):
2161         (WebCore::FrameView::endDeferredRepaints):
2162         * page/FrameView.h:
2163
2164 2008-04-13  Eric Seidel  <eric@webkit.org>
2165
2166         Reviewed by Oliver.
2167
2168         Fix spelling error in function name, no test case.
2169
2170         * svg/SVGTextContentElement.cpp:
2171         (WebCore::SVGInlineTextBoxQueryWalker::chunkPortionCallback):
2172
2173 2008-04-13  Eric Seidel  <eric@webkit.org>
2174
2175         Reviewed by Oliver.
2176
2177         Build fix for +SVG_ANIMATION -SVG_FOREIGN_OBJECT build, no tests.
2178
2179         * svg/SVGAnimateMotionElement.cpp:
2180         (WebCore::SVGAnimateMotionElement::hasValidTarget):
2181
2182 2008-04-13  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
2183
2184         Reviewed by Oliver Hunt.
2185
2186         http://bugs.webkit.org/show_bug.cgi?id=18239
2187         [Gtk] Build breaks if SVG is enabled but SVG Fonts disabled
2188
2189         * svg/SVGAltGlyphElement.idl: Add SVG_FONTS in Conditional
2190
2191 2008-04-13  Julien Chaffraix  <jchaffraix@webkit.org>
2192
2193         Reviewed by David.
2194
2195         More SVG filters build fix.
2196
2197         * svg/graphics/filters/SVGFEImage.cpp:
2198         (WebCore::SVGFEImage::~SVGFEImage):
2199         (WebCore::SVGFEImage::setCachedImage):
2200
2201 2008-04-13  David Hyatt  <hyatt@apple.com>
2202
2203         Fix build bustage on the filters SVG code path (not built by default).
2204
2205         * svg/SVGFEImageElement.cpp:
2206         (WebCore::SVGFEImageElement::~SVGFEImageElement):
2207         (WebCore::SVGFEImageElement::parseMappedAttribute):
2208
2209 2008-04-13  Dan Winship  <danw@gnome.org>
2210
2211         Reviewed by Alp Toker.
2212
2213         http://bugs.webkit.org/show_bug.cgi?id=18391
2214         return body data incrementally from libsoup backend
2215
2216         Fix libsoup backend to pass data to the loader incrementally
2217         rather than all at once at the end.
2218
2219         * platform/network/soup/ResourceHandleSoup.cpp
2220         (ResourceHandle::start): connect to "got-headers" and "got-chunk"
2221         signals on the message
2222         (gotHeadersCallback): call client->didReceiveResponse() from here
2223         (gotChunkCallback): call client->didReceiveData() from here
2224         (finishedCallback): renamed from dataCallback. mostly just calls
2225         client->didFinishLoading() now.
2226
2227 2008-04-13  Dan Bernstein  <mitz@apple.com>
2228
2229         Reviewed by Jessica Kahn.
2230
2231         - remove duplicate condition in canHaveChildrenForEditing()
2232
2233         * editing/htmlediting.cpp:
2234         (WebCore::canHaveChildrenForEditing):
2235
2236 2008-04-13  Dan Bernstein  <mitz@apple.com>
2237
2238         Reviewed by Darin Adler.
2239
2240         - fix http://bugs.webkit.org/show_bug.cgi?id=18307
2241           <rdar://problem/5842546> REGRESSION (r31620): Incorrect Hiragino Kaku Gothic, font-weight:500
2242
2243         Test: fast/css/font-weight-1.html
2244
2245         * platform/graphics/mac/FontCacheMac.mm:
2246         (WebCore::toAppKitFontWeight): Adjusted the mapping to cover the AppKit
2247         weight range from 2 to 12, because AppKit weight 1 never occurs. The
2248         new mapping matches font-weight: n00 to ISO weight Wn.
2249         * platform/mac/WebFontCache.mm:
2250         (betterChoice): Changed the midpoint used when deciding between two
2251         candidates that deviate from the desired weight by the same amount.
2252
2253 2008-04-12  David Hyatt  <hyatt@apple.com>
2254
2255         Memory management cleanup for the new StyleCachedImage and StyleGeneratedImage classes.  Make the back end
2256         values hold refptrs to cached front end values.  This will avoid malloc churn as RenderStyles get
2257         re-resolved.
2258
2259         Reviewed by olliej
2260
2261         * css/CSSCursorImageValue.cpp:
2262         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
2263         (WebCore::CSSCursorImageValue::cachedImage):
2264         * css/CSSCursorImageValue.h:
2265         * css/CSSImageGeneratorValue.cpp:
2266         (WebCore::CSSImageGeneratorValue::CSSImageGeneratorValue):
2267         (WebCore::CSSImageGeneratorValue::generatedImage):
2268         * css/CSSImageGeneratorValue.h:
2269         * css/CSSImageValue.cpp:
2270         (WebCore::CSSImageValue::CSSImageValue):
2271         (WebCore::CSSImageValue::~CSSImageValue):
2272         (WebCore::CSSImageValue::cachedImage):
2273         * css/CSSImageValue.h:
2274         * css/CSSStyleSelector.cpp:
2275         (WebCore::CSSStyleSelector::applyProperty):
2276         (WebCore::CSSStyleSelector::createStyleImage):
2277         * css/CSSStyleSelector.h:
2278         * rendering/RenderStyle.h:
2279         (WebCore::StyleCachedImage::cachedImage):
2280         (WebCore::StyleGeneratedImage::StyleGeneratedImage):
2281         (WebCore::StyleGeneratedImage::data):
2282
2283 2008-04-12  Julien Chaffraix  <jchaffraix@webkit.org>
2284
2285         Not reviewed, Qt build fix.
2286
2287         * dom/XMLTokenizer.cpp:
2288        (WebCore::XMLTokenizer::parseEndElement):
2289         * platform/graphics/qt/GraphicsContextQt.cpp:
2290         (WebCore::GraphicsContext::clip):
2291         * platform/qt/ClipboardQt.cpp:
2292         (WebCore::ClipboardQt::setDragImage):
2293
2294 2008-04-12  David Hyatt  <hyatt@apple.com>
2295
2296         Add support for list-style-image gradients.  Also improve the image comparisons between two RenderStyles        
2297         to not mistakenly believe that images have changed.
2298
2299         Reviewed by olliej
2300
2301         Added fast/gradients/list-item-gradient.html
2302
2303         * css/CSSComputedStyleDeclaration.cpp:
2304         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2305         * css/CSSParser.cpp:
2306         (WebCore::CSSParser::parseValue):
2307         * css/CSSStyleSelector.cpp:
2308         (WebCore::CSSStyleSelector::applyProperty):
2309         (WebCore::CSSStyleSelector::createStyleImage):
2310         * rendering/RenderListMarker.cpp:
2311         (WebCore::RenderListMarker::RenderListMarker):
2312         (WebCore::RenderListMarker::paint):
2313         (WebCore::RenderListMarker::imageChanged):
2314         (WebCore::RenderListMarker::calcPrefWidths):
2315         * rendering/RenderListMarker.h:
2316         * rendering/RenderStyle.cpp:
2317         (WebCore::imagesEquivalent):
2318         (WebCore::BorderImage::operator==):
2319         (WebCore::StyleCachedImage::errorOccurred):
2320         (WebCore::BackgroundLayer::operator==):
2321         (WebCore::StyleInheritedData::StyleInheritedData):
2322         (WebCore::cursorDataEquivalent):
2323         (WebCore::StyleInheritedData::operator==):
2324         (WebCore::RenderStyle::diff):
2325         * rendering/RenderStyle.h:
2326         (WebCore::StyleImage::errorOccurred):
2327         (WebCore::RenderStyle::listStyleImage):
2328         (WebCore::RenderStyle::setListStyleImage):
2329         (WebCore::RenderStyle::initialListStyleImage):
2330
2331 2008-04-12  Dan Bernstein  <mitz@apple.com>
2332
2333         - Windows build fix
2334
2335         * platform/win/ClipboardWin.cpp:
2336         (WebCore::ClipboardWin::setDragImage):
2337
2338 2008-04-12  Kevin Ollivier  <kevino@theolliviers.com>
2339
2340         wx build fix. Update clip to take a FloatRect.
2341
2342         * platform/graphics/wx/GraphicsContextWx.cpp:
2343         (WebCore::GraphicsContext::clip):
2344
2345 2008-04-12  David Hyatt  <hyatt@apple.com>
2346
2347         Add gradient support to border-image (even though it's mostly just weird).
2348
2349         Reviewed by Dan
2350
2351         Added fast/gradients/border-image-gradient.html
2352               fast/gradients/border-image-gradient-sides-and-corners.html
2353
2354         * css/CSSBorderImageValue.h:
2355         (WebCore::CSSBorderImageValue::imageValue):
2356         * css/CSSStyleSelector.cpp:
2357         (WebCore::CSSStyleSelector::applyProperty):
2358         * platform/graphics/GeneratedImage.cpp:
2359         (WebCore::GeneratedImage::draw):
2360         * rendering/InlineFlowBox.cpp:
2361         (WebCore::InlineFlowBox::paintBoxDecorations):
2362         * rendering/RenderBox.cpp:
2363         (WebCore::RenderBox::imageChanged):
2364         * rendering/RenderObject.cpp:
2365         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
2366         (WebCore::RenderObject::paintBorderImage):
2367         (WebCore::RenderObject::paintBorder):
2368         (WebCore::RenderObject::updateBackgroundImages):
2369         (WebCore::RenderObject::arenaDelete):
2370         * rendering/RenderStyle.cpp:
2371         (WebCore::StyleCachedImage::isLoaded):
2372         * rendering/RenderStyle.h:
2373         (WebCore::StyleImage::isLoaded):
2374         (WebCore::BorderImage::image):
2375
2376 2008-04-11  Dan Bernstein  <mitz@apple.com>
2377
2378         Reviewed by Dave Hyatt.
2379
2380         - fix a regression from r31324 which caused most Arabic text to render
2381           as missing glyphs
2382
2383         Test: svg/W3C-SVG-1.1/fonts-glyph-02-t.svg
2384
2385         * svg/SVGFont.cpp:
2386         (WebCore::SVGTextRunWalker::walk): Changed to always process characters
2387         in logical order and therefore dispatch the callbacks with a logically-
2388         ordered glyph stream. Changed the call to isCompatibleGlyph() to check
2389         for compatibility only with the range of characters the candidate glyph
2390         is derived from rather than with the entire lookup range. Changed to
2391         mark the <missing-glyph> glyph identifier as valid, to facilitate the
2392         use of invalid glyph identifiers to mark font fallback.
2393         (WebCore::drawTextUsingSVGFontCallback): Changed to only append the
2394         glyph identifier to a vector.
2395         (WebCore::drawTextMissingGlyphCallback): Changed to only append the
2396         character to a vector and append an invalid glyph identifier to the
2397         glyph vector.
2398         (WebCore::Font::drawTextUsingSVGFont): Moved the drawing from the
2399         callbacks into this function, iterating over the glyph and fallback
2400         characters vector in visual order.
2401
2402 2008-04-11  Dirk Schulze <vbs85@gmx.de>
2403
2404         Reviewed by eseidel.
2405
2406         Attempt to fix Cairo build.
2407
2408         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2409         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
2410
2411 2008-04-11  David Hyatt  <hyatt@apple.com>
2412
2413         Rename CachedResource's ref/deref methods to addClient/removeClient.  This matches the new
2414         StyleImage class and is a more accurate description of what those methods really do.
2415
2416         Reviewed by olliej
2417
2418         * WebCore.base.exp:
2419         * css/CSSCursorImageValue.cpp:
2420         (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed):
2421         * css/CSSFontFaceSource.cpp:
2422         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
2423         (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
2424         * css/CSSImageValue.cpp:
2425         (WebCore::CSSImageValue::~CSSImageValue):
2426         (WebCore::CSSImageValue::image):
2427         * css/CSSImportRule.cpp:
2428         (WebCore::CSSImportRule::~CSSImportRule):
2429         (WebCore::CSSImportRule::insertedIntoParent):
2430         * dom/ProcessingInstruction.cpp:
2431         (WebCore::ProcessingInstruction::~ProcessingInstruction):
2432         (WebCore::ProcessingInstruction::checkStyleSheet):
2433         (WebCore::ProcessingInstruction::parseStyleSheet):
2434         * dom/XMLTokenizer.cpp:
2435         (WebCore::XMLTokenizer::~XMLTokenizer):
2436         (WebCore::XMLTokenizer::endElementNs):
2437         (WebCore::XMLTokenizer::notifyFinished):
2438         * html/CanvasPattern.cpp:
2439         (WebCore::CanvasPattern::CanvasPattern):
2440         (WebCore::CanvasPattern::~CanvasPattern):
2441         * html/HTMLImageLoader.cpp:
2442         (WebCore::HTMLImageLoader::~HTMLImageLoader):
2443         (WebCore::HTMLImageLoader::setImage):
2444         (WebCore::HTMLImageLoader::updateFromElement):
2445         * html/HTMLLinkElement.cpp:
2446         (WebCore::HTMLLinkElement::~HTMLLinkElement):
2447         (WebCore::HTMLLinkElement::process):
2448         * html/HTMLScriptElement.cpp:
2449         (WebCore::HTMLScriptElement::~HTMLScriptElement):
2450         (WebCore::HTMLScriptElement::parseMappedAttribute):
2451         (WebCore::HTMLScriptElement::insertedIntoDocument):
2452         (WebCore::HTMLScriptElement::removedFromDocument):
2453         (WebCore::HTMLScriptElement::notifyFinished):
2454         * html/HTMLTokenizer.cpp:
2455         (WebCore::HTMLTokenizer::reset):
2456         (WebCore::HTMLTokenizer::scriptHandler):
2457         (WebCore::HTMLTokenizer::notifyFinished):
2458         * loader/CachedCSSStyleSheet.cpp:
2459         (WebCore::CachedCSSStyleSheet::addClient):
2460         * loader/CachedCSSStyleSheet.h:
2461         * loader/CachedFont.cpp:
2462         (WebCore::CachedFont::addClient):
2463         * loader/CachedFont.h:
2464         * loader/CachedImage.cpp:
2465         (WebCore::CachedImage::addClient):
2466         * loader/CachedImage.h:
2467         * loader/CachedResource.cpp:
2468         (WebCore::CachedResource::addClient):
2469         (WebCore::CachedResource::removeClient):
2470         * loader/CachedResource.h:
2471         * loader/CachedScript.cpp:
2472         (WebCore::CachedScript::addClient):
2473         * loader/CachedScript.h:
2474         * loader/CachedXBLDocument.h:
2475         * loader/CachedXSLStyleSheet.cpp:
2476         (WebCore::CachedXSLStyleSheet::addClient):
2477         * loader/CachedXSLStyleSheet.h:
2478         * loader/mac/UserStyleSheetLoader.cpp:
2479         (UserStyleSheetLoader::UserStyleSheetLoader):
2480         (UserStyleSheetLoader::~UserStyleSheetLoader):
2481         * platform/mac/ClipboardMac.mm:
2482         (WebCore::ClipboardMac::setDragImage):
2483         * rendering/RenderImage.cpp:
2484         (WebCore::RenderImage::~RenderImage):
2485         (WebCore::RenderImage::setCachedImage):
2486         * rendering/RenderListMarker.cpp:
2487         (WebCore::RenderListMarker::~RenderListMarker):
2488         (WebCore::RenderListMarker::setStyle):
2489         * rendering/RenderObject.cpp:
2490         (WebCore::RenderObject::updateBackgroundImages):
2491         (WebCore::RenderObject::arenaDelete):
2492         * rendering/RenderStyle.cpp:
2493         (WebCore::StyleCachedImage::addClient):
2494         (WebCore::StyleCachedImage::removeClient):
2495         * svg/SVGImageLoader.cpp:
2496         (WebCore::SVGImageLoader::updateFromElement):
2497         * xml/XSLImportRule.cpp:
2498         (WebCore::XSLImportRule::~XSLImportRule):
2499         (WebCore::XSLImportRule::loadSheet):
2500
2501 2008-04-11  David Hyatt  <hyatt@apple.com>
2502
2503         This patch adds support for CSS gradients as background images.  RenderStyles now hold a StyleImage
2504         RefPtr, which is a wrapper for two types of images: CachedImages (loaded from URLs) and generated images
2505         (patterns created on the fly such as gradients).
2506
2507         All of the features of <canvas> are supported: gradients can be linear or radial, have multiple stops, and
2508         can specify their points as percentages (for reusable gradients across different box sizes).
2509
2510         Reviewed by olliej
2511
2512         Added fast/gradients/simple-gradients.html
2513
2514         * WebCore.xcodeproj/project.pbxproj:
2515         * css/CSSBorderImageValue.cpp:
2516         (WebCore::CSSBorderImageValue::CSSBorderImageValue):
2517         * css/CSSBorderImageValue.h:
2518         (WebCore::CSSBorderImageValue::imageValue):
2519         (WebCore::CSSBorderImageValue::generatorValue):
2520         * css/CSSComputedStyleDeclaration.cpp:
2521         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2522         * css/CSSGradientValue.cpp: Added.
2523         (WebCore::CSSGradientValue::cssText):
2524         (WebCore::CSSGradientValue::createGradient):
2525         (WebCore::CSSGradientValue::image):
2526         (WebCore::compareStops):
2527         (WebCore::CSSGradientValue::sortStopsIfNeeded):
2528         (WebCore::CSSGradientValue::resolvePoint):
2529         (WebCore::CSSGradientValue::resolveRadius):
2530         * css/CSSGradientValue.h: Added.
2531         (WebCore::):
2532         (WebCore::CSSGradientColorStop::CSSGradientColorStop):
2533         (WebCore::CSSGradientValue::CSSGradientValue):
2534         (WebCore::CSSGradientValue::type):
2535         (WebCore::CSSGradientValue::setType):
2536         (WebCore::CSSGradientValue::setFirstX):
2537         (WebCore::CSSGradientValue::setFirstY):
2538         (WebCore::CSSGradientValue::setSecondX):
2539         (WebCore::CSSGradientValue::setSecondY):
2540         (WebCore::CSSGradientValue::setFirstRadius):
2541         (WebCore::CSSGradientValue::setSecondRadius):
2542         (WebCore::CSSGradientValue::addStop):
2543         * css/CSSImageGeneratorValue.cpp: Added.
2544         (WebCore::CSSImageGeneratorValue::~CSSImageGeneratorValue):
2545         (WebCore::CSSImageGeneratorValue::addClient):
2546         (WebCore::CSSImageGeneratorValue::removeClient):
2547         (WebCore::CSSImageGeneratorValue::getImage):
2548         (WebCore::CSSImageGeneratorValue::putImage):
2549         * css/CSSImageGeneratorValue.h: Added.
2550         (WebCore::CSSImageGeneratorValue::isImageGeneratorValue):
2551         * css/CSSImageValue.h:
2552         (WebCore::CSSImageValue::isImageValue):
2553         * css/CSSParser.cpp:
2554         (WebCore::CSSParser::parseBackgroundImage):
2555         (WebCore::BorderImageParseContext::commitImage):
2556         (WebCore::CSSParser::parseBorderImage):
2557         (WebCore::parseGradientPoint):
2558         (WebCore::parseGradientColorStop):
2559         (WebCore::CSSParser::parseGradient):
2560         * css/CSSParser.h:
2561         * css/CSSStyleSelector.cpp:
2562         (WebCore::CSSStyleSelector::applyProperty):
2563         (WebCore::CSSStyleSelector::createStyleImage):
2564         (WebCore::CSSStyleSelector::mapBackgroundImage):
2565         * css/CSSStyleSelector.h:
2566         * css/CSSValue.h:
2567         (WebCore::CSSValue::isImageValue):
2568         (WebCore::CSSValue::isImageGeneratorValue):
2569         * html/CanvasRenderingContext2D.cpp:
2570         (WebCore::CanvasRenderingContext2D::isPointInPath):
2571         * platform/graphics/BitmapImage.cpp:
2572         (WebCore::BitmapImage::BitmapImage):
2573         (WebCore::BitmapImage::dataChanged):
2574         (WebCore::BitmapImage::frameCount):
2575         * platform/graphics/BitmapImage.h:
2576         * platform/graphics/GraphicsContext.cpp:
2577         (WebCore::GraphicsContext::clipToImageBuffer):
2578         * platform/graphics/GraphicsContext.h:
2579         * platform/graphics/ImageBuffer.h:
2580         (WebCore::ImageBuffer::cgImage):
2581         (WebCore::ImageBuffer::image):
2582         * platform/graphics/cg/GraphicsContextCG.cpp:
2583         (WebCore::GraphicsContext::clipToImageBuffer):
2584         (WebCore::GraphicsContext::paintBuffer):
2585         (WebCore::GraphicsContext::drawImage):
2586         * platform/graphics/cg/ImageBufferCG.cpp:
2587         (WebCore::ImageBuffer::create):
2588         (WebCore::ImageBuffer::ImageBuffer):
2589         (WebCore::ImageBuffer::~ImageBuffer):
2590         (WebCore::ImageBuffer::image):
2591         (WebCore::ImageBuffer::getImageData):
2592         (WebCore::ImageBuffer::putImageData):
2593         (WebCore::ImageBuffer::toDataURL):
2594         * platform/graphics/cg/ImageCG.cpp:
2595         (WebCore::BitmapImage::BitmapImage):
2596         (WebCore::BitmapImage::draw):
2597         (WebCore::Image::drawPattern):
2598         * platform/graphics/qt/ImageQt.cpp:
2599         (WebCore::BitmapImage::BitmapImage):
2600         * rendering/InlineFlowBox.cpp:
2601         (WebCore::InlineFlowBox::paintBackground):
2602         * rendering/RenderBox.cpp:
2603         (WebCore::RenderBox::calculateBackgroundSize):
2604         (WebCore::RenderBox::imageChanged):
2605         (WebCore::RenderBox::paintBackgroundExtended):
2606         * rendering/RenderObject.cpp:
2607         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
2608         (WebCore::RenderObject::updateBackgroundImages):
2609         (WebCore::RenderObject::arenaDelete):
2610         * rendering/RenderStyle.cpp:
2611         (WebCore::StyleCachedImage::cssValue):
2612         (WebCore::StyleCachedImage::canRender):
2613         (WebCore::StyleCachedImage::imageSize):
2614         (WebCore::StyleCachedImage::setImageContainerSize):
2615         (WebCore::StyleCachedImage::addClient):
2616         (WebCore::StyleCachedImage::removeClient):
2617         (WebCore::StyleCachedImage::image):
2618         (WebCore::StyleGeneratedImage::cssValue):
2619         (WebCore::StyleGeneratedImage::imageSize):
2620         (WebCore::StyleGeneratedImage::setImageContainerSize):
2621         (WebCore::StyleGeneratedImage::addClient):
2622         (WebCore::StyleGeneratedImage::removeClient):
2623         (WebCore::StyleGeneratedImage::image):
2624         * rendering/RenderStyle.h:
2625         (WebCore::StyleImage::StyleImage):
2626         (WebCore::StyleImage::~StyleImage):
2627         (WebCore::StyleImage::operator==):
2628         (WebCore::StyleImage::canRender):
2629         (WebCore::StyleImage::isCachedImage):
2630         (WebCore::StyleImage::isGeneratedImage):
2631         (WebCore::StyleCachedImage::StyleCachedImage):
2632         (WebCore::StyleCachedImage::data):
2633         (WebCore::StyleCachedImage::isCachedImage):
2634         (WebCore::StyleGeneratedImage::StyleGeneratedImage):
2635         (WebCore::StyleGeneratedImage::data):
2636         (WebCore::StyleGeneratedImage::isGeneratedImage):
2637         (WebCore::BackgroundLayer::backgroundImage):
2638         (WebCore::BackgroundLayer::setBackgroundImage):
2639         (WebCore::BackgroundLayer::containsImage):
2640         (WebCore::RenderStyle::backgroundImage):
2641         (WebCore::RenderStyle::initialBackgroundImage):
2642         * svg/graphics/cg/SVGPaintServerGradientCg.cpp:
2643         (WebCore::SVGPaintServerGradient::teardown):
2644         * svg/graphics/cg/SVGResourceMaskerCg.mm:
2645         (WebCore::SVGResourceMasker::applyMask):
2646
2647 2008-04-11  Dan Bernstein  <mitz@apple.com>
2648
2649         Reviewed by Oliver Hunt.
2650
2651         - add SVGGlyphMap.h to project files
2652
2653         * WebCore.vcproj/WebCore.vcproj:
2654         * WebCore.xcodeproj/project.pbxproj:
2655
2656 2008-04-11  Anders Carlsson  <andersca@apple.com>
2657
2658         Fix release build.
2659         
2660         * WebCore.base.exp:
2661         
2662         * loader/archive/ArchiveResource.h:
2663         (WebCore::ArchiveResource::response):
2664         This should be const.
2665
2666 2008-04-11  Antti Koivisto  <antti@apple.com>
2667
2668         Try to fix Qt build.
2669
2670         * svg/animation/SMILTime.cpp:
2671
2672 2008-04-11  Anders Carlsson  <andersca@apple.com>
2673
2674         Reviewed by Brady.
2675
2676         Don't create the ArchiveResource response lazily.
2677         
2678         * loader/archive/ArchiveResource.cpp:
2679         (WebCore::ArchiveResource::ArchiveResource):
2680         * loader/archive/ArchiveResource.h:
2681         (WebCore::ArchiveResource::response):
2682
2683 2008-04-11  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
2684
2685         Reviewed by Mark Rowe.
2686
2687         Added missing '\' in the svg include path
2688
2689         * GNUmakefile.am:
2690
2691 2008-04-11  Antti Koivisto  <antti@apple.com>
2692
2693         Another attempted Qt build fix.
2694
2695         * WebCore.pro:
2696
2697 2008-04-11  Antti Koivisto  <antti@apple.com>
2698
2699         Reviewed by Oliver.
2700
2701         Fix build when SVG is enabled but SVG_ANIMATION is not.
2702
2703         * ChangeLog:
2704         * bindings/js/JSSVGElementWrapperFactory.cpp:
2705         * bindings/objc/DOM.mm:
2706         (WebCore::createElementClassMap):
2707         * svg/SVGAElement.cpp:
2708         (WebCore::SVGAElement::defaultEventHandler):
2709         * svg/SVGAnimateColorElement.cpp:
2710         * svg/SVGAnimateColorElement.h:
2711         * svg/SVGAnimateColorElement.idl:
2712         * svg/SVGAnimateMotionElement.h:
2713         * svg/SVGAnimationElement.cpp:
2714         (WebCore::SVGAnimationElement::animationMode):
2715         * svg/SVGAnimationElement.h:
2716         * svg/SVGAnimationElement.idl:
2717         * svg/SVGSetElement.cpp:
2718         * svg/SVGSetElement.h:
2719         * svg/SVGSetElement.idl:
2720         * svg/animation/SMILTimeContainer.cpp:
2721         (WebCore::SMILTimeContainer::begin):
2722         (WebCore::SMILTimeContainer::pause):
2723         (WebCore::SMILTimeContainer::resume):
2724         (WebCore::SMILTimeContainer::elapsed):
2725         (WebCore::SMILTimeContainer::isPaused):
2726         (WebCore::SMILTimeContainer::timerFired):
2727         * svg/animation/SMILTimeContainer.h:
2728         * svg/animation/SVGSMILElement.cpp:
2729         * svg/animation/SVGSMILElement.h:
2730         * svg/svgtags.in:
2731
2732 2008-04-11  Anders Carlsson  <andersca@apple.com>
2733
2734         Reviewed by Brady.
2735
2736         Move archive loading from FrameLoader to DocumentLoader.
2737         
2738         * loader/DocumentLoader.cpp:
2739         (WebCore::DocumentLoader::DocumentLoader):
2740         (WebCore::DocumentLoader::clearArchiveResources):
2741         (WebCore::DocumentLoader::deliverArchivedResourcesAfterDelay):
2742         (WebCore::DocumentLoader::archiveResourceDeliveryTimerFired):
2743         (WebCore::DocumentLoader::isArchiveLoadPending):
2744         (WebCore::DocumentLoader::cancelPendingArchiveLoad):
2745         (WebCore::DocumentLoader::scheduleArchiveLoad):
2746         (WebCore::DocumentLoader::setDefersLoading):
2747         * loader/DocumentLoader.h:
2748         * loader/FrameLoader.cpp:
2749         (WebCore::FrameLoader::FrameLoader):
2750         (WebCore::FrameLoader::setDefersLoading):
2751         (WebCore::FrameLoader::stopAllLoaders):
2752         * loader/FrameLoader.h:
2753         * loader/ResourceLoader.cpp:
2754         (WebCore::ResourceLoader::load):
2755         (WebCore::ResourceLoader::didCancel):
2756
2757 2008-04-11  Timothy Hatcher  <timothy@apple.com>
2758
2759         Fixes the regression where the DOM tree does not update when navigating
2760         to another page with the Inspector open.
2761
2762         https://bugs.webkit.org/show_bug.cgi?id=18418
2763
2764         Reviewed by Adam Roben.
2765
2766         * page/inspector/ElementsPanel.js:
2767         (WebInspector.ElementsPanel.prototype.reset): If the inspected document does not have a
2768         firstChild yet, add an event listener for DOMContentLoaded. The event listener just sets
2769         a proeprty that a polling functions looks for then triggers the reset.
2770         (WebInspector.ElementsPanel.prototype._focusedNodeChanged): Always call updateStyles with
2771         forceUpdate as true. This makes sure the Styles pane clears when there isn't a focused node.
2772
2773 2008-04-11  Dan Bernstein  <mitz@apple.com>
2774
2775         Reviewed by Timothy Hatcher.
2776
2777         - fix http://bugs.webkit.org/show_bug.cgi?id=18412
2778           Inspector truncates text when editing a CSS property
2779
2780         * page/inspector/inspector.css:
2781
2782 2008-04-11  Antti Koivisto  <antti@apple.com>
2783
2784         Try to fix Qt build by including some headers.
2785
2786         * ChangeLog:
2787         * platform/graphics/UnitBezier.h:
2788         * svg/SVGAnimationElement.cpp:
2789         * svg/animation/SMILTime.h:
2790         * svg/animation/SVGSMILElement.cpp:
2791
2792 2008-04-11  Antti Koivisto  <antti@apple.com>
2793
2794         Try to fix Windows build by switching to std::sort().
2795
2796         * svg/animation/SVGSMILElement.cpp:
2797         (WebCore::sortTimeList):
2798
2799 2008-04-11  Rob Buis  <buis@kde.org>
2800
2801         Reviewed by Eric.
2802
2803         http://bugs.webkit.org/show_bug.cgi?id=18340
2804         Elements with display="none" in a <clipPath> still contribute to clipping path
2805
2806         Skip elements in clip-path container that have display=none specified.
2807
2808         * svg/SVGClipPathElement.cpp:
2809         (WebCore::SVGClipPathElement::canvasResource):
2810
2811 2008-04-10  Antti Koivisto  <antti@apple.com>
2812
2813         Reviewed by Eric.
2814
2815         Redo the SVG animation support.
2816         
2817         It does
2818         - Full SMIL interval timing model including syncbase and event base timing (the hard part).
2819         - CSS and XML attribute animation.
2820         - Linear, discrete and spline calcModes.
2821         - Values animation with keyTimes and keySplines.
2822         - Link activated animations.
2823         - Pretty good support for <animate> and <set> animations
2824         - Basic support for <animateColor>, <animateMotion> and <animateTransform>.
2825
2826         This passes some 35 of the 56 tests in W3C SVG animation test suite, a bunch more
2827         with some subtest failures.
2828
2829         What is still missing
2830         - Additive animation with multiple animations operating on the same property. This is a
2831           major architectural feature in animation code. It shouldn't be too hard to add.
2832         - Only <animate> implements accumulate.
2833         - <animateMotion> does not do paths, keypoints, rotate.
2834         - <animateTransform> does not work correctly in all cases
2835         - calcMode paced is missing.
2836         - repeat, beginEvent, endEvent are missing.
2837         - accesskey() is missing.
2838         - JS does not see correct values for baseVal/animVal, changing values that are being
2839           animted for a script produces wrong results. This problem needs to be solved outside
2840           the animation code.
2841         - Some other stuff I forgot or do not know about.
2842
2843         * GNUmakefile.am:
2844         * WebCore.pro:
2845         * WebCore.vcproj/WebCore.vcproj:
2846         * WebCore.xcodeproj/project.pbxproj:
2847         * dom/Document.cpp:
2848         * history/CachedPage.cpp:
2849         (WebCore::CachedPage::CachedPage):
2850         
2851         Use cache notification mechanism to start/stop animations.
2852
2853         * svg/SVGAElement.cpp:
2854         (WebCore::SVGAElement::defaultEventHandler):
2855         
2856         Start target animation on link activation.
2857         
2858         * svg/SVGAnimateColorElement.cpp:
2859         (WebCore::SVGAnimateColorElement::applyAnimatedValueToElement):
2860         (WebCore::SVGAnimateColorElement::updateAnimatedValue):
2861         (WebCore::SVGAnimateColorElement::calculateFromAndToValues):
2862         (WebCore::SVGAnimateColorElement::calculateFromAndByValues):
2863         * svg/SVGAnimateColorElement.h:
2864         * svg/SVGAnimateElement.cpp:
2865         (WebCore::SVGAnimateElement::SVGAnimateElement):
2866         (WebCore::parseNumberValueAndUnit):
2867         (WebCore::SVGAnimateElement::applyAnimatedValueToElement):
2868         (WebCore::SVGAnimateElement::updateAnimatedValue):
2869         (WebCore::isColorAttribute):
2870         (WebCore::SVGAnimateElement::calculateFromAndToValues):
2871         (WebCore::SVGAnimateElement::calculateFromAndByValues):
2872         * svg/SVGAnimateElement.h:
2873         (WebCore::SVGAnimateElement::):
2874         * svg/SVGAnimateMotionElement.cpp:
2875         (WebCore::SVGAnimateMotionElement::SVGAnimateMotionElement):
2876         (WebCore::SVGAnimateMotionElement::parseMappedAttribute):
2877         (WebCore::SVGAnimateMotionElement::updateAnimatedValue):
2878         (WebCore::parsePoint):
2879         (WebCore::SVGAnimateMotionElement::calculateFromAndToValues):
2880         (WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
2881         (WebCore::SVGAnimateMotionElement::applyAnimatedValueToElement):
2882         (WebCore::SVGAnimateMotionElement::startedActiveInterval):
2883         * svg/SVGAnimateMotionElement.h:
2884         * svg/SVGAnimateTransformElement.cpp:
2885         (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
2886         (WebCore::SVGAnimateTransformElement::hasValidTarget):
2887         (WebCore::SVGAnimateTransformElement::updateAnimatedValue):
2888         (WebCore::transformListFor):
2889         (WebCore::SVGAnimateTransformElement::applyAnimatedValueToElement):
2890         (WebCore::SVGAnimateTransformElement::calculateFromAndToValues):
2891         (WebCore::SVGAnimateTransformElement::calculateFromAndByValues):
2892         (WebCore::SVGAnimateTransformElement::startedActiveInterval):
2893         (WebCore::SVGAnimateTransformElement::parseTransformValue):
2894         * svg/SVGAnimateTransformElement.h:
2895         
2896         Concrete anmation element classes.
2897         
2898         * svg/SVGAnimationElement.cpp:
2899         (WebCore::SVGAnimationElement::SVGAnimationElement):
2900         (WebCore::SVGAnimationElement::~SVGAnimationElement):
2901         (WebCore::parseKeyTimes):
2902         (WebCore::parseKeySplines):
2903         (WebCore::SVGAnimationElement::parseMappedAttribute):
2904         (WebCore::SVGAnimationElement::attributeChanged):
2905         (WebCore::SVGAnimationElement::getStartTime):
2906         (WebCore::SVGAnimationElement::getCurrentTime):
2907         (WebCore::SVGAnimationElement::getSimpleDuration):
2908         (WebCore::SVGAnimationElement::beginElement):
2909         (WebCore::SVGAnimationElement::beginElementAt):
2910         (WebCore::SVGAnimationElement::endElement):
2911         (WebCore::SVGAnimationElement::endElementAt):
2912         (WebCore::SVGAnimationElement::animationMode):
2913         (WebCore::SVGAnimationElement::calcMode):
2914         (WebCore::SVGAnimationElement::attributeType):
2915         (WebCore::SVGAnimationElement::toValue):
2916         (WebCore::SVGAnimationElement::byValue):
2917         (WebCore::SVGAnimationElement::fromValue):
2918         (WebCore::SVGAnimationElement::attributeName):
2919         (WebCore::SVGAnimationElement::isAdditive):
2920         (WebCore::SVGAnimationElement::isAccumulated):
2921         (WebCore::SVGAnimationElement::hasValidTarget):
2922         (WebCore::SVGAnimationElement::targetAttributeIsCSS):
2923         (WebCore::SVGAnimationElement::setTargetAttributeAnimatedValue):
2924         (WebCore::SVGAnimationElement::targetAttributeBaseValue):
2925         (WebCore::solveEpsilon):
2926         (WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
2927         (WebCore::SVGAnimationElement::startedActiveInterval):
2928         (WebCore::SVGAnimationElement::applyAnimation):
2929         (WebCore::SVGAnimationElement::unapplyAnimation):
2930         (WebCore::SVGAnimationElement::endedActiveInterval):
2931         * svg/SVGAnimationElement.h:
2932         (WebCore::SVGAnimationElement::):
2933         
2934         This is pretty much a complete rewrite of the SVGAnimationElement. Timing related functionality
2935         was refactored to SMILTimingElement class that this class now inherits.
2936         
2937         * svg/SVGDocumentExtensions.cpp:
2938         (WebCore::SVGDocumentExtensions::startAnimations):
2939         * svg/SVGElement.cpp:
2940         (WebCore::SVGElement::ownerSVGElement):
2941         * svg/SVGSVGElement.cpp:
2942         
2943         We need to reach the <svg> element from <use> too so go out from the shadow tree.
2944         
2945         (WebCore::SVGSVGElement::SVGSVGElement):
2946         (WebCore::SVGSVGElement::~SVGSVGElement):
2947         (WebCore::SVGSVGElement::pauseAnimations):
2948         (WebCore::SVGSVGElement::unpauseAnimations):
2949         (WebCore::SVGSVGElement::animationsPaused):
2950         (WebCore::SVGSVGElement::getCurrentTime):
2951         (WebCore::SVGSVGElement::willSaveToCache):
2952         (WebCore::SVGSVGElement::willRestoreFromCache):
2953         * svg/SVGSVGElement.h:
2954         (WebCore::SVGSVGElement::timeContainer):
2955         * svg/SVGSetElement.cpp:
2956         (WebCore::SVGSetElement::applyAnimatedValueToElement):
2957         (WebCore::SVGSetElement::calculateFromAndToValues):
2958         (WebCore::SVGSetElement::calculateFromAndByValues):
2959         (WebCore::SVGSetElement::updateAnimatedValue):
2960         * svg/SVGSetElement.h:
2961         
2962         Concrete anmation element classes.
2963         
2964         * svg/SVGTimer.cpp: Removed.
2965         * svg/SVGTimer.h: Removed.
2966         * svg/SVGUseElement.cpp:
2967         (WebCore::SVGUseElement::removedFromDocument):
2968         * svg/TimeScheduler.cpp: Removed.
2969         * svg/TimeScheduler.h: Removed.
2970         
2971         Replaced these with SMILTimeContainer class.
2972         
2973         * svg/animation: Added.
2974         * svg/animation/SMILTime.cpp: Added.
2975         (WebCore::operator+):
2976         (WebCore::operator-):
2977         (WebCore::operator*):
2978         * svg/animation/SMILTime.h: Added.
2979         (WebCore::SMILTime::SMILTime):
2980         (WebCore::SMILTime::unresolved):
2981         (WebCore::SMILTime::indefinite):
2982         (WebCore::SMILTime::operator=):
2983         (WebCore::SMILTime::value):
2984         (WebCore::SMILTime::isFinite):
2985         (WebCore::SMILTime::isIndefinite):
2986         (WebCore::SMILTime::isUnresolved):
2987         (WebCore::operator==):
2988         (WebCore::operator!=):
2989         (WebCore::operator>):
2990         (WebCore::operator<):
2991         (WebCore::operator>=):
2992         (WebCore::operator<=):
2993         (WebCore::max):
2994         (WebCore::min):
2995         
2996         A floating point number with special values "indefinite" and "unresolved". Defines math for those.
2997         
2998         * svg/animation/SMILTimeContainer.cpp: Added.
2999         (WebCore::SMILTimeContainer::SMILTimeContainer):
3000         (WebCore::SMILTimeContainer::schedule):
3001         (WebCore::SMILTimeContainer::unschedule):
3002         (WebCore::SMILTimeContainer::elapsed):
3003         (WebCore::SMILTimeContainer::isActive):
3004         (WebCore::SMILTimeContainer::isPaused):
3005         (WebCore::SMILTimeContainer::begin):
3006         (WebCore::SMILTimeContainer::pause):
3007         (WebCore::SMILTimeContainer::resume):
3008         (WebCore::SMILTimeContainer::startTimer):
3009         (WebCore::SMILTimeContainer::timerFired):
3010         (WebCore::SMILTimeContainer::updateAnimations):
3011         * svg/animation/SMILTimeContainer.h: Added.
3012         
3013         Manages the clock and time line for active animations in a document.
3014         
3015         * svg/animation/SVGSMILElement.cpp: Added.
3016         (WebCore::ConditionEventListener::ConditionEventListener):
3017         (WebCore::ConditionEventListener::handleEvent):
3018         (WebCore::SVGSMILElement::Condition::Condition):
3019         (WebCore::SVGSMILElement::SVGSMILElement):
3020         (WebCore::SVGSMILElement::~SVGSMILElement):
3021         (WebCore::SVGSMILElement::insertedIntoDocument):
3022         (WebCore::SVGSMILElement::removedFromDocument):
3023         (WebCore::SVGSMILElement::finishParsingChildren):
3024         (WebCore::SVGSMILElement::parseOffsetValue):
3025         (WebCore::SVGSMILElement::parseClockValue):
3026         (WebCore::smilTimeSortFunction):
3027         (WebCore::sortTimeList):
3028         (WebCore::SVGSMILElement::parseCondition):
3029         (WebCore::SVGSMILElement::isTimingElement):
3030         (WebCore::SVGSMILElement::parseBeginOrEnd):
3031         (WebCore::SVGSMILElement::parseMappedAttribute):
3032         (WebCore::SVGSMILElement::attributeChanged):
3033         (WebCore::SVGSMILElement::connectConditions):
3034         (WebCore::SVGSMILElement::disconnectConditions):
3035         (WebCore::SVGSMILElement::reschedule):
3036         (WebCore::SVGSMILElement::targetElement):
3037         (WebCore::SVGSMILElement::elapsed):
3038         (WebCore::SVGSMILElement::restart):
3039         (WebCore::SVGSMILElement::fill):
3040         (WebCore::SVGSMILElement::xlinkHref):
3041         (WebCore::SVGSMILElement::dur):
3042         (WebCore::SVGSMILElement::repeatDur):
3043         (WebCore::SVGSMILElement::repeatCount):
3044         (WebCore::SVGSMILElement::maxValue):
3045         (WebCore::SVGSMILElement::minValue):
3046         (WebCore::SVGSMILElement::simpleDuration):
3047         (WebCore::SVGSMILElement::addBeginTime):
3048         (WebCore::SVGSMILElement::addEndTime):
3049         (WebCore::SVGSMILElement::findInstanceTime):
3050         (WebCore::SVGSMILElement::repeatingDuration):
3051         (WebCore::SVGSMILElement::resolveActiveEnd):
3052         (WebCore::SVGSMILElement::resolveInterval):
3053         (WebCore::SVGSMILElement::resolveFirstInterval):
3054         (WebCore::SVGSMILElement::resolveNextInterval):
3055         (WebCore::SVGSMILElement::nextProgressTime):
3056         (WebCore::SVGSMILElement::beginListChanged):
3057         (WebCore::SVGSMILElement::endListChanged):
3058         (WebCore::SVGSMILElement::checkRestart):
3059         (WebCore::SVGSMILElement::calculateAnimationPercentAndRepeat):
3060         (WebCore::SVGSMILElement::calculateNextProgressTime):
3061         (WebCore::SVGSMILElement::determineActiveState):
3062         (WebCore::SVGSMILElement::progress):
3063         (WebCore::SVGSMILElement::notifyDependentsIntervalChanged):
3064         (WebCore::SVGSMILElement::createInstanceTimesFromSyncbase):
3065         (WebCore::SVGSMILElement::addTimeDependent):
3066         (WebCore::SVGSMILElement::removeTimeDependent):
3067         (WebCore::SVGSMILElement::handleConditionEvent):
3068         (WebCore::SVGSMILElement::beginByLinkActivation):
3069         * svg/animation/SVGSMILElement.h: Added.
3070         (WebCore::SVGSMILElement::timeContainer):
3071         (WebCore::SVGSMILElement::):
3072         (WebCore::SVGSMILElement::intervalBegin):
3073         (WebCore::SVGSMILElement::intervalEnd):
3074         (WebCore::SVGSMILElement::Condition::):
3075         
3076             This abstract class implements the SMIL timing model. As an output it produces calls
3077             to these virtual functions:
3078         
3079             virtual void startedActiveInterval() = 0;
3080             virtual void applyAnimation(float percent, unsigned repeat) = 0;
3081             virtual void unapplyAnimation() = 0;
3082             virtual void endedActiveInterval() = 0;
3083
3084 2008-04-10  Antti Koivisto  <antti@apple.com>
3085
3086         Reviewed by Eric.
3087
3088         Move CurveData out from AnimationController.cpp and rename
3089         it to UnitBezier. This makes it possible to reuse this nice class from the 
3090         SVG animation code.
3091
3092         * WebCore.vcproj/WebCore.vcproj:
3093         * WebCore.xcodeproj/project.pbxproj:
3094         * page/AnimationController.cpp:
3095         (WebCore::solveCubicBezierFunction):
3096         * platform/graphics/UnitBezier.h: Added.
3097         (WebCore::UnitBezier::UnitBezier):
3098         (WebCore::UnitBezier::sampleCurveX):
3099         (WebCore::UnitBezier::sampleCurveY):
3100         (WebCore::UnitBezier::sampleCurveDerivativeX):
3101         (WebCore::UnitBezier::solveCurveX):
3102         (WebCore::UnitBezier::solve):
3103
3104 2008-04-10  Brady Eidson  <beidson@apple.com>
3105
3106         Reviewed by Sam Weinig
3107
3108         The name "OriginStorage" never felt right to a few of us.  The HTML5 spec refers to our 
3109         concept of "OriginStorage" as a "storage area", which makes more sense here.
3110
3111         This patch is basically:
3112         s/OriginStorage/StorageArea/
3113
3114         * GNUmakefile.am:
3115         * WebCore.pro:
3116         * WebCore.vcproj/WebCore.vcproj:
3117         * WebCore.xcodeproj/project.pbxproj:
3118         * WebCoreSources.bkl:
3119
3120         * loader/FrameLoader.cpp:
3121
3122         * page/DOMWindow.cpp:
3123         (WebCore::DOMWindow::sessionStorage):
3124         * page/Page.cpp:
3125
3126         * storage/OriginStorage.cpp: Removed.
3127         * storage/OriginStorage.h: Removed.
3128
3129         * storage/SessionStorage.cpp:
3130         (WebCore::SessionStorage::copy):
3131         (WebCore::SessionStorage::storageArea):
3132         * storage/SessionStorage.h:
3133
3134         * storage/Storage.cpp:
3135         (WebCore::Storage::create):
3136         (WebCore::Storage::Storage):
3137         (WebCore::Storage::length):
3138         (WebCore::Storage::key):
3139         (WebCore::Storage::getItem):
3140         (WebCore::Storage::setItem):
3141         (WebCore::Storage::removeItem):
3142         (WebCore::Storage::contains):
3143         * storage/Storage.h:
3144
3145         * storage/StorageArea.cpp: Copied from storage/OriginStorage.cpp.
3146         (WebCore::StorageArea::create):
3147         (WebCore::StorageArea::StorageArea):
3148         (WebCore::StorageArea::~StorageArea):
3149         (WebCore::StorageArea::copy):
3150         (WebCore::StorageArea::length):
3151         (WebCore::StorageArea::key):
3152         (WebCore::StorageArea::getItem):
3153         (WebCore::StorageArea::setItem):
3154         (WebCore::StorageArea::removeItem):
3155         (WebCore::StorageArea::contains):
3156         (WebCore::StorageArea::dispatchStorageEvent):
3157         * storage/StorageArea.h: Copied from storage/OriginStorage.h.
3158
3159 2008-04-10  Xan Lopez  <xan@gnome.org>
3160
3161         Reviewed by Alp Toker.
3162
3163         http://bugs.webkit.org/show_bug.cgi?id=18342
3164         Bug #18342 - Add logging to HTTP soup backend
3165         
3166         Add soup logging facilities to HTTP soup backend.
3167         Enable defining WEBKIT_SOUP_LOGGING, with values from
3168         0 to 3 for more verbosity.
3169         
3170         * platform/network/soup/ResourceHandleSoup.cpp:
3171         (WebCore::ResourceHandle::start):
3172
3173 2008-04-10  Timothy Hatcher  <timothy@apple.com>
3174
3175         Fixes floating point precision in the Resources graph labels by using String.sprintf to
3176         format the values. Also makes the image view use Number.bytesToString when showing the file
3177         size. Makes Number.bytesToString and Number.secondsToString take an optional formatter function
3178         so the Inspector can pass WebInspector.UIString, so the format strings can be localized.
3179
3180         https://bugs.webkit.org/show_bug.cgi?id=18381
3181         https://bugs.webkit.org/show_bug.cgi?id=14333
3182
3183         Reviewed by Adam Roben.
3184
3185         * English.lproj/InspectorLocalizedStrings.js: Added the new strings.
3186         * page/inspector/ImageView.js:
3187         (WebInspector.ImageView): Use Number.bytesToString to format this.resource.contentLength.
3188         * page/inspector/ResourcesPanel.js:
3189         (WebInspector.ResourceTransferTimeCalculator.prototype.formatValue): Pass WebInspector.UIString
3190         to Number.secondsToString.
3191         (WebInspector.ResourceTransferSizeCalculator.prototype.formatValue): Pass WebInspector.UIString
3192         to Number.bytesToString.
3193         * page/inspector/utilities.js:
3194         (Number.secondsToString): Added a formatterFunction argument. Use the formatter and format strings
3195         to control the number precision.
3196         (Number.bytesToString): Ditto.
3197
3198 2008-04-010  Alice Liu  <alice.liu@apple.com>
3199
3200         Reviewed by Dan Bernstein.
3201
3202         Fixed <rdar://5815856> CrashTracer: [USER] 8384 crashes in WebCore::Widget::getView const + 6
3203
3204         Test: fast/events/mouseout-dead-subframe.html
3205
3206         * page/EventHandler.cpp:
3207         dispatching a mouse event can change the document structure, necessitating
3208         a check for whether we still want to pass the event to the pre-determined subframe 
3209         (WebCore::EventHandler::handleMouseMoveEvent):
3210
3211 2008-04-10  Antti Koivisto  <antti@apple.com>
3212
3213         Reviewed by Eric.
3214
3215         Fix scale transform. This will be tested by the animation test suite when
3216         SVG animation support lands.
3217
3218         * svg/SVGTransformDistance.cpp:
3219         (WebCore::SVGTransformDistance::SVGTransformDistance):
3220
3221 2008-04-10  David Hyatt  <hyatt@apple.com>
3222
3223         Add a gradient fillRect method to GraphicsContext.  This is implemented only in the CG port.  I stubbed
3224         out a method in GraphicsContext.cpp with notImplemented().  Other platforms will need to add their own
3225         gradient fill methods.
3226
3227         Reviewed by aroben
3228
3229         * platform/graphics/GraphicsContext.cpp:
3230         (WebCore::GraphicsContext::fillRect):
3231         * platform/graphics/GraphicsContext.h:
3232         * platform/graphics/cg/GraphicsContextCG.cpp:
3233         (WebCore::GraphicsContext::fillRect):
3234
3235 2008-04-10  David Hyatt  <hyatt@apple.com>
3236
3237         Gradient improvements.  Support for adding color stops by Color and not just by String.  Add the ability to mark
3238         stops as already being sorted.
3239
3240         Reviewed by aroben
3241
3242         * platform/graphics/Gradient.cpp:
3243         (WebCore::Gradient::addColorStop):
3244         * platform/graphics/Gradient.h:
3245         (WebCore::Gradient::setStopsSorted):
3246
3247 2008-04-10  Timothy Hatcher  <timothy@apple.com>
3248
3249         Fixes the build where some wtf headers would not be copied due
3250         to a bug in some older versions of Xcode.
3251
3252         Rubber-stamped by Adam Roben.
3253
3254         * WebCore.xcodeproj/project.pbxproj: Adds a new script phase to handle
3255         the copying of the icu and ForwardingHeaders folder to WebCore's PrivateHeaders.
3256         Removes the old copy files phase and the icu and ForwardingHeaders folder references.
3257
3258 2008-04-09  Brady Eidson  <beidson@apple.com>
3259
3260         Reviewed by Mitz Pettel
3261
3262         Add the "onstorage" attribute for the body element to provide easy setup of StorageEvent handling.
3263
3264         Tests: storage/domstorage/sessionstorage/onstorage-attribute-markup.html
3265                storage/domstorage/sessionstorage/onstorage-attribute-setattribute.html
3266
3267         * html/HTMLAttributeNames.in: Added "onstorage"
3268         * html/HTMLBodyElement.cpp:
3269         (WebCore::HTMLBodyElement::parseMappedAttribute): Handle this attribute on the body element *only*
3270           because that's where the HTML5 spec says StorageEvents go.  This might change in the future
3271
3272 2008-04-09  Antti Koivisto  <antti@apple.com>
3273
3274         Reviewed by Mitz.
3275
3276         Remove a less-than-critical bit from Node and replace it with a hash. Those bits are valuable!
3277
3278         Also moved setting of the guard to dispatchSimulatedClick for better consistency. 
3279         No one else calls dispatchSimulatedMouseEvent() currently and this is really a click() specific behavior.
3280
3281         * dom/EventTargetNode.cpp:
3282         (WebCore::EventTargetNode::dispatchSimulatedMouseEvent):
3283         (WebCore::EventTargetNode::dispatchSimulatedClick):
3284         * dom/Node.cpp:
3285         (WebCore::Node::Node):
3286         * dom/Node.h:
3287
3288 2008-04-09  Sam Weinig  <sam@webkit.org>
3289
3290         Reviewed by Geoffrey Garen.
3291
3292         Fix for https://bugs.webkit.org/show_bug.cgi?id=18389
3293         Crash in JSDOMWindowWrapper::mark loading digg.com
3294
3295         - Add a null check to JSDOMWindowWrapper::mark for the case when the collector
3296           runs during its allocation.
3297         - Cleans up the creation of the window to be a little more straight forward.
3298
3299         * bindings/js/JSDOMWindowBase.cpp:
3300         (WebCore::JSDOMWindowBasePrivate::JSDOMWindowBasePrivate):
3301         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3302         (WebCore::JSDOMWindowBase::clear):
3303         (WebCore::JSDOMWindowBase::wrapper):
3304         * bindings/js/JSDOMWindowBase.h:
3305         * bindings/js/JSDOMWindowWrapper.cpp:
3306         (WebCore::JSDOMWindowWrapper::JSDOMWindowWrapper):
3307         (WebCore::JSDOMWindowWrapper::mark):
3308         * bindings/js/JSDOMWindowWrapper.h:
3309         * bindings/js/kjs_proxy.cpp:
3310         (WebCore::KJSProxy::initScript):
3311         * bindings/scripts/CodeGeneratorJS.pm:
3312
3313 2008-04-09  Brady Eidson  <beidson@apple.com>
3314
3315         Rubberstamped by Mitzpettel
3316
3317         Added HTMLAttributeNames.in and HTMLTagNames.in to the xcodeproj for easy editing, 
3318         and sorted the html group
3319
3320         * WebCore.xcodeproj/project.pbxproj:
3321
3322 2008-04-09  Brent Fulgham  <bfulgham@gmail.com>
3323
3324         Reviewed by Mitz.
3325
3326         Correct build regression in Windows (Cairo) build due to changes
3327         in FontDescription.h signature.  (see http://bugs.webkit.org/show_bug.cgi?id=18394)
3328
3329         * rendering/RenderThemeWin.cpp:  Change for new font methods.
3330         (WebCore::RenderThemeWin::systemFont):
3331
3332 2008-04-09  Brady Eidson  <beidson@apple.com>
3333
3334         Reviewed by Sam Weinig
3335
3336         When enumerating a Storage object, the Storage built-ins should not be included, but the 
3337         prototype chain SHOULD be included.
3338
3339         * bindings/js/JSStorageCustom.cpp:
3340         (WebCore::JSStorage::customGetPropertyNames): Return false so the prototype chain is walked
3341
3342         * storage/Storage.idl: Mark all built-ins as "DontEnum"
3343
3344 2008-04-09  Brady Eidson  <beidson@apple.com>
3345
3346         Reviewed by Adam Roben
3347
3348         Per the HTML5 spec, enumerating a Storage object should walk the keys in the storage area, 
3349         and should not return the built-in properties.
3350
3351         Test: storage/domstorage/sessionstorage/enumerate-storage.html
3352
3353         * bindings/js/JSLocationCustom.cpp:
3354         (WebCore::JSLocation::customGetPropertyNames): Removed the name from an unused parameter
3355
3356         * bindings/js/JSStorageCustom.cpp:
3357         (WebCore::JSStorage::customGetPropertyNames): Copy all of the keys into the property names array
3358
3359         * storage/Storage.idl: Add CustomGetPropertyNames
3360
3361 2008-04-09  Timothy Hatcher  <timothy@apple.com>
3362
3363         Fixes the regression where resource time/size pills do not
3364         update during a load in the Inspector.
3365
3366         http://bugs.webkit.org/show_bug.cgi?id=18374
3367
3368         Reviewed by John Sullivan.
3369
3370         * page/inspector/ResourcesPanel.js:
3371         (ResourcesPanel.prototype.show): Remove an unneeded call to _updateGraphBars,
3372         since _updateSidebarWidth already calls _updateGraphBars.
3373         (ResourcesPanel.prototype.addResource): Call updateGraphSideWidth.
3374         (ResourcesPanel.prototype._updateGraphBars): Ditto.
3375         (ResourceSidebarTreeElement.prototype.updateGraphSideWidth): Update the
3376         style for graphSideElement with the passed in width.
3377
3378 2008-04-09  Antti Koivisto  <antti@apple.com>
3379
3380         Reviewed by Mitz.
3381
3382         Avoid unnecessary calls to virtual updateStyleAttributeIfNeeded() method.
3383         - do the the checking in call sites instead of inside the function
3384         - rename to updateStyleAttribute()
3385         - use namedAttrMap directly (for getting id attribute) in insertedIntoDocument/removedFromDocument 
3386           to avoid calling attributes() which may trigger style attribute update.
3387         
3388         * dom/Element.cpp:
3389         (WebCore::Element::attributes):
3390         (WebCore::Element::getAttribute):
3391         (WebCore::Element::hasAttributes):
3392         (WebCore::Element::insertedIntoDocument):
3393         (WebCore::Element::removedFromDocument):
3394         * dom/Element.h:
3395         (WebCore::Element::updateStyleAttribute):
3396         * dom/NamedAttrMap.cpp:
3397         (WebCore::NamedAttrMap::addAttribute):
3398         * dom/StyledElement.cpp:
3399         (WebCore::StyledElement::updateStyleAttribute):
3400         * dom/StyledElement.h:
3401
3402 2008-04-09  Timothy Hatcher  <timothy@apple.com>
3403
3404         A more complete fix for: can't drag the Web Inspector when grabbing
3405         in the toolbar area. Makes dragging under the search field in the
3406         empty space work again.
3407
3408         http://bugs.webkit.org/show_bug.cgi?id=18373
3409
3410         Reviewed by Adam Roben.
3411
3412         * page/inspector/inspector.js:
3413         (WebInspector.toolbarDragStart): Prevent dragging if the event target
3414         is a toggleable toolbar item. Allow dragging when the target is a
3415         normal toolbar item.
3416
3417 2008-04-08  Sam Weinig  <sam@webkit.org>
3418
3419         Reviewed by Timothy Hatcher.
3420
3421         Fix for http://bugs.webkit.org/show_bug.cgi?id=18373
3422         REGRESSION: Can't drag the Web Inspector when grabbing in the toolbar area
3423
3424         * page/inspector/inspector.css:
3425
3426 2008-04-08  Christian Persch  <chpe@gnome.org>
3427
3428         Reviewed by Alp Toker.
3429
3430         http://bugs.webkit.org/show_bug.cgi?id=18360
3431         "missing sentinel" warnings in PluginDatabaseGtk.cpp
3432
3433         Use NULL, not 0 as sentinel in varargs calls.
3434
3435         * plugins/gtk/PluginDatabaseGtk.cpp:
3436         (WebCore::PluginDatabase::getPluginPathsInDirectories):
3437         (WebCore::PluginDatabase::defaultPluginDirectories):
3438
3439 2008-04-04  Sam Weinig  <sam@webkit.org>
3440
3441         Reviewed by Geoffrey Garen.
3442
3443         First step in implementing the "split window"
3444
3445         - This patch takes the first step in changing the window navigation model
3446           from clearing the window properties on navigation, to replacing
3447           an inner window.  This is necessary to safely perform security checks
3448           using the lexical global object.
3449
3450           This first step adds a new class called JSDOMWindowWrapper, which wraps
3451           the real window object.  All JS calls that would go to the window object
3452           now go to it, which it forwards to the current inner window.  To accomplish
3453           this, the wrapper window is used as the ThisValue wherever the window was used
3454           before.
3455
3456         * WebCore.base.exp:
3457         * WebCore.xcodeproj/project.pbxproj:
3458         * bindings/js/JSDOMWindowBase.cpp:
3459         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3460         (WebCore::JSDOMWindowBase::clear): Reset the wrapper windows prototype too.
3461         (WebCore::JSDOMWindowBase::toThisObject):
3462         (WebCore::JSDOMWindowBase::wrapper):
3463         (WebCore::windowProtoFuncAToB):
3464         (WebCore::windowProtoFuncBToA):
3465         (WebCore::windowProtoFuncOpen):
3466         (WebCore::windowProtoFuncSetTimeout):
3467         (WebCore::windowProtoFuncClearTimeout):
3468         (WebCore::windowProtoFuncSetInterval):
3469         (WebCore::windowProtoFuncAddEventListener):
3470         (WebCore::windowProtoFuncRemoveEventListener):
3471         (WebCore::windowProtoFuncShowModalDialog):
3472         (WebCore::windowProtoFuncNotImplemented):
3473         (WebCore::toJS):
3474         * bindings/js/JSDOMWindowBase.h:
3475         Fix to expect the wrapper as the thisObj.
3476         * bindings/js/JSDOMWindowCustom.cpp:
3477         (WebCore::JSDOMWindow::postMessage):
3478         (WebCore::toDOMWindow):
3479         * bindings/js/JSDOMWindowWrapper.cpp: Added.
3480         (WebCore::):
3481         (WebCore::JSDOMWindowWrapper::JSDOMWindowWrapper):
3482         (WebCore::JSDOMWindowWrapper::~JSDOMWindowWrapper):
3483         (WebCore::JSDOMWindowWrapper::mark):
3484         (WebCore::JSDOMWindowWrapper::className):
3485         (WebCore::JSDOMWindowWrapper::getOwnPropertySlot):
3486         (WebCore::JSDOMWindowWrapper::put):
3487         (WebCore::JSDOMWindowWrapper::deleteProperty):
3488         (WebCore::JSDOMWindowWrapper::getPropertyNames):
3489         (WebCore::JSDOMWindowWrapper::getPropertyAttributes):
3490         (WebCore::JSDOMWindowWrapper::defineGetter):
3491         (WebCore::JSDOMWindowWrapper::defineSetter):
3492         (WebCore::JSDOMWindowWrapper::lookupGetter):
3493         (WebCore::JSDOMWindowWrapper::lookupSetter):
3494         (WebCore::JSDOMWindowWrapper::toGlobalObject):
3495         (WebCore::JSDOMWindowWrapper::impl):
3496         (WebCore::JSDOMWindowWrapper::disconnectFrame):
3497         (WebCore::JSDOMWindowWrapper::clear):
3498         (WebCore::toJS):
3499         * bindings/js/JSDOMWindowWrapper.h: Added.
3500         (WebCore::JSDOMWindowWrapper::innerWindow):
3501         (WebCore::JSDOMWindowWrapper::setInnerWindow):
3502         (WebCore::JSDOMWindowWrapper::classInfo):
3503         Forward methods to the innerWindow.
3504         * bindings/js/JSHTMLDocumentCustom.cpp:
3505         (WebCore::JSHTMLDocument::open):
3506         * bindings/js/ScheduledAction.cpp:
3507         (WebCore::ScheduledAction::execute):
3508         * bindings/js/kjs_events.cpp:
3509         (WebCore::JSAbstractEventListener::handleEvent):
3510         * bindings/js/kjs_proxy.cpp:
3511         (WebCore::KJSProxy::~KJSProxy):
3512         (WebCore::KJSProxy::evaluate):
3513         (WebCore::KJSProxy::clear):
3514         (WebCore::KJSProxy::initScript):
3515         (WebCore::KJSProxy::clearDocumentWrapper):
3516         (WebCore::KJSProxy::processingUserGesture):
3517         (WebCore::KJSProxy::attachDebugger):
3518         * bindings/js/kjs_proxy.h:
3519         (WebCore::KJSProxy::haveWindowWrapper):
3520         (WebCore::KJSProxy::windowWrapper):
3521         (WebCore::KJSProxy::globalObject):
3522         (WebCore::KJSProxy::initScriptIfNeeded):
3523         Hold onto the wrapper window instead of global object.  As a convenience,
3524         keep the globalObject() as a forward to the inner window.
3525         * bindings/objc/DOMUtility.mm:
3526         (KJS::createDOMWrapper):
3527         * bindings/scripts/CodeGeneratorJS.pm:
3528         * dom/Document.cpp:
3529         (WebCore::Document::domWindow):
3530         * dom/Document.h:
3531         (WebCore::Document::defaultView):
3532         * loader/FrameLoader.cpp:
3533         (WebCore::FrameLoader::dispatchWindowObjectAvailable):
3534         * page/DOMWindow.idl:
3535         * page/Frame.cpp:
3536         (WebCore::Frame::~Frame):
3537         (WebCore::Frame::pageDestroyed):
3538
3539 2008-04-08  Brady Eidson  <beidson@apple.com>
3540
3541         Encourage Windows to rebuild - AGAIN...
3542
3543         * WebCore.vcproj/build-generated-files.sh:
3544         * bindings/scripts/CodeGenerator.pm:
3545         * bindings/scripts/CodeGeneratorJS.pm:
3546         * config.h:
3547
3548 2008-04-08  Brady Eidson  <beidson@apple.com>
3549
3550         OMG release builds didn't have this flag Windows build bots I'm so 
3551         sorry will you ever forgive me?
3552
3553         (Found by Stephanie, rubberstamped and landed by Brady)
3554
3555         * WebCore.vcproj/WebCore.vcproj: Add ENABLE_DOM_STORAGE for release builds