Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: Source/core/rendering/RenderListBox.cpp

Issue 14160005: Track the region where text is painted. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed build on win and mac Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderImage.cpp ('k') | Source/core/rendering/RenderListMarker.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r)); 427 r.move(itemOffsetForAlignment(textRun, itemStyle, itemFont, r));
428 428
429 if (element->hasTagName(optgroupTag)) { 429 if (element->hasTagName(optgroupTag)) {
430 FontDescription d = itemFont.fontDescription(); 430 FontDescription d = itemFont.fontDescription();
431 d.setWeight(d.bolderWeight()); 431 d.setWeight(d.bolderWeight());
432 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing()); 432 itemFont = Font(d, itemFont.letterSpacing(), itemFont.wordSpacing());
433 itemFont.update(document()->styleResolver()->fontSelector()); 433 itemFont.update(document()->styleResolver()->fontSelector());
434 } 434 }
435 435
436 // Draw the item text 436 // Draw the item text
437 paintInfo.context->drawBidiText(itemFont, textRun, roundedIntPoint(r.locatio n())); 437 TextRunPaintInfo textRunPaintInfo(textRun);
438 textRunPaintInfo.bounds = r;
439 paintInfo.context->drawBidiText(itemFont, textRunPaintInfo, roundedIntPoint( r.location()));
438 } 440 }
439 441
440 void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex) 442 void RenderListBox::paintItemBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset, int listIndex)
441 { 443 {
442 const Vector<HTMLElement*>& listItems = selectElement()->listItems(); 444 const Vector<HTMLElement*>& listItems = selectElement()->listItems();
443 HTMLElement* element = listItems[listIndex]; 445 HTMLElement* element = listItems[listIndex];
444 446
445 Color backColor; 447 Color backColor;
446 if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected ()) { 448 if (element->hasTagName(optionTag) && toHTMLOptionElement(element)->selected ()) {
447 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node()) 449 if (frame()->selection()->isFocusedAndActive() && document()->focusedNod e() == node())
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 887
886 if (m_vBar) 888 if (m_vBar)
887 m_vBar->styleChanged(); 889 m_vBar->styleChanged();
888 890
889 // Force an update since we know the scrollbars have changed things. 891 // Force an update since we know the scrollbars have changed things.
890 if (document()->hasAnnotatedRegions()) 892 if (document()->hasAnnotatedRegions())
891 document()->setAnnotatedRegionsDirty(true); 893 document()->setAnnotatedRegionsDirty(true);
892 } 894 }
893 895
894 } // namespace WebCore 896 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderImage.cpp ('k') | Source/core/rendering/RenderListMarker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698