2008-03-19 Brady Eidson <beidson@apple.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2008-03-19  Brady Eidson  <beidson@apple.com>
2
3         Reviewed by Anders
4
5         Change SharedBuffer so the wrapping platform data aspect can be shared with all CoreFoundation platforms
6         (Mac and Windows instead of just Mac)
7
8         * WebCore.vcproj/WebCore.vcproj: Add SharedBufferCF.cpp
9         * WebCore.xcodeproj/project.pbxproj: Ditto
10
11         * platform/SharedBuffer.cpp:
12         * platform/SharedBuffer.h: Change the private c'tor from NSData to CFDataRef, other PLATFORM tweaks
13
14         * platform/cf/SharedBufferCF.cpp: Added.
15         (WebCore::SharedBuffer::SharedBuffer):
16         (WebCore::SharedBuffer::createCFData): Non-Mac version of createCFData
17         (WebCore::SharedBuffer::hasPlatformData):
18         (WebCore::SharedBuffer::platformData):
19         (WebCore::SharedBuffer::platformDataSize):
20         (WebCore::SharedBuffer::maybeTransferPlatformData):
21         (WebCore::SharedBuffer::clearPlatformData):
22
23         * platform/mac/SharedBufferMac.mm:
24         (WebCore::SharedBuffer::wrapNSData): Use the CFDataRef constructor via toll-free bridging
25         (WebCore::SharedBuffer::createCFData): Mac-specific version of createCFData
26
27 2008-03-19  Oliver Hunt  <oliver@apple.com>
28
29         Reviewed by Antti.
30
31         Bug 17954: Canvas arc() with radius of 0 throws exception
32         http://bugs.webkit.org/show_bug.cgi?id=17954
33
34         Simple fix -- use >= instead of > when validating the radius.
35
36         * html/CanvasRenderingContext2D.cpp:
37         (WebCore::CanvasRenderingContext2D::arc):
38
39 2008-03-19  Justin Garcia  <justin.garcia@apple.com>
40
41         Reviewed by Oliver.
42
43         <rdar://problem/5794920> Acid3: Assertion failure in VisiblePosition::previous when clicking on results (17004)
44         
45         The position inside an empty inline-block was a candidate, but upstream and downstream
46         would move across it without stopping.  This confused canonicalPosition, since no more
47         than two candidates should have the same upstream/downstream (be visually equivalent).
48         
49         Code was added intentionally in isCandidate to make VisiblePositions inside empty 
50         inline-blocks, so we need to make upstream/downstream understand that.
51
52         * dom/Position.cpp:
53         (WebCore::endsOfNodeAreVisuallyDistinctPositions): upstream and downstream used to only
54         stop when entering or leaving a non-inline element (referred to as a "block").  We must also 
55         avoid entering or leaving an empty inline-block.  This will allow a VisiblePosition there, to 
56         match up with what the code in isCandidate intended.
57         (WebCore::enclosingVisualBoundary): Removed enclosingBlock and replaced it with this.
58         (WebCore::Position::upstream): Added better comments, called the new functions.
59         (WebCore::Position::downstream): Ditto.
60         * dom/Position.h:
61
62 2008-03-19  Dan Bernstein  <mitz@apple.com>
63
64         Rubber-stamped by John Sullivan.
65
66         - change CSS property and value keyword constants from all-caps with
67           underscores to intra-caps.
68
69         * css/makeprop.pl:
70         * css/makevalues.pl:
71         * All files using the constants
72
73 2008-03-19  Adam Roben  <aroben@apple.com>
74
75         Make clicking anywhere in a row in the DOM tree select that row's node
76
77         We now have mousedown and dblclick event listeners on the root of the
78         tree that forward the event to the node on the row the mouse is over.
79
80         Reviewed by Tim Hatcher.
81
82         * page/inspector/DocumentPanel.js:
83         (WebInspector.DocumentPanel): Added a dblclick and mousedown event
84         listeners to the root of the tree.
85         (WebInspector.DocumentPanel._treeElementFromEvent): Added. Finds the
86         tree element for the row underneath the mouse.
87         (WebInspector.DocumentPanel._ondblclick): Added. Sends the dblclick
88         event on to the tree element in the current row.
89         (WebInspector.DocumentPanel._onmousedown): Added. Selects the tree
90         element in the current row.
91         * page/inspector/treeoutline.js:
92         (TreeOutline.treeElementFromPoint): Added.
93         (TreeElement.treeElementSelected): Changed to call
94         TreeElement.isEventWithinDisclosureTriangle, and added an early return.
95         (TreeElement.treeElementToggled): Ditto.
96         (TreeElement.isEventWithinDisclosureTriangle): Added.
97         * page/inspector/utilities.js:
98         (Node.enclosingNodeOrSelfWithNodeNameInArray): Added.
99         (Node.enclosingNodeOrSelfWithNodeName): Now just calls
100         enclosingNodeOrSelfWithNodeNameInArray.
101         (Elemnt.get totalOffsetLeft): Added.
102         (Elemnt.get totalOffsetTop): Added.
103
104 2008-03-19  Dan Bernstein  <mitz@apple.com>
105
106         Reviewed by Sam Weinig.
107
108         - fix assertion failure in RenderBlock::determineStartPosition() at http://www.wired.com/techbiz/it/magazine/16-04/bz_apple
109
110         Test: fast/repaint/line-flow-with-floats-10.html
111
112         * rendering/bidi.cpp:
113         (WebCore::RenderBlock::determineStartPosition): Removed bogus assertion.
114         If the float's top margin has changed and it has not been repositioned
115         yet, we do not have its new y position.
116
117 2008-03-19  David Hyatt  <hyatt@apple.com>
118
119         New implementation of full page zoom.  Because of how much doesn't transform when zooming, and because
120         of the need to obey viewport constraints, I decided to take a completely different approach.  Now CSS
121         lengths and intrinsic sizes are simply adjusted by the zoom factor.  This approach works much better and
122         avoids pixel cracks more than the old approach.   In addition widgets "just work", namely plugins zoom
123         and scrollbars do not.
124
125         This patch also implements the IE zoom CSS property.  This property allows fine-grained control over
126         zooming at the element level.  It takes values of normal | <number> | <percentage> to match WinIE.  In
127         addition, in the vein of text-size-adjust for text zooming, I have extended the zoom property with an
128         extra value, reset.  The reset keyword can be used to prevent a section of the page from scaling at all
129         when a zoom is applied.
130
131         Reviewed by olliej
132
133         * css/CSSComputedStyleDeclaration.cpp:
134         (WebCore::):
135         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
136         Support the new 'zoom' property for getComputedStyle.
137
138         * css/CSSParser.cpp:
139         (WebCore::CSSParser::parseValue):
140         Code that parses the 'zoom' property.
141
142         * css/CSSPrimitiveValue.cpp:
143         (WebCore::CSSPrimitiveValue::computeLengthInt):
144         (WebCore::CSSPrimitiveValue::computeLengthIntForLength):
145         (WebCore::CSSPrimitiveValue::computeLengthShort):
146         (WebCore::CSSPrimitiveValue::computeLengthFloat):
147         (WebCore::CSSPrimitiveValue::computeLengthDouble):
148         * css/CSSPrimitiveValue.h:
149         Extend all of the computeLength methods to take a multiplier so that lengths can be adjusted by the
150         zoom factor.
151
152         * css/CSSPropertyNames.in:
153         Add the new zoom property to the list of properties we understand.
154
155         * css/CSSStyleSelector.cpp:
156         (WebCore::CSSStyleSelector::applyDeclarations):
157         (WebCore::CSSStyleSelector::applyProperty):
158         (WebCore::CSSStyleSelector::mapBackgroundSize):
159         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
160         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
161         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
162         * css/CSSStyleSelector.h:
163         (WebCore::CSSStyleSelector::setStyle):
164         Pass in the zoom factor when computing all lengths in CSS.
165
166         * css/CSSValueKeywords.in:
167         Add support for the 'reset' keyword of the zoom property.
168
169         * dom/Document.cpp:
170         (WebCore::Document::recalcStyle):
171         Set the 'zoom' CSS property on the RenderView.  This is how we implement full page zoom.
172
173         * html/CanvasRenderingContext2D.cpp:
174         (WebCore::size):
175         Make sure the back end canvas size ignores zooming when rendering images.
176
177         * html/HTMLImageElement.cpp:
178         (WebCore::HTMLImageElement::width):
179         (WebCore::HTMLImageElement::height):
180         (WebCore::HTMLImageElement::naturalWidth):
181         (WebCore::HTMLImageElement::naturalHeight):
182         Use the unzoomed width/height if we have no style information in HTMLImageElement.cpp.
183
184         * loader/CachedImage.cpp:
185         (WebCore::CachedImage::ref):
186         (WebCore::CachedImage::imageSize):
187         (WebCore::CachedImage::imageRect):
188         * loader/CachedImage.h:
189         (WebCore::CachedImage::canRender):
190         Force access to the CachedImage metrics to take a multiplier so that people have to think about
191         the zoom factor.  The "intrinsic size" of the image then takes that into account.
192
193         * loader/ImageDocument.cpp:
194         (WebCore::ImageTokenizer::finish):
195         (WebCore::ImageDocument::scale):
196         (WebCore::ImageDocument::resizeImageToFit):
197         (WebCore::ImageDocument::imageChanged):
198         (WebCore::ImageDocument::restoreImageSize):
199         (WebCore::ImageDocument::imageFitsInWindow):
200         Make sure image documents respect the zoom.
201
202         * page/AnimationController.cpp:
203         (WebCore::ImplicitAnimation::animate):
204         Make the 'zoom' CSS property work with CSS transitions.
205
206         * page/Frame.h:
207         (WebCore::Frame::pageZoomFactor):
208         (WebCore::Frame::textZoomFactor):
209         Add accessors for obtaining the pageZoom vs. textZoom.
210
211         * page/FrameView.cpp:
212         (WebCore::FrameView::adjustViewSize):
213         Remove the old zoom implementation that used transforms.
214
215         * page/mac/WebCoreAXObject.mm:
216         (-[WebCoreAXObject accessibilityIsIgnored]):
217         Pass in the zoom factor.
218
219         * rendering/InlineFlowBox.cpp:
220         (WebCore::InlineFlowBox::paintBackground):
221         (WebCore::InlineFlowBox::paintBoxDecorations):
222         Pass in the zoom factor when testing for size.
223
224         * rendering/RenderBox.cpp:
225         (WebCore::RenderBox::calculateBackgroundSize):
226         (WebCore::RenderBox::imageChanged):
227         (WebCore::RenderBox::paintBackgroundExtended):
228         (WebCore::RenderBox::calcHeight):
229         * rendering/RenderFrameSet.cpp:
230         (WebCore::RenderFrameSet::layout):
231         * rendering/RenderHTMLCanvas.cpp:
232         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
233         * rendering/RenderHTMLCanvas.h:
234         (WebCore::RenderHTMLCanvas::renderName):
235         (WebCore::RenderHTMLCanvas::intrinsicSizeChanged):
236         * rendering/RenderImage.cpp:
237         (WebCore::RenderImage::setImageSizeForAltText):
238         (WebCore::RenderImage::imageChanged):
239         (WebCore::RenderImage::calcReplacedWidth):
240         (WebCore::RenderImage::calcReplacedHeight):
241         * rendering/RenderImage.h:
242         (WebCore::RenderImage::intrinsicSizeChanged):
243         * rendering/RenderListMarker.cpp:
244         (WebCore::RenderListMarker::layout):
245         (WebCore::RenderListMarker::imageChanged):
246         (WebCore::RenderListMarker::getRelativeMarkerRect):
247         * rendering/RenderObject.cpp:
248         (WebCore::RenderObject::mustRepaintBackgroundOrBorder):
249         (WebCore::RenderObject::paintBorder):
250         Pass in the zoom factor when testing for size.
251
252         * rendering/RenderReplaced.cpp:
253         (WebCore::RenderReplaced::RenderReplaced):
254         (WebCore::RenderReplaced::setStyle):
255         (WebCore::RenderReplaced::intrinsicSizeChanged):
256         * rendering/RenderReplaced.h:
257         Added a new call when the zoom factor changes, intrinsicSizeChanged().  Replaced element subclasses
258         respond to this via overrides.
259
260         * rendering/RenderStyle.cpp:
261         (WebCore::StyleVisualData::StyleVisualData):
262         (WebCore::StyleInheritedData::StyleInheritedData):
263         (WebCore::StyleInheritedData::operator==):
264         (WebCore::RenderStyle::diff):
265         * rendering/RenderStyle.h:
266         (WebCore::StyleVisualData::operator==):
267         (WebCore::RenderStyle::zoom):
268         (WebCore::RenderStyle::zoomInEffect):
269         (WebCore::RenderStyle::setZoom):
270         (WebCore::RenderStyle::setZoomInEffect):
271         (WebCore::RenderStyle::initialZoom):
272         Support for 'zoom' in the RenderStyle.  "zoomInEffect" represents the computed zoom taking into account
273         all the zooms specified on ancestors.
274
275         * rendering/RenderTableCol.cpp:
276         (WebCore::RenderTableCol::imageChanged):
277         * rendering/RenderTableRow.cpp:
278         (WebCore::RenderTableRow::imageChanged):
279         * rendering/RenderTableSection.cpp:
280         (WebCore::RenderTableSection::imageChanged):
281         * rendering/RenderVideo.h:
282         (WebCore::RenderVideo::intrinsicSizeChanged):
283         Pass in the zoom factor.
284
285         * rendering/RenderView.cpp:
286         (WebCore::RenderView::calcHeight):
287         (WebCore::RenderView::calcWidth):
288         (WebCore::RenderView::layout):
289         (WebCore::RenderView::viewHeight):
290         (WebCore::RenderView::viewWidth):
291         * rendering/RenderView.h:
292         (WebCore::RenderView::zoomFactor):
293         Back out the old implementation.
294
295 2008-03-19  Adam Roben  <aroben@apple.com>
296
297         Rename firstParent* methods to enclosingNode*
298
299         Rubberstamped by John Sullivan.
300
301         * page/inspector/ConsolePanel.js:
302         * page/inspector/DocumentPanel.js:
303         * page/inspector/NetworkPanel.js:
304         * page/inspector/inspector.js:
305         * page/inspector/utilities.js:
306
307 2008-03-19  Dan Bernstein  <mitz@apple.com>
308
309         Reviewed by John Sullivan.
310
311         - fix <rdar://problem/5805070> CrashTracer: [USER] 33 crashes in Safari at com.apple.WebCore: WebCore::FrameView::layout + 431
312
313         Test: fast/dynamic/subtree-parent-static-y.html
314
315         * rendering/RenderObject.cpp:
316         (WebCore::RenderObject::markContainingBlocksForLayout): Avoid calling
317         this method on the parent if the parent is the new layout subtree root,
318         which would result in marking all the way to the top, when it should
319         actually do nothing.
320
321 2008-03-19  Mark Rowe  <mrowe@apple.com>
322
323         Reviewed by Oliver Hunt.
324
325         Use WTF::Unicode abstraction rather than using ICU functions directly.
326
327         * html/PreloadScanner.cpp:
328         (WebCore::PreloadScanner::tokenize):
329
330 2008-03-19  Mark Rowe  <mrowe@apple.com>
331
332         Attempt to fix the Gtk build.
333
334         * platform/network/curl/ResourceHandleCurl.cpp:
335         (WebCore::ResourceHandle::setHostAllowsAnyHTTPSCertificate):
336
337 2008-03-18  Darin Adler  <darin@apple.com>
338
339         Reviewed by Maciej.
340
341         - Speed up JavaScript built-in properties by changing the
342           hash table to take advantage of the identifier objects
343
344         5% speedup for Acid3 test 26
345
346         * bindings/js/JSDOMWindowBase.cpp:
347         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Update for change to HashTable.
348         (WebCore::JSDOMWindowBase::put): Ditto.
349         * bindings/js/JSDOMWindowCustom.cpp:
350         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Ditto.
351         * bindings/js/JSHTMLInputElementBase.cpp:
352         (WebCore::JSHTMLInputElementBase::getOwnPropertySlot): Ditto.
353         * bindings/js/JSHistoryCustom.cpp:
354         (WebCore::JSHistory::customGetOwnPropertySlot): Ditto.
355         * bindings/js/JSLocation.cpp:
356         (WebCore::JSLocation::customGetOwnPropertySlot): Ditto.
357         (WebCore::JSLocation::put): Ditto.
358         * bindings/js/kjs_binding.cpp:
359         (WebCore::nonCachingStaticFunctionGetter): Ditto.
360
361         * bindings/scripts/CodeGeneratorJS.pm: Same changes as in the
362         create_hash_table script.
363
364 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
365
366         Fix the Gtk build for real this time.
367
368         * platform/network/curl/AuthenticationChallenge.h:
369
370 2008-03-18  Sam Weinig  <sam@webkit.org>
371
372         Reviewed by Anders Carlsson.
373
374         Fix for http://bugs.webkit.org/show_bug.cgi?id=17057
375         REGRESSION: Frequent random crashes in WebCore::JSNodeList::indexGetter
376         <rdar://problem/5725058>
377
378         Tests: fast/dom/NodeList/5725058-crash-scenario-1.html
379                fast/dom/NodeList/5725058-crash-scenario-2.html
380                fast/dom/NodeList/5725058-crash-scenario-3.html
381
382         * dom/ChildNodeList.cpp: 
383         (WebCore::ChildNodeList::ChildNodeList):
384         * dom/ChildNodeList.h:
385         Remove rootNodeChildrenChanged() method and fix the constructor to not 
386         pass in a needsNotifications argument to DynamicNodeList, as it no longer
387         takes one.
388
389         * dom/ClassNodeList.cpp:
390         (WebCore::ClassNodeList::ClassNodeList):
391         Don't pass the needsNotifications argument to DynamicNodeList.
392
393         * dom/ContainerNode.cpp:
394         (WebCore::ContainerNode::childrenChanged):
395         Rename call to hasNodeLists() to hasNodeListCaches().
396
397         * dom/Document.cpp:
398         (WebCore::Document::Document):
399         (WebCore::Document::~Document): Zero out the m_document variable to signify
400         to destructors down the destruction chain that this is a Document type node
401         being destructed, and thus, accessing document() is prohibited.
402         * dom/Document.h:
403         (WebCore::Document::addNodeListCache): Renamed from addNodeList.
404         (WebCore::Document::removeNodeListCache): Renamed from removeNodeList, adds assertion.
405         (WebCore::Document::hasNodeListCaches): Renamed from hasNodeListCaches.
406         Rename m_numNodeLists to m_numNodeListCaches.
407
408         * dom/DynamicNodeList.cpp:
409         (WebCore::DynamicNodeList::DynamicNodeList):
410         (WebCore::DynamicNodeList::~DynamicNodeList):
411         (WebCore::DynamicNodeList::invalidateCache):
412         (WebCore::DynamicNodeList::Caches::Caches):
413         * dom/DynamicNodeList.h:
414         (WebCore::DynamicNodeList::hasOwnCaches):
415         Remove the needsNotifications concept from DynamicNodeList, instead, manually
416         invalidate the cache for lists that own their own cache.
417
418         * dom/NameNodeList.cpp:
419         (WebCore::NameNodeList::NameNodeList):
420         * dom/NameNodeList.h:
421         Remove rootNodeAttributeChanged() method and fix the constructor to not 
422         pass in a needsNotifications argument to DynamicNodeList, as it no longer
423         takes one.
424
425         * dom/Node.cpp:
426         (WebCore::Node::~Node): Decrement the document's nodeListCache count
427         if we had a NodeListsNodeData cache and this is not the Document being
428         destructor, as tagged by a null m_document.
429         (WebCore::Node::childNodes): Increment the document's nodeListCache count 
430         if we need create the NodeListsNodeData.
431         (WebCore::Node::registerDynamicNodeList): Increment the document's nodeListCache count 
432         if we need create the NodeListsNodeData.  Change to invalidate all the caches, instead 
433         of just the ChildNodeList, if document has had no NodeListCaches.
434         (WebCore::Node::unregisterDynamicNodeList): Change to remove the cache from the m_listsWithCaches
435         set if it is owned by the NodeList and clear the m_nodeLists if it is empty.
436         (WebCore::Node::notifyLocalNodeListsAttributeChanged): Move logic to 
437         NodeListsNodeData::invalidateAttributeCaches and clear the cache pointer if it is empty.
438         (WebCore::Node::notifyLocalNodeListsChildrenChanged): Move logic to 
439         NodeListsNodeData::invalidateCaches and clear the cache pointer if it is empty.
440         (WebCore::Node::notifyNodeListsChildrenChanged): Cleanup.
441         (WebCore::Node::getElementsByName): Increment the document's nodeListCache count 
442         if we need create the NodeListsNodeData.
443         (WebCore::Node::getElementsByClassName): Increment the document's nodeListCache count 
444         if we need create the NodeListsNodeData.
445
446         (WebCore::NodeListsNodeData::invalidateCaches): Added.
447         (WebCore::NodeListsNodeData::invalidateAttributeCaches): Added.
448         (WebCore::NodeListsNodeData::isEmpty): Added.
449
450         * dom/TagNodeList.cpp:
451         (WebCore::TagNodeList::TagNodeList):
452         Don't pass the needsNotifications argument to DynamicNodeList.
453
454 2008-03-18  Matt Lilek  <webkit@mattlilek.com>
455
456         Not reviewed, build fix.
457
458         * platform/network/curl/AuthenticationChallenge.h:
459
460 2008-03-18  Brent Fulgham  <bfulgham@gmail.com>
461
462         Reviewed by Adam Roben.
463
464         Provide some stub implementations for things that WebKit
465         uses for performing authentication/challenge activities.  This
466         is in support of http://bugs.webkit.org/show_bug.cgi?id=17837
467
468         * platform/network/ResourceHandle.h:
469         * platform/network/curl/AuthenticationChallenge.h:
470         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
471         (WebCore::AuthenticationChallenge::sourceHandle):
472
473 2008-03-18  Eric Seidel  <eric@webkit.org>
474
475         Reviewed by Oliver.
476
477         Fix SVGImage crash seen once, and obvious via code inspection.
478         
479         I was not able to find a test case for this.
480
481         * svg/graphics/SVGImage.cpp:
482         (WebCore::SVGImage::setContainerSize):
483         (WebCore::SVGImage::usesContainerSize):
484         (WebCore::SVGImage::hasRelativeWidth):
485         (WebCore::SVGImage::hasRelativeHeight):
486
487 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
488
489         Fix Qt build after r31123.
490
491         Add PluginView methods to TemporaryLinkStubs.
492
493         * platform/qt/TemporaryLinkStubs.cpp:
494
495 2008-03-18  Sam Weinig  <sam@webkit.org>
496
497         Reviewed by Darin Adler.
498
499         - Speed up JavaScript prototype and constructor object creation
500           using a static Identifier in the self() methods to avoid the
501           cost of creating one from a c-string each time.
502
503         5% speedup for Acid3 test 26
504
505         * bindings/scripts/CodeGeneratorJS.pm:
506
507 2008-03-18  Antti Koivisto  <antti@apple.com>
508
509         Reviewed by Mark Rowe.
510
511         Enable preloading for other platforms besides Mac.
512
513         * GNUmakefile.am:
514         * WebCore.pro:
515         * WebCore.vcproj/WebCore.vcproj:
516         * WebCoreSources.bkl:
517         * html/HTMLTokenizer.cpp:
518         * html/HTMLTokenizer.h:
519         * html/PreloadScanner.cpp:
520         (WebCore::PreloadScanner::tokenize):
521
522 2008-03-18  Dan Bernstein  <mitz@apple.com>
523
524         Reviewed by Adele Peterson.
525
526         - fix <rdar://problem/5805127> REGRESSION (r31116): Assertion failure (floatIndex < floats.size()) in RenderBlock::determineStartPosition() at digg.com
527
528         Test: fast/dynamic/floating-to-positioned.html
529
530         * rendering/RenderObject.cpp:
531         (WebCore::RenderObject::setStyle): Added code to remove a float from
532         object lists if its position property changes to something other than
533         static, since then it ceases to be a float.
534
535 2008-03-18  Adam Roben  <aroben@apple.com>
536
537         Windows build fix after r31123
538
539         * plugins/win/PluginViewWin.cpp: Add back MozillaUserAgent.
540
541 2008-03-18  Dan Bernstein  <mitz@apple.com>
542
543         Reviewed by Darin Adler.
544
545         - eliminate RenderFlow::m_clear
546
547         * rendering/RenderBlock.cpp:
548         (WebCore::RenderBlock::layoutBlock): Removed code to set m_clear.
549         (WebCore::RenderBlock::newLine): Added a 'clear' parameter.
550         * rendering/RenderBlock.h:
551         * rendering/RenderFlow.h:
552         (WebCore::RenderFlow::RenderFlow): Removed initialization of m_clear.
553         * rendering/bidi.cpp:
554         (WebCore::RenderBlock::layoutInlineChildren): Added a local 'clear'
555         variable, passing a pointer to it to findNextLineBreak() and its value
556         to newLine(). 
557         (WebCore::RenderBlock::findNextLineBreak): Added a 'clear' parameter,
558         which this method adjusts when it encounters a <br>.
559
560 2008-03-18  Simon Hausmann  <hausmann@webkit.org>
561
562         Reviewed by Holger.
563
564         Fix the Qt build and clean up the invoke mechanism for dispatching
565         functions in the main thread by using QMetaObject::invokeMethod
566         instead of posting a null event.
567
568         * platform/qt/MainThreadQt.cpp:
569
570 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
571
572         Fix Mac build from commit of r31123.
573
574         Add a typedef for NSView* to PlatformWidget, remove duplicate PluginMessageThrottlerWin definition.
575
576         * platform/Widget.h:
577         * WebCore.vcproj/WebCore.vcproj:
578
579 2008-03-18  Rodney Dawes  <dobey@wayofthemonkey.com>
580
581         Reviewed by Jon Honeycutt.
582
583         Add PluginView.cpp and npapi.cpp to build files.
584         Copy win/PluginViewWin.cpp to PluginView.cpp for shared code.
585         Split Windows specific code out of PluginView.cpp.
586         Add #if USE(NPOBJECT) around dependant code.
587         Use npruntime_internal.h instead of npapi.h.
588         Add PlatformWidget typedef to Widget.h.
589         Update WidgetGtk.cpp for the PlatformWidget usage.
590         Add needed methods to TemporaryLinkStubs for GTK+ port.
591
592         * GNUmakefile.am:
593         * WebCore.pro:
594         * WebCoreSources.bkl:
595         * WebCore.vcproj/WebCore.vcproj:
596         * plugins/win/PluginViewWin.cpp:
597         * plugins/PluginView.cpp:
598         * plugins/PluginView.h:
599         * plugins/npapi.cpp:
600         * platform/Widget.h:
601         * platform/gtk/WidgetGtk.cpp:
602         * platform/gtk/TemporaryLinkStubs.cpp:
603
604 2008-03-17  Darin Adler  <darin@apple.com>
605
606         Reviewed by Maciej.
607
608         - speed up document property fetching (eliminate the AtomicString
609           objects made during document property lookup)
610
611         3% speedup for Acid3 test 26
612
613         * bindings/js/JSDOMWindowBase.cpp:
614         (WebCore::JSDOMWindowBase::getOwnPropertySlot): Use AtomicString::find to
615         locate the AtomicString, only if already present. Also call the new faster
616         versions of the hasNamedItem and hasElementWithId functions that don't
617         ref/deref the AtomicStringImpl, get inlined, etc.
618         * bindings/js/JSHTMLDocumentCustom.cpp:
619         (WebCore::JSHTMLDocument::canGetItemsForName): Ditto.
620         (WebCore::writeHelper): Use a Vector instead of a String to build up
621         the string to avoid the bad performance of string append.
622
623         * dom/Document.cpp: Tweaked code and comments a bit. Nothing substantive.
624         * dom/Document.h: Added new hasElementWithId function that's faster than
625         getElementById because it doesn't ref/deref the AtomicStringImpl*, gets
626         inlined, doesn't have to handle the 0 case, and doesn't try to return the
627         element pointer (just a boolean).
628
629         * html/HTMLAppletElement.cpp:
630         (WebCore::HTMLAppletElement::parseMappedAttribute): Use AtomicString
631         consistently. Also renamed the data member for clarity.
632         (WebCore::HTMLAppletElement::insertedIntoDocument): Ditto.
633         (WebCore::HTMLAppletElement::removedFromDocument): Ditto.
634         * html/HTMLAppletElement.h: Ditto.
635
636         * html/HTMLDocument.cpp:
637         (WebCore::addItemToMap): Use AtomicString instead of String.
638         (WebCore::removeItemFromMap): Ditto.
639         (WebCore::HTMLDocument::addNamedItem): Updated for member name change.
640         (WebCore::HTMLDocument::removeNamedItem): Ditto.
641         (WebCore::HTMLDocument::addExtraNamedItem): Ditto.
642         (WebCore::HTMLDocument::removeExtraNamedItem): Ditto.
643         (WebCore::HTMLDocument::clear): Added. Moved code here from the JavaScript
644         bindings. If we're going to have an empty placeholder function, there's no
645         reason to have it in the bindings instead of here.
646         * html/HTMLDocument.h: Added clear. Changed the named item function
647         arguments to AtomicString insted of String. Changed the NameCountMap to
648         use AtomicStringImpl* instead of StringImpl*. Renamed the data members
649         to add a m_ prefix and remove the needless doc prefix. Added hasNamedItem
650         and hasExtraNamedItem functions that are inlined and faster than the old
651         idiom because they doesn't ref/deref the AtomicStringImpl*, get inlined,
652         and don't have to handle the 0 case.
653         * html/HTMLDocument.idl: Removed the [Custom] attribute on clear and took
654         it out of the JavaScript-specific section.
655
656         * html/HTMLEmbedElement.cpp:
657         (WebCore::HTMLEmbedElement::parseMappedAttribute): Use AtomicString
658         consistently. Also renamed the data member for clarity.
659         (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
660         (WebCore::HTMLEmbedElement::removedFromDocument): Ditto.
661         * html/HTMLFormElement.cpp:
662         (WebCore::HTMLFormElement::insertedIntoDocument): Ditto.
663         (WebCore::HTMLFormElement::removedFromDocument): Ditto.
664         (WebCore::HTMLFormElement::parseMappedAttribute): Ditto.
665         * html/HTMLFormElement.h: Ditto.
666
667         * html/HTMLFrameElementBase.cpp:
668         (WebCore::HTMLFrameElementBase::openURL): Renamed m_name to m_frameName for
669         clarity, since the frame name is not the same as the name attribute.
670         (WebCore::HTMLFrameElementBase::parseMappedAttribute): Ditto.
671         (WebCore::HTMLFrameElementBase::setNameAndOpenURL): Ditto.
672         * html/HTMLFrameElementBase.h: Ditto.
673
674         * html/HTMLIFrameElement.cpp:
675         (WebCore::HTMLIFrameElement::parseMappedAttribute): Use AtomicString
676         consistently. Also renamed the data member for clarity.
677         (WebCore::HTMLIFrameElement::insertedIntoDocument): Ditto.
678         (WebCore::HTMLIFrameElement::removedFromDocument): Ditto.
679         * html/HTMLIFrameElement.h: Ditto.
680         * html/HTMLImageElement.cpp:
681         (WebCore::HTMLImageElement::parseMappedAttribute): Ditto.
682         (WebCore::HTMLImageElement::insertedIntoDocument): Ditto.
683         (WebCore::HTMLImageElement::removedFromDocument): Ditto.
684         * html/HTMLImageElement.h: Ditto.
685         * html/HTMLObjectElement.cpp:
686         (WebCore::HTMLObjectElement::parseMappedAttribute): Ditto.
687         (WebCore::HTMLObjectElement::insertedIntoDocument): Ditto.
688         (WebCore::HTMLObjectElement::removedFromDocument): Ditto.
689         (WebCore::HTMLObjectElement::updateDocNamedItem): Ditto.
690         * html/HTMLObjectElement.h: Ditto.
691
692         * html/HTMLParamElement.cpp:
693         (WebCore::HTMLParamElement::isURLAttribute): Use equalIgnoringCase instead
694         of callling lower().
695
696         * html/HTMLPlugInElement.h: Changed the type of m_name. The code that
697         uses this is in HTMLAppletElement, HTMLEmbedElement, and HTMLObjectElement.
698
699         * platform/text/AtomicString.cpp:
700         (WebCore::equal): Moved to an inline so we can share this code between a
701         few different functions. It could move to a header too if we want to use
702         it elsewhere.
703         (WebCore::UCharBufferTranslator::equal): Change to use inline.
704         (WebCore::HashAndCharactersTranslator::hash): Added.
705         (WebCore::HashAndCharactersTranslator::equal): Added.
706         (WebCore::HashAndCharactersTranslator::translate): Added.
707         (WebCore::AtomicString::add): Improved the Identifier and UString overloads
708         to use the already-computed hash code instead of rehashing the string.
709         (WebCore::AtomicString::find): Added.
710         * platform/text/AtomicString.h: Added a find function so we can avoid
711         allocating memory just to look up a string in an atomic string set or map.
712
713         * platform/text/StringImpl.h: Added declarations needed for the
714         AtomicString changes.
715
716 2008-03-17  Timothy Hatcher  <timothy@apple.com>
717
718         Reviewed by Mark Rowe.
719
720         Bug 17908: Various bugs in the Console completion code
721         http://bugs.webkit.org/show_bug.cgi?id=17908
722
723         * page/inspector/ConsolePanel.js:
724         (WebInspector.ConsolePanel.complete): Moved the code that checked for the caret being at the end
725         of the prompt into the _caretAtEndOfPrompt helper function.
726         (WebInspector.ConsolePanel.messagesSelectStart): Clear and redo the auto complete when the selection changes.
727         (WebInspector.ConsolePanel._caretInsidePrompt): Fixed a logic error that always caused a false result.
728         (WebInspector.ConsolePanel._caretAtEndOfPrompt): Added. Tests if the selection is a caret at the
729         end of the prompt.
730         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Changed the offset to use the childNodes length.
731         This makes sure the caret is at the end when there are multiple text nodes in the prompt.
732
733 2008-03-17  Dan Bernstein  <mitz@apple.com>
734
735         Rubber-stamped by Dave Hyatt.
736
737         - FloatingObject cleanup
738
739         Renamed FloatingObject's data members as follows: node -> m_renderer,
740         startY -> m_top, endY -> m_bottom, left -> m_left, width -> m_width,
741         and noPaint -> !m_shouldPaint, reversing the meaning of the flag.
742
743         Also addressed the FIXME in RenderBlock::containsFloat().
744
745         * rendering/RenderBlock.cpp:
746         (WebCore::RenderBlock::repaintOverhangingFloats):
747         (WebCore::RenderBlock::paintFloats):
748         (WebCore::RenderBlock::insertFloatingObject):
749         (WebCore::RenderBlock::removeFloatingObject):
750         (WebCore::RenderBlock::positionNewFloats):
751         (WebCore::RenderBlock::leftRelOffset):
752         (WebCore::RenderBlock::rightRelOffset):
753         (WebCore::RenderBlock::nextFloatBottomBelow):
754         (WebCore::RenderBlock::floatBottom):
755         (WebCore::RenderBlock::floatRect):
756         (WebCore::RenderBlock::lowestPosition):
757         (WebCore::RenderBlock::rightmostPosition):
758         (WebCore::RenderBlock::leftmostPosition):
759         (WebCore::RenderBlock::leftBottom):
760         (WebCore::RenderBlock::rightBottom):
761         (WebCore::RenderBlock::clearFloats):
762         (WebCore::RenderBlock::addOverhangingFloats):
763         (WebCore::RenderBlock::addIntrudingFloats):
764         (WebCore::RenderBlock::containsFloat): Changed to return false if the
765         floats lists exists but is empty, since line layout code no longer
766         relies on the buggy behavior.
767         (WebCore::RenderBlock::nodeAtPoint):
768         (WebCore::RenderBlock::adjustForBorderFit):
769         * rendering/RenderBlock.h:
770         (WebCore::RenderBlock::containsFloats):
771         (WebCore::RenderBlock::FloatingObject::FloatingObject):
772         * rendering/bidi.cpp:
773         (WebCore::RenderBlock::layoutInlineChildren):
774         (WebCore::RenderBlock::matchedEndLine):
775
776 2008-03-17  Dan Bernstein  <mitz@apple.com>
777
778         Reviewed by Dave Hyatt.
779
780         - allow incremental relayout of blocks that contain floats
781
782         Tests: fast/repaint/line-flow-with-floats-[1-9].html
783
784         * rendering/RenderBlock.cpp:
785         (WebCore::RenderBlock::clearFloatsIfNeeded): Cleaned up by moving most
786         of the function body out of an if statement which was replaced with an
787         early return.
788         (WebCore::RenderBlock::insertFloatingObject): Cleaned up by moving most
789         of the function body out of an if statement and moving the ASSERT, which
790         is a crash in release builds, to the beginning. Made this function set
791         the m_isDescendant flag of floating objects it creates.
792         (WebCore::RenderBlock::removeFloatingObject): Added a call to
793         markLinesDirtyInVerticalRange() when removing a float from a block with
794         inline children.
795         (WebCore::RenderBlock::markLinesDirtyInVerticalRange): Added. Marks the
796         lines in the given range as dirty.
797         (WebCore::RenderBlock::clearFloats): Added code to detect changes to
798         the geometry of floats intruding into this block from other blocks and
799         mark any lines whose available width has changed as a result as dirty.
800
801         * rendering/RenderBlock.h:
802         (WebCore::RenderBlock::FloatWithRect::FloatWithRect): Added a structure
803         to cache a float with its position and size.
804         (WebCore::RenderBlock::FloatingObject::FloatingObject): Added an
805         m_isDescendant flag, used by clearFloats() to distinguish between floats
806         entering the block from outside and floats internal to the block.
807
808         * rendering/RootInlineBox.h:
809         (WebCore::RootInlineBox::floats): Added.
810         (WebCore::RootInlineBox::floatsPtr): Added.
811         (WebCore::RootInlineBox::Overflow::Overflow): Added a data member to
812         hold the floats originating on the line.
813
814         * rendering/bidi.cpp:
815         (WebCore::RenderBlock::layoutInlineChildren): Made the existence of
816         floats not force a full layout. Changed to cache the geometry of floats
817         in the block and detect changes to it. If a float's size or position
818         changes, all lines from that point on are treated as dirty. An exception
819         is a change in the dimensions of a float on an otherwise-clean line,
820         which only dirties lines potentially affected by the change (see
821         determineStartPosition()). Added code to update each RootInlineBox's
822         set of floats as lines are laid out. Added code to shift floats
823         belonging to clean lines in the end along with the lines.
824         (WebCore::RenderBlock::determineStartPosition): Made this function look
825         for changes to floats' dimensions and mark lines as dirty accordingly.
826         Also look for new floats and if found, cause a full layout. Added code
827         to re-add floats belonging to clean lines.
828         (WebCore::RenderBlock::matchedEndLine): Added checking that the clean
829         lines in the end can be shifted vertically as needed, i.e. that the
830         available width along the way is uniform.
831
832 2008-03-17  Eric Seidel  <eric@webkit.org>
833
834         Reviewed by darin.
835
836         Fix _NPN_IntFromIdentifier (and export the symbol for use!)
837
838         Test: plugins/netscape-identifier-conversion.html
839
840         * WebCore.NPAPI.exp:
841         * bridge/npruntime.cpp:
842         (_NPN_IntFromIdentifier):
843
844 2008-03-17  Sam Weinig  <sam@webkit.org>
845
846         Reviewed by Dan Bernstein.
847
848         Add HTMLCollection constructor to the Window object. (Omission noticed by Harri Porten)
849
850         * page/DOMWindow.idl: 
851
852 2008-03-17  Holger Hans Peter Freyther  <zecke@selfish.org>
853
854         Unreviewed Gtk+ build fix.
855
856         * platform/gtk/ScrollViewGtk.cpp: remove const
857
858 2008-03-17  Julien Chaffraix  <julien.chaffraix@gmail.com>
859
860         Reviewed by Holger.
861
862         <http://bugs.webkit.org/show_bug.cgi?id=17754>
863
864         - Implement ResourceHandle::loadResourceSynchronously to dispatch synchronous
865           requests.
866
867         - Implement WebCoreSynchronousLoader, the ResourceHandleClient which holds
868           the network data, response and error for us during the transfert.
869
870         * platform/network/ResourceHandleInternal.h: Remove trailing white space.
871         * platform/network/curl/ResourceHandleCurl.cpp: Add WebCoreSynchronousLoader
872         (WebCore::WebCoreSynchronousLoader::resourceResponse):
873         (WebCore::WebCoreSynchronousLoader::resourceError):
874         (WebCore::WebCoreSynchronousLoader::data):
875         (WebCore::WebCoreSynchronousLoader::WebCoreSynchronousLoader):
876         (WebCore::WebCoreSynchronousLoader::didReceiveResponse):
877         (WebCore::WebCoreSynchronousLoader::didReceiveData):
878         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
879         (WebCore::WebCoreSynchronousLoader::didFail):
880         (WebCore::ResourceHandle::loadResourceSynchronously): Implement method
881         using WebCoreSynchronousLoader.
882
883         * platform/network/curl/ResourceHandleManager.cpp:
884         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
885         (WebCore::ResourceHandleManager::startJob):
886         (WebCore::ResourceHandleManager::initializeHandle): Handle initialization
887         method used both for synchronous and asynchronous job.
888
889         * platform/network/curl/ResourceHandleManager.h:
890
891 2008-03-17  Darin Adler  <darin@apple.com>
892
893         - try to fix GTK build
894
895         * platform/ScrollView.h: Make setGtkAdjustments adjustment.
896         And non-virtual (why was it virtual?).
897
898 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
899
900         Fix Bug 17898: Split PluginMessageThrottlerWin into its own files
901
902         <http://bugs.webkit.org/show_bug.cgi?id=17898>
903
904         Move the PluginMessageThrottlerWin class into its own files, in
905         preparation for refactoring PluginView code to be shared.
906
907         Reviewed and tweaked by Adam Roben.
908
909         * WebCore.vcproj/WebCore.vcproj:
910         * plugins/PluginView.h:
911         * plugins/win/PluginMessageThrottlerWin.cpp: Added.
912         * plugins/win/PluginMessageThrottlerWin.h: Added.
913         * plugins/win/PluginViewWin.cpp:
914
915 2008-03-17  Adam Roben  <aroben@apple.com>
916
917         More Windows build fixes after r31098
918
919         * platform/ScrollView.h: Make some more methods public.
920
921 2008-03-17  Adam Roben  <aroben@apple.com>
922
923         Windows and Qt build fixes after r31098
924
925         * platform/ScrollView.h: Mark methods public that still need to be so.
926
927 2008-03-16  Timothy Hatcher  <timothy@apple.com>
928
929         Reviewed by Darin Adler.
930
931         Bug 17883: Console completion should support bracket notation
932         http://bugs.webkit.org/show_bug.cgi?id=17883
933
934         Also fixes a bug where the Inspector's window object was used instead of the
935         inspected window object.
936
937         * page/inspector/ConsolePanel.js:
938         (WebInspector.ConsolePanel.complete): Add a comment about the _backwardsRange call.
939         (WebInspector.ConsolePanel.completions): Add a comment about the _backwardsRange call.
940         Check the last character of the expression for a dot or bracket. Fallback
941         to the InspectorController.inspectedWindow() instead of window, this was a bad bug.
942         If the expression caused an exception, just consider the prefix a window property.
943         When bracket notation is used remember what quote was used and compared property names
944         with that quote surrounding it. Also escape the property name for the quote and backslash.
945
946 2008-03-17  Robert Blaut  <webkit@blaut.biz>
947
948         Reviewed by Darin.
949
950         Fix for bug http://bugs.webkit.org/show_bug.cgi?id=17696
951         Set default margin-bottom for form element in quirk mode
952         and be compatible with Gecko.
953
954         Tests: fast/css/margin-bottom-form-element-quirk.html
955                fast/css/margin-bottom-form-element-strict.html
956
957         * css/html4.css:
958         * css/quirks.css:
959
960 2008-03-17  Antti Koivisto  <antti@apple.com>
961
962         Reviewed by Darin.
963
964         Speculative fix for http://bugs.webkit.org/show_bug.cgi?id=17878
965         Bug 17878: REGRESSION: Acid3 sometimes crashes Webkit under WebCore::Loader::Host::cancelRequests
966         
967         I can't reproduce the crash or make a test case for this one but I'm pretty sure this
968         is the problem. Essentially the same bug as http://bugs.webkit.org/show_bug.cgi?id=17862
969         except in didFail() instead of didFinishLoading().
970
971         * loader/loader.cpp:
972         (WebCore::Loader::Host::didFail):
973
974 2008-03-17  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
975
976         Reviewed and tweaked by Darin.
977
978         http://bugs.webkit.org/show_bug.cgi?id=17172
979         Refactor platform checks in ScrollView.h
980
981         * platform/ScrollView.h: Change #ifs around.
982
983 2008-03-17  Yuzhu Shen  <yuzhu.shen@gmail.com>
984
985         Reviewed by Darin.
986
987         Fix the bug: http://bugs.webkit.org/show_bug.cgi?id=17760
988         It is necessary to load the image even when src="".
989
990         Test: fast/images/load-img-with-empty-src.html
991
992         * html/HTMLImageLoader.cpp:
993         (WebCore::HTMLImageLoader::updateFromElement): isNull rather than isEmpty.
994
995 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
996
997         Fix GTK+ build from r31094.
998
999         * plugins/gtk/PluginDatabaseGtk.cpp:
1000         (PluginDatabase::getPluginsInPaths):
1001
1002 2008-03-17  Adam Roben  <aroben@apple.com>
1003
1004         Fix Bug 17876: REGRESSION (r31060): Attempting to visit Ofcom page causes crash
1005
1006         <http://bugs.webkit.org/show_bug.cgi?id=17876>
1007
1008         Reviewed by John.
1009
1010         Test: fast/dom/remove-named-attribute-crash.html
1011
1012         * dom/NamedAttrMap.cpp:
1013         (WebCore::NamedAttrMap::removeAttribute): Store the Attribute we're
1014         going to remove from the m_attributes Vector in a RefPtr so it doesn't
1015         get deleted when it is removed from the Vector.
1016
1017 2008-03-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1018
1019         Reviewed by Adam Roben.
1020
1021         Implement PluginDatabase for GTK+ with PluginDatabaseGtk.cpp.
1022         Remove implemented methods from TemporaryLinkStubs.
1023
1024         * GNUmakefile.am:
1025         * plugins/gtk:
1026         * plugins/gtk/PluginDatabaseGtk.cpp:
1027         * platform/gtk/TemporaryLinkStubs.cpp:
1028
1029 2008-03-17  Simon Hausmann  <hausmann@webkit.org>
1030
1031         Fix the Qt build.
1032
1033         * platform/text/qt/TextCodecQt.cpp:
1034         (WebCore::TextCodecQt::encode):
1035         * platform/text/qt/TextCodecQt.h:
1036
1037 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1038
1039         Not reviewed, just fixing an incomplete comment from the last commit.
1040
1041         * dom/Range.cpp:
1042         (WebCore::Range::surroundContents):
1043
1044 2008-03-16  Maciej Stachowiak  <mjs@apple.com>
1045
1046         Reviewed by Darin.
1047
1048         - fixed "Acid3 expects different exceptions for surroundContents calls involving comment nodes (affects Acid3 test 11)"
1049         http://bugs.webkit.org/show_bug.cgi?id=17509
1050         
1051         This gets us to 92/100
1052
1053         * dom/Range.cpp:
1054         (WebCore::Range::surroundContents): Check for
1055         HIERARCHY_REQUEST_ERR before BAD_BOUNDARYPOINTS_ERR, since Acid3
1056         expects exceptional conditions to be tested in the order that the
1057         spec lists them. Also, adjust the HIERARCHY_REQUEST_ERR check. If
1058         the start point of the range is in a comment node, the node that
1059         would be the parent of a partial replacement is actually the
1060         comment node's parent (since comment nodes have character
1061         indices), so we should do the HIERARCHY_REQUEST_ERR check based on
1062         the parent of the comment node, as for text nodes, even though it
1063         will fail later with a different exception because it is not
1064         allowed to surround a partially selected non-text node.
1065
1066 2008-03-16  Marvin Decker  <marv.decker@gmail.com>
1067
1068         Reviewed by Darin.
1069
1070         Fix bug 15119: URL query characters that are unencodable in the
1071         request's character set should be converted to XML entities with
1072         non-alphanumeric characters escaped.
1073
1074         Test: http/tests/uri/escaped-entity.html
1075
1076         * html/FormDataList.cpp:
1077         (WebCore::FormDataList::appendString):
1078         * html/HTMLFormElement.cpp:
1079         (WebCore::HTMLFormElement::formData):
1080         * platform/KURL.cpp:
1081         (WebCore::encodeRelativeString):
1082         * platform/text/String.cpp:
1083         (WebCore::String::latin1):
1084         (WebCore::String::utf8):
1085         * platform/text/TextCodec.cpp:
1086         (WebCore::TextCodec::unencodableCharReplacement):
1087         * platform/text/TextCodec.h:
1088         (WebCore::):
1089         * platform/text/TextCodecICU.cpp:
1090         (WebCore::urlEscapedEntityCallback):
1091         (WebCore::gbkUrlEscapedEntityCallack):
1092         (WebCore::TextCodecICU::encode):
1093         * platform/text/TextCodecICU.h:
1094         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
1095         * platform/text/TextCodecLatin1.cpp:
1096         (WebCore::encodeComplexWindowsLatin1):
1097         (WebCore::TextCodecLatin1::encode):
1098         * platform/text/TextCodecLatin1.h:
1099         * platform/text/TextCodecUTF16.cpp:
1100         (WebCore::TextCodecUTF16::encode):
1101         * platform/text/TextCodecUTF16.h:
1102         * platform/text/TextCodecUserDefined.cpp:
1103         (WebCore::encodeComplexUserDefined):
1104         (WebCore::TextCodecUserDefined::encode):
1105         * platform/text/TextCodecUserDefined.h:
1106         * platform/text/TextEncoding.cpp:
1107         (WebCore::TextEncoding::encode):
1108         * platform/text/TextEncoding.h:
1109         * platform/text/mac/TextCodecMac.cpp:
1110         (WebCore::TextCodecMac::encode):
1111         * platform/text/mac/TextCodecMac.h:
1112         * xml/XMLHttpRequest.cpp:
1113         (WebCore::XMLHttpRequest::send):
1114
1115 2008-03-16  Kevin Ollivier  <kevino@theolliviers.com>
1116
1117         Rubber stamped by Darin.
1118
1119         Add set-webkit-configuration support for wx port, and centralize
1120         build dir location setting.
1121
1122         http://bugs.webkit.org/show_bug.cgi?id=17790
1123
1124         * webcore-base.bkl:
1125
1126 2008-03-16  Darin Adler  <darin@apple.com>
1127
1128         Reviewed by Mark Rowe.
1129
1130         - http://bugs.webkit.org/show_bug.cgi?id=17881
1131           a little cleanup for HTMLTextAreaElement
1132
1133         Tests: fast/forms/textarea-default-value-leading-newline.html
1134                fast/forms/textarea-linewrap-dynamic.html
1135
1136         * html/HTMLTextAreaElement.cpp:
1137         (WebCore::HTMLTextAreaElement::HTMLTextAreaElement): Tweaked names/
1138         (WebCore::HTMLTextAreaElement::selectionStart): Ditto, also use early return
1139         and check for < 0 rather than -1 specifically.
1140         (WebCore::HTMLTextAreaElement::selectionEnd): Ditto.
1141         (WebCore::HTMLTextAreaElement::setSelectionStart): Early return.
1142         (WebCore::HTMLTextAreaElement::setSelectionEnd): Ditto.
1143         (WebCore::HTMLTextAreaElement::select): Ditto.
1144         (WebCore::HTMLTextAreaElement::setSelectionRange): Ditto.
1145         (WebCore::HTMLTextAreaElement::parseMappedAttribute): Changed value parsing
1146         to treat unknown values as meaning "default" rather than "leave value as-is".
1147         Only call setNeedsLayoutAndPrefWidthsRecalc when mode changed.
1148         (WebCore::HTMLTextAreaElement::createRenderer): Removed name of unused argument.
1149         (WebCore::HTMLTextAreaElement::appendFormData): Updated for name changes.
1150         (WebCore::HTMLTextAreaElement::isKeyboardFocusable): Got rid of unnneeded explicit
1151         class name in isFocusable call.
1152         (WebCore::HTMLTextAreaElement::isMouseFocusable): Ditto.
1153         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Tweaked formatting.
1154         (WebCore::HTMLTextAreaElement::defaultEventHandler): Ditto.
1155         (WebCore::HTMLTextAreaElement::updateValue): Early return.
1156         (WebCore::HTMLTextAreaElement::setValue): Got rid of intermediate value to
1157         eliminate on small refcount churn.
1158         (WebCore::HTMLTextAreaElement::defaultValue): Got rid of unneeded redundant
1159         string length checks, since String already checks all indexing and returns 0.
1160         (WebCore::HTMLTextAreaElement::setDefaultValue): Added code to normalize
1161         line endings and add a leading line ending to fix cases where the first
1162         character is a newline.
1163         (WebCore::HTMLTextAreaElement::accessKeyAction): Removed name of unused arg.
1164         (WebCore::HTMLTextAreaElement::accessKey): Changed return value to avoid
1165         refcount churn.
1166         (WebCore::HTMLTextAreaElement::selection): Updated names and use < 0 instead
1167         of -1 specifically.
1168
1169         * html/HTMLTextAreaElement.h: Replaced wrap function with more-specific
1170         shouldWrapText one. Changed return value of accessKey. Made WrapMethod enum
1171         provate and renamed the values. Renamed cachedSelStart and cachedSelEnd to
1172         m_cachedSelectionStart and m_cachedSelectionEnd.
1173
1174         * rendering/RenderTextControl.cpp:
1175         (WebCore::RenderTextControl::createInnerTextStyle): Updated for change to
1176         HTMLTextAreaElement wrap function.
1177
1178 2008-03-16  Antti Koivisto  <antti@apple.com>
1179
1180         Reviewed by Mitz.
1181
1182         Fix http/tests/security/frame-loading-via-document-write.html
1183         which was broken by the preload patch.
1184         
1185         Don't print error message when preload fails local file security check.
1186         Some minor refactoring.
1187
1188         * html/PreloadScanner.cpp:
1189         (WebCore::PreloadScanner::emitTag):
1190         (WebCore::PreloadScanner::emitCSSRule):
1191         * loader/Cache.cpp:
1192         (WebCore::Cache::requestResource):
1193         * loader/Cache.h:
1194         * loader/DocLoader.cpp:
1195         (WebCore::DocLoader::requestResource):
1196         (WebCore::DocLoader::preload):
1197         (WebCore::DocLoader::printPreloadStats):
1198         * loader/DocLoader.h:
1199
1200 2008-03-16  Antti Koivisto  <antti@apple.com>
1201
1202         Reviewed by Darin.
1203         
1204         Fix http://bugs.webkit.org/show_bug.cgi?id=17862
1205         REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
1206         
1207         This was a memory smasher introduced by the preloading patch. 
1208         If a script resource was marked uncacheable, early deletion of the 
1209         Request object would cause deletion of the CachedResource too if
1210         it was referred more than once in a single document.
1211
1212         Test: http/tests/misc/uncacheable-script-repeated.html
1213
1214         * loader/loader.cpp:
1215         (WebCore::Loader::Host::servePendingRequests):
1216         (WebCore::Loader::Host::didFinishLoading):
1217
1218 2008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
1219
1220         Reviewed by Darin.
1221
1222         Fix bug http://bugs.webkit.org/show_bug.cgi?id=17714
1223         <img href="#"> should go to top of the page.
1224
1225         Test: fast/html/empty-fragment-id-goto-top.html
1226
1227         * loader/FrameLoader.cpp:
1228         (WebCore::FrameLoader::gotoAnchor):
1229
1230 2008-03-16  Thiago Macieira  <thiago.macieira@trolltech.com>
1231
1232         Reviewed by Darin.
1233
1234         Don't use RefPtr in classes you haven't seen the implementation of.
1235
1236         Forward-declaration and declaration of RefPtr<Foo> is ok. But you
1237         cannot *use* said objects until Foo is defined. This is true even for
1238         initialisation with a 0.
1239
1240         Seems the HP aCC compiler is more strict here than gcc.
1241
1242         * editing/SplitTextNodeCommand.h:
1243         * page/FrameTree.h:
1244         * xml/XPathExpressionNode.h:
1245
1246 2008-03-16  Darin Adler  <darin@apple.com>
1247
1248         Reviewed by Mitz.
1249
1250         - fix http://bugs.webkit.org/show_bug.cgi?id=14941
1251           <rdar://problem/5404093> textarea value from JavaScript includes extra newline
1252
1253         Test: fast/forms/textarea-trailing-newline.html
1254
1255         * rendering/RenderTextControl.cpp:
1256         (WebCore::RenderTextControl::finishText): Added code to strip the trailing
1257         newline. It's possible there are some obscure cases where this is not wanted,
1258         but I couldn't find any. If someone finds a case where this is bad, we can
1259         make the code conditional.
1260
1261 2008-03-16  Darin Adler  <darin@apple.com>
1262
1263         Reviewed by Mitz.
1264
1265         - fix http://bugs.webkit.org/show_bug.cgi?id=17876
1266           Attempting to visit Ofcom page causes crash
1267
1268         This is causing intermittent crashes on some existing test cases on the buildbot
1269         too; I don't have a 100% test case right now, but it should be easy to add one later
1270         and this does fix a crash in a test we already have.
1271
1272         * dom/CharacterData.cpp:
1273         (WebCore::CharacterData::CharacterData): Initialize m_data to the empty string,
1274         not the null string. The class assumes the string can never being null.
1275         (WebCore::CharacterData::setData): If asked to set the data to the null string,
1276         set it to the empty string instead. This matches what the (non-empty) constructor
1277         has always done.
1278
1279 2008-03-15  Timothy Hatcher  <timothy@apple.com>
1280
1281         Reviewed by Adam Roben.
1282
1283         Bug 17870: Web Inspector console should feel more like a terminal
1284         http://bugs.webkit.org/show_bug.cgi?id=17870
1285
1286         Bug 14390: Console input area should be more noticeable
1287         http://bugs.webkit.org/show_bug.cgi?id=14390
1288
1289         Adds tab completion, auto completion and a blended input prompt.
1290         The prompt is also focused when the console is shown.
1291            Implements a new look, that will be part of the UI refresh.
1292
1293         * page/inspector/ConsolePanel.js: 
1294         (WebInspector.ConsolePanel): Renamed a few properties.
1295         (WebInspector.ConsolePanel.get/set promptText): Property to set
1296         and get the current prompt text. Does not affect command history.
1297         (WebInspector.ConsolePanel.show): Make the prompt focus on show.
1298         (WebInspector.ConsolePanel.acceptAutoComplete): Accepts any
1299         pending auto complete text.
1300         (WebInspector.ConsolePanel.clearAutoComplete): Cancels any pending
1301         auto complete text.
1302         (WebInspector.ConsolePanel.autoCompleteSoon): Sets a timeout to auto
1303         complete in 250 ms, only if there isn't a pending auto complete.
1304         (WebInspector.ConsolePanel.complete): 
1305         (WebInspector.ConsolePanel.completions): Generate a list of possible
1306         completions based on the prefix and the previous expression ranges.
1307         (WebInspector.ConsolePanel._backwardsRange): Helper to scan backwards
1308         from a node and offset to find a start node and offset of the first
1309         character found in the characters string.
1310         (WebInspector.ConsolePanel._evalInInspectedWindow): Helper to eval in the
1311         inspected window.
1312         (WebInspector.ConsolePanel._caretInsidePrompt): Returns true if the selection
1313         is collapsed and is inside the prompt element.
1314         (WebInspector.ConsolePanel._moveCaretToEndOfPrompt): Moves the selection
1315         to the end of the prompt.
1316         (WebInspector.ConsolePanel._onTabPressed): Calls complete on
1317         tab press.
1318         (WebInspector.ConsolePanel._onEnterPressed): Call clearAutoComplete so the
1319         autocompletion text is not evaluated.
1320
1321         * page/inspector/Images/errorIcon.png: New image.
1322         * page/inspector/Images/userInputIcon.png: Added.
1323         * page/inspector/Images/userInputPreviousIcon.png: Added.
1324         * page/inspector/Images/warningIcon.png: New image.
1325         * page/inspector/inspector.css: New refreshed UI.
1326
1327 2008-03-15  Mark Mentovai  <mark@moxienet.com>
1328
1329         Reviewed and landed by Darin.
1330
1331         - http://bugs.webkit.org/show_bug.cgi?id=17833
1332           use file extensions instead of explicit file types in WebCore's Xcode project
1333
1334         * WebCore.xcodeproj/project.pbxproj: Remove unnecessary
1335           uses of explicitFileType, preferring lastKnownFileType ("File Type:
1336           Default for File" in Xcode's File Info's General tab).  Files below
1337           that relied on an explicit file type setting other than what would
1338           be implied by their extensions have been renamed to have correct
1339           extensions.
1340         * bridge/jni/jni_jsobject.cpp: Removed.
1341         * bridge/jni/jni_jsobject.mm: Copied from bridge/jni/jni_jsobject.cpp.
1342         * loader/mac/LoaderNSURLExtras.m: Removed.
1343         * loader/mac/LoaderNSURLExtras.mm: Copied from loader/mac/LoaderNSURLExtras.m.
1344         * platform/mac/SharedTimerMac.cpp: Removed.
1345         * platform/mac/SharedTimerMac.mm: Copied from platform/mac/SharedTimerMac.cpp.
1346
1347 2008-03-15  Darin Adler  <darin@apple.com>
1348
1349         Reviewed by Sam.
1350
1351         - fix http://bugs.webkit.org/show_bug.cgi?id=11997
1352           Ranges are not fixed after mutation (affects Acid3 test 13)
1353
1354         Test: fast/dom/Range/mutation.html
1355
1356         * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
1357         and NodeWithIndexBefore.h.
1358
1359         * dom/CharacterData.cpp:
1360         (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
1361         with call to Document::textRemoved.
1362         (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
1363         with call to Document::textInserted.
1364         (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
1365         and Document::shiftMarkers with call to Document::textRemoved.
1366         (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
1367         and Document::shiftMarkers with call to Document::textRemoved and
1368         Document::textInserted.
1369         (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
1370
1371         * dom/ContainerNode.cpp:
1372         (WebCore::ContainerNode::childrenChanged): Added a call to
1373         Document::nodeChildrenChanged when the nmber of children was changed (and not
1374         by the parser).
1375         (WebCore::dispatchChildRemovalEvents): Updated for name change.
1376
1377         * dom/Document.cpp:
1378         (WebCore::Document::~Document): Assert that all ranges are gone.
1379         (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
1380         all ranges.
1381         (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
1382         Added code to call nodeWillBeRemoved on all ranges.
1383         (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
1384         also calls shiftMarkers.
1385         (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
1386         calls removeMarkers and shiftMarkers.
1387         (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
1388         (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
1389         (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
1390         for this document.
1391         (WebCore::Document::detachRange): Added. Removes range from the HashSet.
1392         * dom/Document.h: Added the new functions and the data member.
1393
1394         * dom/Element.cpp:
1395         (WebCore::Element::normalizeAttributes): Added. Contains the part of the
1396         normalize function that's specific to Element. Better encapsulation to have it
1397         here rather than in Node::normalize.
1398         * dom/Element.h: Added the new function.
1399
1400         * dom/Node.cpp:
1401         (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
1402         a call to textNodesMerged after each pair of nodes is merged but before the
1403         second node is removed.
1404         (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
1405         normalize, but also useful elsewhere.
1406         * dom/Node.h: Added the new function.
1407
1408         * dom/NodeIterator.cpp:
1409         (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
1410         * dom/NodeIterator.h: Ditto.
1411
1412         * dom/ProcessingInstruction.cpp:
1413         (WebCore::ProcessingInstruction::setData): Call textRemoved.
1414
1415         * dom/Range.cpp:
1416         (WebCore::NodeWithIndex::index): Added. Computes and stores index.
1417         (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
1418         (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
1419         (WebCore::Range::Range): Call attachRange.
1420         (WebCore::Range::~Range): Call detachRange unless the range is already detached.
1421         (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
1422         It's no longer possible to create a range where the two containers are non-zero
1423         and have no common ancestor.
1424         (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
1425         (WebCore::Range::compareNode): Changed local variable to use int for consistency.
1426         (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
1427         (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
1428         initialization of ec to 0; both are now inside checkDeleteExtract.
1429         (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
1430         Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
1431         and -1.
1432         (WebCore::Range::processContents): Changed code to not get the nodeType multiple
1433         times on the same node, and tweaked formatting. Removed code to update the range
1434         on deletion, because the normal delete logic will take care of that now.
1435         (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
1436         initialization of ec to 0; both are now inside checkDeleteExtract.
1437         (WebCore::Range::insertNode): Changed local variable to use int for consistency.
1438         (WebCore::Range::toString): Changed variable name to pastLast.
1439         (WebCore::Range::detach): Call detachRange.
1440         (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
1441         set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
1442         (WebCore::endpointNodeChildrenChanged): Added.
1443         (WebCore::Range::nodeChildrenChanged): Added.
1444         (WebCore::endpointNodeWillBeRemoved): Added.
1445         (WebCore::Range::nodeWillBeRemoved): Added.
1446         (WebCore::endpointTextInserted): Added.
1447         (WebCore::Range::textInserted): Added.
1448         (WebCore::endpointTextRemoved): Added.
1449         (WebCore::Range::textRemoved): Added.
1450         (WebCore::endpointTextNodesMerged): Added.
1451         (WebCore::Range::textNodesMerged): Added.
1452         (WebCore::endpointTextNodesSplit): Added.
1453         (WebCore::Range::textNodeSplit): Added.
1454
1455         * dom/Range.h: Added new member functions.
1456
1457         * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
1458         node more than once.
1459         * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
1460         node and treats a node pointer of 0 as meaning "before first node in parent container".
1461         * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
1462         as meaning "after last node in parent container".
1463
1464         * dom/Text.cpp:
1465         (WebCore::Text::splitText): Call textNodeSplit.
1466
1467         * editing/ApplyStyleCommand.cpp:
1468         (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
1469
1470 2008-03-15  Julien Chaffraix  <julien.chaffraix@gmail.com>
1471
1472         Reviewed by Holger.
1473
1474         [CURL] Crash below ResourceHandleManager::setupPOST when job->request().httpBody() is NULL
1475         http://bugs.webkit.org/show_bug.cgi?id=16906
1476
1477         Add null checks for httpBody() to match other ports.
1478
1479         Test: http/tests/xmlhttprequest/xmlhttprequest-post-crash.html
1480
1481         * platform/network/curl/ResourceHandleManager.cpp:
1482         (WebCore::readCallback): Add null check.
1483         (WebCore::ResourceHandleManager::setupPOST): Ditto.
1484
1485 2008-03-14  Steve Falkenburg  <sfalken@apple.com>
1486
1487         PGO build fixes.
1488
1489         * WebCore.vcproj/WebCore.vcproj:
1490
1491 2008-03-14  Anders Carlsson  <andersca@apple.com>
1492
1493         Reviewed by Sam.
1494
1495         <rdar://problem/5794989>
1496         https://bugs.webkit.org/show_bug.cgi?id=17792
1497         REGRESSION (Safari 3.0.4-3.1): Ordering tickets from Sweden's biggest train operator doesn't work
1498
1499         Pass the frame loader that should be used for looking up the frame name to FrameLoader::createWindow
1500         so that somewindow.open calls where the active window and 'somewindow' differ return the correct frame.
1501         
1502         * bindings/js/JSDOMWindowBase.cpp:
1503         (WebCore::createWindow):
1504         * loader/FrameLoader.cpp:
1505         (WebCore::FrameLoader::createWindow):
1506         * loader/FrameLoader.h:
1507
1508 2008-03-14  Dan Bernstein  <mitz@apple.com>
1509
1510         Reviewed by Mark Rowe.
1511
1512         - fix <rdar://problem/5797836> shadow offsets are smaller than specified
1513
1514         * platform/graphics/cg/GraphicsContextCG.cpp:
1515         (WebCore::GraphicsContext::setShadow): Made the workaround for
1516         <rdar://problem/5539388> unconditional.
1517
1518 2008-03-14  Adam Roben  <aroben@apple.com>
1519
1520         Fix it right this time
1521
1522         * platform/MainThread.cpp: Cast to unsigned so we can use %u in the
1523         format string.
1524         * platform/mac/MainThreadMac.mm:
1525
1526 2008-03-14  Adam Roben  <aroben@apple.com>
1527
1528         Mac build fix
1529
1530         * platform/mac/MainThreadMac.mm: Corrected a typo.
1531
1532 2008-03-14  Dan Bernstein  <mitz@apple.com>
1533
1534         Reviewed by Darin Adler.
1535
1536         - fix http://bugs.webkit.org/show_bug.cgi?id=17834
1537           REGRESSION: floated first-letter does not work when included in table
1538
1539         Test: fast/css/first-letter-float.html
1540
1541         * rendering/RenderBlock.cpp:
1542         (WebCore::RenderBlock::updateFirstLetter): Changed the search for the
1543         first text node to stop at a float if that float is an existing first-
1544         letter.
1545
1546 2008-03-14  Sam Weinig  <sam@webkit.org>
1547
1548         Fix Mac build
1549
1550         * WebCore.xcodeproj/project.pbxproj:
1551
1552 2008-03-13  Adam Roben  <aroben@apple.com>
1553
1554         Make most of callOnMainThread's implementation be cross-platform
1555
1556         I took the non-platform-specific parts of MainThreadWin.cpp and moved
1557         them to a new MainThread.cpp. Each platform is now responsible for
1558         implementing one function, scheduleDispatchFunctionsOnMainThread,
1559         which is supposed to set things up so that
1560         dispatchFunctionsFromMainThread gets called from the main thread in
1561         the near future.
1562
1563         Reviewed by Alexey.
1564
1565         * GNUmakefile.am: Added MainThread.cpp to the project.
1566         * WebCore.pro: Ditto.
1567         * WebCore.vcproj/WebCore.vcproj: Ditto.
1568         * WebCore.xcodeproj/project.pbxproj: Ditto.
1569         * WebCoreSources.bkl: Ditto.
1570         * platform/MainThread.cpp:
1571           - Copied from WebCore/platform/win/MainThreadWin.cpp.
1572           - Removed the Windows-specific parts.
1573         (WebCore::callOnMainThread): Changed to call
1574         scheduleDispatchFunctionsOnMainThread instead of PostMessage.
1575         * platform/gtk/MainThreadGtk.cpp:
1576         (WebCore::timeoutFired): Renamed from callFunctionOnMainThread. Now
1577         just calls dispatchFunctionsFromMainThread.
1578         (WebCore::scheduleDispatchFunctionsOnMainThread): Added. Calls through
1579         to g_timeout_add.
1580         * platform/mac/MainThreadMac.mm: Renamed WebCoreFunctionWrapper to
1581         WebCoreMainThreadCaller.
1582         (-[WebCoreMainThreadCaller call]): Calls through to
1583         dispatchFunctionsFromMainThread.
1584         (WebCore::scheduleDispatchFunctionsOnMainThread): Makes a new
1585         WebCoreMainThreadCaller and calls performSelectorOnMainThread on it.
1586         * platform/qt/MainThreadQt.cpp: Removed PerformFunctionEvent.
1587         (WebCore::MainThreadInvoker::event): Chagned to call through to
1588         dispatchFunctionsFromMainThread.
1589         (WebCore::scheduleDispatchFunctionsOnMainThread): Sends an empty event
1590         to the MainThreadInvoker.
1591         * platform/win/MainThreadWin.cpp:
1592           - Removed the non-Windows-specific parts.
1593           - Removed some unnecessary initialization of static variables to 0.
1594         (WebCore::ThreadingWindowWndProc): Changed to call
1595         dispatchFunctionsFromMainThread.
1596         (WebCore::scheduleDispatchFunctionsOnMainThread): Calls through to
1597         PostMessage.
1598         * platform/wx/MainThreadWx.cpp:
1599         (WebCore::scheduleDispatchFunctionsOnMainThread): Added.
1600
1601 2008-03-14  Beth Dakin  <bdakin@apple.com>
1602
1603         Reviewed by Geoff.
1604
1605         Fix for <rdar://problem/5728171> Potential PLT speedup: don't 
1606         realloc every time inside NamedAttrMap::addAttribute
1607
1608         The speed-up for this turned out to be so small that it is mostly 
1609         imperceptible. It is likely that it is a tiny boost, though, and 
1610         the new code is much cleaner.
1611
1612         * dom/Element.cpp:
1613         (WebCore::Element::setAttributeMap): attrs is now called 
1614         m_attributes
1615         * dom/NamedAttrMap.cpp: The array attrs is now the Vector of 
1616         RefPtrs called m_attributes, and there is no longer any need for 
1617         the len member variable. 
1618         (WebCore::NamedAttrMap::NamedAttrMap): 
1619         (WebCore::NamedAttrMap::item):
1620         (WebCore::NamedAttrMap::getAttributeItem):
1621         (WebCore::NamedAttrMap::clearAttributes):
1622         (WebCore::NamedAttrMap::operator=):
1623         (WebCore::NamedAttrMap::addAttribute):
1624         (WebCore::NamedAttrMap::removeAttribute):
1625         (WebCore::NamedAttrMap::mapsEquivalent):
1626         * dom/NamedAttrMap.h: Same.
1627         (WebCore::NamedAttrMap::length):
1628         (WebCore::NamedAttrMap::attributeItem):
1629         (WebCore::NamedAttrMap::shrinkToLength):
1630         (WebCore::NamedAttrMap::reserveCapacity):
1631         * html/HTMLTokenizer.cpp: One of the benefits of the old array was 
1632         that it never took up more memory than it needed to. So the 
1633         tokenizer utilizes new member functions on NamedAttrMap 
1634         (shrinkToLength and reserveCapacity) to try to keep memory usage at 
1635         a minimum. 
1636         (WebCore::Token::addAttribute):
1637         (WebCore::HTMLTokenizer::processToken):
1638
1639 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
1640
1641         BUILD FIX when ENABLE(MAC_JAVA_BRIDGE) set to 0.
1642
1643         * page/mac/FrameMac.mm: Move up #if ENABLE(MAC_JAVA_BRIDGE) guard
1644         to comment out unused code.
1645
1646 2008-03-14  David D. Kilzer  <ddkilzer@apple.com>
1647
1648         Unify concept of enabling the Mac Java bridge.
1649
1650         Reviewed by Darin and Anders.
1651
1652         No test cases added since there is no change in functionality.
1653
1654         * DerivedSources.make: Added check for ENABLE_MAC_JAVA_BRIDGE macro.
1655         If defined as "1", add WebCore.JNI.exp to WEBCORE_EXPORT_DEPENDENCIES.
1656         * WebCore.JNI.exp: Added.
1657         * WebCore.base.exp: Moved exported JNI methods to WebCore.JNI.exp.
1658
1659         * bridge/jni/jni_class.cpp: Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
1660         * bridge/jni/jni_class.h: Ditto.
1661         * bridge/jni/jni_instance.cpp: Ditto.
1662         * bridge/jni/jni_instance.h: Ditto.
1663         * bridge/jni/jni_jsobject.cpp: Ditto.
1664         * bridge/jni/jni_jsobject.h: Ditto.
1665         * bridge/jni/jni_objc.mm: Ditto.
1666         * bridge/jni/jni_runtime.cpp: Ditto.
1667         * bridge/jni/jni_runtime.h: Ditto.
1668         * bridge/jni/jni_utility.cpp: Ditto.
1669         * bridge/jni/jni_utility.h: Ditto.
1670
1671         * bridge/runtime.cpp: Removed unused #include statements.
1672         * bridge/runtime.h:
1673         (KJS::Bindings::Instance::BindingLanguage): Added #if ENABLE(MAC_JAVA_BRIDGE)
1674         guard for JavaLanguage enum.  Also added #if PLATFORM(MAC) guard for
1675         ObjectiveCLanguage enum to match corresponding code in runtime.cpp.
1676
1677         * config.h: Removed definition of HAVE_JNI.
1678
1679         * loader/FrameLoaderClient.h:
1680         (WebCore::FrameLoaderClient::javaApplet): Added #if ENABLE(MAC_JAVA_BRIDGE) guard.
1681         * page/Frame.cpp:
1682         (WebCore::Frame::Frame): Ditto.
1683         * page/Frame.h:
1684         (WebCore::Frame::initJavaJSBindings): Ditto.
1685         * page/mac/FrameMac.mm:
1686         (WebCore::Frame::createScriptInstanceForWidget): Ditto.
1687         (WebCore::Frame::initJavaJSBindings): Ditto.
1688
1689 2008-03-13  Darin Adler  <darin@apple.com>
1690
1691         * html/PreloadScanner.h: Corrected license.
1692         * html/PreloadScanner.cpp: Corrected license.
1693
1694 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1695
1696         Reviewed by darin.  Landed by eseidel.
1697
1698         * platform/FloatConversion.h: Include a header to get CoreGraphics
1699         types when using CoreGraphics types.
1700
1701 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1702
1703         Reviewed by eseidel.  Landed by eseidel.
1704
1705         * WebCore.xcodeproj/project.pbxproj:
1706         * css/CSSParser.cpp:
1707         * css/makeprop.pl:
1708         Move CSSPropertyNames.c to CSSPropertyNames.cpp
1709
1710 2008-03-13  Mark Mentovai  <mark@moxienet.com>
1711
1712         Reviewed by eseidel.  Landed by eseidel.
1713
1714         * platform/Arena.h: Use statement1;statement2 instead of
1715         (statement1,statement2) in CLEAR_UNUSED.
1716
1717 2008-03-13  Tommi Komulainen  <tommi.komulainen@iki.fi>
1718
1719         Reviewed by Alp Toker.
1720
1721         http://bugs.webkit.org/show_bug.cgi?id=17821
1722         [SOUP] POST requests are empty
1723
1724         Send the HTTP request body as well.
1725
1726         * platform/network/soup/ResourceHandleSoup.cpp:
1727         (WebCore::ResourceHandle::start):
1728
1729 2008-03-13  Dan Bernstein  <mitz@apple.com>
1730
1731         Reviewed by Dave Hyatt.
1732
1733         - fix http://bugs.webkit.org/show_bug.cgi?id=17819
1734           Border-collapse: collapse later cell wins on PC, earlier cell on Mac
1735
1736         Test: fast/table/border-collapsing/equal-precedence-resolution.html
1737
1738         * rendering/RenderTableCell.cpp:
1739         (WebCore::RenderTableCell::collapsedLeftBorder): When calling
1740         compareBorders() with borders that may have the same precedence, made
1741         sure to pass the border belonging to the earlier (in document order)
1742         element first, since compareBorders() prefers the first argument when
1743         there is a tie.
1744         (WebCore::RenderTableCell::collapsedRightBorder): Ditto.
1745         (WebCore::RenderTableCell::collapsedTopBorder): Ditto.
1746
1747 2008-03-13  Adam Roben  <aroben@apple.com>
1748
1749         wx build fix and Windows leak fix after r31034
1750
1751         * platform/graphics/wx/ImageWx.cpp:
1752         (WebCore::Image::loadPlatformResource): Use SharedBuffer::create.
1753         * platform/win/SharedBufferWin.cpp:
1754         (WebCore::SharedBuffer::createWithContentsOfFile): Ditto (we were
1755         leaking the SharedBuffer here before).
1756
1757 2008-03-13  Antti Koivisto  <antti@apple.com>
1758
1759         Reviewed by Eric.
1760
1761         Correct a few issues spotted by Mike Belshe. 
1762
1763         * html/PreloadScanner.cpp:
1764         (WebCore::PreloadScanner::tokenize):
1765         * loader/loader.cpp:
1766         (WebCore::Loader::cancelRequests):
1767
1768 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
1769
1770         Fix GTK+ build for SharedBuffer changes.
1771
1772         * platform/graphics/gtk/ImageGtk.cpp:
1773         (Image::loadPlatformResource):
1774
1775 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
1776
1777         More PGO build fixes.
1778
1779         * WebCorePrefix.cpp:
1780
1781 2008-03-13  Antti Koivisto  <antti@apple.com>
1782
1783         Reviewed by Darin.
1784         
1785         Make page loads go fast.
1786         
1787         http://bugs.webkit.org/show_bug.cgi?id=17480
1788
1789         - Implement speculative preloading. When a script load blocks the main parser, use a side 
1790           parser to pick up more resources.
1791         - Implement per-host load queues, prioritize scripts and stylesheets over images.
1792         
1793         Depending on content and network latency this may speed things up quite a bit.
1794
1795         * WebCore.xcodeproj/project.pbxproj:
1796         * dom/Document.cpp:
1797         (WebCore::Document::implicitClose):
1798         Clear the preloads after laoding completes.
1799         
1800         * html/HTMLLinkElement.cpp:
1801         (WebCore::HTMLLinkElement::parseMappedAttribute):
1802         (WebCore::HTMLLinkElement::tokenizeRelAttribute):
1803         * html/HTMLLinkElement.h:
1804         Make tokenizeRelAttribute() public static so it can be used from elsewhere.
1805         Eliminate a pointless bitfield so I can get references.
1806         
1807         * html/HTMLTokenizer.cpp:
1808         (WebCore::HTMLTokenizer::scriptHandler):
1809         (WebCore::HTMLTokenizer::scriptExecution):
1810         (WebCore::HTMLTokenizer::write):
1811         * html/HTMLTokenizer.h:
1812         Spin up the preload scanner whenever a script load blocks the parser. One scanner tracks the end of 
1813         the document while temporary ones are created as needed to scan document.write() output.
1814         
1815         * html/PreloadScanner.cpp: Added.
1816         (WebCore::PreloadScanner::PreloadScanner):
1817         (WebCore::PreloadScanner::~PreloadScanner):
1818         (WebCore::PreloadScanner::begin):
1819         (WebCore::PreloadScanner::end):
1820         (WebCore::PreloadScanner::reset):
1821         (WebCore::PreloadScanner::write):
1822         (WebCore::isWhitespace):
1823         (WebCore::PreloadScanner::clearLastCharacters):
1824         (WebCore::PreloadScanner::rememberCharacter):
1825         (WebCore::PreloadScanner::lastCharactersMatch):
1826         (WebCore::legalEntityFor):
1827         (WebCore::PreloadScanner::consumeEntity):
1828         (WebCore::PreloadScanner::tokenize):
1829         (WebCore::PreloadScanner::processAttribute):
1830         (WebCore::PreloadScanner::emitCharacter):
1831         (WebCore::PreloadScanner::tokenizeCSS):
1832         (WebCore::PreloadScanner::emitTag):
1833         (WebCore::PreloadScanner::emitCSSRule):
1834         * html/PreloadScanner.h: Added.
1835         (WebCore::PreloadScanner::inProgress):
1836         (WebCore::PreloadScanner::):
1837         HTML5 tokenization plus some glue code. Fake CSS parsing thrown in just for fun.
1838         
1839         * loader/Cache.cpp:
1840         (WebCore::Cache::pruneDeadResources):
1841         Preloads have zero refcount, avoid kicking them out too early.
1842         
1843         * loader/CachedResource.cpp:
1844         (WebCore::CachedResource::CachedResource):
1845         (WebCore::CachedResource::ref):
1846         * loader/CachedResource.h:
1847         (WebCore::CachedResource::):
1848         (WebCore::CachedResource::preloadResult):
1849         (WebCore::CachedResource::setRequestedFromNetworkingLayer):
1850         (WebCore::CachedResource::canDelete):
1851         (WebCore::CachedResource::isPreloaded):
1852         (WebCore::CachedResource::increasePreloadCount):
1853         (WebCore::CachedResource::decreasePreloadCount):
1854         Keep track which resources are preloads. Avoid deleting them. Track
1855         at which point of the loading preloads get utilized to enable some interesting 
1856         statistics.
1857         
1858         * loader/DocLoader.cpp:
1859         (WebCore::DocLoader::~DocLoader):
1860         (WebCore::DocLoader::checkForReload):
1861         (WebCore::DocLoader::registerPreload):
1862         (WebCore::DocLoader::clearPreloads):
1863         (WebCore::DocLoader::printPreloadStats):
1864         * loader/DocLoader.h:
1865         Ensure we utilize preloaded resources during reloads.
1866         Keep a list of all preloads in the document. Clear the preloads after
1867         parsing is complete. Some debug statistics.
1868         
1869         * loader/DocumentLoader.cpp:
1870         (WebCore::DocumentLoader::isLoadingInAPISense):
1871         Avoid signaling that loading is complete too early. 
1872         
1873         * loader/loader.cpp:
1874         (WebCore::Loader::Loader):
1875         (WebCore::Loader::~Loader):
1876         (WebCore::Loader::determinePriority):
1877         (WebCore::Loader::load):
1878         (WebCore::Loader::scheduleServePendingRequests):
1879         (WebCore::Loader::requestTimerFired):
1880         (WebCore::Loader::servePendingRequests):
1881         (WebCore::Loader::cancelRequests):
1882         (WebCore::Loader::Host::Host):
1883         (WebCore::Loader::Host::~Host):
1884         (WebCore::Loader::Host::addRequest):
1885         (WebCore::Loader::Host::hasRequests):
1886         (WebCore::Loader::Host::servePendingRequests):
1887         (WebCore::Loader::Host::didFinishLoading):
1888         (WebCore::Loader::Host::didFail):
1889         (WebCore::Loader::Host::didReceiveResponse):
1890         (WebCore::Loader::Host::didReceiveData):
1891         (WebCore::Loader::Host::cancelPendingRequests):
1892         (WebCore::Loader::Host::cancelRequests):
1893         * loader/loader.h:
1894         (WebCore::Loader::):
1895         Distribute load requests to per-host priority queues. Limit the number of loads issued to the 
1896         networking layer so we have better changes of getting important requests through first.
1897         Prioritize scripts > stylesheets > images.
1898
1899 2008-03-13  David Hyatt  <hyatt@apple.com>
1900
1901         This patch makes full page zoom work pretty well. It fixes repainting so that it works when transforms
1902         are set on the RenderView. It also implements the "smart layout" behavior that other browsers support when
1903         zooming. The page will still try to constrain to the viewport size even when zoomed.
1904
1905         Reviewed by john
1906
1907         * dom/Document.cpp:
1908         (WebCore::Document::recalcStyle):
1909         Make sure to test for transform changes even when there is no zoom.  This fixes repainting issues
1910         caused by jumping from a zoomed state back to the standard size.
1911
1912         * page/FrameView.cpp:
1913         (WebCore::FrameView::adjustViewSize):
1914         Adjust for the zoom factor (the render tree is in unzoomed coordinates, but the scrollbars of the view
1915         need to handle zoomed coordinates).
1916
1917         * rendering/RenderBox.cpp:
1918         (WebCore::RenderBox::calcHeight):
1919         Fix the body-sizing-to-the-view-height quirk so that it takes the zoom factor into account when
1920         stretching to fill the viewport.
1921
1922         * rendering/RenderLayer.cpp:
1923         (WebCore::RenderLayer::updateLayerPositions):
1924         (WebCore::RenderLayer::setHasVisibleContent):
1925         Remove the FIXMEs now that absoluteClippedOverflowRect works with transforms on the RenderView.
1926
1927         * rendering/RenderView.cpp:
1928         (WebCore::RenderView::calcHeight):
1929         (WebCore::RenderView::calcWidth):
1930         Make sure the calculated width/height take the zoom factor into account in order to get the "smart layout"
1931         behavior.
1932
1933         (WebCore::RenderView::layout):
1934         When deciding whether children have to get a relayout, we need to check the zoomed width/height and not just
1935         the viewport size.
1936
1937         (WebCore::RenderView::computeAbsoluteRepaintRect):
1938         Patched to take into account transforms set on the RenderView.
1939
1940         (WebCore::RenderView::docHeight):
1941         (WebCore::RenderView::docWidth):
1942         Patched to just always use m_width and m_height initially, since those have already been adjusted for
1943         the zoom factor.
1944
1945         (WebCore::RenderView::zoomedHeight):
1946         (WebCore::RenderView::zoomedWidth):
1947         * rendering/RenderView.h:
1948         New helper methods for obtaining the adjusted width/height of the viewport taking into account the
1949         zoom factor.
1950
1951 2008-03-13  Anders Carlsson  <andersca@apple.com>
1952
1953         Build fix.
1954
1955         * WebCore.base.exp:
1956
1957 2008-03-13  Anders Carlsson  <andersca@apple.com>
1958
1959         Reviewed by Adam.
1960
1961         Get rid of actualRequest, it is not used anymore. Also, get rid of 
1962         initialRequest and replace all uses with originalRequest because those are
1963         the same thing.
1964         
1965         * loader/DocumentLoader.cpp:
1966         * loader/DocumentLoader.h:
1967         * loader/FrameLoader.cpp:
1968         (WebCore::FrameLoader::initialRequest):
1969         (WebCore::FrameLoader::originalRequestURL):
1970
1971 2008-03-13  Brady Eidson  <beidson@apple.com>
1972
1973         Reviewed by Anders
1974
1975         Convert SharedBuffer to start with a refCount of 1
1976
1977         * loader/ImageDocument.cpp:
1978         (WebCore::ImageTokenizer::finish):
1979
1980         * loader/ResourceLoader.cpp:
1981         (WebCore::ResourceLoader::addData):
1982         (WebCore::ResourceLoader::willStopBufferingData):
1983
1984         * loader/icon/IconDatabase.cpp:
1985         (WebCore::IconDatabase::defaultIcon):
1986         (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
1987
1988         * loader/loader.cpp:
1989         (WebCore::Loader::didReceiveData):
1990
1991         * platform/SharedBuffer.h:
1992         (WebCore::SharedBuffer::create): Make all constructors private, add ::create() calls
1993         * platform/SharedBuffer.cpp:
1994         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
1995         (WebCore::SharedBuffer::copy):
1996         * platform/mac/SharedBufferMac.mm:
1997         (WebCore::SharedBuffer::wrapNSData):
1998         (WebCore::SharedBuffer::SharedBuffer): Revert to default RefCounted constructor to start with a ref count of 1
1999
2000 2008-03-13  Steve Falkenburg  <sfalken@apple.com>
2001
2002         PGO build fixes.
2003         
2004         Disable PGO for normal release builds.
2005         Added work-in-progress Release_PGOInstrument/Release_PGOOptimize targets.
2006
2007         * WebCore.vcproj/WebCore.vcproj:
2008
2009 2008-03-13  Anders Carlsson  <andersca@apple.com>
2010
2011         Reviewed by Darin.
2012
2013         Make a bunch of DocumentLoader setters/getters inline.
2014         
2015         * loader/DocumentLoader.cpp:
2016         * loader/DocumentLoader.h:
2017         (WebCore::DocumentLoader::isStopping):
2018         (WebCore::DocumentLoader::setCommitted):
2019         (WebCore::DocumentLoader::isCommitted):
2020         (WebCore::DocumentLoader::isLoading):
2021         (WebCore::DocumentLoader::setLoading):
2022         (WebCore::DocumentLoader::response):
2023         (WebCore::DocumentLoader::mainDocumentError):
2024         (WebCore::DocumentLoader::setResponse):
2025         (WebCore::DocumentLoader::isClientRedirect):
2026         (WebCore::DocumentLoader::setIsClientRedirect):
2027         (WebCore::DocumentLoader::overrideEncoding):
2028         (WebCore::DocumentLoader::responses):
2029         (WebCore::DocumentLoader::triggeringAction):
2030         (WebCore::DocumentLoader::setTriggeringAction):
2031         (WebCore::DocumentLoader::setOverrideEncoding):
2032         (WebCore::DocumentLoader::setLastCheckedRequest):
2033         (WebCore::DocumentLoader::lastCheckedRequest):
2034         (WebCore::DocumentLoader::title):
2035         (WebCore::DocumentLoader::setLoadingFromCachedPage):
2036         (WebCore::DocumentLoader::isLoadingFromCachedPage):
2037
2038 2008-03-13  Rodney Dawes  <dobey@wayofthemonkey.com>
2039
2040         Fix builds without SVG enabled.
2041
2042         * page/Frame.cpp:
2043         (Frame::shouldApplyTextZoom):
2044         (Frame::shouldApplyPageZoom):
2045
2046 2008-03-13  Simon Hausmann  <hausmann@webkit.org>
2047
2048         Fix the Qt build.
2049
2050         * bridge/qt/qt_instance.cpp:
2051         (KJS::Bindings::QtInstance::getQtInstance):
2052         (KJS::Bindings::QtInstance::getRuntimeObject):
2053         * bridge/qt/qt_instance.h:
2054         (KJS::Bindings::QtInstance::create):
2055         * bridge/qt/qt_runtime.cpp:
2056         (KJS::Bindings::convertQVariantToValue):
2057         (KJS::Bindings::QtConnectionObject::execute):
2058         * page/qt/FrameQt.cpp:
2059         (WebCore::Frame::createScriptInstanceForWidget):
2060
2061 2008-03-12  Sam Weinig  <sam@webkit.org>
2062
2063         Reviewed by Darin Adler.
2064
2065         Fix <rdar://problem/5784773>
2066         Crash loading QT movies @ apple.com/ipodtouch/features.html with a PAC file (WebKitThreadingException)
2067
2068         Make bridged RuntimeObjects get collected on the main thread only. This is necessary
2069         because clients of the bridged objects are unlikely to prepared for a collection on 
2070         non-main thread, which can happen with a PAC file.
2071
2072         * bridge/runtime_object.cpp:
2073         (RuntimeObjectImp::RuntimeObjectImp):
2074
2075 2008-03-12  Adam Roben  <aroben@apple.com>
2076
2077         Fix Bug 17815: Inspector's DOM tree should descend into subframes
2078
2079         <http://bugs.webkit.org/show_bug.cgi?id=17815>
2080
2081         Reviewed by Tim.
2082
2083         * page/inspector/DocumentPanel.js:
2084         (WebInspector.DocumentPanel.revealNode): Changed to provide
2085         _isAncestorIncludingParentFramesWithinPanel and
2086         _parentNodeOrFrameElementWithinPanel for the isAncestor and getParent
2087         parameters to findTreeElement so that parent frames will be searched.
2088         (WebInspector.DocumentPanel.updateBreadcrumb):
2089           - Changed while loop to for loop
2090           - Use _parentNodeOrFrameElementWithinPanel instead of
2091             Node.parentNode to move to the next node
2092           - The loop now ends when we reach the DocumentPanel's document node
2093           - Traversal past other Document nodes is now allowed
2094           - We add the "start" class to the final crumb after the loop exits
2095         (WebInspector.DocumentPanel._getDocumentForNode): Added. Simple helper
2096         that returns the node itself if the node is a Document node, or the
2097         node's ownerDocument otherwise.
2098         (WebInspector.DocumentPanel._parentNodeOrFrameElementWithinPanel):
2099         Added. Returns the node's parent node or, in the case of a Document
2100         node, the node's window's owning frame element, but will not return a
2101         node that is in a parent frame of the DocumentPanel's Document.
2102         (WebInspector.DocumentPanel._isAncestorIncludingParentFramesWithinPanel):
2103         Added. Returns true if a is an ancestor of b if a is an ancestor of a
2104         frame element whose subframe(s) contain b.
2105         (WebInspector.DOMNodeTreeElement): We now consider ourselves to have
2106         children if we have a contentDocument.
2107         (WebInspector.DOMNodeTreeElement.onpopulate): Moved the appendChild
2108         loop into a function so that we can add both children of our
2109         contentDocument and children of our node to the tree.
2110         (WebInspector.DOMNodeTreeElement.ondblclick): Changed so that we get
2111         the rootDOMNode by traversing the tree outline hierarchy instead of
2112         the DOM hierarchy so that we can easily jump up to a parent frame.
2113
2114 2008-03-12  Adam Roben  <aroben@apple.com>
2115
2116         Update the styles/metrics panes and breadcrumb after editing DOM
2117         attributes
2118
2119         Reviewed by Tim.
2120
2121         * page/inspector/DocumentPanel.js:
2122         (WebInspector.DocumentPanel.set focusedDOMNode): Moved code to update
2123         the parts of the DocumentPanel other than the DOM tree into a new
2124         function, _focusedNodeChanged.
2125         (WebInspector.DocumentPanel._focusedNodeChanged): Added. The
2126         forceUpdate parameter specifies whether the update should occur even
2127         if the focused node hasn't changed since the last update.
2128         (WebInspector.DocumentPanel.updateBreadcrumb): Added a forceUpdate
2129         parameter. If forceUpdate is true, we always rebuild the breadcrumbs.
2130         (WebInspector.DocumentPanel.updateStyles): Added a forceUpdate
2131         parameter. If forceUpdate is true, we always rebuild the styles pane.
2132         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added a
2133         call to DocumentPanel._focusedNodeChanged. We have to force the update
2134         because we haven't changed the focused node (the attributes of the
2135         node have changed).
2136         * page/inspector/StylesSidebarPane.js:
2137         (WebInspector.StylesSidebarPane.update): Added a forceUpdate
2138         parameter. If forceUpdate is true we always rebuild the styles.
2139
2140 2008-03-12  Mark Rowe  <mrowe@apple.com>
2141
2142         Further Gtk and Qt build fixes.
2143
2144         * bridge/runtime.cpp:
2145         (KJS::Bindings::Instance::createRuntimeObject): Adapt Qt-only code for change to PassRefPtr.
2146         * page/gtk/FrameGtk.cpp: Add missing include.
2147
2148 2008-03-12  Mark Rowe  <mrowe@apple.com>
2149
2150         Fix Gtk and Qt builds.
2151
2152         * page/gtk/FrameGtk.cpp:
2153         * page/qt/FrameQt.cpp:
2154
2155 2008-03-12  Mark Rowe  <mrowe@apple.com>
2156
2157         Mac build fix.
2158
2159         * WebCore.base.exp:  Remove symbol.
2160
2161 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2162
2163         Build fix.
2164
2165         * page/win/FrameWin.cpp:
2166
2167 2008-03-12  Steve Falkenburg  <sfalken@apple.com>
2168
2169         Build fix.
2170
2171         * plugins/win/PluginViewWin.cpp:
2172         (WebCore::PluginView::bindingInstance):
2173
2174 2008-03-12  Darin Adler  <darin@apple.com>
2175
2176         Reviewed by Anders.
2177
2178         - http://bugs.webkit.org/show_bug.cgi?id=17640
2179           eliminate WebCoreFrameBridge
2180
2181         * WebCore.base.exp: Added more exports, needed by code moved from WebCoreFrameBridge
2182         to WebFrame in WebKit.
2183         * WebCore.xcodeproj/project.pbxproj: Added more headers, same reason. Also deleted
2184         WebCoreFrameBridge.h and WebCoreFrameBridge.mm.
2185
2186         * page/Frame.cpp:
2187         (WebCore::Frame::Frame): Added call to initJavaJSBindings(), formerly handled by
2188         the WebCoreFrameBridge.
2189         * page/Frame.h: Added initJavaJSBindings function.
2190
2191         * page/mac/FrameMac.mm:
2192         (WebCore::updateRenderingForBindings): Moved here from WebCoreFrameBridge.
2193         (WebCore::Frame::initJavaJSBindings): Ditto; code was in the init function.
2194
2195         * page/mac/WebCoreFrameBridge.h: Removed.
2196         * page/mac/WebCoreFrameBridge.mm: Removed.
2197
2198 2008-03-12  Sam Weinig  <sam@webkit.org>
2199
2200         Reviewed by Anders Carlsson.
2201
2202         Don't go through the Document just to get the frame Element.
2203
2204         * page/DOMWindow.cpp:
2205         (WebCore::DOMWindow::frameElement):
2206
2207 2008-03-12  Anders Carlsson  <andersca@apple.com>
2208
2209         Reviewed by Geoff and Sam.
2210
2211         More Instance cleanup:
2212         
2213         * Make Instance inherit from RefCounted instead of doing its own refcounting.        
2214         * Make all Instance subclasses private, add static create methods.         
2215         * Have Instance start out with a refcount of 1.
2216         * Get rid of Instance::createBindingForLanguageInstance and call the individual 
2217           instance constructor methods instead.
2218         * Fix many methods to take and return PassRefPtr<Instance> to ensure that the
2219           refcounting is done correctly.
2220          
2221         * bridge/c/c_instance.h:
2222         (KJS::Bindings::CInstance::create):
2223         * bridge/c/c_utility.cpp:
2224         (KJS::Bindings::convertNPVariantToValue):
2225         * bridge/jni/jni_instance.cpp:
2226         (JavaInstance::invokeMethod):
2227         * bridge/jni/jni_instance.h:
2228         (KJS::Bindings::JavaInstance::create):
2229         * bridge/jni/jni_jsobject.cpp:
2230         (JavaJSObject::convertJObjectToValue):
2231         * bridge/jni/jni_runtime.cpp:
2232         (JavaField::valueFromInstance):
2233         (JavaArray::valueAt):
2234         * bridge/objc/objc_instance.h:
2235         (KJS::Bindings::ObjcInstance::create):
2236         * bridge/objc/objc_utility.mm:
2237         (KJS::Bindings::convertObjcValueToValue):
2238         * bridge/qt/qt_instance.cpp:
2239         (KJS::Bindings::QtRuntimeObjectImp::QtRuntimeObjectImp):
2240         (KJS::Bindings::QtInstance::getQtInstance):
2241         (KJS::Bindings::QtInstance::getRuntimeObject):
2242         * bridge/qt/qt_instance.h:
2243         * bridge/runtime.cpp:
2244         (KJS::Bindings::Instance::Instance):
2245         (KJS::Bindings::Instance::createRuntimeObject):
2246         * bridge/runtime.h:
2247         * bridge/runtime_object.cpp:
2248         (RuntimeObjectImp::RuntimeObjectImp):
2249         * bridge/runtime_object.h:
2250         * page/Frame.h:
2251         * page/mac/FrameMac.mm:
2252         (WebCore::Frame::createScriptInstanceForWidget):
2253         * page/win/FrameWin.cpp:
2254         (WebCore::Frame::createScriptInstanceForWidget):
2255         * plugins/PluginView.h:
2256         * plugins/win/PluginViewWin.cpp:
2257         (WebCore::PluginView::bindingInstance):
2258
2259 2008-03-12  Dan Bernstein  <mitz@apple.com>
2260
2261         Suggested by Darin Adler. Reviewed by Dave Hyatt.
2262
2263         - speed up BidiIterator::direction()
2264
2265         * rendering/bidi.cpp:
2266         (WebCore::BidiIterator::current): Made inline and corrected the
2267         out-of-bounds condition to work with 0-length text and offsets beyond
2268         the end of the text.
2269         (WebCore::BidiIterator::direction): Changed to call current() and not
2270         call the virtual method isListMarker() most of the time.
2271         (WebCore::addMidpoint): Removed unnecessary null-check of smidpoints.
2272         (WebCore::appendRunsForObject): Ditto.
2273
2274 2008-03-12  Adam Roben  <aroben@apple.com>
2275
2276         Make URLs not be underlined while editing them in the DOM view
2277
2278         Reviewed by Tim.
2279
2280         * page/inspector/inspector.css:
2281
2282 2008-03-12  Adam Roben  <aroben@apple.com>
2283
2284         Part of Bug 17224: DOM nodes/attributes should be editable
2285
2286         <http://bugs.webkit.org/show_bug.cgi?id=17224>
2287         <rdar://problem/5732825>
2288
2289         We now start editing if the user single-clicks on an attribute,
2290         attribute value, or text node while the parent element is selected.
2291         Previously, we started editing on double-click regardless of the
2292         selection state of the element.
2293
2294         URLs in the DOM tree are now followed on Alt/Option-click, rather than
2295         on just click.
2296
2297         Reviewed by Tim.
2298
2299         * English.lproj/InspectorLocalizedStrings.js: Added four new localized
2300         strings.
2301         * page/inspector/DocumentPanel.js:
2302         (WebInspector.DOMNodeTreeElement.onattach): Call new
2303         _makeURLSActivateOnModifiedClick.
2304         (WebInspector.DOMNodeTreeElement._makeURLsActivateOnModifiedClick):
2305         Added. Changes the tooltip of each link in this element to indicate
2306         that Alt/Option-click will follow the URL, and sets the
2307         followOnAltClick property on each link.
2308         (WebInspector.DOMNodeTreeElement.onselect): Mark that we're being
2309         selected.
2310         (WebInspector.DOMNodeTreeElement.onmousedown): If we're not currently
2311         being selected, start editing.
2312         (WebInspector.DOMNodeTreeElement.ondblclick): We no longer start
2313         editing here. We block re-rooting of the tree if we're currently
2314         editing.
2315         (WebInspector.DOMNodeTreeElement._startEditing):
2316           - Don't do anything if we're not focused
2317           - Pass the event down to _startEditingAttribute.
2318         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't do
2319         anything if the event target is a URL and the Alt/Option key is
2320         pressed -- in this case we want to follow the link.
2321         (WebInspector.DOMNodeTreeElement._updateTitle): Call
2322         _makeURLsActivateOnClick again since the anchor elements have all been
2323         recreated.
2324         * page/inspector/inspector.js:
2325         (WebInspector.documentClick): If the anchor as a followOnAltClick
2326         property and the Alt/Option key is not pressed, do nothing.
2327
2328 2008-03-12  Ada Chan  <adachan@apple.com>
2329
2330         Fixed the initial value of zoom factor.
2331
2332         Reviewed by Adam.
2333
2334         * page/Frame.cpp:
2335         (WebCore::FramePrivate::FramePrivate):
2336
2337 2008-03-12  David Hyatt  <hyatt@apple.com>
2338
2339         Make full page zoom vaguely work.  This patch uses the CSS transform system to turn on full page zoom at the
2340         document level.  There are many many bugs that I'm going to file to track all the issues (most of the issues
2341         are just bugs with transforms themselves).
2342
2343         Reviewed by Adam Roben
2344
2345         * css/CSSStyleSelector.cpp:
2346         (WebCore::CSSStyleSelector::applyProperty):
2347         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
2348         * dom/Document.cpp:
2349         (WebCore::Document::recalcStyle):
2350         * page/Frame.cpp:
2351         (WebCore::Frame::shouldApplyTextZoom):
2352         (WebCore::Frame::shouldApplyPageZoom):
2353         * page/Frame.h:
2354         * rendering/RenderLayer.cpp:
2355         (WebCore::RenderLayer::updateLayerPositions):
2356         (WebCore::RenderLayer::setHasVisibleContent):
2357         (WebCore::RenderLayer::paintLayer):
2358         (WebCore::RenderLayer::hitTestLayer):
2359         * rendering/RenderLayer.h:
2360
2361 2008-03-12  David Hyatt  <hyatt@apple.com>
2362
2363         Make the zoom factor a float and not a percent.
2364
2365         Reviewed by antti
2366
2367         * WebCore.base.exp:
2368         * css/CSSStyleSelector.cpp:
2369         (WebCore::CSSStyleSelector::applyProperty):
2370         (WebCore::CSSStyleSelector::getComputedSizeFromSpecifiedSize):
2371         * page/Frame.cpp:
2372         (WebCore::Frame::zoomFactor):
2373         (WebCore::Frame::setZoomFactor):
2374         * page/Frame.h:
2375         * page/FramePrivate.h:
2376         * svg/SVGSVGElement.cpp:
2377         (WebCore::SVGSVGElement::currentScale):
2378         (WebCore::SVGSVGElement::setCurrentScale):
2379
2380 2008-03-12  David Hyatt  <hyatt@apple.com>
2381
2382         Eliminate setTextMultiplier from the bridge.  Make Webkit just call setZoomFactor on the frame directly.
2383
2384         Reviewed by Tim H.
2385
2386         * WebCore.base.exp:
2387         * page/mac/WebCoreFrameBridge.h:
2388         * page/mac/WebCoreFrameBridge.mm:
2389
2390 2008-03-12  Dan Bernstein  <mitz@apple.com>
2391
2392         Reviewed by Darin Adler and Sam Weinig.
2393
2394         - <rdar://problem/4433248> use CoreText API instead of SPI on Leopard
2395
2396         Use CTFontCopyGraphicsFont and CTFontGetPlatformFont on Leopard instead
2397         of wkGetCGFontFromNSFont and wkGetNSFontATSUFontId, relying on NSFont
2398         and CTFontRef being toll-free bridged.
2399
2400         * WebCore.Tiger.exp:
2401         * WebCore.base.exp:
2402         * platform/graphics/mac/FontMac.mm:
2403         (WebCore::Font::drawGlyphs): Changed to use the cgFont() accessor.
2404         * platform/graphics/mac/FontPlatformData.h:
2405         Made m_cgFont a RetainPtr on Leopard.
2406         (WebCore::toCTFontRef): Added a function that encapsulates the
2407         toll-free bridging.
2408         (WebCore::FontPlatformData::FontPlatformData):
2409         (WebCore::FontPlatformData::cgFont): Added this accessor method.
2410         * platform/graphics/mac/FontPlatformDataMac.mm:
2411         (WebCore::FontPlatformData::FontPlatformData): Changed to use
2412         CoreText API on Leopard.
2413         (WebCore::FontPlatformData::setFont): Ditto.
2414         * platform/graphics/mac/SimpleFontDataMac.mm:
2415         (WebCore::initFontData):
2416         (WebCore::pathFromFont):
2417         (WebCore::SimpleFontData::platformInit):
2418         (WebCore::SimpleFontData::platformWidthForGlyph):
2419         * platform/mac/WebCoreSystemInterface.mm:
2420
2421 2008-03-12  David Harrison  <harrison@apple.com>
2422
2423         Reviewed by Darin.
2424
2425         <rdar://problem/5607382> CrashTracer: [REGRESSION] 2290 crashes in Safari at com.apple.WebCore: -[WebCoreAXObject isWebArea] + 8
2426
2427         The problem was that we lost track of the AX cache for a subframe when Frame::disconnectOwnerElement() was
2428         called, so we were unable to locate the AXObjects to de-register from AppKit's accessibility registry.
2429         Also saw that cache clearing was missing from Document::detach(), and fixed that.
2430         
2431         Also added a debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
2432         
2433         Lastly, RenderWidget::destroy() now skips trying to remove the AXObject if accessibility has never been enabled.
2434        
2435         * dom/Document.cpp:
2436         (WebCore::Document::attach):
2437         Assert that there is no AX cache (since there is no renderer).
2438         
2439         (WebCore::Document::detach):
2440         Destroy the AX cache installed on this document.
2441         
2442         (WebCore::Document::clearAXObjectCache):
2443         New. Destroy the AX cache associated with this document.
2444         
2445         (WebCore::Document::axObjectCache):
2446         Added some comments.
2447         
2448         * dom/Document.h:
2449         Declare clearAXObjectCache().
2450         
2451         * page/Frame.cpp:
2452         (WebCore::Frame::disconnectOwnerElement):
2453         Destroy the AX cache associated with this frame's document.
2454         
2455         * page/mac/AXObjectCacheMac.mm:
2456         (WebCore::AXObjectCache::remove):        
2457         * page/mac/WebCoreAXObject.mm:
2458         (-[WebCoreAXObject initWithRenderer:]):
2459         (-[WebCoreAXObject detach]):
2460         * rendering/RenderObject.cpp:
2461         (WebCore::RenderObject::RenderObject):
2462         (WebCore::RenderObject::~RenderObject):
2463         * rendering/RenderObject.h:
2464         (WebCore::RenderObject::setHasAXObject):
2465         (WebCore::RenderObject::hasAXObject):
2466         Add debug-only check that AXObjectCache::remove() not finding the AXObject is expected.
2467         
2468         * rendering/RenderWidget.cpp:
2469         (WebCore::RenderWidget::destroy):
2470         Skip call to remove the AXObject if accessibility has never been enabled. A simple speed optimization in the
2471         very common case that the accessibility APIs are not being used. Same as in RenderObject::destroy().
2472
2473 2008-03-12  Xan Lopez  <xan@gnome.org>
2474
2475         Reviewed by Alp Toker.
2476
2477         http://bugs.webkit.org/show_bug.cgi?id=15229
2478
2479         Add Pango font backend.
2480
2481         Original patch by Sven Herzberg <sven@imendio.com>
2482
2483         * GNUmakefile.am:
2484         * platform/graphics/gtk/FontCacheGtk.cpp:
2485         (WebCore::FontCache::fontExists):
2486         * platform/graphics/gtk/FontCustomPlatformDataPango.cpp: Added.
2487         (WebCore::FontCustomPlatformData::~FontCustomPlatformData):
2488         (WebCore::FontCustomPlatformData::fontPlatformData):
2489         (WebCore::releaseData):
2490         (WebCore::createFontCustomPlatformData):
2491         * platform/graphics/gtk/FontPlatformData.h:
2492         (WebCore::FontPlatformData::FontPlatformData):
2493         (WebCore::FontPlatformData::hash):
2494         * platform/graphics/gtk/FontPlatformDataPango.cpp: Added.
2495         (WebCore::FontPlatformData::FontPlatformData):
2496         (WebCore::FontPlatformData::init):
2497         (WebCore::FontPlatformData::~FontPlatformData):
2498         (WebCore::FontPlatformData::isFixedPitch):
2499         (WebCore::FontPlatformData::setFont):
2500         (WebCore::FontPlatformData::operator==):
2501         * platform/graphics/gtk/GlyphPageTreeNodePango.cpp: Added.
2502         (WebCore::pango_font_get_glyph):
2503         (WebCore::GlyphPage::fill):
2504         * platform/graphics/gtk/SimpleFontDataPango.cpp: Added.
2505         (WebCore::SimpleFontData::platformInit):
2506         (WebCore::SimpleFontData::platformDestroy):
2507         (WebCore::SimpleFontData::smallCapsFontData):
2508         (WebCore::SimpleFontData::containsCharacters):
2509         (WebCore::SimpleFontData::determinePitch):
2510         (WebCore::SimpleFontData::platformWidthForGlyph):
2511         (WebCore::SimpleFontData::setFont):
2512
2513 2008-03-12  Justin Garcia  <justin.garcia@apple.com>
2514
2515         Reviewed by Oliver.
2516         
2517         <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
2518         
2519         Fixes some (but not all) of the instances of:
2520         <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
2521         <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
2522
2523         * editing/InsertLineBreakCommand.cpp:
2524         (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
2525         the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
2526         * editing/RemoveFormatCommand.cpp:
2527         (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
2528
2529 2008-03-11  Alexey Proskuryakov  <ap@webkit.org>
2530
2531         Reviewed by Darin.
2532
2533         <rdar://problem/5640615> REGRESSION (Safari 2-3): Changing subframe encoding rules broke
2534         some sites.
2535
2536         Other browsers' behavior keeps changing; let's implement what Firefox and Opera do now:
2537         if the frame and subframe belong to the same site, then the encoding is inherited from parent
2538         frame to subframe. Otherwise, it is not.
2539
2540         Always inheriting the encoding would cause a security problem.
2541
2542         Tests: http/tests/misc/frame-default-enc-different-domain.html
2543                http/tests/misc/frame-default-enc-same-domain.html
2544                fast/encoding/frame-default-enc.html
2545
2546         * loader/FrameLoader.cpp:
2547         (WebCore::FrameLoader::write): Also removed a check for m_frame->document() being non-null -
2548         this function also has code that uses it without checking, so it must be safe.
2549
2550 2008-03-12  Mark Rowe  <mrowe@apple.com>
2551
2552         Gtk build fix.
2553
2554         * page/Frame.h: Forward-declare FramePrivate.
2555
2556 2008-03-11  Steve Falkenburg  <sfalken@apple.com>
2557
2558         Disable LTCG/PGO for all of WebCore for now.
2559         We'll re-enable this as part of follow-on PGO work.
2560         
2561         Reviewed by Oliver.
2562
2563         * WebCore.vcproj/WebCore.vcproj:
2564
2565 2008-03-11  Darin Adler  <darin@apple.com>
2566
2567         Reviewed by Sam.
2568
2569         - remove all bridge-related things from WebCore except the bridge itself
2570
2571         * WebCore.base.exp: Removed the bridge and setBridge functions.
2572
2573         * loader/FrameLoader.cpp:
2574         (WebCore::FrameLoader::detachFromParent): Removed call to the bridge's
2575         close method.
2576
2577         * page/Frame.cpp:
2578         (WebCore::Frame::~Frame): Removed call to setBridge(0).
2579         (WebCore::FramePrivate::FramePrivate): Removed initialization of m_bridge.
2580         * page/Frame.h: Removed setBridge and bridge functions.
2581         * page/FramePrivate.h: Removed m_bridge pointer.
2582         * page/mac/FrameMac.mm: Removed setBridge and bridge functions.
2583
2584         * page/mac/WebCoreFrameBridge.h: Added setWebCoreFrame: method.
2585         Removed bridgeForDOMDocument: and clearFrame methods.
2586         * page/mac/WebCoreFrameBridge.mm: Ditto.
2587         (-[WebCoreFrameBridge close]): Changed to set m_frame to 0 directly.
2588         (-[WebCoreFrameBridge setWebCoreFrame:]): Added.
2589
2590 2008-03-11  Darin Adler  <darin@apple.com>
2591
2592         - restored some code I removed in the Range change; this code can't go
2593           until the rest of the Range fix is in
2594
2595         * dom/Range.cpp:
2596         (WebCore::Range::commonAncestorContainer): Added back the check for 0
2597         that I removed erroneously in the Range patch.
2598         (WebCore::Range::processContents): Left in assertions I used to debug
2599         this.
2600
2601 2008-03-11  Darin Adler  <darin@apple.com>
2602
2603         - fix Release build
2604
2605         * platform/mac/ScrollViewMac.mm:
2606         (WebCore::ScrollView::setContentsPos): Don't use NSMakePoint.
2607
2608 2008-03-11  Darin Adler  <darin@apple.com>
2609
2610         Reviewed by Anders.
2611
2612         - simplify Mac code for ScrollView, since it's used only for FrameView
2613           and not in two different modes like it was historically
2614         - remove code depending on the bridge to get from an NSView to a WebCore::Frame
2615
2616         * bindings/objc/DOMHTML.mm:
2617         (-[DOMHTMLInputElement _rectOnScreen]): getDocumentView -> documentView.
2618
2619         * bridge/jni/jni_jsobject.cpp:
2620         (createRootObject): Instead of using WebCoreViewFactory to find the frame given
2621         and NSView, use the WebCoreFrameView interface to do it.
2622
2623         * editing/mac/EditorMac.mm:
2624         (WebCore::Editor::paste): getDocumentView -> documentView.
2625         * editing/mac/SelectionControllerMac.mm:
2626         (WebCore::SelectionController::notifyAccessibilityForSelectionChange): Ditto.
2627
2628         * page/FrameView.h: Fixed comment.
2629
2630         * page/InspectorController.cpp:
2631         (WebCore::InspectorController::drawNodeHighlight): Removed uneeded typecasts
2632         to ScrollView* since FrameView is derived from ScrollView.
2633
2634         * page/mac/EventHandlerMac.mm:
2635         (WebCore::EventHandler::focusDocumentView): getDocumentView -> documentView.
2636         * page/mac/FrameMac.mm:
2637         (WebCore::Frame::imageFromRect): Ditto.
2638         * page/mac/WebCoreAXObject.mm:
2639         (-[WebCoreAXObject position]): Ditto.
2640         (-[WebCoreAXObject doAXTextMarkerForPosition:]): Ditto.
2641         (-[WebCoreAXObject rendererForView:]): Updated code that used to use
2642         WebCoreBridgeHolder to use WebCoreFrameView instead.
2643
2644         * page/mac/WebCoreFrameBridge.mm:
2645         (-[WebCoreFrameBridge computePageRectsWithPrintWidthScaleFactor:printHeight:]):
2646         getDocumentView -> documentView.
2647
2648         * page/mac/WebCoreFrameView.h: Removed the WebCoreScrollbarMode type; we just
2649         use WebCore::ScrollbarMode directly. Renamed the WebCoreFrameView protocol to
2650         WebCoreFrameScrollView, since it's a protocol for the scroll view, not the
2651         frame view itself. Replaced WebCoreBridgeHolder protocol with WebCoreFrameView
2652         protocol, which returns a WebCore::Frame directly rather than a bridge.
2653
2654         * page/mac/WebCoreViewFactory.h: Eliminated the bridgeForView method.
2655
2656         * platform/ScrollView.h: Moved the constructor and destructor out of the
2657         class-specific #if blocks. Renamed Mac-specific function that gets the
2658         NSView for from getDocumentView to documentView and a scrollView function
2659         that returns an appropriately classed NSScrollView.
2660
2661         * platform/graphics/MediaPlayer.h: Changed type of parentWidget to FrameView
2662         instead of Widget.
2663         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2664         (WebCore::MediaPlayerPrivate::createQTMovieView): Removed unnecessary cast.
2665
2666         * platform/mac/PopupMenuMac.mm:
2667         (WebCore::PopupMenu::show): getDocumentView -> documentView.
2668         * platform/mac/ScrollViewMac.mm:
2669         (WebCore::ScrollView::ScrollView): Added.
2670         (WebCore::ScrollView::~ScrollView): Added.
2671         (WebCore::ScrollView::scrollView): Added.
2672         (WebCore::ScrollView::visibleWidth): Removed unused non-NSScrollView case.
2673         (WebCore::ScrollView::visibleHeight): Ditto.
2674         (WebCore::ScrollView::visibleContentRect): Ditto.
2675         (WebCore::ScrollView::visibleContentRectConsideringExternalScrollers): Ditto.
2676         (WebCore::ScrollView::contentsWidth): Ditto.
2677         (WebCore::ScrollView::contentsHeight): Ditto.
2678         (WebCore::ScrollView::contentsX): Ditto.
2679         (WebCore::ScrollView::contentsY): Ditto.
2680         (WebCore::ScrollView::scrollOffset): Ditto.
2681         (WebCore::ScrollView::scrollRectIntoViewRecursively): Ditto.
2682         (WebCore::ScrollView::setContentsPos): Ditto.
2683         (WebCore::ScrollView::setVScrollbarMode): Ditto.
2684         (WebCore::ScrollView::setHScrollbarMode): Ditto.
2685         (WebCore::ScrollView::setScrollbarsMode): Ditto.
2686         (WebCore::ScrollView::vScrollbarMode): Ditto.
2687         (WebCore::ScrollView::hScrollbarMode): Ditto.
2688         (WebCore::ScrollView::suppressScrollbars): Ditto.
2689         (WebCore::ScrollView::addChild): Ditto.
2690         (WebCore::ScrollView::resizeContents): Ditto.
2691         (WebCore::ScrollView::updateContents): Ditto.
2692         (WebCore::ScrollView::contentsToWindow): Ditto.
2693         (WebCore::ScrollView::windowToContents): Ditto.
2694         (WebCore::ScrollView::setStaticBackground): Ditto.
2695         (WebCore::ScrollView::documentView): Renamed and removed unused case.
2696         (WebCore::ScrollView::scrollbarUnderMouse): Removed incorrect comment.
2697
2698         * platform/mac/WidgetMac.mm:
2699         (WebCore::Widget::getOuterView): Update for protocol name change.
2700
2701         * rendering/RenderThemeMac.mm:
2702         (WebCore::RenderThemeMac::paintCheckbox): getDocumentView -> documentView.
2703         (WebCore::RenderThemeMac::paintRadio): Ditto.
2704         (WebCore::RenderThemeMac::paintButton): Ditto.
2705         (WebCore::RenderThemeMac::paintMenuList): Ditto.
2706         (WebCore::RenderThemeMac::paintSliderThumb): Ditto.
2707         (WebCore::RenderThemeMac::paintSearchField): Ditto.
2708         (WebCore::RenderThemeMac::paintSearchFieldCancelButton): Ditto.
2709         (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration): Ditto.
2710         (WebCore::RenderThemeMac::paintSearchFieldResultsButton): Ditto.
2711
2712 2008-03-11  Brent Fulgham  <bfulgham@gmail.com>
2713
2714         Reviewed by Adam Roben.
2715
2716         Split CookieJarWin.cpp into CFNet and non-CFNet versions to
2717         reduce the massive amount of conditionalization in the file.
2718         (see http://bugs.webkit.org/show_bug.cgi?id=17788)
2719
2720         * WebCore.vcproj/WebCore.vcproj:
2721         * platform/network/win/CookieJarCFNetWin.cpp: Copied from WebCore/platform/network/win/CookieJarWin.cpp.
2722         (WebCore::setCookies):
2723         (WebCore::cookies):
2724         (WebCore::cookiesEnabled):
2725         * platform/network/win/CookieJarWin.cpp:
2726         (WebCore::setCookies):
2727         (WebCore::cookies):
2728         (WebCore::cookiesEnabled):
2729
2730 2008-03-11  Darin Adler  <darin@apple.com>
2731
2732         Reviewed by Sam.
2733
2734         - eliminate the remaining parts of WebCoreBridge used for calls to WebKit from WebCore
2735
2736         * page/ChromeClient.h: Added new client functions to replace calls up to WebKit
2737         that were formerly handled by the bridge.
2738
2739         * page/Frame.h: Removed unneeded declarations. Moved declarations of script-specific
2740         functions to a ScriptController section. Removed willPopupMenu.
2741
2742         * page/mac/ChromeMac.mm:
2743         (WebCore::Chrome::focusNSView): Changed to call firstResponder and makeFirstResponder
2744         via the client instead of the bridge.
2745
2746         * page/mac/EventHandlerMac.mm:
2747         (WebCore::EventHandler::passMouseDownEventToWidget): Changed to call firstResponder
2748         and makeFirstResponder via the chrome client instead of the bridge.
2749
2750         * page/mac/FrameMac.mm: Removed willPopupMenu.
2751
2752         * page/mac/WebCoreFrameBridge.h: Removed WebCoreFrameBridge protocol and
2753         SubclassResponsibility category. Also removed some unneeded imports.
2754
2755         * platform/mac/PopupMenuMac.mm:
2756         (WebCore::PopupMenu::show): Call willPopUpMenu on chrome client instead of frame.
2757
2758         * platform/mac/WidgetMac.mm:
2759         (WebCore::Widget::setIsSelected): Call functions directly on the view rather than
2760         calling via the bridge.
2761
2762 2008-03-11  Darin Adler  <darin@apple.com>
2763
2764         Reviewed by Mitz.
2765
2766         - make some Range improvements (preparation for Range support for DOM mutation)
2767
2768         Made constructors private, added create functions.
2769         Made refcount start at 1 rather than starting at 0 and being incremented.
2770         Made Range use two Position objects for the start/end container/offset pairs.
2771
2772         * WebCore.base.exp: Updated.
2773
2774         * dom/Document.cpp:
2775         (WebCore::Document::createRange): Changed to use Range::create.
2776         (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
2777
2778         * dom/Position.cpp:
2779         (WebCore::Position::formatForDebugger): Updated for member variable name change.
2780         (WebCore::Position::showTreeForThis): Ditto.
2781         (WebCore::startPosition): Changed to use Range::startPosition.
2782         (WebCore::endPosition): Changed to use Range::endPosition.
2783
2784         * dom/Position.h: Made the data members public and renamed them to container
2785         and offset. But since offset() is already a function, temporarily used posOffset
2786         for the data member. Later we'll get rid of offset(). Made more functions inline.
2787         Removed the constructor that takes a PositionIterator.
2788
2789         * dom/PositionIterator.cpp:
2790         (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
2791         that used to be in Position.
2792         * dom/PositionIterator.h: Added conversion operator to produce a Position.
2793         Removed friend declaration for Position.
2794
2795         * dom/Range.cpp:
2796         (WebCore::Range::Range): Updated constructors for data member changes and made
2797         them use a refcount of 1.
2798         (WebCore::Range::create): Added.
2799         (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
2800         is now indicated by m_start.container of 0. Also updated to use m_start instead
2801         of the old m_startContainer.
2802         (WebCore::Range::startOffset): Ditto.
2803         (WebCore::Range::endContainer): Ditto.
2804         (WebCore::Range::endOffset): Ditto.
2805         (WebCore::Range::commonAncestorContainer): Ditto.
2806         (WebCore::Range::collapsed): Ditto.
2807         (WebCore::Range::setStart): Ditto.
2808         (WebCore::Range::setEnd): Ditto.
2809         (WebCore::Range::collapse): Ditto.
2810         (WebCore::Range::isPointInRange): Ditto.
2811         (WebCore::Range::comparePoint): Ditto.
2812         (WebCore::Range::compareNode): Ditto.
2813         (WebCore::Range::compareBoundaryPoints): Ditto.
2814         (WebCore::Range::boundaryPointsValid): Ditto.
2815         (WebCore::Range::deleteContents): Ditto.
2816         (WebCore::Range::intersectsNode): Ditto.
2817         (WebCore::Range::processContents): Ditto.
2818         (WebCore::Range::extractContents): Ditto.
2819         (WebCore::Range::cloneContents): Ditto.
2820         (WebCore::Range::insertNode): Ditto.
2821         (WebCore::Range::toString): Ditto.
2822         (WebCore::Range::text): Ditto.
2823         (WebCore::Range::createContextualFragment): Ditto.
2824         (WebCore::Range::detach): Ditto.
2825         (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
2826         multiple calls to the virtual nodeType() function.
2827         (WebCore::Range::cloneRange): Ditto.
2828         (WebCore::Range::setStartAfter): Ditto.
2829         (WebCore::Range::setEndBefore): Ditto.
2830         (WebCore::Range::setEndAfter): Ditto.
2831         (WebCore::Range::selectNode): Ditto.
2832         (WebCore::Range::selectNodeContents): Ditto.
2833         (WebCore::Range::surroundContents): Ditto.
2834         (WebCore::Range::setStartBefore): Ditto.
2835         (WebCore::Range::checkDeleteExtract): Ditto.
2836         (WebCore::Range::containedByReadOnly): Ditto.
2837         (WebCore::Range::firstNode): Ditto.
2838         (WebCore::Range::editingStartPosition): Ditto.
2839         (WebCore::Range::pastLastNode): Ditto.
2840         (WebCore::Range::addLineBoxRects): Ditto.
2841         (WebCore::Range::formatForDebugger): Ditto.
2842         (WebCore::operator==): Ditto.
2843         (WebCore::rangeOfContents): Ditto.
2844         (WebCore::Range::maxStartOffset): Ditto.
2845         (WebCore::Range::maxEndOffset): Ditto.
2846
2847         * dom/Range.h: Made constructors private. Added create functions.
2848         Added getters for startContainer/Offset and endContainer/Offset that
2849         return 0 instead of an exception for detached ranges that are inline
2850         and don't require an ExceptionCode out parameter. Changed the parameters
2851         to setStart and setEnd to PassRefPtr. Removed isDetached function.
2852         Made ActionType and processContents private. Made startPosition and
2853         endPosition inlines and have then return const&. Renamed startNode and
2854         pastEndNode to firstNode and pastLastNode to reduce the chance of
2855         confusion with startContainer/endContainer. Used Position for m_start
2856         and m_end instead of separate container and offset members. Changed
2857         maxStartOffset and maxEndOffset into int to match other offsets.
2858
2859         * editing/ApplyStyleCommand.cpp:
2860         (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
2861         (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
2862         * editing/CompositeEditCommand.cpp:
2863         (WebCore::CompositeEditCommand::inputText): Ditto.
2864         (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
2865         * editing/DeleteSelectionCommand.cpp:
2866         (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
2867         * editing/Editor.cpp:
2868         (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
2869         (WebCore::Editor::setComposition): Changed to use Range::create.
2870         (WebCore::paragraphAlignedRangeForRange): Ditto.
2871         (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
2872         isDetached and check for 0 from startContainer instead.
2873         (WebCore::Editor::compositionRange): Changed to use Range::create.
2874         * editing/EditorCommand.cpp:
2875         (WebCore::unionDOMRanges): Ditto.
2876         * editing/Selection.cpp:
2877         (WebCore::Selection::toRange): Ditto.
2878         * editing/TextIterator.cpp:
2879         (WebCore::TextIterator::TextIterator): Changed for firstNode and pastLastNode
2880         name change.
2881         (WebCore::TextIterator::range): Changed to use Range::create.
2882         (WebCore::SimplifiedBackwardsTextIterator::range): Ditto.
2883         (WebCore::TextIterator::subrange): Ditto.
2884         * editing/VisiblePosition.cpp:
2885         (WebCore::makeRange): Ditto.
2886         * editing/VisiblePosition.h: Added now-needed include.
2887         * editing/htmlediting.cpp:
2888         (WebCore::indexForVisiblePosition): Changed to use Range::create.
2889         (WebCore::avoidIntersectionWithNode): Changed to get rid of check for
2890         isDetached and check for 0 instead and to use Range::create.
2891         * editing/markup.cpp:
2892         (WebCore::renderedText): Changed to use Range::create.
2893         (WebCore::createMarkup): Changed to no longer use isDetached and also
2894         for new firstNode/pastEndNode names.
2895         (WebCore::createFragmentFromText): Ditto.
2896         * editing/visible_units.cpp:
2897         (WebCore::previousBoundary): Changed to use Range::create.
2898         * page/mac/WebCoreFrameBridge.mm:
2899         (-[WebCoreFrameBridge convertToNSRange:]): Changed to no longer use
2900         isDetached().
2901         * rendering/RenderTextControl.cpp:
2902         (WebCore::RenderTextControl::visiblePositionForIndex): Changed to use Range::create.
2903         (WebCore::RenderTextControl::indexForVisiblePosition): Ditto.
2904
2905 2008-03-11  Daniel Zucker <zucker@wake3.com>
2906
2907         Reviewed by Adam Roben.
2908
2909         There are a handful of placed where the use of CFNetwork-specific
2910         calls are protected by PLATFORM(CF).  Revise to use the more specific
2911         USE(CFNETWORK) macro.  (See http://bugs.webkit.org/show_bug.cgi?id=17783) 
2912
2913         * platform/network/ProtectionSpace.cpp:  Change PLATFORM(CF) to USE(CFNETWORK)
2914         * platform/network/ResourceHandle.cpp: Change PLATFORM(CF) to USE(CFNETWORK)
2915         * platform/network/win/CookieJarWin.cpp:  Correct error in
2916           InternetGetCookie call.  Conditionalize 'cookiesEnabled' the same
2917           as all other implementations in this file.
2918
2919 2008-03-11  Xan Lopez  <xan@gnome.org>
2920
2921         Reviewed by Alp Toker.
2922
2923         http://bugs.webkit.org/show_bug.cgi?id=16476
2924
2925         Add libsoup HTTP backend.
2926         
2927         * GNUmakefile.am:
2928         * platform/network/ResourceHandleInternal.h:
2929         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2930         * platform/network/soup/AuthenticationChallenge.h: Added.
2931         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2932         * platform/network/soup/ResourceError.h: Added.
2933         (WebCore::ResourceError::ResourceError):
2934         * platform/network/soup/ResourceHandleSoup.cpp: Added.
2935         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
2936         (WebCore::ResourceHandle::~ResourceHandle):
2937         (WebCore::dataCallback):
2938         (WebCore::parseDataUrl):
2939         (WebCore::ResourceHandle::start):
2940         (WebCore::ResourceHandle::cancel):
2941         (WebCore::ResourceHandle::bufferedData):
2942         (WebCore::ResourceHandle::supportsBufferedData):
2943         (WebCore::ResourceHandle::setDefersLoading):
2944         (WebCore::ResourceHandle::loadsBlocked):
2945         (WebCore::ResourceHandle::willLoadFromCache):
2946         * platform/network/soup/ResourceRequest.h: Copied from WebCore/platform/network/curl/ResourceRequest.h.
2947         (WebCore::ResourceRequest::ResourceRequest):
2948         (WebCore::ResourceRequest::doUpdatePlatformRequest):
2949         * platform/network/soup/ResourceResponse.h: Added.
2950         (WebCore::ResourceResponse::ResourceResponse):
2951         (WebCore::ResourceResponse::setResponseFired):
2952         (WebCore::ResourceResponse::responseFired):
2953         (WebCore::ResourceResponse::doUpdateResourceResponse):
2954
2955 2008-03-11  Rodney Dawes  <dobey@wayofthemonkey.com>
2956
2957         Fix Qt build.
2958
2959         * plugins/qt/PluginDataQt.cpp:
2960         (PluginData::initPlugins)
2961
2962 2008-03-11  Adam Roben  <aroben@apple.com>
2963
2964         Make attribute quoting in DOM view more consistent with source view
2965
2966         Two changes which make the DOM view more consistent with source view:
2967          1) We now quote all attribute values, including URLs
2968          2) The quotes around the values are now purple, matching the left and
2969             right angle brackets that surround the tag
2970
2971         One bug fixed by these changes:
2972          1) The entire URL is selected for editing when you double-click a URL
2973             that is an attribute value. Previously, the first and last
2974             characters were not included in the selection.
2975
2976         Reviewed by Darin.
2977
2978         * page/inspector/DocumentPanel.js:
2979         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Don't need
2980         to account for the quotes around attribute values anymore because the
2981         quotes are now outside the webkit-html-attribute-value span.
2982         * page/inspector/utilities.js:
2983         (nodeTitleInfo): Quote all attribute values, including URLs, and place
2984         the quotes outside the webkit-html-attribute-value span.
2985
2986 2008-03-11  Adam Roben  <aroben@apple.com>
2987
2988         Stop including pthread.h in WebCore on Windows
2989
2990         Reviewed by Darin.
2991
2992         * WebCore.vcproj/WebCore.vcproj:
2993           - Changed the include path to not contain pthreads/
2994           - Let VS remove a duplicate FileConfiguration element
2995           - Let VS have its way with the file ordering
2996         * WebCorePrefix.h: Made the #include of pthread.h be compiled out on
2997         Windows.
2998         * loader/FTPDirectoryDocument.cpp: Added a Windows-specific #define of
2999         localtime_r (pthread.h was providing a macro that substituted plain
3000         old localtime before, but localtime_s is "more secure", so I went with
3001         that).
3002         * loader/FTPDirectoryParser.cpp: Ditto for gmtime_r.
3003
3004 2008-03-11  Adam Roben  <aroben@apple.com>
3005
3006         Roll out r30961 since it broke the default site icon on Windows
3007
3008         * loader/icon/IconDatabase.cpp:
3009         (WebCore::IconDatabase::defaultIcon):
3010
3011 2008-03-11  Dan Bernstein  <mitz@apple.com>
3012
3013         Reviewed by Darin Adler.
3014
3015         - clean up line layout code
3016
3017         * platform/graphics/GraphicsContext.cpp:
3018         (WebCore::TextRunIterator::increment): Removed the resolver parameter.
3019         (WebCore::GraphicsContext::drawBidiText): Adjusted for changes to
3020         createBidiRunsForLine(), which no longer takes a start parameter.
3021         * platform/text/BidiResolver.h:
3022         (WebCore::BidiResolver::): Made Noncopyable and removed the
3023         m_adjustEmbedding member variable.
3024         (WebCore::BidiResolver::position): Added. Returns the resolver's current
3025         position.
3026         (WebCore::BidiResolver::setPosition): Added. Sets the resolver's current
3027         position without changing any other state.
3028         (WebCore::BidiResolver::increment): Added. Advances the resolver to the
3029         next position, allowing the iterator to push and pop embedding.
3030         (WebCore::BidiResolver::appendRun): Removed the resolver parameter in
3031         the call to increment().
3032         (WebCore::BidiResolver::embed): Removed code to save, set and restore
3033         m_adjustEmbedding.
3034         (WebCore::BidiResolver::createBidiRunsForLine): Changed to not take a
3035         'start' iterator. Instead, start at the current position. Removed code
3036         to set m_adjustEmbedding. Changed for noncopyability.
3037         * rendering/RenderBlock.h:
3038         * rendering/bidi.cpp:
3039         (WebCore::bidiNext): Made the resolver parameter optional. Changed to
3040         null-check the 'end of inline' pointer only twice.
3041         (WebCore::bidiFirst): Made the resolver parameter optional.
3042         (WebCore::BidiIterator::increment): Ditto.
3043         (WebCore::BidiState::increment): Added. Overrides the default
3044         BidiResolver::increment() method by passing the resolver to
3045         BidiIterator::increment().
3046         (WebCore::checkMidpoints): Removed the resolver parameter.
3047         (WebCore::BidiState::appendRun): Removed code to save, set and restore
3048         m_adjustEmbedding. Adjusted for change to increment().
3049         (WebCore::RenderBlock::bidiReorderLine): Removed the 'start' parameter
3050         and unreachable code.
3051         (WebCore::buildCompactRuns): Adjusted for changes to BidiResolver/
3052         (WebCore::RenderBlock::layoutInlineChildren): Moved code to initialize
3053         the resolver from this method to determineStartPosition(). Unified the
3054         resolver with the 'start' iterator. Removed unreachable code. Moved one
3055         statement from the beginning of the while loop to the end.
3056         (WebCore::RenderBlock::determineStartPosition): Moved code to initialize
3057         the resolver from layoutInlineChildren() into this method.
3058         (WebCore::RenderBlock::matchedEndLine): Adjusted for the resolver and
3059         the 'start' iterator being one object.
3060         (WebCore::skipNonBreakingSpace): Made the parameter const.
3061         (WebCore::requiresLineBox): Ditto.
3062         (WebCore::RenderBlock::generatesLineBoxesForInlineChild): Adjusted for
3063         the change to BidiIterator::increment().
3064         (WebCore::RenderBlock::skipWhitespace): Made two versions of this
3065         method, one for BidiIterator and one for BidiState.
3066         (WebCore::shouldSkipWhitespaceAfterStartObject): Removed the resolver
3067         parameter.
3068         (WebCore::RenderBlock::findNextLineBreak): Removed the resolver
3069         parameter. Removed calls to setAdjustEmbedding(). Removed the 'previous'
3070         variable and changed the 'last' variable to do its job.
3071         * rendering/bidi.h:
3072
3073 2008-03-10  Adam Roben  <aroben@apple.com>
3074
3075         Part of Bug 17224: DOM nodes/attributes should be editable
3076
3077         <http://bugs.webkit.org/show_bug.cgi?id=17224>
3078         <rdar://problem/5732825>
3079
3080         This patch makes text nodes editable via double-click.
3081
3082         Reviewed by Tim.
3083
3084         * page/inspector/DocumentPanel.js:
3085         (WebInspector.DOMNodeTreeElement._startEditing):
3086           - Moved most of this code to _startEditingAttribute
3087           - Calls _startEditingTextNode or _startEditingAttribute as
3088             appropriate
3089         (WebInspector.DOMNodeTreeElement._startEditingAttribute): Added. Code
3090         came from _startEditing.
3091         (WebInspector.DOMNodeTreeElement._startEditingTextNode): Added.
3092         (WebInspector.DOMNodeTreeElement._textNodeEditingCommitted): Added.
3093         (WebInspector.DOMNodeTreeElement._editingCancelled): Renamed from
3094         _attributeEditingCancelled.
3095         * page/inspector/utilities.js:
3096         (nodeTitleInfo): Wrap text nodes in a webkit-html-text-node span so
3097         that we can easily recognize/edit them.
3098
3099 2008-03-11  Holger Hans Peter Freyther  <zecke@selfish.org>
3100
3101         Reviewed by Darin.
3102
3103         r25512 inlined the urlIcon to improve the startup time of Safari on Mac. Inlining is
3104         not suitable for platforms where this icon is themable. E.g. the Qt platform is allowing
3105         to theme this icon and the Gtk+ platform will probably end up with themable icons
3106         as well.
3107         
3108         Remove dead code from the windows port and move the urlIcon from the windows
3109         directory to the Resource directory to be used by Qt and other ports.
3110         
3111         Ifdef the usage of the built-in icon in IconDatabase.cpp and for Qt do not use
3112         it. Gtk+ currently has no proper implementation of Image::loadPlatformResource but
3113         once it does it wants to use this for getting the urlIcon as well.
3114
3115         * Resources/urlIcon.png: Renamed from WebKit/win/WebKit.vcproj/urlIcon.png.
3116         * loader/icon/IconDatabase.cpp:
3117         (WebCore::IconDatabase::defaultIcon):
3118
3119 2008-03-11  Tor Arne Vestbø  <tavestbo@trolltech.com>
3120
3121         Reviewed by Darin.
3122
3123         Implemented HTML media element support for QtWebKit, using Phonon.
3124
3125         http://bugs.webkit.org/show_bug.cgi?id=17766
3126
3127         * WebCore.pro:
3128         * platform/graphics/MediaPlayer.cpp:
3129         * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: Added.
3130         (debugMediaObject):
3131         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3132         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
3133         (WebCore::MediaPlayerPrivate::getSupportedTypes):
3134         (WebCore::MediaPlayerPrivate::hasVideo):
3135         (WebCore::MediaPlayerPrivate::load):
3136         (WebCore::MediaPlayerPrivate::cancelLoad):
3137         (WebCore::MediaPlayerPrivate::play):
3138         (WebCore::MediaPlayerPrivate::pause):
3139         (WebCore::MediaPlayerPrivate::paused):
3140         (WebCore::MediaPlayerPrivate::seek):
3141         (WebCore::MediaPlayerPrivate::seeking):
3142         (WebCore::MediaPlayerPrivate::duration):
3143         (WebCore::MediaPlayerPrivate::currentTime):
3144         (WebCore::MediaPlayerPrivate::setEndTime):
3145         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
3146         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
3147         (WebCore::MediaPlayerPrivate::bytesLoaded):
3148         (WebCore::MediaPlayerPrivate::totalBytesKnown):
3149         (WebCore::MediaPlayerPrivate::totalBytes):
3150         (WebCore::MediaPlayerPrivate::setRate):
3151         (WebCore::MediaPlayerPrivate::setVolume):
3152         (WebCore::MediaPlayerPrivate::setMuted):
3153         (WebCore::MediaPlayerPrivate::dataRate):
3154         (WebCore::MediaPlayerPrivate::networkState):
3155         (WebCore::MediaPlayerPrivate::readyState):
3156         (WebCore::MediaPlayerPrivate::updateStates):
3157         (WebCore::MediaPlayerPrivate::setVisible):
3158         (WebCore::MediaPlayerPrivate::setRect):
3159         (WebCore::MediaPlayerPrivate::loadStateChanged):
3160         (WebCore::MediaPlayerPrivate::rateChanged):
3161         (WebCore::MediaPlayerPrivate::sizeChanged):
3162         (WebCore::MediaPlayerPrivate::timeChanged):
3163         (WebCore::MediaPlayerPrivate::volumeChanged):
3164         (WebCore::MediaPlayerPrivate::didEnd):
3165         (WebCore::MediaPlayerPrivate::loadingFailed):
3166         (WebCore::MediaPlayerPrivate::naturalSize):
3167         (WebCore::MediaPlayerPrivate::eventFilter):
3168         (WebCore::MediaPlayerPrivate::repaint):
3169         (WebCore::MediaPlayerPrivate::paint):
3170         (WebCore::MediaPlayerPrivate::stateChanged):
3171         (WebCore::MediaPlayerPrivate::tick):
3172         (WebCore::MediaPlayerPrivate::metaDataChanged):
3173         (WebCore::MediaPlayerPrivate::seekableChanged):
3174         (WebCore::MediaPlayerPrivate::hasVideoChanged):
3175         (WebCore::MediaPlayerPrivate::bufferStatus):
3176         (WebCore::MediaPlayerPrivate::finished):
3177         (WebCore::MediaPlayerPrivate::currentSourceChanged):
3178         (WebCore::MediaPlayerPrivate::aboutToFinish):
3179         (WebCore::MediaPlayerPrivate::prefinishMarkReached):
3180         (WebCore::MediaPlayerPrivate::totalTimeChanged):
3181         * platform/graphics/qt/MediaPlayerPrivatePhonon.h: Added.
3182         (WebCore::MediaPlayerPrivate::):
3183         (WebCore::MediaPlayerPrivate::isAvailable):
3184
3185 2008-03-10  Sam Weinig  <sam@webkit.org>
3186
3187         Reviewed by Beth Dakin.
3188
3189         Throw a SECURITY_ERR when accessing a tainted canvas
3190         by CanvasRenderingContext2D::getImageData() and
3191         HTMLCanvasElement::toDataURL().
3192
3193         * html/CanvasRenderingContext2D.cpp:
3194         (WebCore::CanvasRenderingContext2D::getImageData):
3195         * html/CanvasRenderingContext2D.h:
3196         * html/CanvasRenderingContext2D.idl:
3197         * html/HTMLCanvasElement.cpp:
3198         (WebCore::HTMLCanvasElement::toDataURL):
3199         * html/HTMLCanvasElement.h:
3200         * html/HTMLCanvasElement.idl:
3201
3202 2008-03-10  Justin Garcia  <justin.garcia@apple.com>
3203
3204         Reviewed by Sam.
3205
3206         <rdar://problem/5779984> REGRESSION (r30391): GMail: Safari won't display the Edit Link dialog
3207
3208         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3209         (WebCore::hasCSSPropertyNamePrefix): Fixed a typo.  The code was only
3210         comparing the first character of the prefix to the first character
3211         of the property name.
3212
3213 2008-03-10  Andre Boule  <aboule@apple.com>
3214
3215         Reviewed by Beth.
3216
3217         Hold off on initializing the frame to avoid the RenderView getting 
3218         a null FrameView. This could potentially cause problems.
3219
3220         * svg/graphics/SVGImage.cpp:
3221         (WebCore::SVGImage::dataChanged):
3222
3223 2008-03-10  Darin Adler  <darin@apple.com>
3224
3225         - try to fix Qt build
3226
3227         * bridge/qt/qt_runtime.cpp:
3228         (KJS::Bindings::convertQVariantToValue): Change KJS::UChar to UChar.
3229
3230 2008-03-10  Darin Adler  <darin@apple.com>
3231
3232         Reviewed by Antti.
3233
3234         - fix <rdar://problem/3059610> VIP: links opened in new frame, window, or tab
3235           should be redrawn as visited immediately
3236         - fix <rdar://problem/4382809> Going "back" a page doesn't change the color of
3237           the visited URL at directory.umi
3238         - fix http://bugs.webkit.org/show_bug.cgi?id=4941
3239           Visited links should be marked as visited
3240         - fix http://bugs.webkit.org/show_bug.cgi?id=7960
3241           REGRESSION: Visited link color doesn't displayed after loading page from cache
3242
3243         We now mark all links on a page as "changed" at the appropriate times.
3244
3245         * WebCore.base.exp: Update since I made completeURL be a const member function.
3246
3247         * css/CSSStyleSelector.cpp: Got rid of some unneeded globals that could be turned
3248         into locals. Also changed some static data members to file-scoped globals with
3249         internal linkage. Renamed the globals to get rid of the m_ prefix. Changed the
3250         prefix on m_styleNotYetAvailable to s_styleNotYetAvailable.
3251         (WebCore::CSSStyleSelector::CSSStyleSelector): Updated for name changes.
3252         (WebCore::parseUASheet): Tweak the comment.
3253         (WebCore::CSSStyleSelector::loadDefaultStyle): Updated for name changes and to
3254         use local variables instead of globals where possible.
3255         (WebCore::CSSStyleSelector::checkPseudoState): Made this a member function so
3256         it can store the link in a hash. Also changed it to have a return value instead
3257         of having it modify a global variable. Added code to put the hash into a set so
3258         we can tell later if this is one of the links that affects this page.
3259         (WebCore::CSSStyleSelector::canShareStyleWithElement): Updated for the change to
3260         checkPseudoState.
3261         (WebCore::CSSStyleSelector::matchUARules): Updated for name changes.
3262         (WebCore::CSSStyleSelector::styleForElement): Ditto.
3263         (WebCore::CSSStyleSelector::adjustRenderStyle): Ditto.
3264         (WebCore::CSSStyleSelector::pseudoStyleRulesForElement): Changed code to read
3265         the SVG style sheet to use a boolean global and put it right here in the function
3266         since this is the only code that needs to know about it.
3267         (WebCore::CSSStyleSelector::checkOneSelector): Updated for name changes.
3268         (WebCore::colorForCSSValue): Moved code inside the function that is not needed
3269         anywhere else.
3270         (WebCore::CSSStyleSelector::getColorFromPrimitiveValue): Updaed for the change
3271         to checkPseudoState.
3272         (WebCore::CSSStyleSelector::allVisitedStateChanged): Added. Calls setChanged on
3273         all links if there were any in the set.
3274         (WebCore::CSSStyleSelector::visitedStateChanged): Added. Calls setChanged on all
3275         links if the one that changed is in the set.
3276
3277         * css/CSSStyleSelector.h: Removed unused StyleSelector class and State enum. Made
3278         CSSStyleSelector derive from Noncopyable. Made lots of member functions private that
3279         didn't need to be public, and removed others that could be made into non-member
3280         functions. Changed pseudoStyleRulesForElement to take a const String& instead of
3281         a StringImpl*. Added new allVisitedStateChanged and visitedStateChanged functions.
3282         Got rid of unneeded friend declarations.
3283
3284         * dom/Document.cpp:
3285         (WebCore::Document::completeURL): Made const.
3286         (WebCore::findSlashDotDotSlash): Moved here from PageGroup.
3287         (WebCore::findSlashSlash): Ditto.
3288         (WebCore::findSlashDotSlash): Ditto.
3289         (WebCore::containsColonSlashSlash):
3290         (WebCore::cleanPath): Ditto.
3291         (WebCore::matchLetter): Ditto.
3292         (WebCore::needsTrailingSlash): Ditto.
3293         (WebCore::Document::visitedLinkHash): Moved this here from PageGroup. This is
3294         the poor-man's completeURL function. The idea of putting it here is that this
3295         way it can be alongside the real completeURL function. Later we should figure out
3296         a way to make this function share more code with the real thing and match behavior.
3297
3298         * dom/Document.h: Marked completeURL function const. Added visitedLinkHash function.
3299
3300         * page/DOMWindow.cpp:
3301         (WebCore::DOMWindow::getMatchedCSSRules): Updated for change to CSSStyleSelector.
3302
3303         * page/Page.cpp:
3304         (WebCore::Page::allVisitedStateChanged): Added. Calls allVisitedStateChanged on all
3305         style selectors.
3306         (WebCore::Page::visitedStateChanged): Ditto.
3307         * page/Page.h: Added the above functions.
3308
3309         * page/PageGroup.cpp:
3310         (WebCore::PageGroup::isLinkVisited): Changed to take a visitedLinkHash parameter.
3311         The CSSStyleSelector now handles actually computing the hash, and it does so by
3312         calling code in Document.
3313         (WebCore::PageGroup::addVisitedLink): Refactored so the two overloaded copies share
3314         a bit more code. Added code that calls visitedStateChanged if a new link was added.
3315         (WebCore::PageGroup::removeVisitedLinks): Added code to call allVisitedStateChanged
3316         if any visited links are removed.
3317         * page/PageGroup.h: Include StringHash.h instead of having the AlreadyHashed struct
3318         definition here.
3319
3320         * platform/text/StringHash.h:
3321         (WebCore::CaseFoldingHash::hash): Tweaked to make this a bit more consistent with
3322         the StringImpl::computeHash function, using the same technique for avoiding 0.
3323         (WebCore::AlreadyHashed::hash): Added. Was formerly in PageGroup.h.
3324         (WebCore::AlreadyHashed::avoidDeletedValue): Added. Was formerly in PageGroup.cpp.
3325
3326         * rendering/RenderStyle.cpp:
3327         (WebCore::RenderStyle::isStyleAvailable): Changed to use an inline function instead
3328         of getting directly at a data member so the data member could be made private.
3329
3330         * loader/FrameLoader.cpp:
3331         (WebCore::FrameLoader::scrollToAnchor): Added call to updateHistoryForAnchorScroll.
3332         (WebCore::FrameLoader::updateHistoryForAnchorScroll): Added.
3333         * loader/FrameLoader.h: Added updateHistoryForAnchorScroll.
3334
3335 2008-03-10  Adam Roben  <aroben@apple.com>
3336
3337         Part of Bug 17224: DOM nodes/attributes should be editable
3338
3339         <http://bugs.webkit.org/show_bug.cgi?id=17224>
3340         <rdar://problem/5732825>
3341
3342         This patch makes DOM attributes editable via double-click.
3343
3344         Reviewed by Tim.
3345
3346         * page/inspector/DocumentPanel.js:
3347         (WebInspector.DOMNodeTreeElement.onmousedown): Don't do anything if
3348         we're being edited, since we want default editing behaviors to work.
3349         (WebInspector.DOMNodeTreeElement.ondblclick): Try to start editing
3350         before doing anything else.
3351         (WebInspector.DOMNodeTreeElement._startEditing): Added. Currently only
3352         lets you edit attributes.
3353         (WebInspector.DOMNodeTreeElement._attributeEditingCommitted): Added.
3354         Uses a scratch element to get the new attribute(s) parsed, then sets
3355         the attribute(s) on the node in the inspected document.
3356         (WebInspector.DOMNodeTreeElement._attributeEditingCancelled): Added.
3357         (WebInspector.DOMNodeTreeElement._updateTitle): Added. Refreshes the
3358         representation of the node in the Inspector's DOM tree to reflect
3359         the node's current state.
3360         * page/inspector/inspector.css: Made the .editing class apply
3361         everywhere.
3362         * page/inspector/utilities.js:
3363         (nodeTitleInfo): Changed to surround attribute name/value pairs in a
3364         webkit-html-attribute span so that we can easily edit the pair as a
3365         whole.
3366
3367 2008-03-10  David Kilzer  <ddkilzer@apple.com>
3368
3369         Fix 64-bit builds.
3370
3371         Reviewed by Stephanie.
3372
3373         WebCore.exp only gets generated once for both 32-bit and 64-bit builds,
3374         so we must exclude the _NPN symbols when creating WebCore.LP64.exp.
3375
3376         * WebCore.xcodeproj/project.pbxproj: Reverted build phase shell code to
3377         r30826 to remove _NPN symbols from 64-bit builds in WebCore.LP64.exp.
3378
3379 2008-03-10  Eric Seidel  <eric@webkit.org>
3380
3381         Reviewed by Darin.
3382
3383         Remove KJS::UChar, use ::UChar instead
3384         http://bugs.webkit.org/show_bug.cgi?id=17017
3385
3386         To functional changes, thus no tests.
3387
3388         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3389         (WebCore::hasCSSPropertyNamePrefix):
3390         (WebCore::cssPropertyName):
3391         * bindings/js/JSDOMWindowBase.cpp:
3392         (WebCore::windowProtoFuncAToB):
3393         (WebCore::windowProtoFuncBToA):
3394         * bindings/js/JSSVGPODTypeWrapper.h:
3395         * bindings/js/kjs_proxy.cpp:
3396         (WebCore::KJSProxy::evaluate):
3397         * bridge/objc/objc_utility.mm:
3398         (KJS::Bindings::throwError):
3399         * dom/Document.cpp:
3400         (WebCore::Document::parseQualifiedName):
3401         * platform/text/AtomicString.cpp:
3402         (WebCore::AtomicString::add):
3403         * platform/text/String.cpp:
3404         (WebCore::String::String):
3405         (WebCore::String::operator Identifier):
3406         (WebCore::String::operator UString):
3407         * platform/text/TextCodecICU.cpp:
3408         (WebCore::TextCodecICU::decode):
3409         * svg/SVGAnimatedTemplate.h:
3410
3411 2008-03-10  Darin Adler  <darin@apple.com>
3412
3413         Reviewed by Sam.
3414
3415         - eliminate keyboard UI mode method from WebCoreFrameBridge
3416
3417         * page/ChromeClient.h: Added keyboardUIMode function.
3418         (WebCore::ChromeClient::keyboardUIMode): Ditto.
3419         * page/mac/EventHandlerMac.mm:
3420         (WebCore::EventHandler::tabsToAllControls): Call chrome client function instead
3421         of bridge function.
3422         * page/mac/WebCoreFrameBridge.h: Removed keyboardUIMode method, and other unused
3423         ones.
3424
3425         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to change the project.
3426         Do not try to fight the Xcode.
3427
3428 2008-03-10  Darin Adler  <darin@apple.com>
3429
3430         - oops, forgot to save last couple changes from the editor
3431
3432         * bindings/js/JSDOMWindowCustom.cpp:
3433         (WebCore::markDOMObjectWrapper): Tweaked a tiny bit.
3434         (WebCore::JSDOMWindow::mark): Sorted alphabetically.
3435
3436 2008-03-10  Darin Adler  <darin@apple.com>
3437
3438         Reviewed by Geoff.
3439
3440         - fix failing regression test (window.navigator is getting garbage
3441           collected and thus losing its custom properties)
3442
3443         * bindings/js/JSDOMWindowCustom.cpp:
3444         (WebCore::markDOMObject): Added helper function.
3445         (WebCore::JSDOMWindow::mark): Added. Marks the wrappers for all the objects that hang
3446         off the window object.
3447
3448         * page/DOMWindow.h:
3449         (WebCore::DOMWindow::optionalScreen): Added so we can get the Screen object without
3450         creating it if it's already there.
3451         (WebCore::DOMWindow::optionalSelection): Ditto.
3452         (WebCore::DOMWindow::optionalHistory): Ditto.
3453         (WebCore::DOMWindow::optionalLocationbar): Ditto.
3454         (WebCore::DOMWindow::optionalMenubar): Ditto.
3455         (WebCore::DOMWindow::optionalPersonalbar): Ditto.
3456         (WebCore::DOMWindow::optionalScrollbars): Ditto.
3457         (WebCore::DOMWindow::optionalStatusbar): Ditto.
3458         (WebCore::DOMWindow::optionalToolbar): Ditto.
3459         (WebCore::DOMWindow::optionalConsole): Ditto.
3460         (WebCore::DOMWindow::optionalNavigator): Ditto.
3461
3462         * page/DOMWindow.idl: Added the CustomMarkFunction flag. Sorted the flags in
3463         alphabetical order since there are a lot of them.
3464
3465 2008-03-10  Darin Adler  <darin@apple.com>
3466
3467         Reviewed by Sam.
3468
3469         - eliminate Java applet methods from WebCoreFrameBridge
3470
3471         * loader/FrameLoaderClient.h: Added a javaApplet function.
3472         * page/mac/FrameMac.mm:
3473         (WebCore::Frame::createScriptInstanceForWidget): Streamlined the code.
3474         Use the loader client instead of the bridge to get the applet.
3475         * page/mac/WebCoreFrameBridge.h: Removed the getAppletInView and
3476         pollForAppletInView methods. Also removed other unused things.
3477
3478 2008-03-10  Marc-Antoine Ruel  <maruel@gmail.com>
3479
3480         Reviewed by Eric, landed by Darin.
3481
3482         http://bugs.webkit.org/show_bug.cgi?id=16095
3483         Move GraphicsContextPrivate to its own header file.
3484
3485         Moves GraphicsContextState and GraphicsContextPrivate to its
3486         own header
3487
3488         * WebCore.vcproj/WebCore.vcproj:
3489         * platform/graphics/GraphicsContext.cpp:
3490         * platform/graphics/GraphicsContextPrivate.h: Added.
3491         (WebCore::GraphicsContextState::GraphicsContextState):
3492         (WebCore::GraphicsContextPrivate::GraphicsContextPrivate):
3493
3494 2008-03-10  Julien Chaffraix  <julien.chaffraix@gmail.com>
3495
3496         Reviewed and landed by Darin.
3497
3498         bug 12182 : XMLHttpRequest should raise SECURITY_ERR for same-origin policy violations
3499
3500         Removed reference to PERMISSION_DENIED (previous non standard exception) and replaced it
3501         by DOM exception SECURITY_ERR. Updated XMLHttpRequest::open to raise SECURITY_ERR.
3502
3503         * bindings/js/kjs_binding.cpp:
3504         (WebCore::setDOMException): Removed PERMISSION_DENIED code.
3505         * dom/ExceptionCode.cpp: Added SECURITY_ERR exception.
3506         * dom/ExceptionCode.h: Ditto.
3507         * xml/XMLHttpRequest.cpp:
3508         (WebCore::XMLHttpRequest::open): Returns SECURITY_ERR now.
3509         * xml/XMLHttpRequestException.h: Removed PERMISSION_DENIED.
3510
3511 2008-03-09  Adam Roben  <aroben@apple.com>
3512
3513         Refactor CSS editing code so we can share it with DOM editing