9a0c902503831bfb979be3fea90405ec8240ac16
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-27  Graham Dennis  <graham.dennis@gmail.com>
2
3         Reviewed by Darin.
4
5         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
6           Japanese characters improperly rendering in TOT
7           
8         Test: fast/encoding/denormalised-voiced-japanese-chars.html
9
10         * platform/Font.cpp:
11         (WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
12         (WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
13         into an argument as WidthIterator::advance doesn't update m_currentCharacter while
14         looping
15
16 2006-07-27  Eric Seidel  <eric@eseidel.com>
17
18         Reviewed by ap.
19
20         Complex entities seem to fail on TOT
21         http://bugzilla.opendarwin.org/show_bug.cgi?id=6390
22         Use an alternative work-around to an XML Entity parsing bug.
23
24         * dom/XMLTokenizer.cpp:
25         (WebCore::XMLTokenizer::write):
26         (WebCore::hackAroundLibXMLEntityBug): added.
27         (WebCore::startElementNsHandler):
28         (WebCore::endElementNsHandler):
29         (WebCore::charactersHandler):
30         (WebCore::processingInstructionHandler):
31         (WebCore::cdataBlockHandler):
32         (WebCore::commentHandler):
33         (WebCore::getEntityHandler):
34
35 2006-07-27  Rob Buis  <buis@kde.org>
36
37         Reviewed by Darin.
38
39         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
40         Fix viewBox issues in Hixie's test
41
42         Do a more accurate and quicker job of parsing the viewBox
43         attribute. Handle properly on negative width/height and
44         invalid syntax in general.
45
46         * ksvg2/svg/SVGFitToViewBox.cpp:
47         (SVGFitToViewBox::parseViewBox):
48
49 2006-07-27  Eric Seidel  <eric@eseidel.com>
50
51         Reviewed by ap.
52
53         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
54         http://bugzilla.opendarwin.org/show_bug.cgi?id=9237
55         This patch does not try to autogenerate anything, but enables the SVG functionality.
56         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
57
58         * bindings/js/kjs_dom.cpp:
59         (KJS::toJS):
60         * bindings/js/kjs_html.cpp:
61         (KJS::JSHTMLElement::objectGetter):
62         (KJS::HTMLElementFunction::callAsFunction):
63         (KJS::JSHTMLElement::objectSetter):
64         * bindings/js/kjs_html.h:
65         (KJS::JSHTMLElement::):
66         * dom/Document.h:
67         (WebCore::Document::isSVGDocument):
68         * html/HTMLEmbedElement.cpp:
69         (WebCore::HTMLEmbedElement::contentDocument):
70         (WebCore::HTMLEmbedElement::getSVGDocument):
71         * html/HTMLEmbedElement.h:
72         * html/HTMLObjectElement.cpp:
73         (WebCore::HTMLObjectElement::HTMLObjectElement):
74         (WebCore::HTMLObjectElement::getInstance):
75         (WebCore::HTMLObjectElement::parseMappedAttribute):
76         (WebCore::HTMLObjectElement::contentDocument):
77         (WebCore::HTMLObjectElement::rendererIsNeeded):
78         (WebCore::HTMLObjectElement::createRenderer):
79         (WebCore::HTMLObjectElement::setCode):
80         (WebCore::HTMLObjectElement::setArchive):
81         (WebCore::HTMLObjectElement::setBorder):
82         (WebCore::HTMLObjectElement::setCodeBase):
83         (WebCore::HTMLObjectElement::setCodeType):
84         (WebCore::HTMLObjectElement::setData):
85         (WebCore::HTMLObjectElement::hspace):
86         (WebCore::HTMLObjectElement::setHspace):
87         (WebCore::HTMLObjectElement::setStandby):
88         (WebCore::HTMLObjectElement::setType):
89         (WebCore::HTMLObjectElement::setUseMap):
90         (WebCore::HTMLObjectElement::vspace):
91         (WebCore::HTMLObjectElement::setVspace):
92         (WebCore::HTMLObjectElement::getSVGDocument):
93         * html/HTMLObjectElement.h:
94         * ksvg2/svg/SVGDocument.h:
95         (WebCore::SVGDocument::isSVGDocument):
96         * rendering/RenderWidget.h:
97         (WebCore::RenderWidget::frameView):
98
99 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
100
101         Reviewed by Darin.
102
103         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
104         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
105
106         Test: fast/js/xhtml-serialize.html
107
108         * editing/markup.cpp:
109         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
110         is not permitted in HTML, to make it valid XML.
111
112 2006-07-26  Alice Liu  <alice.liu@apple.com>
113
114         Reviewed by John Sullivan (and Kevin and Timo).
115
116         landing this patch for John et al.  
117         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
118
119         * page/FrameView.cpp:
120         (WebCore::FrameView::layout):
121         moved the call to didFirstLayout to above the check for needsLayout
122         because we need to call didFirstLayout for every webview, not just
123         ones we think need layout.  
124
125 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
126
127         Reviewed by darin
128         
129         <rdar://problem/4652788>
130         REGRESSION: Can't change size or style of any text in message body
131
132         * dom/Node.cpp:
133         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
134         * html/HTMLElement.cpp:
135         (WebCore::HTMLElement::isContentRichlyEditable): First check
136         the frame for editability, then userModify, like what
137         HTMLElement::isContentEditable() does.
138         * html/HTMLElement.h:
139
140 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
141
142         Reviewed by ap.
143
144         - fix debug-only information() string for table cells
145
146         * rendering/RenderObject.cpp:
147         (WebCore::RenderObject::information):
148
149 2006-07-25  David Harrison  <harrison@apple.com>
150
151         Reviewed by timo and Darin.
152
153         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
154         
155         * WebCore.xcodeproj/project.pbxproj:
156         * bridge/mac/WebCoreFrameBridge.h:
157         * bridge/mac/WebCoreFrameBridge.mm:
158         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
159         Add matchStyle parameter for use by WebKit.
160
161 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
162
163         Reviewed by adele
164         
165         <rdar://problem/4649560>
166         REGRESSION: Can't Select All when the body is contentEditable="true"
167
168         * editing/VisiblePosition.cpp:
169         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
170         element into an editable body as a convenience.
171
172 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
173
174         Reviewed by darin
175         
176         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
177
178         * dom/Document.cpp:
179         (WebCore::Document::inDesignMode): Removed some spaces.
180         * page/Frame.cpp:
181         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
182         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
183         it eventually.
184
185 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
186
187         Reviewed by Darin.
188
189         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
190           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
191
192         No test added because there is no change in functionality.
193
194         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
195         * bindings/js/kjs_binding.h: Ditto.
196         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
197         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
198         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
199           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
200         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
201
202 2006-07-24  Dan Waylonis  <waylonis@google.com>
203
204         Reviewed and tweaked a bunch by Darin.
205
206         Test: plugins/bindings-test.html
207
208         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
209           jsNull and NSNull not properly converted between JS and ObjC
210
211         * bindings/objc/WebScriptObject.mm:
212         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
213         Added case that converts jsNull to NSNull.
214
215 2006-07-24  Darin Adler  <darin@apple.com>
216
217         Reviewed by Adele and Justin.
218
219         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
220           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
221         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
222           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
223         - removed some uses of DeprecatedPtrList in the markup code
224
225         Test: fast/forms/textarea-type-spaces.html
226         Test: fast/forms/textarea-paste-newline.html
227
228         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
229         Updated call to pass a range -- in this case it is the range of the entire document,
230         so this will not handle the whitespace properly.
231
232         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
233         documentFragmentWithText: method, so we can handle whitespace properly.
234         * bridge/mac/WebCoreFrameBridge.mm:
235         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
236         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
237         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
238         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
239         parameter -- pass it on to createFragmentFromText.
240         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
241         DeprecatedPtrList to Vector.
242         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
243         Pass the range of the current selection as context when creating the fragment.
244
245         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
246         a call to the new containsCaretOffset function -- helps make the caret work right when
247         it is past the end of the last line in a textarea.
248
249         * editing/CompositeEditCommand.cpp:
250         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
251         style does not call for collapsing whitespace.
252         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
253         to share code, including the new logic mentioned above.
254
255         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
256         Use a text node instead of a break element when inserting and the style is preserveNewline.
257
258         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
259         to createFragmentFromText.
260
261         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
262         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
263         not to call otherwise.
264
265         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
266         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
267         Also changed the constructor to take a selection rather than a pointer to the root
268         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
269         unused parameter from shouldMergeEnd.
270         * editing/ReplaceSelectionCommand.cpp:
271         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
272         Compute root editable element from passed-in selection. Used the start of the selection
273         as a base node for style purposes for the test rendering. Removed the special case
274         "single text node" alternative to createFragmentFromText in the plain text case, since
275         createFragmentFromText now handles that correctly.
276         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
277         property from the source location when creating a temporary element for test rendering.
278         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
279         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
280         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
281         change code to not remove end BR when it can be re-used instead, don't call the
282         paragraph separator insertion when the position is at the start of a paragraph already,
283         removed redundant computation of identical "next" value, removed unneeded boolean
284         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
285         a newline character, removed unneeded code to set insertionPos after all code that uses
286         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
287         context is one where we do not collapse white space.
288         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
289         a boolean instead of doing the removal.
290
291         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
292         createFragmentFromText function to take a range for context instead of a document.
293         * editing/markup.cpp:
294         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
295         (WebCore::createMarkup): Ditto.
296         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
297         and changed a couple places to use isEmpty instead of comparing with "".
298         (WebCore::createFragmentFromText): Given the new context parameter, if the context
299         is one that preserves newlines, then use "\n" instead of <br> elements.
300         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
301
302         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
303         elements if the context of this node is one where we preserve newlines.
304
305         * rendering/InlineTextBox.h:
306         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
307         Added. Implements the appropriate rule for determining if a caret position is
308         in this line or not. Returns true for both one line and the next in cases where
309         affinity must be considered to determine which line the caret is on.
310
311         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
312         * rendering/RenderText.cpp:
313         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
314         which will no longer apply due to the new containsCaretOffset function logic.
315         (WebCore::RenderText::caretRect): Use containsCaretOffset.
316         (WebCore::RenderText::inlineBox): Ditto.
317
318         * rendering/RenderTextControl.cpp:
319         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
320         after calling setInnerText so that the last newline in the string has the effect
321         we expect outside the HTML world (an additional line).
322         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
323         too. The layout tests caught this problem, which needs a better solution long term.
324         (WebCore::RenderTextControl::text): Call textContent with the parameter false
325         so it will not include newlines for <br> elements. Now the only <br> element
326         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
327         that one should not show up in the text value.
328
329         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
330         that specifically called out the pre whitespace mode and made it work for all
331         the modes that preserve newlines. This makes sure we get a last line box for
332         text after the last "\n" even in cases where there is no <br> afterward.
333
334         * editing/DeleteSelectionCommand.cpp:
335         (WebCore::DeleteSelectionCommand::fixupWhitespace):
336         * editing/InsertParagraphSeparatorCommand.cpp:
337         (WebCore::InsertParagraphSeparatorCommand::doApply):
338         Added assertions to make sure we don't do anything when we're not collapsing
339         whitespace.
340
341         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
342         Changed to use Vector instead of DeprecatedPtrList.
343
344         * editing/HTMLInterchange.cpp: Removed obsolete comment.
345
346         * loader/Cache.h: Removed a stray include.
347
348 2006-07-24  Adele Peterson  <adele@apple.com>
349
350         Reviewed by Justin.
351
352         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
353
354         Test: * editing/style/apple-style-editable-mix.html
355
356         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
357           checks the user modify property of its own renderer, since that is inherited.
358         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
359         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
360
361 2006-07-24  Darin Adler  <darin@apple.com>
362
363         Reviewed by Hyatt.
364
365         - implement String::createCFString
366
367         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
368
369         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
370
371         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
372         and added the CFStringRef ones.
373         * platform/mac/StringMac.mm: Added. Ditto.
374
375 2006-07-24  David Hyatt  <hyatt@apple.com>
376
377         Two bug fixes.
378
379         (1) Make sure to mark positioned objects that depend on line position to
380         mark themselves as needing layout when their line box placeholder gets
381         repositioned.
382
383         * rendering/RenderBox.cpp:
384         (WebCore::RenderBox::position):
385        
386         (2) Improve highlighting to factor the inflation into overflow so that
387         invalidation and repainting will work properly.
388
389         * rendering/RootInlineBox.cpp:
390         (WebCore::RootInlineBox::addHighlightOverflow):
391         * rendering/RootInlineBox.h:
392         * rendering/bidi.cpp:
393         (WebCore::RenderBlock::layoutInlineChildren):
394
395 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
396
397         Reviewed by Adele.
398
399         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
400         
401         * html/HTMLInputElement.cpp:
402         (WebCore::HTMLInputElement::defaultEventHandler):
403         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
404         that onsearch can be invoked.
405         
406         * manual-tests/onsearch-enter.html: Added.
407
408 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
409
410         Reviewed by Darin and Alexey.
411         
412         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
413         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
414
415         Test: svg/custom/non-opaque-filters.svg
416
417         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
418         (WebCore::KCanvasFilterQuartz::prepareFilter):
419         We create an autorelease pool so we can control the deallocation of the
420         CIContext that we're creating. The CIContext retains the CGContext that 
421         you pass it internally so when the CIContext is released, the 
422         CGContext is released as well.
423         This is all fine and dandy unless you wrap the creation of the CIFilter
424         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
425         out from underneath you. So if you start with context A, 
426         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
427         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
428         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
429         release on A, but A never got the refcount in the first place. B did. BOOM!
430         So we create a pool, then do a retain, then release the pool so that we 
431         don't have to worry about the pool releasing it at a later time.
432         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
433
434 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
435
436         Reviewed by Hyatt.
437
438         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
439           Incomplete repaint when changing an inline's border
440
441         Test: fast/repaint/line-overflow.html
442
443         * rendering/RenderBlock.h:
444         * rendering/bidi.cpp:
445         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
446         variables to track the vertical edges of the area that changed, accounting for
447         lines that were deleted, inserted or moved. Removed unnecessary updating of
448         m_overflowHeight.
449         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
450         m_overflowHeight.
451         (WebCore::RenderBlock::determineEndPosition):
452         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
453         arguments, which this method updates to account for deleted lines.
454         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
455
456 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
457
458         Reviewed by Darin.
459
460         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
461           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
462
463         Test: fast/forms/select-visual-hebrew.html
464
465         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
466
467 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
468
469         Reviewed by Darin.
470
471         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
472         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
473
474         * page/Frame.cpp:
475         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
476         claims it.
477
478 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
479
480         Reviewed by Darin.
481
482         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
483           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
484
485         * rendering/RenderBlock.cpp:
486         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
487         for bug 9312: For coordinates outside a replaced object, return the position
488         just before (after) the element if the coordinates are above or to the left (below
489         or to the right).
490
491 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
492
493         Reviewed by maciej.
494
495         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
496         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
497
498         WebCore portion of the fix.
499
500         * bridge/mac/WebCoreScriptDebugger.h:
501         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
502         * bridge/mac/WebCoreScriptDebugger.mm:
503         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
504
505 2006-07-23  Alice Liu  <alice.liu@apple.com>
506
507         Reviewed by Adele.
508         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
509
510         * editing/visible_units.cpp:
511         (WebCore::previousLinePosition):
512         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
513         (WebCore::nextLinePosition):
514         same as above
515
516 2006-07-23  David Harrison  <harrison@apple.com>
517
518         Reviewed by timo.
519
520         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
521         
522         * Test: editing/deleting/delete-mixed-editable-content-001.html
523
524         * editing/visible_units.cpp:
525         (WebCore::startOfParagraph):
526         Respect editable boundary the same way endOfParagraph does.
527
528 2006-07-23  Beth Dakin  <bdakin@apple.com>
529
530         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
531
532         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
533         text - WebCore::InlineBox::root()
534
535         The initial rendering crash was due to a render object having a 
536         stale reference to an inline box that had already been deleted and 
537         then recreated in the exact same location in memory. (Crazy, I 
538         know.) The situation seemed pretty specific to list markers 
539         according to Hyatt according to Maciej, so that is what I patched 
540         specifically. Fixing this crash unearthed a separate editing crash 
541         where we were trying to insert a block into itself. I worked on 
542         that with Maciej and Harrison, and Harrison came up with a fix.
543
544         * editing/CompositeEditCommand.cpp:
545         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
546         node, insert the new block into the parent instead.
547         * rendering/InlineBox.cpp:
548         (WebCore::InlineBox::isChildOfParent): This function is for 
549         posterity. It will help keep the linebox tree in check.
550         * rendering/InlineBox.h:
551         * rendering/InlineFlowBox.cpp:
552         (WebCore::InlineFlowBox::addToLine): Added assert.
553         (WebCore::InlineFlowBox::deleteLine): Added assert.
554         * rendering/ListMarkerBox.cpp:
555         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
556         removeChild on this.
557         (WebCore::ListMarkerBox::operator delete):
558         * rendering/ListMarkerBox.h:
559
560 2006-07-23  Alice Liu  <alice.liu@apple.com>
561
562         Reviewed by Darin.
563
564         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
565
566         * rendering/RenderBlock.cpp:
567         (WebCore::RenderBlock::positionForCoordinates):
568         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
569         * rendering/RenderTextControl.cpp:
570         (WebCore::RenderTextControl::nodeAtPoint):
571         added implementation
572         * rendering/RenderTextControl.h:
573         added function protocol
574
575 2006-07-23  Adele Peterson  <adele@apple.com>
576
577         Reviewed by Darin.
578
579         Updating fix from last checkin.
580
581         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
582         Only tell the view about this flexbox if there isn't another flexbox already cached.
583
584 2006-07-23  Adele Peterson  <adele@apple.com>
585
586         Reviewed by Maciej.
587
588         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
589
590         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
591         its first layout.
592         * rendering/RenderFlexibleBox.cpp:
593         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
594         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
595
596         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
597         * rendering/RenderView.h:
598         (WebCore::RenderView::setFlexBoxInFirstLayout):
599         (WebCore::RenderView::flexBoxInFirstLayout):
600
601 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
602
603         Reviewed by Darin.
604
605         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
606         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
607         of registered mime types
608
609         * bindings/js/kjs_navigator.cpp:
610         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
611         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
612         from even being called.
613
614 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
615
616         Reviewed by Adele and Tim Omernick.
617
618         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
619
620         Couldn't figure out how to make layout test, here's a manual test:
621         * manual-tests/remove-select-onchange.html: Added.
622         
623         * rendering/RenderMenuList.cpp:
624         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
625         tree so it doesn't get destroyed if we do.
626         
627         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
628         to be in the render tree:
629         
630         * rendering/RenderPopupMenu.cpp:
631         (WebCore::RenderPopupMenu::RenderPopupMenu):
632         * rendering/RenderPopupMenu.h:
633         (WebCore::RenderPopupMenu::menuList):
634         * rendering/RenderPopupMenuMac.h:
635         * rendering/RenderPopupMenuMac.mm:
636         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
637         * rendering/RenderPopupMenuWin.h:
638         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
639         * rendering/RenderTheme.h:
640         * rendering/RenderThemeMac.h:
641         * rendering/RenderThemeMac.mm:
642         (WebCore::RenderThemeMac::createPopupMenu):
643         * rendering/RenderThemeWin.cpp:
644         (WebCore::RenderThemeWin::createPopupMenu):
645         * rendering/RenderThemeWin.h:
646
647 2006-07-21  Adele Peterson  <adele@apple.com>
648
649         Reviewed by Darin.
650
651         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
652
653         Test: fast/forms/textarea-scrolled-endline-caret.html
654
655         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
656         When looking for the closest line box, take the scroll offset into account.
657
658 2006-07-21  Tim Omernick  <timo@apple.com>
659
660         Reviewed by Geoff & Maciej.
661
662         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
663
664         Geoff is working on a layout test for this.
665
666         * bridge/mac/FrameMac.mm:
667         (WebCore::FrameMac::focusWindow):
668         (WebCore::FrameMac::unfocusWindow):
669         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
670         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
671         crasher.
672         
673 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
674
675         Reviewed by Darin.
676
677         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
678
679         * rendering/RenderTextControl.cpp:
680         (WebCore::RenderTextControl::updateFromElement): Clear the undo
681         chain when the text control contents have been set
682         programmatically.
683         * bridge/mac/FrameMac.mm:
684         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
685         stack, close all open undo groups and then open an equal number,
686         since otherwise NSUndoManager ends up in an inconsistent state
687         leading to uncaught ObjC exceptions.
688
689 2006-07-21  Beth Dakin  <bdakin@apple.com>
690         
691         Reviewed by Darin.
692
693         Just moving this assertion down a couple of lines. It was hitting 
694         every time you try to print a page because we put it too early in 
695         the function.
696
697         * bridge/mac/WebCoreFrameBridge.mm:
698         (-[WebCoreFrameBridge drawRect:]):
699
700 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
701
702         Reviewed by levi
703         
704         <rdar://problem/4548238>
705         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
706
707         * editing/CompositeEditCommand.cpp:
708         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
709         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
710         * editing/CompositeEditCommand.h:
711         * editing/InsertParagraphSeparatorCommand.cpp:
712         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
713         * editing/TypingCommand.cpp:
714         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
715         the endingSelection is at the start of an editable region.
716         * editing/htmlediting.cpp:
717         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
718         (WebCore::appendedSublist): Ditto.
719         (WebCore::enclosingEmptyListItem): Ditto.
720         * editing/htmlediting.h:
721
722 === Safari-521.20 ===
723
724 2006-07-21  Tim Omernick  <timo@apple.com>
725
726         Reviewed by Beth Dakin & John Sullivan.
727
728         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
729
730         Beth is in the middle of making a layout test for this; she will land it soon.
731
732         * platform/mac/ScrollBarMac.mm:
733         (ScrollBar::~ScrollBar):
734         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
735         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
736         in view-based widgets to prevent their destruction while the tracking is in progress.
737         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
738         than using removeFromSuperview().
739
740 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
741
742         Reviewed by Darin.
743
744         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
745           REGRESSION: Selection bug in new text fields when selecting past the first letter
746
747         Test: editing/selection/select-from-textfield-outwards.html
748
749         * editing/Selection.cpp:
750         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
751         where the selection starts (resp. ends) in the last (resp. first) visual position
752         inside an editable root.
753         * editing/htmlediting.cpp:
754         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
755         tree with a position in the shadow ancestor.
756         * rendering/RenderBlock.cpp:
757         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
758         object, return the position just before (after) the element if the coordinates are above or
759         to the left (below or to the right).
760         * rendering/RenderObject.cpp:
761         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
762         * rendering/RenderText.cpp:
763         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
764         in the lowest text box if the y coordinate is below all text boxes.
765
766 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
767
768         Reviewed by Darin.
769         
770         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
771         HousingMaps.com (Google Maps-based site)
772         
773         - Made style.filter undetectable, like document.all.
774         
775         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
776         which conflicts with IE's custom CSS attribute by the same name. Web programs 
777         like the Google maps API test for style.filter, and assume it's the IE 
778         style.filter if they find it, so we need to make style.filter undetectable 
779         to avoid breaking them.
780         
781         An alternative solution would be to hotwire a delorean, go back in time,
782         and beg the web standards makers to make standards that work on the web.
783
784         * bindings/js/kjs_css.cpp:
785         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
786
787 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
788
789         Reviewed by john
790         
791         <rdar://problem/4641033>
792         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
793         
794         * editing/markup.cpp:
795         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
796         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
797         at those ancestors.  We assumed that any ancestors of the current node not in the 
798         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
799         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
800         currently accumulated markup with markup for render-less containers.  Most of the
801         content at apple.com was being put inside an <optgroup> inside a <select> element.  
802         Then on Paste createContextualFragment would drop it.
803
804 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
805
806         Reviewed by Geoff.
807
808         * dom/Document.h:
809         (WebCore::Document::):
810         * dom/EventTargetNode.cpp:
811         (WebCore::EventTargetNode::addEventListener):
812         * page/FrameView.cpp:
813         (WebCore::FrameView::layout):
814         * rendering/RenderLayer.cpp:
815         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
816         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
817
818 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
819
820         Reviewed by Geoff.
821
822         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
823
824         * xml/XSLTProcessor.cpp:
825         (WebCore::xsltParamArrayFromParameterMap):
826         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
827         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
828         This also works around a bug in libxslt where a hash table isn't allocated.
829
830 2006-07-20  Alice Liu  <alice.liu@apple.com>
831
832         Reviewed by Tim Omernick.
833
834         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
835         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
836
837         * manual-tests/remove-input-file-onchange.html: Added.
838         * platform/mac/FileButtonMac.mm:
839         (-[WebFileChooserButton chooseFilename:]):
840         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
841
842 2006-07-20  Alice Liu  <alice.liu@apple.com>
843
844         Reviewed by Adele.
845
846         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
847         added a manual test because of the need to use AutoFill.
848
849         * dom/Node.h:
850         (WebCore::Node::aboutToUnload):
851         added virtual function prototype
852         * html/HTMLInputElement.cpp:
853         (WebCore::HTMLInputElement::aboutToUnload):
854         added implementation that sends textFieldDidEndEditing notification
855         * html/HTMLInputElement.h:
856         added virtual function prototype
857         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
858         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
859         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
860         * page/Frame.cpp:
861         (WebCore::Frame::stopLoading):
862         before unloading, call aboutToUnload on the current focused node
863
864 2006-07-20  Brady Eidson  <beidson@apple.com>
865
866         Reviewed by Maciej
867
868         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
869         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
870         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
871
872         * dom/Document.cpp:
873         (WebCore::Document::Document):
874         (WebCore::Document::clear):
875         (WebCore::Document::handleWindowEvent):
876         (WebCore::Document::getHTMLWindowEventListener):
877         (WebCore::Document::removeHTMLWindowEventListener):
878         (WebCore::Document::removeWindowEventListener):
879         (WebCore::Document::hasWindowEventListener):
880         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
881
882         * dom/Document.h:
883         Changed the EventListener list to be a vanilla pointer list to a refptr list
884
885 2006-07-20  John Sullivan  <sullivan@apple.com>
886
887         Reviewed by Maciej
888
889         - WebCore part of fix for:
890         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
891         closing tabs after clicking in a web page
892         
893         * bridge/mac/WebCoreFrameBridge.h:
894         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
895         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
896         * bridge/mac/FrameMac.mm:
897         (WebCore::FrameMac::passMouseDownEventToWidget):
898         updated for name change
899
900 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
901
902         Reviewed by Darin.
903
904         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
905         Use of window.open & window.close can cause crash
906
907         * platform/PlatformMouseEvent.h:
908         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
909         * platform/mac/PlatformMouseEventMac.mm:
910         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
911         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
912
913         * bridge/mac/FrameMac.mm:
914         (WebCore::FrameMac::handleMouseMoveEvent):
915         * rendering/RenderFormElement.cpp:
916         (WebCore::RenderFormElement::clicked): 
917         Updated for the above changes.
918
919         * platform/gdk/MouseEventGdk.cpp:
920         * platform/gdk/TemporaryLinkStubs.cpp:
921         (PlatformMouseEvent::PlatformMouseEvent):
922         * platform/win/MouseEventWin.cpp:
923         * platform/win/TemporaryLinkStubs.cpp:
924         (PlatformMouseEvent::PlatformMouseEvent):
925         Trying not to break other platforms.
926
927         * manual-tests/invalid-mouse-event.html: Added.
928
929 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
930         
931         Reviewed by Anders.
932
933         - delete line that I only commented in the last patch - meant to do this before landing
934
935         * html/HTMLFrameElement.cpp:
936         (WebCore::HTMLFrameElement::close): 
937
938 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
939
940         Reviewed by Geoff.
941
942         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
943         
944         I couldn't figure out how to make an automated test case for this,
945         or even a manual one. It seems to be timing-related in some way.
946
947         * html/HTMLFrameElement.cpp:
948         (WebCore::HTMLFrameElement::close): detach the child frame from
949         its element, not the frame containing this element.
950
951 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
952
953         Reviewed by Darin.
954
955         * bridge/mac/FrameMac.mm:
956         (WebCore::FrameMac::nextKeyViewInFrame):
957         Hold a ref to the node in case it gets destroyed by an event handler.
958
959 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
960
961         Reviewed by Darin.
962
963         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
964         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
965         Image::checkForSolidColor
966
967         * platform/Image.cpp:
968         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
969         the frame was decoded successfully.
970
971 2006-07-19  Adele Peterson  <adele@apple.com>
972
973         Reviewed by Maciej.
974
975         - Fix for: 
976         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
977         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
978
979         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
980         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
981
982         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
983
984         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
985         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
986         which will cause the correct selection & scrolling behavior to occur. 
987
988         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
989         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
990         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
991         a layout to happen, and we don't want that to happen in the middle of attach().
992
993         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
994         * bindings/objc/DOMPrivate.h:
995
996         * dom/Element.cpp:
997         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
998         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
999         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
1000         and only requiring the element to be focusable now before updating focus appearance.
1001         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1002         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
1003         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
1004         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
1005         (WebCore::Element::blur): ditto.
1006         * dom/Element.h:
1007         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
1008         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
1009
1010         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
1011         * html/HTMLAnchorElement.h: Added supportsFocus.
1012         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
1013         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
1014         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
1015         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
1016
1017         * html/HTMLInputElement.cpp:
1018         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1019         and only requiring the element to be focusable now before updating focus appearance.
1020         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1021         * html/HTMLInputElement.h:
1022
1023         * html/HTMLTextAreaElement.cpp:
1024         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1025         and only requiring the element to be focusable now before updating focus appearance.
1026         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1027         * html/HTMLTextAreaElement.h:
1028
1029 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1030
1031         Reviewed by levi
1032         
1033         <rdar://problem/4631972>
1034         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1035
1036         * dom/Position.cpp:
1037         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1038         (WebCore::Position::downstream): Ditto.
1039         * editing/CompositeEditCommand.cpp:
1040         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1041         * editing/htmlediting.cpp:
1042         (WebCore::canHaveChildrenForEditing): Added !iframe.
1043         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1044         (WebCore::enclosingBlock): Added.
1045         * editing/htmlediting.h:
1046
1047 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1048
1049         Reviewed by Adele.
1050
1051         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1052         
1053         * bridge/mac/FrameMac.mm:
1054         (WebCore::FrameMac::nextKeyViewInFrame):
1055         Take into account that focus handlers can cause a node's renderer to be destroyed.
1056         
1057 2006-07-19  David Hyatt  <hyatt@apple.com>
1058
1059         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1060         I re-architected image.  This patch restores the optimization for CG.  Cairo
1061         will still need the optimization.
1062
1063         Reviewed by darin
1064
1065         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1066
1067         * platform/Image.cpp:
1068         (WebCore::Image::Image):
1069         (WebCore::Image::invalidateData):
1070         (WebCore::Image::cacheFrame):
1071         * platform/Image.h:
1072         (WebCore::Image::setIsPDF):
1073         * platform/cairo/ImageCairo.cpp:
1074         (WebCore::Image::checkForSolidColor):
1075         * platform/mac/ImageMac.mm:
1076         (WebCore::Image::initNativeData):
1077         (WebCore::Image::invalidateNativeData):
1078         (WebCore::Image::checkForSolidColor):
1079         (WebCore::Image::draw):
1080         (WebCore::Image::drawTiled):
1081
1082 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1083
1084         Reviewed by levi
1085         
1086         <rdar://problem/4613519>
1087         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1088
1089         * editing/InsertParagraphSeparatorCommand.cpp:
1090         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1091         if the enclosingBlockFlowElement doesn't have a parent.
1092
1093 2006-07-19  David Harrison  <harrison@apple.com>
1094
1095         Reviewed by Tim Hatcher.
1096
1097         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1098         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1099         
1100         Better patch than previous checkin.
1101
1102         * test: editing/pasteboard/paste-table-003.html
1103         
1104         * editing/markup.cpp:
1105         (WebCore::createMarkup):
1106         Make sure to include the table when including a tbody.
1107
1108 === Safari-521.19 ===
1109
1110 2006-07-19  David Harrison  <harrison@apple.com>
1111
1112         Reviewed by Tim Hatcher.
1113
1114         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1115
1116         No test case as this can only be reproduced through ObjC APIs.
1117
1118         * editing/markup.cpp:
1119         (WebCore::createMarkup):
1120         Adjust the range for ancestor markup handling when main loop skips first node.
1121
1122 2006-07-18  David Hyatt  <hyatt@apple.com>
1123
1124         Fix for radar 4611287, make resizable text fields opt-in rather than
1125         opt-out.  Open source users will need to write the pref into their defaults
1126         to see the resizers on textareas now.
1127
1128         Reviewed by mjs and adele
1129
1130         * WebCore.xcodeproj/project.pbxproj:
1131         * bridge/mac/WebCoreSettings.mm:
1132         (-[WebCoreSettings setTextAreasAreResizable:]):
1133         * css/cssparser.cpp:
1134         (WebCore::CSSParser::parseValue):
1135         * css/cssstyleselector.cpp:
1136         (WebCore::CSSStyleSelector::applyProperty):
1137         * css/html4.css:
1138
1139 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1140
1141         Reviewed by Darin.
1142
1143         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1144         REGRESSION: iframes stop rendering after 200th one on successive reloads
1145         
1146         * html/HTMLFrameElement.cpp:
1147         (WebCore::HTMLFrameElement::attach):
1148         (WebCore::HTMLFrameElement::close):
1149         * html/HTMLIFrameElement.cpp:
1150         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1151         (WebCore::HTMLIFrameElement::willRemove):
1152         Remove calls to incrementFrameCount and decrementFrameCount.
1153         
1154         * page/Frame.cpp:
1155         (WebCore::Frame::Frame):
1156         Call incrementFrameCount here.
1157         
1158         (WebCore::Frame::~Frame):
1159         Call disconnectOwnerElement.
1160         
1161         (WebCore::Frame::disconnectOwnerElement):
1162         Call decrementFrameCount here.
1163         
1164 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1165
1166         Reviewed by Darin.
1167
1168         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1169         Let correct CSS custom cursor declarations parse
1170
1171         * css/cssparser.cpp:
1172         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1173         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1174         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1175
1176         * manual-tests/custom-cursors.html: Added a test for this issue.
1177         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1178
1179 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1180
1181         Reviewed by Anders.
1182         
1183         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1184         
1185         WebCore needs to add -sub_library libobjc to maintain
1186         backwards compatibility with binaries linked with WebKit
1187         before JavaScriptCore moved out of WebKit.
1188
1189         * WebCore.xcodeproj/project.pbxproj:
1190
1191 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1192
1193         Reviewed by Justin.
1194
1195         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1196           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1197
1198         Test: editing/selection/click-start-of-line.html
1199
1200         * rendering/RenderText.cpp:
1201         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1202         affinity if the x coordinate is to the left of the middle of the first character
1203         in the text box.
1204
1205 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1206
1207         Reviewed by Darin.
1208
1209         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1210         <rdar://problem/4614085> 
1211         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1212         
1213         * editing/SelectionController.cpp:
1214         (WebCore::SelectionController::modifyExtendingRightForward):
1215         (WebCore::SelectionController::modifyMovingRightForward):
1216         (WebCore::SelectionController::modifyExtendingLeftBackward):
1217         (WebCore::SelectionController::modifyMovingLeftBackward):
1218         If the caret is inside an editable region, the beginning/end of the document should actually be the
1219         beginning/end of the editable region.
1220
1221 2006-07-17  Tim Omernick  <timo@apple.com>
1222
1223         Reviewed by Maciej.
1224
1225         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1226         by script
1227
1228         * bridge/mac/WebCoreFrameBridge.h:
1229         * bridge/mac/WebCoreFrameBridge.mm:
1230         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1231         * page/Frame.cpp:
1232         (WebCore::Frame::prohibitsScrolling):
1233         (WebCore::Frame::setProhibitsScrolling):
1234         * page/Frame.h:
1235         * page/FramePrivate.h:
1236         (WebCore::FramePrivate::FramePrivate):
1237         * page/FrameView.cpp:
1238         (WebCore::FrameView::scrollPointRecursively):
1239         (WebCore::FrameView::setContentsPos):
1240         * page/FrameView.h:
1241         * platform/ScrollView.h:
1242
1243 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1244
1245         Reviewed by Dave Harrison.
1246         
1247         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1248
1249         * editing/htmlediting.cpp:
1250         (WebCore::editingIgnoresContent):
1251
1252 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1253
1254         Reviewed by levi
1255         
1256         <rdar://problem/4621728>
1257         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1258         <rdar://problem/4604932>
1259         REGRESSION: Dragging too far left on a line will select all lines above it.
1260  
1261         No layout test because of 9980.
1262
1263         * rendering/RenderBlock.cpp:
1264         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1265         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1266         editable.
1267
1268 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1269
1270         Reviewed by Darin.
1271
1272         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1273
1274         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1275         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1276         * html/CanvasRenderingContext2D.cpp:
1277         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1278
1279 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1280
1281         Reviewed by Maciej.
1282
1283         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1284
1285         Moves WebScriptObject and WebUndefined to WebCore.
1286
1287         * WebCore.exp:
1288         * WebCore.xcodeproj/project.pbxproj:
1289         * bindings/objc/DOM.mm:
1290         * bindings/objc/DOMCore.h:
1291         * bindings/objc/DOMInternal.mm:
1292         * bindings/objc/DOMUtility.mm:
1293         * bindings/objc/WebScriptObject.mm: Added.
1294         (+[WebUndefined allocWithZone:]):
1295         (-[WebUndefined initWithCoder:]):
1296         (-[WebUndefined encodeWithCoder:]):
1297         (-[WebUndefined copyWithZone:]):
1298         * bindings/objc/WebScriptObjectPrivate.h: Added.
1299         * bridge/mac/FrameMac.mm:
1300         * bridge/mac/WebCoreScriptDebugger.mm:
1301
1302 2006-07-17  David Hyatt  <hyatt@apple.com>
1303
1304         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1305         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1306         font parsing as a means of also correcting IE's incorrect font size rules.
1307
1308         This fixes Yahoo.com.
1309
1310         Reviewed by darin
1311
1312         * css/cssparser.cpp:
1313         (WebCore::CSSParser::parseFont):
1314
1315 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1316
1317         Reviewed by levi
1318         
1319         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1320         
1321         * dom/Document.cpp:
1322         (WebCore::Document::updateSelection):
1323
1324 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1325
1326         Reviewed by Beth.
1327         
1328         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1329
1330         * html/HTMLInputElement.cpp:
1331         (WebCore::HTMLInputElement::setChecked):
1332         (WebCore::HTMLInputElement::preDispatchEventHandler):
1333         * html/HTMLInputElement.h:
1334
1335 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1336
1337         Reviewed by Darin.
1338
1339         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
1340           REGRESSION: document.dir should return empty string in <head>
1341
1342         Test: fast/dom/document-dir-property.html
1343
1344         * bindings/js/kjs_html.cpp:
1345         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
1346         undefined value for an unset document.dir property.
1347
1348 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1349
1350         Reviewed by Darin.
1351
1352         * dom/NodeFilter.idl:
1353         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
1354         * manual-tests/input-empty-on-focus.html:
1355         Removed "Property changes" that snuck in as part of the "apply patch" process.
1356
1357 2006-07-16  Darin Adler  <darin@apple.com>
1358
1359         Reviewed by John Sullivan.
1360
1361         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
1362           <rdar://problem/4590613>
1363           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
1364
1365         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
1366         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
1367         Presumably some other bug that we fixed had been compensating.
1368
1369         Test: fast/html/body-offset-properties.html
1370
1371         * rendering/RenderObject.cpp:
1372         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
1373         (WebCore::RenderObject::offsetTop): Ditto.
1374         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
1375
1376 2006-07-16  Beth Dakin  <bdakin@apple.com>
1377
1378         Reviewed by Maciej.
1379
1380         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
1381         clock widget clock hand motion on 9A211 + 4604574
1382
1383         The second hand on the widget was jiggling because the rotation was 
1384         messing up the use of the affine transformation matrix while 
1385         rounding to pixel boundaries in device space. We are mainly 
1386         concerned with rounding to pixel boundaries with the scale in mind, 
1387         so this patch extracts the scale to device space from the matrix, 
1388         and rounds to pixel boundaries using only the scale. This doesn't 
1389         seem like it is a perfect solution, but it definitely solves the 
1390         immediate problem. We will probably need to re-address what should 
1391         happen to avoid pixel cracks with rotations at non-integral scale 
1392         factors. 
1393
1394         * platform/cg/GraphicsContextCG.cpp:
1395         (WebCore::GraphicsContext::roundToDevicePixels):
1396
1397 2006-07-15  Darin Adler  <darin@apple.com>
1398
1399         - fix mistake from fix for 8952 that was breaking layout tests
1400
1401         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1402         Justin was right! I changed the behavior of the function by accident. Changed it
1403         back so that it doesn't blow away the selection on the DOM side in the case where
1404         it didn't before.
1405
1406         I will write 100 times on the blackboard: "When Justin says something about editing,
1407         assume he is right."
1408
1409 2006-07-15  Darin Adler  <darin@apple.com>
1410
1411         - try to fix Windows build
1412
1413         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
1414
1415 2006-07-15  Darin Adler  <darin@apple.com>
1416
1417         Reviewed by John Sullivan.
1418
1419         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
1420           <rdar://problem/4575185>
1421           REGRESSION: crash on drag of highlighted Google custom home page modules
1422
1423         Test: fast/dynamic/move-node-with-selection.html
1424
1425         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
1426         Call updateRendering before calling clearSelection(), since it's important to do any
1427         work beforehand, and there are calls inside clearSelection that will indirectly do an
1428         updateRendering. Also change code to make fewer assumptions about object lifetime.
1429
1430 2006-07-15  Darin Adler  <darin@apple.com>
1431
1432         Reviewed by John Sullivan.
1433
1434         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
1435           <rdar://problem/4631844>
1436           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
1437
1438         Test: fast/lists/numeric-markers-outside-list.html
1439
1440         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
1441         Look for list items, even when we're outside any list.
1442
1443 2006-07-15  Adele Peterson  <adele@apple.com>
1444
1445         Reviewed by John.
1446
1447         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
1448
1449         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
1450         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
1451         part of an editing command to replace the selected text.
1452
1453         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
1454           part of a composite command to replace the text being deleted.
1455         * editing/DeleteSelectionCommand.cpp:
1456         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
1457         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
1458         * editing/CompositeEditCommand.h:
1459         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
1460           Added replace argument to construct DeleteSelectionCommand.
1461           
1462         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
1463         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
1464
1465 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
1466
1467         Reviewed by Maciej, tweaked to match Darin's patch.
1468         
1469         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
1470         FCKeditor demo (9911)
1471         
1472         * WebCore.xcodeproj/project.pbxproj:
1473         * bindings/js/kjs_html.cpp:
1474         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
1475         forwarding the put request to it. I confirmed that no other parts of the 
1476         file use 'body' or 'bodyElement' without checking for null. 
1477         
1478         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
1479         any element, not just HTMLBodyElement.
1480
1481 2006-07-15  Darin Adler  <darin@apple.com>
1482
1483         Reviewed by Adele.
1484
1485         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
1486           <rdar://problem/4575417>
1487           REGRESSION: Pressing Enter/Return in a text input removes the selected text
1488
1489         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
1490           <rdar://problem/4614228>
1491           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
1492
1493         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
1494         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
1495         enough for the future.
1496
1497         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
1498         Consume Enter key keypress events even if the element is not in a form.
1499
1500         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
1501         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
1502         the Macintosh, but in layout tests we can use \n, and everything other than the
1503         code path here works, so worth fixing.
1504
1505 2006-07-15  Darin Adler  <darin@apple.com>
1506
1507         Reviewed by John Sullivan.
1508
1509         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
1510           <rdar://problem/4631821>
1511           REGRESSION: NativePopups don't work correctly in some forum software
1512
1513         Test: fast/forms/select-selected.html
1514
1515         * rendering/RenderMenuList.h:
1516         * rendering/RenderMenuList.cpp:
1517         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
1518         index to a list index before using it to index into the list.
1519         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
1520         to a list index before passing it to the menu renderer.
1521         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
1522         option index before calling setSelectedIndex (that function takes an option index).
1523
1524 2006-07-15  Darin Adler  <darin@apple.com>
1525
1526         Reviewed by John Sullivan.
1527
1528         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
1529           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
1530
1531         * bindings/objc/DOM.mm:
1532         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
1533         (-[DOMNode removeEventListener:::]): Ditto.
1534         (-[DOMNode dispatchEvent:]): Ditto.
1535
1536         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
1537
1538 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
1539
1540         Reviewed by Anders.
1541
1542         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
1543
1544         * rendering/RenderTable.cpp:
1545         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
1546         just table sections!
1547
1548 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
1549
1550         Reviewed by Darin.
1551
1552         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
1553         <rdar://problem/4631561>
1554         REGRESSION: Repro crash from mangleme using iframe, only from server.
1555         
1556         * html/HTMLIFrameElement.cpp:
1557         (WebCore::HTMLIFrameElement::attach):
1558         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
1559
1560 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
1561
1562         Reviewed by Darin.
1563
1564         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
1565         REGRESSION: KOI8-U encoding no longer supported.
1566
1567         Tests:
1568         * http/tests/misc/BOM-override.pl
1569         * http/tests/misc/BOM-override-script.html
1570         * fast/encoding/charset-koi8-u.html
1571         * fast/encoding/charset-x-nextstep.html
1572
1573         Restored a TEC code path for encodings that are not supported by ICU (but which currently
1574         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
1575         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
1576         makes little sense now.
1577
1578         * WebCore.exp:
1579         * bridge/mac/WebCoreTextDecoder.h: Removed.
1580         * bridge/mac/WebCoreTextDecoder.mm: Removed.
1581         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
1582
1583         * loader/Decoder.cpp:
1584         (Decoder::Decoder):
1585         (Decoder::setEncodingName):
1586         (Decoder::decode):
1587         Use StreamingTextDecoder::create().
1588
1589         * platform/StreamingTextDecoder.cpp:
1590         (WebCore::StreamingTextDecoder::create):
1591         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
1592         * platform/StreamingTextDecoder.h:
1593         StreamingTextDecoder is just an abstract interface to implementations now.
1594
1595         * platform/StreamingTextDecoderICU.cpp: Added.
1596         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
1597         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
1598         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
1599         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
1600         (WebCore::StreamingTextDecoderICU::convertUTF16):
1601         (WebCore::StreamingTextDecoderICU::convertIfASCII):
1602         (WebCore::StreamingTextDecoderICU::createICUConverter):
1603         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
1604         (WebCore::StreamingTextDecoderICU::convertUsingICU):
1605         (WebCore::StreamingTextDecoderICU::convert):
1606         (WebCore::StreamingTextDecoderICU::toUnicode):
1607         (WebCore::StreamingTextDecoderICU::fromUnicode):
1608         * platform/StreamingTextDecoderICU.h: Added.
1609         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
1610         supported by the decoder; minor cleanup.
1611
1612         * platform/TextEncoding.cpp:
1613         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
1614         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
1615         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
1616         
1617         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
1618
1619         * platform/mac/StreamingTextDecoderMac.cpp: Added.
1620         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
1621         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
1622         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
1623         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
1624         (WebCore::StreamingTextDecoderMac::convertUTF16):
1625         (WebCore::StreamingTextDecoderMac::convertIfASCII):
1626         (WebCore::StreamingTextDecoderMac::createTECConverter):
1627         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
1628         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
1629         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
1630         (WebCore::StreamingTextDecoderMac::convert):
1631         (WebCore::StreamingTextDecoderMac::toUnicode):
1632         (WebCore::StreamingTextDecoderMac::fromUnicode):
1633         * platform/mac/StreamingTextDecoderMac.h: Added.
1634         (WebCore::StreamingTextDecoderMac::convert):
1635         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
1636
1637         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
1638
1639         * WebCore.xcodeproj/project.pbxproj:
1640
1641 === Safari-521.17 ===
1642
1643 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1644
1645         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
1646
1647         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
1648         DOMEventTarget protocol that works with GCC 5412.
1649
1650         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
1651
1652         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
1653         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
1654
1655         * WebCore.xcodeproj/project.pbxproj:
1656         * bindings/objc/DOMCore.h:
1657         * bindings/objc/DOMEvents.h:
1658         * bridge/mac/FormDataMac.h:
1659         * bridge/mac/WebCoreAXObject.h:
1660         * bridge/mac/WebCoreCache.h:
1661         * bridge/mac/WebCoreEncodings.h:
1662         * bridge/mac/WebCoreFrameBridge.h:
1663         * bridge/mac/WebCoreFrameNamespaces.h:
1664         * bridge/mac/WebCoreJavaScript.h:
1665         * bridge/mac/WebCorePageBridge.h:
1666         * bridge/mac/WebCorePageState.h:
1667         * bridge/mac/WebCoreResourceLoader.h:
1668         * bridge/mac/WebCoreScriptDebugger.h:
1669         * bridge/mac/WebCoreSettings.h:
1670         * bridge/mac/WebCoreStringTruncator.h:
1671         * bridge/mac/WebCoreStringTruncator.mm:
1672         * bridge/mac/WebCoreTextDecoder.h:
1673         * bridge/mac/WebDashboardRegion.h:
1674         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
1675         * platform/mac/CookieJar.mm:
1676         * platform/mac/DeprecatedStringMac.mm:
1677         * platform/mac/FontDataMac.mm:
1678         * platform/mac/FoundationExtras.h:
1679         * platform/mac/TextBoundaries.mm:
1680         * platform/mac/WebCoreHistory.h:
1681         * platform/mac/WebCoreHistory.m:
1682         * platform/mac/WebCoreKeyGenerator.h:
1683         * platform/mac/WebCoreTextArea.h:
1684         * platform/mac/WebCoreTextField.h:
1685         * platform/mac/WebCoreTextRenderer.h:
1686         * platform/mac/WebCoreView.h:
1687         * platform/mac/WebCoreWidgetHolder.h:
1688
1689 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1690
1691         Reviewed by Maciej.
1692
1693         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
1694         JavaScriptCore.
1695
1696         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
1697         manual delete.
1698
1699 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
1700
1701         Reviewed by Adele and Justin.
1702
1703         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
1704         <rdar://problem/4613948>
1705         REGRESSION: Check Spelling does not work in textarea elements
1706         
1707         * bridge/mac/FrameMac.mm:
1708         (WebCore::FrameMac::advanceToNextMisspelling):
1709         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
1710         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
1711         indices respectively.
1712         
1713         * dom/Range.cpp:
1714         (WebCore::Range::checkNodeBA):
1715         Allow range operations on shadow trees.
1716
1717         * manual-tests/form-element-spelling.html: Added.
1718
1719 2006-07-14  Beth Dakin  <bdakin@apple.com>
1720
1721         Reviewed by Hyatt.
1722
1723         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
1724         WebCore::FrameView::updateOverflowStatus
1725
1726         m_viewportRenderer is never initialized for framesets, and it 
1727         shouldn't be. So we just need to nil-check for it in 
1728         updateOverflowStatus() and return early.
1729
1730         * page/FrameView.cpp:
1731         (WebCore::FrameView::updateOverflowStatus): Nil check.
1732
1733 2006-07-14  Adele Peterson  <adele@apple.com>
1734
1735         RS by Darin.
1736
1737         Backing out fix for <rdar://problem/4604703> 
1738         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1739
1740         Darin had a better fix in WebKit for this.
1741
1742         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1743
1744 2006-07-14  Adele Peterson  <adele@apple.com>
1745
1746         Reviewed by Darin.
1747
1748         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
1749
1750         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
1751         * bridge/mac/FrameMac.h: ditto.
1752         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
1753         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
1754         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
1755         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
1756
1757 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1758
1759         Reviewed by Darin.
1760
1761         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
1762           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
1763
1764         * rendering/RenderText.cpp:
1765         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
1766         position.
1767
1768 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1769
1770         Reviewed by Darin.
1771
1772         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
1773           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
1774
1775         Test: editing/deleting/delete-at-start-or-end.html
1776
1777         * editing/TypingCommand.cpp:
1778         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
1779         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1780
1781 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
1782
1783         Reviewed by Geoffrey.
1784
1785         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
1786           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
1787
1788         No test cases since there is no change in functionality.
1789
1790         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1791         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
1792         no-argument getNumber() method.
1793
1794 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
1795
1796         Reviewed by Adele.
1797
1798         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
1799         one surrounding this function, and the nested one makes the compiler
1800         think our local variable is volatile (seems like a compiler bug to me).
1801         
1802         * bridge/mac/FrameMac.mm:
1803         (WebCore::FrameMac::sendContextMenuEvent):
1804
1805 2006-07-14  Timothy Hatcher  <timothy@apple.com>
1806
1807         Reviewed by Maciej.
1808
1809         Make JavaScriptCore a public framework. Adjusted the paths.
1810
1811         * WebCore.xcodeproj/project.pbxproj:
1812
1813 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
1814
1815         Reviewed by Hyatt.
1816
1817         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
1818         
1819         I also fixed all the similar crash / assertion failure cases I could think of.
1820
1821         * dom/Node.cpp:
1822         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
1823         * dom/Node.h:
1824         * rendering/RenderTable.cpp:
1825         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
1826         an HTML document, since we don't need that quirk and because parsing won't
1827         do certain render tree fixups. Also watch out for case when inserting before
1828         the renderer of a misnested child.
1829         * rendering/RenderTableRow.cpp:
1830         (WebCore::RenderTableRow::addChild): ditto
1831         * rendering/RenderTableSection.cpp:
1832         (WebCore::RenderTableSection::addChild): ditto
1833
1834 2006-07-13  Adele Peterson  <adele@apple.com>
1835
1836         Reviewed by Maciej.
1837
1838         - Fix for <rdar://problem/4604703> 
1839         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
1840
1841         Test:
1842         * manual-tests/password-ctrl-click-lose-focus.html: Added.
1843
1844         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
1845         If we're about to set a selection in the current view, make sure its the first responder.
1846         In this case, this will cause the password field to resign first responder at the right time.
1847
1848 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1849
1850         Reviewed by Hyatt.
1851
1852         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
1853           REGRESSION: RTL white-space:pre-wrap text is offset to the right
1854
1855         Test: fast/text/international/rtl-white-space-pre-wrap.html
1856
1857         * rendering/RenderText.cpp:
1858         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
1859         of clipping the caret position to the text box when the caret is after
1860         the trailing space of an autowrapped line.
1861         * rendering/bidi.cpp:
1862         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
1863         to-fit the logically last text box if it contains the trailing spaces of an
1864         autowrapped line. 
1865         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
1866         In the case of autowrapped text with white space that overflows beyond the line,
1867         the last text run is the one containing the overflowing white space.
1868         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
1869         line that autowraps only after white space into a separate text run.
1870
1871 2006-07-13  David Harrison  <harrison@apple.com>
1872
1873         Reviewed by Dave Hyatt.
1874
1875         <rdar://problem/4624203> -webkit-highlight should be behind images
1876
1877         * rendering/RenderImage.cpp:
1878         (WebCore::RenderImage::paint):
1879         * rendering/RenderListMarker.cpp:
1880         (WebCore::RenderListMarker::paint):
1881         * rendering/RenderWidget.cpp:
1882         (WebCore::RenderWidget::paint):
1883         Call custom highlighter before painting the image, marker, or widget.
1884
1885 2006-07-13  David Harrison  <harrison@apple.com>
1886
1887         Reviewed by Justin and Levi.
1888
1889         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
1890
1891         * Tests:
1892         editing/deleting/delete-by-word-001.html
1893         editing/deleting/delete-by-word-002.html
1894
1895         * editing/TypingCommand.cpp:
1896         (WebCore::TypingCommand::deleteKeyPressed):
1897         (WebCore::TypingCommand::forwardDeleteKeyPressed):
1898         (WebCore::TypingCommand::doApply):
1899         * editing/TypingCommand.h:
1900         Delete and forward delete to use specified granularity.
1901         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
1902         
1903         * page/Frame.cpp:
1904         (WebCore::Frame::setSelection):
1905         Close typing and end style even if selection is not changing.
1906         * page/Frame.h:
1907         Remove unused setSelection parameter keepTypingStyle.
1908
1909 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
1910
1911         Reviewed by justin
1912
1913         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
1914
1915         * editing/DeleteSelectionCommand.cpp:
1916         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
1917         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
1918         instead of enclosingBlockFlowElement.
1919         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
1920         when the start or end block is removed.
1921         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
1922         to keep things like HRs from being given children.
1923         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
1924         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
1925         * editing/TypingCommand.cpp:
1926         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
1927         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
1928         * editing/htmlediting.cpp:
1929         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
1930         * editing/visible_units.cpp:
1931         (WebCore::startOfParagraph): Fix for HRs and tables.
1932         (WebCore::endOfParagraph): Ditto.
1933
1934 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
1935
1936         Reviewed by Darin.
1937
1938         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
1939           Memory leaks running DOM-Hanoi
1940
1941         No change in behavior, thus no test included.
1942
1943         * bridge/mac/FrameMac.mm:
1944         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
1945         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
1946
1947 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1948
1949         Reviewed by Adele.
1950
1951         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
1952           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
1953         - see also <rdar://problem/4622407>
1954
1955         Test: fast/frames/repaint-display-none-crash.html
1956
1957         * rendering/RenderView.cpp:
1958         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
1959         renderer, which can be null if the iframe is set to display:none.
1960
1961 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
1962
1963         Reviewed by levi
1964         
1965         <rdar://problem/4509393>
1966         selected DOM range starts with <object>, 0 offset but selection should include the <object>
1967
1968         * editing/ReplaceSelectionCommand.cpp:
1969         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
1970         Don't pull content out of a table cell.
1971         * editing/htmlediting.cpp:
1972         (WebCore::editingIgnoresContent): Added <select> nodes.
1973         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
1974         for more types of nodes.
1975         * rendering/RenderContainer.cpp:
1976         (WebCore::RenderContainer::positionForCoordinates): 
1977         Fix a crasher when right clicking on an anonymous table.
1978
1979 2006-07-12  John Sullivan  <sullivan@apple.com>
1980
1981         Reviewed by Brady Eidson
1982         
1983         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
1984         misspelled words (WebCore::RenderObject::repaint(bool)
1985
1986         * dom/Document.cpp:
1987         (WebCore::Document::removeMarkers):
1988         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
1989         happening. One of the cases like this was fixed a while back, but other cases were
1990         either missed at that time or crept in since. 
1991
1992 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
1993
1994         Reviewed by Justin.
1995
1996         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
1997         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
1998         
1999         * dom/Document.cpp:
2000         (WebCore::Document::updateSelection):
2001         Don't return early if the selection is empty.
2002
2003 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2004
2005         Reviewed by Adele.
2006
2007         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
2008         
2009         * bridge/mac/FrameMac.mm:
2010         (WebCore::FrameMac::dispatchCPPEvent):
2011         If the element is a shadow node, dispatch the event to its real parent.
2012
2013         * manual-tests/textarea-onpaste.html: Added.
2014
2015 2006-07-12  Beth Dakin  <bdakin@apple.com>
2016
2017         Reviewed by Anders.
2018
2019         Fix for layout test regressions after my check-in last night. Just 
2020         a silly mistake where I should have asked if we were NOT printing 
2021         instead of if we were in the listbox code.
2022
2023         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
2024         XCode 2.3
2025         * platform/mac/ListBoxMac.mm:
2026         (itemTextRenderer): Inverted check.
2027         (groupLabelTextRenderer): Inverted check.
2028
2029 2006-07-12  Darin Adler  <darin@apple.com>
2030
2031         Reviewed by Maciej.
2032
2033         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
2034           <rdar://problem/4622622>
2035           REGRESSION: Large rowspan causes WebKit to call abort()
2036
2037         Test: fast/table/large-rowspan-crash.html
2038
2039         * rendering/RenderTableSection.cpp:
2040         (WebCore::RenderTableSection::ensureRows):
2041         Use sizeof(RowStruct) instead of sizeof(int).
2042         Clearly we'll need something better to solve this completely.
2043         I expect another smaller, but still huge, value will still cause a problem.
2044
2045 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2046
2047         Reviewed by Maciej.
2048
2049         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2050
2051         * bridge/mac/FrameMac.h:
2052         Add focusCallResultedInViewBeingCreated argument. 
2053         
2054         * bridge/mac/FrameMac.mm:
2055         (WebCore::FrameMac::nextKeyViewInFrame):
2056         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2057         
2058         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2059         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2060         a text field as the first responder if its field editor already is the current first responder.
2061         
2062         * page/FrameView.cpp:
2063         (WebCore::FrameView::handleMousePressEvent):
2064         In some cases, get the event target node again after dispatching the mouse event.
2065
2066 2006-07-12  Beth Dakin  <bdakin@apple.com>
2067
2068         Reviewed by Adele.
2069
2070         Fix for <rdar://problem/4615765> Input[type='search' fields 
2071         initially render too large in Widgets
2072
2073         Fundamentally, the problem here is that we were miscalculating 
2074         things because [NSGraphicsContext currentContextDrawingToScreen] 
2075         was evaluating to false when widgets first load. We only ever used 
2076         this check, however, to determine if we were printing or not, so it 
2077         should not have evaluated to false for loading in Dashbaord. 
2078         Instead, if we query the RenderView about whether or not we are 
2079         printing, we will get the right answer.
2080
2081         No test case added since this appears only to affect Dashboard.
2082
2083         * bridge/mac/WebCoreFrameBridge.mm:
2084         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2085         printing instead. This is not part of the actual bug fix, but it 
2086         seems wise to get rid of all calls to [NSGraphicsContext 
2087         currentContextDrawingToScreen] when we are just trying to determine 
2088         if we are printing or not.
2089         * platform/mac/ListBoxMac.mm:
2090         (itemTextRenderer):This function now takes a boolean, isPrinting.
2091         (groupLabelTextRenderer): Same as above.
2092         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2093         printing.
2094         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2095         * platform/mac/PopUpButtonMac.mm:
2096         (PopUpButton::sizeHint): Same as above.
2097         * platform/mac/TextFieldMac.mm:
2098         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2099         * rendering/RenderLineEdit.cpp: Same as above.
2100
2101 2006-07-12  Adele Peterson  <adele@apple.com>
2102
2103         Reviewed by Maciej.
2104
2105         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2106         OPTION text can paint over select element's scrollbar
2107
2108         Test: fast/forms/option-text-clip.html
2109
2110         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2111         When calculating the clip to apply to the button text, also consider padding.
2112         In the future, we may have separate renderers for the text part, and the arrow part
2113         of the control, and then the separation should be natural.  For now, we use padding.
2114
2115 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2116
2117         Windows build fix.  Reviewed by NOBODY.
2118
2119         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2120         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2121
2122 2006-07-11  Darin Adler  <darin@apple.com>
2123
2124         Reviewed by Adele.
2125
2126         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2127           <rdar://problem/4619515>
2128           focus ring fails to appear on select element after choosing item from popup
2129
2130         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2131           improvements to select element, including some storage leak fixes
2132
2133         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2134         reference for the list items, so we don't have to copy a vector.
2135         * html/HTMLSelectElement.cpp:
2136         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2137         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2138         (WebCore::HTMLSelectElement::length): Ditto.
2139         (WebCore::HTMLSelectElement::remove): Ditto.
2140         (WebCore::HTMLSelectElement::value): Ditto.
2141         (WebCore::HTMLSelectElement::setValue): Ditto.
2142         (WebCore::HTMLSelectElement::stateValue): Ditto.
2143         (WebCore::HTMLSelectElement::restoreState): Ditto.
2144         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2145         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2146         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2147         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2148         fields mutable.
2149         (WebCore::HTMLSelectElement::reset): Use a const reference for
2150         the list items, so we don't have to copy the vector. Remove the call to
2151         setSelectionChanged for the RenderMenuList case.
2152         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2153         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2154         the pop-up.
2155         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2156         Changed the listItems function to return a const reference to the vector so
2157         it no longer copies the vector. Removed the const_cast to the call to
2158         recalcListItems and changed it to a const member function. Made m_recalcListItems
2159         mutable.
2160         * rendering/DeprecatedRenderSelect.cpp:
2161         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2162         to recalcListItems, which is called automatically. Use a const reference for the
2163         list items so we don't have to copy a vector.
2164         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2165         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2166         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2167         * rendering/RenderMenuList.cpp:
2168         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2169         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2170         (WebCore::RenderMenuList::addChild): Ditto.
2171         (WebCore::RenderMenuList::removeChild): Ditto.
2172         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2173         on the pop-up menu, because it's created with the correct style and destroyed
2174         before it a style change could occur.
2175         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2176         maximum width in a simpler fashion, and to not bother trying to maintain
2177         the "selected" flags on the elements, since the HTMLSelectElement class
2178         takes care of that. Store the width as an int. Call setText to set the text
2179         based on the selected element's option text.
2180         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2181         up the clip -- always set up the clip.
2182         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2183         instead of calling ceilf on m_longestWidth.
2184         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2185         menu -- instead keep the pointer in a local variable. Get the selected
2186         index from the HTMLSelectElement.
2187         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2188         to do most of the work.
2189         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2190         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2191         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2192         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2193         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2194         hasPopupMenu functions. Removed extra includes.
2195         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2196         Change to iterate the list items instead of iterating all children
2197         of the select node.
2198         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2199         * rendering/RenderPopupMenuMac.mm:
2200         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2201         the pop-up here from the caller. Removed an extra retain that would cause
2202         the NSPopUpButtonCell to leak.
2203         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2204         create the pop-up, which is now in populate, and also the call to the
2205         clear function, for the same reason. Reorganized code to make it a bit
2206         more readable. Removed an unnecessary if to check if frame is nil.
2207         Used a RefPtr to make sure we don't make a call on a frame after it's
2208         deleted. As part of the reorganization fixed a problem where we'd retain
2209         the event and then return early without releasing it in one case.
2210         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2211         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2212         manage the NSMenu at the bottom of the function.
2213         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2214
2215 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2216
2217         Reviewed by levi
2218         
2219         <rdar://problem/4620686>
2220         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2221
2222         * bridge/mac/FrameMac.mm:
2223         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2224         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2225         
2226
2227 2006-07-11  Tim Omernick  <timo@apple.com>
2228
2229         Reviewed by NOBODY (build fix)
2230
2231         * bindings/objc/DOMPrivate.h:
2232         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2233         there is of a different type.
2234         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2235         before landing.
2236
2237 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2238
2239         Reviewed by Geoff.
2240
2241         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2242         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2243         
2244         * html/HTMLTokenizer.cpp:
2245         (WebCore::HTMLTokenizer::scriptHandler):
2246         Don't load external scripts if the parser is stopped.
2247         
2248         * manual-tests/open-close-tokenizer-crash.html: Added.
2249         * manual-tests/resources/empty-file.js: Added.
2250         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2251         Add manual test.
2252
2253 2006-07-11  John Sullivan  <sullivan@apple.com>
2254
2255         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2256
2257         - added support for creating a selection image with white text
2258
2259         * rendering/RenderObject.h:
2260         (WebCore::):
2261         add PaintRestriction enum
2262         (WebCore::RenderObject::PaintInfo::PaintInfo):
2263         add forceWhiteText boolean to PaintInfo struct
2264
2265         * page/FramePrivate.h:
2266         (WebCore::FramePrivate::FramePrivate):
2267         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2268         text to white
2269
2270         * page/Frame.cpp:
2271         (WebCore::Frame::paint):
2272         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2273
2274         * bridge/mac/FrameMac.h:
2275         * bridge/mac/FrameMac.mm:
2276         (WebCore::FrameMac::selectionImage):
2277         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2278
2279         * bridge/mac/WebCoreFrameBridge.h:
2280         * bridge/mac/WebCoreFrameBridge.mm:
2281         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2282         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2283         down into Frame
2284
2285         * rendering/RenderLayer.h:
2286         * rendering/RenderLayer.cpp:
2287         (WebCore::RenderLayer::paint):
2288         use a PaintRestriction value where we used to use a selectionOnly bool
2289         (WebCore::RenderLayer::paintLayer):
2290         ditto; also stores forceWhiteText in PaintInfo struct
2291
2292         * kcanvas/KCanvasResources.cpp:
2293         (WebCore::KCanvasMarker::draw):
2294         updated for changed signature of PaintInfo constructor
2295
2296         * ksvg2/svg/SVGMaskElement.cpp:
2297         (WebCore::SVGMaskElement::drawMaskerContent):
2298         ditto
2299
2300         * ksvg2/svg/SVGPatternElement.cpp:
2301         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2302         ditto
2303
2304         * rendering/InlineTextBox.cpp:
2305         (WebCore::InlineTextBox::paint):
2306         paint with white text color if forceWhiteText is set in PaintInfo struct
2307
2308 2006-07-11  Tim Omernick  <timo@apple.com>
2309
2310         Reviewed by Anders.
2311
2312         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2313         Give Netscape plug-ins access to their own DOM element
2314
2315         * html/HTMLPlugInElement.h:
2316         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2317         Changed __APPLE__ to PLATFORM(MAC).
2318         Added m_NPObject ivar.
2319         * html/HTMLPlugInElement.cpp:
2320         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2321         Initialize the NPObject.
2322         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2323         Release the NPObject when the element is destroyed.
2324         (WebCore::HTMLPlugInElement::createNPObject):
2325         Creates an NPObject for the element.
2326         (WebCore::HTMLPlugInElement::getNPObject):
2327         Returns the NPObject for the element, creating and caching it if necessary.
2328
2329         * html/HTMLAppletElement.h:
2330         Changed __APPLE__ to PLATFORM(MAC).
2331         * html/HTMLAppletElement.cpp:
2332         ditto
2333         * html/HTMLEmbedElement.h:
2334         ditto
2335         * html/HTMLEmbedElement.cpp:
2336         ditto
2337         * html/HTMLObjectElement.h:
2338         ditto
2339         * html/HTMLObjectElement.cpp:
2340         ditto
2341
2342         * bindings/objc/DOMPrivate.h:
2343         Added -[DOMElement _NPObject].
2344
2345         * bindings/objc/DOM.mm:
2346         (-[DOMElement _NPObject]):
2347         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
2348         the NPObject for applet, embed, and object elements.
2349         
2350 2006-07-11  Adele Peterson  <adele@apple.com>
2351
2352         Reviewed by Hyatt.
2353
2354         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
2355         REGRESSION: Can't dynamically change list box to popup
2356         
2357         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2358         REGRESSION: Can't dynamically change popup to list box
2359
2360         The original fix for 9859 was in the renderer, and I think we can catch the change
2361         earlier in the element to detach and reattach.
2362
2363         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
2364
2365         Test: fast/forms/select-change-listbox-to-popup.html
2366
2367         * html/HTMLSelectElement.cpp:
2368         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
2369         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
2370         when we attach.
2371         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
2372         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
2373         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
2374         (WebCore::HTMLSelectElement::createRenderer): ditto.
2375         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
2376         (WebCore::HTMLSelectElement::reset): ditto.
2377         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
2378         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
2379
2380         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
2381         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
2382         to determine whether or not to use the new menu list implementation.
2383
2384         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
2385         * rendering/DeprecatedRenderSelect.cpp:
2386         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
2387         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
2388         (WebCore::DeprecatedRenderSelect::updateFromElement):
2389         (WebCore::DeprecatedRenderSelect::baselinePosition):
2390         (WebCore::DeprecatedRenderSelect::layout):
2391         (WebCore::DeprecatedRenderSelect::updateSelection):
2392
2393         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2394         Backed out previous fix since this is now done in HTMLSelectElement.
2395
2396 2006-07-11  Adele Peterson  <adele@apple.com>
2397
2398         Reviewed by Hyatt.
2399
2400         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
2401         REGRESSION: Can't dynamically change popup to list box
2402
2403         Test: fast/forms/select-change-popup-to-listbox.html
2404
2405         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
2406         If the select element has the multiple property set, or has a size > 1, then it
2407         really should be a list box, so we detach and attach the element so it creates the
2408         correct type of renderer.
2409
2410 2006-07-11  John Sullivan  <sullivan@apple.com>
2411
2412         Reviewed by Beth Dakin and Tim Omernick
2413
2414         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
2415         at non-integral scale factors
2416
2417         * bridge/mac/FrameMac.mm:
2418         (WebCore::FrameMac::imageFromRect):
2419         round image rect in window coordinate space
2420
2421 2006-07-10  Darin Adler  <darin@apple.com>
2422
2423         Reviewed by Geoff.
2424
2425         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
2426           rdar://problem/4619572
2427           OPTION text contained in OPTGROUP appears at the wrong size
2428
2429         * dom/Node.h:
2430         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
2431         The derived classes were overriding with const member functions, and I could
2432         change either this or the derived -- decided to do this.
2433
2434 2006-07-10  Darin Adler  <darin@apple.com>
2435
2436         Reviewed by Geoff.
2437
2438         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
2439           rdar://problem/4619534
2440           OPTGROUP label text is using the default font instead of Lucida Grande
2441
2442         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
2443         Code wants the family name, but was calling fontName, which is not the same thing.
2444         Also removed the unneeded conversion to DeprecatedString.
2445
2446 === Safari-521.16 ===
2447
2448 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
2449
2450         Reviewed by Darin.
2451
2452         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
2453           Implement select.options.add() method
2454
2455         Tests:
2456         - fast/dom/select-selectedIndex-multiple.html
2457         - fast/dom/select-selectedIndex.html
2458         - fast/js/select-options-add.html
2459
2460         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
2461         * ForwardingHeaders/kjs/operations.h: Added.
2462         * WebCore.xcodeproj/project.pbxproj: Added new source files.
2463         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
2464         (WebCore::JSHTMLOptionsCollection::length):
2465         (WebCore::JSHTMLOptionsCollection::setLength):
2466         (WebCore::JSHTMLOptionsCollection::indexSetter):
2467         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
2468         Renamed classes and methods for consistency.
2469         (KJS::JSHTMLElement::selectGetter):
2470         (KJS::JSHTMLElement::put):
2471         (KJS::JSHTMLElement::selectSetter):
2472         (KJS::JSHTMLCollection::JSHTMLCollection):
2473         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
2474         (KJS::getHTMLOptionsCollection):
2475         * bindings/js/kjs_html.h: Ditto.
2476         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
2477         Added support for Optional parameter attribute, which makes generated code assume overloaded
2478         implementation methods are available for a JavaScript function with optional arguments.  Changed
2479         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
2480         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
2481         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
2482         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
2483         (WebCore::HTMLOptionsCollection::add):
2484         (WebCore::HTMLOptionsCollection::selectedIndex):
2485         (WebCore::HTMLOptionsCollection::setSelectedIndex):
2486         (WebCore::HTMLOptionsCollection::setLength):
2487         * html/HTMLOptionsCollection.h: Ditto.
2488         * html/HTMLOptionsCollection.idl: Added.
2489
2490 2006-07-10  David Harrison  <harrison@apple.com>
2491
2492         Reviewed by Dave Hyatt.
2493
2494         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
2495
2496         * rendering/RenderBox.cpp:
2497         (WebCore::RenderBox::paintCustomHighlight):
2498         * rendering/RenderBox.h:
2499         Utility for subclasses.
2500         
2501         * rendering/RenderImage.cpp:
2502         (WebCore::RenderImage::paint):
2503         Custom highlight in front of images.
2504         
2505         * rendering/RenderListMarker.cpp:
2506         (WebCore::RenderListMarker::paint):
2507         Custom highlight in front of list markers.
2508
2509         * rendering/RenderWidget.cpp:
2510         (WebCore::RenderWidget::paint):
2511         Custom highlight in front of objects.
2512
2513 2006-07-10  David Hyatt  <hyatt@apple.com>
2514
2515         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
2516         correctly after choosing Redo Typing
2517
2518         Better fix for repainting issue with positioned objects when height
2519         changes.  Optimize when only a positioned child changes so that we don't
2520         incorrectly do normal flow layout.
2521
2522         Reviewed by darin
2523
2524         * WebCore.xcodeproj/project.pbxproj:
2525         * rendering/RenderBlock.cpp:
2526         (WebCore::RenderBlock::layoutBlock):
2527         * rendering/RenderFlexibleBox.cpp:
2528         (WebCore::RenderFlexibleBox::layoutBlock):
2529         * rendering/RenderTable.cpp:
2530         (WebCore::RenderTable::layout):
2531         * rendering/RenderView.cpp:
2532         (WebCore::RenderView::layout):
2533         * rendering/bidi.cpp:
2534         (WebCore::RenderBlock::layoutInlineChildren):
2535
2536 2006-07-10  Adele Peterson  <adele@apple.com>
2537
2538         Reviewed by Beth.
2539
2540         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
2541
2542         Test: fast/forms/select-style.html
2543
2544         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
2545         Don't let popups be style-able for now.  We'll allow it later, when we
2546         have a good way to handle border & backgrounds and still having it look like a control.
2547
2548 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
2549
2550         Reviewed by harrison
2551         
2552         <rdar://problem/4619260>
2553         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2554         <rdar://problem/4619841>
2555         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
2556
2557         * WebCore.xcodeproj/project.pbxproj:
2558         * editing/Selection.cpp:
2559         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
2560         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
2561         Migrate to isEditablePosition instead of isContentEditable.
2562         
2563
2564 2006-07-10  Beth Dakin  <bdakin@apple.com>
2565
2566         Reviewed by Adele.
2567
2568         Shuffling comments around from my last check-in to make things read 
2569         more clearly.
2570
2571         * page/DOMWindow.h:
2572         * page/DOMWindow.idl:
2573
2574 2006-07-10  Beth Dakin  <bdakin@apple.com>
2575
2576         Reviewed by Darin.
2577
2578         Fix for <rdar://problem/4621095> The should be a way to 
2579         access the user interface scale factor through the DOM
2580
2581         window.devicePixelRatio returns the user interface scale factor.
2582
2583         * page/DOMWindow.cpp:
2584         (WebCore::DOMWindow::devicePixelRatio):
2585         * page/DOMWindow.h:
2586         * page/DOMWindow.idl:
2587
2588 2006-07-10  Brady Eidson  <beidson@apple.com>
2589
2590         Reviewed by Alexey
2591
2592         Resolved the console error messages people got from the new DB even if they didn't have it enabled
2593
2594         * icon/IconDatabase.cpp:
2595         (WebCore::IconDatabase::pruneUnreferencedIcons):
2596         (WebCore::IconDatabase::pruneUnretainedIcons):
2597         Added quick check to bail if the DB isn't open
2598
2599 2006-07-10  David Harrison  <harrison@apple.com>
2600
2601         Reviewed by Tim Hatcher
2602
2603         Partial fix for...
2604         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
2605         
2606         * editing/Selection.cpp:
2607         (WebCore::Selection::adjustForEditableContent):
2608         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
2609
2610 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2611
2612         Reviewed by Darin.
2613
2614         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
2615           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
2616
2617         * manual-tests/ATSU-bad-layout.html: Added.
2618         * platform/mac/FontMac.mm:
2619         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
2620
2621 2006-07-10  Darin Adler  <darin@apple.com>
2622
2623         - try to fix the no-SVG build
2624
2625         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
2626
2627 2006-07-10  Darin Adler  <darin@apple.com>
2628
2629         Reviewed by Anders.
2630
2631         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
2632           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
2633
2634         * manual-tests/empty-title-popup.html: Added.
2635
2636         * rendering/RenderMenuList.h: Add createInnerBlock.
2637         * rendering/RenderMenuList.cpp:
2638         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
2639         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
2640         (WebCore::RenderMenuList::setText): Changed parameter type.
2641         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
2642         the parent class's addChild.
2643
2644 2006-07-10  Rob Buis  <buis@kde.org>
2645
2646         Reviewed by Maciej via IRC.
2647
2648         Make sure the attributes are calculated against viewport width value,
2649         as defined in the spec.  http://paste.lisp.org/display/22342
2650
2651         * ksvg2/svg/SVGEllipseElement.cpp:
2652         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
2653         * ksvg2/svg/SVGLineElement.cpp:
2654         (SVGLineElement::x2): Ditto.
2655
2656 2006-07-10  Beth Dakin  <bdakin@apple.com>
2657
2658         Reviewed by Maciej.
2659
2660         Fix for <rdar://problem/4610314> Support the CSS3 content property 
2661         for images
2662
2663         This patch provides initial support for the CSS3 content property. 
2664         It lacks support for any content other than images, and only allows 
2665         content for elements that seemed safe for now.
2666
2667         * css/cssstyleselector.cpp:
2668         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
2669         just :before and :after
2670         * html/HTMLBRElement.cpp:
2671         (WebCore::HTMLBRElement::createRenderer):
2672         * html/HTMLFrameSetElement.cpp:
2673         (WebCore::HTMLFrameSetElement::createRenderer):
2674         * html/HTMLImageElement.cpp:
2675         (WebCore::HTMLImageElement::createRenderer):
2676         * html/HTMLLegendElement.cpp:
2677         (WebCore::HTMLLegendElement::createRenderer):
2678         * rendering/RenderImage.cpp:
2679         (WebCore::RenderImage::RenderImage):
2680         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
2681         set this way if it was already set with the content property.
2682         * rendering/RenderImage.h:
2683         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
2684         those set through the content property.
2685         (WebCore::RenderImage::isAnonymousImage):
2686         * rendering/RenderObject.cpp:
2687         (WebCore::RenderObject::createObject): If there is content 
2688         specified, create a RenderImage with the content and initialize the 
2689         cached image to whatever was specified in the CSS.
2690
2691 2006-07-10  Brady Eidson  <beidson@apple.com>
2692
2693         Reviewed by NOBODY (Build Fix!)
2694
2695         * icon/SiteIcon.cpp:
2696         (SiteIcon::getImage):
2697         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
2698
2699 2006-07-10  Brady Eidson  <beidson@apple.com>
2700
2701         Reviewed by Maciej
2702
2703         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
2704         information out to keep down disk usage.  For now, it is still off by default, as the critical
2705         feature of importing old icons into the new DB is still unrealized.
2706         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
2707
2708         * icon/IconDatabase.cpp:
2709         (WebCore::IconDatabase::IconDatabase):
2710         (WebCore::IconDatabase::open):
2711           -Sets up a timer for initial pruning
2712         (WebCore::IconDatabase::iconForPageURL):
2713           -Switched away from "dirty blob hack" as the problem is provisionally solved
2714         (WebCore::IconDatabase::retainIconForURL):
2715         (WebCore::IconDatabase::releaseIconForURL):
2716           -Same as found in WebKit
2717         (WebCore::IconDatabase::totalRetainCountForIconURL):
2718           -Adds up all retainers of icon
2719         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
2720           -Wipes an Icon table entry out
2721         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
2722         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
2723         (WebCore::IconDatabase::establishIconIDForIconURL):
2724         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
2725           -Added ability to get an iconID without creating a new one if a lookup is all
2726            that is genuinely wanted
2727         (WebCore::IconDatabase::pruneUnreferencedIcons):
2728         (WebCore::IconDatabase::pruneUnretainedIcons):
2729           -Called on a timer on DB startup to clean it out
2730         * icon/IconDatabase.h:
2731         * icon/SiteIcon.cpp:
2732         (SiteIcon::SiteIcon):
2733         (SiteIcon::~SiteIcon):
2734           -Deletes the image on deletion
2735         (SiteIcon::getImage):
2736           -Cut down on no-longer-necessary debug info
2737
2738 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
2739
2740         Reviewed by Adele.
2741
2742         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
2743         Quirksmode: Incorrect handling of disabled BUTTON elements
2744
2745         * html/HTMLButtonElement.cpp:
2746         (WebCore::HTMLButtonElement::defaultEventHandler):
2747         Don't call prepareSubmit if the element is disabled.
2748
2749         * html/HTMLInputElement.cpp:
2750         (WebCore::HTMLInputElement::defaultEventHandler):
2751         Don't call prepareSubmit if the element is disabled.
2752
2753 2006-07-10  Darin Adler  <darin@apple.com>
2754
2755         - try to fix Windows build
2756
2757         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
2758         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
2759
2760 2006-07-10  Darin Adler  <darin@apple.com>
2761
2762         Reviewed by Geoff.
2763
2764         - fix failures seen in layout tests
2765
2766         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
2767         that really needed to be there -- because we have two classes named JSHTMLDocument
2768         at the moment! (One in KJS and one in WebCore namespace.)
2769
2770 2006-07-10  Darin Adler  <darin@apple.com>
2771
2772         - try to fix Windows build
2773
2774         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
2775
2776 2006-07-09  Adele Peterson  <adele@apple.com>
2777
2778         Reviewed by Maciej.
2779
2780         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
2781
2782         * css/html4.css: Added style for new selects, and for list boxes.
2783         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
2784    
2785         * rendering/RenderMenuList.cpp:
2786         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
2787         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
2788         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
2789
2790         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
2791         so RenderThemeMac will compute its baseline.
2792         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
2793         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
2794         Removed sizeOfArrowControl. 
2795         * rendering/RenderThemeMac.mm:
2796         (WebCore::): Added enum for padding.
2797         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
2798         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
2799         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
2800         (WebCore::RenderThemeMac::popupButtonSizes): Added.
2801         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
2802         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
2803         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
2804         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
2805         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
2806         (WebCore::RenderThemeMac::minimumTextSize): Added.
2807
2808 2006-07-09  Darin Adler  <darin@apple.com>
2809
2810         - add back "unused code" for plain text fields, still used by <isindex>!
2811
2812         * platform/TextField.h:
2813         * platform/mac/TextFieldMac.mm:
2814         * platform/mac/WebCoreTextField.h:
2815         * platform/mac/WebCoreTextField.mm:
2816         * rendering/RenderLineEdit.cpp:
2817
2818 2006-07-09  Darin Adler  <darin@apple.com>
2819
2820         Reviewed by Tim Hatcher.
2821
2822         - put more into the WebCore namespace
2823         - removed unused code for plain text fields
2824
2825         Put more classes, class templates, enums, functions, and constants into
2826         the WebCore namespace, including all the headers in the platform directory.
2827
2828         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
2829
2830         Added some "WebCore::" qualifiers in a few places.
2831
2832         Removed "uses WebCore::" in headers that we said we'd remove "when
2833         everything is in the WebCore namespace".
2834
2835         * bindings/js/JSDOMParser.cpp:
2836         * bindings/js/JSHTMLElementWrapperFactory.cpp:
2837         * bindings/js/JSXSLTProcessor.cpp:
2838         * bindings/js/kjs_binding.cpp:
2839         * bindings/js/kjs_css.cpp:
2840         * bindings/js/kjs_dom.cpp:
2841         * bindings/js/kjs_dom.h:
2842         * bindings/js/kjs_events.cpp:
2843         * bindings/js/kjs_proxy.h:
2844         * bindings/js/kjs_window.h:
2845         * bindings/objc/DOM.mm:
2846         * bridge/History.h:
2847         * bridge/JavaAppletWidget.h:
2848         * bridge/mac/FormDataMac.h:
2849         * bridge/mac/FormDataMac.mm:
2850         * bridge/mac/WebCoreAXObject.mm:
2851         * bridge/mac/WebCoreEncodings.mm:
2852         * bridge/mac/WebCoreFrameBridge.h:
2853         * bridge/mac/WebCoreIconDatabaseBridge.mm:
2854         * bridge/mac/WebCorePageState.h:
2855         * bridge/mac/WebCoreScriptDebugger.mm:
2856         * bridge/mac/WebCoreSettings.h:
2857         * css/CSSGrammar.y:
2858         * css/CSSPageRule.cpp:
2859         * css/CSSPageRule.h:
2860         * css/MediaList.cpp:
2861         * css/cssstyleselector.h:
2862         * dom/Clipboard.h:
2863         * dom/Document.cpp:
2864         * dom/Document.h:
2865         * dom/EventTargetNode.h:
2866         * dom/Node.cpp:
2867         * dom/Node.h:
2868         * dom/Position.h:
2869         * dom/Range.cpp:
2870         * dom/XMLTokenizer.cpp:
2871         * editing/AppendNodeCommand.h:
2872         * editing/ApplyStyleCommand.cpp:
2873         * editing/BreakBlockquoteCommand.cpp:
2874         * editing/BreakBlockquoteCommand.h:
2875         * editing/CompositeEditCommand.cpp:
2876         * editing/CompositeEditCommand.h:
2877         * editing/CreateLinkCommand.h:
2878         * editing/DeleteFromTextNodeCommand.h:
2879         * editing/DeleteSelectionCommand.h:
2880         * editing/FormatBlockCommand.h:
2881         * editing/HTMLInterchange.cpp:
2882         * editing/HTMLInterchange.h:
2883         * editing/IndentOutdentCommand.h:
2884         * editing/InsertIntoTextNodeCommand.h:
2885         * editing/InsertLineBreakCommand.h:
2886         * editing/InsertListCommand.h:
2887         * editing/InsertNodeBeforeCommand.h:
2888         * editing/InsertTextCommand.cpp:
2889         * editing/InsertTextCommand.h:
2890         * editing/JSEditor.cpp:
2891         * editing/JSEditor.h:
2892         * editing/JoinTextNodesCommand.h:
2893         * editing/MergeIdenticalElementsCommand.cpp:
2894         * editing/MergeIdenticalElementsCommand.h:
2895         * editing/ModifySelectionListLevel.h:
2896         * editing/MoveSelectionCommand.h:
2897         * editing/RebalanceWhitespaceCommand.h:
2898         * editing/RemoveNodeAttributeCommand.h:
2899         * editing/RemoveNodeCommand.h:
2900         * editing/RemoveNodePreservingChildrenCommand.h:
2901         * editing/ReplaceSelectionCommand.h:
2902         * editing/SetNodeAttributeCommand.h:
2903         * editing/SplitElementCommand.cpp:
2904         * editing/SplitElementCommand.h:
2905         * editing/SplitTextNodeCommand.cpp:
2906         * editing/SplitTextNodeCommand.h:
2907         * editing/SplitTextNodeContainingElementCommand.h:
2908         * editing/TypingCommand.cpp:
2909         * editing/TypingCommand.h:
2910         * editing/UnlinkCommand.h:
2911         * editing/VisiblePosition.cpp:
2912         * editing/WrapContentsInDummySpanCommand.cpp:
2913         * editing/WrapContentsInDummySpanCommand.h:
2914         * editing/markup.cpp:
2915         * editing/markup.h:
2916         * html/HTMLAnchorElement.cpp:
2917         * html/HTMLBodyElement.cpp:
2918         * html/HTMLButtonElement.h:
2919         * html/HTMLCollection.h:
2920         * html/HTMLDocument.h:
2921         * html/HTMLEmbedElement.cpp:
2922         * html/HTMLFormElement.cpp:
2923         * html/HTMLFormElement.h:
2924         * html/HTMLFrameElement.cpp:
2925         * html/HTMLFrameSetElement.cpp:
2926         * html/HTMLKeygenElement.cpp:
2927         * html/HTMLLabelElement.cpp:
2928         * html/HTMLObjectElement.cpp:
2929         * html/HTMLObjectElement.h:
2930         * html/HTMLTableElement.cpp:
2931         * html/HTMLTablePartElement.cpp:
2932         * icon/IconDatabase.h:
2933         * kcanvas/KCanvasPath.h:
2934         * kcanvas/KCanvasResources.cpp:
2935         * kcanvas/KCanvasResources.h:
2936         * kcanvas/KCanvasTreeDebug.cpp:
2937         * kcanvas/KCanvasTreeDebug.h:
2938         * kcanvas/RenderSVGContainer.cpp:
2939         * kcanvas/RenderSVGText.h:
2940         * kcanvas/device/KRenderingPaintServer.h:
2941         * kcanvas/device/KRenderingPaintServerGradient.h:
2942         * kcanvas/device/KRenderingPaintServerSolid.cpp:
2943         * ksvg2/misc/SVGImageLoader.cpp:
2944         * ksvg2/svg/SVGElement.cpp:
2945         * ksvg2/svg/SVGElement.h:
2946         * ksvg2/svg/SVGForeignObjectElement.cpp:
2947         * ksvg2/svg/SVGForeignObjectElement.h:
2948         * ksvg2/svg/SVGImageElement.cpp:
2949         * ksvg2/svg/SVGPoint.h:
2950         * ksvg2/svg/SVGStylable.h:
2951         * ksvg2/svg/SVGTRefElement.cpp:
2952         * ksvg2/svg/SVGTRefElement.h:
2953         * ksvg2/svg/SVGTSpanElement.cpp:
2954         * ksvg2/svg/SVGTSpanElement.h:
2955         * ksvg2/svg/SVGTextElement.h:
2956         * ksvg2/svg/svgpathparser.cpp:
2957         * ksvg2/svg/svgpathparser.h:
2958         * loader/Cache.h:
2959         * loader/DocLoader.h:
2960         * loader/LoaderFunctions.h:
2961         * loader/mac/LoaderFunctionsMac.mm:
2962         * page/Frame.h:
2963         * page/FrameView.h:
2964         * page/Page.h:
2965         * page/Settings.h:
2966         * platform/AffineTransform.cpp:
2967         * platform/AffineTransform.h:
2968         * platform/Arena.cpp:
2969         * platform/Arena.h:
2970         * platform/CookieJar.h:
2971         * platform/DeprecatedCString.cpp:
2972         * platform/DeprecatedCString.h:
2973         * platform/DeprecatedPtrList.h:
2974         * platform/DeprecatedPtrListImpl.cpp:
2975         * platform/DeprecatedPtrListImpl.h:
2976         * platform/DeprecatedPtrQueue.h:
2977         * platform/DeprecatedString.cpp:
2978         * platform/DeprecatedString.h:
2979         * platform/DeprecatedStringList.cpp:
2980         * platform/DeprecatedStringList.h:
2981         * platform/DeprecatedValueList.h:
2982         * platform/DeprecatedValueListImpl.cpp:
2983         * platform/DeprecatedValueListImpl.h:
2984         * platform/FileButton.h:
2985         * platform/FloatPoint.h:
2986         * platform/FloatRect.h:
2987         * platform/FloatSize.h:
2988         * platform/FontData.h:
2989         * platform/FontFallbackList.h:
2990         * platform/GraphicsContext.h:
2991         * platform/IntPoint.h:
2992         * platform/IntRect.h:
2993         * platform/IntSize.h:
2994         * platform/KURL.cpp:
2995         * platform/KURL.h:
2996         * platform/ListBox.h:
2997         * platform/Logging.cpp:
2998         * platform/Logging.h:
2999         * platform/Pen.h:
3000         * platform/PopUpButton.h:
3001         * platform/RegularExpression.cpp:
3002         * platform/RegularExpression.h:
3003         * platform/SSLKeyGenerator.h:
3004         * platform/ScrollBar.h:
3005         * platform/SegmentedString.h:
3006         * platform/Shared.h:
3007         * platform/Slider.h:
3008         * platform/StringImpl.h:
3009         * platform/TextBox.h:
3010         * platform/TextField.h:
3011         * platform/TextStream.cpp:
3012         * platform/TextStream.h:
3013         * platform/TransferJob.h:
3014         * platform/TransferJobClient.h:
3015         * platform/Widget.h:
3016         * platform/cg/AffineTransformCG.cpp:
3017         * platform/mac/ClipboardMac.h:
3018         * platform/mac/ClipboardMac.mm:
3019         * platform/mac/DeprecatedStringListMac.mm:
3020         * platform/mac/FontCacheMac.mm:
3021         * platform/mac/KURLMac.mm:
3022         * platform/mac/ListBoxMac.mm:
3023         * platform/mac/PopUpButtonMac.mm:
3024         * platform/mac/SSLKeyGeneratorMac.mm:
3025         * platform/mac/TextBoxMac.mm:
3026         * platform/mac/TextFieldMac.mm:
3027         * platform/mac/WebCoreTextArea.h:
3028         * platform/mac/WebCoreTextArea.mm:
3029         * platform/mac/WebCoreTextField.h:
3030         * platform/mac/WebCoreTextField.mm:
3031         * rendering/DeprecatedRenderSelect.h:
3032         * rendering/RenderArena.cpp:
3033         * rendering/RenderArena.h:
3034         * rendering/RenderBlock.cpp:
3035         * rendering/RenderBox.cpp:
3036         * rendering/RenderContainer.cpp:
3037         * rendering/RenderFlexibleBox.cpp:
3038         * rendering/RenderFlow.cpp:
3039         * rendering/RenderLayer.cpp:
3040         * rendering/RenderLineEdit.cpp:
3041         * rendering/RenderObject.h:
3042         * rendering/RenderStyle.cpp:
3043         * rendering/RenderStyle.h:
3044         * rendering/RenderText.cpp:
3045         * rendering/RenderTextFragment.cpp:
3046         * rendering/RenderTheme.h:
3047         * rendering/RenderTreeAsText.cpp:
3048         * rendering/RenderTreeAsText.h:
3049         * rendering/RenderView.h:
3050         * rendering/bidi.h:
3051         * xml/XSLStyleSheet.cpp:
3052         * xml/XSLTProcessor.cpp:
3053
3054 2006-07-09  Geoffrey Garen  <ggaren@apple.com>
3055
3056         Reviewed by Beth.
3057
3058         * bindings/js/kjs_window.cpp:
3059         (KJS::Window::clear): Garbage collect after reinitalizing the global
3060         object, not before, since the reinitialization tends to create garbage.
3061
3062 2006-07-09  Timothy Hatcher  <timothy@apple.com>
3063
3064         Reviewed by Darin.
3065
3066         Bug 9820: Move new DOM API that has been through API review to public headers
3067         http://bugzilla.opendarwin.org/show_bug.cgi?id=9820
3068
3069         * bindings/objc/DOM.mm:
3070         (-[DOMElement focus]):
3071         (-[DOMElement blur]):
3072         (-[DOMRange text]):
3073         (-[DOMRange _text]):
3074         * bindings/objc/DOMCSS.mm:
3075         (-[DOMRGBColor color]):
3076         (-[DOMRGBColor _color]):
3077         * bindings/objc/DOMCore.h:
3078         * bindings/objc/DOMEvents.h:
3079         * bindings/objc/DOMExtensions.h:
3080         * bindings/objc/DOMHTML.mm:
3081         (-[DOMHTMLElement titleDisplayString]):
3082         (-[DOMHTMLDocument createDocumentFragmentWithMarkupString:baseURL:]):
3083         (-[DOMHTMLDocument createDocumentFragmentWithText:]):
3084         (-[DOMHTMLDocument _createDocumentFragmentWithMarkupString:baseURLString:]):
3085         (-[DOMHTMLDocument _createDocumentFragmentWithText:]):
3086         * bindings/objc/DOMPrivate.h:
3087         * bindings/objc/DOMXPath.h:
3088         * bindings/objc/DOMXPath.mm:
3089
3090 2006-07-09  Beth Dakin  <bdakin@apple.com>
3091
3092         Reviewed by Maciej.
3093
3094         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9749 A 
3095         nested content editable div causes unnecessary screen redraws.
3096         
3097         We were repainting too much because we were deciding that we needed 
3098         a full layout because we didn't have a first line box. Our code 
3099         used to hold a lot of assumptions that positioned elements would 
3100         always have line boxes, but I fixed a few bugs a while back that 
3101         appeared because this assumption isn't true. This assumption was 
3102         also causing the extra redraws because the check meant that we 
3103         would decide to do a full layout for any positioned element that 
3104         did not have any line boxes in the first place. Maciej and I talked 
3105         about this, and we couldn't figure out why the check for line boxes 
3106         was part of determining if we need a full layout in the first 
3107         place. After hunting around the code, we decided to assume that 
3108         this check is antiquated. Removing it fixes the bug and doesn't 
3109         seem to break any layout tests. So, fingers crossed!
3110
3111         Will add layout test so soon.
3112
3113         * rendering/bidi.cpp:
3114         (WebCore::RenderBlock::layoutInlineChildren): Remove firstLineBox 
3115         check.
3116
3117 2006-07-09  David Harrison  <harrison@apple.com>
3118
3119         Reviewed by John Sullivan.
3120
3121         <rdar://problem/4598149> Deleting the contents of a DOMRange and then inserting a node into it crashes in WebCore::Font::canUseGlyphCache
3122
3123         Test: fast/dom/delete-contents.html
3124         
3125         * dom/Range.cpp:
3126         (WebCore::Range::processContents):
3127
3128 2006-07-09  Darin Adler  <darin@apple.com>
3129
3130         - another round of renaming; and KWQ is dead
3131
3132         * WebCore.vcproj/WebCore/WebCore.vcproj: Remove paths for kwq and khtml directories.
3133         Move files to their new locations. Did rename.
3134         * WebCore.xcodeproj/project.pbxproj: Move files to their new locations. Did rename.
3135         * WebCoreSources.bkl: Did rename.
3136         * webcore-base.bkl: Removed kwq.
3137
3138         * kwq/AccessibilityObjectCache.h: Removed.
3139         * kwq/AccessibilityObjectCache.mm: Removed.
3140         * kwq/FormDataMac.h: Removed.
3141         * kwq/FormDataMac.mm: Removed.
3142         * kwq/WebCoreAXObject.h: Removed.
3143         * kwq/WebCoreAXObject.mm: Removed.
3144         * kwq/WebCoreEditCommand.h: Removed.
3145         * kwq/WebCoreEditCommand.mm: Removed.
3146         * kwq/WebCorePageState.h: Removed.
3147         * kwq/WebCorePageState.mm: Removed.
3148         * kwq/WebCoreResourceLoaderImp.h: Removed.
3149         * kwq/WebCoreResourceLoaderImp.mm: Removed.
3150
3151         * bridge/AXObjectCache.h: Added.
3152         * bridge/mac/AXObjectCacheMac.mm: Added.
3153         * bridge/mac/WebCoreAXObject.h: Added.
3154         * bridge/mac/WebCoreAXObject.mm: Added.
3155
3156         * loader/CachedObject.cpp: Removed.
3157         * loader/CachedObject.h: Removed.
3158         * loader/CachedObjectClient.h: Removed.
3159         * loader/CachedObjectClientWalker.cpp: Removed.
3160         * loader/CachedObjectClientWalker.h: Removed.
3161
3162         * loader/CachedResource.cpp: Added.
3163         * loader/CachedResource.h: Added.
3164         * loader/CachedResourceClient.h: Added.
3165         * loader/CachedResourceClientWalker.cpp: Added.
3166         * loader/CachedResourceClientWalker.h: Added.
3167
3168         * bridge/mac/FrameMac.mm:
3169         * bridge/mac/WebCoreFrameBridge.mm:
3170         * css/CSSImageValue.h:
3171         * css/CSSImportRule.h:
3172         * dom/Document.cpp:
3173         * dom/Document.h:
3174         * dom/Notation.h:
3175         * dom/ProcessingInstruction.h:
3176         * dom/XMLTokenizer.cpp:
3177         * html/CanvasPattern.h:
3178         * html/HTMLDocument.h:
3179         * html/HTMLImageLoader.cpp:
3180         * html/HTMLImageLoader.h:
3181         * html/HTMLLinkElement.h:
3182         * html/HTMLScriptElement.cpp:
3183         * html/HTMLScriptElement.h:
3184         * html/HTMLTokenizer.cpp:
3185         * html/HTMLTokenizer.h:
3186         * kcanvas/KCanvasFilters.h:
3187         * ksvg2/svg/SVGCursorElement.cpp:
3188         * ksvg2/svg/SVGCursorElement.h:
3189         * ksvg2/svg/SVGFEImageElement.cpp:
3190         * ksvg2/svg/SVGFEImageElement.h:
3191         * loader/Cache.cpp:
3192         * loader/Cache.h:
3193         * loader/CachedCSSStyleSheet.cpp:
3194         * loader/CachedCSSStyleSheet.h:
3195         * loader/CachedImage.cpp:
3196         * loader/CachedImage.h:
3197         * loader/CachedScript.cpp:
3198         * loader/CachedScript.h:
3199         * loader/CachedXBLDocument.cpp:
3200         * loader/CachedXBLDocument.h:
3201         * loader/CachedXSLStyleSheet.cpp:
3202         * loader/CachedXSLStyleSheet.h:
3203         * loader/DocLoader.cpp:
3204         * loader/DocLoader.h:
3205         * loader/LoaderFunctions.h:
3206         * loader/Request.cpp:
3207         * loader/Request.h:
3208         * loader/loader.cpp:
3209         * loader/loader.h:
3210         * loader/mac/LoaderFunctionsMac.mm:
3211         * page/Frame.cpp:
3212         * page/FrameView.cpp:
3213         * platform/gdk/TemporaryLinkStubs.cpp:
3214         * platform/mac/ClipboardMac.h:
3215         * platform/win/TemporaryLinkStubs.cpp:
3216         * rendering/RenderBox.h:
3217         * rendering/RenderContainer.cpp:
3218         * rendering/RenderImage.cpp:
3219         * rendering/RenderImage.h:
3220         * rendering/RenderLayer.h:
3221         * rendering/RenderObject.cpp:
3222         * rendering/RenderObject.h:
3223         * rendering/RenderStyle.cpp:
3224         * rendering/RenderStyle.h:
3225         * xml/XSLImportRule.h:
3226         Did renaming.
3227
3228         * platform/mac/can-convert.mm: Removed.
3229
3230 2006-07-09  Anders Carlsson  <acarlsson@apple.com>
3231
3232         Reviewed by Tim O.
3233
3234         * WebCore.exp:
3235         Add wkPathFromFont.
3236         
3237         * platform/mac/FontDataMac.mm:
3238         (-[NSFont WebCore]):
3239         Use wkPathFromFont.
3240         
3241         * platform/mac/WebCoreSystemInterface.h:
3242         * platform/mac/WebCoreSystemInterface.mm:
3243         Declare wkPathFromFont.
3244
3245 2006-07-09  Brady Eidson  <beidson@apple.com>
3246
3247         Reviewed by Maciej
3248
3249         Set the stage to remove the workaround for the SQLite BLOB corruption.  A few other small cleanups, and
3250         preparation for pruning unreferenced and unretained icons.
3251
3252         * icon/IconDatabase.cpp:
3253         (WebCore::IconDatabase::recreateDatabase):  Added another trigger to assist in icon removal
3254         (WebCore::IconDatabase::deletePrivateTables):  Cleaned up logging messages
3255         (WebCore::IconDatabase::imageDataForIconID):  #ifdefed the blobbing hack for impending removal, use the real blob by default
3256         (WebCore::IconDatabase::imageDataForIconURL):  same
3257         (WebCore::IconDatabase::imageDataForPageURL):  same
3258         (WebCore::IconDatabase::pruneUnreferencedIcons):  Will delete any icons and their data that are not referenced
3259           by any PageURL
3260         * icon/IconDatabase.h:
3261
3262         * icon/SQLDatabase.h:  Changed BlobAsVector to be unsigned char as thats the most reasonable type for
3263           a byte-buffer, and is what CFData expects
3264         * icon/SQLStatement.cpp:
3265         (WebCore::SQLStatement::getColumnBlobAsVector):
3266
3267 2006-07-09  Darin Adler  <darin@apple.com>
3268
3269         - move all but the last 12 files out of kwq directory
3270         - removed a few unused source files I discovered
3271
3272         * WebCore.vcproj/WebCore/WebCore.vcproj: Update for new file locations.
3273         * WebCore.xcodeproj/project.pbxproj: Ditto.
3274
3275         * bridge/mac/FrameMac.mm:
3276         * dom/Element.h:
3277         * html/HTMLImageLoader.cpp:
3278         * loader/Cache.cpp:
3279         * loader/Cache.h:
3280         * loader/CachedCSSStyleSheet.cpp:
3281         * loader/CachedCSSStyleSheet.h:
3282         * loader/CachedImage.cpp:
3283         * loader/CachedImage.h:
3284         * loader/CachedObject.h:
3285         * loader/CachedScript.cpp:
3286         * loader/CachedScript.h:
3287         * loader/CachedXBLDocument.cpp:
3288         * loader/CachedXBLDocument.h:
3289         * loader/CachedXSLStyleSheet.cpp:
3290         * loader/CachedXSLStyleSheet.h:
3291         * loader/DocLoader.cpp:
3292         * loader/DocLoader.h:
3293         * page/Frame.cpp:
3294         * page/Frame.h:
3295         * page/FramePrivate.h:
3296         * platform/gdk/TemporaryLinkStubs.cpp:
3297         * platform/win/TemporaryLinkStubs.cpp:
3298         * rendering/DeprecatedSlider.cpp:
3299         * rendering/RenderObject.h:
3300         * xml/xmlhttprequest.cpp:
3301         Updated includes as needed for file location changes. Changed
3302         CachePolicy uses to match new filename and enum names.
3303
3304         * loader/CachedResource.cpp: Removed.
3305         * loader/CachedResource.h: Removed.
3306         * loader/CachedResourceClient.h: Removed.
3307         * loader/CachedResourceClientWalker.cpp: Removed.
3308         * loader/CachedResourceClientWalker.h: Removed.
3309         The above files were checked in by accident a while back. The rename of
3310         CachedObject to CachedResource is now reflected in do-webcore-rename,
3311         and will be done soon.
3312
3313         * kwq/AffineTransform.cpp: Removed.
3314         * kwq/AffineTransform.h: Removed.
3315         * kwq/CacheControl.h: Removed.
3316         * kwq/DeprecatedPtrQueue.h: Removed.
3317         * kwq/FileButton.h: Removed.
3318         * kwq/FileButton.mm: Removed.
3319         * kwq/ListBox.h: Removed.
3320         * kwq/ListBox.mm: Removed.
3321         * kwq/LoaderFunctions.h: Removed.
3322         * kwq/LoaderFunctions.mm: Removed.
3323         * kwq/PopUpButton.h: Removed.
3324         * kwq/PopUpButton.mm: Removed.
3325         * kwq/SSLKeyGenerator.h: Removed.
3326         * kwq/SSLKeyGenerator.mm: Removed.
3327         * kwq/Settings.h: Removed.
3328         * kwq/TextBox.h: Removed.
3329         * kwq/TextBox.mm: Removed.
3330         * kwq/TextField.h: Removed.
3331         * kwq/TextField.mm: Removed.
3332         * kwq/WebCoreScrollBar.h: Removed.
3333         * kwq/WebCoreScrollBar.mm: Removed.
3334         * kwq/WebCoreSlider.h: Removed.
3335         * kwq/WebCoreSlider.mm: Removed.
3336
3337         * loader/CachePolicy.h: Added.
3338         * loader/LoaderFunctions.h: Added.
3339
3340         * loader/mac/LoaderFunctionsMac.mm: Added.
3341
3342         * page/Settings.h: Added.
3343
3344         * platform/AffineTransform.cpp: Added.
3345         * platform/AffineTransform.h: Added.
3346         * platform/DeprecatedPtrQueue.h: Added.
3347         * platform/FileButton.h: Added.
3348         * platform/ListBox.h: Added.
3349         * platform/PopUpButton.h: Added.
3350         * platform/SSLKeyGenerator.h: Added.
3351         * platform/ScrollBar.h: Added.
3352         * platform/Slider.h: Added.
3353         * platform/TextBox.h: Added.
3354         * platform/TextField.h: Added.
3355
3356         * platform/cg/AffineTransformCG.cpp: Added.
3357
3358         * platform/mac/FileButtonMac.mm: Added.
3359         * platform/mac/ListBoxMac.mm: Added.
3360         * platform/mac/PopUpButtonMac.mm: Added.
3361         * platform/mac/SSLKeyGeneratorMac.mm: Added.
3362         * platform/mac/ScrollBarMac.mm: Added.
3363         * platform/mac/ScrollBarMac.mm: Added.
3364         * platform/mac/SliderMac.mm: Added.
3365         * platform/mac/SliderMac.mm: Added.
3366         * platform/mac/TextBoxMac.mm: Added.
3367         * platform/mac/TextFieldMac.mm: Added.
3368
3369 2006-07-09  Darin Adler  <darin@apple.com>
3370
3371         - move 4 files out of kwq directory
3372         - make some minor project adjustments for the WebCore project
3373
3374         * WebCore.xcodeproj/project.pbxproj: Link libsqlite3 the same way we do other
3375         libraries, rather than using a custom linker option. Moved the files from their
3376         old locations to the new ones. Removed "khtml" from the list of header search
3377         paths since that directory doesn't exist any more. Eliminated STYLE_LDFLAGS
3378         and just put -umbrella WebKit in OTHER_LDFLAGS in the Production configuration
3379         (was a leftover from "build styles" in Xcode 1). Changed to use EXPORTED_SYMBOLS_FILE
3380         instead of using -exported_symbols_list directly again now that Xcode has fixed the
3381         "strip twice" bug. Removed unneeded explicit SECTORDER_FLAGS = "" settings.
3382         Removed the explicit -Y,3 option now that Xcode does that by default.
3383
3384         * WebCore.vcproj/WebCore/WebCore.vcproj: Removed some obsolete uneeded files,
3385         many of which didn't exist any more. Moved the files from their old locations
3386         to the new ones.
3387
3388         * WebCoreSources.bkl: Moved the files from their old locations to the new ones.
3389
3390         * kwq/DeprecatedCString.cpp: Removed.
3391         * kwq/DeprecatedCString.h: Removed.
3392         * kwq/TextStream.cpp: Removed.
3393         * kwq/TextStream.h: Removed.
3394         * platform/DeprecatedCString.cpp: Added.
3395         * platform/DeprecatedCString.h: Added.
3396         * platform/TextStream.cpp: Added.
3397         * platform/TextStream.h: Added.
3398
3399 2006-07-09  Darin Adler  <darin@apple.com>
3400
3401         Rubber stamped by Maciej (kinda).
3402
3403         - did the next pass of renaming (used do-webcore-rename script)
3404           this takes care of most of the remaining KWQ names (almost all)
3405
3406         * WebCore+SVG/DOMList.h:
3407         * WebCore.vcproj/WebCore/WebCore.vcproj:
3408         * WebCore.xcodeproj/project.pbxproj:
3409         * WebCoreSources.bkl:
3410         * bindings/js/kjs_dom.cpp:
3411         * bindings/js/kjs_window.cpp:
3412         * bindings/objc/DOMHTML.mm:
3413         * bridge/mac/FrameMac.h:
3414         * bridge/mac/FrameMac.mm:
3415         * bridge/mac/WebCoreFrameBridge.mm:
3416         * bridge/mac/WebCoreSettings.h:
3417         * bridge/mac/WebCoreSettings.mm:
3418         * bridge/win/FrameWin.cpp:
3419         * css/CSSPrimitiveValue.cpp:
3420         * css/CSSValueKeywords.in:
3421         * css/MediaQueryEvaluator.cpp:
3422         * css/cssparser.cpp:
3423         * css/cssstyleselector.cpp:
3424         * css/cssstyleselector.h:
3425         * dom/CharacterData.cpp:
3426         * dom/CharacterData.h:
3427         * dom/Document.cpp:
3428         * dom/Element.cpp:
3429         * dom/Element.h:
3430         * dom/EventTargetNode.cpp:
3431         * dom/EventTargetNode.h:
3432         * dom/Node.cpp:
3433         * dom/Node.h:
3434         * dom/Position.cpp:
3435         * dom/ProcessingInstruction.cpp:
3436         * dom/QualifiedName.cpp:
3437         * dom/QualifiedName.h:
3438         * dom/XMLTokenizer.cpp: Added.
3439         * dom/xml_tokenizer.cpp: Removed.
3440         * dom/xml_tokenizer.h: Removed.
3441         * editing/EditAction.h:
3442         * editing/HTMLInterchange.cpp:
3443         * editing/HTMLInterchange.h:
3444         * editing/Selection.h:
3445         * editing/SelectionController.h:
3446         * editing/TextAffinity.h:
3447         * editing/TextIterator.cpp:
3448         * editing/TextIterator.h:
3449         * editing/VisiblePosition.h:
3450         * editing/htmlediting.cpp:
3451         * editing/markup.cpp:
3452         * editing/markup.h:
3453         * editing/visible_units.cpp:
3454         * editing/visible_units.h:
3455         * html/HTMLDocument.cpp:
3456         * html/HTMLFontElement.cpp:
3457         * html/HTMLInputElement.cpp:
3458         * html/HTMLKeygenElement.cpp:
3459         * html/HTMLSelectElement.h:
3460         * html/HTMLTextAreaElement.cpp:
3461         * html/HTMLTextFieldInnerElement.cpp:
3462         * html/HTMLTokenizer.cpp:
3463         * html/HTMLTokenizer.h:
3464         * kcanvas/KCanvasContainer.cpp: Removed.
3465         * kcanvas/KCanvasContainer.h: Removed.
3466         * kcanvas/KCanvasCreator.cpp:
3467         * kcanvas/KCanvasFilters.cpp:
3468         * kcanvas/KCanvasFilters.h:
3469         * kcanvas/KCanvasMatrix.cpp:
3470         * kcanvas/KCanvasMatrix.h:
3471         * kcanvas/KCanvasPath.cpp:
3472         * kcanvas/KCanvasPath.h:
3473         * kcanvas/KCanvasResources.cpp:
3474         * kcanvas/KCanvasResources.h:
3475         * kcanvas/KCanvasTreeDebug.cpp:
3476         * kcanvas/KCanvasTreeDebug.h:
3477         * kcanvas/RenderForeignObject.cpp:
3478         * kcanvas/RenderForeignObject.h:
3479         * kcanvas/RenderPath.cpp:
3480         * kcanvas/RenderPath.h:
3481         * kcanvas/RenderSVGContainer.cpp: Added.
3482         * kcanvas/RenderSVGContainer.h: Added.
3483         * kcanvas/RenderSVGImage.cpp:
3484         * kcanvas/RenderSVGImage.h:
3485         * kcanvas/RenderSVGText.cpp:
3486         * kcanvas/RenderSVGText.h:
3487         * kcanvas/device/KRenderingPaintServer.h:
3488         * kcanvas/device/KRenderingPaintServerGradient.cpp:
3489         * kcanvas/device/KRenderingPaintServerGradient.h:
3490         * kcanvas/device/KRenderingPaintServerPattern.cpp:
3491         * kcanvas/device/KRenderingPaintServerPattern.h:
3492         * kcanvas/device/KRenderingPaintServerSolid.cpp:
3493         * kcanvas/device/KRenderingPaintServerSolid.h:
3494         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
3495         * kcanvas/device/quartz/KCanvasItemQuartz.h:
3496         * kcanvas/device/quartz/KCanvasResourcesQuartz.h:
3497         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
3498         * kcanvas/device/quartz/KRenderingPaintServerGradientQuartz.mm:
3499         * kcanvas/device/quartz/KRenderingPaintServerQuartz.mm:
3500         * ksvg2/css/CSSValueKeywords.in:
3501         * ksvg2/css/SVGRenderStyleDefs.cpp:
3502         * ksvg2/misc/KCanvasRenderingStyle.cpp:
3503         * ksvg2/misc/KSVGTimeScheduler.cpp:
3504         * ksvg2/svg/SVGAElement.cpp:
3505         * ksvg2/svg/SVGAnimateTransformElement.cpp:
3506         * ksvg2/svg/SVGAnimateTransformElement.h:
3507         * ksvg2/svg/SVGGElement.cpp:
3508         * ksvg2/svg/SVGHelper.cpp:
3509         * ksvg2/svg/SVGHelper.h:
3510         * ksvg2/svg/SVGImageElement.cpp:
3511         * ksvg2/svg/SVGLinearGradientElement.cpp:
3512         * ksvg2/svg/SVGMarkerElement.cpp:
3513         * ksvg2/svg/SVGMaskElement.cpp:
3514         * ksvg2/svg/SVGMatrix.cpp:
3515         * ksvg2/svg/SVGMatrix.h:
3516         * ksvg2/svg/SVGPatternElement.cpp:
3517         * ksvg2/svg/SVGRadialGradientElement.cpp:
3518         * ksvg2/svg/SVGSVGElement.cpp:
3519         * ksvg2/svg/SVGStyledElement.h:
3520         * ksvg2/svg/SVGStyledTransformableElement.cpp:
3521         * ksvg2/svg/SVGStyledTransformableElement.h:
3522         * ksvg2/svg/SVGSwitchElement.cpp:
3523         * ksvg2/svg/SVGTextElement.cpp:
3524         * ksvg2/svg/SVGTransformable.h:
3525         * ksvg2/svg/SVGUseElement.cpp:
3526         * kwq/AffineTransform.cpp: Added.
3527         * kwq/AffineTransform.h: Added.
3528         * kwq/DeprecatedCString.cpp: Added.
3529         * kwq/DeprecatedCString.h: Added.
3530         * kwq/DeprecatedPtrQueue.h: Added.
3531         * kwq/FileButton.h: Added.
3532         * kwq/FileButton.mm: Added.
3533         * kwq/FormDataMac.mm: Added.
3534         * kwq/KWQCString.cpp: Removed.
3535         * kwq/KWQCString.h: Removed.
3536         * kwq/KWQComboBox.h: Removed.
3537         * kwq/KWQComboBox.mm: Removed.
3538         * kwq/KWQEditCommand.h: Removed.
3539         * kwq/KWQEditCommand.mm: Removed.
3540         * kwq/KWQFileButton.h: Removed.
3541         * kwq/KWQFileButton.mm: Removed.
3542         * kwq/KWQFormData.h: Removed.
3543         * kwq/KWQFormData.mm: Removed.
3544         * kwq/KWQKHTMLSettings.h: Removed.
3545         * kwq/KWQKIOGlobal.h: Removed.
3546         * kwq/KWQKSSLKeyGen.h: Removed.
3547         * kwq/KWQKSSLKeyGen.mm: Removed.
3548         * kwq/KWQLineEdit.h: Removed.
3549         * kwq/KWQLineEdit.mm: Removed.
3550         * kwq/KWQListBox.h: Removed.
3551         * kwq/KWQListBox.mm: Removed.
3552         * kwq/KWQLoader.h: Removed.
3553         * kwq/KWQLoader.mm: Removed.
3554         * kwq/KWQPageState.h: Removed.
3555         * kwq/KWQPageState.mm: Removed.
3556         * kwq/KWQPtrQueue.h: Removed.
3557         * kwq/KWQResourceLoader.h: Removed.
3558         * kwq/KWQResourceLoader.mm: Removed.
3559         * kwq/KWQScrollBar.h: Removed.
3560         * kwq/KWQScrollBar.mm: Removed.
3561         * kwq/KWQSlider.h: Removed.
3562         * kwq/KWQSlider.mm: Removed.
3563         * kwq/KWQTextEdit.h: Removed.
3564         * kwq/KWQTextEdit.mm: Removed.
3565         * kwq/KWQTextStream.cpp: Removed.
3566         * kwq/KWQTextStream.h: Removed.
3567         * kwq/KWQWMatrix.cpp: Removed.
3568         * kwq/KWQWMatrix.h: Removed.
3569         * kwq/ListBox.h: Added.
3570         * kwq/ListBox.mm: Added.
3571         * kwq/LoaderFunctions.h: Added.
3572         * kwq/LoaderFunctions.mm: Added.
3573         * kwq/PopUpButton.h: Added.
3574         * kwq/PopUpButton.mm: Added.
3575         * kwq/SSLKeyGenerator.h: Added.
3576         * kwq/SSLKeyGenerator.mm: Added.
3577         * kwq/Settings.h: Added.
3578         * kwq/TextBox.h: Added.
3579         * kwq/TextBox.mm: Added.
3580         * kwq/TextField.h: Added.
3581         * kwq/TextField.mm: Added.
3582         * kwq/TextStream.cpp: Added.
3583         * kwq/TextStream.h: Added.
3584         * kwq/WebCoreEditCommand.h: Added.
3585         * kwq/WebCoreEditCommand.mm: Added.
3586         * kwq/WebCorePageState.h: Added.
3587         * kwq/WebCorePageState.mm: Added.
3588         * kwq/WebCoreResourceLoaderImp.h: Added.
3589         * kwq/WebCoreResourceLoaderImp.mm: Added.
3590         * kwq/WebCoreScrollBar.h: Added.
3591         * kwq/WebCoreScrollBar.mm: Added.
3592         * kwq/WebCoreSlider.h: Added.
3593         * kwq/WebCoreSlider.mm: Added.
3594         * loader/Cache.h:
3595         * loader/CachedCSSStyleSheet.cpp:
3596         * loader/CachedImage.cpp:
3597         * loader/CachedObject.h:
3598         * loader/CachedObjectClientWalker.h:
3599         * loader/CachedResource.h:
3600         * loader/CachedResourceClientWalker.h:
3601         * loader/CachedScript.h:
3602         * loader/CachedXBLDocument.h:
3603         * loader/Decoder.h:
3604         * loader/DocLoader.cpp:
3605         * loader/DocLoader.h:
3606         * loader/FormData.h:
3607         * loader/ImageDocument.cpp:
3608         * loader/PluginDocument.cpp:
3609         * loader/TextDocument.cpp:
3610         * loader/loader.cpp:
3611         * loader/loader.h:
3612         * page/Frame.cpp:
3613         * page/Frame.h:
3614         * page/FramePrivate.h:
3615         * page/Page.cpp:
3616         * page/Page.h:
3617         * platform/DeprecatedPtrList.h:
3618         * platform/DeprecatedPtrListImpl.cpp:
3619         * platform/DeprecatedPtrListImpl.h:
3620         * platform/DeprecatedString.cpp:
3621         * platform/DeprecatedString.h:
3622         * platform/DeprecatedStringList.cpp:
3623         * platform/DeprecatedStringList.h:
3624         * platform/DeprecatedValueList.h:
3625         * platform/DeprecatedValueListImpl.cpp:
3626         * platform/DeprecatedValueListImpl.h:
3627         * platform/FloatSize.h:
3628         * platform/Font.cpp:
3629         * platform/KURL.cpp:
3630         * platform/RegularExpression.cpp:
3631         * platform/RegularExpression.h:
3632         * platform/SegmentedString.h:
3633         * platform/StreamingTextDecoder.cpp:
3634         * platform/String.cpp:
3635         * platform/StringImpl.cpp:
3636         * platform/TextEncoding.cpp:
3637         * platform/TransferJob.cpp:
3638         * platform/TransferJob.h:
3639         * platform/TransferJobInternal.h:
3640         * platform/gdk/FrameGdk.cpp:
3641         * platform/gdk/TemporaryLinkStubs.cpp:
3642         * platform/mac/ClipboardMac.h:
3643         * platform/mac/ClipboardMac.mm:
3644         * platform/mac/CursorMac.mm:
3645         * platform/mac/DeprecatedStringMac.mm: Added.
3646         * platform/mac/FontCacheMac.mm:
3647         * platform/mac/FontMac.mm:
3648         * platform/mac/FoundationExtras.h:
3649         * platform/mac/ImageMac.mm:
3650         * platform/mac/KURLMac.mm:
3651         * platform/mac/MouseEventMac.mm: Removed.
3652         * platform/mac/QStringListMac.mm: Removed.
3653         * platform/mac/QStringMac.mm: Removed.
3654         * platform/mac/TransferJobMac.mm:
3655         * platform/mac/WebCoreTextArea.h:
3656         * platform/mac/WebCoreTextArea.mm:
3657         * platform/mac/WebCoreTextField.h:
3658         * platform/mac/WebCoreTextField.mm:
3659         * platform/mac/WidgetMac.mm:
3660         * platform/win/TemporaryLinkStubs.cpp:
3661         * rendering/DataRef.h:
3662         * rendering/DeprecatedRenderSelect.cpp:
3663         * rendering/DeprecatedRenderSelect.h:
3664         * rendering/DeprecatedSlider.cpp:
3665         * rendering/InlineFlowBox.cpp:
3666         * rendering/RenderApplet.cpp:
3667         * rendering/RenderBlock.cpp:
3668         * rendering/RenderBlock.h:
3669         * rendering/RenderContainer.cpp:
3670         * rendering/RenderFileButton.cpp:
3671         * rendering/RenderFlexibleBox.cpp:
3672         * rendering/RenderFlow.cpp:
3673         * rendering/RenderFormElement.cpp:
3674         * rendering/RenderFrameSet.cpp:
3675         * rendering/RenderFrameSet.h:
3676         * rendering/RenderImage.cpp:
3677         * rendering/RenderInline.cpp:
3678         * rendering/RenderLayer.cpp:
3679         * rendering/RenderLayer.h:
3680         * rendering/RenderLineEdit.cpp:
3681         * rendering/RenderListItem.cpp:
3682         * rendering/RenderListMarker.cpp:
3683         * rendering/RenderObject.cpp:
3684         * rendering/RenderObject.h:
3685         * rendering/RenderPartObject.cpp:
3686         * rendering/RenderReplaced.cpp:
3687         * rendering/RenderStyle.cpp: Added.
3688         * rendering/RenderStyle.h: Added.
3689         * rendering/RenderTable.cpp:
3690         * rendering/RenderTable.h:
3691         * rendering/RenderTableCell.cpp:
3692         * rendering/RenderTableCell.h:
3693         * rendering/RenderTableCol.cpp:
3694         * rendering/RenderTableCol.h:
3695         * rendering/RenderTableRow.cpp:
3696         * rendering/RenderTableSection.cpp:
3697         * rendering/RenderTableSection.h:
3698         * rendering/RenderText.cpp:
3699         * rendering/RenderText.h:
3700         * rendering/RenderTextArea.cpp:
3701         * rendering/RenderTextControl.cpp: Added.
3702         * rendering/RenderTextControl.h: Added.
3703         * rendering/RenderTextField.cpp: Removed.
3704         * rendering/RenderTextField.h: Removed.
3705         * rendering/RenderTheme.cpp:
3706         * rendering/RenderThemeMac.mm:
3707         * rendering/RenderTreeAsText.cpp:
3708         * rendering/RenderTreeAsText.h:
3709         * rendering/RenderView.cpp:
3710         * rendering/RenderWidget.cpp:
3711         * rendering/bidi.cpp:
3712         * rendering/render_style.cpp: Removed.
3713         * rendering/render_style.h: Removed.
3714         * xml/XSLStyleSheet.cpp:
3715         * xml/XSLTProcessor.cpp:
3716         * xml/xmlhttprequest.cpp:
3717         * xpath/impl/XPathParser.cpp:
3718
3719 2006-07-09  Rob Buis  <buis@kde.org>
3720
3721         Reviewed by Darin.
3722
3723         http://bugzilla.opendarwin.org/show_bug.cgi?id=8251
3724         navigator.platform incorrect in WebKit.app on Intel Macs
3725
3726         For navigator.platform return "MacIntel" for Intel processors, "MacPPC"
3727         otherwise.
3728
3729         * bindings/js/kjs_navigator.cpp:
3730         (KJS::Navigator::getValueProperty):
3731
3732 2006-07-08  Timothy Hatcher  <timothy@apple.com>
3733
3734         Reviewed by Maciej.
3735
3736         Bug 5312: comments aren't available via DOM
3737         http://bugzilla.opendarwin.org/show_bug.cgi?id=5312
3738
3739         <rdar://problem/4564414> getting comments via DOM isn't working (5312)
3740         <rdar://problem/4545691> DOM_COMMENT node masking out real DOM elements
3741
3742         * dom/Document.cpp:
3743         (WebCore::Document::removedLastRef): set m_documentElement to 0
3744         (WebCore::Document::childrenChanged): invalidate the document element we have cached in case it was replaced
3745         (WebCore::Document::documentElement): cache the first element as the document node if m_documentElement is 0
3746         * dom/Document.h: added m_documentElement
3747         * html/HTMLDocument.cpp: removed documentElement(), HTML documents just use Document's documentElement()
3748         * html/HTMLDocument.h: ditto
3749         * html/HTMLParser.cpp:
3750         (WebCore::HTMLParser::handleError): make a new HTML node is the document's firstChild is NULL or
3751         the firstChild is not a HTML element (like a comment)
3752         * html/HTMLTokenizer.cpp:
3753         (WebCore::HTMLTokenizer::parseComment): removed the #ifdef to include comment nodes
3754
3755 2006-07-08  Anders Carlsson  <acarlsson@apple.com>
3756
3757         Reviewed by Darin, tweaked slightly and landed by Maciej.
3758
3759         http://bugzilla.opendarwin.org/show_bug.cgi?id=9787
3760         fast/frames tests failing (bad pointer to owner element) under MallocScribble
3761         
3762         * html/HTMLFrameElement.cpp:
3763         (WebCore::HTMLFrameElement::close):
3764         Disconnect the owner element of our frame.
3765         
3766         * html/HTMLIFrameElement.cpp:
3767         (WebCore::HTMLIFrameElement::attach):
3768         Don't call setFrame here.
3769         
3770         * html/HTMLPlugInElement.cpp:
3771         (WebCore::HTMLPlugInElement::detach):
3772         Disconnect the owner element of our frame.
3773
3774         * html/HTMLPlugInElement.h:
3775         (WebCore::HTMLPlugInElement::setFrameName):        
3776         New function.
3777         
3778         * page/Frame.cpp:
3779         (WebCore::Frame::Frame):
3780         Don't call setFrame.
3781         
3782         (WebCore::Frame::~Frame):
3783         Null out the owner element.
3784         
3785         (WebCore::Frame::requestObject):
3786         When an object creates a child frame, assign it a name so it can be
3787         accessed from HTMLPlugInElement.
3788         
3789         * rendering/RenderPart.cpp:
3790         (WebCore::RenderPart::RenderPart):
3791         (WebCore::RenderPart::~RenderPart):
3792         * rendering/RenderPart.h:
3793         Get rid of setFrame.
3794
3795 2006-07-08  Darin Adler  <darin@apple.com>
3796
3797         Reviewed by Geoff.
3798
3799         - better fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9622
3800           REGRESSION: showModalDialog returnValue ignored, function result is always "undefined"
3801
3802         * bindings/js/kjs_window.cpp:
3803         (KJS::showModalDialog): Set the return value after returning from the function if the
3804         window is not cleared; this is a better way to handle the case where the window does
3805         not get cleared before returning, and handles some new cases created by slight changes
3806         in the latest Safari properly too.
3807         (KJS::Window::clear): Changed logic slightly so we always store the result of getDirect
3808         into the return value slot -- the old code left the storage untouched if it was 0.
3809         Also made it only overwrite the return value slot if it's 0.
3810
3811         * bindings/js/kjs_proxy.h:
3812         * bindings/js/kjs_proxy.cpp:
3813         * bindings/js/kjs_window.h:
3814         * bindings/js/kjs_window.cpp:
3815         * page/Frame.cpp:
3816         Roll the previous fix out.
3817
3818 2006-07-08  Darin Adler  <darin@apple.com>
3819
3820         - try to fix Windows build
3821
3822         * WebCore.vcproj/WebCore/WebCore.vcproj: Add missing source files.
3823
3824 === Safari-521.15 ===
3825
3826 2006-07-07  Justin Garcia  <justin.garcia@apple.com>
3827
3828         Reviewed by levi
3829         
3830         Fix Mail ToDo crashers.
3831
3832         * dom/Range.cpp:
3833         (WebCore::Range::compareBoundaryPoints): Added an ASSERT that both
3834         containers are non-null and an early return.
3835         * editing/Selection.cpp:
3836         (WebCore::Selection::validate): Fix a dangling start/end.
3837         (WebCore::Selection::adjustForEditableContent): Added an early return if
3838         m_start or m_end are null.
3839         (WebCore::Selection::isContentEditable): Use isRichlyEditablePosition.
3840         (WebCore::Selection::isContentRichlyEditable): Ditto.
3841         * editing/Selection.h:
3842         * editing/VisiblePosition.cpp:
3843         (WebCore::VisiblePosition::next): Use the new highestEditableRoot.
3844         (WebCore::VisiblePosition::previous): Ditto.
3845         * editing/htmlediting.cpp:
3846         (WebCore::highestEditableRoot): Takes in a position.
3847         (WebCore::isEditablePosition): Added.
3848         (WebCore::isRichlyEditablePosition): Added.
3849         (WebCore::rootEditableElement): Added.
3850         (WebCore::nextCandidate): Moved and split out from nextVisiblePosition.
3851         (WebCore::nextVisuallyDistinctCandidate): Ditto.
3852         (WebCore::previousCandidate): Moved and split out from previousVisiblePosition.
3853         (WebCore::previousVisuallyDistinctCandidate): Ditto.
3854         (WebCore::firstEditablePositionAfterPositionInRoot): Iterate over positions,
3855         using nextVisuallyDistinctCandidate, skipping atomic nodes that are non-editable.
3856         (WebCore::lastEditablePositionBeforePositionInRoot): Ditto.
3857         * editing/htmlediting.h:
3858         * editing/visible_units.cpp:
3859         (WebCore::startOfWord): Added a FIXME.
3860
3861 2006-07-07  Levi Weintraub  <lweintraub@apple.com>
3862
3863         Reviewed by justin
3864
3865         Allowed deletion typing commands to take in a granularity
3866
3867         * bridge/mac/WebCoreFrameBridge.h: Pass granularity across the bridge
3868         * bridge/mac/WebCoreFrameBridge.mm: Ditto
3869         (-[WebCoreFrameBridge deleteKeyPressedWithSmartDelete:granularity:]):
3870         (-[WebCoreFrameBridge forwardDeleteKeyPressedWithSmartDelete:granularity:]):
3871         * editing/TypingCommand.cpp: Constructors take in a granularity
3872         (WebCore::TypingCommand::TypingCommand):
3873         (WebCore::TypingCommand::deleteKeyPressed):
3874         (WebCore::TypingCommand::forwardDeleteKeyPressed):
3875         * editing/TypingCommand.h: ditto
3876         * page/Frame.h: Fixed bug that shouldDeleteSelection wasn't virtual
3877
3878 2006-07-07  Brady Eidson  <beidson@apple.com>
3879
3880         Reviewed by Anders and Tim Hatcher
3881
3882         Added an accessor to a SQLite config option to change its disk-syncing behavior.
3883         Used this accessor to significantly speed up writes to the Icon DB.
3884
3885         * icon/IconDatabase.cpp:
3886         (WebCore::IconDatabase::open):  Disable full syncing to the SQLite db to speed up writes to the icondb
3887
3888         * icon/SQLDatabase.cpp:
3889         (SQLDatabase::setFullsync):
3890         (SQLDatabase::setSynchronous):
3891         * icon/SQLDatabase.h:
3892         (WebCore::SQLDatabase::):  Added accessor to the SQLite config pragma "synchronous"
3893
3894 2006-07-07  Darin Adler  <darin@apple.com>
3895
3896         Reviewed by Maciej.
3897
3898         - fixed a storage leak noticed by the buildbot
3899
3900         * dom/Document.cpp: (WebCore::Document::removedLastRef):
3901         Call delete on the markers before clearing the map containing them.
3902
3903 2006-07-08  Anders Carlsson  <acarlsson@apple.com>
3904
3905         Reviewed by Brady.
3906
3907         http://bugzilla.opendarwin.org/show_bug.cgi?id=9777
3908         Reproducible crash in Loading/Frames in ToT.
3909         
3910         The problem was that the renderpart destructor resets the frame's 
3911         owner element. For iframes, this should only be done when the element is 
3912         going to be removed from the document.
3913         
3914         * html/HTMLIFrameElement.cpp:
3915         (WebCore::HTMLIFrameElement::~HTMLIFrameElement):
3916         (WebCore::HTMLIFrameElement::willRemove):
3917         (WebCore::HTMLIFrameElement::removedFromDocument):
3918         (WebCore::HTMLIFrameElement::detach):        
3919         * html/HTMLIFrameElement.h:
3920         Remove the frame in willRemove instead.
3921         
3922         * rendering/RenderPart.cpp:
3923         (WebCore::RenderPart::RenderPart):
3924         (WebCore::RenderPart::~RenderPart):
3925         * rendering/RenderPart.h:
3926         Don't call setFrame(0) in the destructor when the element is an iframe element.
3927
3928 2006-07-07  Darin Adler  <darin@apple.com>
3929
3930         Reviewed by Anders.
3931
3932         - fixed a storage leak noticed by the buildbot
3933
3934         * page/FrameView.cpp: (WebCore::FrameViewPrivate::~FrameViewPrivate):
3935         Delete m_scheduledEvents.
3936
3937 2006-07-07  Darin Adler  <darin@apple.com>
3938
3939         Reviewed by Adele.
3940
3941         - fixed a couple of storage leaks noticed by the buildbot
3942
3943         * html/HTMLOptGroupElement.cpp: (WebCore::HTMLOptGroupElement::attach):
3944         Call deref on the style after calling setRenderStyle, since styleForRenderer
3945         returns us a "ref'd" RenderStyle object.
3946         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::attach): Ditto.
3947
3948 2006-07-07  Darin Adler  <darin@apple.com>
3949
3950         Reviewed by Adele.
3951
3952         - fix some license mistakes
3953
3954         * LICENSE-APPLE: Added more years of publication to the copyright here.
3955
3956         * html/CanvasGradient.idl: Corrected license on this file. It had the wrong one.
3957         * html/CanvasPattern.idl: Ditto.
3958         * html/CanvasRenderingContext2D.idl: Ditto.
3959         * html/HTMLCanvasElement.idl: Ditto.
3960
3961 2006-07-06  Levi Weintraub  <lweintraub@apple.com>
3962
3963         Reviewed by justin
3964
3965         Improved table editing: pressing delete directly before or after a table will now select
3966         the table first, then delete it, instead of just deleting it. Useful for when the table's
3967         existence is non-obvious.
3968
3969         * bridge/mac/FrameMac.h: Added shouldDeleteSelection, which allows WebCore to trigger
3970         deletion editing deligates
3971         * bridge/mac/FrameMac.mm: ditto
3972         (WebCore::FrameMac::shouldDeleteSelection):
3973         * bridge/mac/WebCoreFrameBridge.h: ditto
3974         * editing/TypingCommand.cpp: Implemented check for a caret position next to a table, and
3975         subsequent selection (as opposed to removal)
3976         (WebCore::TypingCommand::deleteKeyPressed):
3977         (WebCore::TypingCommand::forwardDeleteKeyPressed):
3978         * page/Frame.cpp: shouldDeleteSelection added
3979         (WebCore::Frame::shouldDeleteSelection):
3980         * page/Frame.h: ditto
3981
3982 2006-07-07  Sam Weinig  <sam.weinig@gmail.com>
3983
3984         Reviewed by Eric.
3985
3986         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9768
3987           Split XSLImportRule out of XSLStyleSheet.* into separate 
3988           files (one class per file).
3989
3990         * WebCore.xcodeproj/project.pbxproj:
3991         * xml/XSLImportRule.cpp: Added.
3992         (WebCore::XSLImportRule::XSLImportRule):
3993         (WebCore::XSLImportRule::parentStyleSheet):
3994         (WebCore::XSLImportRule::loadSheet):
3995         * xml/XSLImportRule.h: Added.
3996         * xml/XSLStyleSheet.cpp:
3997         * xml/XSLStyleSheet.h:
3998
3999 2006-07-07  Anders Carlsson  <acarlsson@apple.com>
4000
4001         Reviewed by Darin.
4002
4003         http://bugzilla.opendarwin.org/show_bug.cgi?id=8300
4004         REGRESSION: First mouse click is randomly ignored when clicking on checkbox and radio buttons
4005         
4006         * css/html4.css:
4007         Set "-webkit-user-select: ignore" on radio buttons and check boxes .
4008         
4009 2006-07-07  Maciej Stachowiak  <mjs@apple.com>
4010
4011         Reviewed by Tim Hatcher.
4012
4013         - fix 20 Node leaks on fast/events tests - these should be the last ones
4014
4015         * bindings/objc/DOMEvents.mm:
4016         (-[DOMEvent dealloc]): implement - deref the event!
4017         (-[DOMEvent finalize]): ditto
4018
4019 2006-07-06  Maciej Stachowiak  <mjs@apple.com>
4020
4021         Reviewed by Tim Hatcher.
4022
4023         - fix 26 Node leaks on fast/dom tests
4024
4025         * dom/Document.cpp:
4026         (WebCore::Document::removedLastRef): delete tokenizer - if we are still parsing at this point, we don't
4027         want nodes held by the parser to keep the document alive.
4028         * html/HTMLParser.cpp:
4029         (WebCore::RefNonDocNodePtr::RefNonDocNodePtr): Smart pointer that acts like RefPtr for Node,
4030         but avoids refing document nodes to avoid cycles.
4031         (WebCore::RefNonDocNodePtr::~RefNonDocNodePtr):
4032         (WebCore::RefNonDocNodePtr::get):
4033         (WebCore::RefNonDocNodePtr::operator*):
4034         (WebCore::RefNonDocNodePtr::operator->):
4035         (WebCore::RefNonDocNodePtr::operator!):
4036         (WebCore::RefNonDocNodePtr::operator UnspecifiedBoolType):
4037         (WebCore::RefNonDocNodePtr::operator=):
4038         (WebCore::operator==):
4039         (WebCore::operator!=):
4040         (WebCore::HTMLStackElem): Use a RefNonDocNodePtr instead of RefPtr<Node>
4041         (WebCore::HTMLParser::handleResidualStyleCloseTagAcrossBlocks): Use a RefPtr here to avoid crashing
4042
4043 2006-07-06  Adele Peterson  <adele@apple.com>
4044
4045         Reviewed by Maciej.
4046
4047         Fixed new popup control to open up when the spacebar and the up and down arrows are pressed.
4048
4049         - Fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=9762
4050         [Native pop up] Highlighted item text is black instead of white
4051
4052         * html/HTMLSelectElement.cpp:
4053         (WebCore::HTMLSelectElement::isKeyboardFocusable): Added.
4054         (WebCore::HTMLSelectElement::isMouseFocusable): Added.
4055         (WebCore::HTMLSelectElement::defaultEventHandler): Updated to showPopup for up and down arrow keys and spacebar.
4056         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Made this const.
4057         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate): Added FIXME.
4058         * rendering/RenderPopupMenuMac.mm:
4059         (WebCore::RenderPopupMenuMac::showPopup): Updated to save the NSEvent that triggers the popup, so we can send
4060         fake mouseUp and keyUp events when the NSMenu returns.
4061         (WebCore::RenderPopupMenuMac::addGroupLabel): Only set the NSForegroundColorAttributeName attribute if the text isn't black.
4062         Follow-up bug about other colors: http://bugzilla.opendarwin.org/show_bug.cgi?id=9769
4063         (WebCore::RenderPopupMenuMac::addOption): ditto.
4064         * bridge/mac/FrameMac.h: (WebCore::FrameMac::currentEvent): Returns the current NSEvent.
4065
4066 2006-07-06  Justin Garcia  <justin.garcia@apple.com>
4067
4068         Reviewed by levi
4069         
4070         <rdar://problem/4609184>
4071         Mail crashes at WebCore::Selection::adjustForEditableContent
4072         <rdar://problem/4609140>
4073         Crash at WebCore::Range::compareBoundaryPoints
4074         
4075         * editing/Selection.cpp:
4076         (WebCore::Selection::adjustForEditableContent):
4077         * editing/VisiblePosition.cpp:
4078         (WebCore::VisiblePosition::next): Moved code into a helper function.
4079         (WebCore::VisiblePosition::previous): Ditto.
4080         * editing/htmlediting.cpp:
4081         (WebCore::comparePositions): Moved from Selection.cpp.
4082         (WebCore::lowestEditableAncestor): Added.  Returns rootEditableElement
4083         for a node in editable content and the rootEditableElement for the first
4084         ancestor that's editable for a node in non-editable content.
4085         (WebCore::firstEditablePositionAfterPositionInRoot): 
4086         (WebCore::lastEditablePositionBeforePositionInRoot):
4087         * editing/htmlediting.h:
4088
4089 2006-07-06  Anders Carlsson  <acarlsson@apple.com>
4090
4091         Reviewed by Adele.
4092
4093         http://bugzilla.opendarwin.org/show_bug.cgi?id=9528
4094         REGRESSION: arrow key skips '>' in Bugzilla replies due to '\n' in text nodes
4095         
4096         Patch by Darin, tweaked by Anders.
4097         
4098         * html/HTMLElement.cpp:
4099         (WebCore::HTMLElement::setInnerText):
4100         Convert newline characters to <br> elements. I've verified that what's done here is what WinIE does when setting innerText.
4101         
4102         (WebCore::HTMLElement::setOuterText):
4103         Fix comment.
4104
4105         * rendering/RenderTextField.cpp:
4106         (WebCore::RenderTextField::textWithHardLineBreaks):
4107         Remove assert. m_div->firstChild() can be null now because setInnerText doesn't create
4108         text nodes for empty strings anymore.
4109
4110 2006-07-06  Adele Peterson  <adele@apple.com>
4111
4112         Reviewed by Tim Hatcher.
4113
4114         - Speculative fix for <rdar://problem/4605532> unrepro crash at cnn.com after upgrading to 10.4.7 (but happening with 10.4.6 too)
4115
4116         * page/FrameView.cpp: (WebCore::FrameView::layout): Ref's the view during layout, since a recalcStyle could cause the view to be deleted.
4117         If we get back from recalcStyle, and there's only one ref, return early since the the view will be deleted when we exit layout.
4118         * page/FrameView.h: (WebCore::FrameView::hasOneRef): Added.
4119
4120 2006-07-06  Anders Carlsson  <acarlsson@apple.com>
4121
4122         Reviewed by Maciej.
4123
4124         <rdar://problem/4610891> Support overflow events
4125      &