Fix a regression from the TextRun landing. Delete the characters in
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  David Hyatt  <hyatt@apple.com>
2
3         Fix a regression from the TextRun landing.  Delete the characters in
4         the adjustedRun, not the ones in the original run!
5
6         Reviewed by beth
7
8         * platform/mac/FontMac.mm:
9         (WebCore::Font::drawComplexText):
10
11 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
12
13         Reviewed by thatcher, levi
14
15         * editing/ReplaceSelectionCommand.cpp:
16         (WebCore::ReplaceSelectionCommand::doApply):
17         Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
18         position pasted into must be split to avoid block nesting.  We now split unnecessarily
19         some times, but the end merge cleans up for us.
20
21 2006-05-11  David Hyatt  <hyatt@apple.com>
22
23         This patch makes drawHighlightForText a completely cross-platform method
24         implemented by the GraphicsContext.  The platform-specific implementations
25         of the method in the Font class have been eliminated.
26
27         Reviewed by andersca
28
29         * platform/Font.h:
30         * platform/FontData.h:
31         Remove the drawHighlight methods.  Change the selectionRect method in
32         Font to return a FloatRect so that the GraphicsContext can do an accurate
33         fill.
34
35         * platform/GraphicsContext.cpp:
36         (WebCore::GraphicsContext::drawHighlightForText):
37         Implement the drawHighlightFunction in terms of the cross-platform
38         Font selectionRect functions and a new float-based fillRect graphics context
39         function.
40
41         * platform/GraphicsContext.h:
42         * platform/cairo/GraphicsContextCairo.cpp:
43         (WebCore::GraphicsContext::fillRect):
44         * platform/cg/GraphicsContextCG.cpp:
45         (WebCore::GraphicsContext::fillRect):
46         Add the new float-based fillRect function for Cairo and CG.
47
48         * platform/mac/FontData.mm:
49         (WebCore::CG_draw):
50         (WebCore::ATSU_draw):
51         Removed the CG and ATSU drawHighlight methods.  Remove the drawing of
52         the background from the deprecated draw methods (they'll be removed
53         soon).
54
55         * platform/mac/FontMac.mm:
56         (WebCore::Font::selectionRectForText):
57         * platform/win/FontWin.cpp:
58         (WebCore::Font::selectionRectForText):
59         Change selectionRectForText to return a FloatRect instead of an IntRect,
60         so that the GraphicsContext can do a precise fill.
61
62         * rendering/InlineTextBox.cpp:
63         (WebCore::InlineTextBox::selectionRect):
64         (WebCore::InlineTextBox::positionForOffset):
65         Modify the callers who expect an int-based selection rect so that they call
66         enclosingIntRect.
67
68 2006-05-11  Darin Adler  <darin@apple.com>
69
70         Reviewed by Adele.
71
72         - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
73           REGRESSION: focus() on input field selects all text within it
74           (was: cannot select cities on British Rail reservation site)
75
76         Test: fast/forms/double-focus.html
77
78         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
79         Changed to only call setFocusNode, select, and revealSelection
80         if the element is not already focused. Also changed to use return
81         a bit more rather than else.
82
83 2006-05-11  Darin Adler  <darin@apple.com>
84
85         Reviewed by Tim Hatcher (earlier version).
86
87         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
88           use the preprocessor for IDL files
89
90         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
91         driver script, passing "-E" so we only preprocess, "-P" so we don't get
92         "#line" directives, and "-x c++" so we handle both C and C++ comments.
93         Removed the code to eliminate comments since the preprocessor handles that.
94         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
95         updated it to do the same way as above.
96
97 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
98
99         Reviewed by Darin.
100
101         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
102         Add support for mozilla-style node constructors as properties of the window object
103         
104         * DerivedSources.make:
105         * WebCore.xcodeproj/project.pbxproj:
106         Add new generated files.
107         
108         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
109         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
110         * bindings/js/JSHTMLElementWrapperFactory.cpp:
111         (WebCore::createJSWrapper):
112         Specify the KJS namespace for JSHTMLElmement.
113                 
114         * bindings/js/kjs_dom.cpp:
115         (KJS::toJS):
116         Create a WebCore::JSHTMLDocument for document nodes. Also, create
117         JSDocumentFragments for document fragments (instead of plain node objects).
118         
119         * bindings/js/kjs_html.cpp:
120         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
121         (KJS::JSHTMLDocument::JSHTMLDocument):
122         (KJS::JSHTMLDocument::getOwnPropertySlot):
123         Add a prototype for JSHTMLDocument and move all functions there.
124         
125         (KJS::JSHTMLElement::JSHTMLElement):
126         (KJS::JSHTMLElement::getOwnPropertySlot):
127         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
128         
129         (KJS::JSHTMLElement::getValueProperty):
130         (KJS::JSHTMLElement::putValueProperty):
131         Remove title setter and getter. Those are autogenerated now.
132         
133         * bindings/js/kjs_html.h:
134         (KJS::JSHTMLElement::):
135         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
136         
137         * bindings/scripts/CodeGeneratorJS.pm:
138         Always generate a prototype object, regardless of whether the object has any functions or
139         constants.
140         
141         Use the type of generator attributes to determine what constructor to use. This is useful for
142         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
143         
144         * dom/DocumentFragment.idl: Added.        
145         * html/HTMLDocument.idl: Added.
146         * html/HTMLElement.idl: Added.
147         
148         * page/DOMWindow.idl:
149         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
150         an alias for the Document constructor.
151         
152 2006-05-11  David Hyatt  <hyatt@apple.com>
153
154         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
155         make it the new API for Font and GraphicsContext when drawing/measuring
156         text.
157
158         Reviewed by andersca
159
160         * platform/Font.cpp:
161         (WebCore::m_finalRoundingWidth):
162         (WebCore::WidthIterator::advance):
163         (WebCore::WidthIterator::normalizeVoicingMarks):
164         (WebCore::Font::width):
165         (WebCore::Font::canUseGlyphCache):
166         (WebCore::Font::drawSimpleText):
167         (WebCore::Font::drawText):
168         (WebCore::Font::floatWidth):
169         (WebCore::Font::floatWidthForSimpleText):
170         * platform/Font.h:
171         (WebCore::TextRun::m_to):
172         (WebCore::TextRun::operator[]):
173         (WebCore::TextRun::data):
174         (WebCore::TextRun::adjustFrom):
175         (WebCore::TextRun::adjustTo):
176         (WebCore::TextRun::characters):
177         (WebCore::TextRun::length):
178         (WebCore::TextRun::from):
179         (WebCore::TextRun::to):
180         * platform/GraphicsContext.cpp:
181         (WebCore::GraphicsContext::drawText):
182         (WebCore::GraphicsContext::drawHighlightForText):
183         * platform/GraphicsContext.h:
184         * platform/mac/FontMac.mm:
185         (WebCore::addDirectionalOverride):
186         (WebCore::overrideLayoutOperation):
187         (WebCore::ATSULayoutParameters::initialize):
188         (WebCore::Font::selectionRectForText):
189         (WebCore::Font::drawComplexText):
190         (WebCore::Font::drawHighlightForText):
191         (WebCore::Font::floatWidthForComplexText):
192         (WebCore::Font::checkSelectionPoint):
193         * platform/win/FontWin.cpp:
194         (WebCore::hackishExtentForString):
195         (WebCore::Font::floatWidth):
196         (WebCore::Font::drawText):
197         (WebCore::Font::drawHighlightForText):
198         (WebCore::Font::selectionRectForText):
199         (WebCore::Font::checkSelectionPoint):
200         * rendering/InlineTextBox.cpp:
201         (WebCore::InlineTextBox::selectionRect):
202         (WebCore::InlineTextBox::paint):
203         (WebCore::InlineTextBox::paintSelection):
204         (WebCore::InlineTextBox::paintMarkedTextBackground):
205         (WebCore::InlineTextBox::paintTextMatchMarker):
206         (WebCore::InlineTextBox::offsetForPosition):
207         (WebCore::InlineTextBox::positionForOffset):
208         * rendering/RenderBlock.cpp:
209         (WebCore::stripTrailingSpace):
210         * rendering/RenderFlexibleBox.cpp:
211         (WebCore::RenderFlexibleBox::layoutVerticalBox):
212         * rendering/RenderImage.cpp:
213         (WebCore::RenderImage::imageChanged):
214         (WebCore::RenderImage::paint):
215         * rendering/RenderText.cpp:
216         (WebCore::RenderText::cacheWidths):
217         (WebCore::RenderText::widthFromCache):
218         (WebCore::RenderText::trimmedMinMaxWidth):
219         (WebCore::RenderText::calcMinMaxWidth):
220         (WebCore::RenderText::width):
221         * rendering/RenderTextField.cpp:
222         (WebCore::RenderTextField::calcMinMaxWidth):
223         * rendering/bidi.cpp:
224         (WebCore::RenderBlock::tabWidth):
225         (WebCore::RenderBlock::checkLinesForTextOverflow):
226         * rendering/render_line.cpp:
227         (WebCore::EllipsisBox::paint):
228         * rendering/render_list.cpp:
229         (WebCore::RenderListMarker::paint):
230         (WebCore::RenderListMarker::calcMinMaxWidth):
231         (WebCore::RenderListMarker::getRelativeMarkerRect):
232
233 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
234
235         Reviewed by darin
236
237         * editing/ReplaceSelectionCommand.cpp:
238         (WebCore::ReplaceSelectionCommand::doApply):
239         Removed the code to find out if we must later add smart replace whitespace.  We can 
240         wait until we've done the insertion to figure it out, and the position sampled (startPos)
241         to make the decision about trailing whitespace was wrong.
242         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
243         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
244         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
245         whitespace (2 and 3 were reversed because the end merge must happen before we can know
246         whether or not we need to add a trailing space).
247         Don't do an end merge if the last node inserted was a br because the end merge will 
248         clobber it.
249         
250         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
251         brs where [br, 0] is at the end of a block and not at the start of a paragraph
252         are the ones that are collapsed because of quirks mode.
253
254 2006-05-10  David Hyatt  <hyatt@apple.com>
255
256         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
257         Font and make them static methods (inlined in the header).  Make the rounding
258         hack character table a static member as well.  Remove the redundant space/rounding
259         functions from FontData.mm.
260
261         Reviewed by darin
262
263         * platform/Font.cpp:
264         (WebCore::):
265         (WebCore::m_finalRoundingWidth):
266         (WebCore::WidthIterator::advance):
267         * platform/Font.h:
268         (WebCore::Font::treatAsSpace):
269         (WebCore::Font::isRoundingHackCharacter):
270         * platform/mac/FontData.mm:
271         (WebCore::overrideLayoutOperation):
272         (WebCore::createATSULayoutParameters):
273         (WebCore::initializeWidthIterator):
274         (WebCore::advanceWidthIterator):
275         * platform/mac/FontMac.mm:
276         (WebCore::overrideLayoutOperation):
277         (WebCore::ATSULayoutParameters::initialize):
278
279 2006-05-10  Darin Adler  <darin@apple.com>
280
281         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
282
283 >>>>>>> .r14297
284 2006-05-10  David Carson <dacarson@gmail.com>
285
286         - Fix for bug 8833. Removed inline keyword from functions declared
287         in .mm and .cpp files. inline function code needs to reside in the
288         header file for the linker to find the code. 
289         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
290
291         Reviewed by Darin, landed by Timothy.
292
293         * platform/Font.cpp:
294         (WebCore::isSpace):
295         * platform/mac/FontData.mm:
296         (WebCore::widthForGlyph):
297         (WebCore::isRoundingHackCharacter):
298         (WebCore::glyphForCharacter):
299
300 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
301
302         Reviewed and landed by Anders.
303
304         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
305           REGRESSION: Words render on top of each other when fallback font is used
306
307         Already covered by several pixel tests in fast/text
308
309         * platform/Font.cpp:
310         (WebCore::Font::drawSimpleText):
311
312 2006-05-10  David Hyatt  <hyatt@apple.com>
313
314         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
315         drawing and measuring of runs up into the Font class.  The fast code
316         path is in Font.cpp and is designed to be mostly cross-platform.  The
317         slow code path is in FontMac.cpp and is Mac-specific.
318
319         Reviewed by darin
320
321         * WebCore.xcodeproj/project.pbxproj:
322         * platform/Font.cpp:
323         (WebCore::isSpace):
324         (WebCore::):
325         (WebCore::isRoundingHackCharacter):
326         (WebCore::m_finalRoundingWidth):
327         (WebCore::WidthIterator::advance):
328         (WebCore::WidthIterator::normalizeVoicingMarks):
329         (WebCore::Font::primaryFont):
330         (WebCore::Font::setAlwaysUseComplexPath):
331         (WebCore::Font::canUseGlyphCache):
332         (WebCore::Font::drawSimpleText):
333         (WebCore::Font::drawText):
334         (WebCore::Font::floatWidth):
335         (WebCore::Font::floatWidthForSimpleText):
336         * platform/Font.h:
337         * platform/FontData.h:
338         (WebCore::FontData::platformData):
339         * platform/GlyphBuffer.h: Added.
340         (WebCore::GlyphBuffer::GlyphBuffer):
341         (WebCore::GlyphBuffer::isEmpty):
342         (WebCore::GlyphBuffer::size):
343         (WebCore::GlyphBuffer::glyphs):
344         (WebCore::GlyphBuffer::advances):
345         (WebCore::GlyphBuffer::fontDataAt):
346         (WebCore::GlyphBuffer::swap):
347         (WebCore::GlyphBuffer::glyphAt):
348         (WebCore::GlyphBuffer::advanceAt):
349         (WebCore::GlyphBuffer::add):
350         * platform/mac/FontData.mm:
351         (WebCore::isSpace):
352         (WebCore::isRoundingHackCharacter):
353         (WebCore::FontData::widthForGlyph):
354         (WebCore::m_ATSUMirrors):
355         (WebCore::FontData::xHeight):
356         (WebCore::FontData::smallCapsFontData):
357         (WebCore::findSubstituteFont):
358         (WebCore::rendererForAlternateFont):
359         (WebCore::findSubstituteRenderer):
360         (WebCore::FontData::findSubstituteFontData):
361         (WebCore::computeWidthForSpace):
362         (WebCore::FontData::updateGlyphMapEntry):
363         (WebCore::extendGlyphMap):
364         (WebCore::extendWidthMap):
365         (WebCore::createATSULayoutParameters):
366         (WebCore::FontData::glyphForCharacter):
367         (WebCore::advanceWidthIterator):
368         (WebCore::shouldUseATSU):
369         * platform/mac/FontMac.mm:
370         (WebCore::ATSULayoutParameters::m_padPerSpace):
371         (WebCore::addDirectionalOverride):
372         (WebCore::initializeATSUStyle):
373         (WebCore::overrideLayoutOperation):
374         (WebCore::ATSULayoutParameters::initialize):
375         (WebCore::disposeATSULayoutParameters):
376         (WebCore::Font::drawComplexText):
377         (WebCore::Font::floatWidthForComplexText):
378         (WebCore::Font::drawGlyphs):
379         * platform/mac/WebCoreTextRenderer.mm:
380         (WebCoreSetAlwaysUseATSU):
381
382 2006-05-10  Darin Adler  <darin@apple.com>
383
384         - another try at fixing the Windows build
385
386         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
387         instead of unicode().
388
389 == Rolled over to ChangeLog-2006-05-10 ==