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