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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 document->page()->deprecatedLocalMainFrame()->view()->setFrameRect(IntRect(I ntPoint::zero(), initialViewportSize)); 945 document->page()->deprecatedLocalMainFrame()->view()->setFrameRect(IntRect(I ntPoint::zero(), initialViewportSize));
946 946
947 ViewportDescription description = page->viewportDescription(); 947 ViewportDescription description = page->viewportDescription();
948 PageScaleConstraints constraints = description.resolve(FloatSize(initialView portSize), Length()); 948 PageScaleConstraints constraints = description.resolve(FloatSize(initialView portSize), Length());
949 949
950 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h); 950 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h);
951 constraints.resolveAutoInitialScale(); 951 constraints.resolveAutoInitialScale();
952 952
953 StringBuilder builder; 953 StringBuilder builder;
954 954
955 builder.appendLiteral("viewport size "); 955 builder.append("viewport size ");
956 builder.append(String::number(constraints.layoutSize.width())); 956 builder.append(String::number(constraints.layoutSize.width()));
957 builder.append('x'); 957 builder.append('x');
958 builder.append(String::number(constraints.layoutSize.height())); 958 builder.append(String::number(constraints.layoutSize.height()));
959 959
960 builder.appendLiteral(" scale "); 960 builder.append(" scale ");
961 builder.append(String::number(constraints.initialScale)); 961 builder.append(String::number(constraints.initialScale));
962 builder.appendLiteral(" with limits ["); 962 builder.append(" with limits [");
963 builder.append(String::number(constraints.minimumScale)); 963 builder.append(String::number(constraints.minimumScale));
964 builder.appendLiteral(", "); 964 builder.append(", ");
965 builder.append(String::number(constraints.maximumScale)); 965 builder.append(String::number(constraints.maximumScale));
966 966
967 builder.appendLiteral("] and userScalable "); 967 builder.append("] and userScalable ");
968 builder.append(description.userZoom ? "true" : "false"); 968 builder.append(description.userZoom ? "true" : "false");
969 969
970 return builder.toString(); 970 return builder.toString();
971 } 971 }
972 972
973 bool Internals::elementShouldAutoComplete(Element* element, ExceptionState& exce ptionState) 973 bool Internals::elementShouldAutoComplete(Element* element, ExceptionState& exce ptionState)
974 { 974 {
975 ASSERT(element); 975 ASSERT(element);
976 if (isHTMLInputElement(*element)) 976 if (isHTMLInputElement(*element))
977 return toHTMLInputElement(*element).shouldAutocomplete(); 977 return toHTMLInputElement(*element).shouldAutocomplete();
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 2092
2093 ASSERT_NOT_REACHED(); 2093 ASSERT_NOT_REACHED();
2094 return "UNKNOWN"; 2094 return "UNKNOWN";
2095 } 2095 }
2096 2096
2097 String Internals::getCurrentCursorInfo() 2097 String Internals::getCurrentCursorInfo()
2098 { 2098 {
2099 Cursor cursor = frame()->page()->chromeClient().lastSetCursorForTesting(); 2099 Cursor cursor = frame()->page()->chromeClient().lastSetCursorForTesting();
2100 2100
2101 StringBuilder result; 2101 StringBuilder result;
2102 result.appendLiteral("type="); 2102 result.append("type=");
2103 result.append(cursorTypeToString(cursor.getType())); 2103 result.append(cursorTypeToString(cursor.getType()));
2104 result.appendLiteral(" hotSpot="); 2104 result.append(" hotSpot=");
2105 result.appendNumber(cursor.hotSpot().x()); 2105 result.appendNumber(cursor.hotSpot().x());
2106 result.append(','); 2106 result.append(',');
2107 result.appendNumber(cursor.hotSpot().y()); 2107 result.appendNumber(cursor.hotSpot().y());
2108 if (cursor.getImage()) { 2108 if (cursor.getImage()) {
2109 IntSize size = cursor.getImage()->size(); 2109 IntSize size = cursor.getImage()->size();
2110 result.appendLiteral(" image="); 2110 result.append(" image=");
2111 result.appendNumber(size.width()); 2111 result.appendNumber(size.width());
2112 result.append('x'); 2112 result.append('x');
2113 result.appendNumber(size.height()); 2113 result.appendNumber(size.height());
2114 } 2114 }
2115 if (cursor.imageScaleFactor() != 1) { 2115 if (cursor.imageScaleFactor() != 1) {
2116 result.appendLiteral(" scale="); 2116 result.append(" scale=");
2117 NumberToStringBuffer buffer; 2117 NumberToStringBuffer buffer;
2118 result.append(numberToFixedPrecisionString(cursor.imageScaleFactor(), 8, buffer, true)); 2118 result.append(numberToFixedPrecisionString(cursor.imageScaleFactor(), 8, buffer, true));
2119 } 2119 }
2120 2120
2121 return result.toString(); 2121 return result.toString();
2122 } 2122 }
2123 2123
2124 bool Internals::cursorUpdatePending() const 2124 bool Internals::cursorUpdatePending() const
2125 { 2125 {
2126 return frame()->eventHandler().cursorUpdatePending(); 2126 return frame()->eventHandler().cursorUpdatePending();
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 } 2564 }
2565 2565
2566 String Internals::getProgrammaticScrollAnimationState(Node* node) const 2566 String Internals::getProgrammaticScrollAnimationState(Node* node) const
2567 { 2567 {
2568 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) 2568 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node))
2569 return scrollableArea->programmaticScrollAnimator().runStateAsText(); 2569 return scrollableArea->programmaticScrollAnimator().runStateAsText();
2570 return String(); 2570 return String();
2571 } 2571 }
2572 2572
2573 } // namespace blink 2573 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGParsingError.cpp ('k') | third_party/WebKit/Source/core/xml/parser/XMLErrors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698