Fix Bug 17815: Inspector's DOM tree should descend into subframes
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-12  Adam Roben  <aroben@apple.com>
2
3         Fix Bug 17815: Inspector's DOM tree should descend into subframes
4
5         <http://bugs.webkit.org/show_bug.cgi?id=17815>
6
7         Reviewed by Tim.
8
9         * page/inspector/DocumentPanel.js:
10         (WebInspector.DocumentPanel.revealNode): Changed to provide
11         _isAncestorIncludingParentFramesWithinPanel and
12         _parentNodeOrFrameElementWithinPanel for the isAncestor and getParent
13         parameters to findTreeElement so that parent frames will be searched.
14         (WebInspector.DocumentPanel.updateBreadcrumb):
15           - Changed while loop to for loop
16           - Use _parentNodeOrFrameElementWithinPanel instead of
17             Node.parentNode to move to the next node
18           - The loop now ends when we reach the DocumentPanel's document node
19           - Traversal past other Document nodes is now allowed
20           - We add the "start" class to the final crumb after the loop exits
21         (WebInspector.DocumentPanel._getDocumentForNode): Added. Simple helper
22         that returns the node itself if the node is a Document node, or the
23         node's ownerDocument otherwise.
24         (WebInspector.DocumentPanel._parentNodeOrFrameElementWithinPanel):
25         Added. Returns the node's parent node or, in the case of a Document
26         node, the node's window's owning frame element, but will not return a
27         node that is in a parent frame of the DocumentPanel's Document.
28         (WebInspector.DocumentPanel._isAncestorIncludingParentFramesWithinPanel):
29         Added. Returns true if a is an ancestor of b if a is an ancestor of a
30         frame element whose subframe(s) contain b.
31         (WebInspector.DOMNodeTreeElement): We now consider ourselves to have
32         children if we have a contentDocument.
33         (WebInspector.DOMNodeTreeElement.onpopulate): Moved the appendChild
34         loop into a function so that we can add both children of our
35         contentDocument and children of our node to the tree.
36         (WebInspector.DOMNodeTreeElement.ondblclick): Changed so that we get
37         the rootDOMNode by traversing the tree outline hierarchy instead of
38         the DOM hierarchy so that we can easily jump up to a parent frame.
39
40 2008-03-12  Adam Roben  <aroben@apple.com>
41
42         Update the styles/metrics panes and breadcrumb after editing DOM
43         attributes
44
45         Reviewed by Tim.
46
47         * page/inspector/DocumentPanel.js:
48         (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
49         the parts of the DocumentPanel other than the DOM tree into a new
50         function, _focusedNodeChanged.
51         (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
52         forceUpdate parameter specifies whether the update should occur even
53         if the focused node hasn't changed since the last update.
54         (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
55         parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
56         (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
57         parameter. If forceUpdate is true, we always rebuild the styles pane.
58         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
59         call to DocumentPanel._focusedNodeChanged. We have to force the update
60         because we haven't changed the focused node (the attributes of the
61         node have changed).
62         * page/inspector/StylesSidebarPane.js:
63         (WebInspector.StylesSidebarPane.update): Added a forceUpdate
64         parameter. If forceUpdate is true we always rebuild the styles.
65
66 2008-03-12  Mark Rowe  <mrowe@apple.com>
67
68         Further Gtk and Qt build fixes.
69
70         * bridge/runtime.cpp:
71         (KJS::Bindings::Instance::createRuntimeObject): Adapt Qt-only code for change to PassRefPtr.
72         * page/gtk/FrameGtk.cpp: Add missing include.
73
74 2008-03-12  Mark Rowe  <mrowe@apple.com>
75
76         Fix Gtk and Qt builds.
77
78         * page/gtk/FrameGtk.cpp:
79         * page/qt/FrameQt.cpp:
80
81 2008-03-12  Mark Rowe  <mrowe@apple.com>
82
83         Mac build fix.
84
85         * WebCore.base.exp:  Remove symbol.
86
87 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
88
89         Build fix.
90
91         * page/win/FrameWin.cpp:
92
93 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
94
95         Build fix.
96
97         * plugins/win/PluginViewWin.cpp:
98         (WebCore::PluginView::bindingInstance):
99
100 2008-03-12  Darin Adler  <darin@apple.com>
101
102         Reviewed by Anders.
103
104         - http://bugs.webkit.org/show_bug.cgi?id=17640
105           eliminate WebCoreFrameBridge
106
107         * WebCore.base.exp: Added more exports, needed by code moved from WebCoreFrameBridge
108         to WebFrame in WebKit.
109         * WebCore.xcodeproj/project.pbxproj: Added more headers, same reason. Also deleted
110         WebCoreFrameBridge.h and WebCoreFrameBridge.mm.
111
112         * page/Frame.cpp:
113         (WebCore::Frame::Frame): Added call to initJavaJSBindings(), formerly handled by
114         the WebCoreFrameBridge.
115         * page/Frame.h: Added initJavaJSBindings function.
116
117         * page/mac/FrameMac.mm:
118         (WebCore::updateRenderingForBindings): Moved here from WebCoreFrameBridge.
119         (WebCore::Frame::initJavaJSBindings): Ditto; code was in the init function.
120
121         * page/mac/WebCoreFrameBridge.h: Removed.
122         * page/mac/WebCoreFrameBridge.mm: Removed.
123
124 2008-03-12  Sam Weinig  <sam@webkit.org>
125
126         Reviewed by Anders Carlsson.
127
128         Don't go through the Document just to get the frame Element.
129
130         * page/DOMWindow.cpp:
131         (WebCore::DOMWindow::frameElement):
132
133 2008-03-12  Anders Carlsson  <andersca@apple.com>
134
135         Reviewed by Geoff and Sam.
136
137         More Instance cleanup:
138         
139         * Make Instance inherit from RefCounted instead of doing its own refcounting.        
140         * Make all Instance subclasses private, add static create methods.         
141         * Have Instance start out with a refcount of 1.
142         * Get rid of Instance::createBindingForLanguageInstance and call the individual 
143           instance constructor methods instead.
144         * Fix many methods to take and return PassRefPtr<Instance> to ensure that the
145           refcounting is done correctly.
146          
147         * bridge/c/c_instance.h:
148         (KJS::Bindings::CInstance::create):
149         * bridge/c/c_utility.cpp:
150         (KJS::Bindings::convertNPVariantToValue):
151         * bridge/jni/jni_instance.cpp:
152         (JavaInstance::invokeMethod):
153         * bridge/jni/jni_instance.h:
154         (KJS::Bindings::JavaInstance::create):
155         * bridge/jni/jni_jsobject.cpp:
156         (JavaJSObject::convertJObjectToValue):
157         * bridge/jni/jni_runtime.cpp:
158         (JavaField::valueFromInstance):
159         (JavaArray::valueAt):
160         * bridge/objc/objc_instance.h:
161         (KJS::Bindings::ObjcInstance::create):
162         * bridge/objc/objc_utility.mm:
163         (KJS::Bindings::convertObjcValueToValue):
164         * bridge/qt/qt_instance.cpp:
165         (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
166         (KJS::Bindings::QtInstance::getQtInstance):
167         (KJS::Bindings::QtInstance::getRuntimeObject):
168         * bridge/qt/qt_instance.h:
169         * bridge/runtime.cpp:
170         (KJS::Bindings::Instance::Instance):
171         (KJS::Bindings::Instance::createRuntimeObject):
172         * bridge/runtime.h:
173         * bridge/runtime_object.cpp:
174         (RuntimeObjectImp::RuntimeObjectImp):
175         * bridge/runtime_object.h:
176         * page/Frame.h:
177         * page/mac/FrameMac.mm:
178         (WebCore::Frame::createScriptInstanceForWidget):
179         * page/win/FrameWin.cpp:
180         (WebCore::Frame::createScriptInstanceForWidget):
181         * plugins/PluginView.h:
182         * plugins/win/PluginViewWin.cpp:
183         (WebCore::PluginView::bindingInstance):
184
185 2008-03-12  Dan Bernstein  <mitz@apple.com>
186
187         Suggested by Darin Adler. Reviewed by Dave Hyatt.
188
189         - speed up BidiIterator::direction()
190
191         * rendering/bidi.cpp:
192         (WebCore::BidiIterator::current): Made inline and corrected the
193         out-of-bounds condition to work with 0-length text and offsets beyond
194         the end of the text.
195         (WebCore::BidiIterator::direction): Changed to call current() and not
196         call the virtual method isListMarker() most of the time.
197         (WebCore::addMidpoint): Removed unnecessary null-check of smidpoints.
198         (WebCore::appendRunsForObject): Ditto.
199
200 2008-03-12  Adam Roben  <aroben@apple.com>
201
202         Make URLs not be underlined while editing them in the DOM view
203
204         Reviewed by Tim.
205
206         * page/inspector/inspector.css:
207
208 2008-03-12  Adam Roben  <aroben@apple.com>
209
210         Part of Bug 17224: DOM nodes/attributes should be editable
211
212         <http://bugs.webkit.org/show_bug.cgi?id=17224>
213         <rdar://problem/5732825>
214
215         We now start editing if the user single-clicks on an attribute,
216         attribute value, or text node while the parent element is selected.
217         Previously, we started editing on double-click regardless of the
218         selection state of the element.
219
220         URLs in the DOM tree are now followed on Alt/Option-click, rather than
221         on just click.
222
223         Reviewed by Tim.
224
225         * English.lproj/InspectorLocalizedStrings.js: Added four new localized
226         strings.
227         * page/inspector/DocumentPanel.js:
228         (WebInspector.DOMNodeTreeElement.onattach): Call new
229         _makeURLSActivateOnModifiedClick.
230         (WebInspector.DOMNodeTreeElement._makeURLsActivateOnModifiedClick):
231         Added. Changes the tooltip of each link in this element to indicate
232         that Alt/Option-click will follow the URL, and sets the
233         followOnAltClick property on each link.
234         (WebInspector.DOMNodeTreeElement.onselect): Mark that we're being
235         selected.
236         (WebInspector.DOMNodeTreeElement.onmousedown): If we're not currently
237         being selected, start editing.
238         (WebInspector.DOMNodeTreeElement.ondblclick): We no longer start
239         editing here. We block re-rooting of the tree if we're currently
240         editing.
241         (WebInspector.DOMNodeTreeElement._startEditing):
242           - Don't do anything if we're not focused
243           - Pass the event down to _startEditingAttribute.
244         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't do
245         anything if the event target is a URL and the Alt/Option key is
246         pressed -- in this case we want to follow the link.
247         (WebInspector.DOMNodeTreeElement._updateTitle): Call
248         _makeURLsActivateOnClick again since the anchor elements have all been
249         recreated.
250         * page/inspector/inspector.js:
251         (WebInspector.documentClick): If the anchor as a followOnAltClick
252         property and the Alt/Option key is not pressed, do nothing.
253
254 2008-03-12  Ada Chan  <adachan@apple.com>
255
256         Fixed the initial value of zoom factor.
257
258         Reviewed by Adam.
259
260         * page/Frame.cpp:
261         (WebCore::FramePrivate::FramePrivate):
262
263 2008-03-12  David Hyatt  <hyatt@apple.com>
264
265         Make full page zoom vaguely work.  This patch uses the CSS transform system to turn on full page zoom at the
266         document level.  There are many many bugs that I'm going to file to track all the issues (most of the issues
267         are just bugs with transforms themselves).
268
269         Reviewed by Adam Roben
270
271         * css/CSSStyleSelector.cpp:
272         (WebCore::CSSStyleSelector::applyProperty):
273         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
274         * dom/Document.cpp:
275         (WebCore::Document::recalcStyle):
276         * page/Frame.cpp:
277         (WebCore::Frame::shouldApplyTextZoom):
278         (WebCore::Frame::shouldApplyPageZoom):
279         * page/Frame.h:
280         * rendering/RenderLayer.cpp:
281         (WebCore::RenderLayer::updateLayerPositions):
282         (WebCore::RenderLayer::setHasVisibleContent):
283         (WebCore::RenderLayer::paintLayer):
284         (WebCore::RenderLayer::hitTestLayer):
285         * rendering/RenderLayer.h:
286
287 2008-03-12  David Hyatt  <hyatt@apple.com>
288
289         Make the zoom factor a float and not a percent.
290
291         Reviewed by antti
292
293         * WebCore.base.exp:
294         * css/CSSStyleSelector.cpp:
295         (WebCore::CSSStyleSelector::applyProperty):
296         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
297         * page/Frame.cpp:
298         (WebCore::Frame::zoomFactor):
299         (WebCore::Frame::setZoomFactor):
300         * page/Frame.h:
301         * page/FramePrivate.h:
302         * svg/SVGSVGElement.cpp:
303         (WebCore::SVGSVGElement::currentScale):
304         (WebCore::SVGSVGElement::setCurrentScale):
305
306 2008-03-12  David Hyatt  <hyatt@apple.com>
307
308         Eliminate setTextMultiplier from the bridge.  Make Webkit just call setZoomFactor on the frame directly.
309
310         Reviewed by Tim H.
311
312         * WebCore.base.exp:
313         * page/mac/WebCoreFrameBridge.h:
314         * page/mac/WebCoreFrameBridge.mm:
315
316 2008-03-12  Dan Bernstein  <mitz@apple.com>
317
318         Reviewed by Darin Adler and Sam Weinig.
319
320         - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
321
322         Use CTFontCopyGraphicsFont and CTFontGetPlatformFont on Leopard instead
323         of wkGetCGFontFromNSFont and wkGetNSFontATSUFontId, relying on NSFont
324         and CTFontRef being toll-free bridged.
325
326         * WebCore.Tiger.exp:
327         * WebCore.base.exp:
328         * platform/graphics/mac/FontMac.mm:
329         (WebCore::Font::drawGlyphs): Changed to use the cgFont() accessor.
330         * platform/graphics/mac/FontPlatformData.h:
331         Made m_cgFont a RetainPtr on Leopard.
332         (WebCore::toCTFontRef): Added a function that encapsulates the
333         toll-free bridging.
334         (WebCore::FontPlatformData::FontPlatformData):
335         (WebCore::FontPlatformData::cgFont): Added this accessor method.
336         * platform/graphics/mac/FontPlatformDataMac.mm:
337         (WebCore::FontPlatformData::FontPlatformData): Changed to use
338         CoreText API on Leopard.
339         (WebCore::FontPlatformData::setFont): Ditto.
340         * platform/graphics/mac/SimpleFontDataMac.mm:
341         (WebCore::initFontData):
342         (WebCore::pathFromFont):
343         (WebCore::SimpleFontData::platformInit):
344         (WebCore::SimpleFontData::platformWidthForGlyph):
345         * platform/mac/WebCoreSystemInterface.mm:
346
347 2008-03-12  David Harrison  <harrison@apple.com>
348
349         Reviewed by Darin.
350
351         <rdar://problem/5607382> CrashTracer: [REGRESSION] 2290 crashes in Safari at com.apple.WebCore: -[WebCoreAXObject isWebArea] + 8
352
353         The problem was that we lost track of the AX cache for a subframe when Frame::disconnectOwnerElement() was
354         called, so we were unable to locate the AXObjects to de-register from AppKit's accessibility registry.
355         Also saw that cache clearing was missing from Document::detach(), and fixed that.
356         
357         Also added a debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
358         
359         Lastly, RenderWidget::destroy() now skips trying to remove the AXObject if accessibility has never been enabled.
360        
361         * dom/Document.cpp:
362         (WebCore::Document::attach):
363         Assert that there is no AX cache (since there is no renderer).
364         
365         (WebCore::Document::detach):
366         Destroy the AX cache installed on this document.
367         
368         (WebCore::Document::clearAXObjectCache):
369         New. Destroy the AX cache associated with this document.
370         
371         (WebCore::Document::axObjectCache):
372         Added some comments.
373         
374         * dom/Document.h:
375         Declare clearAXObjectCache().
376         
377         * page/Frame.cpp:
378         (WebCore::Frame::disconnectOwnerElement):
379         Destroy the AX cache associated with this frame's document.
380         
381         * page/mac/AXObjectCacheMac.mm:
382         (WebCore::AXObjectCache::remove):        
383         * page/mac/WebCoreAXObject.mm:
384         (-[WebCoreAXObject initWithRenderer:]):
385         (-[WebCoreAXObject detach]):
386         * rendering/RenderObject.cpp:
387         (WebCore::RenderObject::RenderObject):
388         (WebCore::RenderObject::~RenderObject):
389         * rendering/RenderObject.h:
390         (WebCore::RenderObject::setHasAXObject):
391         (WebCore::RenderObject::hasAXObject):
392         Add debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
393         
394         * rendering/RenderWidget.cpp:
395         (WebCore::RenderWidget::destroy):
396         Skip call to remove the AXObject if accessibility has never been enabled. A simple speed optimization in the
397         very common case that the accessibility APIs are not being used. Same as in RenderObject::destroy().
398
399 2008-03-12  Xan Lopez  <xan@gnome.org>
400
401         Reviewed by Alp Toker.
402
403         http://bugs.webkit.org/show_bug.cgi?id=15229
404
405         Add Pango font backend.
406
407         Original patch by Sven Herzberg <sven@imendio.com>
408
409         * GNUmakefile.am:
410         * platform/graphics/gtk/FontCacheGtk.cpp:
411         (WebCore::FontCache::fontExists):
412         * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Added.
413         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
414         (WebCore::FontCustomPlatformData::fontPlatformData):
415         (WebCore::releaseData):
416         (WebCore::createFontCustomPlatformData):
417         * platform/graphics/gtk/FontPlatformData.h:
418         (WebCore::FontPlatformData::FontPlatformData):
419         (WebCore::FontPlatformData::hash):
420         * platform/graphics/gtk/FontPlatformDataPango.cpp: Added.
421         (WebCore::FontPlatformData::FontPlatformData):
422         (WebCore::FontPlatformData::init):
423         (WebCore::FontPlatformData::~FontPlatformData):
424         (WebCore::FontPlatformData::isFixedPitch):
425         (WebCore::FontPlatformData::setFont):
426         (WebCore::FontPlatformData::operator==):
427         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp: Added.
428         (WebCore::pango_font_get_glyph):
429         (WebCore::GlyphPage::fill):
430         * platform/graphics/gtk/SimpleFontDataPango.cpp: Added.
431         (WebCore::SimpleFontData::platformInit):
432         (WebCore::SimpleFontData::platformDestroy):
433         (WebCore::SimpleFontData::smallCapsFontData):
434         (WebCore::SimpleFontData::containsCharacters):
435         (WebCore::SimpleFontData::determinePitch):
436         (WebCore::SimpleFontData::platformWidthForGlyph):
437         (WebCore::SimpleFontData::setFont):
438
439 2008-03-12  Justin Garcia  <justin.garcia@apple.com>
440
441         Reviewed by Oliver.
442         
443         <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
444         
445         Fixes some (but not all) of the instances of:
446         <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
447         <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
448
449         * editing/InsertLineBreakCommand.cpp:
450         (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
451         the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
452         * editing/RemoveFormatCommand.cpp:
453         (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
454
455 2008-03-11  Alexey Proskuryakov  <ap@webkit.org>
456
457         Reviewed by Darin.
458
459         <rdar://problem/5640615> REGRESSION (Safari 2-3): Changing subframe encoding rules broke
460         some sites.
461
462         Other browsers' behavior keeps changing; let's implement what Firefox and Opera do now:
463         if the frame and subframe belong to the same site, then the encoding is inherited from parent
464         frame to subframe. Otherwise, it is not.
465
466         Always inheriting the encoding would cause a security problem.
467
468         Tests: http/tests/misc/frame-default-enc-different-domain.html
469                http/tests/misc/frame-default-enc-same-domain.html
470                fast/encoding/frame-default-enc.html
471
472         * loader/FrameLoader.cpp:
473         (WebCore::FrameLoader::write): Also removed a check for m_frame->document() being non-null -
474         this function also has code that uses it without checking, so it must be safe.
475
476 2008-03-12  Mark Rowe  <mrowe@apple.com>
477
478         Gtk build fix.
479
480         * page/Frame.h: Forward-declare FramePrivate.
481
482 2008-03-11  Steve Falkenburg  <sfalken@apple.com>
483
484         Disable LTCG/PGO for all of WebCore for now.
485         We'll re-enable this as part of follow-on PGO work.
486         
487         Reviewed by Oliver.
488
489         * WebCore.vcproj/WebCore.vcproj:
490
491 2008-03-11  Darin Adler  <darin@apple.com>
492
493         Reviewed by Sam.
494
495         - remove all bridge-related things from WebCore except the bridge itself
496
497         * WebCore.base.exp: Removed the bridge and setBridge functions.
498
499         * loader/FrameLoader.cpp:
500         (WebCore::FrameLoader::detachFromParent): Removed call to the bridge's
501         close method.
502
503         * page/Frame.cpp:
504         (WebCore::Frame::~Frame): Removed call to setBridge(0).
505         (WebCore::FramePrivate::FramePrivate): Removed initialization of m_bridge.
506         * page/Frame.h: Removed setBridge and bridge functions.
507         * page/FramePrivate.h: Removed m_bridge pointer.
508         * page/mac/FrameMac.mm: Removed setBridge and bridge functions.
509
510         * page/mac/WebCoreFrameBridge.h: Added setWebCoreFrame: method.
511         Removed bridgeForDOMDocument: and clearFrame methods.
512         * page/mac/WebCoreFrameBridge.mm: Ditto.
513         (-[WebCoreFrameBridge close]): Changed to set m_frame to 0 directly.
514         (-[WebCoreFrameBridge setWebCoreFrame:]): Added.
515
516 2008-03-11  Darin Adler  <darin@apple.com>
517
518         - restored some code I removed in the Range change; this code can't go
519           until the rest of the Range fix is in
520
521         * dom/Range.cpp:
522         (WebCore::Range::commonAncestorContainer): Added back the check for 0
523         that I removed erroneously in the Range patch.
524         (WebCore::Range::processContents): Left in assertions I used to debug
525         this.
526
527 2008-03-11  Darin Adler  <darin@apple.com>
528
529         - fix Release build
530
531         * platform/mac/ScrollViewMac.mm:
532         (WebCore::ScrollView::setContentsPos): Don't use NSMakePoint.
533
534 2008-03-11  Darin Adler  <darin@apple.com>
535
536         Reviewed by Anders.
537
538         - simplify Mac code for ScrollView, since it's used only for FrameView
539           and not in two different modes like it was historically
540         - remove code depending on the bridge to get from an NSView to a WebCore::Frame
541
542         * bindings/objc/DOMHTML.mm:
543         (-[DOMHTMLInputElement _rectOnScreen]): getDocumentView -> documentView.
544
545         * bridge/jni/jni_jsobject.cpp:
546         (createRootObject): Instead of using WebCoreViewFactory to find the frame given
547         and NSView, use the WebCoreFrameView interface to do it.
548
549         * editing/mac/EditorMac.mm:
550         (WebCore::Editor::paste): getDocumentView -> documentView.
551         * editing/mac/SelectionControllerMac.mm:
552         (WebCore::SelectionController::notifyAccessibilityForSelectionChange): Ditto.
553
554         * page/FrameView.h: Fixed comment.
555
556         * page/InspectorController.cpp:
557         (WebCore::InspectorController::drawNodeHighlight): Removed uneeded typecasts
558         to ScrollView* since FrameView is derived from ScrollView.
559
560         * page/mac/EventHandlerMac.mm:
561         (WebCore::EventHandler::focusDocumentView): getDocumentView -> documentView.
562         * page/mac/FrameMac.mm:
563         (WebCore::Frame::imageFromRect): Ditto.
564         * page/mac/WebCoreAXObject.mm:
565         (-[WebCoreAXObject position]): Ditto.
566         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Ditto.
567         (-[WebCoreAXObject rendererForView:]): Updated code that used to use
568         WebCoreBridgeHolder to use WebCoreFrameView instead.
569
570         * page/mac/WebCoreFrameBridge.mm:
571         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
572         getDocumentView -> documentView.
573
574         * page/mac/WebCoreFrameView.h: Removed the WebCoreScrollbarMode type; we just
575         use WebCore::ScrollbarMode directly. Renamed the WebCoreFrameView protocol to
576         WebCoreFrameScrollView, since it's a protocol for the scroll view, not the
577         frame view itself. Replaced WebCoreBridgeHolder protocol with WebCoreFrameView
578         protocol, which returns a WebCore::Frame directly rather than a bridge.
579
580         * page/mac/WebCoreViewFactory.h: Eliminated the bridgeForView method.
581
582         * platform/ScrollView.h: Moved the constructor and destructor out of the
583         class-specific #if blocks. Renamed Mac-specific function that gets the
584         NSView for from getDocumentView to documentView and a scrollView function
585         that returns an appropriately classed NSScrollView.
586
587         * platform/graphics/MediaPlayer.h: Changed type of parentWidget to FrameView
588         instead of Widget.
589         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
590         (WebCore::MediaPlayerPrivate::createQTMovieView): Removed unnecessary cast.
591
592         * platform/mac/PopupMenuMac.mm:
593         (WebCore::PopupMenu::show): getDocumentView -> documentView.
594         * platform/mac/ScrollViewMac.mm:
595         (WebCore::ScrollView::ScrollView): Added.
596         (WebCore::ScrollView::~ScrollView): Added.
597         (WebCore::ScrollView::scrollView): Added.
598         (WebCore::ScrollView::visibleWidth): Removed unused non-NSScrollView case.
599         (WebCore::ScrollView::visibleHeight): Ditto.
600         (WebCore::ScrollView::visibleContentRect): Ditto.
601         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers): Ditto.
602         (WebCore::ScrollView::contentsWidth): Ditto.
603         (WebCore::ScrollView::contentsHeight): Ditto.
604         (WebCore::ScrollView::contentsX): Ditto.
605         (WebCore::ScrollView::contentsY): Ditto.
606         (WebCore::ScrollView::scrollOffset): Ditto.
607         (WebCore::ScrollView::scrollRectIntoViewRecursively): Ditto.
608         (WebCore::ScrollView::setContentsPos): Ditto.
609         (WebCore::ScrollView::setVScrollbarMode): Ditto.
610         (WebCore::ScrollView::setHScrollbarMode): Ditto.
611         (WebCore::ScrollView::setScrollbarsMode): Ditto.
612         (WebCore::ScrollView::vScrollbarMode): Ditto.
613         (WebCore::ScrollView::hScrollbarMode): Ditto.
614         (WebCore::ScrollView::suppressScrollbars): Ditto.
615         (WebCore::ScrollView::addChild): Ditto.
616         (WebCore::ScrollView::resizeContents): Ditto.
617         (WebCore::ScrollView::updateContents): Ditto.
618         (WebCore::ScrollView::contentsToWindow): Ditto.
619         (WebCore::ScrollView::windowToContents): Ditto.
620         (WebCore::ScrollView::setStaticBackground): Ditto.
621         (WebCore::ScrollView::documentView): Renamed and removed unused case.
622         (WebCore::ScrollView::scrollbarUnderMouse): Removed incorrect comment.
623
624         * platform/mac/WidgetMac.mm:
625         (WebCore::Widget::getOuterView): Update for protocol name change.
626
627         * rendering/RenderThemeMac.mm:
628         (WebCore::RenderThemeMac::paintCheckbox): getDocumentView -> documentView.
629         (WebCore::RenderThemeMac::paintRadio): Ditto.
630         (WebCore::RenderThemeMac::paintButton): Ditto.
631         (WebCore::RenderThemeMac::paintMenuList): Ditto.
632         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
633         (WebCore::RenderThemeMac::paintSearchField): Ditto.
634         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Ditto.
635         (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): Ditto.
636         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Ditto.
637
638 2008-03-11  Brent Fulgham  <bfulgham@gmail.com>
639
640         Reviewed by Adam Roben.
641
642         Split CookieJarWin.cpp into CFNet and non-CFNet versions to
643         reduce the massive amount of conditionalization in the file.
644         (see http://bugs.webkit.org/show_bug.cgi?id=17788)
645
646         * WebCore.vcproj/WebCore.vcproj:
647         * platform/network/win/CookieJarCFNetWin.cpp: Copied from WebCore/platform/network/win/CookieJarWin.cpp.
648         (WebCore::setCookies):
649         (WebCore::cookies):
650         (WebCore::cookiesEnabled):
651         * platform/network/win/CookieJarWin.cpp:
652         (WebCore::setCookies):
653         (WebCore::cookies):
654         (WebCore::cookiesEnabled):
655
656 2008-03-11  Darin Adler  <darin@apple.com>
657
658         Reviewed by Sam.
659
660         - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
661
662         * page/ChromeClient.h: Added new client functions to replace calls up to WebKit
663         that were formerly handled by the bridge.
664
665         * page/Frame.h: Removed unneeded declarations. Moved declarations of script-specific
666         functions to a ScriptController section. Removed willPopupMenu.
667
668         * page/mac/ChromeMac.mm:
669         (WebCore::Chrome::focusNSView): Changed to call firstResponder and makeFirstResponder
670         via the client instead of the bridge.
671
672         * page/mac/EventHandlerMac.mm:
673         (WebCore::EventHandler::passMouseDownEventToWidget): Changed to call firstResponder
674         and makeFirstResponder via the chrome client instead of the bridge.
675
676         * page/mac/FrameMac.mm: Removed willPopupMenu.
677
678         * page/mac/WebCoreFrameBridge.h: Removed WebCoreFrameBridge protocol and
679         SubclassResponsibility category. Also removed some unneeded imports.
680
681         * platform/mac/PopupMenuMac.mm:
682         (WebCore::PopupMenu::show): Call willPopUpMenu on chrome client instead of frame.
683
684         * platform/mac/WidgetMac.mm:
685         (WebCore::Widget::setIsSelected): Call functions directly on the view rather than
686         calling via the bridge.
687
688 2008-03-11  Darin Adler  <darin@apple.com>
689
690         Reviewed by Mitz.
691
692         - make some Range improvements (preparation for Range support for DOM mutation)
693
694         Made constructors private, added create functions.
695         Made refcount start at 1 rather than starting at 0 and being incremented.
696         Made Range use two Position objects for the start/end container/offset pairs.
697
698         * WebCore.base.exp: Updated.
699
700         * dom/Document.cpp:
701         (WebCore::Document::createRange): Changed to use Range::create.
702         (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
703
704         * dom/Position.cpp:
705         (WebCore::Position::formatForDebugger): Updated for member variable name change.
706         (WebCore::Position::showTreeForThis): Ditto.
707         (WebCore::startPosition): Changed to use Range::startPosition.
708         (WebCore::endPosition): Changed to use Range::endPosition.
709
710         * dom/Position.h: Made the data members public and renamed them to container
711         and offset. But since offset() is already a function, temporarily used posOffset
712         for the data member. Later we'll get rid of offset(). Made more functions inline.
713         Removed the constructor that takes a PositionIterator.
714
715         * dom/PositionIterator.cpp:
716         (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
717         that used to be in Position.
718         * dom/PositionIterator.h: Added conversion operator to produce a Position.
719         Removed friend declaration for Position.
720
721         * dom/Range.cpp:
722         (WebCore::Range::Range): Updated constructors for data member changes and made
723         them use a refcount of 1.
724         (WebCore::Range::create): Added.
725         (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
726         is now indicated by m_start.container of 0. Also updated to use m_start instead
727         of the old m_startContainer.
728         (WebCore::Range::startOffset): Ditto.
729         (WebCore::Range::endContainer): Ditto.
730         (WebCore::Range::endOffset): Ditto.
731         (WebCore::Range::commonAncestorContainer): Ditto.
732         (WebCore::Range::collapsed): Ditto.
733         (WebCore::Range::setStart): Ditto.
734         (WebCore::Range::setEnd): Ditto.
735         (WebCore::Range::collapse): Ditto.
736         (WebCore::Range::isPointInRange): Ditto.
737         (WebCore::Range::comparePoint): Ditto.
738         (WebCore::Range::compareNode): Ditto.
739         (WebCore::Range::compareBoundaryPoints): Ditto.
740         (WebCore::Range::boundaryPointsValid): Ditto.
741         (WebCore::Range::deleteContents): Ditto.
742         (WebCore::Range::intersectsNode): Ditto.
743         (WebCore::Range::processContents): Ditto.
744         (WebCore::Range::extractContents): Ditto.
745         (WebCore::Range::cloneContents): Ditto.
746         (WebCore::Range::insertNode): Ditto.
747         (WebCore::Range::toString): Ditto.
748         (WebCore::Range::text): Ditto.
749         (WebCore::Range::createContextualFragment): Ditto.
750         (WebCore::Range::detach): Ditto.
751         (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
752         multiple calls to the virtual nodeType() function.
753         (WebCore::Range::cloneRange): Ditto.
754         (WebCore::Range::setStartAfter): Ditto.
755         (WebCore::Range::setEndBefore): Ditto.
756         (WebCore::Range::setEndAfter): Ditto.
757         (WebCore::Range::selectNode): Ditto.
758         (WebCore::Range::selectNodeContents): Ditto.
759         (WebCore::Range::surroundContents): Ditto.
760         (WebCore::Range::setStartBefore): Ditto.
761         (WebCore::Range::checkDeleteExtract): Ditto.
762         (WebCore::Range::containedByReadOnly): Ditto.
763         (WebCore::Range::firstNode): Ditto.
764         (WebCore::Range::editingStartPosition): Ditto.
765         (WebCore::Range::pastLastNode): Ditto.
766         (WebCore::Range::addLineBoxRects): Ditto.
767         (WebCore::Range::formatForDebugger): Ditto.
768         (WebCore::operator==): Ditto.
769         (WebCore::rangeOfContents): Ditto.
770         (WebCore::Range::maxStartOffset): Ditto.
771         (WebCore::Range::maxEndOffset): Ditto.
772
773         * dom/Range.h: Made constructors private. Added create functions.
774         Added getters for startContainer/Offset and endContainer/Offset that
775         return 0 instead of an exception for detached ranges that are inline
776         and don't require an ExceptionCode out parameter. Changed the parameters
777         to setStart and setEnd to PassRefPtr. Removed isDetached function.
778         Made ActionType and processContents private. Made startPosition and
779         endPosition inlines and have then return const&. Renamed startNode and
780         pastEndNode to firstNode and pastLastNode to reduce the chance of
781         confusion with startContainer/endContainer. Used Position for m_start
782         and m_end instead of separate container and offset members. Changed
783         maxStartOffset and maxEndOffset into int to match other offsets.
784
785         * editing/ApplyStyleCommand.cpp:
786         (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
787         (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
788         * editing/CompositeEditCommand.cpp:
789         (WebCore::CompositeEditCommand::inputText): Ditto.
790         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
791         * editing/DeleteSelectionCommand.cpp:
792         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
793         * editing/Editor.cpp:
794         (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
795         (WebCore::Editor::setComposition): Changed to use Range::create.
796         (WebCore::paragraphAlignedRangeForRange): Ditto.
797         (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
798         isDetached and check for 0 from startContainer instead.
799         (WebCore::Editor::compositionRange): Changed to use Range::create.
800         * editing/EditorCommand.cpp:
801         (WebCore::unionDOMRanges): Ditto.
802         * editing/Selection.cpp:
803         (WebCore::Selection::toRange): Ditto.
804         * editing/TextIterator.cpp:
805         (WebCore::TextIterator::TextIterator): Changed for firstNode and pastLastNode
806         name change.
807         (WebCore::TextIterator::range): Changed to use Range::create.
808         (WebCore::SimplifiedBackwardsTextIterator::range): Ditto.
809         (WebCore::TextIterator::subrange): Ditto.
810         * editing/VisiblePosition.cpp:
811         (WebCore::makeRange): Ditto.
812         * editing/VisiblePosition.h: Added now-needed include.
813         * editing/htmlediting.cpp:
814         (WebCore::indexForVisiblePosition): Changed to use Range::create.
815         (WebCore::avoidIntersectionWithNode): Changed to get rid of check for
816         isDetached and check for 0 instead and to use Range::create.
817         * editing/markup.cpp:
818         (WebCore::renderedText): Changed to use Range::create.
819         (WebCore::createMarkup): Changed to no longer use isDetached and also
820         for new firstNode/pastEndNode names.
821         (WebCore::createFragmentFromText): Ditto.
822         * editing/visible_units.cpp:
823         (WebCore::previousBoundary): Changed to use Range::create.
824         * page/mac/WebCoreFrameBridge.mm:
825         (-[WebCoreFrameBridge convertToNSRange:]): Changed to no longer use
826         isDetached().
827         * rendering/RenderTextControl.cpp:
828         (WebCore::RenderTextControl::visiblePositionForIndex): Changed to use Range::create.
829         (WebCore::RenderTextControl::indexForVisiblePosition): Ditto.
830
831 2008-03-11  Daniel Zucker <zucker@wake3.com>
832
833         Reviewed by Adam Roben.
834
835         There are a handful of placed where the use of CFNetwork-specific
836         calls are protected by PLATFORM(CF).  Revise to use the more specific
837         USE(CFNETWORK) macro.  (See http://bugs.webkit.org/show_bug.cgi?id=17783) 
838
839         * platform/network/ProtectionSpace.cpp:  Change PLATFORM(CF) to USE(CFNETWORK)
840         * platform/network/ResourceHandle.cpp: Change PLATFORM(CF) to USE(CFNETWORK)
841         * platform/network/win/CookieJarWin.cpp:  Correct error in
842           InternetGetCookie call.  Conditionalize 'cookiesEnabled' the same
843           as all other implementations in this file.
844
845 2008-03-11  Xan Lopez  <xan@gnome.org>
846
847         Reviewed by Alp Toker.
848
849         http://bugs.webkit.org/show_bug.cgi?id=16476
850
851         Add libsoup HTTP backend.
852         
853         * GNUmakefile.am:
854         * platform/network/ResourceHandleInternal.h:
855         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
856         * platform/network/soup/AuthenticationChallenge.h: Added.
857         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
858         * platform/network/soup/ResourceError.h: Added.
859         (WebCore::ResourceError::ResourceError):
860         * platform/network/soup/ResourceHandleSoup.cpp: Added.
861         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
862         (WebCore::ResourceHandle::~ResourceHandle):
863         (WebCore::dataCallback):
864         (WebCore::parseDataUrl):
865         (WebCore::ResourceHandle::start):
866         (WebCore::ResourceHandle::cancel):
867         (WebCore::ResourceHandle::bufferedData):
868         (WebCore::ResourceHandle::supportsBufferedData):
869         (WebCore::ResourceHandle::setDefersLoading):
870         (WebCore::ResourceHandle::loadsBlocked):
871         (WebCore::ResourceHandle::willLoadFromCache):
872         * platform/network/soup/ResourceRequest.h: Copied from WebCore/platform/network/curl/ResourceRequest.h.
873         (WebCore::ResourceRequest::ResourceRequest):
874         (WebCore::ResourceRequest::doUpdatePlatformRequest):
875         * platform/network/soup/ResourceResponse.h: Added.
876         (WebCore::ResourceResponse::ResourceResponse):
877         (WebCore::ResourceResponse::setResponseFired):
878         (WebCore::ResourceResponse::responseFired):
879         (WebCore::ResourceResponse::doUpdateResourceResponse):
880
881 2008-03-11  Rodney Dawes  <dobey@wayofthemonkey.com>
882
883         Fix Qt build.
884
885         * plugins/qt/PluginDataQt.cpp:
886         (PluginData::initPlugins)
887
888 2008-03-11  Adam Roben  <aroben@apple.com>
889
890         Make attribute quoting in DOM view more consistent with source view
891
892         Two changes which make the DOM view more consistent with source view:
893          1) We now quote all attribute values, including URLs
894          2) The quotes around the values are now purple, matching the left and
895             right angle brackets that surround the tag
896
897         One bug fixed by these changes:
898          1) The entire URL is selected for editing when you double-click a URL
899             that is an attribute value. Previously, the first and last
900             characters were not included in the selection.
901
902         Reviewed by Darin.
903
904         * page/inspector/DocumentPanel.js:
905         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
906         to account for the quotes around attribute values anymore because the
907         quotes are now outside the webkit-html-attribute-value span.
908         * page/inspector/utilities.js:
909         (nodeTitleInfo): Quote all attribute values, including URLs, and place
910         the quotes outside the webkit-html-attribute-value span.
911
912 2008-03-11  Adam Roben  <aroben@apple.com>
913
914         Stop including pthread.h in WebCore on Windows
915
916         Reviewed by Darin.
917
918         * WebCore.vcproj/WebCore.vcproj:
919           - Changed the include path to not contain pthreads/
920           - Let VS remove a duplicate FileConfiguration element
921           - Let VS have its way with the file ordering
922         * WebCorePrefix.h: Made the #include of pthread.h be compiled out on
923         Windows.
924         * loader/FTPDirectoryDocument.cpp: Added a Windows-specific #define of
925         localtime_r (pthread.h was providing a macro that substituted plain
926         old localtime before, but localtime_s is "more secure", so I went with
927         that).
928         * loader/FTPDirectoryParser.cpp: Ditto for gmtime_r.
929
930 2008-03-11  Adam Roben  <aroben@apple.com>
931
932         Roll out r30961 since it broke the default site icon on Windows
933
934         * loader/icon/IconDatabase.cpp:
935         (WebCore::IconDatabase::defaultIcon):
936
937 2008-03-11  Dan Bernstein  <mitz@apple.com>
938
939         Reviewed by Darin Adler.
940
941         - clean up line layout code
942
943         * platform/graphics/GraphicsContext.cpp:
944         (WebCore::TextRunIterator::increment): Removed the resolver parameter.
945         (WebCore::GraphicsContext::drawBidiText): Adjusted for changes to
946         createBidiRunsForLine(), which no longer takes a start parameter.
947         * platform/text/BidiResolver.h:
948         (WebCore::BidiResolver::): Made Noncopyable and removed the
949         m_adjustEmbedding member variable.
950         (WebCore::BidiResolver::position): Added. Returns the resolver's current
951         position.
952         (WebCore::BidiResolver::setPosition): Added. Sets the resolver's current
953         position without changing any other state.
954         (WebCore::BidiResolver::increment): Added. Advances the resolver to the
955         next position, allowing the iterator to push and pop embedding.
956         (WebCore::BidiResolver::appendRun): Removed the resolver parameter in
957         the call to increment().
958         (WebCore::BidiResolver::embed): Removed code to save, set and restore
959         m_adjustEmbedding.
960         (WebCore::BidiResolver::createBidiRunsForLine): Changed to not take a
961         'start' iterator. Instead, start at the current position. Removed code
962         to set m_adjustEmbedding. Changed for noncopyability.
963         * rendering/RenderBlock.h:
964         * rendering/bidi.cpp:
965         (WebCore::bidiNext): Made the resolver parameter optional. Changed to
966         null-check the 'end of inline' pointer only twice.
967         (WebCore::bidiFirst): Made the resolver parameter optional.
968         (WebCore::BidiIterator::increment): Ditto.
969         (WebCore::BidiState::increment): Added. Overrides the default
970         BidiResolver::increment() method by passing the resolver to
971         BidiIterator::increment().
972         (WebCore::checkMidpoints): Removed the resolver parameter.
973         (WebCore::BidiState::appendRun): Removed code to save, set and restore
974         m_adjustEmbedding. Adjusted for change to increment().
975         (WebCore::RenderBlock::bidiReorderLine): Removed the 'start' parameter
976         and unreachable code.
977         (WebCore::buildCompactRuns): Adjusted for changes to BidiResolver/
978         (WebCore::RenderBlock::layoutInlineChildren): Moved code to initialize
979         the resolver from this method to determineStartPosition(). Unified the
980         resolver with the 'start' iterator. Removed unreachable code. Moved one
981         statement from the beginning of the while loop to the end.
982         (WebCore::RenderBlock::determineStartPosition): Moved code to initialize
983         the resolver from layoutInlineChildren() into this method.
984         (WebCore::RenderBlock::matchedEndLine): Adjusted for the resolver and
985         the 'start' iterator being one object.
986         (WebCore::skipNonBreakingSpace): Made the parameter const.
987         (WebCore::requiresLineBox): Ditto.
988         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Adjusted for
989         the change to BidiIterator::increment().
990         (WebCore::RenderBlock::skipWhitespace): Made two versions of this
991         method, one for BidiIterator and one for BidiState.
992         (WebCore::shouldSkipWhitespaceAfterStartObject): Removed the resolver
993         parameter.
994         (WebCore::RenderBlock::findNextLineBreak): Removed the resolver
995         parameter. Removed calls to setAdjustEmbedding(). Removed the 'previous'
996         variable and changed the 'last' variable to do its job.
997         * rendering/bidi.h:
998
999 2008-03-10  Adam Roben  <aroben@apple.com>
1000
1001         Part of Bug 17224: DOM nodes/attributes should be editable
1002
1003         <http://bugs.webkit.org/show_bug.cgi?id=17224>
1004         <rdar://problem/5732825>
1005
1006         This patch makes text nodes editable via double-click.
1007
1008         Reviewed by Tim.
1009
1010         * page/inspector/DocumentPanel.js:
1011         (WebInspector.DOMNodeTreeElement._startEditing):
1012           - Moved most of this code to _startEditingAttribute
1013           - Calls _startEditingTextNode or _startEditingAttribute as
1014             appropriate
1015         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Added. Code
1016         came from _startEditing.
1017         (WebInspector.DOMNodeTreeElement._startEditingTextNode): Added.
1018         (WebInspector.DOMNodeTreeElement._textNodeEditingCommitted): Added.
1019         (WebInspector.DOMNodeTreeElement._editingCancelled): Renamed from
1020         _attributeEditingCancelled.
1021         * page/inspector/utilities.js:
1022         (nodeTitleInfo): Wrap text nodes in a webkit-html-text-node span so
1023         that we can easily recognize/edit them.
1024
1025 2008-03-11  Holger Hans Peter Freyther  <zecke@selfish.org>
1026
1027         Reviewed by Darin.
1028
1029         r25512 inlined the urlIcon to improve the startup time of Safari on Mac. Inlining is
1030         not suitable for platforms where this icon is themable. E.g. the Qt platform is allowing
1031         to theme this icon and the Gtk+ platform will probably end up with themable icons
1032         as well.
1033         
1034         Remove dead code from the windows port and move the urlIcon from the windows
1035         directory to the Resource directory to be used by Qt and other ports.
1036         
1037         Ifdef the usage of the built-in icon in IconDatabase.cpp and for Qt do not use
1038         it. Gtk+ currently has no proper implementation of Image::loadPlatformResource but
1039         once it does it wants to use this for getting the urlIcon as well.
1040
1041         * Resources/urlIcon.png: Renamed from WebKit/win/WebKit.vcproj/urlIcon.png.
1042         * loader/icon/IconDatabase.cpp:
1043         (WebCore::IconDatabase::defaultIcon):
1044
1045 2008-03-11  Tor Arne Vestbø  <tavestbo@trolltech.com>
1046
1047         Reviewed by Darin.
1048
1049         Implemented HTML media element support for QtWebKit, using Phonon.
1050
1051         http://bugs.webkit.org/show_bug.cgi?id=17766
1052
1053         * WebCore.pro:
1054         * platform/graphics/MediaPlayer.cpp:
1055         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: Added.
1056         (debugMediaObject):
1057         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
1058         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
1059         (WebCore::MediaPlayerPrivate::getSupportedTypes):
1060         (WebCore::MediaPlayerPrivate::hasVideo):
1061         (WebCore::MediaPlayerPrivate::load):
1062         (WebCore::MediaPlayerPrivate::cancelLoad):
1063         (WebCore::MediaPlayerPrivate::play):
1064         (WebCore::MediaPlayerPrivate::pause):
1065         (WebCore::MediaPlayerPrivate::paused):
1066         (WebCore::MediaPlayerPrivate::seek):
1067         (WebCore::MediaPlayerPrivate::seeking):
1068         (WebCore::MediaPlayerPrivate::duration):
1069         (WebCore::MediaPlayerPrivate::currentTime):
1070         (WebCore::MediaPlayerPrivate::setEndTime):
1071         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
1072         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
1073         (WebCore::MediaPlayerPrivate::bytesLoaded):
1074         (WebCore::MediaPlayerPrivate::totalBytesKnown):
1075         (WebCore::MediaPlayerPrivate::totalBytes):
1076         (WebCore::MediaPlayerPrivate::setRate):
1077         (WebCore::MediaPlayerPrivate::setVolume):
1078         (WebCore::MediaPlayerPrivate::setMuted):
1079         (WebCore::MediaPlayerPrivate::dataRate):
1080         (WebCore::MediaPlayerPrivate::networkState):
1081         (WebCore::MediaPlayerPrivate::readyState):
1082         (WebCore::MediaPlayerPrivate::updateStates):
1083         (WebCore::MediaPlayerPrivate::setVisible):
1084         (WebCore::MediaPlayerPrivate::setRect):
1085         (WebCore::MediaPlayerPrivate::loadStateChanged):
1086         (WebCore::MediaPlayerPrivate::rateChanged):
1087         (WebCore::MediaPlayerPrivate::sizeChanged):
1088         (WebCore::MediaPlayerPrivate::timeChanged):
1089         (WebCore::MediaPlayerPrivate::volumeChanged):
1090         (WebCore::MediaPlayerPrivate::didEnd):
1091         (WebCore::MediaPlayerPrivate::loadingFailed):
1092         (WebCore::MediaPlayerPrivate::naturalSize):
1093         (WebCore::MediaPlayerPrivate::eventFilter):
1094         (WebCore::MediaPlayerPrivate::repaint):
1095         (WebCore::MediaPlayerPrivate::paint):
1096         (WebCore::MediaPlayerPrivate::stateChanged):
1097         (WebCore::MediaPlayerPrivate::tick):
1098         (WebCore::MediaPlayerPrivate::metaDataChanged):
1099         (WebCore::MediaPlayerPrivate::seekableChanged):
1100         (WebCore::MediaPlayerPrivate::hasVideoChanged):
1101         (WebCore::MediaPlayerPrivate::bufferStatus):
1102         (WebCore::MediaPlayerPrivate::finished):
1103         (WebCore::MediaPlayerPrivate::currentSourceChanged):
1104         (WebCore::MediaPlayerPrivate::aboutToFinish):
1105         (WebCore::MediaPlayerPrivate::prefinishMarkReached):
1106         (WebCore::MediaPlayerPrivate::totalTimeChanged):
1107         * platform/graphics/qt/MediaPlayerPrivatePhonon.h: Added.
1108         (WebCore::MediaPlayerPrivate::):
1109         (WebCore::MediaPlayerPrivate::isAvailable):
1110
1111 2008-03-10  Sam Weinig  <sam@webkit.org>
1112
1113         Reviewed by Beth Dakin.
1114
1115         Throw a SECURITY_ERR when accessing a tainted canvas
1116         by CanvasRenderingContext2D::getImageData() and
1117         HTMLCanvasElement::toDataURL().
1118
1119         * html/CanvasRenderingContext2D.cpp:
1120         (WebCore::CanvasRenderingContext2D::getImageData):
1121         * html/CanvasRenderingContext2D.h:
1122         * html/CanvasRenderingContext2D.idl:
1123         * html/HTMLCanvasElement.cpp:
1124         (WebCore::HTMLCanvasElement::toDataURL):
1125         * html/HTMLCanvasElement.h:
1126         * html/HTMLCanvasElement.idl:
1127
1128 2008-03-10  Justin Garcia  <justin.garcia@apple.com>
1129
1130         Reviewed by Sam.
1131
1132         <rdar://problem/5779984> REGRESSION (r30391): GMail: Safari won't display the Edit Link dialog
1133
1134         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1135         (WebCore::hasCSSPropertyNamePrefix): Fixed a typo.  The code was only
1136         comparing the first character of the prefix to the first character
1137         of the property name.
1138
1139 2008-03-10  Andre Boule  <aboule@apple.com>
1140
1141         Reviewed by Beth.
1142
1143         Hold off on initializing the frame to avoid the RenderView getting 
1144         a null FrameView. This could potentially cause problems.
1145
1146         * svg/graphics/SVGImage.cpp:
1147         (WebCore::SVGImage::dataChanged):
1148
1149 2008-03-10  Darin Adler  <darin@apple.com>
1150
1151         - try to fix Qt build
1152
1153         * bridge/qt/qt_runtime.cpp:
1154         (KJS::Bindings::convertQVariantToValue): Change KJS::UChar to UChar.
1155
1156 2008-03-10  Darin Adler  <darin@apple.com>
1157
1158         Reviewed by Antti.
1159
1160         - fix <rdar://problem/3059610> VIP: links opened in new frame, window, or tab
1161           should be redrawn as visited immediately
1162         - fix <rdar://problem/4382809> Going "back" a page doesn't change the color of
1163           the visited URL at directory.umi
1164         - fix http://bugs.webkit.org/show_bug.cgi?id=4941
1165           Visited links should be marked as visited
1166         - fix http://bugs.webkit.org/show_bug.cgi?id=7960
1167           REGRESSION: Visited link color doesn't displayed after loading page from cache
1168
1169         We now mark all links on a page as "changed" at the appropriate times.
1170
1171         * WebCore.base.exp: Update since I made completeURL be a const member function.
1172
1173         * css/CSSStyleSelector.cpp: Got rid of some unneeded globals that could be turned
1174         into locals. Also changed some static data members to file-scoped globals with
1175         internal linkage. Renamed the globals to get rid of the m_ prefix. Changed the
1176         prefix on m_styleNotYetAvailable to s_styleNotYetAvailable.
1177         (WebCore::CSSStyleSelector::CSSStyleSelector): Updated for name changes.
1178         (WebCore::parseUASheet): Tweak the comment.
1179         (WebCore::CSSStyleSelector::loadDefaultStyle): Updated for name changes and to
1180         use local variables instead of globals where possible.
1181         (WebCore::CSSStyleSelector::checkPseudoState): Made this a member function so
1182         it can store the link in a hash. Also changed it to have a return value instead
1183         of having it modify a global variable. Added code to put the hash into a set so
1184         we can tell later if this is one of the links that affects this page.
1185         (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for the change to
1186         checkPseudoState.
1187         (WebCore::CSSStyleSelector::matchUARules): Updated for name changes.
1188         (WebCore::CSSStyleSelector::styleForElement): Ditto.
1189         (WebCore::CSSStyleSelector::adjustRenderStyle): Ditto.
1190         (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Changed code to read
1191         the SVG style sheet to use a boolean global and put it right here in the function
1192         since this is the only code that needs to know about it.
1193         (WebCore::CSSStyleSelector::checkOneSelector): Updated for name changes.
1194         (WebCore::colorForCSSValue): Moved code inside the function that is not needed
1195         anywhere else.
1196         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Updaed for the change
1197         to checkPseudoState.
1198         (WebCore::CSSStyleSelector::allVisitedStateChanged): Added. Calls setChanged on
1199         all links if there were any in the set.
1200         (WebCore::CSSStyleSelector::visitedStateChanged): Added. Calls setChanged on all
1201         links if the one that changed is in the set.
1202
1203         * css/CSSStyleSelector.h: Removed unused StyleSelector class and State enum. Made
1204         CSSStyleSelector derive from Noncopyable. Made lots of member functions private that
1205         didn't need to be public, and removed others that could be made into non-member
1206         functions. Changed pseudoStyleRulesForElement to take a const String& instead of
1207         a StringImpl*. Added new allVisitedStateChanged and visitedStateChanged functions.
1208         Got rid of unneeded friend declarations.
1209
1210         * dom/Document.cpp:
1211         (WebCore::Document::completeURL): Made const.
1212         (WebCore::findSlashDotDotSlash): Moved here from PageGroup.
1213         (WebCore::findSlashSlash): Ditto.
1214         (WebCore::findSlashDotSlash): Ditto.
1215         (WebCore::containsColonSlashSlash):
1216         (WebCore::cleanPath): Ditto.
1217         (WebCore::matchLetter): Ditto.
1218         (WebCore::needsTrailingSlash): Ditto.
1219         (WebCore::Document::visitedLinkHash): Moved this here from PageGroup. This is
1220         the poor-man's completeURL function. The idea of putting it here is that this
1221         way it can be alongside the real completeURL function. Later we should figure out
1222         a way to make this function share more code with the real thing and match behavior.
1223
1224         * dom/Document.h: Marked completeURL function const. Added visitedLinkHash function.
1225
1226         * page/DOMWindow.cpp:
1227         (WebCore::DOMWindow::getMatchedCSSRules): Updated for change to CSSStyleSelector.
1228
1229         * page/Page.cpp:
1230         (WebCore::Page::allVisitedStateChanged): Added. Calls allVisitedStateChanged on all
1231         style selectors.
1232         (WebCore::Page::visitedStateChanged): Ditto.
1233         * page/Page.h: Added the above functions.
1234
1235         * page/PageGroup.cpp:
1236         (WebCore::PageGroup::isLinkVisited): Changed to take a visitedLinkHash parameter.
1237         The CSSStyleSelector now handles actually computing the hash, and it does so by
1238         calling code in Document.
1239         (WebCore::PageGroup::addVisitedLink): Refactored so the two overloaded copies share
1240         a bit more code. Added code that calls visitedStateChanged if a new link was added.
1241         (WebCore::PageGroup::removeVisitedLinks): Added code to call allVisitedStateChanged
1242         if any visited links are removed.
1243         * page/PageGroup.h: Include StringHash.h instead of having the AlreadyHashed struct
1244         definition here.
1245
1246         * platform/text/StringHash.h:
1247         (WebCore::CaseFoldingHash::hash): Tweaked to make this a bit more consistent with
1248         the StringImpl::computeHash function, using the same technique for avoiding 0.
1249         (WebCore::AlreadyHashed::hash): Added. Was formerly in PageGroup.h.
1250         (WebCore::AlreadyHashed::avoidDeletedValue): Added. Was formerly in PageGroup.cpp.
1251
1252         * rendering/RenderStyle.cpp:
1253         (WebCore::RenderStyle::isStyleAvailable): Changed to use an inline function instead
1254         of getting directly at a data member so the data member could be made private.
1255
1256         * loader/FrameLoader.cpp:
1257         (WebCore::FrameLoader::scrollToAnchor): Added call to updateHistoryForAnchorScroll.
1258         (WebCore::FrameLoader::updateHistoryForAnchorScroll): Added.
1259         * loader/FrameLoader.h: Added updateHistoryForAnchorScroll.
1260
1261 2008-03-10  Adam Roben  <aroben@apple.com>
1262
1263         Part of Bug 17224: DOM nodes/attributes should be editable
1264
1265         <http://bugs.webkit.org/show_bug.cgi?id=17224>
1266         <rdar://problem/5732825>
1267
1268         This patch makes DOM attributes editable via double-click.
1269
1270         Reviewed by Tim.
1271
1272         * page/inspector/DocumentPanel.js:
1273         (WebInspector.DOMNodeTreeElement.onmousedown): Don't do anything if
1274         we're being edited, since we want default editing behaviors to work.
1275         (WebInspector.DOMNodeTreeElement.ondblclick): Try to start editing
1276         before doing anything else.
1277         (WebInspector.DOMNodeTreeElement._startEditing): Added. Currently only
1278         lets you edit attributes.
1279         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added.
1280         Uses a scratch element to get the new attribute(s) parsed, then sets
1281         the attribute(s) on the node in the inspected document.
1282         (WebInspector.DOMNodeTreeElement._attributeEditingCancelled): Added.
1283         (WebInspector.DOMNodeTreeElement._updateTitle): Added. Refreshes the
1284         representation of the node in the Inspector's DOM tree to reflect
1285         the node's current state.
1286         * page/inspector/inspector.css: Made the .editing class apply
1287         everywhere.
1288         * page/inspector/utilities.js:
1289         (nodeTitleInfo): Changed to surround attribute name/value pairs in a
1290         webkit-html-attribute span so that we can easily edit the pair as a
1291         whole.
1292
1293 2008-03-10  David Kilzer  <ddkilzer@apple.com>
1294
1295         Fix 64-bit builds.
1296
1297         Reviewed by Stephanie.
1298
1299         WebCore.exp only gets generated once for both 32-bit and 64-bit builds,
1300         so we must exclude the _NPN symbols when creating WebCore.LP64.exp.
1301
1302         * WebCore.xcodeproj/project.pbxproj: Reverted build phase shell code to
1303         r30826 to remove _NPN symbols from 64-bit builds in WebCore.LP64.exp.
1304
1305 2008-03-10  Eric Seidel  <eric@webkit.org>
1306
1307         Reviewed by Darin.
1308
1309         Remove KJS::UChar, use ::UChar instead
1310         http://bugs.webkit.org/show_bug.cgi?id=17017
1311
1312         To functional changes, thus no tests.
1313
1314         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
1315         (WebCore::hasCSSPropertyNamePrefix):
1316         (WebCore::cssPropertyName):
1317         * bindings/js/JSDOMWindowBase.cpp:
1318         (WebCore::windowProtoFuncAToB):
1319         (WebCore::windowProtoFuncBToA):
1320         * bindings/js/JSSVGPODTypeWrapper.h:
1321         * bindings/js/kjs_proxy.cpp:
1322         (WebCore::KJSProxy::evaluate):
1323         * bridge/objc/objc_utility.mm:
1324         (KJS::Bindings::throwError):
1325         * dom/Document.cpp:
1326         (WebCore::Document::parseQualifiedName):
1327         * platform/text/AtomicString.cpp:
1328         (WebCore::AtomicString::add):
1329         * platform/text/String.cpp:
1330         (WebCore::String::String):
1331         (WebCore::String::operator Identifier):
1332         (WebCore::String::operator UString):
1333         * platform/text/TextCodecICU.cpp:
1334         (WebCore::TextCodecICU::decode):
1335         * svg/SVGAnimatedTemplate.h:
1336
1337 2008-03-10  Darin Adler  <darin@apple.com>
1338
1339         Reviewed by Sam.
1340
1341         - eliminate keyboard UI mode method from WebCoreFrameBridge
1342
1343         * page/ChromeClient.h: Added keyboardUIMode function.
1344         (WebCore::ChromeClient::keyboardUIMode): Ditto.
1345         * page/mac/EventHandlerMac.mm:
1346         (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
1347         of bridge function.
1348         * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
1349         ones.
1350
1351         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
1352         Do not try to fight the Xcode.
1353
1354 2008-03-10  Darin Adler  <darin@apple.com>
1355
1356         - oops, forgot to save last couple changes from the editor
1357
1358         * bindings/js/JSDOMWindowCustom.cpp:
1359         (WebCore::markDOMObjectWrapper): Tweaked a tiny bit.
1360         (WebCore::JSDOMWindow::mark): Sorted alphabetically.
1361
1362 2008-03-10  Darin Adler  <darin@apple.com>
1363
1364         Reviewed by Geoff.
1365
1366         - fix failing regression test (window.navigator is getting garbage
1367           collected and thus losing its custom properties)
1368
1369         * bindings/js/JSDOMWindowCustom.cpp:
1370         (WebCore::markDOMObject): Added helper function.
1371         (WebCore::JSDOMWindow::mark): Added. Marks the wrappers for all the objects that hang
1372         off the window object.
1373
1374         * page/DOMWindow.h:
1375         (WebCore::DOMWindow::optionalScreen): Added so we can get the Screen object without
1376         creating it if it's already there.
1377         (WebCore::DOMWindow::optionalSelection): Ditto.
1378         (WebCore::DOMWindow::optionalHistory): Ditto.
1379         (WebCore::DOMWindow::optionalLocationbar): Ditto.
1380         (WebCore::DOMWindow::optionalMenubar): Ditto.
1381         (WebCore::DOMWindow::optionalPersonalbar): Ditto.
1382         (WebCore::DOMWindow::optionalScrollbars): Ditto.
1383         (WebCore::DOMWindow::optionalStatusbar): Ditto.
1384         (WebCore::DOMWindow::optionalToolbar): Ditto.
1385         (WebCore::DOMWindow::optionalConsole): Ditto.
1386         (WebCore::DOMWindow::optionalNavigator): Ditto.
1387
1388         * page/DOMWindow.idl: Added the CustomMarkFunction flag. Sorted the flags in
1389         alphabetical order since there are a lot of them.
1390
1391 2008-03-10  Darin Adler  <darin@apple.com>
1392
1393         Reviewed by Sam.
1394
1395         - eliminate Java applet methods from WebCoreFrameBridge
1396
1397         * loader/FrameLoaderClient.h: Added a javaApplet function.
1398         * page/mac/FrameMac.mm:
1399         (WebCore::Frame::createScriptInstanceForWidget): Streamlined the code.
1400         Use the loader client instead of the bridge to get the applet.
1401         * page/mac/WebCoreFrameBridge.h: Removed the getAppletInView and
1402         pollForAppletInView methods. Also removed other unused things.
1403
1404 2008-03-10  Marc-Antoine Ruel  <maruel@gmail.com>
1405
1406         Reviewed by Eric, landed by Darin.
1407
1408         http://bugs.webkit.org/show_bug.cgi?id=16095
1409         Move GraphicsContextPrivate to its own header file.
1410
1411         Moves GraphicsContextState and GraphicsContextPrivate to its
1412         own header
1413
1414         * WebCore.vcproj/WebCore.vcproj:
1415         * platform/graphics/GraphicsContext.cpp:
1416         * platform/graphics/GraphicsContextPrivate.h: Added.
1417         (WebCore::GraphicsContextState::GraphicsContextState):
1418         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
1419
1420 2008-03-10  Julien Chaffraix  <julien.chaffraix@gmail.com>
1421
1422         Reviewed and landed by Darin.
1423
1424         bug 12182 : XMLHttpRequest should raise SECURITY_ERR for same-origin policy violations
1425
1426         Removed reference to PERMISSION_DENIED (previous non standard exception) and replaced it
1427         by DOM exception SECURITY_ERR. Updated XMLHttpRequest::open to raise SECURITY_ERR.
1428
1429         * bindings/js/kjs_binding.cpp:
1430         (WebCore::setDOMException): Removed PERMISSION_DENIED code.
1431         * dom/ExceptionCode.cpp: Added SECURITY_ERR exception.
1432         * dom/ExceptionCode.h: Ditto.
1433         * xml/XMLHttpRequest.cpp:
1434         (WebCore::XMLHttpRequest::open): Returns SECURITY_ERR now.
1435         * xml/XMLHttpRequestException.h: Removed PERMISSION_DENIED.
1436
1437 2008-03-09  Adam Roben  <aroben@apple.com>
1438
1439         Refactor CSS editing code so we can share it with DOM editing
1440
1441         Add WebInspector.startEditing, which takes the element to be edited, a
1442         committedCallback, a cancelledCallback, and a context parameter. This
1443         function takes care of setting up the element for editing, and calls
1444         either the cancelledCallback or committedCallback when editing ends.
1445
1446         Reviewed by Tim.
1447
1448         * page/inspector/StylesSidebarPane.js:
1449         (WebInspector.StylePropertyTreeElement.startEditing):
1450           - Call WebInspector.isBeingEdited and WebInspector.startEditing
1451           - Removed code now handled by WebInspector.startEditing
1452         (WebInspector.StylePropertyTreeElement.editingEnded):
1453           - Renamed from endEditing
1454           - Removed code now handled by WebInspector.startEditing
1455         (WebInspector.StylePropertyTreeElement.editingCancelled):
1456           - Renamed from cancelEditing
1457           - Changed parameters to match WebInspector.startEditing's
1458             cancelledCallback
1459         (WebInspector.StylePropertyTreeElement.editingCommitted):
1460           - Renamed from commitEditing
1461           - Changed parameters to match WebInspector.startEditing's
1462             committedCallback
1463         * page/inspector/inspector.js:
1464         (WebInspector.changeFocus): Changed a call to firstParentWithClassName
1465         to firstParentOrSelfWithClassName so that if the focusable element
1466         itself is the target it will be recognized. I don't know why this
1467         change wasn't needed before this.
1468         (WebInspector.isBeingEdited): Added.
1469         (WebInspector.startEditing): Added.
1470
1471 2008-03-10  Adam Roben  <aroben@apple.com>
1472
1473         Windows build fix
1474
1475         * WebCore.vcproj/WebCore.vcproj: Pick up generated source files out of
1476         $(WebKitOutputDir) instead of hard-coding WebKitBuild.
1477
1478 2008-03-10  Darin Adler  <darin@apple.com>
1479
1480         * DerivedSources.make: Merge plug-in-related changes with the new way of handling
1481         autogenerated DOM classes.
1482
1483 2008-03-10  Johnny Ding  <johnnyding.webkit@gmail.com>
1484
1485         Reviewed, tweaked and landed by Alexey.
1486
1487         - fix http://bugs.webkit.org/show_bug.cgi?id=17732        
1488
1489         We didn't have a fallback to frame encoding in the case of loading a script via
1490         changing its src attribute.
1491
1492         Test: fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src.html
1493
1494         * html/HTMLScriptElement.cpp:
1495         (WebCore::HTMLScriptElement::parseMappedAttribute): Use a helper function to get proper
1496         charset for correct decoding of script content.
1497         (WebCore::HTMLScriptElement::insertedIntoDocument):
1498         (WebCore::HTMLScriptElement::scriptCharset): A helper function for getting proper charset
1499         for the script (as much as can be determined prior to loading it).
1500         * html/HTMLScriptElement.h:
1501         * html/HTMLTokenizer.cpp:
1502         (WebCore::HTMLTokenizer::parseTag): Use a helper function to get proper charset for correct
1503         decoding of script content.
1504
1505 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
1506
1507         Reviewed by Lars.
1508
1509         Fix reference counting of returned MimeType and Plugin objects
1510         created in the array wrappers.
1511
1512         * plugins/MimeTypeArray.cpp:
1513         * plugins/MimeTypeArray.h:
1514         * plugins/Plugin.cpp:
1515         * plugins/Plugin.h:
1516         * plugins/PluginArray.cpp:
1517         * plugins/PluginArray.h:
1518
1519 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
1520
1521         Wx linking fix.
1522
1523         Added missing stubs for PluginData.
1524
1525         * platform/wx/TemporaryLinkStubs.cpp:
1526
1527 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
1528
1529         Windows build fix that I forgot to merge earlier ;(
1530
1531         Forward declare Page as class, not struct.
1532
1533         * plugins/PluginData.h:
1534
1535 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
1536
1537         Attempt to fix the Wx build.
1538
1539         * WebCoreSources.bkl:
1540
1541 2008-03-07  Simon Hausmann  <hausmann@webkit.org>
1542
1543         Reviewed by Darin.
1544
1545         Done with Lars.
1546
1547         http://bugs.webkit.org/show_bug.cgi?id=16815
1548
1549         Ported the manually written JS bindings of window.navigator,
1550         window.navigator.plugins and window.navigator.mimeTypes to
1551         auto-generated bindings.
1552
1553         Moved the globally cached plugin and mimetype information to a
1554         per WebCore::Page shared PluginData structure.
1555
1556         Implemented window.navigator.plugins.refresh() in a
1557         platform-independent way.
1558
1559         * DerivedSources.make:
1560         * GNUmakefile.am:
1561         * WebCore.pro:
1562         * WebCore.vcproj/WebCore.vcproj:
1563         * WebCore.xcodeproj/project.pbxproj:
1564         * bindings/js/JSDOMWindowBase.cpp:
1565         (WebCore::JSDOMWindowBase::getValueProperty):
1566         * bindings/js/JSMimeTypeArrayCustom.cpp: Added.
1567         (WebCore::JSMimeTypeArray::canGetItemsForName):
1568         (WebCore::JSMimeTypeArray::nameGetter):
1569         * bindings/js/JSNavigatorCustom.cpp: Added.
1570         (WebCore::needsYouTubeQuirk):
1571         (WebCore::JSNavigator::appVersion):
1572         * bindings/js/JSPluginArrayCustom.cpp: Added.
1573         (WebCore::JSPluginArray::canGetItemsForName):
1574         (WebCore::JSPluginArray::nameGetter):
1575         * bindings/js/JSPluginCustom.cpp: Added.
1576         (WebCore::JSPlugin::canGetItemsForName):
1577         (WebCore::JSPlugin::nameGetter):
1578         * bindings/js/kjs_navigator.cpp: Removed.
1579         * bindings/js/kjs_navigator.h: Removed.
1580         * dom/Clipboard.cpp:
1581         * dom/DOMImplementation.cpp:
1582         (WebCore::DOMImplementation::createDocument):
1583         * loader/FrameLoader.cpp:
1584         (WebCore::FrameLoader::shouldUsePlugin):
1585         * page/DOMWindow.cpp:
1586         (WebCore::DOMWindow::clear):
1587         (WebCore::DOMWindow::navigator):
1588         * page/DOMWindow.h:
1589         * page/DOMWindow.idl:
1590         * page/DragController.cpp:
1591         * page/Frame.cpp:
1592         * page/Frame.h:
1593         * page/Navigator.cpp: Added.
1594         (WebCore::Navigator::Navigator):
1595         (WebCore::Navigator::~Navigator):
1596         (WebCore::Navigator::disconnectFrame):
1597         (WebCore::Navigator::appCodeName):
1598         (WebCore::Navigator::appName):
1599         (WebCore::Navigator::appVersion):
1600         (WebCore::Navigator::language):
1601         (WebCore::Navigator::userAgent):
1602         (WebCore::Navigator::platform):
1603         (WebCore::Navigator::plugins):
1604         (WebCore::Navigator::mimeTypes):
1605         (WebCore::Navigator::product):
1606         (WebCore::Navigator::productSub):
1607         (WebCore::Navigator::vendor):
1608         (WebCore::Navigator::vendorSub):
1609         (WebCore::Navigator::cookieEnabled):
1610         (WebCore::Navigator::javaEnabled):
1611         * page/Navigator.h: Added.
1612         (WebCore::Navigator::create):
1613         (WebCore::Navigator::frame):
1614         * page/Navigator.idl: Added.
1615         * page/Page.cpp:
1616         (WebCore::Page::refreshPlugins):
1617         (WebCore::Page::pluginData):
1618         * page/Page.h:
1619         * page/Plugin.h: Removed.
1620         * page/mac/FrameMac.mm:
1621         * page/mac/WebCoreFrameBridge.mm:
1622         (-[WebCoreFrameBridge canProvideDocumentSource]):
1623         * page/mac/WebCoreViewFactory.h:
1624         * page/qt/FrameQt.cpp:
1625         * page/win/FrameWin.cpp:
1626         * platform/gtk/TemporaryLinkStubs.cpp:
1627         * platform/mac/PlugInInfoStoreMac.mm: Removed.
1628         * platform/qt/MIMETypeRegistryQt.cpp:
1629         (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
1630         * plugins/MimeType.cpp: Added.
1631         (WebCore::MimeType::MimeType):
1632         (WebCore::MimeType::~MimeType):
1633         (WebCore::MimeType::type):
1634         (WebCore::MimeType::suffixes):
1635         (WebCore::MimeType::description):
1636         (WebCore::MimeType::enabledPlugin):
1637         * plugins/MimeType.h: Added.
1638         (WebCore::MimeType::create):
1639         * plugins/MimeType.idl: Added.
1640         * plugins/MimeTypeArray.cpp: Added.
1641         (WebCore::MimeTypeArray::MimeTypeArray):
1642         (WebCore::MimeTypeArray::~MimeTypeArray):
1643         (WebCore::MimeTypeArray::length):
1644         (WebCore::MimeTypeArray::item):
1645         (WebCore::MimeTypeArray::canGetItemsForName):
1646         (WebCore::MimeTypeArray::nameGetter):
1647         (WebCore::MimeTypeArray::getPluginData):
1648         * plugins/MimeTypeArray.h: Added.
1649         (WebCore::MimeTypeArray::create):
1650         (WebCore::MimeTypeArray::disconnectFrame):
1651         * plugins/MimeTypeArray.idl: Added.
1652         * plugins/Plugin.cpp: Added.
1653         (WebCore::Plugin::Plugin):
1654         (WebCore::Plugin::~Plugin):
1655         (WebCore::Plugin::name):
1656         (WebCore::Plugin::filename):
1657         (WebCore::Plugin::description):
1658         (WebCore::Plugin::length):
1659         (WebCore::Plugin::item):
1660         (WebCore::Plugin::canGetItemsForName):
1661         (WebCore::Plugin::nameGetter):
1662         * plugins/Plugin.h: Added.
1663         (WebCore::Plugin::create):
1664         * plugins/Plugin.idl: Added.
1665         * plugins/PluginArray.cpp: Added.
1666         (WebCore::PluginArray::PluginArray):
1667         (WebCore::PluginArray::~PluginArray):
1668         (WebCore::PluginArray::length):
1669         (WebCore::PluginArray::item):
1670         (WebCore::PluginArray::canGetItemsForName):
1671         (WebCore::PluginArray::nameGetter):
1672         (WebCore::PluginArray::refresh):
1673         (WebCore::PluginArray::getPluginData):
1674         * plugins/PluginArray.h: Added.
1675         (WebCore::PluginArray::create):
1676         (WebCore::PluginArray::disconnectFrame):
1677         * plugins/PluginArray.idl: Added.
1678         * plugins/PluginData.cpp: Added.
1679         (WebCore::PluginData::PluginData):
1680         (WebCore::PluginData::~PluginData):
1681         (WebCore::PluginData::supportsMimeType):
1682         (WebCore::PluginData::pluginNameForMimeType):
1683         * plugins/PluginData.h: Added.
1684         (WebCore::PluginData::create):
1685         (WebCore::PluginData::disconnectPage):
1686         (WebCore::PluginData::page):
1687         (WebCore::PluginData::plugins):
1688         (WebCore::PluginData::mimes):
1689         * plugins/mac/PluginDataMac.mm: Added.
1690         (WebCore::PluginData::initPlugins):
1691         (WebCore::PluginData::refresh):
1692         * plugins/qt/PluginDataQt.cpp: Added.
1693         (WebCore::PluginData::initPlugins):
1694         * plugins/win/PluginDataWin.cpp: Added.
1695         (WebCore::PluginData::initPlugins):
1696         (WebCore::PluginData::refresh):
1697
1698 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
1699
1700         Reviewed by Holger.
1701
1702         Replace two printfs() in the Qt port with notImplemented().
1703
1704         * html/CanvasRenderingContext2D.cpp:
1705         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
1706         (WebCore::CanvasRenderingContext2D::applyFillPattern):
1707
1708 2008-03-10  Simon Hausmann  <hausmann@webkit.org>
1709
1710         Reviewed by Alp.
1711
1712         Compilation fix with gcc 4.3: Include stdio.h for printf.
1713
1714         * html/CanvasRenderingContext2D.cpp:
1715         * html/HTMLCanvasElement.cpp:
1716
1717 2008-03-09  Steve Falkenburg  <sfalken@apple.com>
1718
1719         Stop Windows build if an error occurs in a prior project.
1720
1721         Rubber stamped by Darin.
1722
1723         * WebCore.vcproj/WebCore.vcproj:
1724         * WebCore.vcproj/WebCoreGenerated.vcproj:
1725
1726 2008-03-09  Darin Adler  <darin@apple.com>
1727
1728         * DerivedSources.make: Third try at fixing the build.
1729         * bindings/js/JSRGBColor.cpp: And touching this file.
1730
1731 2008-03-09  Darin Adler  <darin@apple.com>
1732
1733         * DerivedSources.make: One *more* try at fixing the build.
1734
1735 2008-03-09  Darin Adler  <darin@apple.com>
1736
1737         * DerivedSources.make: One more try at fixing the build.
1738
1739 2008-03-09  Darin Adler  <darin@apple.com>
1740
1741         * DerivedSources.make: Re-land the change, fixed, and with an attempt to fix the
1742         bots by removing the incorrect file.
1743
1744 2008-03-09  Oliver Hunt  <oliver@apple.com>
1745
1746         RS=Mark Rowe
1747
1748         Roll out r30909 -- it breaks the build and is a non-trivial fix (according to weinig)
1749
1750         * DerivedSources.make:
1751
1752 2008-03-09  Darin Adler  <darin@apple.com>
1753
1754         Reviewed by Adam.
1755
1756         * DerivedSources.make: Put the list of DOM classes into its own
1757         variable, and generate the JavaScript bindings and Objective-C
1758         bindings dependencies from that. Added some separators to make it
1759         a little easier to see the sections of the file. Moved all the
1760         Mac-specific rules (except for the SVG conditional part) down
1761         to the bottom of the file in a separate section.
1762
1763 2008-03-09  Adam Roben  <aroben@apple.com>
1764
1765         Windows build fix
1766
1767         * WebCore.vcproj/WebCore.vcproj: Make sure all Cairo files are
1768         excluded from all three CG-based configurations: Debug, Release, and
1769         Debug_Internal.
1770
1771 2008-03-08  Mark Rowe  <mrowe@apple.com>
1772
1773         Attempt to fix the Qt build.
1774
1775         * platform/MIMETypeRegistry.cpp:  Add missing include.
1776
1777 2008-03-08  Oliver Hunt  <oliver@apple.com>
1778
1779         Reviewed by Sam W.
1780
1781         Bug 16516: canvas image patterns stop working with some transformations
1782
1783         Simple fix.  We used x/yStep of FLT_MAX to fake a no-repeat-x/y pattern
1784         with CG.  However any transforms involving FLT_MAX immediately get
1785         consumed by the introduced floating point error.  yStep had already been
1786         clamped to a much smaller arbitrary value, and this patch makes us use
1787         that clamp value for xStep as well.
1788
1789         * html/CanvasPattern.cpp:
1790         (WebCore::CanvasPattern::createPattern):
1791
1792 2008-03-08  Oliver Hunt  <oliver@apple.com>
1793
1794         Reviewed by Mitz.
1795
1796         Bug 17728: Canvas.createPattern with null repeat argument throws an exception
1797
1798         Trivial fix, we were calling toString on null which produces the string "null",
1799         we just needed to switch to using valueToStringWithNullCheck rather than 
1800         JSValue::toString directly
1801
1802         Test: fast/canvas/canvas-pattern-behaviour.html
1803
1804         * WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1805         (WebCore::JSCanvasRenderingContext2D::createPattern):
1806
1807 2008-03-08  Mark Rowe  <mrowe@apple.com>
1808
1809         Reviewed by Darin Adler.
1810
1811         Fix 64-bit build with GCC 4.2.
1812
1813         * bindings/objc/WebScriptObject.mm: Use NSUInteger in place of unsigned where required.
1814         * platform/mac/SharedBufferMac.mm: Ditto.
1815
1816 2008-03-08  Dan Bernstein  <mitz@apple.com>
1817
1818         Reviewed by Oliver Hunt.
1819
1820         - fix garbage in transparent areas in canvas.toDataURL results
1821
1822         * platform/graphics/cg/ImageBufferCG.cpp:
1823         (WebCore::ImageBuffer::toDataURL): Clear the bitmap context before
1824         painting the canvas image onto it.
1825
1826 2008-03-08  Darin Adler  <darin@apple.com>
1827
1828         Reviewed by Adele.
1829
1830         - eliminate custom highlight methods from WebCoreFrameBridge
1831
1832         * page/Chrome.cpp:
1833         (WebCore::ChromeClient::customHighlightRect): Added.
1834         (WebCore::ChromeClient::paintCustomHighlight): Added.
1835         * page/ChromeClient.h: Added custom highlight functions.
1836         * page/Frame.h: Removed custom highlight functions.
1837         * page/mac/FrameMac.mm: Ditto.
1838         * page/mac/WebCoreFrameBridge.h: Removed custom highlight methods.
1839         * rendering/InlineTextBox.cpp:
1840         (WebCore::InlineTextBox::paintCustomHighlight): Changed code to use
1841         the ChromeClient instead of WebCoreFrameBridge to do the custom highlight.
1842         * rendering/RenderBox.cpp:
1843         (WebCore::RenderBox::paintCustomHighlight): Ditto.
1844         * rendering/RootInlineBox.cpp:
1845         (WebCore::RootInlineBox::addHighlightOverflow): Ditto.
1846         (WebCore::RootInlineBox::paintCustomHighlight): Ditto.
1847
1848 2008-03-07  Stephanie Lewis  <slewis@apple.com>
1849
1850         Reviewed by Oliver.
1851
1852         Fix Windows build.
1853
1854         * platform/graphics/cg/ImageBufferCG.cpp:
1855         (WebCore::ImageBuffer::toDataURL):
1856
1857 2008-03-07  David D. Kilzer  <ddkilzer@apple.com>
1858
1859         Unify concept of enabling Netscape Plug-in API (NPAPI).
1860
1861         Reviewed by Darin.
1862
1863         No test cases since there is no change in functionality.
1864
1865         * DerivedSources.make: Added check for ENABLE_NETSCAPE_PLUGIN_API macro.
1866         If defined as "1", add WebCore.NPAPI.exp to WEBCORE_EXPORT_DEPENDENCIES.
1867         * WebCore.NPAPI.exp: Added.
1868         * WebCore.base.exp: Moved exported NPAPI methods to WebCore.NPAPI.exp.
1869         * WebCore.xcodeproj/project.pbxproj: Removed changes in r30826 (except
1870         comments) since we now handle exported NPAPI methods via DerivedSources.make.
1871
1872         * config.h: Removed USE(NPOBJECT) since we now use ENABLE(NETSCAPE_PLUGIN_API) as
1873         defined in Platform.h.
1874
1875         * bindings/objc/DOM.mm: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
1876         (-[DOMElement _NPObject]):
1877
1878         * bridge/NP_jsobject.cpp: Replaced !PLATFORM(DARWIN) || !defined(__LP64__) with
1879         ENABLE(NETSCAPE_PLUGIN_API).
1880         * bridge/NP_jsobject.h: Ditto.
1881         * bridge/c/c_class.cpp: Ditto.
1882         * bridge/c/c_class.h: Ditto.
1883         * bridge/c/c_instance.cpp: Ditto.
1884         * bridge/c/c_instance.h: Ditto.
1885         * bridge/c/c_runtime.cpp: Ditto.
1886         * bridge/c/c_runtime.h: Ditto.
1887         * bridge/c/c_utility.cpp: Ditto.
1888         * bridge/c/c_utility.h: Ditto.
1889         * bridge/npruntime.cpp: Ditto.
1890         * bridge/npruntime_impl.h: Ditto.
1891         * bridge/npruntime_priv.h: Ditto.
1892         * bridge/runtime.cpp: Ditto.
1893         (KJS::Bindings::Instance::createBindingForLanguageInstance):
1894
1895         * html/HTMLPlugInElement.cpp: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
1896         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
1897         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
1898         * html/HTMLPlugInElement.h: Ditto.
1899
1900         * page/Frame.cpp: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
1901         (WebCore::Frame::clearScriptObjects):
1902         (WebCore::FramePrivate::FramePrivate): Also added #if ENABLE(NETSCAPE_PLUGIN_API)
1903         guard around m_windowScriptNPObject.
1904         * page/Frame.h: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
1905         * page/FramePrivate.h: Added #if ENABLE(NETSCAPE_PLUGIN_API) guard around
1906         m_windowScriptNPObject.
1907         * page/mac/FrameMac.mm: Replaced USE(NPOBJECT) with ENABLE(NETSCAPE_PLUGIN_API).
1908         (WebCore::Frame::createScriptInstanceForWidget):
1909
1910 2008-03-07  Alexey Proskuryakov  <ap@webkit.org>
1911
1912         Reviewed by Darin.
1913
1914         REGRESSION: Korean decoding doesn't support extended EUC-KR.
1915
1916         Test: fast/encoding/char-decoding.html
1917
1918         * platform/text/TextCodecICU.cpp:
1919         (WebCore::TextCodecICU::registerExtendedEncodingNames): Untangle the system of duplicate ICU
1920         encoding names by manually registering windows-939-2000, and mapping all other related
1921         encodings to it.
1922
1923 2008-03-07  Dan Bernstein  <mitz@apple.com>
1924
1925         Reviewed by Stephanie.
1926
1927         - try to fix leaks seen on Tiger after r30840
1928
1929         * css/CSSStyleSelector.cpp:
1930         (WebCore::CSSStyleSelector::~CSSStyleSelector): Use the default operator
1931         delete, rather than arena delete, to deallocate the root default style.
1932
1933 2008-03-07  Pierre-Luc Beaudoin  <pierre-luc.beaudoin@collabora.co.uk>
1934
1935         Reviewed by Alp Toker.
1936
1937         http://bugs.webkit.org/show_bug.cgi?id=17681
1938         GtkLauncher fails to render an element with position: fixed
1939
1940         Implement the required parts of PlatformScreenGtk.
1941
1942         * ChangeLog:
1943         * platform/gtk/PlatformScreenGtk.cpp:
1944         (WebCore::screenDepth):
1945         (WebCore::screenIsMonochrome):
1946         (WebCore::screenRect):
1947
1948 2008-03-07  Oliver Hunt  <oliver@apple.com>
1949
1950         Reviewed by Darin Adler.
1951
1952         Bug 16610: <canvas> restore() removes path segments created before it
1953
1954         The problem here is that WebKit stored the Path as part of the state, so
1955         restore would incorrectly lose changes made to the canvas path.  To match
1956         Firefox and HTML5 we make two real changes:
1957           * Move the context path from the state object directly onto the context.
1958             This is responsible for all the changes to the path manipulation functions
1959           * Add transform tracking to each state -- this is needed to correctly transform
1960             the current path when restore()-ing to a prior state.
1961
1962         Test: fast/canvas/canvas-save-restore-with-path.html
1963
1964         * html/CanvasRenderingContext2D.cpp:
1965         (WebCore::CanvasRenderingContext2D::restore):
1966         (WebCore::CanvasRenderingContext2D::scale):
1967         (WebCore::CanvasRenderingContext2D::rotate):
1968         (WebCore::CanvasRenderingContext2D::translate):
1969         (WebCore::CanvasRenderingContext2D::transform):
1970         (WebCore::CanvasRenderingContext2D::beginPath):
1971         (WebCore::CanvasRenderingContext2D::closePath):
1972         (WebCore::CanvasRenderingContext2D::moveTo):
1973         (WebCore::CanvasRenderingContext2D::lineTo):
1974         (WebCore::CanvasRenderingContext2D::quadraticCurveTo):
1975         (WebCore::CanvasRenderingContext2D::arcTo):
1976         (WebCore::CanvasRenderingContext2D::arc):
1977         (WebCore::CanvasRenderingContext2D::rect):
1978         (WebCore::CanvasRenderingContext2D::clearPathForDashboardBackwardCompatibilityMode):
1979         (WebCore::CanvasRenderingContext2D::fill):
1980         (WebCore::CanvasRenderingContext2D::stroke):
1981         (WebCore::CanvasRenderingContext2D::clip):
1982         (WebCore::CanvasRenderingContext2D::isPointInPath):
1983         * html/CanvasRenderingContext2D.h:
1984
1985 2008-03-07  Oliver Hunt  <oliver@apple.com>
1986
1987         Reviewed by Ada.
1988
1989         Fix for crash caused by FrameLoader incorrectly assuming it has
1990         a RenderWidget
1991
1992         In some circumstances an application embedding a WebView may 
1993         choose to prevent a webview from loading a resource.  If that
1994         resource was requested by an <object> element then we may 
1995         fallback to different content which may not produce a RenderWidget.
1996         Unfortunately FrameLoader::loadSubframe was assuming that if a
1997         renderer was produced it would always be a RenderWidget, and arbitrarily
1998         performed what could be an incorrect cast.  This could then lead to
1999         a crash.
2000
2001         We currently don't have anyway of making a test for this.
2002
2003         * loader/FrameLoader.cpp:
2004         (WebCore::FrameLoader::loadSubframe):
2005
2006 2008-03-07  Samuel Weinig  <sam@webkit.org>
2007
2008         Reviewed by Oliver Hunt.
2009
2010         Fix for http://bugs.webkit.org/show_bug.cgi?id=16673
2011         <canvas> lacks toDataURL()
2012
2013         Tests: fast/canvas/toDataURL-noData.html
2014                fast/canvas/toDataURL-supportedTypes.html
2015
2016         * html/CanvasRenderingContext2D.cpp:
2017         (WebCore::CanvasRenderingContext2D::printSecurityExceptionMessage): Make message non-global.
2018         * html/HTMLCanvasElement.cpp:
2019         (WebCore::HTMLCanvasElement::printSecurityExceptionMessage): Log error message indicating that toDataURL has
2020         been called on a tainted canvas. 
2021         (WebCore::HTMLCanvasElement::toDataURL): This does the tainted canvas check, ensures that the canvas has pixel
2022         data, checks to see if the MIME type is supported.  Unsupported MIME types and the null string (which is made
2023         by passing no argument/null/undefined in JavaScript) are treated as being PNG, as per the spec.  The actual 
2024         toDataURL logic is actually done in the ImageBuffer class.
2025         * html/HTMLCanvasElement.h: Add function declarations.
2026         * html/HTMLCanvasElement.idl: Add function declaration.
2027
2028         * platform/MIMETypeRegistry.cpp:
2029         (WebCore::initializeSupportedImageMIMETypes):
2030         (WebCore::initializeSupportedImageMIMETypesForEncoding):
2031         (WebCore::initializeSupportedJavaScriptMIMETypes):
2032         (WebCore::initializeSupportedNonImageMimeTypes):
2033         (WebCore::initializeSupportedMediaMIMETypes):
2034         (WebCore::initializeMIMETypeRegistry):
2035         (WebCore::MIMETypeRegistry::getMIMETypeForPath):
2036         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
2037         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
2038         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
2039         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
2040         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
2041         (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
2042         (WebCore::MIMETypeRegistry::isJavaAppletMIMEType):
2043         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
2044         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
2045         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypesForEncoding):
2046         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
2047         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes):
2048         * platform/MIMETypeRegistry.h:
2049         Clean up and add new supportedImageMIMETypesForEncoding set which contains the set of
2050         MIME types the platform knows how to encode. Currently only implemented for CG and Qt.
2051
2052         * platform/graphics/ImageBuffer.h: Add toDataURL method.
2053         * platform/graphics/cairo/ImageBufferCairo.cpp:
2054         (WebCore::ImageBuffer::toDataURL): Add stub.
2055         * platform/graphics/cg/ImageBufferCG.cpp:
2056         (WebCore::ImageBuffer::create):
2057         (WebCore::ImageBuffer::getImageData):
2058         (WebCore::ImageBuffer::putImageData):
2059         (WebCore::ImageBuffer::toDataURL):
2060         Converts the current context to a data: url of the specified MIME type.  This method
2061         unfortunately has to flip the context, resulting in less than optimal code.
2062
2063         * platform/graphics/qt/ImageBufferQt.cpp:
2064         (WebCore::ImageBuffer::toDataURL): Add stub.
2065         * platform/graphics/wx/ImageBufferWx.cpp:
2066         (WebCore::ImageBuffer::toDataURL): Add stub.
2067
2068 2008-03-07  Steve Falkenburg  <sfalken@apple.com>
2069
2070         Build fix.
2071
2072         * WebCore.vcproj/WebCore.vcproj:
2073
2074 2008-03-07  Brent Fulgham  <bfulgham@gmail.com>
2075
2076         Reviewed by Mark Rowe.
2077
2078         Correct build intermediary output
2079         (http://bugs.webkit.org/show_bug.cgi?id=17713)
2080
2081         * WebCore/WebCore.vcproj:  Correct intermediary paths
2082
2083 2008-03-07  Brent Fulgham  <bfulgham@gmail.com>
2084
2085         Reviewed by Steve Falkenburg.
2086
2087         Add Cairo build requirements to WebCore.vcproj under a new
2088         set of targets.  Exclude Cairo elements from normal CG build.
2089         Exclude CG elements from Cairo builds.
2090         (http://bugs.webkit.org/show_bug.cgi?id=17300)
2091
2092         * WebCore.vcproj/WebCore.vcproj:
2093         * WebCore.vcproj/webcore.vsprops: Added.
2094
2095 2008-03-07  Darin Adler  <darin@apple.com>
2096
2097         Reviewed by Adam.
2098
2099         - eliminated WebCoreFrameBridge runOpenPanel
2100
2101         * page/ChromeClient.h: Added runOpenPanel function.
2102         * page/mac/ChromeMac.mm:
2103         (WebCore::ChromeClient::runOpenPanel): Added.
2104         * platform/FileChooser.cpp:
2105         (WebCore::FileChooser::FileChooser): Moved this here. It's no longer platform-specific.
2106         Also start the refcount at 1.
2107         (WebCore::FileChooser::create): Added adoptRef since the refcount no starts at one.
2108         (WebCore::FileChooser::~FileChooser): Moved here. No longer platform-specific.
2109         * platform/FileChooser.h: Removed m_controller, which was Macintosh-specific.
2110         * platform/gtk/FileChooserGtk.cpp: Removed FileChooser constructor and destructor,
2111         since they are no longer platform-specific.
2112         * platform/qt/FileChooserQt.cpp: Ditto.
2113         * platform/win/FileChooserWin.cpp: Ditto.
2114         * platform/wx/TemporaryLinkStubs.cpp: Ditto.
2115         * platform/mac/FileChooserMac.mm:
2116         (WebCore::FileChooser::openFileChooser): Call the chrome client instead of the
2117         bridge to run the open panel. Allows us to get rid of the WebCoreOpenPanelController
2118         class and m_controller data member and move the cosntrutor/destructor to platform-
2119         independent code.
2120
2121 2008-03-07  Adam Roben  <aroben@apple.com>
2122
2123         Add JavaScriptDebugServer
2124
2125         This class is a singleton which allows one or more
2126         JavaScriptDebugListeners to receive callbacks during JavaScript
2127         execution.
2128
2129         Right now all listeners receive callbacks for all Pages in the
2130         process. Eventually we will want to support listeners registering for
2131         callbacks for specific Pages (e.g., the Inspector will want to listen
2132         for execution in just the Page it's inspecting).
2133
2134         Pages notify the JavaScriptDebugServer when they are created so that
2135         it can install itself as the Page's debugger.
2136
2137         Reviewed by Darin.
2138
2139         * GNUMakefile.am: Added new files to project.
2140         * WebCore.pro: Ditto.
2141         * WebCore.vcproj/WebCore.vcproj: Ditto.
2142         * WebCore.xcodeproj/project.pbxproj: Ditto.
2143         * WebCoreSources.bkl: Ditto.
2144         * page/JavaScriptDebugListener.h: Added.
2145         * page/JavaScriptDebugServer.cpp: Added.
2146         (WebCore::toFrame):
2147         (WebCore::JavaScriptDebugServer::shared):
2148         (WebCore::JavaScriptDebugServer::JavaScriptDebugServer):
2149         (WebCore::JavaScriptDebugServer::~JavaScriptDebugServer):
2150         (WebCore::JavaScriptDebugServer::addListener): Registers as the
2151         debugger for all Pages if we're adding our first listener.
2152         (WebCore::JavaScriptDebugServer::removeListener): Deregisters as the
2153         debugger for all Pages if we're removing our last listner.
2154         (WebCore::JavaScriptDebugServer::pageCreated): Registers as the
2155         debugger for the newly created Page if we have any listeners.
2156         (WebCore::dispatchDidParseSource): Helper function.
2157         (WebCore::dispatchFailedToParseSource): Ditto.
2158         (WebCore::JavaScriptDebugServer::sourceParsed): Call
2159         dispatchDidParseSource or dispatchFailedToParseSource depending on
2160         whether there was an error or not.
2161         (WebCore::JavaScriptDebugServer::dispatchFunctionToListeners): Calls
2162         the passed-in JavaScriptExecutionCallback on each listener, guarding
2163         against re-entry.
2164         (WebCore::JavaScriptDebugServer::callEvent): Dispatch didEnterCallFrame.
2165         (WebCore::JavaScriptDebugServer::atStatement): Dispatch willExecuteStatement.
2166         (WebCore::JavaScriptDebugServer::returnEvent): Dispatch willLeaveCallFrame.
2167         (WebCore::JavaScriptDebugServer::exception): Dispatch exceptionWasRaised.
2168         * page/JavaScriptDebugServer.h: Added.
2169         * page/Page.cpp:
2170         (WebCore::Page::Page): Tell the shared JavaScriptDebugServer we were
2171         created so it can register as our debugger if needed.
2172
2173 2008-03-07  Darin Adler  <darin@apple.com>
2174
2175         Reviewed by Brady.
2176
2177         - fix a theoretical problem with the visited-link hash table by avoiding collision
2178           with the special "deleted" value
2179         - improve efficiency of with the visited-link hash table by not hashing twice
2180
2181         * page/PageGroup.cpp:
2182         (WebCore::avoidDeletedValue): Added. Makes sure we never try to use the "all ones"
2183         value, since the hash table uses that for deleted hash table entries.
2184         (WebCore::PageGroup::isLinkVisited): Call avoidDeletedValue before using the hash
2185         value with the HashSet.
2186         (WebCore::PageGroup::addVisitedLink): Ditto.
2187
2188         * page/PageGroup.h: Added a new hash function, AlreadyHashed, for unsigned integer
2189         values. This assumes that the value is already a hash value, and doesn't try to
2190         hash it again. Used this for m_visitedLinkHashes.
2191
2192 2008-03-07  Simon Hausmann  <hausmann@webkit.org>
2193
2194         Fix the Qt build.
2195
2196         * WebCore.pro:
2197
2198 2008-03-06  Sam Weinig  <sam@webkit.org> with a little help from Oliver Hunt  <oliver@apple.com>
2199
2200         Reviewed by Mitz.
2201
2202         Implement the HTML5 canvas tainting rules to prevent potential data leakage
2203
2204         Added originClean to HTMLCanvasElement and CanvasPattern
2205         to track whether a canvas (or pattern) is tainted by remote
2206         data.
2207         Use originClean flag to determine whether getImageData should
2208         return, well, image data.
2209
2210         Test: http/tests/security/canvas-remote-read-remote-image.html
2211
2212         * html/CanvasPattern.cpp:
2213         (WebCore::CanvasPattern::CanvasPattern):
2214         * html/CanvasPattern.h:
2215         * html/CanvasRenderingContext2D.cpp:
2216         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
2217         (WebCore::CanvasRenderingContext2D::setFillStyle):
2218         (WebCore::CanvasRenderingContext2D::checkOrigin):
2219         (WebCore::CanvasRenderingContext2D::drawImage):
2220         (WebCore::CanvasRenderingContext2D::drawImageFromRect):
2221         (WebCore::CanvasRenderingContext2D::createPattern):
2222         (WebCore::CanvasRenderingContext2D::printSecurityExceptionMessage):
2223         (WebCore::CanvasRenderingContext2D::getImageData):
2224         * html/CanvasRenderingContext2D.h:
2225         * html/HTMLCanvasElement.cpp:
2226         (WebCore::HTMLCanvasElement::HTMLCanvasElement):
2227         * html/HTMLCanvasElement.h:
2228         (WebCore::HTMLCanvasElement::setOriginTainted):
2229         (WebCore::HTMLCanvasElement::originClean):
2230
2231 2008-03-06  Anders Carlsson  <andersca@apple.com>
2232
2233         Reviewed by Jon.
2234
2235         Templatize the JNI call code to reduce the amount of code that has
2236         to be duplicated.
2237
2238         * bridge/jni/jni_class.cpp:
2239         (JavaClass::JavaClass):
2240         * bridge/jni/jni_instance.cpp:
2241         (JavaInstance::stringValue):
2242         (JavaInstance::numberValue):
2243         (JavaInstance::booleanValue):
2244         (JavaInstance::invokeMethod):
2245         * bridge/jni/jni_jsobject.cpp:
2246         (JavaJSObject::convertJObjectToValue):
2247         * bridge/jni/jni_runtime.cpp:
2248         (JavaField::JavaField):
2249         (JavaMethod::JavaMethod):
2250         * bridge/jni/jni_utility.cpp:
2251         * bridge/jni/jni_utility.h:
2252         (KJS::Bindings::):
2253         (KJS::Bindings::callJNIMethodIDA):
2254         (KJS::Bindings::callJNIMethodV):
2255         (KJS::Bindings::callJNIMethod):
2256         (KJS::Bindings::callJNIStaticMethod):
2257
2258 2008-03-06  Darin Adler  <darin@apple.com>
2259
2260         Reviewed by Mitz.
2261
2262         - fix regression test failures from the visited-link change
2263
2264         * WebCore.base.exp: Export PageGroup::setShouldTrackVisitedLinks.
2265         * page/PageGroup.cpp:
2266         (WebCore::PageGroup::addVisitedLink): Do nothing and return early
2267         if shouldTrackVisitedLinks is false.
2268         (WebCore::PageGroup::removeVisitedLinks): Reset m_visitedLinksPopulated
2269         so the next time a link is queried this will be populated from history.
2270         (WebCore::PageGroup::setShouldTrackVisitedLinks): Added.
2271         * page/PageGroup.h: Added setShouldTrackVisitedLinks. This is global
2272         for now, but it would be better if it was per-page-group instead.
2273
2274 2008-03-06  Adele Peterson  <adele@apple.com>
2275
2276         Reviewed by Darin.
2277
2278         Fixes for for <rdar://problem/5785892> Implement activeElement attribute for HTMLDocument (HTML5)
2279         and <rdar://problem/5785895> Implement hasFocus() for HTMLDocument (HTML5)
2280
2281         Tests: fast/dom/HTMLDocument/activeElement.html
2282                fast/dom/HTMLDocument/hasFocus.html
2283
2284         * html/HTMLDocument.cpp:
2285         (WebCore::HTMLDocument::activeElement): Added. Returns the focused element, or the body element if nothing's focused.
2286         (WebCore::HTMLDocument::hasFocus): Added. Returns whether or not the document has focus (inclusive of sub-frames).
2287         * html/HTMLDocument.h: Added methods for activeElement and hasFocus.
2288         * html/HTMLDocument.idl: Added definitions for activeElement and hasFocus.
2289
2290 2008-03-06  Dan Bernstein  <mitz@apple.com>
2291
2292         Reviewed by Darin Adler.
2293
2294         - fix <rdar://problem/5741981> 154008 WebKit: Some asian language font glyphs are not shown (in Mail and Entourage)
2295
2296         Test: fast/text/soft-hyphen-3.html
2297
2298         * rendering/bidi.cpp:
2299         (WebCore::checkMidpoints):
2300         (WebCore::RenderBlock::findNextLineBreak): Made 'pos' unsigned. Made the
2301         midpoint after a hyphen always be a valid iterator, not allowing an
2302         offset past the end of a text node. Changed the check for consecutive
2303         soft hyphens to account for that.
2304
2305 2008-03-06  Darin Adler  <darin@apple.com>
2306
2307         - try to fix Wx build
2308
2309         * WebCoreSources.bkl: Added PageGroup.cpp.
2310
2311 2008-03-06  Darin Adler  <darin@apple.com>
2312
2313         - fix some builds
2314
2315         * GNUmakefile.am: Added PageGroup.cpp.
2316         * WebCore.base.exp: Removed WebCoreHistory.
2317         * WebCore.pro: Added PageGroup.cpp.
2318
2319 2008-03-06  Alexey Proskuryakov  <ap@webkit.org>
2320
2321         Reviewed by Darin.
2322
2323         <rdar://problem/5687269> Need to create a Collator abstraction for WebCore and JavaScriptCore
2324         
2325         * ForwardingHeaders/wtf/unicode/Collator.h: Added.
2326         * xml/XSLTUnicodeSort.cpp:
2327         (WebCore::xsltUnicodeSortFunction):
2328         * xml/XSLTUnicodeSort.h:
2329
2330 2008-03-06  Darin Adler  <darin@apple.com>
2331
2332         Reviewed by Mitz.
2333
2334         - fix http://bugs.webkit.org/show_bug.cgi?id=17526
2335           REGRESSION: iframes are added to Safari's History menu
2336           by separating the visited link machinery from global history
2337
2338         This should also make page loading faster due to more efficient visited link coloring.
2339
2340         * WebCore.base.exp: Updated.
2341         * WebCore.vcproj/WebCore.vcproj: Added PageGroup.h/cpp, removed GlobalHistory.h/cpp.
2342         * WebCore.xcodeproj/project.pbxproj: Ditto. Also removed WebCoreHistory.h/m.
2343
2344         * css/CSSStyleSelector.cpp: Updated includes.
2345         (WebCore::CSSStyleSelector::initElementAndPseudoState): Eliminated code to set
2346         currentEncodedURL.
2347         (WebCore::checkPseudoState): Moved most of the code inside a new
2348         PageGroup::isLinkVisited function.
2349         (WebCore::CSSStyleSelector::canShareStyleWithElement): Tightened code a bit by using
2350         references and only getting colors when needed.
2351         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Ditto.
2352         * css/CSSStyleSelector.h: Removed EncodedURL, m_encodedURL, and setEncodedURL.
2353
2354         * dom/Document.cpp:
2355         (WebCore::Document::attach): Removed call to setEncodedURL.
2356         (WebCore::Document::setURL): Ditto.
2357         (WebCore::Document::recalcStyleSelector): Ditto.
2358
2359         * loader/FrameLoader.cpp:
2360         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget): Changed code to use
2361         early exit idiom to be a little more readable.
2362         (WebCore::FrameLoader::urlsMatchItem): Change to use a reference for slightly
2363         better efficiency.
2364         (WebCore::FrameLoader::goToItem): Use early exit idiom to be a little more
2365         readable.
2366         (WebCore::FrameLoader::updateHistoryForStandardLoad): Moved history code back
2367         in here and got rid of the helper function updateGlobalHistory, restoring the
2368         logic before r30549. Also added a call to the new addVisitedLink function.
2369         (WebCore::FrameLoader::updateHistoryForClientRedirect): Added code to call
2370         addVisitedLink here.
2371         (WebCore::FrameLoader::updateHistoryForBackForwardNavigation): Removed comment.
2372         (WebCore::FrameLoader::updateHistoryForReload): Removed call to
2373         updateGlobalHistory; we can just go without updating global history or
2374         visited links here, at least for now, since it's not clear that a reload
2375         is a "history event".
2376         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory): Moved
2377         history code back where it was, and added the call to addVisitedLink, just
2378         as in updateHistoryForStandardLoad above.
2379         * loader/FrameLoader.h: Removed updateGlobalHistory function.
2380
2381         * page/Chrome.cpp:
2382         (WebCore::ChromeClient::populateVisitedLinks): Added. Empty placeholder so we
2383         don't have to implement this for every port all at once.
2384         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer): Changed to use the
2385         new PageGroup class.
2386         * page/ChromeClient.h: Added populateVisitedLinks function, used to fill the
2387         visited links set from the global history at application startup time.
2388
2389         * page/FrameTree.cpp:
2390         (WebCore::FrameTree::find): Updated to use the new PageGroup class.
2391
2392         * page/GlobalHistory.h: Removed.
2393         * page/win/GlobalHistoryWin.cpp: Removed.
2394         * page/mac/GlobalHistoryMac.mm: Removed.
2395         * platform/mac/WebCoreHistory.h: Removed.
2396         * platform/mac/WebCoreHistory.m: Removed.
2397         * platform/win/WebCoreHistory.cpp: Removed.
2398         * platform/win/WebCoreHistory.h: Removed.
2399
2400         * page/Page.cpp:
2401         (WebCore::Page::Page): Set m_group to 0.
2402         (WebCore::Page::setGroupName): Set up m_group. If the page is not in any
2403         group, set it to 0 for now to postpone the cost of creating a group.
2404         (WebCore::Page::initGroup): Added. Sets m_group to point to a single-page
2405         group; used when getting a group.
2406         (WebCore::Page::removeAllVisitedLinks): Added. Calls removeVisitedLinks
2407         on all page groups.
2408         * page/Page.h: Moved enums inside the WebCore namespace. Removed the
2409         frameNamespace function and instead added the group and groupPtr functions.
2410
2411         * page/PageGroup.cpp: Added. Contains all the visited code from the
2412         CSSStyleSelector in the isVisitedLink function, but more efficient because
2413         we don't allocate memory for the buffer.
2414         * page/PageGroup.h: Added.
2415
2416         * platform/gtk/TemporaryLinkStubs.cpp: Removed historyContains.
2417         * platform/qt/TemporaryLinkStubs.cpp: Removed unneeded include.
2418         * platform/wx/TemporaryLinkStubs.cpp: Removed historyContains.
2419
2420 2008-03-06  Mark Rowe  <mrowe@apple.com>
2421
2422         Fix 64-bit Mac build.
2423
2424         * WebCore.xcodeproj/project.pbxproj:  Exclude _NPN symbols from the exports list as they
2425         are compiled out of 64-bit builds.
2426
2427 2008-03-06  Mark Rowe  <mrowe@apple.com>
2428
2429         Leopard build fix.
2430
2431         * WebCore.base.exp:
2432
2433 2008-03-05  Kevin Ollivier  <kevino@theolliviers.com>
2434
2435         Fix the wx build after the bindings move.
2436
2437         * WebCoreSources.bkl:
2438         * webcore-base.bkl:
2439         * webcore-wx.bkl:
2440
2441 2008-03-05  Dan Bernstein  <mitz@apple.com>
2442
2443         Reviewed by Adele Peterson.
2444
2445         - fix "background-position: inherit"
2446
2447         * css/CSSStyleSelector.cpp:
2448         Made HANDLE_MULTILAYER_INHERIT_AND_INITIAL fall through and added
2449         a return statement in HANDLE_MULTILAYER_VALUE. Also removed an unused
2450         macro.
2451
2452 2008-03-05  Alp Toker  <alp@atoker.com>
2453
2454         Add a missing make dependency for derived sources to improve
2455         autotools build dependency tracking.
2456
2457         Issue spotted by Ori Bernstein.
2458
2459         * GNUmakefile.am:
2460
2461 2008-03-05  Alp Toker  <alp@atoker.com>
2462
2463         GTK+ build fix for breakage introduced in r30800.
2464
2465         Track moved bridge sources from JavaScriptCore to WebCore.
2466
2467         * GNUmakefile.am:
2468
2469 2008-03-05  Justin Garcia  <justin.garcia@apple.com>
2470
2471         Reviewed by Darin.
2472
2473         One part of fix for:
2474         <rdar://problem/5780697> Copying content with percentage based rules in a style sheet will cause fidelity issues
2475
2476         * editing/markup.cpp:
2477         (WebCore::appendStartMarkup): Styles from matched rules should take precedence over those in
2478         inline style declarations, not the other way around. 
2479
2480 2008-03-05  Anders Carlsson  <andersca@apple.com>
2481
2482         Reviewed by Darin.
2483
2484         Move JNI specific code from runtime_root over to jni_jsobject, where it is used.
2485
2486         * bridge/jni/jni_jsobject.cpp:
2487         (completedJavaScriptAccess):
2488         (initializeJavaScriptAccessLock):
2489         (lockJavaScriptAccess):
2490         (unlockJavaScriptAccess):
2491         (dispatchToJavaScriptThread):
2492         (performJavaScriptAccess):
2493         (JavaJSObject::initializeJNIThreading):
2494         (isJavaScriptThread):
2495         (JavaJSObject::invoke):
2496         * bridge/jni/jni_jsobject.h:
2497         * bridge/runtime_root.cpp:
2498         * bridge/runtime_root.h:
2499         * page/mac/WebCoreFrameBridge.mm:
2500         (-[WebCoreFrameBridge init]):
2501
2502 2008-03-05  Darin Adler  <darin@apple.com>
2503
2504         Reviewed by Sam.
2505
2506         - add functions giving offsets within a KURL, slated to replace the
2507           EncodedURL object in CSSStyleSelector (in a future "visited link" change)
2508         - changed all KURL data members names to use the traditional m_ prefix
2509         - initialize all members to 0 in invalid KURLs rather than having all
2510           functions check m_isValid
2511
2512         * platform/KURL.cpp:
2513         (WebCore::KURL::invalidate): Added. Initializes all the fields except for
2514         m_string to the "invalid" values. For use in the empty constructor and
2515         in the init and parse functions.
2516         (WebCore::KURL::init): Tweaked comments. Changed all code paths that return
2517         early to use the invalidate() function. Updated for member variable name
2518         changes.
2519         (WebCore::KURL::hasPath): Updated for member variable name changes.
2520         Remove now-unneeded check of m_isValid.
2521         (WebCore::KURL::lastPathComponent): Ditto.
2522         (WebCore::KURL::protocol): Ditto.
2523         (WebCore::KURL::host): Ditto.
2524         (WebCore::KURL::port): Ditto.
2525         (WebCore::KURL::pass): Ditto.
2526         (WebCore::KURL::user): Ditto.
2527         (WebCore::KURL::ref): Ditto.
2528         (WebCore::KURL::hasRef): Ditto.
2529         (WebCore::KURL::protocolIs): Ditto.
2530         (WebCore::KURL::query): Ditto.
2531         (WebCore::KURL::path): Ditto.
2532         (WebCore::KURL::setProtocol): Ditto.
2533         (WebCore::KURL::setHost): Ditto.
2534         (WebCore::KURL::setPort): Ditto.
2535         (WebCore::KURL::setHostAndPort): Ditto.
2536         (WebCore::KURL::setUser): Ditto.
2537         (WebCore::KURL::setPass): Ditto.
2538         (WebCore::KURL::setRef): Ditto.
2539         (WebCore::KURL::setQuery): Ditto.
2540         (WebCore::KURL::setPath): Ditto.
2541         (WebCore::KURL::prettyURL): Ditto.
2542         (WebCore::copyPathRemovingDots): Removed braces to match our code style.
2543         (WebCore::KURL::parse): Changed all code paths that return early to use
2544         the invalidate function. Moved code to set m_isValid to true to the very
2545         end of the function. Removed braces to match our code style. Removed an
2546         extra copy of the path/query/fragment code (there were two identical copies
2547         in the two sides of an if statement). Removed some commented-out code.
2548         Reversed an if statment. Added code to set the new m_pathAfterLastSlash
2549         field. Updated for member variable name changes.
2550         (WebCore::equalIgnoringRef): Updated for member variable name changes.
2551         (WebCore::KURL::isHierarchical): Ditto.
2552
2553         * platform/KURL.h: Added a FIXME about ref vs. fragment. Made the empty
2554         constructor inline and called the new invalidate function. Added new
2555         pathStart, pathEnd, and pathAfterLastSlash functions, for use in the
2556         new visited link code. Added an invalidate function. Renamed all the
2557         data members to use the m_ prefix.
2558
2559         * WebCore.base.exp: Updated.
2560
2561 2008-03-05  Anders Carlsson  <andersca@apple.com>
2562
2563         Reviewed by Sam.
2564
2565         * WebCore.xcodeproj/project.pbxproj:
2566         Change jni_jsobject.cpp to be Obj-C++ for now. The plan is to merge 
2567         this with jni_objc.mm and create jni_jsobject.mm.
2568         
2569         * bridge/jni/jni_jsobject.cpp:
2570         (createRootObject):
2571         Move createRootObject here from WebCoreFrameBridge.
2572         
2573         (JavaJSObject::createNative):
2574         Call the newly added createRootObject function.
2575         
2576         * bridge/runtime_root.cpp:
2577         (KJS::Bindings::RootObject::initializeJNIThreading):
2578         * bridge/runtime_root.h:
2579         setCreateRootObject no longer takes a root object, rename it to initializeJNIThreading.
2580
2581         * page/mac/FrameMac.mm:
2582         (WebCore::Frame::createScriptInstanceForWidget):
2583         Just call Frame::createRootObject here.
2584         
2585         * page/mac/WebCoreFrameBridge.mm:
2586         (-[WebCoreFrameBridge init]):
2587         Call initializeJNIThreading.
2588
2589 2008-03-05  Anders Carlsson  <andersca@apple.com>
2590
2591         Reviewed by Sam.
2592
2593         Change some static class variables to be regular static variables,
2594         making it easier to move the chunk of mac-specific code out of runtime_root.[cpp|h]
2595
2596         * bridge/runtime_root.cpp:
2597         (KJS::Bindings::completedJavaScriptAccess):
2598         (KJS::Bindings::RootObject::dispatchToJavaScriptThread):
2599         (KJS::Bindings::performJavaScriptAccess):
2600         (KJS::Bindings::RootObject::createRootObject):
2601         (KJS::Bindings::RootObject::runLoop):
2602         (KJS::Bindings::RootObject::setCreateRootObject):
2603         * bridge/runtime_root.h:
2604
2605 2008-03-05  Brent Fulgham <bfulgham@gmail.com>
2606
2607         Reviewed by Adam Roben.
2608
2609         Modify source files to use the USE(SAFARI_THEME) macro, rather than
2610         USE_SAFARI_THEME.  (http://bugs.webkit.org/show_bug.cgi?id=17683)
2611
2612         * WebCore/platform/win/PlatformScrollBarSafari.cpp
2613         * WebCore/rendering/RenderThemeSafari.cpp
2614         * WebCore/rendering/RenderThemeSafari.h
2615         * config.h: Move definition of WTF_USE_SAFARI_THEME here 
2616
2617 2008-03-05  Brady Eidson  <beidson@apple.com>
2618
2619         Reviewed by Alexey and Mark Rowe
2620
2621         Fix for <rdar://problem/5778247> - Reproducible crash on storage/execute-sql-args.html
2622
2623         DatabaseThread::unscheduleDatabaseTasks() manually filters through a MessageQueue,
2624         removing particular items for Databases that were shutting down.
2625
2626         This filtering operation is not atomic, and therefore causes a race condition with the
2627         database thread waking up and reading from the message queue.  
2628
2629         The end result was an attempt to dereference a null DatabaseTask.  Timing-wise, this never
2630         seemed to happen in a debug build, otherwise an assertion would've caught it.  Replacing that
2631         assertion with a crash in a release build is what revealed this bug.
2632
2633         The fix for the above symptom was entirely in WTF::MessageQueue in JSCore.  With this fix in 
2634         place, another crash popped up in the layout tests that was related to dereferencing a 
2635         deallocated object - simply because SQLTransaction had a raw pointer to it's Database object 
2636         when it needed to be a ref pointer.
2637
2638         * storage/SQLTransaction.cpp:
2639         (WebCore::SQLTransaction::runCurrentStatement):
2640         * storage/SQLTransaction.h: Change m_database to be a RefPtr
2641         (WebCore::SQLTransaction::database):
2642
2643 2008-03-05  Mark Rowe  <mrowe@apple.com>
2644
2645         Build fix.
2646
2647         * WebCore.base.exp:  Remove symbol that no longer exists from the exports file.
2648
2649 2008-03-05  Adam Roben  <aroben@apple.com>
2650
2651         Export a header/symbol for WebKit
2652
2653         Reviewed by Kevin M.
2654
2655         * WebCore.base.exp:
2656         * WebCore.xcodeproj/project.pbxproj:
2657
2658 2008-03-05  Adam Roben  <aroben@apple.com>
2659
2660         Move WebCoreScriptDebugger up to WebKit
2661
2662         Reviewed by Darin.
2663
2664         * WebCore.base.exp: Exported some functions used by
2665         WebCoreScriptDebugger, and sorted the list.
2666         * WebCore.xcodeproj/project.pbxproj: Removed
2667         WebCoreScriptDebugger.{h,mm} from the project and marked
2668         a few headers private so that WebKit can use them.
2669         * page/mac/WebCoreScriptDebugger.h: Removed.
2670         * page/mac/WebCoreScriptDebugger.mm: Removed.
2671
2672 2008-03-05  Anders Carlsson  <andersca@apple.com>
2673
2674         Build bridge/. Copy some headers over to WebKit as part of the post-build step.
2675         
2676         * WebCore.vcproj/WebCore.vcproj:
2677
2678 2008-03-05  Anders Carlsson  <andersca@apple.com>
2679
2680         Reviewed by Geoff.
2681
2682         * WebCore.base.exp:
2683         Add the NPN and KJS methods.
2684         
2685         * WebCore.xcodeproj/project.pbxproj:
2686         Bring in bridge/
2687
2688         * config.h:
2689         Add HAVE_JNI define.
2690         
2691         * bindings/js/kjs_html.cpp:
2692         * bindings/objc/DOMInternal.mm:
2693         * bindings/objc/DOMUtility.mm:
2694         * bindings/objc/WebScriptObject.mm:
2695         * html/HTMLAppletElement.cpp:
2696         * html/HTMLEmbedElement.cpp:
2697         * html/HTMLObjectElement.cpp:
2698         * html/HTMLPlugInElement.cpp:
2699         * page/Frame.cpp:
2700         * page/mac/FrameMac.mm:
2701         * page/mac/WebCoreFrameBridge.mm:
2702         * page/mac/WebCoreScriptDebugger.mm:
2703         * plugins/win/PluginViewWin.cpp:
2704         Include file changes.
2705
2706 2008-03-04  Anders Carlsson  <andersca@apple.com>
2707
2708         Reviewed by Sam.
2709
2710         Rewrite NPRuntime string conversion routines to use WebCore::String
2711         
2712         * bridge/NP_jsobject.cpp:
2713         (_NPN_Evaluate):
2714         * bridge/c/c_utility.cpp:
2715         (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback):
2716         (KJS::Bindings::convertNPVariantToValue):
2717         (KJS::Bindings::convertNPStringToUTF16):
2718         (KJS::Bindings::identifierFromNPIdentifier):
2719         * bridge/c/c_utility.h:
2720
2721 2008-03-05  Oliver Hunt  <oliver@apple.com>
2722
2723         Reviewed by Alexey P.
2724
2725         Small performance improvement to putImageData (3-5% on assignment in my tests)
2726
2727         * html/CanvasPixelArray.h:
2728         (WebCore::CanvasPixelArray::set):
2729
2730 2008-03-04  Sam Weinig  <sam@webkit.org>
2731
2732         Reviewed by Adele.
2733
2734         * bindings/js/JSXMLHttpRequest.h: Remove unnecessary override of toBoolean.
2735
2736 2008-03-04  Maciej Stachowiak  <mjs@apple.com>
2737
2738         Reviewed by Sam and Oliver.
2739
2740         - fixed http://bugs.webkit.org/show_bug.cgi?id=16289
2741         - fixed Acid3 tests 26 and 27 (not exactly the same issue but related)
2742
2743         * bindings/js/JSNodeCustom.cpp:
2744         (WebCore::JSNode::mark): When marking a node that's in-document,
2745         mark the owner document if it hasn't been already. This means holding on
2746         to a single node from an unreferenced document now keeps the whole document alive.
2747         
2748         We are now at 90/100 on Acid3.
2749
2750 2008-03-04  Sam Weinig  <sam@webkit.org>
2751
2752         Qt build fix.
2753
2754         * page/qt/FrameQt.cpp:
2755
2756 2008-03-04  Sam Weinig  <sam@webkit.org>
2757
2758         Reviewed by Mark Rowe.
2759
2760         Rename kjs_window to JSDOMWindowBase.
2761
2762         - Remove all unnecessary includes of JSDOMWindowBase.h, we prefer including
2763           JSDOMWindow.h
2764
2765         * ChangeLog:
2766         * DerivedSources.make:
2767         * GNUmakefile.am:
2768         * WebCore.pro:
2769         * WebCore.vcproj/WebCore.vcproj:
2770         * WebCore.xcodeproj/project.pbxproj:
2771         * WebCoreSources.bkl:
2772         * bindings/js/JSCustomVoidCallback.cpp:
2773         * bindings/js/JSCustomXPathNSResolver.cpp:
2774         * bindings/js/JSDOMWindowBase.cpp: Copied from bindings/js/kjs_window.cpp.
2775         * bindings/js/JSDOMWindowBase.h: Copied from bindings/js/kjs_window.h.
2776         * bindings/js/JSDOMWindowCustom.cpp:
2777         * bindings/js/JSDatabaseCustom.cpp:
2778         * bindings/js/JSEventTargetBase.cpp:
2779         * bindings/js/JSEventTargetBase.h:
2780         * bindings/js/JSEventTargetNode.cpp:
2781         * bindings/js/JSHTMLDocumentCustom.cpp:
2782         * bindings/js/JSHTMLFrameSetElementCustom.cpp:
2783         * bindings/js/JSHistoryCustom.cpp:
2784         * bindings/js/JSLocation.cpp:
2785         * bindings/js/JSSQLTransactionCustom.cpp:
2786         * bindings/js/JSXMLHttpRequest.cpp:
2787         * bindings/js/ScheduledAction.cpp:
2788         * bindings/js/kjs_binding.cpp:
2789         * bindings/js/kjs_events.cpp:
2790         * bindings/js/kjs_navigator.cpp:
2791         * bindings/js/kjs_proxy.cpp:
2792         * bindings/js/kjs_window.cpp: Removed.
2793         * bindings/js/kjs_window.h: Removed.
2794         * bindings/scripts/CodeGeneratorJS.pm:
2795         * history/CachedPage.cpp:
2796         * loader/FrameLoader.cpp:
2797         * page/Chrome.cpp:
2798         * page/InspectorController.cpp:
2799         * page/mac/FrameMac.mm:
2800         * page/mac/WebCoreFrameBridge.mm:
2801         * page/qt/FrameQt.cpp:
2802         * page/win/FrameWin.cpp:
2803         * plugins/win/PluginViewWin.cpp:
2804
2805 2008-03-04  Mark Rowe  <mrowe@apple.com>
2806
2807         Speculative Qt build fix.
2808
2809         * platform/qt/PasteboardQt.cpp:
2810
2811 2008-03-04  Anders Carlsson  <andersca@apple.com>
2812
2813         Reviewed by Sam.
2814
2815         Update include paths. This code is not used yet.
2816
2817         * bridge/NP_jsobject.cpp:
2818         * bridge/c/c_class.cpp:
2819         * bridge/c/c_instance.cpp:
2820         * bridge/c/c_utility.cpp:
2821         (KJS::Bindings::convertUTF8ToUTF16WithLatin1Fallback):
2822         #if 0 this out for now. 
2823         
2824         * bridge/jni/jni_class.cpp:
2825         * bridge/jni/jni_jsobject.cpp:
2826         * bridge/jni/jni_objc.mm:
2827         * bridge/jni/jni_runtime.cpp:
2828         * bridge/jni/jni_utility.cpp:
2829         * bridge/jni/jni_utility.h:
2830         * bridge/npruntime.cpp:
2831         * bridge/objc/WebScriptObject.h:
2832         * bridge/objc/objc_class.h:
2833         * bridge/objc/objc_instance.h:
2834         * bridge/objc/objc_runtime.h:
2835         * bridge/objc/objc_utility.h:
2836         * bridge/objc/objc_utility.mm:
2837         * bridge/runtime.cpp:
2838         * bridge/runtime.h:
2839         * bridge/runtime_array.cpp:
2840         * bridge/runtime_array.h:
2841         * bridge/runtime_method.cpp:
2842         * bridge/runtime_method.h:
2843         * bridge/runtime_object.cpp:
2844         * bridge/runtime_object.h:
2845         * bridge/runtime_root.cpp:
2846         * bridge/runtime_root.h:
2847
2848 2008-03-04  Dan Bernstein  <mitz@apple.com>
2849
2850         Reviewed by Darin Adler.
2851
2852         - fix http://bugs.webkit.org/show_bug.cgi?id=17676
2853           <rdar://problem/5781091> REGRESSION (r30240-r30267): href attribute values with non-ASCII characters in the host part do not work
2854
2855         Test: fast/encoding/url-host-name-non-ascii.html
2856
2857         * platform/KURL.cpp:
2858         (WebCore::appendEncodedHostname): Added an early return in the all-ASCII
2859         case to avoid copying the host name twice and corrected the error
2860         checking after calling uidna_IDNToASCII().
2861
2862 2008-03-04  Sam Weinig  <sam@webkit.org>
2863
2864         Reviewed by Dan Bernstein.
2865
2866         Use JSDOMWindow exclusively instead of JSDOMWindowBase.
2867
2868         * bindings/js/ScheduledAction.cpp:
2869         (WebCore::ScheduledAction::execute):
2870         * bindings/js/ScheduledAction.h:
2871         * bindings/js/kjs_window.cpp:
2872         (WebCore::JSDOMWindowBase::timerFired):
2873
2874 2008-03-04  Timothy Hatcher  <timothy@apple.com>
2875
2876         Reviewed by Darin Adler.
2877
2878         <rdar://problem/5720160> Browser windows "do nothing" while modal
2879         dialog or menu is up due to run loop modes (or while scrolling)
2880
2881         Adds a new SchedulePair object that holds a runloop and the mode to use.
2882         A HashSet of SchedulePairs is tracked by Page so it can be used for resource
2883         loading and, in the future, maybe SharedTimerMac.
2884
2885         * WebCore.base.exp: Add new exports for WebKit.
2886         * WebCore.xcodeproj/project.pbxproj: Add new files.
2887         * loader/mac/DocumentLoaderMac.cpp: Added.
2888         (WebCore::scheduleAll): Call schedule all the ResourceLoader handles.
2889         (WebCore::unscheduleAll): Call unschedule all the ResourceLoader handles.
2890         (WebCore::DocumentLoader::schedule): Schedule all the ResourceLoaders owned by the DocumentLoader.
2891         (WebCore::DocumentLoader::unschedule): Unschedule all the ResourceLoaders owned by the DocumentLoader.
2892         * loader/DocumentLoader.h:
2893         * page/Page.h:
2894         (WebCore::Page::scheduledRunLoopPairs): Return m_scheduledRunLoopPairs.
2895         * page/mac/PageMac.cpp:
2896         (WebCore::Page::addSchedulePair): Add a SchedulePair to m_scheduledRunLoopPairs.
2897         (WebCore::Page::removeSchedulePair): Removes a SchedulePair from m_scheduledRunLoopPairs.
2898         * platform/cf/SchedulePair.cpp: Added.
2899         * platform/cf/SchedulePair.h: Added.
2900         * platform/mac/SchedulePairMac.mm: Added.
2901         * platform/network/ResourceHandle.h:
2902         * platform/network/mac/FormDataStreamMac.mm:
2903         (WebCore::advanceCurrentStream): Use the new SchedulePair.
2904         (WebCore::formCreate): Ditto.
2905         (WebCore::formFinalize): Ditto.
2906         (WebCore::formSchedule): Ditto.
2907         (WebCore::formUnschedule): Ditto.
2908         * platform/network/mac/ResourceHandleMac.mm:
2909         (WebCore::ResourceHandle::start): Schedule the connection with all the SchedulePairs
2910         that Page holds. If Page has no SchedulePairs, schedule with the current runloop, and
2911         pick the mode based on ResourceHandle::loadsDuringCommonRunLoopModes.
2912         (WebCore::ResourceHandle::schedule):
2913         (WebCore::ResourceHandle::unschedule):
2914
2915 2008-03-04  Sam Weinig  <sam@webkit.org>
2916
2917         Reviewed by Darin Adler.
2918
2919         Rename kjs_css to JSRGBColor.
2920
2921         * DerivedSources.make:
2922         * GNUmakefile.am:
2923         * WebCore.pro:
2924         * WebCore.vcproj/WebCore.vcproj:
2925         * WebCore.xcodeproj/project.pbxproj:
2926         * WebCoreSources.bkl:
2927         * bindings/js/JSRGBColor.cpp: Copied from bindings/js/kjs_css.cpp.
2928         * bindings/js/JSRGBColor.h: Copied from bindings/js/kjs_css.h.
2929         * bindings/js/kjs_css.cpp: Removed.
2930         * bindings/js/kjs_css.h: Removed.
2931         * bindings/js/kjs_window.cpp:
2932         * bindings/objc/DOMUtility.mm:
2933         * bindings/scripts/CodeGeneratorJS.pm:
2934
2935 2008-03-04  Anders Carlsson  <andersca@apple.com>
2936
2937         Fix 64-bit build.
2938         
2939         * html/HTMLPlugInElement.cpp:
2940
2941 2008-03-04  Nikolas Zimmermann  <zimmermann@kde.org>
2942
2943         Reviewed by Eric & David.
2944
2945         Fixes: http://bugs.webkit.org/show_bug.cgi?id=17078
2946
2947         Fix getSubStringLength() handling, verified by Acid3 test 77.
2948         Brings up Acid3 score to 88/100.
2949
2950         Added test: svg/custom/acid3-test-77.html
2951                     svg/custom/getSubStringLength.html
2952
2953         * svg/SVGTextContentElement.cpp:
2954         (WebCore::cummulatedCharacterRangeLength): Simplify some code.
2955         (WebCore::SVGTextContentElement::getSubStringLength):
2956
2957 2008-03-04  Anders Carlsson  <andersca@apple.com>
2958
2959         Mac build fix. Neither me, Sam nor Adam know why we need to do this though :(
2960
2961         * bindings/js/kjs_proxy.cpp:
2962         (WebCore::KJSProxy::attachDebugger):
2963         * page/Page.cpp:
2964         (WebCore::Page::setDebuggerForAllPages):
2965         (WebCore::Page::setDebugger):
2966
2967 2008-03-04  Adam Roben  <aroben@apple.com>
2968
2969         Add ExecState.h to ForwardingHeaders
2970
2971         Reviewed by Anders.
2972
2973         * ForwardingHeaders/kjs/ExecState.h: Added.
2974         * page/Page.cpp: Touch this to force WebCore to build and the headers
2975         to be copied.
2976
2977 2008-03-04  Adam Roben  <aroben@apple.com>
2978
2979         Make it possible to set a KJS::Debugger on all Frames in a Page and
2980         all Pages in the process
2981
2982         Reviewed by Kevin M.
2983
2984         * ForwardingHeaders/kjs/debugger.h: Added.
2985         * bindings/js/kjs_proxy.cpp:
2986         (WebCore::KJSProxy::initScript): Attach the Page's debugger if there
2987         is one.
2988         (WebCore::KJSProxy::attachDebugger): Attach the passed-in debugger, or
2989         detach any existing debugger if none was passed in.
2990         * bindings/js/kjs_proxy.h:
2991         * page/Page.cpp:
2992         (WebCore::Page::Page): Initialize new member.
2993         (WebCore::Page::setDebuggerForAllPages): Call setDebugger on each Page
2994         in the process.
2995         (WebCore::Page::setDebugger): Store the debugger and pass it off to
2996         all our Frames.
2997         * page/Page.h:
2998
2999 2008-03-04  Sam Weinig  <sam@webkit.org>
3000
3001         Reviewed by Darin Adler.
3002
3003         Add ClassInfo to custom constructors so that they toString properly
3004
3005         - Take this chance to remove the "Imp" from the end of JSXMLHttpRequestConstructorImp,
3006           and XSLTProcessorConstructorImp and prefix all the classes with JS. 
3007
3008         * bindings/js/JSAudioConstructor.cpp:
3009         (WebCore::): Added ClassInfo definition.
3010         (WebCore::JSAudioConstructor::JSAudioConstructor):
3011         (WebCore::JSAudioConstructor::construct): Cleanup.
3012         * bindings/js/JSAudioConstructor.h: Rename m_doc to m_document.
3013         (WebCore::JSAudioConstructor::classInfo): Added.
3014
3015         * bindings/js/JSHTMLInputElementBase.cpp: Rename HTMLInputElementBasePrototype 
3016         to JSHTMLInputElementBasePrototype as seen if toString'ed.
3017         (WebCore::):
3018
3019         * bindings/js/JSHTMLOptionElementConstructor.cpp:
3020         (WebCore::): Added ClassInfo definition.
3021         * bindings/js/JSHTMLOptionElementConstructor.h:
3022         (WebCore::JSHTMLOptionElementConstructor::classInfo): Added.
3023
3024         * bindings/js/JSImageConstructor.cpp:
3025         (WebCore::): Added ClassInfo definition.
3026         (WebCore::JSImageConstructor::implementsConstruct): Moved here from header.
3027         * bindings/js/JSImageConstructor.h:
3028         (WebCore::JSImageConstructor::classInfo): Added.
3029
3030         * bindings/js/JSXMLHttpRequest.cpp:
3031         (WebCore::): Rename XMLHttpRequestPrototype  to JSXMLHttpRequestPrototype 
3032         as seen if toString'ed.
3033         (WebCore::JSXMLHttpRequestConstructor::JSXMLHttpRequestConstructor):
3034         (WebCore::JSXMLHttpRequestConstructor::implementsConstruct):
3035         (WebCore::JSXMLHttpRequestConstructor::construct):
3036         * bindings/js/JSXMLHttpRequest.h: Renamed JSXMLHttpRequestConstructorImp to
3037         JSXMLHttpRequestConstructor and doc to m_document and 
3038         (WebCore::JSXMLHttpRequestConstructor::classInfo): Added.
3039
3040         * bindings/js/JSXSLTProcessor.cpp:
3041         (WebCore::): Renamed XSLTProcessorPrototype to JSXSLTProcessorPrototype and 
3042         XSLTProcessorConstructorImp to JSXSLTProcessorConstructor.
3043         (WebCore::JSXSLTProcessorConstructor::JSXSLTProcessorConstructor):
3044         (WebCore::JSXSLTProcessorConstructor::implementsConstruct):
3045         (WebCore::JSXSLTProcessorConstructor::construct):
3046         * bindings/js/JSXSLTProcessor.h:
3047         (WebCore::JSXSLTProcessorConstructor::classInfo): Added.
3048
3049         * bindings/js/kjs_window.cpp:
3050         (WebCore::JSDOMWindowBase::getValueProperty): Fixed to work with the new class names.
3051
3052 2008-03-04  Dan Bernstein  <mitz@apple.com>
3053
3054         Reviewed by Oliver Hunt and Geoffrey Garen.
3055
3056         - fix http://bugs.webkit.org/show_bug.cgi?id=17667
3057           <rdar://problem/5779658> REGRESSION (r30587): Document::implicitClose() not called when done loading page (Image does not get scaled to fit)
3058
3059         * loader/loader.cpp:
3060         (WebCore::Loader::didFinishLoading): Changed to call
3061         setLoadInProgress(false) even for 4xx errors, because that triggers
3062         load completion check.
3063
3064 2008-03-04  Adele Peterson  <adele@apple.com>
3065
3066         Reviewed by Beth.
3067
3068         Fix for <rdar://problem/5779718> focus() does not work for anchor elements with no content
3069
3070         If an anchor has zero size, don't exclude it from being focusable from JS, just exclude it
3071         from being keyboard focusable (using the tab key).
3072
3073         * html/HTMLAnchorElement.cpp:
3074         (WebCore::HTMLAnchorElement::isFocusable):
3075         (WebCore::HTMLAnchorElement::isKeyboardFocusable):
3076
3077 2008-03-04  Chris Fleizach  <cfleizach@apple.com>
3078
3079         Reviewed by Darin Adler.
3080
3081         - fix <rdar://problem/5119360> ER - Seed: Google results do not have AXHeading information
3082
3083         * page/mac/WebCoreAXObject.mm:
3084         (headingLevel):
3085         (-[WebCoreAXObject accessibilityIsIgnored]):
3086
3087 2008-03-04  Sam Weinig  <sam@webkit.org>
3088
3089         GTK+ build fix.
3090
3091         * GNUmakefile.am:
3092
3093 2008-03-04  Sam Weinig  <sam@webkit.org>
3094
3095         Reviewed by Darin Adler.
3096
3097         Remame ImageConstructorImp to JSImageConstructor and move it into its
3098         own file.
3099
3100         * GNUmakefile.am:
3101         * WebCore.pro:
3102         * WebCore.vcproj/WebCore.vcproj:
3103         * WebCore.xcodeproj/project.pbxproj:
3104         * WebCoreSources.bkl:
3105         * bindings/js/JSImageConstructor.cpp: Copied from bindings/js/kjs_html.cpp.
3106         (WebCore::JSImageConstructor::JSImageConstructor):
3107         (WebCore::JSImageConstructor::construct):
3108         * bindings/js/JSImageConstructor.h: Copied from bindings/js/kjs_html.h.
3109         * bindings/js/kjs_html.cpp:
3110         (WebCore::getRuntimeObject): Make this function static since it is only used
3111         in this file.
3112         * bindings/js/kjs_html.h:
3113         * bindings/js/kjs_window.cpp:
3114         (WebCore::JSDOMWindowBase::getValueProperty):
3115
3116 2008-03-04  Adam Roben  <aroben@apple.com>
3117
3118         Fix an uninitialized value warning in CodeGeneratorJS.pm
3119
3120         * bindings/scripts/CodeGeneratorJS.pm: Remove reference to
3121         non-existent $maybeOkParam (this was removed in r30753).
3122
3123 2008-03-04  Sam Weinig  <sam@webkit.org>
3124
3125         Reviewed by Darin Adler.
3126
3127         Remove kjs_dom.{h,cpp}.
3128
3129         - Removed custom toAttr, which took a boolean ok, and teach CodeGeneratorJS.pm
3130           to us a null return value as an indication of failure. (This new logic is used
3131           for toVoidCallback as well.)
3132         - Move getRuntimeObject to kjs_html where a bunch of other runtime object related
3133           functions currently live.
3134         - Move checkNodeSecurity to kjs_binding, where other frame security functions 
3135           currently live.
3136         - Remove getNodeConstructor.  It had no implementation.
3137
3138         * GNUmakefile.am:
3139         * WebCore.pro:
3140         * WebCore.vcproj/WebCore.vcproj:
3141         * WebCore.xcodeproj/project.pbxproj:
3142         * WebCoreSources.bkl:
3143         * bindings/js/JSAttrCustom.cpp:
3144         * bindings/js/JSCustomVoidCallback.cpp:
3145         (WebCore::toVoidCallback):
3146         * bindings/js/JSCustomVoidCallback.h:
3147         * bindings/js/JSDatabaseCustom.cpp:
3148         (WebCore::JSDatabase::changeVersion):
3149         (WebCore::JSDatabase::transaction):
3150         * bindings/js/JSElementCustom.cpp:
3151         (WebCore::JSElement::setAttributeNode):
3152         (WebCore::JSElement::setAttributeNodeNS):
3153         * bindings/js/JSEventTargetBase.cpp:
3154         (WebCore::toJS):
3155         * bindings/js/JSEventTargetBase.h:
3156         * bindings/js/JSHTMLAppletElementCustom.cpp:
3157         * bindings/js/JSHTMLElementCustom.cpp:
3158         * bindings/js/JSHTMLEmbedElementCustom.cpp:
3159         * bindings/js/JSHTMLFormElementCustom.cpp:
3160         * bindings/js/JSHTMLFrameElementCustom.cpp:
3161         * bindings/js/JSHTMLIFrameElementCustom.cpp:
3162         * bindings/js/JSHTMLObjectElementCustom.cpp:
3163         * bindings/js/JSNamedNodeMapCustom.cpp:
3164         * bindings/js/JSNamedNodesCollection.cpp:
3165         * bindings/js/JSNodeFilterCustom.cpp:
3166         * bindings/js/JSXSLTProcessor.cpp:
3167         * bindings/js/kjs_binding.cpp:
3168         (WebCore::checkNodeSecurity):
3169         * bindings/js/kjs_binding.h:
3170         * bindings/js/kjs_css.cpp:
3171         * bindings/js/kjs_dom.cpp: Removed.
3172         * bindings/js/kjs_dom.h: Removed.
3173         * bindings/js/kjs_events.cpp:
3174         * bindings/js/kjs_html.cpp:
3175         (WebCore::getRuntimeObject):
3176         * bindings/js/kjs_html.h:
3177         * bindings/js/kjs_window.cpp:
3178         * bindings/scripts/CodeGeneratorJS.pm:
3179         * dom/Attr.idl:
3180         * html/HTMLPlugInElement.cpp:
3181         * page/InspectorController.cpp:
3182
3183 2008-03-04  Adam Roben  <aroben@apple.com>
3184
3185         Win/Qt/GTK+/wx build fix after r30740
3186
3187         * editing/Editor.cpp: Added missing #include.
3188         * page/qt/FrameQt.cpp: Removed Frame::dashboardRegionsChanged.
3189         * page/win/FrameWin.cpp: Ditto.
3190         * platform/wx/TemporaryLinkStubs.cpp: Ditto.
3191
3192 2008-03-04  Alp Toker  <alp@atoker.com>
3193
3194         GTK+ build fix for breakage introduced in r30740.
3195
3196         Remove Frame::dashboardRegionsChanged(). There's now a default
3197         implementation at ChromeClient::dashboardRegionsChanged().
3198
3199         * page/gtk/FrameGtk.cpp:
3200
3201 2008-03-04  Alp Toker  <alp@atoker.com>
3202
3203         GTK+ build fix suggested by aroben. Remove an unused Mac-specific
3204         included introduced in r30740.
3205
3206         * page/ChromeClient.h:
3207
3208 2008-03-04  Dan Bernstein  <mitz@apple.com>
3209
3210         Reviewed by Sam Weinig.
3211
3212         - fix <rdar://problem/5622336> Burmese text does not render on http://www.myanmarbible.com/bible/Judson/html/index.html
3213
3214         Test: platform/win/fast/text/uniscribe-missing-glyph.html
3215
3216         Note that default installations of Windows do not have Myanmar fonts.
3217         What this patch does is ensure that the Myanmar and other complex
3218         scripts are rendered as missing glyphs rather than not rendered at all.
3219         The particular page in the bug measures the relative widths of two
3220         rendered strings and, if they are rendered as missing glyphs, detects
3221         that a Myanmar fonts is not available and substitutes the text with
3222         images. By not rendering (and measuring) missing glyphs, WebKit was
3223         throwing the page's detection code off.
3224
3225         * platform/graphics/win/UniscribeController.cpp:
3226         (WebCore::UniscribeController::shape): Removed an early return in case
3227         shaping resulted in missing glyphs. This is now expected if font
3228         fallback failed to produce a font containing glyphs for the character.
3229         Also changed two resize()s to shrink()s.
3230
3231 2008-03-04  Darin Adler  <darin@apple.com>
3232
3233         Reviewed by Adam.
3234
3235         - remove WebCoreFrameBridge reapplyStyles method
3236
3237         * WebCore.base.exp: Added exports.
3238         * page/mac/WebCoreFrameBridge.h: Removed WebCoreDeviceType and
3239         reapplyStylesForDeviceType: method.
3240         * page/mac/WebCoreFrameBridge.mm: Ditto.
3241
3242 2008-03-04  Darin Adler  <darin@apple.com>
3243
3244         Reviewed by Adam.
3245
3246         - eliminate WebCoreFrameBridge createFrameViewWithNSView
3247
3248         * WebCore.base.exp: Added some more exports.
3249         * page/mac/WebCoreFrameBridge.h: Deleted createFrameViewWithNSView.
3250         * page/mac/WebCoreFrameBridge.mm: Ditto.
3251
3252 2008-03-04  Darin Adler  <darin@apple.com>
3253
3254         Reviewed by Adam.
3255
3256         - removed WebCoreFrameBridge scrollOverflowInDirection
3257
3258         * WebCore.base.exp: Export function needed by WebKit.
3259         * page/mac/WebCoreFrameBridge.h: Removed WebScrollDirection, WebScrollGranularity,
3260         and scrollOverflowInDirection.
3261         * page/mac/WebCoreFrameBridge.mm: Removed method.
3262
3263 2008-03-04  Darin Adler  <darin@apple.com>
3264
3265         Reviewed by Adam.
3266
3267         - remove WebCoreFrameBridge installInFrame: method
3268
3269         * WebCore.base.exp: Export a few symbols.
3270         * WebCore.xcodeproj/project.pbxproj: Export a few files.
3271         * page/mac/WebCoreFrameBridge.h: Remove installInFrame:.
3272         * page/mac/WebCoreFrameBridge.mm: Ditto.
3273
3274 2008-03-04  Darin Adler  <darin@apple.com>
3275
3276         Reviewed by Adam.
3277
3278         - remove WebCoreFrameBridge window method
3279
3280         * page/mac/EventHandlerMac.mm:
3281         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): Get the window by calling
3282         window on the NSView instead of using the bridge. The WebKit side wasn't doing anything
3283         special, so a call to -[NSView window] is fine.
3284
3285         * page/mac/WebCoreFrameBridge.h: Removed the window method.
3286
3287 2008-03-04  Darin Adler  <darin@apple.com>
3288
3289         Reviewed by Adam.
3290
3291         - remove -[WebCoreFrameBridge dashboardRegionsChanged:]
3292
3293         * WebCore.base.exp: Updated.
3294         * page/Chrome.cpp:
3295         (WebCore::ChromeClient::dashboardRegionsChanged): Added.
3296         * page/ChromeClient.h: Added virtual function for dashboardRegionsChanged.
3297         * page/Frame.h: Removed dashboardRegionsChanged function.
3298         * page/FrameView.cpp:
3299         (WebCore::FrameView::updateDashboardRegions): Changed to call dashboardRegionsChanged
3300         on ChromeClient and to only call it when the regions actually changed.
3301         * page/mac/FrameMac.mm: Removed dashboardRegionsChanged function.
3302         * page/mac/WebCoreFrameBridge.h: Removed dashboardRegionsChanged: method.
3303
3304 2008-03-04  Darin Adler  <darin@apple.com>
3305
3306         Reviewed by Adam.
3307
3308         - remove WebCoreFrameBridge issuePasteComand method
3309
3310         * editing/Editor.cpp:
3311         (WebCore::Editor::paste): Moved the Mac-specific part of this to EditorMac.
3312         * editing/mac/EditorMac.mm:
3313         (WebCore::Editor::paste): Added. Calls paste: on the document view (normally a
3314         WebHTMLView). We should get rid of this eventually.
3315         * page/Frame.h: Removed issuePasteCommand.
3316         * page/mac/FrameMac.mm: Ditto.
3317         * page/mac/WebCoreFrameBridge.h: Ditto.
3318
3319 2008-03-04  Alexey Proskuryakov  <ap@webkit.org>
3320
3321         Suggested by Darin, rubber-stamped by Mark.
3322
3323         http://bugs.webkit.org/show_bug.cgi?id=17569
3324         REGRESSION (r30571): Buzzword.com doesn't load
3325
3326         Rolling out r30571, as determining what is wrong with it proved tricky.
3327
3328         * loader/FrameLoader.cpp:
3329         (WebCore::FrameLoader::load):
3330         (WebCore::FrameLoader::tokenizerProcessedData):
3331         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
3332
3333 2008-03-04  Sam Weinig  <sam@webkit.org>
3334
3335         Build fix.
3336
3337         * bindings/js/kjs_events.cpp:
3338
3339 2008-03-03  Sam Weinig  <sam@webkit.org>
3340
3341         Reviewed by Mark Rowe.
3342
3343         Move JSClipboard into its own file.
3344
3345         * DerivedSources.make:
3346         * GNUmakefile.am:
3347         * WebCore.pro:
3348         * WebCore.vcproj/WebCore.vcproj:
3349         * WebCore.xcodeproj/project.pbxproj:
3350         * WebCoreSources.bkl:
3351         * bindings/js/JSAttrCustom.cpp:
3352         * bindings/js/JSClipboardCustom.cpp: Added.
3353         (WebCore::JSClipboard::types):
3354         (WebCore::JSClipboard::clearData):
3355         (WebCore::JSClipboard::getData):
3356         (WebCore::JSClipboard::setData):
3357         (WebCore::JSClipboard::setDragImage):
3358         * bindings/js/JSElementCustom.cpp:
3359         * bindings/js/JSEventCustom.cpp:
3360         * bindings/js/JSHTMLFrameElementCustom.cpp:
3361         * bindings/js/JSHTMLIFrameElementCustom.cpp:
3362         * bindings/js/kjs_events.cpp:
3363         * bindings/js/kjs_events.h:
3364         * bindings/js/kjs_window.cpp:
3365         * bindings/scripts/CodeGeneratorJS.pm:
3366         * dom/Clipboard.cpp:
3367         (WebCore::Clipboard::setDropEffect):
3368         (WebCore::Clipboard::setEffectAllowed):
3369         * dom/Clipboard.idl: Added.
3370
3371 2008-03-03  Sam Weinig  <sam@webkit.org>
3372
3373         Windows build-fix.
3374
3375         * page/Chrome.cpp:
3376         * plugins/win/PluginViewWin.cpp:
3377
3378 2008-03-03  Sam Weinig  <sam@webkit.org>
3379
3380         Reviewed by Darin Adler.
3381
3382         Cleanup and plumbing in preparation for the great Window split.
3383
3384         - Rename KJS::Window to WebCore::JSDOMWindowBase.
3385         - Remove KJS::Window::retrieve() and KJS::Window::retrieveWindow() and replace
3386           with the new toJSDOMWindow().
3387         - Remove KJS::Window::retrieveActive() and replace with explicit call to 
3388           exec->dynamicGlobalObject() and toJSDOMWindow().
3389
3390         * bindings/js/JSCustomVoidCallback.cpp:
3391         (WebCore::toVoidCallback):.
3392         * bindings/js/JSCustomXPathNSResolver.cpp:
3393         (WebCore::JSCustomXPathNSResolver::create):
3394         * bindings/js/JSDatabaseCustom.cpp:
3395         (WebCore::JSDatabase::changeVersion):
3396         (WebCore::JSDatabase::transaction):
3397         * bindings/js/JSDocumentCustom.cpp:
3398         (WebCore::JSDocument::location):
3399         (WebCore::toJS):
3400         * bindings/js/JSEventTargetBase.cpp:
3401         (WebCore::jsEventTargetAddEventListener):
3402         (WebCore::jsEventTargetRemoveEventListener):
3403         * bindings/js/JSEventTargetNode.cpp:
3404         (WebCore::JSEventTargetNode::setListener):
3405         * bindings/js/JSHTMLDocumentCustom.cpp:
3406         (WebCore::JSHTMLDocument::nameGetter):
3407         (WebCore::JSHTMLDocument::open):
3408         * bindings/js/JSHTMLFrameSetElementCustom.cpp:
3409         (WebCore::JSHTMLFrameSetElement::nameGetter):
3410         * bindings/js/JSLocation.cpp:
3411         (WebCore::JSLocation::put):
3412         (WebCore::jsLocationProtoFuncReplace):
3413         (WebCore::jsLocationProtoFuncReload):
3414         (WebCore::jsLocationProtoFuncAssign):
3415         * bindings/js/JSLocation.h:
3416         * bindings/js/JSSQLTransactionCustom.cpp:
3417         (WebCore::JSSQLTransaction::executeSql):
3418         * bindings/js/JSSVGLazyEventListener.cpp:
3419         (WebCore::JSSVGLazyEventListener::JSSVGLazyEventListener):
3420         (WebCore::JSSVGLazyEventListener::eventParameterName):
3421         * bindings/js/JSSVGLazyEventListener.h:
3422         * bindings/js/JSXMLHttpRequest.cpp:
3423         (WebCore::JSXMLHttpRequest::putValueProperty):
3424         (WebCore::jsXMLHttpRequestPrototypeFunctionOpen):
3425         (WebCore::jsXMLHttpRequestPrototypeFunctionAddEventListener):
3426         (WebCore::jsXMLHttpRequestPrototypeFunctionRemoveEventListener):
3427         * bindings/js/ScheduledAction.cpp:
3428         (WebCore::ScheduledAction::execute):
3429         * bindings/js/ScheduledAction.h:
3430         * bindings/js/kjs_binding.cpp:
3431         (WebCore::allowsAccessFromFrame):
3432         (WebCore::printErrorMessageForFrame):
3433         * bindings/js/kjs_events.cpp:
3434         (WebCore::JSAbstractEventListener::handleEvent):
3435         (WebCore::JSUnprotectedEventListener::JSUnprotectedEventListener):
3436         (WebCore::JSUnprotectedEventListener::~JSUnprotectedEventListener):
3437         (WebCore::JSUnprotectedEventListener::windowObj):
3438         (WebCore::JSEventListener::JSEventListener):
3439         (WebCore::JSEventListener::~JSEventListener):
3440         (WebCore::JSEventListener::windowObj):
3441         (WebCore::JSLazyEventListener::JSLazyEventListener):
3442         (WebCore::JSLazyEventListener::parseCode):
3443         * bindings/js/kjs_events.h:
3444         * bindings/js/kjs_navigator.cpp:
3445         (WebCore::MimeType::getValueProperty):
3446         * bindings/js/kjs_proxy.cpp:
3447         (WebCore::KJSProxy::evaluate):
3448         (WebCore::KJSProxy::createHTMLEventHandler):
3449         (WebCore::KJSProxy::createSVGEventHandler):
3450         * bindings/js/kjs_window.cpp:
3451         (WebCore::JSDOMWindowBasePrivate::JSDOMWindowBasePrivate):
3452         (WebCore::DOMWindowTimer::DOMWindowTimer):
3453         (WebCore::DOMWindowTimer::action):
3454         (WebCore::DOMWindowTimer::takeAction):
3455         (WebCore::):
3456         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
3457         (WebCore::JSDOMWindowBase::~JSDOMWindowBase):
3458         (WebCore::JSDOMWindowBase::location):
3459         (WebCore::JSDOMWindowBase::mark):
3460         (WebCore::allowPopUp):
3461         (WebCore::createWindow):
3462         (WebCore::showModalDialog):
3463         (WebCore::JSDOMWindowBase::getValueProperty):
3464         (WebCore::JSDOMWindowBase::childFrameGetter):
3465         (WebCore::JSDOMWindowBase::indexGetter):
3466         (WebCore::JSDOMWindowBase::namedItemGetter):
3467         (WebCore::JSDOMWindowBase::getOwnPropertySlot):
3468         (WebCore::JSDOMWindowBase::put):
3469         (WebCore::JSDOMWindowBase::allowsAccessFrom):
3470         (WebCore::JSDOMWindowBase::allowsAccessFromNoErrorMessage):
3471         (WebCore::JSDOMWindowBase::allowsAccessFromPrivate):
3472         (WebCore::JSDOMWindowBase::crossDomainAccessErrorMessage):
3473         (WebCore::JSDOMWindowBase::printErrorMessage):
3474         (WebCore::JSDOMWindowBase::globalExec):
3475         (WebCore::JSDOMWindowBase::shouldInterruptScript):
3476         (WebCore::JSDOMWindowBase::setListener):
3477         (WebCore::JSDOMWindowBase::getListener):
3478         (WebCore::JSDOMWindowBase::findJSEventListener):
3479         (WebCore::JSDOMWindowBase::findOrCreateJSEventListener):
3480         (WebCore::JSDOMWindowBase::findJSUnprotectedEventListener):
3481         (WebCore::JSDOMWindowBase::findOrCreateJSUnprotectedEventListener):
3482         (WebCore::JSDOMWindowBase::clearHelperObjectProperties):
3483         (WebCore::JSDOMWindowBase::clear):
3484         (WebCore::JSDOMWindowBase::setCurrentEvent):
3485         (WebCore::JSDOMWindowBase::currentEvent):
3486         (WebCore::windowProtoFuncAToB):
3487         (WebCore::windowProtoFuncBToA):
3488         (WebCore::windowProtoFuncOpen):
3489         (WebCore::windowProtoFuncSetTimeout):
3490         (WebCore::windowProtoFuncClearTimeout):
3491         (WebCore::windowProtoFuncSetInterval):
3492         (WebCore::windowProtoFuncAddEventListener):
3493         (WebCore::windowProtoFuncRemoveEventListener):
3494         (WebCore::windowProtoFuncShowModalDialog):
3495         (WebCore::windowProtoFuncNotImplemented):
3496         (WebCore::JSDOMWindowBase::setReturnValueSlot):
3497         (WebCore::JSDOMWindowBase::clearAllTimeouts):
3498         (WebCore::JSDOMWindowBase::installTimeout):
3499         (WebCore::JSDOMWindowBase::pauseTimeouts):
3500         (WebCore::JSDOMWindowBase::resumeTimeouts):
3501         (WebCore::JSDOMWindowBase::clearTimeout):
3502         (WebCore::JSDOMWindowBase::timerFired):
3503         (WebCore::JSDOMWindowBase::disconnectFrame):
3504         (WebCore::JSDOMWindowBase::jsEventListeners):
3505         (WebCore::JSDOMWindowBase::jsHTMLEventListeners):
3506         (WebCore::JSDOMWindowBase::jsUnprotectedEventListeners):
3507         (WebCore::JSDOMWindowBase::jsUnprotectedHTMLEventListeners):
3508         (WebCore::toJS):
3509         (WebCore::toJSDOMWindow):
3510         (WebCore::toJSDOMWindow):
3511         * bindings/js/kjs_window.h:
3512         (WebCore::JSDOMWindowBase::impl):
3513         (WebCore::JSDOMWindowBase::classInfo):
3514         (WebCore::JSDOMWindowBase::):
3515         * bindings/objc/DOMUtility.mm:
3516         (KJS::createDOMWrapper):
3517         * bindings/scripts/CodeGeneratorJS.pm:
3518         * history/CachedPage.cpp:
3519         (WebCore::CachedPage::CachedPage):
3520         (WebCore::CachedPage::restore):
3521         * page/Chrome.cpp:
3522         (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
3523         (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
3524         * page/DOMWindow.idl:
3525         * page/Frame.cpp:
3526         (WebCore::Frame::~Frame):
3527         (WebCore::Frame::windowScriptNPObject):
3528         (WebCore::Frame::pageDestroyed):
3529         * page/InspectorController.cpp:
3530         (WebCore::inspectedWindow):
3531         * page/mac/FrameMac.mm:
3532         (WebCore::Frame::windowScriptObject):
3533         * page/mac/WebCoreFrameBridge.mm:
3534         (updateRenderingForBindings):
3535         * platform/SecurityOrigin.cpp:
3536         (WebCore::SecurityOrigin::canAccess):
3537
3538 2008-03-03  Kevin Ollivier  <kevino@theolliviers.com>
3539
3540         wx build fixes after recent Frame-related changes.
3541
3542         * platform/wx/PasteboardWx.cpp:
3543         * platform/wx/TemporaryLinkStubs.cpp:
3544
3545 2008-03-03  Dan Bernstein  <mitz@apple.com>
3546
3547         Reviewed by Darin Adler.
3548
3549         - make :first-letter apply to the first letter in normal flow, skipping
3