1 2006-05-11 David Hyatt <hyatt@apple.com>
3 Remove the misspelling drawing code from Font and FontData. Implement it
4 natively in GraphicContext instead.
9 * platform/GraphicsContext.cpp:
10 * platform/GraphicsContext.h:
11 * platform/cairo/GraphicsContextCairo.cpp:
12 (WebCore::GraphicsContext::drawLineForMisspelling):
13 * platform/mac/FontData.mm:
14 * platform/mac/FontMac.mm:
15 * platform/mac/GraphicsContextMac.mm:
16 (WebCore::GraphicsContext::drawLineForMisspelling):
17 * platform/win/FontWin.cpp:
18 * rendering/InlineTextBox.cpp:
19 (WebCore::InlineTextBox::paintSpellingMarker):
21 2006-05-11 David Hyatt <hyatt@apple.com>
23 Remove drawLineForText from the Font API. Implement it natively in
24 the two GraphicsContexts (CG and Cairo) instead.
29 * platform/FontData.h:
30 * platform/GraphicsContext.cpp:
31 * platform/GraphicsContext.h:
32 * platform/cairo/GraphicsContextCairo.cpp:
33 (WebCore::GraphicsContext::drawLineForText):
34 * platform/cg/GraphicsContextCG.cpp:
35 (WebCore::GraphicsContext::drawLineForText):
36 * platform/mac/FontData.mm:
37 * platform/mac/FontMac.mm:
38 * platform/win/FontWin.cpp:
39 (WebCore::Font::drawLineForText):
40 * rendering/InlineTextBox.cpp:
41 (WebCore::InlineTextBox::paintDecoration):
42 (WebCore::InlineTextBox::paintMarkedTextUnderline):
43 * rendering/render_line.cpp:
44 (WebCore::InlineFlowBox::paintDecorations):
46 2006-05-11 Steve Falkenburg <sfalken@apple.com>
52 * dom/QualifiedName.h:
53 (WebCore::QualifiedName::QualifiedName):
55 2006-05-11 Steve Falkenburg <sfalken@apple.com>
59 Fix crash on static constructors builds at exit due to qualified name default constructor not
62 * dom/QualifiedName.cpp:
63 (WebCore::QualifiedName::deref):
65 2006-05-11 Mitz Pettel <opendarwin.org@mitzpettel.com>
69 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8851
70 REGRESSION: RTL text shifted to the right
72 Already covered by several tests in fast/text
75 (WebCore::TextRun::TextRun): Added length parameter.
76 * rendering/InlineTextBox.cpp: Pass the length to the TextRun constructor.
77 (WebCore::InlineTextBox::selectionRect):
78 (WebCore::InlineTextBox::paint):
79 (WebCore::InlineTextBox::paintSelection):
80 (WebCore::InlineTextBox::paintMarkedTextBackground):
81 (WebCore::InlineTextBox::paintTextMatchMarker):
82 (WebCore::InlineTextBox::offsetForPosition):
83 (WebCore::InlineTextBox::positionForOffset):
84 * rendering/RenderText.cpp:
85 (WebCore::RenderText::widthFromCache): Pass length and from instead of from and to
86 to the TextRun constructor.
87 (WebCore::RenderText::width): Ditto.
89 2006-05-11 David Hyatt <hyatt@apple.com>
91 Fix a regression from the TextRun landing. Delete the characters in
92 the adjustedRun, not the ones in the original run!
96 * platform/mac/FontMac.mm:
97 (WebCore::Font::drawComplexText):
99 2006-05-10 Justin Garcia <justin.garcia@apple.com>
101 Reviewed by thatcher, levi
103 * editing/ReplaceSelectionCommand.cpp:
104 (WebCore::ReplaceSelectionCommand::doApply):
105 Removed a use fragment.hasMoreThanOneBlock to decide if the paragraph containing the
106 position pasted into must be split to avoid block nesting. We now split unnecessarily
107 some times, but the end merge cleans up for us.
109 2006-05-11 David Hyatt <hyatt@apple.com>
111 This patch makes drawHighlightForText a completely cross-platform method
112 implemented by the GraphicsContext. The platform-specific implementations
113 of the method in the Font class have been eliminated.
118 * platform/FontData.h:
119 Remove the drawHighlight methods. Change the selectionRect method in
120 Font to return a FloatRect so that the GraphicsContext can do an accurate
123 * platform/GraphicsContext.cpp:
124 (WebCore::GraphicsContext::drawHighlightForText):
125 Implement the drawHighlightFunction in terms of the cross-platform
126 Font selectionRect functions and a new float-based fillRect graphics context
129 * platform/GraphicsContext.h:
130 * platform/cairo/GraphicsContextCairo.cpp:
131 (WebCore::GraphicsContext::fillRect):
132 * platform/cg/GraphicsContextCG.cpp:
133 (WebCore::GraphicsContext::fillRect):
134 Add the new float-based fillRect function for Cairo and CG.
136 * platform/mac/FontData.mm:
138 (WebCore::ATSU_draw):
139 Removed the CG and ATSU drawHighlight methods. Remove the drawing of
140 the background from the deprecated draw methods (they'll be removed
143 * platform/mac/FontMac.mm:
144 (WebCore::Font::selectionRectForText):
145 * platform/win/FontWin.cpp:
146 (WebCore::Font::selectionRectForText):
147 Change selectionRectForText to return a FloatRect instead of an IntRect,
148 so that the GraphicsContext can do a precise fill.
150 * rendering/InlineTextBox.cpp:
151 (WebCore::InlineTextBox::selectionRect):
152 (WebCore::InlineTextBox::positionForOffset):
153 Modify the callers who expect an int-based selection rect so that they call
156 2006-05-11 Darin Adler <darin@apple.com>
160 - test for http://bugzilla.opendarwin.org/show_bug.cgi?id=8743
161 REGRESSION: focus() on input field selects all text within it
162 (was: cannot select cities on British Rail reservation site)
164 Test: fast/forms/double-focus.html
166 * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::focus):
167 Changed to only call setFocusNode, select, and revealSelection
168 if the element is not already focused. Also changed to use return
169 a bit more rather than else.
171 2006-05-11 Darin Adler <darin@apple.com>
173 Reviewed by Tim Hatcher (earlier version).
175 - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
176 use the preprocessor for IDL files
178 * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
179 driver script, passing "-E" so we only preprocess, "-P" so we don't get
180 "#line" directives, and "-x c++" so we handle both C and C++ comments.
181 Removed the code to eliminate comments since the preprocessor handles that.
182 * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
183 updated it to do the same way as above.
185 2006-05-11 Anders Carlsson <acarlsson@apple.com>
189 http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
190 Add support for mozilla-style node constructors as properties of the window object
192 * DerivedSources.make:
193 * WebCore.xcodeproj/project.pbxproj:
194 Add new generated files.
196 * bindings/js/JSCanvasRenderingContext2DBase.cpp:
197 (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
198 * bindings/js/JSHTMLElementWrapperFactory.cpp:
199 (WebCore::createJSWrapper):
200 Specify the KJS namespace for JSHTMLElmement.
202 * bindings/js/kjs_dom.cpp:
204 Create a WebCore::JSHTMLDocument for document nodes. Also, create
205 JSDocumentFragments for document fragments (instead of plain node objects).
207 * bindings/js/kjs_html.cpp:
208 (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
209 (KJS::JSHTMLDocument::JSHTMLDocument):
210 (KJS::JSHTMLDocument::getOwnPropertySlot):
211 Add a prototype for JSHTMLDocument and move all functions there.
213 (KJS::JSHTMLElement::JSHTMLElement):
214 (KJS::JSHTMLElement::getOwnPropertySlot):
215 Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
217 (KJS::JSHTMLElement::getValueProperty):
218 (KJS::JSHTMLElement::putValueProperty):
219 Remove title setter and getter. Those are autogenerated now.
221 * bindings/js/kjs_html.h:
222 (KJS::JSHTMLElement::):
223 Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
225 * bindings/scripts/CodeGeneratorJS.pm:
226 Always generate a prototype object, regardless of whether the object has any functions or
229 Use the type of generator attributes to determine what constructor to use. This is useful for
230 the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
232 * dom/DocumentFragment.idl: Added.
233 * html/HTMLDocument.idl: Added.
234 * html/HTMLElement.idl: Added.
236 * page/DOMWindow.idl:
237 Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
238 an alias for the Document constructor.
240 2006-05-11 David Hyatt <hyatt@apple.com>
242 Bug 8845. Define a TextRun (similar to the old WebCoreTextRun) and
243 make it the new API for Font and GraphicsContext when drawing/measuring
249 (WebCore::m_finalRoundingWidth):
250 (WebCore::WidthIterator::advance):
251 (WebCore::WidthIterator::normalizeVoicingMarks):
252 (WebCore::Font::width):
253 (WebCore::Font::canUseGlyphCache):
254 (WebCore::Font::drawSimpleText):
255 (WebCore::Font::drawText):
256 (WebCore::Font::floatWidth):
257 (WebCore::Font::floatWidthForSimpleText):
259 (WebCore::TextRun::m_to):
260 (WebCore::TextRun::operator[]):
261 (WebCore::TextRun::data):
262 (WebCore::TextRun::adjustFrom):
263 (WebCore::TextRun::adjustTo):
264 (WebCore::TextRun::characters):
265 (WebCore::TextRun::length):
266 (WebCore::TextRun::from):
267 (WebCore::TextRun::to):
268 * platform/GraphicsContext.cpp:
269 (WebCore::GraphicsContext::drawText):
270 (WebCore::GraphicsContext::drawHighlightForText):
271 * platform/GraphicsContext.h:
272 * platform/mac/FontMac.mm:
273 (WebCore::addDirectionalOverride):
274 (WebCore::overrideLayoutOperation):
275 (WebCore::ATSULayoutParameters::initialize):
276 (WebCore::Font::selectionRectForText):
277 (WebCore::Font::drawComplexText):
278 (WebCore::Font::drawHighlightForText):
279 (WebCore::Font::floatWidthForComplexText):
280 (WebCore::Font::checkSelectionPoint):
281 * platform/win/FontWin.cpp:
282 (WebCore::hackishExtentForString):
283 (WebCore::Font::floatWidth):
284 (WebCore::Font::drawText):
285 (WebCore::Font::drawHighlightForText):
286 (WebCore::Font::selectionRectForText):
287 (WebCore::Font::checkSelectionPoint):
288 * rendering/InlineTextBox.cpp:
289 (WebCore::InlineTextBox::selectionRect):
290 (WebCore::InlineTextBox::paint):
291 (WebCore::InlineTextBox::paintSelection):
292 (WebCore::InlineTextBox::paintMarkedTextBackground):
293 (WebCore::InlineTextBox::paintTextMatchMarker):
294 (WebCore::InlineTextBox::offsetForPosition):
295 (WebCore::InlineTextBox::positionForOffset):
296 * rendering/RenderBlock.cpp:
297 (WebCore::stripTrailingSpace):
298 * rendering/RenderFlexibleBox.cpp:
299 (WebCore::RenderFlexibleBox::layoutVerticalBox):
300 * rendering/RenderImage.cpp:
301 (WebCore::RenderImage::imageChanged):
302 (WebCore::RenderImage::paint):
303 * rendering/RenderText.cpp:
304 (WebCore::RenderText::cacheWidths):
305 (WebCore::RenderText::widthFromCache):
306 (WebCore::RenderText::trimmedMinMaxWidth):
307 (WebCore::RenderText::calcMinMaxWidth):
308 (WebCore::RenderText::width):
309 * rendering/RenderTextField.cpp:
310 (WebCore::RenderTextField::calcMinMaxWidth):
311 * rendering/bidi.cpp:
312 (WebCore::RenderBlock::tabWidth):
313 (WebCore::RenderBlock::checkLinesForTextOverflow):
314 * rendering/render_line.cpp:
315 (WebCore::EllipsisBox::paint):
316 * rendering/render_list.cpp:
317 (WebCore::RenderListMarker::paint):
318 (WebCore::RenderListMarker::calcMinMaxWidth):
319 (WebCore::RenderListMarker::getRelativeMarkerRect):
321 2006-05-10 Justin Garcia <justin.garcia@apple.com>
325 * editing/ReplaceSelectionCommand.cpp:
326 (WebCore::ReplaceSelectionCommand::doApply):
327 Removed the code to find out if we must later add smart replace whitespace. We can
328 wait until we've done the insertion to figure it out, and the position sampled (startPos)
329 to make the decision about trailing whitespace was wrong.
330 Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
331 the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
332 br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
333 whitespace (2 and 3 were reversed because the end merge must happen before we can know
334 whether or not we need to add a trailing space).
335 Don't do an end merge if the last node inserted was a br because the end merge will
338 (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
339 brs where [br, 0] is at the end of a block and not at the start of a paragraph
340 are the ones that are collapsed because of quirks mode.
342 2006-05-10 David Hyatt <hyatt@apple.com>
344 Rename isSpace to treatAsSpace. Move it and the rounding hack function into
345 Font and make them static methods (inlined in the header). Make the rounding
346 hack character table a static member as well. Remove the redundant space/rounding
347 functions from FontData.mm.
353 (WebCore::m_finalRoundingWidth):
354 (WebCore::WidthIterator::advance):
356 (WebCore::Font::treatAsSpace):
357 (WebCore::Font::isRoundingHackCharacter):
358 * platform/mac/FontData.mm:
359 (WebCore::overrideLayoutOperation):
360 (WebCore::createATSULayoutParameters):
361 (WebCore::initializeWidthIterator):
362 (WebCore::advanceWidthIterator):
363 * platform/mac/FontMac.mm:
364 (WebCore::overrideLayoutOperation):
365 (WebCore::ATSULayoutParameters::initialize):
367 2006-05-10 Darin Adler <darin@apple.com>
369 * WebCore: Removed an extra WebCore subtree that somehow got checked in.
372 2006-05-10 David Carson <dacarson@gmail.com>
374 - Fix for bug 8833. Removed inline keyword from functions declared
375 in .mm and .cpp files. inline function code needs to reside in the
376 header file for the linker to find the code.
377 http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
379 Reviewed by Darin, landed by Timothy.
383 * platform/mac/FontData.mm:
384 (WebCore::widthForGlyph):
385 (WebCore::isRoundingHackCharacter):
386 (WebCore::glyphForCharacter):
388 2006-05-10 Mitz Pettel <opendarwin.org@mitzpettel.com>
390 Reviewed and landed by Anders.
392 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
393 REGRESSION: Words render on top of each other when fallback font is used
395 Already covered by several pixel tests in fast/text
398 (WebCore::Font::drawSimpleText):
400 2006-05-10 David Hyatt <hyatt@apple.com>
402 Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
403 drawing and measuring of runs up into the Font class. The fast code
404 path is in Font.cpp and is designed to be mostly cross-platform. The
405 slow code path is in FontMac.cpp and is Mac-specific.
409 * WebCore.xcodeproj/project.pbxproj:
413 (WebCore::isRoundingHackCharacter):
414 (WebCore::m_finalRoundingWidth):
415 (WebCore::WidthIterator::advance):
416 (WebCore::WidthIterator::normalizeVoicingMarks):
417 (WebCore::Font::primaryFont):
418 (WebCore::Font::setAlwaysUseComplexPath):
419 (WebCore::Font::canUseGlyphCache):
420 (WebCore::Font::drawSimpleText):
421 (WebCore::Font::drawText):
422 (WebCore::Font::floatWidth):
423 (WebCore::Font::floatWidthForSimpleText):
425 * platform/FontData.h:
426 (WebCore::FontData::platformData):
427 * platform/GlyphBuffer.h: Added.
428 (WebCore::GlyphBuffer::GlyphBuffer):
429 (WebCore::GlyphBuffer::isEmpty):
430 (WebCore::GlyphBuffer::size):
431 (WebCore::GlyphBuffer::glyphs):
432 (WebCore::GlyphBuffer::advances):
433 (WebCore::GlyphBuffer::fontDataAt):
434 (WebCore::GlyphBuffer::swap):
435 (WebCore::GlyphBuffer::glyphAt):
436 (WebCore::GlyphBuffer::advanceAt):
437 (WebCore::GlyphBuffer::add):
438 * platform/mac/FontData.mm:
440 (WebCore::isRoundingHackCharacter):
441 (WebCore::FontData::widthForGlyph):
442 (WebCore::m_ATSUMirrors):
443 (WebCore::FontData::xHeight):
444 (WebCore::FontData::smallCapsFontData):
445 (WebCore::findSubstituteFont):
446 (WebCore::rendererForAlternateFont):
447 (WebCore::findSubstituteRenderer):
448 (WebCore::FontData::findSubstituteFontData):
449 (WebCore::computeWidthForSpace):
450 (WebCore::FontData::updateGlyphMapEntry):
451 (WebCore::extendGlyphMap):
452 (WebCore::extendWidthMap):
453 (WebCore::createATSULayoutParameters):
454 (WebCore::FontData::glyphForCharacter):
455 (WebCore::advanceWidthIterator):
456 (WebCore::shouldUseATSU):
457 * platform/mac/FontMac.mm:
458 (WebCore::ATSULayoutParameters::m_padPerSpace):
459 (WebCore::addDirectionalOverride):
460 (WebCore::initializeATSUStyle):
461 (WebCore::overrideLayoutOperation):
462 (WebCore::ATSULayoutParameters::initialize):
463 (WebCore::disposeATSULayoutParameters):
464 (WebCore::Font::drawComplexText):
465 (WebCore::Font::floatWidthForComplexText):
466 (WebCore::Font::drawGlyphs):
467 * platform/mac/WebCoreTextRenderer.mm:
468 (WebCoreSetAlwaysUseATSU):
470 2006-05-10 Darin Adler <darin@apple.com>
472 - another try at fixing the Windows build
474 * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
475 instead of unicode().
477 == Rolled over to ChangeLog-2006-05-10 ==