a45982b57f103deaf4b1121f4fe12e2eeae85566
[WebKit-https.git] / WebCore / ChangeLog
1 2007-03-23  Darin Adler  <darin@apple.com>
2
3         * html/HTMLBodyElement.cpp: Fix comment typo.
4
5 2007-03-23  George Staikos  <staikos@kde.org>
6
7         Reviewed and committed by George.
8
9         Patch from Adam Treat to make the Qt build work without SVG and XSLT.
10         XMLNames is required in any case.
11
12         * WebCore.pro:
13
14 2007-03-23  Darin Adler  <darin@apple.com>
15
16         Reviewed by Hyatt.
17
18         - <rdar://problem/5074439> handle margins on frame and iframe elements
19           without involving FrameView, FrameLoader, etc.
20
21         * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::insertedIntoDocument):
22         Grab the margin from the frame directly here. There was no real benefit
23         to doing this via FrameView. Later we can delete quite a bit of unneeded code
24         here and in WebKit that exists only to set up the margin values in FrameView,
25         which are now unused.
26
27 2007-03-23  Adele Peterson  <adele@apple.com>
28
29         Reviewed by Darin.
30
31         Fix for <rdar://problem/5080428> REGRESSION: getting value for hidden input element fails after the fix for Bug 11866
32         http://bugs.webkit.org/show_bug.cgi?id=13121
33
34         Rolled out the change for 11866 that made hidden input elements store the value separately from the value attribute.
35         Added an m_originalValue field that gets set when the element is done being parsed (in closeRenderer).  In reset,
36         use the m_originalValue for hidden input elements.
37
38         * html/HTMLInputElement.cpp:
39         (WebCore::HTMLInputElement::closeRenderer):
40         (WebCore::HTMLInputElement::reset):
41         (WebCore::HTMLInputElement::setValue):
42         (WebCore::HTMLInputElement::storesValueSeparateFromAttribute):
43         * html/HTMLInputElement.h:
44
45 2007-03-23  Mitz Pettel  <mitz@webkit.org>
46
47         Reviewed by Dave Hyatt.
48
49         - fix http://bugs.webkit.org/show_bug.cgi?id=13157
50               <rdar://problem/5083995>
51           List markers positioned incorrectly and don't repaint properly on Oxford homepage
52
53         Test: fast/lists/marker-image-error.html
54
55         * rendering/RenderListMarker.cpp:
56         (WebCore::RenderListMarker::imageChanged): Mark ourselves for relayout if
57         the image failed to load, since that means we will use a bullet instead.
58
59 2007-03-23  Zack Rusin  <zrusin@trolltech.com>
60
61         Fix the compile.
62
63         * platform/graphics/qt/ImageSourceQt.cpp:
64
65 2007-03-22  Dave Hyatt  <hyatt@apple.com>
66
67         Fix for <rdar://problem/5083072>.
68
69         * page/Frame.cpp:
70         (WebCore::Frame::setPrinting):
71         (WebCore::Frame::forceLayoutWithPageWidthRange):
72         * page/Frame.h:
73         * page/mac/WebCoreFrameBridge.mm:
74         (-[WebCoreFrameBridge forceLayoutWithMinimumPageWidth:maximumPageWidth:adjustingViewSize:]):
75
76 2007-03-22  Anders Carlsson  <acarlsson@apple.com>
77
78         Reviewed by Ada.
79
80         <rdar://problem/5074974>
81         CrashTracer: [USER] repro crash in Safari at com.apple.WebCore: WebCore::FrameLoader::activeDocumentLoader const + 6
82         
83         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
84         (WebCore::NetscapePlugInStreamLoader::didReceiveResponse):
85         Don't use ResourceResponse:isHTTP here since that only looks at the protocol instead of if the response came from a 
86         HTTP server (and not a web archive).
87
88 2007-03-22  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
89
90         Not reviewed - gdk build fix.
91
92         * platform/graphics/cairo/ImageSourceCairo.cpp:
93
94 2007-03-22  Dave Hyatt  <hyatt@apple.com>
95
96         Fix for <rdar://problem/5083473>.  Make sure wheeling still forwards to the frame view even
97         when no node is hit.  Technically not ever hitting a node is a regression from the RenderView
98         size changes (making it be the size of the initial containing block according to CSS2.1), but
99         we should still handle this case gracefully in case it comes up again.
100        
101         Reviewed by olliej
102
103         * page/EventHandler.cpp:
104         (WebCore::EventHandler::handleWheelEvent):
105
106 2007-03-22  Justin Garcia  <justin.garcia@apple.com>
107
108         Reviewed by kevin
109
110         <rdar://problem/5081257> 
111         REGRESSION: New Mail signatures start out empty
112
113         * editing/VisiblePosition.cpp:
114         (WebCore::VisiblePosition::canonicalPosition): Allow
115         descent from positions inside the document into an 
116         editable body.
117
118 2007-03-22  Brady Eidson  <beidson@apple.com>
119
120         Reviewed by Adele and John
121
122         <rdar://5043528> - Prepare for new API
123         
124         * platform/network/ResourceHandle.cpp:
125         (WebCore::ResourceHandle::clearAuthentication): Clear CF type
126
127 2007-03-22  Beth Dakin  <bdakin@apple.com>
128
129         Patch by Hyatt, reviewed and committed by me.
130
131         Does not reproduce consistently, so a layout test does not seem 
132         possible.
133
134         Fix for <rdar://problem/5082421> Constantly hitting ASSERT(!
135         needsLayout()) in RenderView::paint()
136
137         * page/FrameView.cpp:
138         (WebCore::FrameView::layoutPending): It is not enough to ask if the 
139         layout timer is active. There may be times that we don't have a 
140         body yet so we cannot schedule layout yet, but the root still needs 
141         layout.  
142
143 2007-03-22  John Sullivan  <sullivan@apple.com>
144
145         Reviewed by Darin
146         
147         Followup for recent fix to 5079700, found by assertion added to Safari.
148
149         * page/mac/FrameMac.mm:
150         (WebCore::Frame::searchForLabelsBeforeElement):
151         Fixed another place in this method where an empty NSString was being returned instead of nil.
152         Cleaned up the style a little too.
153
154 2007-03-22  David Hyatt  <hyatt@apple.com>
155
156         Remove unnecessary destroyFrameAtIndex call.  Now that we throw away
157         the image source, it is no longer needed.
158
159         Reviewed by beth
160
161         * platform/graphics/BitmapImage.cpp:
162         (WebCore::BitmapImage::destroyDecodedData):
163
164 2007-03-22  David Harrison  <harrison@apple.com>
165
166         Reviewed by Geoff, Darin.
167
168         <rdar://problem/5077892> In RapidWeaver 3.5.1, a crash occurs when attempting to load Safari Bookmarks in iMedia Browser
169         
170         * platform/mac/ThreadCheck.mm:
171         (WebCore::_WebCoreThreadViolationCheck):
172         Change default on Tiger to NSLog rather than raise an exception.
173
174 2007-03-22  Darin Adler  <darin@apple.com>
175
176         Reviewed by Brady.
177
178         - use binary_search instead of hash table; slightly better performance and
179           less memory use
180
181         * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::portAllowed):
182         Use binary_search.
183
184 2007-03-22  Darin Adler  <darin@apple.com>
185
186         Reviewed by Adele.
187
188         - fix <rdar://problem/5074630> detachChildren call should move from WebKit to WebCore
189
190         * loader/FrameLoader.cpp: (WebCore::FrameLoader::setDocumentLoader):
191         Add a call to detachChildren() after the call to prepareForDataSourceReplacement().
192         There was no reason for this crucial loading step to be left to the client.
193
194 2007-03-22  David Hyatt  <hyatt@apple.com>
195
196         Minor refactoring and cleanup of the bridge calls that want to control layout settings on the RenderView.
197         Have the bridge talk through the FrameView instead of just asking for the RenderView directly.
198
199         Add an assert to help catch situations where the RenderView needs layout at paint time, since this is a known
200         catastrophic scenario that will (much of the time) result in a crash in RenderTableSection::paint.
201
202         Reviewed by aroben
203
204         * page/FrameView.cpp:
205         (WebCore::FrameView::adjustViewSize):
206         (WebCore::FrameView::needsLayout):
207         (WebCore::FrameView::setNeedsLayout):
208         * page/FrameView.h:
209         * page/mac/WebCoreFrameBridge.mm:
210         (-[WebCoreFrameBridge needsLayout]):
211         (-[WebCoreFrameBridge setNeedsLayout]):
212         * rendering/RenderView.cpp:
213         (WebCore::RenderView::paint):
214
215 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
216
217         Reviewed by Beth Dakin.
218         
219         Re-worked the fix in r20375. 'M' and 'm' are not the only commands that
220         accept "extra" coordinates -- virtually all commands accept them.
221
222         * ksvg2/svg/SVGParserUtilities.cpp:
223         (WebCore::SVGPathParser::parseSVG):
224
225 2007-03-21  David Harrison  <harrison@apple.com>
226
227         Reviewed by hyatt.
228
229         <rdar://problem/5072460> CrashTracer: [USER] 1 crashes in Xcode at com.apple.ImageIO.framework: getBandProcPNG + 168
230
231         An NSData object was being alloc/init'd, then returned callers who cast the pointer as a
232         CFDataRef, including calling CFRelease on it. The problem is that under garbage collection, the NS
233         retain count is ignored (it's always 0), but the CFRetain and CFRelease are not ignored. This
234         caused the object to be over-released. The solution that works in both GC and non-GC is to "transfer"
235         the initial NS retain count to the CF retain count, using HardRetainWithNSRelease.
236         
237         The creator of the NSData was SharedBuffer::createNSData. The callers were PDFDocumentImage::dataChanged()
238         and ImageSource::setData(). This particular crash involved the ImageSource::setData() case.
239
240         * platform/SharedBuffer.h:
241         Declare createCFData().
242         
243         * platform/graphics/cg/ImageSourceCG.cpp:
244         (WebCore::ImageSource::setData):
245         Call createCFData instead of createNSData.
246         
247         * platform/graphics/cg/PDFDocumentImage.cpp:
248         (WebCore::PDFDocumentImage::dataChanged):
249         Call createCFData instead of createNSData.
250         
251        * platform/mac/SharedBufferMac.mm:
252         (WebCore::SharedBuffer::createCFData):
253         Implement createCFData(). Use HardRetainWithNSRelease for gc safety.
254         
255 2007-03-21  Mitz Pettel  <mitz@webkit.org>
256
257         Reviewed by Darin.
258
259         - fix http://bugs.webkit.org/show_bug.cgi?id=13145
260           Regression: Scrollbar not resizing after display none
261
262         Test: fast/dynamic/view-overflow.html
263
264         * rendering/RenderView.cpp:
265         (WebCore::RenderView::layout): Reset overflowHeight() and overflowWidth()
266         before calling docHeight() and docWidth(), since the former act as a lower
267         bound for the latter.
268
269 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
270
271         Reviewed by Beth Dakin.
272         
273         A little cleanup based work I've been doing on the SVG parsers.
274
275         * ksvg2/svg/SVGParserUtilities.h:
276         (WebCore::skipString):
277         * ksvg2/svg/SVGPreserveAspectRatio.cpp: Moved checkString into
278         SVGParserUtilities.h, so it could be with all its friends. Renamed 
279         "checkString" to "skipString" to match the rest of the code and to be 
280         clear about which functions move the buffer pointer.
281         (WebCore::SVGPreserveAspectRatio::parsePreserveAspectRatio):
282         * ksvg2/svg/SVGTransformable.cpp:
283         (WebCore::SVGTransformable::parseTransformAttribute): Changed gotos into 
284         returns. Removed unnecessary magic number.
285
286 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
287
288         Reviewed by Beth Dakin.
289         
290         Fixed <rdar://problem/5078471> SVG rgb color parser runs past end of 
291         buffer when running fuzzing test
292
293         * ksvg2/svg/SVGColor.cpp:
294         (WebCore::parseNumberOrPercent): Check for past the end condition.
295         (WebCore::SVGColor::colorFromRGBColorString): Reversed "read past end
296         of buffer, then check if you're past the end" logic.
297
298 2007-03-21  Geoffrey Garen  <ggaren@apple.com>
299
300         Reviewed by Beth Dakin.
301         
302         Fixed <rdar://problem/5079410> SVG path parser hangs, exhausts memory when 
303         running fuzzer test
304
305         * ksvg2/svg/SVGParserUtilities.cpp:
306         (WebCore::SVGPathParser::parseSVG): Don't assume that extra digits are
307         always preceded by an 'M' or an 'm'.
308
309 2007-03-21  John Sullivan  <sullivan@apple.com>
310
311         Reviewed by Adam
312         
313         - fixed <rdar://problem/5079700> REGRESSION (r19702): Name/password aren't autofilled 
314           or saved for .Mac homepage login
315
316         * page/mac/FrameMac.mm:
317         (WebCore::Frame::searchForLabelsBeforeElement):
318         don't count empty strings as valid results
319
320 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
321
322         Reviewed by darin
323
324         * editing/markup.cpp:
325         (WebCore::styleFromMatchedRulesAndInlineDecl): 
326         Release the RefPtr to avoid increasing/decreasing
327         the refcount unnecessarily.
328         (WebCore::propertyMissingOrEqualToNone): Added and used
329         instead of converting values to strings.
330         (WebCore::elementHasTextDecorationProperty): 
331         (WebCore::createMarkup):
332
333 2007-03-21  Justin Garcia  <justin.garcia@apple.com>
334
335         Reviewed by oliver
336
337         <rdar://problem/5075944> 
338         REGRESSION: Partially selected underlined content pastes as plain text
339         
340         We stopped adding markup for all the ancestors
341         of lastClosed up to the commonAncestorBlock
342         because it was adding a lot of unnecessary markup.
343         This caused us to lose underlining when copying a 
344         partially selected underlined element (even though 
345         we put all styles that the copied markup inherits 
346         into a style span, because the text-decoration 
347         isn't inheritable).
348
349         * editing/markup.cpp:
350         (WebCore::styleFromMatchedRulesAndInlineDecl): Moved
351         code here.
352         (WebCore::elementHasTextDecorationProperty): Added.
353         (WebCore::createMarkup): If the copied markup has a
354         text-decoration because some common ancestor has
355         a text-decoration property set, include that ancestor
356         and all its descendants in the copied markup.
357
358 2007-03-21  Oliver Hunt  <oliver@apple.com>
359
360         Reviewed by Antti.
361
362         Update a few SVG attribute parsers to be more defensive against
363         reading beyond the end of input. 
364
365         Fixes rdar://problem/5077218 -- SVG transform parser runs past
366         end of buffer when running fuzzing test
367
368         * ksvg2/svg/SVGParserUtilities.cpp:
369         (WebCore::SVGPathParser::parseSVG):
370         * ksvg2/svg/SVGParserUtilities.h:
371         (WebCore::skipOptionalSpacesOrDelimiter):
372         * ksvg2/svg/SVGTransformable.cpp:
373         (WebCore::parseTransformParamList):
374         (WebCore::SVGTransformable::parseTransformAttribute):
375
376 2007-03-21  Alexey Proskuryakov  <ap@webkit.org>
377
378         Reviewed by Mitz.
379
380         http://bugs.webkit.org/show_bug.cgi?id=13140
381         Crash after loading SVG fragment with XMLHttpRequest (Yosemite Map Geology Layer)
382
383         Test: svg/carto.net/frameless-svg-parse-error.html
384
385         * ksvg2/misc/SVGDocumentExtensions.cpp:
386         (WebCore::SVGDocumentExtensions::reportError): Added a null check.
387         (WebCore::SVGDocumentExtensions::reportWarning): Ditto.
388
389 2007-03-21  Beth Dakin  <bdakin@apple.com>
390
391         Reviewed by Geoff.
392
393         Fix for <rdar://problem/5072678> Crash in
394         RenderLayer::scrollRectToVisible with MallocScribble enabled
395
396         I tried to fix this earlier today but my fix caused a regression
397         scrolling through RSS pages. It turns out that sometimes scroll
398         events need to propagate immediately, and sometimes they must be
399         delayed or they risk deleting objects that are expected to be
400         around after the event has propagated. Mitz's original fix made
401         sheduleEvent() only delay events that happen during layout. This
402         fix marks two other places in addition to layout where events also
403         need to be delayed. These two places are places that were marked
404         with FIXMEs that Mitz removed in his original patch. (There was a
405         third FIXME in RenderLayer::updateScrollInfoAfterLayout() but that
406         case is only called through layout and is covered by Mitz's
407         original patch.)
408
409         * page/FrameView.cpp:
410         (WebCore::FrameView::~FrameView): Added assertion.
411         (WebCore::FrameView::layout): Call new functions to increment and 
412         decrement the queued events count.
413         (WebCore::FrameView::pauseScheduledEvents):
414         (WebCore::FrameView::resumeScheduledEvents): Decrement queued 
415         events count and dispatch events if the count has zeroed.
416         * page/FrameView.h:
417         * rendering/RenderLayer.cpp:
418         (WebCore::RenderLayer::scrollRectToVisible):
419         (WebCore::Marquee::start):
420
421 2007-03-21  Mitz Pettel  <mitz@webkit.org>
422
423         Reviewed by John Sullivan.
424
425         - fix http://bugs.webkit.org/show_bug.cgi?id=13130
426           REGRESSION: Sometimes a frame resizer keeps following the mouse after mouseup
427
428         * rendering/RenderFrameSet.cpp:
429         (WebCore::RenderFrameSet::userResize): Reordered the code to allow resizing
430         to be terminated by a mouseup event regardless of whether the frameset needs
431         layout.
432
433 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
434
435         Reviewed by Oliver.
436
437         <rdar://problem/5077252> 
438         In NetNewsWire 2.1.1 and 3.0d62, a crash occurs after triple-clicking a link on the page
439         
440         * loader/FrameLoader.cpp:
441         (WebCore::FrameLoader::load):
442         Move the m_inStopAllLoaders check to the load function that's common for loading a request or substitute data.
443
444 2007-03-20  Brady Eidson  <beidson@apple.com>
445
446         Reviewed by Anders.
447
448         <rdar://problem/5073391> and http://bugs.webkit.org/show_bug.cgi?id=13137
449
450         Crash in IconDatabase when private browsing is enabled.
451
452         The problem was caused by http://trac.webkit.org/projects/webkit/changeset/20182 
453         which changed many uses of char[] and Vector<char> to SharedBuffer.  The patch
454         tended to literally replace a Vector<char> with RefPtr<SharedBuffers> but forgot
455         to enforce the concept that Vector<char>'s always exist, whereas RefPtr<SharedBuffers>
456         can be null.  This led to derefs.
457
458         I took the opportunity to rework the iconDB functions to live in a SharedBuffer 
459         world, as that didn't exist when they were originally written - now they just return
460         SharedBuffers instead of taking a Vector<char>& as a parameter
461
462         * loader/icon/IconDatabase.cpp:
463         (WebCore::IconDatabase::imageDataForIconURL): Return a SharedBuffer
464         (WebCore::IconDatabase::iconForPageURL): Null check the SharedBuffer before asking
465           it if it's empty
466         (WebCore::IconDatabase::imageDataForIconURLQuery): Return a new SharedBuffer
467
468         * loader/icon/IconDatabase.h: Return SharedBuffer's instead of taking Vector<char>&'s
469
470 2007-03-20  Adam Roben  <aroben@apple.com>
471
472         Rubberstamped by Adele.
473
474         Roll out r20348 because it was causing crashes.
475
476         * page/FrameView.cpp:
477         (WebCore::FrameViewPrivate::FrameViewPrivate):
478         (WebCore::FrameView::layout):
479         (WebCore::FrameView::scheduleEvent):
480
481 2007-03-20  Timothy Hatcher  <timothy@apple.com>
482
483         Reviewed by Kevin Decker.
484
485         Rolling out part of r19828 that caused a scrolling regression in Mail.
486
487         <rdar://problem/4820817> Message jumps around when trying to select text
488
489         * platform/mac/ScrollViewMac.mm:
490         (WebCore::ScrollView::visibleContentRect):
491         (WebCore::ScrollView::updateContents):
492
493 2007-03-20  Brady Eidson  <beidson@apple.com>
494
495         Reviewed by John
496
497         <rdar://5071341> - Crash in IconLoader::finishLoading()
498         
499         Though the reproducibility of the crash is still elusive, there's been a crasher likely uncovered 
500         Hyatt's recent caching changings to the IconLoader.  This crash tends to hit on sites without favicons,
501         that serve up complex 404 pages, often when the load is cancelled or redirected.  Occasionally, it *seems*
502         the IconLoader is getting failed/cancelled twice.
503         
504         This patch adds some assertions and a "fail gracefully in a release build" check that will have to
505         serve us until we know more about the cause.
506
507         * loader/icon/IconLoader.cpp:
508         (WebCore::IconLoader::didFail): Add an assertion to catch this case
509         (WebCore::IconLoader::finishLoading): Add an assertion to catch the case, and fail
510           gracefully in debug builds.  Also add an efficiency check to not commit to the DB if there is no
511           IconURL
512
513 2007-03-20  Antti Koivisto  <antti@apple.com>
514
515         Reviewed by Darin.
516
517         - fix http://bugs.webkit.org/show_bug.cgi?id=10747
518         REGRESSION: Using two fingers on a trackpad to scroll inside a text area makes the whole page move
519         <rdar://problem/5045710>
520         
521         Eat smooth scroll events in WebCore if pointer is over scrollable area. Not
522         really a good fix, smooth scrolling should be supported properly. It should do for now.
523
524         * page/EventHandler.cpp:
525         (WebCore::EventHandler::handleWheelEvent):
526         * rendering/RenderListBox.cpp:
527         (WebCore::RenderListBox::isScrollable):
528         * rendering/RenderListBox.h:
529         * rendering/RenderObject.cpp:
530         (WebCore::RenderObject::isScrollable):
531         * rendering/RenderObject.h:
532         * rendering/RenderTextControl.cpp:
533         (WebCore::RenderTextControl::isScrollable):
534         * rendering/RenderTextControl.h:
535
536 2007-03-20  Beth Dakin  <bdakin@apple.com>
537
538         Reviewed by Geoff.
539
540         Covered by existing test case.
541
542         Fix for <rdar://problem/5072678> Crash in 
543         RenderLayer::scrollRectToVisible with MallocScribble enabled
544
545         This removes some code that was added with http://bugs.webkit.org/
546         show_bug.cgi?id=8360. This code was not needed to fix that bug, but 
547         the idea behind it was that there are times when it is safe for 
548         scheduleEvent() to propagate the event immediately. The 
549         MallocScribble crash revealed that this assumption was a bit too 
550         broad; the cause of the crash was that we were propagating events 
551         immediately when it was not safe. Mitz and I discussed this online 
552         and we agree that the safest solution is to revert to the old 
553         behavior here, and always delay the propagation of the event. 
554
555         * page/FrameView.cpp:
556         (WebCore::FrameViewPrivate::FrameViewPrivate):
557         (WebCore::FrameView::layout):
558         (WebCore::FrameView::scheduleEvent):
559
560 2007-03-20  Brady Eidson  <beidson@apple.com>
561
562         Reviewed by John Sullivan
563
564         Add some very helpful logging to the IconLoader's SubresourceLoaderClient impl.
565
566         * loader/icon/IconLoader.cpp:
567         (WebCore::IconLoader::didReceiveResponse):
568         (WebCore::IconLoader::didReceiveData):
569         (WebCore::IconLoader::didFail):
570         (WebCore::IconLoader::didFinishLoading):
571
572 2007-03-20  Justin Garcia  <justin.garcia@apple.com>
573
574         Reviewed by darin
575
576         <rdar://problem/5071074> 
577         REGRESSION: Links are pasted as plain text at certain positions
578         
579         moveParagraphs calls createMarkup without annotation, which leaves
580         out anchor elements that aren't fully selected.
581
582         * editing/CompositeEditCommand.cpp:
583         (WebCore::CompositeEditCommand::moveParagraphs): We don't want 
584         createMarkup to do full annotation here.  Doing so could include 
585         special ancestor blocks, which would prevent the copied content 
586         from appearing in the destination paragraph when it's re-inserted.  
587         Annotation would also inline styles from style sheets,  which is 
588         unnecessary because the content is being moved to the same 
589         document it's being moved from.
590         Added a new bool to createMarkup that when true allows markup for 
591         special ancestors as long as they are inline when annotation is off.
592         * editing/markup.cpp:
593         (WebCore::createMarkup): Don't set specialCommonAncestor if annotation
594         is off, unless it's inline and we've been told it's ok to include such
595         elements.
596         * editing/markup.h:
597
598 2007-03-20  Alexey Proskuryakov  <ap@webkit.org>
599
600         Reviewed by Darin.
601
602         http://bugs.webkit.org/show_bug.cgi?id=12497
603         Implement XPath result ordering.
604
605         XPath::NodeVector typedef is replaced with a real XPath::NodeSet class that knows how 
606         to sort itself, and can remember whether it has been already sorted.
607
608         * CMakeLists.txt:
609         * WebCore.pro:
610         * WebCore.xcodeproj/project.pbxproj:
611         * WebCoreSources.bkl:
612         Added XPathNodeSet files.
613
614         * xml/XPathExpression.cpp: Fixed includes.
615
616         * xml/XPathFunctions.cpp:
617         (WebCore::XPath::FunId::evaluate): Mark the resulting node-set as unsorted.
618         (WebCore::XPath::FunLocalName::evaluate): Replacing NodeVector with NodeSet.
619         (WebCore::XPath::FunNamespaceURI::evaluate): Ditto.
620         (WebCore::XPath::FunName::evaluate): Ditto.
621         (WebCore::XPath::FunCount::evaluate): Ditto.
622         (WebCore::XPath::FunSum::evaluate): Ditto.
623
624         * xml/XPathNodeSet.cpp: Added.
625         (WebCore::XPath::parentWithDepth):
626         (WebCore::XPath::sortBlock):
627         (WebCore::XPath::NodeSet::sort): Sort the node-set in document order.
628         (WebCore::XPath::NodeSet::reverse): Reverse the order (useful for making axes such as 
629         parent or ancestor sorted).
630         (WebCore::XPath::NodeSet::firstNode): Returns the first node in document order; currently
631         implemented via fully sorting the node-set, but this can obviously be optimized.
632         (WebCore::XPath::NodeSet::anyNode): Added for symmetry with firstNode().
633         
634         * xml/XPathNodeSet.h: Added.
635         (WebCore::XPath::NodeSet::NodeSet):
636         (WebCore::XPath::NodeSet::operator=):
637         (WebCore::XPath::NodeSet::size):
638         (WebCore::XPath::NodeSet::isEmpty):
639         (WebCore::XPath::NodeSet::operator[]):
640         (WebCore::XPath::NodeSet::reserveCapacity):
641         (WebCore::XPath::NodeSet::clear):
642         (WebCore::XPath::NodeSet::swap):
643         (WebCore::XPath::NodeSet::append):
644         (WebCore::XPath::NodeSet::markSorted):
645         (WebCore::XPath::NodeSet::isSorted):
646         Most of these methods just call Vector counterparts. 
647
648         * xml/XPathParser.cpp: Updated the copyright notice.
649
650         * xml/XPathPath.cpp:
651         (WebCore::XPath::Filter::evaluate): Replacing NodeVector with NodeSet.
652         (WebCore::XPath::Path::evaluate): Ditto.
653         (WebCore::XPath::LocationPath::evaluate): Replacing NodeVector with NodeSet. This function
654         always marks the result as unsorted, because it is hard to tell whether a step breaks node order.
655         Identifying and implementing special cases when it is not necessary to do so is an important
656         future optimization.
657
658         * xml/XPathPath.h: Replacing NodeVector with NodeSet.
659         * xml/XPathPredicate.cpp:
660         (WebCore::XPath::EqTestOp::compare): Replacing NodeVector with NodeSet.
661         (WebCore::XPath::Union::evaluate): Replacing NodeVector with NodeSet. Currently, Union just
662         marks the result as unordered; we can consider using merge sort to avoid this.
663
664         * xml/XPathResult.cpp:
665         (WebCore::XPathResult::XPathResult): Replacing NodeVector with NodeSet.
666         (WebCore::XPathResult::singleNodeValue): Ditto.
667         (WebCore::XPathResult::snapshotLength): Ditto.
668         (WebCore::XPathResult::iterateNext): Ditto.
669         (WebCore::XPathResult::snapshotItem): Ditto.
670         (WebCore::XPathResult::convertTo): Ditto. Sort the result when requested to.
671
672         * xml/XPathResult.h: Replacing NodeVector with NodeSet.
673
674         * xml/XPathStep.cpp:
675         (WebCore::XPath::Step::evaluate): If the input is not sorted, mark the output as such, too.
676         (WebCore::XPath::Step::nodesInAxis): Fixed a number of bugs when enumerating with an
677         attribute context node.
678         (WebCore::XPath::Step::nodeTestMatches): Replacing NodeVector with NodeSet.
679         * xml/XPathStep.h: Ditto.
680
681         * xml/XPathUtil.cpp:
682         (WebCore::XPath::isValidContextNode): XPath data model doesn't put attribute data into child
683         nodes, so passing such node as a context could cause problems.
684
685         * xml/XPathUtil.h: Removed NodeVector typedef.
686
687         * xml/XPathValue.cpp:
688         (WebCore::XPath::Value::Value):
689         (WebCore::XPath::Value::toNodeSet):
690         (WebCore::XPath::Value::toBoolean):
691         (WebCore::XPath::Value::toNumber):
692         (WebCore::XPath::Value::toString):
693         * xml/XPathValue.h:
694         (WebCore::XPath::Value::):
695         (WebCore::XPath::Value::isNodeSet):
696         Replacing NodeVector with NodeSet.
697
698 2007-03-21  Mark Rowe  <mrowe@apple.com>
699
700         Build fix.
701
702         * bindings/objc/WebScriptObject.mm:
703         (-[WebScriptObject methodForSelector:]):
704         (-[WebScriptObject respondsToSelector:]):
705
706 2007-03-21  Mark Rowe  <mrowe@apple.com>
707
708         Reviewed by Tim Hatcher.
709
710         Fix for http://bugs.webkit.org/show_bug.cgi?id=13129.
711         Bug 13129: Democracy Player dies in NSException from WebScriptObject on startup.
712
713         Some cross-language scripting bridges use the presence of -(int)count to determine
714         whether to treat objects as sequence-like.  All WebScriptObject's exposed this method
715         which lead to non-collection WebScriptObject's being mishandled by PyObjC.  We now
716         expose -count only when the object we wrap looks like a collection from a JavaScript
717         point of view (eg, it has a length property).
718
719         * bindings/objc/WebScriptObject.mm:
720         (-[WebScriptObject _shouldRespondToCount]):
721         (-[WebScriptObject methodForSelector:]):
722         (-[WebScriptObject respondsToSelector:]):
723         (-[WebScriptObject _count]):
724         * bindings/objc/WebScriptObjectPrivate.h:
725
726 2007-03-20  Darin Adler  <darin@apple.com>
727
728         * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent):
729         Fix obvious typo in the change from last night -- forgot to assign to the variable.
730
731 2007-03-20  Dave Hyatt  <hyatt@apple.com>
732
733         Refactor fonts a bit for portability.
734        
735         Reviewed by aroben
736
737         * platform/Font.cpp:
738         (WebCore::Font::drawSimpleText):
739         (WebCore::Font::drawGlyphBuffer):
740         (WebCore::Font::floatWidthForSimpleText):
741         * platform/Font.h:
742         * platform/FontData.h:
743         (WebCore::FontData::isSystemFont):
744         (WebCore::FontData::scriptCache):
745         * platform/GlyphBuffer.h:
746         (WebCore::GlyphBuffer::add):
747
748 2007-03-20  Anders Carlsson  <acarlsson@apple.com>
749
750         Reviewed by Adam.
751
752         Stub out a couple of CFNetwork backend functions.
753         
754         * platform/network/ResourceHandle.h:
755
756 2007-03-19  Oliver Hunt  <oliver@apple.com>
757
758         Reviewed by Ada.
759
760         Protect against possibility of JS detaching a frame (and losing its view)
761         midway through a mouse move.
762
763         * page/EventHandler.cpp:
764         (WebCore::EventHandler::handleMouseMoveEvent):
765
766 2007-03-19  Alexey Proskuryakov  <ap@webkit.org>
767
768         Reviewed by Darin.
769
770         http://bugs.webkit.org/show_bug.cgi?id=13107
771         XPath should raise an exception when trying to parse an unknown function
772
773         Test: fast/xpath/invalid-functions.html
774
775         * xml/XPathFunctions.cpp:
776         (WebCore::XPath::createFunction): Return 0 if the function couldn't be created.
777         * xml/XPathGrammar.y: Handle nulls returned from createFunction().
778
779 2007-03-19  Adele Peterson  <adele@apple.com>
780
781         Reviewed by Beth.
782
783         Fix for http://bugs.webkit.org/show_bug.cgi?id=13087
784         <rdar://problem/5064316> REGRESSION: Allow setting the checked attribute in js and in markup for unnamed radio buttons (dominos.com)
785
786         Test: fast/forms/radio_checked_name.html
787
788         We were matching a WinIE quirk that does not allow a user to check and uncheck an unnamed radio button.  But they still
789         allow the checked attribute to be set in html, and changed in javascript.  So this change matches that behavior.
790
791         * html/HTMLInputElement.cpp:
792         (WebCore::HTMLInputElement::parseMappedAttribute): We no longer need a special call to setChecked when parsing the name
793          attribute, since we setChecked will now work with unnamed radio buttons.
794         (WebCore::HTMLInputElement::preDispatchEventHandler): Added comment.
795         (WebCore::HTMLInputElement::setChecked): Don't check for the unnamed radio button case here.
796         (WebCore::HTMLInputElement::postDispatchEventHandler): Don't call setChecked for unnamed radio buttons.
797         (WebCore::HTMLInputElement::defaultEventHandler): ditto.
798
799 2007-03-19  Adam Roben  <aroben@apple.com>
800
801         Rubberstamped by Oliver.
802
803         * bridge/JavaScriptStatistics.cpp: Added missing header for
804         correctness.
805
806 2007-03-19  Andrew Wellington  <proton@wiretapped.net>
807
808         Reviewed by Maciej.
809
810         Really set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
811
812         * WebCore.xcodeproj/project.pbxproj:
813
814 2007-03-19  Justin Garcia  <justin.garcia@apple.com>
815
816         Reviewed by darin
817         
818         <rdar://problem/5071074> 
819         REGRESSION: Links that aren't fully selected copy and paste as only text
820         
821         We stopped adding markup for all commonAncestorBlocks
822         and the ancestors of lastClosed up to them because it 
823         was adding a lot of unnecessary markup.
824
825         * editing/markup.cpp:
826         (WebCore::createMarkup): Also include markup for nodes
827         up to an enclosing anchor.  Cleaned up the code for
828         including special common ancestors a bit.
829
830 2007-03-19  Nikolas Zimmermann  <zimmermann@kde.org>
831
832         Reviewed by Lars Knoll.
833
834         Fix crash when opening a SVG document which contains SVG elements, but no <svg> root element.
835         Moving the mouse was crashing WebKit. Fixes svg/hixie/dynamic/006.xml.
836
837         * rendering/RenderObject.cpp:
838         (WebCore::RenderObject::updateHitTestResult):
839
840 2007-03-19  Mitz Pettel  <mitz@webkit.org>
841
842         Reviewed by Hyatt.
843
844         - fix http://bugs.webkit.org/show_bug.cgi?id=13117
845         REGRESSION (r14658): Flickering text fields when updating via javascript
846
847         * page/Frame.cpp:
848         (WebCore::Frame::forceLayout): Added a flag to allow partial relayout.
849         * page/Frame.h:
850         * page/mac/WebCoreFrameBridge.mm:
851         (-[WebCoreFrameBridge forceLayoutAdjustingViewSize:]): Allow partial relayout
852         if not adjusting view size.
853         (-[WebCoreFrameBridge needsLayout]): Changed to check for pending subtree
854         layout instead of just whether the root needs layout.
855
856 2007-03-18  Nikolas Zimmermann  <zimmermann@kde.org>
857
858         Reviewed by Maciej.
859
860         Make JS function calls on POD-types (ie. SVGLength) take effect.
861         Calling ie. newValueInSpecifiedUnits on SVGLength works as expected.
862
863         This worked fine before we switched to SVGLength POD type, so this
864         can be considered as P1 regression fix.
865
866         Partly fix svg/hixie/dynamic/005-broken.svg. We match Opera now though
867         it's not yet completly fixed. Setting baseVal attribute on SVGAnimatedString
868         doesn't work as expected - needs a seperated fix.
869
870         * bindings/scripts/CodeGeneratorJS.pm:
871
872 2007-03-19  Adele Peterson  <adele@apple.com>
873
874         Reviewed by Adam.
875
876         Adding comments and a little cleanup from my last checkin.
877
878         * html/HTMLSelectElement.cpp:
879         (WebCore::HTMLSelectElement::setSelectedIndex): Removed commented out assert.  Added comment about how we use onChange.
880         (WebCore::HTMLSelectElement::selectAll): Added comment about how we use saveLastSelection and onChange.
881         (WebCore::HTMLSelectElement::dispatchFocusEvent): ditto.
882         (WebCore::HTMLSelectElement::dispatchBlurEvent): ditto.
883         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): ditto.
884         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler): ditto.
885         (WebCore::HTMLSelectElement::menuListOnChange): Added assert that usesMenuList() is true.
886         (WebCore::HTMLSelectElement::listBoxOnChange): Added assert that usesMenuList() is false.
887         (WebCore::HTMLSelectElement::saveLastSelection): Added early return for menu lists.
888
889 2007-03-19  Mitz Pettel  <mitz@webkit.org>
890
891         Reviewed by Tim Hatcher.
892
893         - fix http://bugs.webkit.org/show_bug.cgi?id=13091
894           REGRESSION (r20075): Wrong text style and pixel break in Apple Store Locator HUD
895
896         Test: fast/innerHTML/additional-inline-style.html
897
898         * editing/markup.cpp:
899         (WebCore::startMarkup): Changed to add inline style based on CSS rules only
900         in AnnotateForInterchange mode.
901
902 2007-03-19  Zack Rusin  <zrusin@trolltech.com>
903
904         Compile fix.
905
906         * platform/qt/ScrollViewQt.cpp:
907         (WebCore::ScrollView::update):
908
909 2007-03-19  Adam Roben  <aroben@apple.com>
910
911         Reviewed by Hyatt and Maciej.
912
913         Renamed WebCoreJavaScript to JavaScriptStatistics and made it C++ as
914         part of <rdar://problem/5071653>.
915
916         All layout tests pass.
917
918         * WebCore.exp: Updated.
919         * WebCore.xcodeproj/project.pbxproj: Updated.
920         * bridge/JavaScriptStatistics.cpp: Moved from
921         bridge/mac/WebCoreJavaScript.mm, and converted to C++.
922         (WebCore::collect):
923         (WebCore::JavaScriptStatistics::objectCount):
924         (WebCore::JavaScriptStatistics::interpreterCount):
925         (WebCore::JavaScriptStatistics::protectedObjectCount):
926         (WebCore::JavaScriptStatistics::rootObjectTypeCounts):
927         (WebCore::JavaScriptStatistics::garbageCollect):
928         (WebCore::JavaScriptStatistics::garbageCollectOnAlternateThread):
929         (WebCore::JavaScriptStatistics::shouldPrintExceptions):
930         (WebCore::JavaScriptStatistics::setShouldPrintExceptions):
931         * bridge/JavaScriptStatistics.h: Added.
932         * bridge/mac/WebCoreJavaScript.h: Removed.
933         * bridge/mac/WebCoreJavaScript.mm: Removed.
934
935 2007-03-18  Maciej Stachowiak  <mjs@apple.com>
936
937         Reviewed by Mark.
938
939         - avoid static construction (and global variable access) in a smarter, more portable way,
940         to later enable MUTLI_THREAD mode to work on other platforms and compilers.
941         
942         * bindings/js/JSCustomXPathNSResolver.cpp:
943         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
944         * bindings/js/JSHTMLInputElementBase.cpp:
945         (WebCore::JSHTMLInputElementBaseFunction::JSHTMLInputElementBaseFunction):
946         * bindings/js/JSHTMLOptionElementConstructor.cpp:
947         (WebCore::JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor):
948         * bindings/js/JSXMLHttpRequest.cpp:
949         (KJS::JSXMLHttpRequestConstructorImp::JSXMLHttpRequestConstructorImp):
950         * bindings/js/JSXSLTProcessor.cpp:
951         (KJS::XSLTProcessorConstructorImp::XSLTProcessorConstructorImp):
952         * bindings/js/kjs_dom.cpp:
953         (KJS::DOMNamedNodeMap::getOwnPropertySlot):
954         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
955         * bindings/js/kjs_events.cpp:
956         (KJS::JSAbstractEventListener::handleEvent):
957         * bindings/js/kjs_html.cpp:
958         (KJS::HTMLElementFunction::HTMLElementFunction):
959         (KJS::JSHTMLCollection::getOwnPropertySlot):
960         * bindings/js/kjs_window.cpp:
961         (KJS::ScheduledAction::execute):
962         * bindings/objc/WebScriptObject.mm:
963         * bindings/scripts/CodeGeneratorJS.pm:
964
965 2007-03-18  Andrew Wellington  <proton@wiretapped.net>
966
967         Reviewed by Mark Rowe
968
969         Set Xcode editor to use 4 space indentation (http://webkit.org/coding/coding-style.html)
970
971         * WebCore.xcodeproj/project.pbxproj:
972
973 2007-03-18  David Hyatt  <hyatt@apple.com>
974
975         Fix for REGRESSION bug 13108, frame borders being painted when they shouldn't be.  Rework both frame borders
976         and resizing to be more like other browsers.
977
978         Reviewed by ggaren
979
980         fast/frames/no-frame-borders.html
981
982         * html/HTMLFrameElement.cpp:
983         (WebCore::HTMLFrameElement::HTMLFrameElement):
984         (WebCore::HTMLFrameElement::attach):
985         (WebCore::HTMLFrameElement::parseMappedAttribute):
986         * html/HTMLFrameElement.h:
987         (WebCore::HTMLFrameElement::hasFrameBorder):
988         * html/HTMLFrameElementBase.cpp:
989         (WebCore::HTMLFrameElementBase::HTMLFrameElementBase):
990         (WebCore::HTMLFrameElementBase::parseMappedAttribute):
991         * html/HTMLFrameElementBase.h:
992         * html/HTMLFrameSetElement.cpp:
993         (WebCore::HTMLFrameSetElement::attach):
994         * html/HTMLFrameSetElement.h:
995         (WebCore::HTMLFrameSetElement::hasFrameBorder):
996         * html/HTMLIFrameElement.cpp:
997         (WebCore::HTMLIFrameElement::HTMLIFrameElement):
998         * rendering/RenderFrame.cpp:
999         (WebCore::RenderFrame::edgeInfo):
1000         * rendering/RenderFrame.h:
1001         * rendering/RenderFrameSet.cpp:
1002         (WebCore::RenderFrameSet::paint):
1003         (WebCore::RenderFrameSet::GridAxis::resize):
1004         (WebCore::RenderFrameSet::fillFromEdgeInfo):
1005         (WebCore::RenderFrameSet::computeEdgeInfo):
1006         (WebCore::RenderFrameSet::edgeInfo):
1007         (WebCore::RenderFrameSet::layout):
1008         (WebCore::RenderFrameSet::startResizing):
1009         (WebCore::RenderFrameSet::continueResizing):
1010         (WebCore::RenderFrameSet::canResizeRow):
1011         (WebCore::RenderFrameSet::canResizeColumn):
1012         (WebCore::RenderFrameSet::splitPosition):
1013         (WebCore::RenderFrameSet::hitTestSplit):
1014         (WebCore::RenderFrameSet::dump):
1015         * rendering/RenderFrameSet.h:
1016         (WebCore::):
1017         (WebCore::FrameEdgeInfo::FrameEdgeInfo):
1018         (WebCore::FrameEdgeInfo::preventResize):
1019         (WebCore::FrameEdgeInfo::allowBorder):
1020         (WebCore::FrameEdgeInfo::setPreventResize):
1021         (WebCore::FrameEdgeInfo::setAllowBorder):
1022
1023 2007-03-19  Mark Rowe  <mrowe@apple.com>
1024
1025         Rubber-stamped by Brady.
1026
1027         Update references to bugzilla.opendarwin.org with bugs.webkit.org.
1028
1029         * ChangeLog:
1030         * WebCore.vcproj/WebCore/build-generated-files.sh:
1031         * manual-tests/ATSU-bad-layout.html:
1032         * manual-tests/accidental-strict-mode.html:
1033         * manual-tests/applet-param-no-name.html:
1034         * manual-tests/bidi-parens.html:
1035         * manual-tests/bugzilla-3855.html:
1036         * manual-tests/bugzilla-4840.html:
1037         * manual-tests/bugzilla-6821.html:
1038         * manual-tests/containing-block-position-chage.html:
1039         * manual-tests/contenteditable-link.html:
1040         * manual-tests/css3-cursor-fallback-quirks.html:
1041         * manual-tests/css3-cursor-fallback-strict.html:
1042         * manual-tests/custom-cursors.html:
1043         * manual-tests/dictionary-scrolled-iframe.html:
1044         * manual-tests/dom-manipulation-on-resize.html:
1045         * manual-tests/drag-image-to-address-bar.html:
1046         * manual-tests/empty-link-target.html:
1047         * manual-tests/empty-title-popup.html:
1048         * manual-tests/first-line-style-crash.html:
1049         * manual-tests/invalid-mouse-event.html:
1050         * manual-tests/left-overflow-repaint.html:
1051         * manual-tests/linkjump-3.html:
1052         * manual-tests/log-keypress-events.html:
1053         * manual-tests/named-window-blank-target.html:
1054         * manual-tests/plain-text-paste.html:
1055         * manual-tests/plugin-controller-datasource.html:
1056         * manual-tests/pre-tab-selection-rect.html:
1057         * manual-tests/redirection-target.html:
1058         * manual-tests/redraw-page-cache-visited-links.html:
1059         * manual-tests/reset-initiatedDrag.html:
1060         * manual-tests/resources/named-window-blank-target-step2.html:
1061         * manual-tests/resources/named-window-blank-target-step3.html:
1062         * manual-tests/resources/named-window-blank-target-step4.html:
1063         * manual-tests/resources/redraw-page-cache-visited-links-2.html:
1064         * manual-tests/scrollbar-hittest.html:
1065         * manual-tests/scrollbar-hittest2.html:
1066         * manual-tests/subview-click-assertion.html:
1067         * manual-tests/tabbing-input-google.html:
1068         * manual-tests/text-field-autoscroll.html:
1069         * manual-tests/textarea-after-stylesheet-link.html:
1070         * manual-tests/textarea-focus.html:
1071         * manual-tests/whitespace-pre-affinity.html:
1072
1073 2007-03-18  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1074
1075         Not reviewed - gdk build fix.
1076
1077         * platform/gdk/ScrollViewGdk.cpp:
1078         (WebCore::ScrollView::update): add a stub
1079
1080 2007-03-18  Brady Eidson  <beidson@apple.com>
1081
1082         Reviewed by Hyatt
1083
1084         http://bugs.webkit.org/show_bug.cgi?id=13111
1085         When stopped a load before it completes, partial images become the 
1086         broken image icon
1087
1088         * loader/loader.cpp:
1089         (WebCore::Loader::didFail): Split off into a method that knows the 
1090           difference between failed and cancelled.  If a load is cancelled,
1091           don't call error() on the object - only remove it from the cache
1092         (WebCore::Loader::cancelRequests): Call didFail(loader, true)
1093         * loader/loader.h: Added didFail(SubresourceLoader*, bool cancelled)
1094
1095 2007-03-18  Mitz Pettel  <mitz@webkit.org>
1096
1097         Reviewed by Adele.
1098
1099         - fix http://bugs.webkit.org/show_bug.cgi?id=13101
1100           REGRESSION (NativeTextField): Specifying word-wrap:break-word makes text field wrap
1101
1102         Test: fast/forms/input-text-word-wrap.html
1103
1104         * rendering/RenderTextControl.cpp:
1105         (WebCore::RenderTextControl::createInnerTextStyle): Force the inner block to
1106         'word-wrap:normal'.
1107
1108 2007-03-18  Dan Waylonis  <waylonis@mac.com>
1109
1110         Reviewed by Tim Hatcher.
1111
1112         Fix http://bugs.webkit.org/show_bug.cgi?id=13005
1113         Bug 13005: WebScriptObject +throwException needs NULL check.
1114
1115         Add checking for NULL interpreter before throwing exception.
1116
1117         * bindings/objc/WebScriptObject.mm:
1118         (+[WebScriptObject throwException:]):
1119
1120 2007-03-18  Geoffrey Garen  <ggaren@apple.com>
1121
1122         Reviewed by Oliver Hunt.
1123         
1124         Fixed http://bugs.webkit.org/show_bug.cgi?id=13106
1125         REGRESSION: Incomplete document.all implementation breaks abtelectronics.com 
1126         (Style Change Through JavaScript Blanks Content)
1127         
1128         When indexing into collections, treat the empty string as an invalid argument,
1129         instead of the number 0.
1130
1131         * bindings/js/kjs_html.cpp:
1132         (KJS::JSHTMLCollection::getOwnPropertySlot):
1133         (KJS::JSHTMLCollection::callAsFunction):
1134         (KJS::JSHTMLCollectionPrototypeFunction::callAsFunction):
1135
1136 2007-03-18  David Hyatt  <hyatt@apple.com>
1137
1138         Use fillRect instead of drawLine, since drawLine has some odd behavior (it's only used for borders).
1139
1140         Reviewed by aroben
1141
1142         * platform/graphics/IntRect.h:
1143         * rendering/RenderFrameSet.cpp:
1144         (WebCore::RenderFrameSet::paintColumnBorder):
1145         (WebCore::RenderFrameSet::paintRowBorder):
1146
1147 2007-03-18  David Hyatt  <hyatt@apple.com>
1148
1149         Change the frameborder color to be light gray for framesets.
1150
1151         Reviewed by aroben
1152
1153         * rendering/RenderFrameSet.cpp:
1154         (WebCore::borderFillColor):
1155         (WebCore::RenderFrameSet::paintColumnBorder):
1156         (WebCore::RenderFrameSet::paintRowBorder):
1157
1158 2007-03-18  David Hyatt  <hyatt@apple.com>
1159
1160         Make iframes work properly with frameborder="0".
1161
1162         Reviewed by aroben
1163
1164         * html/HTMLIFrameElement.cpp:
1165         (WebCore::HTMLIFrameElement::mapToEntry):
1166         (WebCore::HTMLIFrameElement::parseMappedAttribute):
1167
1168 2007-03-18  David Hyatt  <hyatt@apple.com>
1169
1170         Add a 2px border by default to <iframe>s for compatibility with other browsers.
1171
1172         Reviewed by aroben
1173
1174         * css/html4.css:
1175
1176 2007-03-18  David Hyatt  <hyatt@apple.com>
1177
1178         Move frame borders out of WebKit and into WebCore.
1179
1180         Reviewed by aroben, olliej
1181
1182         * bridge/mac/FrameViewMac.mm:
1183         * css/html4.css:
1184         * html/HTMLFrameSetElement.cpp:
1185         (WebCore::HTMLFrameSetElement::HTMLFrameSetElement):
1186         (WebCore::HTMLFrameSetElement::mapToEntry):
1187         (WebCore::HTMLFrameSetElement::parseMappedAttribute):
1188         (WebCore::HTMLFrameSetElement::attach):
1189         * html/HTMLFrameSetElement.h:
1190         (WebCore::HTMLFrameSetElement::hasBorderColor):
1191         * page/FrameView.cpp:
1192         (WebCore::FrameViewPrivate::FrameViewPrivate):
1193         * page/FrameView.h:
1194         * page/mac/WebCoreFrameBridge.h:
1195         * platform/graphics/IntRect.h:
1196         (WebCore::IntRect::topLeft):
1197         (WebCore::IntRect::topRight):
1198         (WebCore::IntRect::bottomLeft):
1199         (WebCore::IntRect::bottomRight):
1200         * rendering/RenderFrame.cpp:
1201         (WebCore::RenderFrame::viewCleared):
1202         * rendering/RenderFrameSet.cpp:
1203         (WebCore::borderStartEdgeColor):
1204         (WebCore::borderEndEdgeColor):
1205         (WebCore::RenderFrameSet::paintColumnBorder):
1206         (WebCore::RenderFrameSet::paintRowBorder):
1207         (WebCore::RenderFrameSet::paint):
1208         * rendering/RenderFrameSet.h:
1209         * rendering/RenderPartObject.cpp:
1210         (WebCore::RenderPartObject::viewCleared):
1211         * rendering/RenderView.cpp:
1212         (WebCore::RenderView::repaintViewRectangle):
1213
1214 2007-03-17  David Hyatt  <hyatt@apple.com>
1215
1216         Make onload do an explicit paint when a top-level document is ready (to ensure that a first paint always
1217         happens before any timers set by the onload can fire).
1218
1219         Reviewed by aroben
1220
1221         * dom/Document.cpp:
1222         (WebCore::Document::implicitClose):
1223         * platform/ScrollView.h:
1224         * platform/mac/ScrollViewMac.mm:
1225         (WebCore::ScrollView::update):
1226
1227 2007-03-17  Dave Hyatt  <hyatt@apple.com>
1228
1229         Prevent starvation of user input and painting when processing timers.
1230         If we are already in the processing of a custom timer message, don't allow that
1231         processing to do another PostMessage.  Force SetTimer to be used instead.
1232       
1233         Reviewed by ggaren
1234
1235        * platform/win/SharedTimerWin.cpp:
1236         (WebCore::TimerWindowWndProc):
1237         (WebCore::setSharedTimerFireTime):
1238
1239 2007-03-17  Geoffrey Garen  <ggaren@apple.com>
1240
1241         Reviewed by Beth Dakin.
1242
1243         Fixed <rdar://problem/5070967> REGRESSION (r20211): Repro crash when 
1244         closing View Source window
1245         
1246         I award myself 0 points, and may God have mercy on my soul.
1247
1248         * bindings/js/kjs_proxy.cpp:
1249         (WebCore::KJSProxy::~KJSProxy):
1250
1251 2007-03-17  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1252
1253         Not reviewed - gdk build fix.
1254
1255         * platform/gdk/TemporaryLinkStubs.cpp:
1256         (Pasteboard::writeURL):
1257
1258 2007-03-17  David Hyatt  <hyatt@apple.com>
1259
1260         Fix tiny PLT regression.  Don't examine the border/background data for RenderImage when images change
1261         unless we actually have a border/background.
1262
1263         Reviewed by Brady
1264
1265         * rendering/RenderImage.cpp:
1266         (WebCore::RenderImage::imageChanged):
1267
1268 2007-03-17  Nikolas Zimmermann  <zimmermann@kde.org>
1269
1270         Reviewed by Sam Weinig.
1271
1272         Fixes: http://bugs.webkit.org/show_bug.cgi?id=13046 (CSS styles on hover and focus are broken for <use>)
1273         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12838 (SVG <use> CSS styles broken)
1274         Added test: svg/custom/use-css-events.svg
1275
1276         In general this fixes the peepo.co.uk website.
1277
1278         Forgot to pass the actual StyleChange to the recalcStyle() function,
1279         when calling it on the shadow tree root element.
1280
1281         * ksvg2/svg/SVGUseElement.cpp:
1282         (WebCore::SVGUseElement::recalcStyle):
1283
1284 2007-03-17  Timothy Hatcher  <timothy@apple.com>
1285
1286         Reviewed by Mark Rowe.
1287
1288         Made Version.xcconfig smarter when building for different configurations.
1289         Now uses the 522+ OpenSource version for Debug and Release, while using the
1290         full 522.4 version for Production builds. The system prefix is also computed
1291         based on the current system, so 4522.4 on Tiger and 5522.4 on Leopard.
1292
1293         * Configurations/Version.xcconfig:
1294         * Configurations/WebCore.xcconfig:
1295
1296 2007-03-17  Antti Koivisto  <antti@apple.com>
1297
1298         Reviewed by Adele.
1299
1300         Fix http://bugs.webkit.org/show_bug.cgi?id=12595
1301         REGRESSION: Can't add item to cart at lnt.com (JS type error)
1302         <rdar://problem/4722863>
1303         
1304         Emulate Firefox behavior where form elements accessed by a name
1305         can be accessed with that name later even if the name changes or
1306         even if element is removed from the document.
1307         
1308         This is loosely based on Darin's earlier patch for the same problem but
1309         is much less expansive. It takes somewhat different approach to more closely
1310         mimic Firefox behavior. Includes expanded test case.
1311
1312         * bindings/js/JSHTMLFormElementCustom.cpp:
1313         (WebCore::JSHTMLFormElement::canGetItemsForName):
1314             Use new the HTMLFormElement::getNamedElements() method
1315         (WebCore::JSHTMLFormElement::nameGetter):
1316             Use new the HTMLFormElement::getNamedElements() method
1317         * html/HTMLFormElement.cpp:
1318         (WebCore::HTMLFormElement::HTMLFormElement):
1319         (WebCore::HTMLFormElement::~HTMLFormElement):
1320         (WebCore::HTMLFormElement::elementForAlias):
1321         (WebCore::HTMLFormElement::addElementAlias):
1322             Maintain a map of known element aliases
1323         (WebCore::HTMLFormElement::getNamedElements):
1324             Get a list of elements matching the name, based both their
1325             current names and known aliases (earlier names).
1326             Keep the alias list in sync.
1327         * html/HTMLFormElement.h:
1328
1329 2007-03-17  Adele Peterson  <adele@apple.com>
1330
1331         Reviewed by Hyatt.
1332
1333         Fix for <rdar://problem/4990050> REGRESSION: onchange gets fired when clicking on a programmatically selected element in a listbox
1334         http://bugs.webkit.org/show_bug.cgi?id=12725
1335
1336         Test: updated fast/forms/listbox-onchange.html
1337
1338         Added HTMLSelectElement::saveLastSelection that is called before changing a selection that could result
1339         in onChange being called.  m_lastOnChangeIndex and m_lastOnChangeSelection no longer have to be up-to date all the time, 
1340         they just have to be up-to-date before we execute an action that may trigger onChange.
1341
1342         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::setSelectedState): Added.
1343           The HTMLSelectElement will only set an option's selected state with this method.  This ensures
1344           that notifyOptionSelected won't get called when the call originates from the select element.
1345         * html/HTMLOptionElement.h:
1346
1347         * html/HTMLSelectElement.cpp:
1348         (WebCore::HTMLSelectElement::deselectItems): Calls setSelectedState.
1349         (WebCore::HTMLSelectElement::setSelectedIndex): ditto. Don't update the last selection variables here.  Scroll to the new selection.
1350          The scrolling call used to only be in notifyOptionSelected.  There's no reason we shouldn't scroll when the selection is set through
1351          the HTMLSelectElement.
1352         (WebCore::HTMLSelectElement::setValue): Call setSelectedIndex to update all options selected state.
1353         (WebCore::HTMLSelectElement::restoreState): Call setSelectedState.
1354         (WebCore::HTMLSelectElement::selectAll): Call saveLastSelection before making the selection, and calling onChange.
1355         (WebCore::HTMLSelectElement::recalcListItems): Call setSelectedState.  Don't need to save selection here anymore, 
1356          since it will get saved before we call onChange.
1357         (WebCore::HTMLSelectElement::reset): ditto.
1358         (WebCore::HTMLSelectElement::dispatchFocusEvent): Added. Call saveLastSelection for menu lists, since onChange can be fired
1359          on blur.
1360         (WebCore::HTMLSelectElement::dispatchBlurEvent): Call menuListOnChange.
1361         (WebCore::HTMLSelectElement::menuListDefaultEventHandler): Call saveLastSelection before showing the popup window.
1362         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):  Call saveLastSelection during mousedown (to prepare for an 
1363          onchange during mouseup, or after autoscroll).
1364         (WebCore::HTMLSelectElement::updateListBoxSelection): Call setSelectedState.
1365
1366         (WebCore::HTMLSelectElement::menuListOnChange): Added. Compares the m_lastOnChangeIndex to the selectedIndex().
1367         (WebCore::HTMLSelectElement::listBoxOnChange): Move the m_lastOnChangeSelection creation to saveLastSelection.
1368         (WebCore::HTMLSelectElement::saveLastSelection): Added. Sets m_lastOnChangeIndex or m_lastOnChangeSelection.
1369         * html/HTMLSelectElement.h:
1370         * platform/PopupMenu.h:
1371
1372 2007-03-16  Oliver Hunt  <oliver@apple.com>
1373
1374         Reviewed by Hyatt.
1375
1376         The old canSaveAsWebArchive call was necessary as stand alone
1377         images used to be rendered by ImageDocument.
1378
1379         Fixes rdar://problem/5061252
1380
1381         * dom/Clipboard.cpp:
1382         * dom/Clipboard.h:
1383         (WebCore::Clipboard::setDragHasStarted):
1384         * page/DragClient.h:
1385         (WebCore::DragClient::declareAndWriteDragImage):
1386         * platform/mac/ClipboardMac.mm:
1387         (WebCore::ClipboardMac::declareAndWriteDragImage):
1388
1389 2007-03-16  Anders Carlsson  <acarlsson@apple.com>
1390
1391         Reviewed by Maciej.
1392
1393         <rdar://problem/4869095>
1394         default content type changed for XMLHttpRequest POSTs changed (breaks Flickrator 0.1 widget)
1395         
1396         * xml/xmlhttprequest.cpp:
1397         (WebCore::XMLHttpRequest::send):
1398
1399 2007-03-16  Brady Eidson  <beidson@apple.com>
1400
1401         Rubberstamped by Tim Hatcher
1402
1403         Update the hash table header for Window object properties
1404
1405         * bindings/js/kjs_window.cpp:
1406
1407 2007-03-16  Brady Eidson  <beidson@apple.com>
1408
1409         Reviewed by Anders
1410
1411         <rdar://problem/5061826> and
1412         http://bugs.webkit.org/show_bug.cgi?id=12863
1413         Implement window.stop()
1414
1415         * bindings/js/kjs_window.cpp:
1416         (KJS::WindowFunc::callAsFunction): Add case Window::Stop
1417         * bindings/js/kjs_window.h:
1418         (KJS::Window::): Add "Stop"
1419
1420 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1421
1422         Reviewed by Brady Eidson.
1423
1424         Fixed dir creation to account for already existing dirs and missing leading
1425         dirs in path.
1426         
1427         * loader/icon/IconDatabase.cpp:
1428         (WebCore::makeAllDirectories):
1429
1430 2007-03-16  David Hyatt  <hyatt@apple.com>
1431
1432         Fix for 13084, assertion failure in the Cache.  Convert the client list
1433         to a HashCountedSet so that multiple refs and derefs are allowed.
1434
1435         Fix RenderImage so that if it has the same image used as a background/border
1436         and as the foreground that it will repaint properly (can be tested using
1437         border-image and a foreground image).
1438
1439         Optimize list marker so that it doesn't waste time in the base class method,
1440         since list markers don't support background or border images.
1441
1442         Reviewed by andersca
1443
1444         * ChangeLog:
1445         * loader/CachedResource.cpp:
1446         (WebCore::CachedResource::ref):
1447         * loader/CachedResource.h:
1448         * loader/CachedResourceClientWalker.cpp:
1449         (WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
1450         * loader/CachedResourceClientWalker.h:
1451         * rendering/RenderImage.cpp:
1452         (WebCore::RenderImage::imageChanged):
1453         * rendering/RenderListMarker.cpp:
1454         (WebCore::RenderListMarker::imageChanged):
1455
1456 2007-03-16  Geoffrey Garen  <ggaren@apple.com>
1457
1458         Reviewed by Anders Carlsson.
1459         
1460         Fixed <rdar://problem/5065399> REGRESSION: leaks in Frame::bindingRootObject 
1461         seen on buildbot
1462
1463         The problem was that we were initializing the same WebScriptObject twice.
1464         This caused it to leak its original set of ivars.
1465         
1466         I think some refactoring could prevent this situation from arising in the
1467         first place, but I'm just adding a check at the call site for now, to do 
1468         the simplest thing.
1469
1470         * bindings/objc/WebScriptObject.mm:
1471         (-[WebScriptObject _setImp:originRootObject:rootObject:]): Added ASSERTs
1472         against multiple calls.
1473
1474         * bindings/objc/WebScriptObjectPrivate.h: Renamed _initializeWithObjectImp
1475         to setImp because "init" vs "initialize" was a too subtle indication that
1476         one was a Cocoa initializer and one was not.
1477
1478 2007-03-16  Lars Knoll <lars@trolltech.com>
1479
1480         don't use #import in .cpp files.
1481
1482         * editing/qt/EditorQt.cpp:
1483
1484 2007-03-16  Lars Knoll <lars@trolltech.com>
1485
1486         Fix the Qt build once again.
1487
1488         * platform/qt/PasteboardQt.cpp:
1489         (WebCore::Pasteboard::Pasteboard):
1490         (WebCore::Pasteboard::writeSelection):
1491         (WebCore::Pasteboard::plainText):
1492         (WebCore::Pasteboard::documentFragment):
1493         (WebCore::Pasteboard::writeURL):
1494         (WebCore::Pasteboard::writeImage):
1495         (WebCore::Pasteboard::clear):
1496
1497 2007-03-15  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
1498
1499         Gdk build fix.
1500
1501         * loader/gdk/FrameLoaderClientGdk.cpp:
1502         (WebCore::FrameLoaderClientGdk::blockedError):
1503         * loader/gdk/FrameLoaderClientGdk.h:
1504
1505 2007-03-15  Beth Dakin  <bdakin@apple.com>
1506
1507         Reviewed by Geoff.
1508
1509         Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
1510         (r19761-19779): Copy image no longer includes image address 
1511         (rdar://5067927)
1512
1513         writeURL() does not need an isImage parameter. Now that it accepts 
1514         the types as a parameter, we can just declare the appropriate image 
1515         types within writeImage and send them to writeURL(). Also, 
1516         declaring the types twice is what broke this.
1517
1518         * platform/Pasteboard.h:
1519         * platform/mac/PasteboardMac.mm:
1520         (WebCore::Pasteboard::writeURL):
1521         (WebCore::Pasteboard::writeImage):
1522
1523 2007-03-15  Adele Peterson  <adele@apple.com>
1524
1525         Reviewed by Kevin Decker.
1526
1527         Fix for <rdar://problem/4926179> Text in menulist control should never update if menu is open
1528
1529         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
1530           Only setTextFromOption if the menu isn't visible.
1531
1532 2007-03-15  Brady Eidson  <beidson@apple.com>
1533
1534         Reviewed by Oliver
1535
1536         A few platform specific tweaks
1537
1538         * platform/cf/RetainPtr.h:
1539         (WebCore::RetainPtr::releaseRef): Fixed releaseRef to work with CF
1540         
1541         * platform/network/ResourceHandle.h: Added a "releaseRef" style call
1542
1543 2007-03-15  Maciej Stachowiak  <mjs@apple.com>
1544
1545         Reviewed by Geoff and Steve.
1546
1547         * config.h: Remove unneeded hack.
1548
1549 2007-03-15  Justin Garcia  <justin.garcia@apple.com>
1550
1551         Reviewed by john
1552         
1553         <rdar://problem/5062376> 
1554         REGRESSION: In Mail and Gmail, can't change alignment to text after it has been applied
1555         
1556         Bring back the remove step in applyBlockStyle.  It's 
1557         necessary because addBlockStyleIfNeeded assumes that 
1558         the properties it adds aren't already on the block that 
1559         it adds them to.
1560
1561         * editing/ApplyStyleCommand.cpp:
1562         (WebCore::ApplyStyleCommand::applyBlockStyle): 
1563         Bring back the remove step (added a testcase).
1564         Don't do the add step if m_removeOnly is true (no testcase
1565         because there aren't any clients using removeOnly functionality
1566         to remove styles yet, only styled elemets).
1567         Moved the code for creating new blocks up one level
1568         to this function so that we can pass blocks to removeCSSStyle.
1569         When converting VisiblePositions to indices and vice versa,
1570         use the highest node in the shadow tree if we're in one as
1571         the scope (working on a testcase).
1572         (WebCore::ApplyStyleCommand::addBlockStyle): Moved code to
1573         applyBlockStyle.
1574         * editing/ApplyStyleCommand.h: 
1575
1576 2007-03-15  Brady Eidson  <beidson@apple.com>
1577
1578         Reviewed by Maciej
1579
1580         <rdar://problem/4429701>
1581         Implements a port blocking black list that matches Firefox's
1582
1583         * loader/FrameLoader.cpp:
1584         (WebCore::FrameLoader::blockedError): Call through to the client for blockedError 
1585         * loader/FrameLoader.h:
1586
1587         * loader/FrameLoaderClient.h: Get the "port blocked" error for the current platform
1588
1589         * loader/ResourceLoader.cpp:
1590         (WebCore::ResourceLoader::wasBlocked): ResourceHandleClient method to pass on the didFail(error)
1591         (WebCore::ResourceLoader::blockedError): Following the pattern of "CancelledError()", get the 
1592           error to fail with for the didFail() call
1593         * loader/ResourceLoader.h:
1594
1595         * platform/graphics/svg/SVGImageEmptyClients.h:
1596         (WebCore::SVGEmptyFrameLoaderClient::blockedError): Added stub
1597
1598         * platform/network/ResourceHandle.cpp:
1599         (WebCore::ResourceHandle::create): If the port is blocked, create the handle but schedule it for
1600           deferred failure on a timer
1601         (WebCore::ResourceHandle::scheduleBlockedFailure): Do the timer scheduling
1602         (WebCore::ResourceHandle::fireBlockedFailure): Fire the timer here
1603         (WebCore::ResourceHandle::portAllowed): Implements checking of Mozilla's
1604         * platform/network/ResourceHandle.h:
1605         * platform/network/ResourceHandleClient.h:
1606         (WebCore::ResourceHandleClient::wasBlocked): Virtual for clients to get the "blocked" message
1607
1608 2007-03-15  Beth Dakin  <bdakin@apple.com>
1609
1610         Reviewed by Hyatt.
1611
1612         Fix for <rdar://problem/5065396> REGRESSION: leaks in 
1613         RenderBlock::layoutInlineChildren seen on buildbot
1614
1615         This leak appeared after http://trac.webkit.org/projects/webkit/
1616         changeset/20188. This change shifted line boxes around in 
1617         removeChild(). But since removeChild() calls 
1618         setNeedsLayoutAndMinMaxRecalc(), all of the line boxes will be 
1619         removed once we actually lay out anyway. So this patch fixes the 
1620         leak by deleting the line boxes instead of shifting them around. 
1621
1622         * editing/IndentOutdentCommand.cpp:
1623         (WebCore::IndentOutdentCommand::outdentParagraph): Call into 
1624         updateLayout(). This fixes an assertion I got in editing/
1625         execCommand/4976800.html This is very similar to the line box fix I 
1626         made recently (http://trac.webkit.org/projects/webkit/changeset/
1627         20177). We need to update layout before relying on VisiblePositions 
1628         after removing a node.
1629         * rendering/RenderBlock.cpp:
1630         (WebCore::RenderBlock::deleteLinesForBlock): New helper function 
1631         since this functionality is needed in three places now.
1632         (WebCore::RenderBlock::makeChildrenNonInline): Call into new 
1633         deleteLinesForBlock().
1634         (WebCore::RenderBlock::removeChild): Same.
1635         * rendering/RenderBlock.h:
1636
1637 2007-03-15  Timothy Hatcher  <timothy@apple.com>
1638
1639         Reviewed by John.
1640
1641         * Factored out most of our common build settings into .xcconfig files. Anything that was common in
1642           each build configuration was factored out into the shared .xcconfig file.
1643         * Adds a Version.xcconfig file to define the current framework version, to be used in other places.
1644         * Use the new $(BUNDLE_VERSION) (defined in Version.xcconfig) in the preprocessed Info.plist.
1645         * Use the versions defined in Version.xcconfig to set $(DYLIB_CURRENT_VERSION).
1646
1647         * Configurations/Base.xcconfig: Added.
1648         * Configurations/DebugRelease.xcconfig: Added.
1649         * Configurations/Version.xcconfig: Added.
1650         * Configurations/WebCore.xcconfig: Added.
1651         * Info.plist:
1652         * WebCore.xcodeproj/project.pbxproj:
1653
1654 2007-03-15  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
1655
1656         Not reviewed - gdk build fixes.
1657
1658         * platform/gdk/EditorClientGdk.cpp:
1659         (WebCore::EditorClientGdk::handleKeypress):
1660         * platform/graphics/cairo/ImageSourceCairo.cpp:
1661         (WebCore::ImageSource::setData):
1662         * platform/graphics/gdk/ImageGdk.cpp:
1663         (WebCore::Image::loadPlatformResource):
1664
1665 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
1666
1667         Reviewed by john
1668         
1669         ~2x speed up of 5k rich text paste:
1670         http://shakespeare.mit.edu/hamlet/full.html        
1671
1672         * editing/ReplaceSelectionCommand.cpp:
1673         (WebCore::ReplaceSelectionCommand::doApply): Remove the top 
1674         level style span if it's unnecessary before inserting
1675         into the document, it's faster than doing it after.
1676         * editing/ReplaceSelectionCommand.h: Exposed 
1677         ReplacementFragment::removeNodePreservingChildren so that
1678         the style span can be removed using non-undoable removes,
1679         like the rest of the removes done on the ReplacementFragment.
1680         * editing/markup.cpp:
1681         (WebCore::createMarkup): Make the style span the top level
1682         element, otherwise it's useless.  This also facilitates the
1683         optimization mentioned above.
1684         When including markup for a fully selected root, include markup
1685         for all the nodes beneath that fully selected root, to preserve 
1686         the structure and appearance of the copied markup.  Did this
1687         by merging with the code for adding markup for descendants of
1688         special commonAncestorBlocks.
1689
1690 2007-03-15  Beth Dakin  <bdakin@apple.com>
1691
1692         Rubber-stamped by Adele.
1693
1694         Rolling out http://trac.webkit.org/projects/webkit/changeset/20148 
1695         (which is a fix for http://bugs.webkit.org/show_bug.cgi?id=12595 
1696         and rdar://4722863) because it causes a horrible memory-trasher. 
1697
1698         * bindings/js/JSHTMLFormElementCustom.cpp:
1699         (WebCore::JSHTMLFormElement::canGetItemsForName):
1700         (WebCore::JSHTMLFormElement::nameGetter):
1701         * bindings/js/kjs_dom.cpp:
1702         (KJS::):
1703         (KJS::DOMNamedNodesCollection::DOMNamedNodesCollection):
1704         (KJS::DOMNamedNodesCollection::lengthGetter):
1705         (KJS::DOMNamedNodesCollection::indexGetter):
1706         (KJS::DOMNamedNodesCollection::getOwnPropertySlot):
1707         * bindings/js/kjs_dom.h:
1708         (KJS::DOMNamedNodesCollection::classInfo):
1709         * bindings/js/kjs_html.cpp:
1710         (KJS::JSHTMLCollection::getNamedItems):
1711         * dom/ChildNodeList.cpp:
1712         (WebCore::ChildNodeList::ChildNodeList):
1713         (WebCore::ChildNodeList::length):
1714         (WebCore::ChildNodeList::item):
1715         (WebCore::ChildNodeList::nodeMatches):
1716         * dom/ChildNodeList.h:
1717         * dom/NameNodeList.cpp:
1718         (WebCore::NameNodeList::NameNodeList):
1719         (WebCore::NameNodeList::item):
1720         (WebCore::NameNodeList::nodeMatches):
1721         * dom/NameNodeList.h:
1722         (WebCore::NameNodeList::rootNodeAttributeChanged):
1723         * dom/Node.cpp:
1724         (WebCore::TagNodeList::TagNodeList):
1725         (WebCore::TagNodeList::nodeMatches):
1726         (WebCore::Node::registerNodeList):
1727         (WebCore::Node::unregisterNodeList):
1728         * dom/Node.h:
1729         * dom/NodeList.cpp:
1730         (WebCore::NodeList::NodeList):
1731         (WebCore::NodeList::~NodeList):
1732         (WebCore::NodeList::recursiveLength):
1733         (WebCore::NodeList::itemForwardsFromCurrent):
1734         (WebCore::NodeList::itemBackwardsFromCurrent):
1735         (WebCore::NodeList::recursiveItem):
1736         (WebCore::NodeList::itemWithName):
1737         (WebCore::NodeList::rootNodeChildrenChanged):
1738         * dom/NodeList.h:
1739         (WebCore::NodeList::rootNodeAttributeChanged):
1740         * html/HTMLFormElement.cpp:
1741         (WebCore::HTMLFormElement::HTMLFormElement):
1742         (WebCore::HTMLFormElement::~HTMLFormElement):
1743         (WebCore::HTMLFormElement::formData):
1744         (WebCore::HTMLFormElement::parseMappedAttribute):
1745         (WebCore::HTMLFormElement::removeFormElement):
1746         * html/HTMLFormElement.h:
1747         * html/HTMLGenericFormElement.cpp:
1748         (WebCore::HTMLGenericFormElement::parseMappedAttribute):
1749         (WebCore::HTMLGenericFormElement::insertedIntoTree):
1750         * html/HTMLGenericFormElement.h:
1751         * html/HTMLInputElement.cpp:
1752         (WebCore::HTMLInputElement::parseMappedAttribute):
1753
1754 2007-03-15  Geoffrey Garen  <ggaren@apple.com>
1755
1756         Added an assert to help catch a bug. Hopefully someone will hit it!
1757         
1758         * bindings/js/kjs_proxy.cpp:
1759         (WebCore::KJSProxy::~KJSProxy):
1760
1761 2007-03-14  Oliver Hunt  <oliver@apple.com>
1762
1763         Reviewed by Adele.
1764
1765         Fix for rdar://problem/5061737.
1766         
1767         This was a regression from the original Objective-C -> C++ conversion
1768         for the drag logic.  We don't need to call Range::startNode as we just
1769         need the document that contains the range.   
1770
1771         * page/DragController.cpp:
1772         (WebCore::documentFragmentFromDragData):
1773
1774 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1775
1776         Reviewed by Hyatt.
1777
1778         - http://bugs.webkit.org/show_bug.cgi?id=13071
1779           REGRESSION: Plain text files no longer wrap lines longer than the width of the browser window
1780
1781         Test: fast/loader/text-document-wrapping.html
1782
1783         * loader/TextDocument.cpp:
1784         (WebCore::TextTokenizer::write): Specified word-wrap:break-word for the <pre> element.
1785
1786 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1787
1788         Reviewed by Hyatt.
1789
1790         - fix http://bugs.webkit.org/show_bug.cgi?id=13072
1791           REGRESSION (r15617): white-space: pre-wrap breaks off the last character of a wide word
1792
1793         Test: fast/text/whitespace/pre-wrap-last-char.html
1794
1795         * rendering/bidi.cpp:
1796         (WebCore::RenderBlock::findNextLineBreak): Undid the change from r15617.
1797
1798 2007-03-14  David Hyatt  <hyatt@apple.com>
1799
1800         Add asserts to help catch double refs and double derefs of CachedResources.
1801
1802         Reviewed by mjs
1803
1804         * loader/CachedResource.cpp:
1805         (WebCore::CachedResource::ref):
1806         (WebCore::CachedResource::deref):
1807
1808 2007-03-14  Alice Liu  <alice.liu@apple.com>
1809
1810         Rubber-stamped by Hyatt.
1811
1812         Adding null check to prevent the crash that happens on 2nd run of iBench HTML load test
1813
1814         * loader/icon/IconDataCache.cpp:
1815         (WebCore::IconDataCache::writeToDatabase):
1816
1817 === Safari-5522.4 ===
1818
1819 2007-03-14  Adele Peterson  <adele@apple.com>
1820
1821         Reviewed by Adam.
1822
1823         Fix for <rdar://problem/5062898> REGRESSION: autocomplete window in text fields doesn't come up
1824
1825         When we moved the initialization of a bunch of variables in the HTMLFormElement constructor, m_autocomplete accidently got initialized to false.
1826
1827         * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::HTMLFormElement):
1828
1829 2007-03-14  Steve Falkenburg  <sfalken@apple.com>
1830
1831         Reviewed by Adam.
1832
1833         Added missing null check in case this is called on a subframe
1834         that hasn't started loading.
1835
1836         * page/Frame.cpp:
1837         (WebCore::Frame::setMarkedTextMatchesAreHighlighted): Check for a null document.
1838
1839 2007-03-14  Antti Koivisto  <antti@apple.com>
1840
1841         Reviewed by Geoff.
1842
1843         Fix http://bugs.webkit.org/show_bug.cgi?id=13060
1844         REGRESSION: Repro ASSERT failure in Cache::adjustSize running layout tests
1845         <rdar://5060208>
1846         
1847         Script evaluation may have dereffed the CachedScript object already, causing double deref and
1848         eventually m_liveResourcesSize underflow.
1849
1850         * html/HTMLScriptElement.cpp:
1851         (WebCore::HTMLScriptElement::notifyFinished):
1852
1853 2007-03-14  Adele Peterson  <adele@apple.com>
1854
1855         Reviewed by Darin.
1856
1857         Added InsertTab, InsertBacktab, InsertLineBreak, and InsertNewline to the editing command table.
1858         Added Event parameter to execCommand, and to all of the enabled and exec functions.  Right now,
1859         the event is only used by the newly added commands.  But in the future, many (and possibly all) of
1860         these editing commands will need to consider the event so they are applied to the correct selection.
1861
1862         * WebCore.exp:
1863         * editing/Editor.cpp:
1864         (WebCore::execCopy):
1865         (WebCore::execCut):
1866         (WebCore::execDelete):
1867         (WebCore::execBackwardDelete):
1868         (WebCore::execForwardDelete):
1869         (WebCore::execMoveBackward):
1870         (WebCore::execMoveBackwardAndModifySelection):
1871         (WebCore::execMoveUpByPageAndModifyCaret):
1872         (WebCore::execMoveDown):
1873         (WebCore::execMoveDownAndModifySelection):
1874         (WebCore::execMoveForward):
1875         (WebCore::execMoveForwardAndModifySelection):
1876         (WebCore::execMoveDownByPageAndModifyCaret):
1877         (WebCore::execMoveLeft):
1878         (WebCore::execMoveLeftAndModifySelection):
1879         (WebCore::execMoveRight):
1880         (WebCore::execMoveRightAndModifySelection):
1881         (WebCore::execMoveToBeginningOfDocument):
1882         (WebCore::execMoveToBeginningOfDocumentAndModifySelection):
1883         (WebCore::execMoveToBeginningOfSentence):
1884         (WebCore::execMoveToBeginningOfSentenceAndModifySelection):
1885         (WebCore::execMoveToBeginningOfLine):
1886         (WebCore::execMoveToBeginningOfLineAndModifySelection):
1887         (WebCore::execMoveToBeginningOfParagraph):
1888         (WebCore::execMoveToBeginningOfParagraphAndModifySelection):
1889         (WebCore::execMoveToEndOfDocument):
1890         (WebCore::execMoveToEndOfDocumentAndModifySelection):
1891         (WebCore::execMoveToEndOfSentence):
1892         (WebCore::execMoveToEndOfSentenceAndModifySelection):
1893         (WebCore::execMoveToEndOfLine):
1894         (WebCore::execMoveToEndOfLineAndModifySelection):
1895         (WebCore::execMoveToEndOfParagraph):
1896         (WebCore::execMoveToEndOfParagraphAndModifySelection):
1897         (WebCore::execMoveParagraphBackwardAndModifySelection):
1898         (WebCore::execMoveParagraphForwardAndModifySelection):
1899         (WebCore::execMoveUp):
1900         (WebCore::execMoveUpAndModifySelection):
1901         (WebCore::execMoveWordBackward):
1902         (WebCore::execMoveWordBackwardAndModifySelection):
1903         (WebCore::execMoveWordForward):
1904         (WebCore::execMoveWordForwardAndModifySelection):
1905         (WebCore::execMoveWordLeft):
1906         (WebCore::execMoveWordLeftAndModifySelection):
1907         (WebCore::execMoveWordRight):
1908         (WebCore::execMoveWordRightAndModifySelection):
1909         (WebCore::execPaste):
1910         (WebCore::execSelectAll):
1911         (WebCore::execToggleBold):
1912         (WebCore::execToggleItalic):
1913         (WebCore::execRedo):
1914         (WebCore::execUndo):
1915         (WebCore::execInsertTab):
1916         (WebCore::execInsertBacktab):
1917         (WebCore::execInsertNewline):
1918         (WebCore::execInsertLineBreak):
1919         (WebCore::enabled):
1920         (WebCore::canPaste):
1921         (WebCore::hasEditableSelection):
1922         (WebCore::hasEditableRangeSelection):
1923         (WebCore::hasRangeSelection):
1924         (WebCore::hasRichlyEditableSelection):
1925         (WebCore::canRedo):
1926         (WebCore::canUndo):
1927         (WebCore::CommandEntry::):
1928         (WebCore::Editor::toggleBold):
1929
1930         (WebCore::Editor::execCommand): Added optional event parameter.
1931         (WebCore::Editor::insertText): Added.  Calls handleTextInputEvent.
1932         (WebCore::Editor::insertTextWithoutSendingTextEvent): Renamed from insertText.
1933          Performs the actual insertion without dispatching any event.
1934         * editing/Editor.h:
1935         * page/EventHandler.cpp: (WebCore::EventHandler::defaultTextInputEventHandler):
1936           Call insertTextWithoutSendingTextEvent.
1937
1938 2007-03-14  Justin Garcia  <justin.garcia@apple.com>
1939
1940         Reviewed by darin
1941         
1942         ~3x speedup pasting 5k lines of rich text:
1943         http://shakespeare.mit.edu/hamlet/full.html
1944         ~2x speedup pasting 10k lines of plain text
1945         
1946         * css/CSSComputedStyleDeclaration.cpp:
1947         (WebCore::computedStyle): Added for convenience.
1948         * css/CSSComputedStyleDeclaration.h:
1949         * editing/ReplaceSelectionCommand.cpp:
1950         (WebCore::ReplaceSelectionCommand::removeRedundantStyles):
1951         The code that pushed down the top level style span had
1952         a bug in it that made it do unnecessary work.  Instead of
1953         fixing the bug I removed the code because it was used to 
1954         help see more redundancies in second level style spans, but 
1955         createMarkup now *only* creates a top level style span.
1956         Only remove redundant styles from style spans and only remove
1957         unstyled elements if they are style spans.  FF doesn't
1958         remove redundant styles from elements, or remove redundant 
1959         font tags on copy/paste.  We could offer this functionality 
1960         through a separate "cleanup" command.
1961         * editing/markup.cpp:
1962         (WebCore::createMarkup): Only add markup for ancestors of 
1963         lastClosed if we're including markup for acommonAncestorBlock 
1964         (we do this for commonAncestorBlocks like tables and lists),
1965         otherwise it's unnecessary/redundant.
1966
1967 2007-03-14  Anders Carlsson  <acarlsson@apple.com>
1968
1969         Reviewed by Ada.
1970
1971         Make sure to call ResourceLoader::didReceiveData to ensure that there's a shared buffer with the resource
1972         data, since SubresourceLoaderClients now make use of that buffer.
1973         
1974         * loader/SubresourceLoader.cpp:
1975         (WebCore::SubresourceLoader::didReceiveData):
1976
1977 2007-03-14  Administrator  <acarlsson@apple.com>
1978
1979         Get the size from the shared buffer.
1980         
1981         * platform/graphics/cg/ImageSourceCG.cpp:
1982         (WebCore::ImageSource::setData):
1983         * platform/graphics/cg/PDFDocumentImage.cpp:
1984         (WebCore::PDFDocumentImage::dataChanged):
1985
1986 2007-03-14  Mitz Pettel  <mitz@webkit.org>
1987
1988         Reviewed by Hyatt, thumbs up by Darin.
1989
1990         - fix http://bugs.webkit.org/show_bug.cgi?id=12782
1991           Reproducible crash in BidiContext::deref
1992
1993         Test: fast/dynamic/anonymous-block-orphaned-lines.html
1994
1995         * rendering/InlineBox.cpp:
1996         (WebCore::InlineBox::root): Added an assertion that we return a root inline box.
1997         * rendering/RenderBlock.cpp:
1998         (WebCore::RenderBlock::removeChild): Added code to adopt the line boxes of
1999         anonymous blocks being destroyed instead of leaving them orphaned, which
2000         is what caused this crash. The boxes will be deleted on the next layout, but
2001         this ensures consistency in the mean time.
2002
2003 2007-03-14  Lars Knoll <lars@trolltech.com>
2004
2005         Reviewed by Antti.
2006
2007         Fix the Qt build.
2008         Add a getter to SharedBuffer that returns a reference to the internal
2009         Vector to avoid an extra copy of the data.
2010
2011         * platform/SharedBuffer.h:
2012         (WebCore::SharedBuffer::buffer):
2013         * platform/graphics/qt/ImageQt.cpp:
2014         (WebCore::Image::loadPlatformResource):
2015         * platform/graphics/qt/ImageSourceQt.cpp:
2016         (WebCore::detectImageFormat):
2017         (WebCore::createDecoder):
2018         (WebCore::ImageSource::setData):
2019
2020 2007-03-14  Antti Koivisto  <antti@apple.com>
2021
2022         Reviewed by Mitz.
2023         
2024         Fix <rdar://problem/5058774>
2025         REGRESSION: In Mail, caret appears oversized when typing in a To Do note
2026         
2027         Horizontal and vertical were switched. Was regression from
2028         http://trac.webkit.org/projects/webkit/changeset/20103
2029
2030         * rendering/RootInlineBox.cpp:
2031         (WebCore::RootInlineBox::addHighlightOverflow):
2032
2033 2007-03-14  David Hyatt  <hyatt@apple.com>
2034
2035         Tweak the data() functions of stylesheets and scripts to be internally consistent.
2036
2037         * loader/CachedCSSStyleSheet.cpp:
2038         (WebCore::CachedCSSStyleSheet::data):
2039         * loader/CachedScript.cpp:
2040         (WebCore::CachedScript::data):
2041         * loader/CachedXSLStyleSheet.cpp:
2042         (WebCore::CachedXSLStyleSheet::data):
2043
2044 2007-03-14  David Hyatt  <hyatt@apple.com>
2045
2046         Fix Radar 5050688.  
2047
2048         For large animated GIFs, destroy and recreate the source for every animation frame.  This keeps
2049         the memory consumption down while giant images are animating.
2050
2051         Reviewed by andersca
2052
2053         * platform/graphics/BitmapImage.cpp:
2054         (WebCore::BitmapImage::BitmapImage):
2055         (WebCore::BitmapImage::destroyDecodedData):
2056         (WebCore::BitmapImage::dataChanged):
2057         (WebCore::BitmapImage::advanceAnimation):
2058         * platform/graphics/BitmapImage.h:
2059
2060 2007-03-14  David Hyatt  <hyatt@apple.com>
2061
2062         Make sure to use CFDataCreateWithBytesNoCopy where we can.
2063
2064         Reviewed by andersca
2065
2066         * platform/graphics/cg/ImageSourceCG.cpp:
2067         (WebCore::ImageSource::setData):
2068         * platform/graphics/cg/PDFDocumentImage.cpp:
2069         (WebCore::PDFDocumentImage::dataChanged):
2070
2071 2007-03-13  David Hyatt  <hyatt@apple.com>
2072
2073         Fix for bugzilla bug 13050 and also radar p1 5050645.
2074
2075         This patch reworks resource loading to avoid having redundant buffers in the icon database and in cached
2076         images in the WebCore cache.  It also avoids overcopying in top-level image documents and in the icon
2077         database.
2078
2079         There is now only one SharedBuffer for a resource and everybody observes that buffer now instead of ever
2080         making their own.  Even ImageIO uses the SharedBuffer while decoding.
2081
2082         The page in 13050 dropped from 145mb down to 45mb of memory use with this change for a stunning savings
2083         of 100mb.
2084
2085         Reviewed by olliej, mjs
2086
2087         * WebCore.exp:
2088         * loader/CachedCSSStyleSheet.cpp:
2089         (WebCore::CachedCSSStyleSheet::data):
2090         * loader/CachedCSSStyleSheet.h:
2091         * loader/CachedImage.cpp:
2092         (WebCore::CachedImage::data):
2093         * loader/CachedImage.h:
2094         * loader/CachedResource.cpp:
2095         (WebCore::CachedResource::CachedResource):
2096         (WebCore::CachedResource::~CachedResource):
2097         * loader/CachedResource.h:
2098         (WebCore::CachedResource::data):
2099         * loader/CachedScript.cpp:
2100         (WebCore::CachedScript::data):
2101         * loader/CachedScript.h:
2102         * loader/CachedXSLStyleSheet.cpp:
2103         (WebCore::CachedXSLStyleSheet::data):
2104         * loader/CachedXSLStyleSheet.h:
2105         * loader/DocLoader.cpp:
2106         (WebCore::DocLoader::checkCacheObjectStatus):
2107         * loader/ImageDocument.cpp:
2108         (WebCore::ImageTokenizer::writeRawData):
2109         (WebCore::ImageTokenizer::finish):
2110         * loader/icon/IconDataCache.cpp:
2111         (WebCore::IconDataCache::setImageData):
2112         (WebCore::IconDataCache::writeToDatabase):
2113         * loader/icon/IconDataCache.h:
2114         * loader/icon/IconDatabase.cpp:
2115         (WebCore::IconDatabase::imageDataForIconURL):
2116         (WebCore::IconDatabase::iconForPageURL):
2117         (WebCore::IconDatabase::setIconDataForIconURL):
2118         (WebCore::IconDatabase::setHaveNoIconForIconURL):
2119         (WebCore::IconDatabase::imageDataForIconURLQuery):
2120         * loader/icon/IconDatabase.h:
2121         * loader/icon/IconLoader.cpp:
2122         (WebCore::IconLoader::startLoading):
2123         (WebCore::IconLoader::didReceiveResponse):
2124         (WebCore::IconLoader::didReceiveData):
2125         (WebCore::IconLoader::didFail):
2126         (WebCore::IconLoader::finishLoading):
2127         (WebCore::IconLoader::clearLoadingState):
2128         * loader/icon/IconLoader.h:
2129         * loader/icon/SQLStatement.cpp:
2130         (WebCore::SQLStatement::getColumnBlobAsVector):
2131         (WebCore::SQLStatement::isExpired):
2132         * loader/icon/SQLStatement.h:
2133         * loader/loader.cpp:
2134         (WebCore::Loader::didFinishLoading):
2135         (WebCore::Loader::didReceiveData):
2136         * page/mac/WebCoreFrameBridge.mm:
2137         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2138         (-[WebCoreFrameBridge getAllResourceDatas:andResponses:]):
2139         * platform/SharedBuffer.h:
2140         (WebCore::SharedBuffer::isEmpty):
2141         * platform/graphics/BitmapImage.cpp:
2142         (WebCore::BitmapImage::destroyDecodedData):
2143         (WebCore::BitmapImage::dataChanged):
2144         * platform/graphics/BitmapImage.h:
2145         * platform/graphics/Image.cpp:
2146         (WebCore::Image::setData):
2147         * platform/graphics/Image.h:
2148         (WebCore::Image::dataChanged):
2149         (WebCore::Image::data):
2150         * platform/graphics/ImageSource.h:
2151         * platform/graphics/cg/ImageSourceCG.cpp:
2152         (WebCore::ImageSource::setData):
2153         * platform/graphics/cg/PDFDocumentImage.cpp:
2154         (WebCore::PDFDocumentImage::dataChanged):
2155         * platform/graphics/cg/PDFDocumentImage.h:
2156         * platform/graphics/mac/ImageMac.mm:
2157         (WebCore::Image::loadPlatformResource):
2158         * platform/graphics/svg/SVGImage.cpp:
2159         (WebCore::SVGImage::setData):
2160         * platform/mac/PasteboardMac.mm:
2161         (WebCore::fileWrapperForImage):
2162
2163 2007-03-13  Justin Garcia  <justin.garcia@apple.com>
2164
2165         Reviewed by darin
2166         
2167         <rdar://problem/5046875> 
2168         Gmail Editor: Applying alignment to selected text in message also applies alignment to signature
2169
2170         * editing/ApplyStyleCommand.cpp:
2171         (WebCore::ApplyStyleCommand::doApply): Don't call applyBlockStyle unless
2172         there is a block style to apply.
2173         (WebCore::ApplyStyleCommand::applyBlockStyle): Don't do the remove step.
2174         It was unnecessary and removed properties from blocks that could contain 
2175         content outside the range being operated on (added a testcase).
2176         (WebCore::ApplyStyleCommand::addBlockStyleIfNeeded): Used an early return
2177         instead of if-nesting.
2178         * editing/ApplyStyleCommand.h:
2179         * editing/CompositeEditCommand.cpp:
2180         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
2181         Return the new block, if one was created.  Use moveParagraphs to move
2182         paragraphs into the new block, instead of moving nodes.  The old code moved
2183         too much (added a testcase).
2184         * editing/CompositeEditCommand.h:
2185
2186 2007-03-13  Oliver Hunt  <oliver@apple.com>
2187
2188         Reviewed by Brady.
2189
2190         To fix <rdar://problem/5044366> we now pass a NSString
2191         representation of the URL extracted with _web_originalDataAsString
2192         instead of relying on [NSURL absoluteString] in the bridge
2193
2194         * page/mac/WebCoreFrameBridge.h:
2195         * page/mac/WebCoreFrameBridge.mm:
2196         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
2197
2198 2007-03-13  Brady Eidson  <beidson@apple.com>
2199
2200         Reviewed by Anders
2201
2202         <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache
2203
2204         Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 
2205         didFail() on them in the Cache loader.  As a result, we basically cleared all of the Subresource Loaders 
2206         out of the Cache loader before more properly failing them as errored out.  The result?  Partially loaded
2207         resources being cached.
2208         
2209         Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 
2210         didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders.
2211         
2212         In addition, pages that didn't completely load were being saved to the back/forward cache.  To fix that,
2213         I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 
2214         completely load.
2215
2216         Note that the layout test for this - if possible - will require other enhancements including possibly adding
2217         support for window.stop().  That task is documented in <rdar://problem/5061826>
2218
2219         * loader/FrameLoader.cpp:
2220         (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to
2221           more perfectly restore the original behavior - including only caching HTML documents via the 
2222           m_client->canCachePage() call
2223         (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different
2224           purpose
2225           - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 
2226           cachability of a page
2227
2228         * loader/loader.cpp:
2229         (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 
2230           loaders-in-progress set.  This adds the effect of properly cleaning up the cached object.
2231
2232 2007-03-13  Beth Dakin  <bdakin@apple.com>
2233
2234         Rendering part reviewed by Hyatt. Editing part consulted with and 
2235         rubber stamped by Justin and Harrison.
2236
2237         Fix for <rdar://problem/5025925> A hang occurs in Safari when 
2238         attempting to print page at http://www.pcadvisor.co.uk
2239
2240         * rendering/RenderBlock.cpp:
2241         (WebCore::RenderBlock::makeChildrenNonInline): 
2242         RenderBlock::makeChildrenNonInline() takes a block's inline 
2243         children and turns them into block children. If the children had 
2244         line boxes, those boxes were being leaked. In the layout test I 
2245         added with the change (and at pcadvisor.co.uk during printing) 
2246         children were being made non-inline, and then they were being made 
2247         inline again. This meant that some of the children ended up 
2248         pointing to totally stale line boxes that are normally just leaked. 
2249         This caused an infinite loop in RenderFlow::destroy(). This patch 
2250         simply deletes everyone's line boxes in 
2251         RenderBlock::makeChildrenNonInline()
2252
2253         * editing/InsertParagraphSeparatorCommand.cpp:
2254         (WebCore::InsertParagraphSeparatorCommand::doApply): The other part 
2255         of this fix is that I added a call to updateLayout in 
2256         InsertParagraphSeparatorCommand::doApply(). One layout test 
2257         (editing/spelling/spelling.html) was changed by my patch to 
2258         RenderBlock. doApply() inserts a node into the render tree. In at 
2259         least one case in spelling.html, that caused some line boxes to be 
2260         deleted. Back in doApply() this meant that the RenderTree was out-
2261         of-date, and we mistakenly thought we were at the end of the 
2262         paragraph. This caused us to insert a RenderBR() at the end of the 
2263         tree instead of an empty RenderText(). No one seems to know exactly 
2264         why we insert either, or if the change is necessarily a problem. It 
2265         is clear, though, that the RenderTree in doApply() is out-of-date 
2266         after inserting the node and deleting some line boxes, so it seems 
2267         prudent to call into updateLayout().
2268
2269 2007-03-13  Adam Roben  <aroben@apple.com>
2270
2271         Reviewed by Anders.
2272
2273         * platform/FontData.h: Added m_isSystemFont parameter to match NSFont.
2274
2275 2007-03-13  Beth Dakin  <bdakin@apple.com>
2276
2277         Reviewed by Maciej.
2278
2279         Export DocumentLoader::setFrame(). Part of fix for <rdar://
2280         problem/4277074> 8F32: Help Viewer crashed on clicking link - 
2281         KHTMLView::viewportMouseReleaseEvent (12647)
2282
2283         * WebCore.exp:
2284
2285 2007-03-13  Darin Adler  <darin@apple.com>
2286
2287         Reviewed by Maciej.
2288
2289         - fix http://bugs.webkit.org/show_bug.cgi?id=12794
2290           <rdar://problem/5028154> REGRESSION: TripTik planner at aaa.com never
2291           finishes loading due to unclosed canvas tag (12794)
2292
2293         Change <canvas> elements so that their contents are parsed normally,
2294         but not rendered. This change fixes the bug, because normal parsing
2295         rules close the <canvas> element in that case. The special parser
2296         stuff was just getting in the way.
2297
2298         Also do some basic cleanup to the HTML parser. This was motivated by
2299         an earlier version of this patch that made even more changes to the
2300         parser, but the cleanup is still worth landing.
2301
2302         Test: fast/canvas/canvas-hides-fallback.html
2303         Test: fast/canvas/script-inside-canvas-fallback.html
2304         Test: fast/canvas/unclosed-canvas-1.html
2305         Test: fast/canvas/unclosed-canvas-2.html
2306         Test: fast/canvas/unclosed-canvas-3.html
2307         Test: fast/canvas/unclosed-canvas-4.html
2308
2309         * html/HTMLCanvasElement.h: Added a data member to keep track of whether the
2310         renderer is a RenderHTMLCanvas or not.
2311         * html/HTMLCanvasElement.cpp:
2312         (WebCore::HTMLCanvasElement::createRenderer): If JavaScript is enabled, create
2313         a RenderHTMLCanvas. If it's not, let the default code create the default type
2314         of renderer, which will result in fallback content being visible. The
2315         RenderHTMLCanvas class already hides all of its children. Set the m_rendererIsCanvas
2316         boolean accordingly. Since the actual storage for the canvas is allocated lazily
2317         when you actually get a drawing context, we don't need to do anything special
2318         to prevent it when JavaScript is disabled; the relevant functions won't be called.
2319         (WebCore::HTMLCanvasElement::reset): Protect the code that manipulates the
2320         RenderHTMLCanvas with a check of m_rendererIsCanvas. This is the only code inside
2321         the DOM element that relies on the renderer type.
2322
2323         * html/HTMLParser.h: Removed unneeded includes. Marked HTMLParser as
2324         Noncopyable. Changed the Document parameter to the constructor to instead
2325         be HTMLDocument. Renamed discard_until to m_skipModeTag for clarity.
2326         Removed unused noSpaces function and unneeded public doc() function.
2327         Moved data members all down to the end so you can see them together in order.
2328         Renamed map to m_currentMapElement and isindex to m_isindexElement.
2329         Removed unused end and headLoaded data members.  Renamed m_fragment to
2330         m_isParsingFragment to make it clearer that it's a boolean, not a fragment.
2331
2332         * html/HTMLParser.cpp:
2333         (WebCore::HTMLParser::HTMLParser): Changed to use member construction
2334         syntax instead of calling reset(). This is especially helpful in the
2335         fragment case, where calling reset() later on is illegal, so not using
2336         it in the constructor lets us assert.
2337         (WebCore::HTMLParser::~HTMLParser): Did an explicit deref instead of
2338         calling setCurrent for its side effect.
2339         (WebCore::HTMLParser::reset): Updated for member name changes and removal
2340         and to use document instead of doc().
2341         (WebCore::HTMLParser::setCurrent): Use document instead of doc().
2342         (WebCore::HTMLParser::setSkipMode): Added. No longer inline. Now sets the
2343         m_inCanvasBeforeFirstOpenTag data member to false.
2344         (WebCore::HTMLParser::parseToken): Tightened up the skip mode logic at the
2345         top of the function, and added a FIXME about the strange case there where
2346         we don't skip yet stay in skip mode. Updated for renaming and doc().
2347         (WebCore::HTMLParser::insertNode): Updated for renaming and doc().
2348         (WebCore::HTMLParser::handleError): Ditto.
2349         (WebCore::HTMLParser::framesetCreateErrorCheck): Ditto.
2350         (WebCore::HTMLParser::isindexCreateErrorCheck): Changed to use RefPtr.
2351         (WebCore::HTMLParser::noscriptCreateErrorCheck): Updated for renaming and doc().
2352         (WebCore::HTMLParser::mapCreateErrorCheck): Ditto.
2353         (WebCore::HTMLParser::getNode): Removed the special case for canvas here.
2354         Canvas fallback is now handled in the DOM, not the parser. Updated for
2355         renaming and doc().
2356         (WebCore::HTMLParser::allowNestedRedundantTag): Changed a #define into a C++
2357         constant.
2358         (WebCore::HTMLParser::processCloseTag): Updated for renaming and doc().
2359         (WebCore::HTMLParser::isInline): Ditto.
2360         (WebCore::HTMLParser::tagIsOnStack): Added. Used by new canvas logic.
2361         (WebCore::HTMLParser::popBlock): Updated for renaming and doc(). Also renamed
2362         the local variable Elem to elem.
2363         (WebCore::HTMLParser::createHead): Ditto.
2364         (WebCore::HTMLParser::handleIsindex): Changed to use RefPtr.
2365         (WebCore::HTMLParser::startBody): Updated for renaming and doc().
2366         (WebCore::HTMLParser::finished): Ditto.
2367
2368 2007-03-13  David Hyatt  <hyatt@apple.com>
2369
2370         Two more cleanup fixes to the cache.  Don't call destroyDecodedData in the BitmapImage destructor, since
2371         clearing the image source and calling setData on it again causes it to do an extra copy of the encoded
2372         data.  Since we're about to be destroyed this is just wasteful.
2373
2374         When the cache prunes, don't allow it to destroy the decoded data of an image that is still actively loading,
2375         since we've established that ImageIO can actually crash if you yank the rug out from under it like that.
2376
2377         Reviewed by ggaren
2378
2379         * loader/Cache.cpp:
2380         (WebCore::Cache::prune):
2381         * platform/graphics/BitmapImage.cpp:
2382         (WebCore::BitmapImage::~BitmapImage):
2383
2384 2007-03-13  Anders Carlsson  <acarlsson@apple.com>
2385
2386         Try fixing the Qt build.
2387         
2388         * editing/Editor.h:
2389         (WebCore::Editor::setStartNewKillRingSequence):
2390
2391 2007-03-13  David Harrison  <harrison@apple.com>
2392
2393         Reviewed by Justin.
2394
2395         <rdar://problem/5031181> cntl-k at end of paragraph adds nothing to the kill ring
2396         <rdar://problem/5031189> REGRESSION: cntl-y yanks only the most recently killed content
2397
2398         For rdar://5031181, properly extend the selection before the killring handling, and
2399         make sure plainText of that selection returns a linefeed.
2400         
2401         For rdar://5031189, restore Editor::deleteRange() code that continued current killring,
2402         even though the range deletion implicitly stopped it via changing the selection.
2403         
2404         A byproduct of this change is the elimination of RUNDFINDER vs CONTENT TextIterator. The
2405         only difference between the two was whether to emit a newline when the range started
2406         with a blockflow element. No callers actually need that any more.
2407
2408         Tests added:
2409         * editing/pasteboard/emacs-ctrl-k-y-001-expected.checksum: Added.
2410         * editing/pasteboard/emacs-ctrl-k-y-001-expected.png: Added.
2411         * editing/pasteboard/emacs-ctrl-k-y-001-expected.txt: Added.
2412         * editing/pasteboard/emacs-ctrl-k-y-001.html: Added.
2413
2414         * editing/Editor.cpp:
2415         (WebCore::Editor::deleteRange):
2416         Clear the "start new kill ring sequence" setting, because it was set to true
2417         when the selection was updated by deleting the range.
2418         
2419         (WebCore::Editor::deleteWithDirection):
2420         If extending the selection to the end of paragraph resulted in a caret selection,
2421         extend by character, to handle the case when the selection started as a caret at
2422         the end of paragraph.
2423         
2424         * editing/TextIterator.cpp:
2425         (WebCore::TextIterator::TextIterator):
2426         Initialize new member variables for tracking handling of the beginning of the range.
2427         
2428         (WebCore::TextIterator::advance):
2429         Call representNodeOffsetZero on the m_endContainer.
2430         Move visibility checks into handleTextNode and handleReplacedElement.
2431         
2432         (WebCore::TextIterator::handleTextNode):
2433         (WebCore::TextIterator::handleTextBox):
2434         Call emitText.
2435         
2436         (WebCore::TextIterator::handleReplacedElement):
2437         Moved visibility check into here.
2438         
2439         (WebCore::shouldEmitNewlinesBeforeAndAfterNode):
2440         
2441         (WebCore::TextIterator::shouldRepresentNodeOffsetZero):
2442         (WebCore::TextIterator::representNodeOffsetZero):
2443         New. Emits proper sequence when encountering offset 0 of a node, including the
2444         m_endContainer. Started with code from handleNonTextNode.
2445         
2446         (WebCore::TextIterator::handleNonTextNode):
2447         Call representNodeOffsetZero.
2448         
2449         (WebCore::TextIterator::exitNode):
2450         Similar to shouldRepresentNodeOffsetZero, do not emit the newline if the node
2451         was collapsed, and before any other emitted content.
2452         
2453         (WebCore::TextIterator::emitCharacter):
2454         
2455         (WebCore::TextIterator::emitText):
2456         New. Consolidates code used by handleText and handleTextBox.
2457         
2458         (WebCore::CharacterIterator::CharacterIterator):
2459         Removed RUNFINDER.
2460
2461         (WebCore::WordAwareIterator::WordAwareIterator):
2462         Removed RUNFINDER.
2463         
2464         (WebCore::WordAwareIterator::advance):
2465         Formatting.
2466
2467         (WebCore::TextIterator::rangeLength):
2468         Formatting.
2469         
2470         * editing/TextIterator.h:
2471         Added member variables for tracking handling of the beginning of the range.
2472         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2473         
2474         * editing/visible_units.cpp:
2475         (WebCore::nextBoundary):
2476         Eliminated concept of RUNDFINDER vs CONTENT TextIterator.
2477
2478 2007-03-13  David Hyatt  <hyatt@apple.com>
2479
2480         Clean up the null image case in CachedImage::data to make sure the size totals will stay accurate.
2481         I'm not convinced this case can even be hit, but I'm cleaning it up just in case.
2482
2483         * loader/CachedImage.cpp:
2484         (WebCore::CachedImage::data):
2485
2486 2007-03-13  David Hyatt  <hyatt@apple.com>
2487
2488         Reorder the call to allReferencesRemoved, since otherwise the live object size will become
2489         incorrect.
2490
2491         * loader/CachedResource.cpp:
2492         (WebCore::CachedResource::deref):
2493
2494 2007-03-13  Antti Koivisto  <antti@apple.com>
2495
2496         Reviewed by Darin.
2497         
2498         Fix http://bugs.webkit.org/show_bug.cgi?id=11083
2499         REGRESSION: Typing tab key fails to insert a tab character in Google Docs editable area
2500         <rdar://problem/4757650>
2501         
2502         Allow inserting tabs in designMode. Backtab behaves like before (matches FF).
2503
2504         * page/EventHandler.cpp:
2505         (WebCore::EventHandler::defaultTabEventHandler):
2506
2507 2007-03-13  David Hyatt  <hyatt@apple.com>
2508
2509         Fix two counting errors in the decoded size of objects in the WebCore cache.  We need to explicitly
2510         destroy decoded data when clearing out a partially loaded image that had an error, since the destructor
2511         (although it does destroy the data) disconnects the observer so that the notification doesn't happen.
2512
2513         Some CachedImages aren't in the cache (like image documents).  When the decoded size of such an image
2514         changes we should not notify the cache, since - newsflash - we aren't actually in it.
2515
2516         Reviewed by ggaren
2517
2518         * loader/CachedImage.cpp:
2519         (WebCore::CachedImage::clear):
2520         (WebCore::CachedImage::decodedSizeChanged):
2521
2522 2007-03-13  Darin Adler  <darin@apple.com>
2523
2524         Reviewed by Tim Hatcher and John Sullivan.
2525
2526         - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at
2527           com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502
2528
2529         * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect):
2530         This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count:
2531         method was never really safe to call unless it was AppKit that called your
2532         drawRect: method. Changed it to call drawSingleRect: instead. A little ugly,
2533         but seems to work and will almost certainly fix the bug.
2534
2535 2007-03-13  Nikolas Zimmermann  <zimmermann@kde.org>
2536
2537         Reviewed by Maciej.
2538
2539         Fixes: http://bugs.webkit.org/show_bug.cgi?id=12974
2540
2541         Call forgetGenericContext in JSSVGPathSeg destructor, otherwhise
2542         we'll hit an ASSERT in a debug build, when running svg/custom/js-update-path-changes.svg
2543         a few dozen times in a single WebKit instance. The ASSERT is good and just warns that
2544         there was already a generic context pointer registered, and the new "to be registered"
2545         object already exists, but pointing to a different object. That's because garbage collection
2546         calls the JSSVGPathSeg destructor, but that didn't cleanup the generic context map.
2547
2548         Only JSSVGPathSeg is hit by this problem, as it's the only non SVGAnimated* type
2549         using the generic context system while using a custom JSSVGPathSegList implementation.
2550
2551         Also cleanup JSSVGPathSegListCustom code to call the static forgetGenericContext
2552         method instead of doing the same using custom code.
2553
2554         * bindings/js/JSSVGPathSegListCustom.cpp:
2555         (WebCore::removeFromPathSegContextMap):
2556         (WebCore::JSSVGPathSegList::clear):
2557         (WebCore::JSSVGPathSegList::removeItem):
2558         * bindings/scripts/CodeGeneratorJS.pm:
2559
2560 2007-03-13  Darin Adler  <darin@apple.com>
2561
2562         Reviewed by Adele.
2563
2564         - fix http://bugs.webkit.org/show_bug.cgi?id=12595
2565           <rdar://problem/4722863> REGRESSION: Can't add item to cart at lnt.com
2566           (JS type error) (12595)
2567
2568         Test: fast/forms/old-names.html
2569
2570         * bindings/js/JSHTMLFormElementCustom.cpp:
2571         (WebCore::JSHTMLFormElement::canGetItemsForName): If the form collection has
2572         nothing for a given name, try the form's oldNamedElement function.
2573         (WebCore::JSHTMLFormElement::nameGetter): Ditto.
2574
2575         * bindings/js/kjs_dom.h: Removed the DOMNamedNodesCollection. Instead we will use
2576         a class derived from NodeList.
2577         * bindings/js/kjs_dom.cpp: Ditto.
2578
2579         * bindings/js/kjs_html.cpp:
2580         (KJS::VectorNodeList::VectorNodeList): Added. Constructor for a new class derived
2581         from NodeList to be used for the named items result from a collection -- uses a
2582         vector of node pointers.
2583         (KJS::VectorNodeList::length): Added.
2584         (KJS::VectorNodeList::item): Added.
2585         (KJS::JSHTMLCollection::getNamedItems): Use VectorNodeList and the existing wrapper
2586         for NodeList rather than a custom JavaScript class, DOMNamedNodesCollection.
2587
2588         * dom/ChildNodeList.h:
2589         * dom/ChildNodeList.cpp:
2590         (WebCore::ChildNodeList::ChildNodeList): Updated to derive from TreeNodeList,
2591         since NodeList is now a simpler class.
2592         (WebCore::ChildNodeList::elementMatches): Updated for name and parameter change.
2593
2594         * dom/NameNodeList.h:
2595         * dom/NameNodeList.cpp:
2596         (WebCore::NameNodeList::NameNodeList): Updated to derive from TreeNodeList,
2597         since NodeList is now a simpler class.
2598         (WebCore::NameNodeList::rootNodeAttributeChanged): Updated for name and
2599         parameter change.
2600
2601         * dom/Node.h: Change register/unregister functions to take TreeNodeList.
2602         * dom/Node.cpp:
2603         (WebCore::TagNodeList::TagNodeList): Updated to derive from TreeNodeList,
2604         since NodeList is now a simpler abstract class.
2605         (WebCore::TagNodeList::elementMatches): Updated for name and parameter change.
2606         (WebCore::Node::registerNodeList): Changed type from NodeList to TreeNodeList.
2607         (WebCore::Node::unregisterNodeList): Ditto.
2608
2609         * dom/NodeList.h: Broke NodeList into a simpler base class and a derived class
2610         with the machinery for iterating a tree, called TreeNodeList.
2611         * dom/NodeList.cpp:
2612         (WebCore::NodeList::~NodeList): Added.
2613         (WebCore::NodeList::itemWithName): Factored out of the old itemWithName.
2614         (WebCore::TreeNodeList::TreeNodeList): Renamed from NodeList.
2615         (WebCore::TreeNodeList::~TreeNodeList): Ditto.
2616         (WebCore::TreeNodeList::recursiveLength): Ditto.
2617         (WebCore::TreeNodeList::itemForwardsFromCurrent): Ditto.
2618         (WebCore::TreeNodeList::itemBackwardsFromCurrent): Ditto.
2619         (WebCore::TreeNodeList::recursiveItem): Ditto.
2620         (WebCore::TreeNodeList::itemWithName): Factored half of this into this function,
2621         the other half in NodeList::itemWithName.
2622         (WebCore::TreeNodeList::rootNodeAttributeChanged): Added. No longer inline.
2623         (WebCore::TreeNodeList::rootNodeChildrenChanged): Renamed from NodeList.
2624
2625         * html/HTMLFormElement.h: Added formElementNameChanged and oldNamedElement
2626         fucntions, and a map called m_oldNames. Also removed m_boundary, which I
2627         thought I had already done.
2628         * html/HTMLFormElement.cpp:
2629         (WebCore::HTMLFormElement::HTMLFormElement): Initialize m_oldNames to 0.
2630         Switched the rest of the members to initialization syntax.
2631         (WebCore::HTMLFormElement::~HTMLFormElement): Delete m_oldNames.
2632         (WebCore::HTMLFormElement::formElementNameChanged): Added. Stores a reference
2633         to one element under each of its old names.
2634         (WebCore::HTMLFormElement::oldNamedElement): Added. Returns the old element
2635         that once had a given name.
2636
2637         * html/HTMLGenericFormElement.h:
2638         * html/HTMLGenericFormElement.cpp:
2639         (WebCore::HTMLGenericFormElement::parseMappedAttribute): When the name
2640         attribute changes, tell the form about the old name.
2641         (WebCore::HTMLGenericFormElement::insertedIntoTree): When telling a form
2642         about an element, also store away the old name so that we can use it
2643         when the name changes later.
2644
2645         * html/HTMLInputElement.cpp:
2646         (WebCore::HTMLInputElement::parseMappedAttribute): Added a call to the
2647         base class in the nameAttr case, so the code in HTMLGenericFormElement
2648         above will get called in the input element case.
2649
2650 2007-03-13  Antti Koivisto  <antti@apple.com>
2651
2652         Reviewed by Alexey.
2653
2654         Alexey spotted a DOS by using string of 64k unbreakable character in
2655         fix for http://bugs.webkit.org/show_bug.cgi?id=12833
2656
2657         * dom/Text.cpp:
2658         (WebCore::Text::createWithLengthLimit):
2659
2660 2007-03-13  Lars Knoll <lars@trolltech.com>
2661
2662         Fix the Qt build
2663
2664         * WebCore.pro:
2665
2666 2007-03-13  Rob Buis  <buis@kde.org>
2667
2668         Reviewed by Darin.
2669
2670         http://bugs.webkit.org/show_bug.cgi?id=12576
2671         WebKit does not support xlink:show attributes
2672
2673         Make an exception for non-empty targets, these should be opened
2674         in a new window, unless the value is _self.
2675
2676         * ksvg2/svg/SVGAElement.cpp:
2677         (WebCore::SVGAElement::defaultEventHandler):
2678
2679 2007-03-13  David Hyatt  <hyatt@apple.com>
2680
2681         - fix cache issues seen in http://bugs.webkit.org/show_bug.cgi?id=13050
2682           6 objects and ~200MB leaked after opening then closing tab
2683           <rdar://problem/5058714>
2684
2685         Double the encoded size of images for now.  We do this to account for a bug in ImageIO where they hold
2686         a separate copy of image data.  See <rdar://problem/5050645>.
2687
2688         Reviewed by aroben.
2689
2690         * loader/CachedImage.cpp:
2691         (WebCore::CachedImage::data):
2692
2693 2007-03-12  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
2694
2695         Not reviewed - gdk build fix.
2696
2697         * platform/gdk/TemporaryLinkStubs.cpp:
2698         (SearchPopupMenu::enabled): add missing stub.
2699
2700 2007-03-12  David Kilzer  <ddkilzer@kilzer.net>
2701
2702         Reviewed by Darin.
2703
2704         - fix http://bugs.webkit.org/show_bug.cgi?id=13045
2705           REGRESSION: Blackboard CourseWare Error with Nightlies after Mar 8
2706
2707         * html/HTMLFormElement.cpp:
2708         (WebCore::getUniqueBoundaryString): Speculative fix: remove dashes from
2709         the boundary prefix that appear after non-dash characters.
2710
2711 2007-03-12  Mitz Pettel  <mitz@webkit.org>
2712
2713         Reviewed by Anders.
2714
2715         - fix http://bugs.webkit.org/show_bug.cgi?id=13015
2716           REGRESSION (r17233-r17241): Repro crash when leaving a page whose unload handler submits a form
2717
2718         Test: fast/loader/onunload-form-submit-crash-2.html
2719
2720         * loader/DocumentLoader.cpp:
2721         (WebCore::DocumentLoader::finishedLoading): Added null check.
2722
2723 2007-03-12  Anders Carlsson  <acarlsson@apple.com>
2724
2725         Reviewed by Darin.
2726
2727         <rdar://problem/4900071>
2728         http://bugs.webkit.org/show_bug.cgi?id=6454
2729         ASSERTION: Navigating 'back' in frameset: !_private->previousItem (6454)
2730
2731         Change back the behavior of checkLoadComplete to traverse the entire frame tree instead of
2732         just the parent frames of the current frame. This is needed in order to reset the previous history item
2733         for all frames when doing a frame navigation. (This was changed in revision 11819)
2734         
2735         * loader/FrameLoader.cpp:
2736         (WebCore::FrameLoader::recursiveCheckLoadComplete):
2737         (WebCore::FrameLoader::checkLoadComplete):
2738         * loader/FrameLoader.h:
2739
2740 2007-03-12  Justin Garcia  <justin.garcia@apple.com>
2741
2742         Reviewed by darin
2743         
2744         <rdar://problem/5056619> 
2745         REGRESSION: Gmail Editor: Dragging text into Reply (textarea) field results in a crash at WebCore::InsertNodeBeforeCommand::doApply()
2746         
2747         * editing/SelectionController.cpp:
2748         (WebCore::removingNodeRemovesPosition): Added.
2749         (WebCore::SelectionController::nodeWillBeRemoved): Clear the
2750         selection if it's inside a shadow tree.
2751         * page/DragController.cpp:
2752         (WebCore::setSelectionToDragCaret): Return false to signal to
2753         clients that a drop shouldn't be performed if the second attempt
2754         to set a selection ends up in non-editable content.
2755
2756 2007-03-12  Darin Adler  <darin@apple.com>
2757
2758         Reviewed by Tim Hatcher.
2759
2760         - fixed JavaScript wrapper classes to be correct for a variety of cases
2761           that a new test uncovered: was broken for at least 5 classes
2762
2763         - fixed Objective-C wrapper classes to be correct for a variety of cases
2764           that a test case uncovered: was broken for ast least 50 classes
2765
2766         - added missing DOM API for creating OverflowEvent and WheelEvent instances
2767
2768         Test: fast/dom/wrapper-classes.html
2769
2770         * DerivedSources.make: Added missing bindings: HTMLCanvasElement for ObjC,
2771         CDATASection, Comment, and EntityReference for JavaScript.
2772         * WebCore.xcodeproj/project.pbxproj: Added those new generated files.
2773
2774         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2775         (WebCore::createJSHTMLWrapper): Corrected the wrapper classes for <keygen>,
2776         which needs an HTMLSelectElement wrapper, and <xmp>, which needs an
2777         HTMLPreElement wrapper.
2778
2779         * bindings/objc/DOMInternal.h: Updated for new naming scheme.
2780         Also moved createDOMWrapper from the KJS namespace to the WebCore namespace.
2781         * bindings/objc/DOMUtility.mm:
2782         (KJS::createDOMWrapper): Broke the core function into a separate one, and
2783         left it in the KJS namespace because Objective-C++ rules make it impossible
2784         for it to work in the WebCore namespace. Used a macro-based implementation
2785         to cut down on repeated code, and added missing cases for Counter,
2786         HTMLOptionsCollection, Range, XPathExpression, XPathResult, Event, RGBColor,
2787         Rect, Window, DOMImplementation, NodeIterator, TreeWalker, and HTMLCollection.
2788         (WebCore::createDOMWrapper): The other half of the function.
2789
2790         * bindings/objc/DOM.mm:
2791         (WebCore::createElementClassMap): Corrected the wrapper classes for
2792         <canvas>, which needs a DOMHTMLCanvasElement wrapper, <del>, which needs
2793         a DOMHTMLModElement wrapper, <embed>, which needs a DOMHTMLEmbedElement
2794         wrapper, <ins>, which needs a DOMHTMLModElement wrapper, <th>, which needs
2795         a DOMHTMLTableCellElement wrapper, and <xmp>, which needs an
2796         DOMHTMLPreElement wrapper.
2797         (+[DOMNode _wrapNode:]): Updated for new naming scheme.
2798         (+[DOMNode _wrapEventTarget:]): Ditto.
2799         (+[DOMNodeFilter _wrapNodeFilter:]): Ditto.
2800         (ObjCNodeFilterCondition::acceptNode): Ditto.
2801         (-[DOMDocument createNodeIterator:whatToShow:filter:expandEntityReferences:]): Ditto.
2802         (-[DOMDocument createTreeWalker:whatToShow:filter:expandEntityReferences:]): Ditto.
2803         (WebCore::ObjCEventListener::handleEvent): Ditto.
2804
2805         * dom/Document.cpp: (WebCore::Document::createEvent):
2806         Added cases for OverflowEvent and WheelEvent.
2807
2808         * dom/OverflowEvent.h: Added empty constructor and initOverflowEvent.
2809         * dom/OverflowEvent.cpp:
2810         (WebCore::OverflowEvent::OverflowEvent): Added.
2811         (WebCore::OverflowEvent::initOverflowEvent): Added.
2812         * dom/OverflowEvent.idl: Added initOverflowEvent.
2813
2814         * bindings/objc/PublicDOMInterfaces.h: Added initOverflowEvent.
2815
2816         * bindings/objc/DOMCSS.mm:
2817         (+[DOMStyleSheet _wrapStyleSheet:]): Updated for new naming scheme.
2818         (+[DOMCSSRule _wrapCSSRule:]): Corrected wrapper for CSSUnknownRule.
2819         (+[DOMCSSValue _wrapCSSValue:]): Updated for new naming scheme.
2820
2821         * bindings/js/kjs_css.h:
2822         (KJS::DOMRGBColor::impl): Added. Used when making an ObjC wrapper.
2823         (KJS::DOMRect::impl): Ditto.
2824
2825         * bindings/js/kjs_dom.cpp: (KJS::toJS): Corrected the wrapper classes for
2826         CDATASection, Comment, and EntityReference.
2827
2828         * bindings/js/kjs_html.cpp: Corrected the class name for HTMLElement
2829         (was "DOMHTMLElement") and HTMLCollection (was "Collection").
2830
2831         * bindings/objc/DOMImplementationFront.h:
2832         * bindings/objc/DOMImplementationFront.cpp:
2833         (WebCore::implementationFront): Added new overload that returns a front given
2834         a JavaScript wrapper. Needed by the code that makes the Objective-C wrapper.
2835
2836         * bindings/objc/WebScriptObject.mm:
2837         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
2838         Updated since createDOMWrapper is now in the WebCore namespace.
2839
2840         * bindings/scripts/CodeGeneratorObjC.pm: Update the naming scheme for the
2841         wrapper creation functions to use _wrapElement: rather then _elementWith:
2842         style. Removed now-unneeded special cases for things that needed to stay
2843         upper-case, since we don't have to do the whole lcfirst thing.
2844
2845         * html/HTMLCanvasElement.idl: Added #if so we can successfully generate the
2846         Objective-C wrapper for this class, even though we can't yet handle the
2847         DOMObject return type.
2848
2849         * html/HTMLOptionsCollection.idl: Added GenerateNativeConverter so we get
2850         an appropriate toJS function.
2851
2852         * bindings/objc/DOMEvents.mm:
2853         (+[DOMEvent _wrapEvent:]):
2854         * bindings/objc/DOMHTML.mm:
2855         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
2856         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
2857         * bindings/objc/DOMObject.mm:
2858         (-[DOMObject sheet]):
2859         * bindings/objc/DOMRGBColor.mm:
2860         (-[DOMRGBColor red]):
2861         (-[DOMRGBColor green]):
2862         (-[DOMRGBColor blue]):
2863         (-[DOMRGBColor alpha]):
2864         (+[DOMRGBColor _wrapRGBColor:]):
2865         * bindings/objc/DOMSVGPathSegInternal.mm:
2866         (+[DOMSVGPathSeg _wrapSVGPathSeg:]):
2867         * bindings/objc/DOMXPath.mm:
2868         (+[DOMNativeXPathNSResolver _wrapXPathNSResolver:]):
2869         * page/mac/WebCoreFrameBridge.mm:
2870         (-[WebCoreFrameBridge nodesFromList:]):
2871         (-[WebCoreFrameBridge elementWithName:inForm:]):
2872         (-[WebCoreFrameBridge formForElement:]):
2873         (-[WebCoreFrameBridge currentForm]):
2874         (-[WebCoreFrameBridge controlsInForm:]):
2875         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
2876         (-[WebCoreFrameBridge convertNSRangeToDOMRange:]):
2877         (-[WebCoreFrameBridge markDOMRange]):
2878         (-[WebCoreFrameBridge markedTextDOMRange]):
2879         (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]):
2880         (-[WebCoreFrameBridge documentFragmentWithMarkupString:baseURLString:]):
2881         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]):
2882         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]):
2883         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
2884         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
2885         (-[WebCoreFrameBridge increaseSelectionListLevel]):
2886         (-[WebCoreFrameBridge increaseSelectionListLevelOrdered]):
2887         (-[WebCoreFrameBridge increaseSelectionListLevelUnordered]):
2888         (-[WebCoreFrameBridge dragCaretDOMRange]):
2889         (-[WebCoreFrameBridge editableDOMRangeForPoint:]):
2890         (-[WebCoreFrameBridge characterRangeAtPoint:]):
2891         (-[WebCoreFrameBridge typingStyle]):
2892         (-[WebCoreFrameBridge rangeOfCharactersAroundCaret]):
2893         * platform/mac/ClipboardMac.mm:
2894         (WebCore::ClipboardMac::declareAndWriteDragImage):
2895         * platform/mac/PasteboardMac.mm:
2896         (WebCore::Pasteboard::writeSelection):
2897         Updated for new naming scheme.
2898
2899 2007-03-12  Timothy Hatcher  <timothy@apple.com>
2900
2901         Reviewed by Darin.
2902
2903         <rdar://problem/4990691> REGRESSION: Selecting text in Adium's Messages field causes horizontal shift
2904
2905         Corrected the recursive point conversion and scrolling done in scrollPointRecursively to use the
2906         document view of each NSClipView.
2907
2908         * platform/mac/ScrollViewMac.mm:
2909         (WebCore::ScrollView::scrollPointRecursively): Call convertPoint:fromView: on the document views,
2910         not the clip views as we encounter them. Then call constrainScrollPoint: on the converted point to
2911         constrain to the document view bounds. And finally call scrollPoint: on the document view, not the clip view.
2912
2913 2007-03-12  Antti Koivisto  <antti@apple.com>
2914
2915         Reviewed by Alexey.
2916
2917         Fix http://bugs.webkit.org/show_bug.cgi?id=12833
2918         REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
2919         <rdar://problem/5028159>
2920         
2921         Divide large text blocks (>64kB) over multiple text nodes. This limits linebox searches to
2922         a manageable subset.
2923         
2924         * dom/Text.cpp:
2925         (WebCore::Text::createWithLengthLimit):
2926         * dom/Text.h:
2927         * html/HTMLParser.cpp:
2928         (WebCore::HTMLParser::parseToken):
2929         * loader/TextDocument.cpp:
2930         (WebCore::TextTokenizer::write):
2931
2932 2007-03-12  David Hyatt  <hyatt@apple.com>
2933
2934         Fix a regression in printing.  Printer fonts need to be part of the
2935         font cache key, since printer fonts have different glyph widths.
2936         (Integer antialiasing is used for screen fonts but not for printer fonts.)
2937
2938         Reviewed by aroben
2939
2940         * platform/FontCache.cpp:
2941         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
2942         (WebCore::FontPlatformDataCacheKey::operator==):
2943         (WebCore::computeHash):
2944         (WebCore::FontCache::getCachedFontPlatformData):
2945
2946 2007-03-12  Lars Knoll <lars@trolltech.com>
2947
2948         add missing symbol to fix the Qt build again.
2949
2950         * platform/qt/SearchPopupMenuQt.cpp:
2951         (WebCore::SearchPopupMenu::enabled):
2952
2953 2007-03-12  Adele Peterson  <adele@apple.com>
2954
2955         Reviewed by Oliver.
2956
2957         Adding the ability to enable or disable a SearchPopupMenu.
2958
2959         * platform/SearchPopupMenu.h:
2960         * platform/mac/SearchPopupMenuMac.mm: (WebCore::SearchPopupMenu::enabled):
2961         * rendering/RenderTextControl.cpp: (WebCore::RenderTextControl::showPopup):
2962
2963 2007-03-12  Rob Buis  <buis@kde.org>
2964
2965         Reviewed by Nikolas Zimmermann.
2966
2967         http://bugs.webkit.org/show_bug.cgi?id=12500
2968         SVG fails to correctly handle all link style selectors
2969         http://bugs.webkit.org/show_bug.cgi?id=12567
2970         <text> elements ignore <a> children
2971
2972         Allow <a> inside svg text and handle xlink:show.
2973
2974         * ksvg2/svg/SVGAElement.cpp:
2975         (WebCore::SVGAElement::createRenderer):
2976         (WebCore::SVGAElement::defaultEventHandler):
2977         (WebCore::SVGAElement::childShouldCreateRenderer):
2978         * ksvg2/svg/SVGAElement.h:
2979         * ksvg2/svg/SVGElement.h:
2980         (WebCore::SVGElement::isTextContent):
2981         * ksvg2/svg/SVGTextContentElement.h:
2982         (WebCore::SVGTextContentElement::isTextContent):
2983         * ksvg2/svg/SVGTextElement.cpp:
2984         (WebCore::SVGTextElement::childShouldCreateRenderer):
2985         * rendering/SVGInlineFlowBox.cpp:
2986         (WebCore::translateBox):
2987         (WebCore::placePositionedBoxesHorizontally):
2988         (WebCore::placeBoxesVerticallyWithAbsBaseline):
2989
2990 2007-03-12  Adele Peterson  <adele@apple.com>
2991
2992         Reviewed by Oliver.
2993
2994         Add a missing parameter to the constructor.
2995
2996         * platform/PlatformKeyboardEvent.h:
2997         * platform/win/KeyEventWin.cpp: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2998
2999 2007-03-12  Lars Knoll <lars@trolltech.com>
3000
3001         Fix the Qt build. I still get crashes though :/
3002
3003         * platform/graphics/qt/ImageDecoderQt.cpp:
3004         (WebCore::ImageDecoderQt::clearFrame):
3005         * platform/graphics/qt/ImageDecoderQt.h:
3006         * platform/graphics/qt/ImageSourceQt.cpp:
3007         (WebCore::ImageSource::setData):
3008         (WebCore::ImageSource::frameIsCompleteAtIndex):
3009         (WebCore::ImageSource::clear):
3010         (WebCore::ImageSource::destroyFrameAtIndex):
3011         * platform/qt/ClipboardQt.cpp:
3012         (WebCore::ClipboardQt::ClipboardQt):
3013         * platform/qt/ClipboardQt.h:
3014         * platform/qt/DragDataQt.cpp:
3015         (WebCore::DragData::createClipboard):
3016
3017 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3018
3019         Not reviewed - gdk build fixes.
3020
3021         * platform/gdk/EditorClientGdk.cpp:
3022         (WebCore::EditorClientGdk::respondToChangedSelection): add stub
3023         * platform/gdk/EditorClientGdk.h:
3024         * platform/gdk/FrameGdk.cpp:
3025         * platform/gdk/TemporaryLinkStubs.cpp:
3026         (Editor::markMisspellings): add stub
3027
3028 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
3029
3030         Reviewed by Adele.
3031
3032         http://bugs.webkit.org/show_bug.cgi?id=12560
3033         W3C XPath test Text_Nodes.svg fails
3034
3035         * xml/XPathStep.cpp:
3036         (WebCore::XPath::Step::nodeTestMatches): Revert the fix, as the behavior doesn't appear 
3037         all that desirable as it did at first glance.
3038
3039 2007-03-11  Oliver Hunt  <oliver@apple.com>
3040
3041         Reviewed by hyatt.
3042
3043         Fix for <rdar://problem/5055690> ASSERTION failure on drop into 
3044         editable element with content changed on drop 
3045
3046         After setting the selection for a drop into an editable region 
3047         we make sure the we succeeded.  If we didn't we assume a focus handler
3048         or similar altered the element contents and try again, if the second
3049         attempt fails we bail out.
3050
3051         * page/DragController.cpp:
3052         (WebCore::setSelectionToDragCaret):
3053         (WebCore::DragController::concludeDrag):
3054
3055 2007-03-11  Oliver Hunt  <oliver@apple.com>
3056
3057         Reviewed by Adele.
3058
3059         Moving Frame{Mac}::respondToChangedSelection to Frame.cpp
3060         Added new EditorClient method to handle old bridge function
3061         
3062         * bridge/EditorClient.h:
3063            Added respondToChangedSelection to replace old bridge function
3064         * editing/Editor.cpp:
3065         (WebCore::Editor::respondToChangedSelection):
3066            Add client call to replace old bridge call from Frame::respondToChangedSelection
3067         * editing/SelectionController.cpp:
3068         (WebCore::SelectionController::setSelection):
3069            No longer directly call Editor as Frame::respondToChangedSelection
3070            makes the call
3071         * page/Frame.cpp:
3072         (WebCore::Frame::respondToChangedSelection):
3073            Moved from FrameMac, replaced bridge call with call to Editor
3074         * page/mac/FrameMac.mm:
3075            Moved respondToChangedSelection to Frame.cpp
3076         * page/mac/WebCoreFrameBridge.h:
3077            Removed respondToChangedSelection from bridge
3078         * page/qt/FrameQt.cpp:
3079            Remove stub method for respondToChangedSelection
3080
3081 2007-03-11  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3082
3083         Reviewed by Brady Eidson.
3084
3085         Linux/gdk fix.
3086
3087         * loader/gdk/FrameLoaderClientGdk.cpp:
3088         (WebCore::FrameLoaderClientGdk::shouldGoToHistoryItem): return true so
3089         that FrameLoader:goBackOrForwards() works.
3090
3091 2007-03-10  Geoffrey Garen  <ggaren@apple.com>
3092
3093         Reviewed by Darin Adler.
3094
3095         Fixed <rdar://problem/4587763> PAC file: lock inversion between QT and 
3096         JSCore causes a hang @ www.panoramas.dk
3097         
3098         See JavaScriptCore ChangeLog for details.
3099         
3100         * bindings/objc/WebScriptObject.mm:
3101         (_didExecute): Added helpful ASSERT.
3102         (+[WebScriptObject throwException:]): Added missing JSLock.
3103
3104 2007-03-11  Antti Koivisto  <antti@apple.com>
3105
3106         Reviewed by Hyatt.
3107
3108         Optimize linebox memory consumption:
3109         - move all bitfields to baseclass compacting them
3110         - make InlineTextBox::m_truncation unsigned short and make it relative to m_start
3111         - remove extremely rarely used EllipsisBox pointer from RootInlineBox and instead
3112           use a global hashmap to store it if needed
3113         - use minimum required number of bits to store BidiStatus enum variables in RootInlineBox
3114         - move overflow variables in RootInlineBox to a separate struct that is instantiated
3115           only if any of the variables is set to a value that can't trivially be derived from 
3116           box x, y, width and height
3117           
3118         As a result line box objects shrink:
3119             InlineBox: 44 -> 44 bytes
3120             InlineTextBox: 68 -> 60 bytes
3121             InlineFlowBox: 68 -> 64 bytes
3122             RootInlineBox: 128 -> 88 bytes
3123             
3124         The optimizations possiblity was noticed when debugging http://bugs.webkit.org/show_bug.cgi?id=12833
3125         Bug 12833: REGRESSION: Selecting text in 6.6MB txt file is sluggish as of the Feb 19th nightly
3126         <rdar://problem/5028159>
3127         
3128         On that page the patch saves 11.5MB or some 21% of linebox memory consumption. It also
3129         actually improves selection performance somewhat by improving memory locality.
3130
3131         * rendering/InlineBox.h:
3132         (WebCore::InlineBox::InlineBox):
3133         * rendering/InlineFlowBox.h:
3134         (WebCore::InlineFlowBox::InlineFlowBox):
3135         * rendering/InlineTextBox.cpp:
3136         (WebCore::InlineTextBox::placeEllipsisBox):
3137         (WebCore::InlineTextBox::nodeAtPoint):
3138         (WebCore::InlineTextBox::paint):
3139         (WebCore::InlineTextBox::paintDecoration):
3140         (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
3141         (WebCore::InlineTextBox::paintMarkedTextUnderline):
3142         * rendering/InlineTextBox.h:
3143         (WebCore::InlineTextBox::InlineTextBox):
3144         * rendering/RootInlineBox.cpp:
3145         (WebCore::throw):
3146         (WebCore::RootInlineBox::Overflow::operator delete):
3147         (WebCore::RootInlineBox::Overflow::destroy):
3148         (WebCore::RootInlineBox::destroy):
3149         (WebCore::RootInlineBox::detachEllipsisBox):
3150         (WebCore::RootInlineBox::clearTruncation):
3151         (WebCore::RootInlineBox::placeEllipsis):
3152         (WebCore::RootInlineBox::paintEllipsisBox):
3153         (WebCore::RootInlineBox::addHighlightOverflow):
3154         (WebCore::RootInlineBox::nodeAtPoint):
3155         (WebCore::RootInlineBox::adjustPosition):
3156         (WebCore::RootInlineBox::selectionTop):
3157         (WebCore::RootInlineBox::setLineBreakInfo):
3158         (WebCore::RootInlineBox::ellipsisBox):
3159         (WebCore::RootInlineBox::setVerticalOverflowPositions):
3160         (WebCore::RootInlineBox::setHorizontalOverflowPositions):
3161         (WebCore::RootInlineBox::setVerticalSelectionPositions):
3162         * rendering/RootInlineBox.h:
3163         (WebCore::RootInlineBox::RootInlineBox):
3164         (WebCore::RootInlineBox::topOverflow):
3165         (WebCore::RootInlineBox::bottomOverflow):
3166         (WebCore::RootInlineBox::leftOverflow):
3167         (WebCore::RootInlineBox::rightOverflow):
3168         (WebCore::RootInlineBox::lineBreakBidiStatus):
3169         (WebCore::RootInlineBox::selectionBottom):
3170         (WebCore::RootInlineBox::Overflow::Overflow):
3171
3172 2007-03-11  Alexey Proskuryakov  <ap@webkit.org>
3173
3174         Reviewed by Darin.
3175
3176         A partial fix for http://bugs.webkit.org/show_bug.cgi?id=13021
3177         XPath can be very slow
3178
3179         * xml/XPathExpression.cpp:
3180         (WebCore::XPathExpression::evaluate): Cache evaluationContext in a local variable.
3181
3182         * xml/XPathExpressionNode.cpp:
3183         (WebCore::XPath::Expression::evaluationContext):
3184         * xml/XPathExpressionNode.h:
3185         (WebCore::XPath::Expression::addSubExpression):
3186         (WebCore::XPath::Expression::subExprCount):
3187         (WebCore::XPath::Expression::subExpr):
3188         * xml/XPathFunctions.cpp:
3189         * xml/XPathFunctions.h:
3190         (WebCore::XPath::Function::setName):
3191         (WebCore::XPath::Function::arg):
3192         (WebCore::XPath::Function::argCount):
3193         (WebCore::XPath::Function::name):
3194         Made one-liners critical for performance inline.
3195
3196         * xml/XPathGrammar.y: Fully parse NodeTests, so that strings are no longer passed for what is
3197         essentially an enum. Use LocationPath accessors to add steps, instead of directly manipulating
3198         internal data members.
3199
3200         * xml/XPathParser.cpp:
3201         (WebCore::XPath::Parser::parseStatement):
3202         (WebCore::XPath::Parser::registerNodeTest):
3203         (WebCore::XPath::Parser::deleteNodeTest):
3204         * xml/XPathParser.h:
3205         Added support methods for changes in XPathGrammar.y.
3206
3207         * xml/XPathPath.cpp:
3208         (WebCore::XPath::Filter::evaluate): Cache evaluationContext in a local variable. Use swap() to avoid
3209         performing vector assignments.
3210         (WebCore::XPath::LocationPath::evaluate): Use swap() to avoid performing vector assignments.
3211         (WebCore::XPath::LocationPath::optimizeStepPair): This new method is called during LocationPath construction, 
3212         to simplify the path as it's being built. Currently, the only optimized case is "//*" - it is a basis for
3213         important operations that cannot be efficiently written in XPath 1.0, but can be optimized with a little bit
3214         of XPath 2.0.
3215         (WebCore::XPath::LocationPath::appendStep): A new accessor that modifies m_steps and calls optimizeStepPair().
3216         (WebCore::XPath::LocationPath::insertFirstStep): Ditto.
3217         * xml/XPathPath.h:
3218         (WebCore::XPath::LocationPath::setAbsolute): A new accessor.
3219
3220         * xml/XPathStep.h:
3221         (WebCore::XPath::Step::NodeTest::):
3222         (WebCore::XPath::Step::NodeTest::NodeTest):
3223         (WebCore::XPath::Step::NodeTest::kind):
3224         (WebCore::XPath::Step::NodeTest::data):
3225         Step::NodeTest is a new sub-class that represents a fully parsed NodeTest.
3226         (WebCore::XPath::Step::axis):
3227         (WebCore::XPath::Step::nodeTest):
3228         (WebCore::XPath::Step::nodeTestData):
3229         (WebCore::XPath::Step::namespaceURI):
3230         (WebCore::XPath::Step::predicates):
3231         (WebCore::XPath::Step::setAxis):
3232         (WebCore::XPath::Step::setNodeTest):
3233         (WebCore::XPath::Step::setNodeTestData):
3234         (WebCore::XPath::Step::setNamespaceURI):
3235         (WebCore::XPath::Step::setPredicates):
3236         New accessors that let optimizeStepPair() manipulate Step data.
3237
3238         * xml/XPathStep.cpp:
3239         (WebCore::XPath::Step::Step): Use the new NodeTest class.
3240         (WebCore::XPath::Step::evaluate): Cache evaluationContext in a local variable. Use swap() to avoid
3241         performing unneeded vector assignments.
3242         (WebCore::XPath::Step::nodesInAxis): Cosmetic changes.
3243         (WebCore::XPath::Step::nodeTestMatches): Use NodeTest instead of parsing the test from string each time.
3244         Added a partial implementation of XPath 2.0 element() node test.
3245
3246 2007-03-10  Alexey Proskuryakov  <ap@webkit.org>
3247
3248         Reviewed by Darin.
3249
3250         http://bugs.webkit.org/show_bug.cgi?id=12249
3251         FCKeditor: <hr>, <ul> and <ol> have id="undefined"
3252
3253         This fixes the attached reduction, but not the original issue.
3254
3255         Test: editing/execCommand/default-parameters.html
3256
3257         * dom/Document.h:
3258         * dom/Document.idl:
3259         Make second and third execCommand() parameters optional.
3260
3261 2007-03-10  Adele Peterson  <adele@apple.com>
3262
3263         Reviewed by Maciej.
3264
3265         Fix for http://bugs.webkit.org/show_bug.cgi?id=13028
3266         REGRESSION: textField:doCommandBySelector:inFrame: not being called properly
3267
3268         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
3269           Before calling the base class defaultEventHandler, which will call handleKeypress, call doTextFieldCommandFromEvent.        
3270
3271 2007-03-10  Mitz Pettel  <mitz@webkit.org>
3272
3273         Reviewed by Darin.
3274
3275         - fix http://bugs.webkit.org/show_bug.cgi?id=13013
3276           REGRESSION: Selection box does not scroll to where the focus jumps when pressing an alphanumeric key
3277
3278         Test: fast/forms/listbox-typeahead-scroll.html
3279
3280         * html/HTMLSelectElement.cpp:
3281         (WebCore::HTMLSelectElement::setSelectedIndex): Reordered to set the active selection's
3282         anchor and end before selecting the option, since the active selection is used to
3283         decide where to scroll when the selection is made.
3284         (WebCore::HTMLSelectElement::defaultEventHandler): Removed redundant check.
3285
3286 2007-03-10  Mitz Pettel  <mitz@webkit.org>
3287
3288         Reviewed by Darin.
3289
3290         - fix http://bugs.webkit.org/show_bug.cgi?id=12973
3291           REGRESSION: Reproducible assert while loading this test file if css is already in the cache
3292
3293         Test: fast/dom/css-cached-import-rule.html
3294
3295         Replaced some direct calls to document->stylesheetLoaded() with calls to
3296         the sheet's checkLoaded(). The latter calls back to the element's sheetLoaded() --
3297         which notifies the document of the load -- and then updates the sheet's
3298         loadCompleted() flag, ensuring that it stays in sync with whether the stylesheet
3299         is still considered pending by the document.
3300
3301         * dom/ProcessingInstruction.cpp:
3302         (WebCore::ProcessingInstruction::parseStyleSheet):
3303         * dom/StyleElement.cpp:
3304         (WebCore::StyleElement::childrenChanged):
3305         * html/HTMLLinkElement.cpp:
3306         (WebCore::HTMLLinkElement::process):
3307         (WebCore::HTMLLinkElement::setCSSStyleSheet):
3308         * ksvg2/svg/SVGStyleElement.cpp:
3309         (WebCore::SVGStyleElement::sheetLoaded):
3310         * ksvg2/svg/SVGStyleElement.h:
3311
3312 2007-03-10  David Kilzer  <ddkilzer@webkit.org>
3313
3314         Reviewed by Darin.
3315
3316         - fix http://bugs.webkit.org/show_bug.cgi?id=9609
3317           REGRESSION: Missing image icon needs to be moved back to WebKit
3318
3319         * WebCore.exp: Export WebCore::Image::loadPlatformResource(const char*) for use in
3320         [WebHTMLView _startDraggingImage:at:operation:event:sourceIsDHTML:DHTMLWroteData:].
3321
3322 2007-03-09  Darin Adler  <darin@apple.com>
3323
3324         Reviewed by Justin.
3325
3326         - fix http://bugs.webkit.org/show_bug.cgi?id=8928
3327           <rdar://problem/5045708> REPRODUCIBLE ASSERT: Cannot paste HTML into a
3328           contenteditable region in an XHTML document (8928)
3329
3330         Test: editing/pasteboard/paste-xml.xhtml
3331
3332         * editing/markup.cpp: (WebCore::createFragmentFromMarkup): Added a check for 0
3333         here, since createContextualFragment can return 0 for XML documents that fail
3334         to parse. In my testing, callers all seem equipped to handle 0.
3335
3336 2007-03-09  Mitz Pettel  <mitz@webkit.org>
3337
3338         Reviewed by Darin.
3339
3340         - fix http://bugs.webkit.org/show_bug.cgi?id=9929
3341           REGRESSION: crash on logging in on mijnpostbank.nl
3342
3343         Test: http/tests/misc/onload-remove-iframe-crash-2.html
3344
3345         The resulted from an iframe's load event handler removing the iframe
3346         from the document.
3347
3348         * dom/Document.cpp:
3349         (WebCore::Document::implicitClose): Bail out early if an event handler
3350         removed the frame.
3351         * loader/FrameLoader.cpp:
3352         (WebCore::FrameLoader::FrameLoader):
3353         (WebCore::FrameLoader::clear):
3354         (WebCore::FrameLoader::checkCompleted): Protect the frame from deletion
3355         by event handlers.
3356         (WebCore::FrameLoader::checkCompletedTimerFired):
3357         (WebCore::FrameLoader::scheduleCheckCompleted):
3358         (WebCore::FrameLoader::detachFromParent): Schedule a completion check
3359         on the parent (in case the child is what has been keeping it from completing).
3360         * loader/FrameLoader.h:
3361
3362 2007-03-08  David Kilzer  <ddkilzer@webkit.org>
3363
3364         Reviewed by Beth.
3365
3366         - fix http://bugs.webkit.org/show_bug.cgi?id=13019
3367           REGRESSION (r20074): Forms don't submit on a variety of websites
3368
3369         No tests added since LayoutTests/fast/forms/document-write.html was timing out
3370         and causing a layout test failure.
3371
3372         * html/HTMLFormElement.cpp:
3373         (WebCore::HTMLFormElement::submit): Removed stray code.
3374
3375 2007-03-08  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3376
3377         Not reviewed - gdk build fix.
3378
3379         * platform/graphics/cairo/ImageSourceCairo.cpp:
3380         (WebCore::ImageSource::frameIsCompleteAtIndex): add empty stub
3381
3382 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3383
3384         Reviewed by harrison
3385         
3386         <rdar://problem/4903193> 
3387         On particular page, Copy is so slow it seems like a hang
3388         
3389         ~2x speedup copying:
3390         http://shakespeare.mit.edu/henryviii/full.html 
3391         Also produces less bloated markup.
3392
3393         * editing/markup.cpp:
3394         (WebCore::startMarkup): Don't wrap text nodes in style spans.
3395         For Elements, don't inline styles inherited from ancestors.
3396         (WebCore::createMarkup): No longer necessary to find 
3397         the root's default style and pass it to startMarkup.
3398         Add a wrapper span around the markup with the styles
3399         that all nodes in the markup inherit (the inheritable 
3400         styles from the common ancestor container's computed style).
3401         Added a FIXME about unecessary markup for inline ancestors 
3402         up to the commonAncestorBlock.
3403
3404 2007-03-08  Darin Adler  <darin@apple.com>
3405
3406         Reviewed by Adele.
3407
3408         - <rdar://problem/4470381> multipart/form-data boundary security vulnerability
3409
3410         By making the form data boundary a string with some random data in it, we reduce
3411         the possibility that anyone could take advantage of it by creating a file that
3412         intentionally has the boundary string in it.
3413
3414         * html/HTMLFormElement.h: Removed boundary(), setBoundary(), and m_boundary.
3415         Marked a lot more stuff private.
3416         * html/HTMLFormElement.cpp:
3417         (WebCore::HTMLFormElement::HTMLFormElement): Removed code to initialize
3418         m_boundary.
3419         (WebCore::randomNumber): Added. Function that returns a random number, including
3420         seeding the random number generator the first time it's called. For now, usees the more
3421         random function random() on Mac OS X and the more-standard rand() on other platforms.
3422         (WebCore::HTMLFormElement::formData): Take a parameter with the form boundary string,
3423         and use that instead of m_boundary.
3424         (WebCore::getUniqueBoundaryString): Added. Makes a boundary string using random numbers
3425         and base 64 encoding.
3426         (WebCore::HTMLFormElement::submit): Call getUniqueBoundaryString and pass the boundary
3427         string into formData for multipart form posts.
3428
3429 2007-03-08  Maciej Stachowiak  <mjs@apple.com>
3430
3431         Reviewed by Adele.
3432         
3433         <rdar://problem/4646563> REGRESSION: Unable to send text message from Verizon text message website: vtext.com (12588)
3434         http://bugs.webkit.org/show_bug.cgi?id=12588
3435
3436         Carefully revised which focus operations restore previous selection, which clear it, and which
3437         select the whole control contents.
3438         
3439         Tests:
3440         fast/forms/focus-selection-input.html
3441         fast/forms/focus-selection-textarea.html
3442         
3443         * dom/Element.cpp:
3444         (WebCore::Element::focus):
3445         * dom/Element.h:
3446         * html/HTMLInputElement.cpp:
3447         (WebCore::HTMLInputElement::focus):
3448         (WebCore::HTMLInputElement::accessKeyAction):
3449         * html/HTMLInputElement.h:
3450         * html/HTMLLabelElement.cpp:
3451         (WebCore::HTMLLabelElement::focus):
3452         (WebCore::HTMLLabelElement::accessKeyAction):
3453         * html/HTMLLabelElement.h:
3454         * html/HTMLLegendElement.cpp:
3455         (WebCore::HTMLLegendElement::focus):
3456         * html/HTMLLegendElement.h:
3457         * html/HTMLTextAreaElement.cpp:
3458         (WebCore::HTMLTextAreaElement::focus):
3459         * html/HTMLTextAreaElement.h:
3460         * page/FocusController.cpp:
3461         (WebCore::FocusController::advanceFocus):
3462
3463 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3464
3465         Reviewed by harrison
3466
3467         <http://bugs.webkit.org/show_bug.cgi?id=12244>
3468         FCKeditor: Find dialog doesn't work
3469
3470         * bindings/js/kjs_window.cpp:
3471         (KJS::Window::find): Added.  This function doesn't yet 
3472         support whole word searches, searching in subframes, or
3473         opening the find dialog.
3474         (KJS::WindowFunc::callAsFunction):
3475         * bindings/js/kjs_window.h:
3476         (KJS::Window::):
3477
3478 2007-03-08  David Hyatt  <hyatt@apple.com>
3479
3480         Fix regression from throwing away frames of large animated images.  Alter
3481         animated images so that they refuse to advance the animation until the
3482         current displayed frame has been fully decoded.
3483
3484         Reviewed by ggaren
3485
3486         * platform/graphics/BitmapImage.cpp:
3487         (WebCore::BitmapImage::startAnimation):
3488         (WebCore::BitmapImage::advanceAnimation):
3489         * platform/graphics/ImageSource.h:
3490         * platform/graphics/cg/ImageSourceCG.cpp:
3491         (WebCore::ImageSource::frameIsCompleteAtIndex):
3492
3493 2007-03-08  David Hyatt  <hyatt@apple.com>
3494
3495         Fix 2% performance regression on the PLT.  Increase the large animated
3496         image cutoff from 1MB to 5MB.
3497
3498         In addition when pruning we will aggressively discard image sources.
3499
3500         Reviewed by ggaren
3501
3502         * platform/graphics/BitmapImage.cpp:
3503         (WebCore::BitmapImage::destroyDecodedData):
3504
3505 2007-03-08  Timothy Hatcher  <timothy@apple.com>
3506
3507         Reviewed by John.
3508
3509         <rdar://problem/4664697> highlighter SPI needs a node parameter to give more context
3510
3511         Pass the RenderObject's node to customHighlightLineRect and paintCustomHighlight.
3512
3513         * page/Frame.h:
3514         * page/mac/FrameMac.mm:
3515         (WebCore::Frame::customHighlightLineRect):
3516         (WebCore::Frame::paintCustomHighlight):
3517         * page/mac/WebCoreFrameBridge.h:
3518         * rendering/InlineTextBox.cpp:
3519         (WebCore::InlineTextBox::paintCustomHighlight):
3520         * rendering/RenderBox.cpp:
3521         (WebCore::RenderBox::paintCustomHighlight):
3522         * rendering/RootInlineBox.cpp:
3523         (WebCore::RootInlineBox::addHighlightOverflow):
3524         (WebCore::RootInlineBox::paintCustomHighlight):
3525
3526 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3527
3528         Reviewed by harrison
3529         
3530         <http://bugs.webkit.org/show_bug.cgi?id=13000>
3531         Range.createContextualFragment is not supported
3532
3533         * dom/Range.cpp:
3534         (WebCore::Range::createContextualFragment): The
3535         "startContainer" may not be a container, if the
3536         range starts inside text.  In that case, look
3537         to the parent of the start node for an HTMLElement.
3538
3539 2007-03-08  Justin Garcia  <justin.garcia@apple.com>
3540
3541         Reviewed by harrison
3542         
3543         <rdar://problem/5049671>
3544         Gmail Editor: With linked text, Remove Formatting doesn't always remove underline
3545
3546         * editing/Editor.cpp:
3547         (WebCore::Editor::removeFormattingAndStyle): Clear removed
3548         anchors after the deletion.
3549
3550 2007-03-08  David Kilzer  <ddkilzer@webkit.org>
3551
3552         Reviewed by NOBODY (build fix).
3553
3554         Added missing file for r20059:
3555         <rdar://problem/4708689> -- REGRESSION: Some symbols with 2-byte display as garbage in Hotmail.
3556
3557         File was taken from this svn repository which contained versions of ucnv.h and ucnv_err.h
3558         that were identical to ours:
3559         http://source.icu-project.org/repos/icu/icu/tags/release-3-2/source/common/unicode/ucnv_cb.h
3560
3561         * icu/unicode/ucnv_cb.h: Added.
3562
3563 2007-03-08  Shrikant Gangoda  <shrikant.gangoda@celunite.com>
3564
3565         Gdk build fix.
3566
3567         * platform/graphics/cairo/ImageSourceCairo.cpp:
3568         (WebCore::ImageSource::~ImageSource):
3569         (WebCore::ImageSource::clear):
3570
3571 2007-03-08  Oliver Hunt  <oliver@apple.com>
3572
3573         Reviewed by Adam.
3574
3575         To match old TEC behaviour when using ICU we need to use 
3576         a few manual fallback encodings for the GBK/EUC-CN charsets
3577
3578         <rdar://problem/4708689> -- REGRESSION: Some symbols with 2-byte display as garbage in Hotmail.
3579
3580         * platform/TextCodecICU.cpp:
3581         (WebCore::TextCodecICU::TextCodecICU):
3582         (WebCore::TextCodecICU::createICUConverter):
3583         (WebCore::gbkEscapes):
3584         (WebCore::gbkCallbackEscape):
3585         (WebCore::gbkCallbackSubstitute):
3586         (WebCore::TextCodecICU::encode):
3587         * platform/TextCodecICU.h:
3588         (WebCore::TextCodecICU::needsGBKFallbacks):
3589         (WebCore::TextCodecICU::setNeedsGBKFallbacks):
3590
3591 2007-03-08  Alexey Proskuryakov  <ap@webkit.org>
3592
3593         Build fix.
3594
3595         * xml/XPathUtil.cpp:
3596         (WebCore::XPath::stringValue):
3597
3598 2007-03-08  David Hyatt  <hyatt@apple.com>
3599
3600         This patch dramatically reduces the memory consumed by animated images.  For large animated GIFs (defined for
3601         now as >1mb in terms of decoded frame buffer size), we will now aggressively flush previous frames of the
3602         animated GIF and just re-decode them on the fly if the animation loops.
3603
3604         Whenever a large animated GIF has its animation reset, we will also just throw out everything and start
3605         the animation over (in order to get rid of any cached detritus held in the ImageSource).
3606
3607         With this patch and the sample GIF used to test, WebKit's memory consumption went from 160MB down to 16MB.
3608
3609         Reviewed by mjs
3610
3611         * platform/graphics/BitmapImage.cpp:
3612         (WebCore::BitmapImage::destroyDecodedData):
3613         (WebCore::BitmapImage::resetAnimation):
3614         (WebCore::BitmapImage::advanceAnimation):
3615         * platform/graphics/ImageSource.h:
3616         * platform/graphics/cg/ImageSourceCG.cpp:
3617         (WebCore::ImageSource::~ImageSource):
3618         (WebCore::ImageSource::clear):
3619
3620 2007-03-08  Alexey Proskuryakov  <ap@webkit.org>
3621
3622         Reviewed by Darin.
3623
3624         http://bugs.webkit.org/show_bug.cgi?id=13006
3625         XPath string-value is broken for some node types
3626
3627         Test: fast/xpath/string-value.html
3628
3629         * xml/XPathUtil.cpp:
3630         (WebCore::XPath::stringValue): Fix it :-)
3631
3632 2007-03-07  Anders Carlsson  <acarlsson@apple.com>
3633
3634         Reviewed by Adam.
3635
3636         <rdar://problem/4981000> 
3637         http://bugs.webkit.org/show_bug.cgi?id=12634
3638         REGRESSION: crash loading web archive (12634)
3639         
3640         The reason this bug wasn't always reproducible is that it involved sending an event to a plugin while 
3641         the page was loading. Before we send the event to the plugin we defer loads. The problem was that
3642         MainResourceLoader::setDefersLoad would not work with data loads.
3643         
3644         * loader/DocumentLoader.cpp:
3645         (WebCore::DocumentLoader::setRequest):
3646         Only set m_committed to false if we also have a valid unreachable URL.
3647         
3648         * loader/MainResourceLoader.cpp:
3649         (WebCore::MainResourceLoader::setDefersLoading):
3650         Make sure to stop and start data loads.
3651
3652 2007-03-07  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
3653
3654         Not reviewed.
3655
3656         Gdk build fixes.
3657
3658         * platform/gdk/EditorClientGdk.cpp:
3659         (WebCore::EditorClientGdk::handleKeypress): renamed
3660         (WebCore::EditorClientGdk::handleInputMethodKeypress): add a stub
3661         * platform/gdk/EditorClientGdk.h:
3662         * platform/graphics/cairo/ImageSourceCairo.cpp:
3663         (WebCore::ImageSource::destroyFrameAtIndex): add a stub
3664
3665 2007-03-07  Alexey Proskuryakov  <ap@webkit.org>
3666
3667         Reviewed by Darin.
3668
3669         http://bugs.webkit.org/show_bug.cgi?id=13004
3670         Repeatedly calling XPathExpression.evaluate() causes crashes or memory leaks
3671
3672         Removed XPath::Expression::optimize() and related methods, since they were buggy and almost useless.
3673         Merged doEvaluate() into evaluate(), since this was all evaluate() was doing after the above changes.
3674
3675         Test: fast/xpath/evaluate-twice.html
3676
3677         * xml/XPathExpression.cpp:
3678         (WebCore::XPathExpression::evaluate):
3679         * xml/XPathExpressionNode.cpp:
3680         (WebCore::XPath::Expression::Expression):
3681         (WebCore::XPath::Expression::~Expression):
3682         * xml/XPathExpressionNode.h:
3683         * xml/XPathFunctions.cpp:
3684         (WebCore::XPath::FunLast::evaluate):
3685         (WebCore::XPath::FunPosition::evaluate):
3686         (WebCore::XPath::FunId::evaluate):
3687         (WebCore::XPath::FunLocalName::evaluate):
3688         (WebCore::XPath::FunNamespaceURI::evaluate):
3689         (WebCore::XPath::FunName::evaluate):
3690         (WebCore::XPath::FunCount::evaluate):
3691         (WebCore::XPath::FunString::evaluate):
3692         (WebCore::XPath::FunConcat::evaluate):
3693         (WebCore::XPath::FunStartsWith::evaluate):
3694         (WebCore::XPath::FunContains::evaluate):
3695         (WebCore::XPath::FunSubstringBefore::evaluate):
3696         (WebCore::XPath::FunSubstringAfter::evaluate):
3697         (WebCore::XPath::FunSubstring::evaluate):
3698         (WebCore::XPath::FunStringLength::evaluate):
3699         (WebCore::XPath::FunNormalizeSpace::evaluate):
3700         (WebCore::XPath::FunTranslate::evaluate):
3701         (WebCore::XPath::FunBoolean::evaluate):
3702         (WebCore::XPath::FunNot::evaluate):
3703         (WebCore::XPath::FunTrue::evaluate):
3704         (WebCore::XPath::FunLang::evaluate):
3705         (WebCore::XPath::FunFalse::evaluate):
3706         (WebCore::XPath::FunNumber::evaluate):
3707         (WebCore::XPath::FunSum::evaluate):
3708         (WebCore::XPath::FunFloor::evaluate):
3709         (WebCore::XPath::FunCeiling::evaluate):
3710         (WebCore::XPath::FunRound::evaluate):
3711         * xml/XPathPath.cpp:
3712         (WebCore::XPath::Filter::evaluate):
3713         (WebCore::XPath::LocationPath::evaluate):
3714         (WebCore::XPath::Path::evaluate):
3715         * xml/XPathPath.h:
3716         * xml/XPathPredicate.cpp:
3717         (WebCore::XPath::Number::evaluate):
3718         (WebCore::XPath::StringExpression::evaluate):
3719         (WebCore::XPath::Negative::evaluate):
3720         (WebCore::XPath::NumericOp::evaluate):
3721         (WebCore::XPath::EqTestOp::evaluate):
3722         (WebCore::XPath::LogicalOp::evaluate):
3723         (WebCore::XPath::Union::evaluate):
3724         * xml/XPathPredicate.h:
3725         * xml/XPathStep.cpp:
3726         * xml/XPathStep.h:
3727         * xml/XPathVariableReference.cpp:
3728         (WebCore::XPath::VariableReference::evaluate):
3729         * xml/XPathVariableReference.h:
3730
3731 2007-03-07  Sam Weinig  <sam@webkit.org>
3732
3733         Reviewed by Tim H.
3734
3735         Remove unused #import from Objective-C bindings and cleanup the order of #imports.
3736
3737         * bindings/scripts/CodeGeneratorObjC.pm:
3738
3739 2007-03-07  Sam Weinig  <sam@webkit.org>
3740
3741         Reviewed by Tim H.
3742
3743         Make sure the baseURI attribute generates for private Objective-C bindings.
3744
3745         * dom/Node.idl:
3746
3747 2007-03-07  Anders Carlsson  <acarlsson@apple.com>
3748
3749         Reviewed by Maciej.
3750
3751         <rdar://problem/4874059>
3752         REGRESSION: Painter IX:register - Crash in WebCore:: ResourceLoader::willSendRequest()
3753
3754         If a load is done from inside of an error delegate method that is called because we cancel another load, 
3755         the first load should be ignored since this is what shipping WebKit does. 
3756         
3757         (Actually, it does load the page in the data source but doesn't do anything with it since the data source
3758         won't have a web frame).
3759         
3760         * loader/FrameLoader.cpp:
3761         (WebCore::FrameLoader::load):
3762         Just bail out if m_isStoppingLoad is true.
3763
3764 2007-03-07  David Hyatt  <hyatt@apple.com>
3765
3766         Use CGImageRelease instead of CFRelease.
3767
3768         Reviewed by aroben
3769
3770         * platform/graphics/cg/ImageCG.cpp:
3771         (WebCore::FrameData::clear):
3772         * platform/graphics/cg/ImageSourceCG.cpp:
3773         (WebCore::ImageSource::destroyFrameAtIndex):
3774
3775 2007-03-07  David Hyatt  <hyatt@apple.com>
3776
3777         Fix a regression where the cache size overflows because of a double
3778         subtraction per resource when they got removed from the cache.  Add an
3779         assert to adjustSize to detect this case in the future.
3780
3781         Fix ImageSourceCG so that when we flush decoded data from our cache that
3782         we also flush it from the ImageSource.
3783
3784         Reviewed by mjs
3785
3786         * loader/Cache.cpp:
3787         (WebCore::Cache::adjustSize):
3788         * platform/graphics/BitmapImage.cpp:
3789         (WebCore::BitmapImage::~BitmapImage):
3790         (WebCore::BitmapImage::destroyDecodedData):
3791         * platform/graphics/Image.h:
3792         * platform/graphics/ImageSource.h:
3793         * platform/graphics/cg/ImageSourceCG.cpp:
3794         (WebCore::ImageSource::setData):
3795         (WebCore::ImageSource::destroyFrameAtIndex):
3796
3797 2007-03-07  Mitz Pettel  <mitz@webkit.org>
3798
3799         Reviewed by Darin.
3800
3801         - fix http://bugs.webkit.org/show_bug.cgi?id=13002
3802           Incomplete repaint of inset outlines
3803
3804         Test: fast/repaint/outline-inset.html
3805
3806         * rendering/RenderObject.cpp:
3807         (WebCore::RenderObject::repaintAfterLayoutIfNeeded):
3808
3809 2007-03-07  Oliver Hunt  <oliver@apple.com>
3810
3811         Reviewed by Antti.
3812
3813         Reset mouse down/drag state variables on mouse button release
3814         
3815         Fixes <rdar://problem/5044654>: Drag out of some QuickTime plug-ins converting into image drag
3816
3817         * page/EventHandler.cpp:
3818         (WebCore::EventHandler::handleMouseReleaseEvent):
3819
3820 2007-03-07  Adele Peterson  <adele@apple.com>
3821
3822         Reviewed by Darin.
3823
3824         WebCore part of fix for:
3825         http://bugs.webkit.org/show_bug.cgi?id=10871
3826         http://bugs.webkit.org/show_bug.cgi?id=12677
3827         <rdar://problem/4823129> REGRESSION: IME key events different in nightly
3828         <rdar://problem/4759563> REGRESSION: Return key is always sent when you confirm a clause in kotoeri
3829
3830         * page/EventHandler.cpp: (WebCore::EventHandler::defaultKeyboardEventHandler): Call handleInputMethodKeypress before actually dispatching the keypress event
3831           so that input methods have a chance to handle the event.  
3832           If the input method handles the event (by marking or unmarking text), then we don't need to send the keypress event.
3833           If an input method doesn't handle the event, then we'll save the data we need to perform the correct action (like what text to insert or what selector to use) 
3834           when we dispatch the keypress event.
3835
3836         * dom/KeyboardEvent.h: Added Mac-specific KeypressCommand struct, so we can store command info during handleInputMethodKeypress, and use it during handleKeypress.
3837         (WebCore::KeyboardEvent::keypressCommand):
3838         (WebCore::KeyboardEvent::setKeypressCommand):
3839
3840         * bridge/EditorClient.h:
3841         * editing/Editor.cpp:
3842         (WebCore::Editor::handleKeypress): Changed handleKeyPress to handleKeypress.
3843         (WebCore::Editor::handleInputMethodKeypress): Added.
3844         * editing/Editor.h:
3845
3846         * platform/graphics/svg/SVGImageEmptyClients.h:
3847         (WebCore::SVGEmptyEditorClient::handleKeypress): Changed handleKeyPress to handleKeypress.
3848         (WebCore::SVGEmptyEditorClient::handleInputMethodKeypress): Added.
3849
3850 2007-03-07  Rob Buis  <buis@kde.org>
3851
3852         Reviewed by Darin.
3853
3854         http://bugs.webkit.org/show_bug.cgi?id=12579
3855         WebKit fails SVG xml:base test
3856
3857         Implement DOM3 properties baseURI and documentURI to fix
3858         the testcase in bug 12579.
3859
3860         * bindings/js/kjs_dom.cpp:
3861         (KJS::DOMNode::getValueProperty):
3862         * bindings/js/kjs_domnode.h:
3863         (KJS::DOMNode::):
3864         * dom/Document.cpp:
3865         (WebCore::Document::documentURI):
3866         (WebCore::Document::setDocumentURI):
3867         (WebCore::Document::baseURI):
3868         * dom/Document.h:
3869         * dom/Document.idl:
3870         * dom/DocumentType.cpp:
3871         (WebCore::DocumentType::baseURI):
3872         * dom/DocumentType.h:
3873         * dom/Element.cpp:
3874         (WebCore::Element::baseURI):
3875         * dom/Element.h:
3876         * dom/Node.cpp:
3877         (WebCore::Node::baseURI):
3878         * dom/Node.h:
3879         * ksvg2/misc/SVGImageLoader.cpp:
3880         (WebCore::SVGImageLoader::updateFromElement):
3881         * ksvg2/svg/SVGImageElement.cpp:
3882         (WebCore::SVGImageElement::parseMappedAttribute):
3883         (WebCore::SVGImageElement::attach):
3884
3885 2007-03-07  Anders Carlsson  <acarlsson@apple.com>
3886
3887         Reviewed by Brady.
3888
3889         Remove some methods in FrameLoader that just calls down to the active document loader. Since each
3890         resource loader now has a pointer to its document loader, we can just call directly to the
3891         document loader.
3892
3893         * WebCore.exp:
3894         * loader/FrameLoader.cpp:
3895         * loader/FrameLoader.h:
3896         * loader/MainResourceLoader.cpp:
3897         (WebCore::MainResourceLoader::willSendRequest):
3898         (WebCore::MainResourceLoader::didReceiveResponse):
3899         * loader/SubresourceLoader.cpp:
3900         (WebCore::SubresourceLoader::SubresourceLoader):
3901         (WebCore::SubresourceLoader::didFinishLoading):
3902         (WebCore::SubresourceLoader::didFail):
3903         (WebCore::SubresourceLoader::didCancel):
3904         * loader/mac/NetscapePlugInStreamLoaderMac.mm:
3905         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
3906         (WebCore::NetscapePlugInStreamLoader::didFail):
3907         (WebCore::NetscapePlugInStreamLoader::didCancel):
3908
3909 2007-03-06  Geoffrey Garen  <ggaren@apple.com>
3910
3911         Reviewed by Maciej Stachowiak.
3912         
3913         Fixed <rdar://problem/4576242> | http://bugs.webkit.org/show_bug.cgi?id=12586
3914         PAC file: malloc deadlock sometimes causes a hang @ www.apple.com/pro/profiles/ (12586)
3915         
3916         No test because this is very difficult to repro, and the new ASSERTs in 
3917         JavaScriptCore catch the underlying cause while running normal layout tests.
3918         
3919         This is a modified version of r14752 on the branch.
3920         
3921         The fix is to use a bit inside each node, instead of a hash table, to track 
3922         which node subtrees are in the process of being marked. This avoids a call 
3923         to malloc inside mark().
3924         
3925         * bindings/js/kjs_binding.cpp:
3926         (KJS::domObjects):
3927         (KJS::domNodesPerDocument):
3928         * bindings/js/kjs_dom.cpp:
3929         (KJS::DOMNode::mark):
3930         * dom/Node.cpp:
3931         (WebCore::Node::Node):
3932         * dom/Node.h:
3933
3934 2007-03-06  David Hyatt  <hyatt@apple.com>
3935
3936         This patch reworks the WebCore memory cache to significantly reduce the amount of memory consumed by
3937         images in the cache and to enhance the accuracy of the cache size as an absolute bound for the objects
3938         contained within it.  WebCore's memory use over time should significantly improve as a result of these
3939         changes.
3940
3941         Cached resources now have both an encoded size (the original data stream) and a decoded size (an estimate of
3942         the amount of memory consumed by an expanded version of that resource, e.g., the decoded frames of an image).
3943         Both sizes now count towards the total size of the object and towards the allowed memory cache total.
3944
3945         By including both totals the reported size of resources will now be larger, and the cache will therefore become
3946         much more aggressive about flushing.
3947
3948         Objects are stored in size-adjusted and popularity-aware LRU lists as before, but encoded size is now always
3949         used when determining the correct LRU list.
3950
3951         The flush algorithm for the memory cache has been rewritten to first destroy decoded data before evicting
3952         resources.  By being able to compact its resources without evicting them, the memory cache can now hold many more
3953         unique resources (encoded) in the same amount of space.  Depending on how much of a hit we want to take from
3954         re-decoding images, the memory cache could in theory have its size significantly reduced now while still holding
3955         more resources than it did at the larger size!
3956
3957         Reviewed by mjs
3958
3959         * WebCore.xcodeproj/project.pbxproj:
3960         * loader/Cache.cpp:
3961         (WebCore::Cache::requestResource):
3962         (WebCore::Cache::prune):
3963         (WebCore::Cache::remove):
3964         (WebCore::Cache::lruListFor):
3965         (WebCore::Cache::adjustSize):
3966         * loader/Cache.h:
3967         * loader/CachedCSSStyleSheet.cpp:
3968         (WebCore::CachedCSSStyleSheet::data):
3969         * loader/CachedImage.cpp:
3970         (WebCore::CachedImage::CachedImage):
3971         (WebCore::CachedImage::allReferencesRemoved):
3972         (WebCore::CachedImage::clear):
3973         (WebCore::CachedImage::data):
3974         (WebCore::CachedImage::destroyDecodedData):
3975         (WebCore::CachedImage::decodedSize):
3976         (WebCore::CachedImage::decodedSizeChanged):
3977         (WebCore::CachedImage::shouldPauseAnimation):
3978         * loader/CachedImage.h:
3979         * loader/CachedResource.cpp:
3980         (WebCore::CachedResource::CachedResource):
3981         (WebCore::CachedResource::deref):
3982         (WebCore::CachedResource::setEncodedSize):
3983         * loader/CachedResource.h:
3984         (WebCore::CachedResource::allReferencesRemoved):
3985         (WebCore::CachedResource::size):
3986         (WebCore::CachedResource::encodedSize):
3987         (WebCore::CachedResource::decodedSize):
3988         (WebCore::CachedResource::destroyDecodedData):
3989         * loader/CachedScript.cpp:
3990         (WebCore::CachedScript::data):
3991         * loader/CachedXSLStyleSheet.cpp:
3992         (WebCore::CachedXSLStyleSheet::data):
3993         * platform/graphics/BitmapImage.cpp:
3994         (WebCore::BitmapImage::BitmapImage):
3995         (WebCore::BitmapImage::~BitmapImage):
3996         (WebCore::BitmapImage::destroyDecodedData):
3997         (WebCore::BitmapImage::pruneDecodedDataIfNeeded):
3998         (WebCore::BitmapImage::cacheFrame):
3999         (WebCore::BitmapImage::setNativeData):
4000         (WebCore::BitmapImage::shouldAnimate):
4001         (WebCore::BitmapImage::advanceAnimation):
4002         * platform/graphics/BitmapImage.h:
4003         (WebCore::BitmapImage::decodedSize):
4004         * platform/graphics/Image.cpp:
4005         (WebCore::Image::Image):
4006         * platform/graphics/Image.h:
4007         (WebCore::Image::destroyDecodedData):
4008         (WebCore::Image::decodedSize):
4009         (WebCore::Image::imageObserver):
4010         * platform/graphics/ImageAnimationObserver.h: Removed.
4011         * platform/graphics/ImageObserver.h: Added.
4012         (WebCore::ImageObserver::~ImageObserver):
4013         * platform/graphics/svg/SVGImage.cpp:
4014         (WebCore::SVGImage::SVGImage):
4015         * platform/graphics/svg/SVGImage.h:
4016
4017 2007-03-06  Alexey Proskuryakov  <ap@webkit.org>
4018
4019         Reviewed by Sam Weinig.
4020
4021         http://bugs.webkit.org/show_bug.cgi?id=12987
4022         Fix and import 4XPath test_numeric_expr.html
4023
4024         * xml/XPathPredicate.cpp:
4025         (WebCore::XPath::Negative::doEvaluate): Convert the argument to number.
4026         (WebCore::XPath::NumericOp::doEvaluate): Convert the arguments to numbers. Use a correct operation for mod.
4027         * xml/XPathStep.cpp:
4028         (WebCore::XPath::Step::nodesInAxis): Do not append parent node if there is none.
4029         * xml/XPathValue.cpp:
4030         (WebCore::XPath::Value::toNumber): Do not convert to DeprecatedString just to trim whitespace and to convert to double.
4031         * platform/DeprecatedString.cpp:
4032         (WebCore::DeprecatedStringData::makeAscii): Added a FIXME about unreliable makeAscii() behavior.
4033
4034 2007-03-06  Maciej Stachowiak  <mjs@apple.com>
4035
4036         Reviewed by Adele.
4037
4038         <rdar://problem/4619663> REGRESSION (NativePopup): Popup menu doesn't draw at the correct vertical position (9816)
4039         
4040         * platform/mac/PopupMenuMac.mm:
4041         (WebCore::PopupMenu::show): Make a temporary dummy view with the
4042         passed in rect, since AppKit will use the view bounds to determine
4043         what area to exclude when popping up a menu moved to the top of
4044         the screen.
4045
4046 2007-03-06  Geoffrey Garen  <ggaren@apple.com>
4047
4048         Reviewed by Maciej Stachowiak.
4049
4050         Fixed all known crashers exposed by run-webkit-tests --threaded [*]. See 
4051         JavaScriptCore ChangeLog for more details.
4052
4053         * bindings/js/kjs_binding.cpp:
4054         (KJS::domNodesPerDocument): Added thread safety ASSERT.
4055         (KJS::ScriptInterpreter::mark): Removed obsolete logic for marking unsafe
4056         objects when collecting on a secondary thread. The Collector takes care
4057         of this now.
4058
4059         * bindings/js/kjs_binding.h:
4060         (KJS::DOMObject::DOMObject): Used new API for specifying that WebCore
4061         objects should be garbage collected on the main thread only.
4062
4063         * bindings/js/kjs_window.cpp:
4064         (KJS::ScheduledAction::execute): Moved JSLock to cover implementedsCall() call,
4065         which, for some subclasses, ends up allocating garbage collected objects.
4066         (This fix was speculative. I didn't actually see a crash from this.)
4067         (KJS::Window::timerFired): Added JSLock around ScheduleAction destruction,
4068         since it destroys a KJS::List.
4069
4070         * bindings/objc/WebScriptObject.mm:
4071         (-[WebScriptObject setException:]): Added JSLock. (This fix was speculative. 
4072         I didn't actually see a crash from this.)
4073
4074         * bridge/mac/WebCoreScriptDebugger.mm:
4075         (-[WebCoreScriptCallFrame evaluateWebScript:]): Added JSLock. (This fix 
4076         was speculative. I didn't actually see a crash from this.)
4077
4078         * dom/Document.cpp:
4079         (WebCore::Document::~Document): Added JSLock around modification to 
4080         domNodesPerDocument(), which can be accessed concurrently during garbage 
4081         collection.
4082         * dom/Node.cpp:
4083         (WebCore::Node::setDocument): ditto.
4084         
4085         [*] fast/js/toString-stack-overflow.html is an exception. --threaded mode
4086         crashes this test because it causes the garbage collector to run frequently,
4087         and this test crashes if you happen to garbage collect while it's running.
4088         This is a known issue with stack overflow during the mark phase. It's
4089         not related to threading.
4090
4091 2007-03-06  Mark Rowe  <mrowe@apple.com>
4092
4093         Reviewed by Sam Weinig.
4094
4095         Fix http://bugs.webkit.org/show_bug.cgi?id=12942
4096         Bug 12942: ASSERTION FAILURE: qantas.com.au changing selected item in <select> via JS
4097
4098         Test: fast/dom/select-selectedIndex-bug-12942.html.
4099
4100         * html/HTMLSelectElement.cpp:
4101         (WebCore::HTMLSelectElement::recalcListItems): Reset m_lastOnChangeIndex when recalculating list items.
4102         * html/HTMLSelectElement.h:
4103
4104 2007-03-06  Brady Eidson  <beidson@apple.com>
4105
4106         Rubberstamped by Kevin Decker
4107
4108         20,000!
4109
4110         * ChangeLog: Point out revision 20,000
4111
4112 2007-03-06  Krzysztof Kowalczyk  <kkowalczyk@gmail.com>
4113
4114         Not reviewed.
4115
4116         Gdk build fix.
4117
4118         * loader/gdk/FrameLoaderClientGdk.cpp: update userAgent() signature.
4119         (WebCore::FrameLoaderClientGdk::userAgent):
4120         * loader/gdk/FrameLoaderClientGdk.h: ditto.
4121
4122 2007-03-06  Mitz Pettel  <mitz@webkit.org>
4123
4124         Reviewed by Adele.
4125
4126         - fix http://bugs.webkit.org/show_bug.cgi?id=12986
4127           REGRESSION(NativeListBox): Listboxes not updated when resized dynamically
4128
4129         Test: fast/forms/select-change-listbox-size.html
4130
4131         * html/HTMLSelectElement.cpp:
4132         (WebCore::HTMLSelectElement::parseMappedAttribute): Reattach on list box size change.
4133
4134 2007-03-06  Mitz Pettel  <mitz@webkit.org>
4135
4136         Reviewed by Dave Hyatt.
4137
4138         - fix http://bugs.webkit.org/show_bug.cgi?id=12885
4139           REGRESSION (r19696): Incomplete background repaint
4140
4141         Tests: fast/repaint/content-into-overflow.html
4142                fast/repaint/overflow-into-content.html
4143
4144         Changed repaintAfterLayoutIfNeeded() to take, in addition to the clipped overflow
4145         rect, the unclipped border box plus outline, and to repaint any areas that
4146         were added or removed from that box, in addition to any areas added or removed
4147         from the clipped overflow rect.
4148
4149         * platform/graphics/svg/SVGResourceMarker.cpp:
4150         (WebCore::SVGResourceMarker::draw):
4151         * rendering/RenderBlock.cpp:
4152         (WebCore::RenderBlock::layoutBlock):
4153         * rendering/RenderBox.cpp:
4154         (WebCore::RenderBox::absoluteClippedOverflowRect): Renamed getAbsoluteRepaintRect() to
4155         this.
4156         * rendering/RenderBox.h:
4157         * rendering/RenderFlexibleBox.cpp:
4158         (WebCore::RenderFlexibleBox::layoutBlock):
4159         * rendering/RenderFlow.cpp:
4160         (WebCore::RenderFlow::absoluteClippedOverflowRect):
4161         * rendering/RenderFlow.h:
4162         * rendering/RenderForeignObject.cpp:
4163         (WebCore::RenderForeignObject::layout):
4164         * rendering/RenderHTMLCanvas.cpp:
4165         (WebCore::RenderHTMLCanvas::layout):
4166         * rendering/RenderImage.cpp:
4167         (WebCore::RenderImage::layout):
4168         * rendering/RenderLayer.cpp: