Commit 888baff5 authored by cevans@chromium.org's avatar cevans@chromium.org

Tweak heuristic to hide fixed-size parent <div>s for one more case.

BUG=http://code.google.com/p/chromium/issues/detail?id=63695
TEST=http://www.zontera.com/banners/clients_work/floating_flash/centered/dove/

Review URL: http://codereview.chromium.org/6266009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71761 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d6dfd4d
......@@ -7,6 +7,7 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "base/string_piece.h"
#include "base/string_util.h"
#include "base/values.h"
#include "chrome/common/jstemplate_builder.h"
#include "chrome/common/render_messages.h"
......@@ -188,11 +189,19 @@ void BlockedPlugin::HidePlugin() {
if (element.hasAttribute("width") && element.hasAttribute("height")) {
std::string width_str("width:[\\s]*");
width_str += element.getAttribute("width").utf8().data();
if (EndsWith(width_str, "px", false)) {
width_str = width_str.substr(0, width_str.length() - 2);
}
TrimWhitespace(width_str, TRIM_TRAILING, &width_str);
width_str += "[\\s]*px";
WebRegularExpression width_regex(WebString::fromUTF8(width_str.c_str()),
WebKit::WebTextCaseSensitive);
std::string height_str("height:[\\s]*");
height_str += element.getAttribute("height").utf8().data();
if (EndsWith(height_str, "px", false)) {
height_str = height_str.substr(0, height_str.length() - 2);
}
TrimWhitespace(height_str, TRIM_TRAILING, &height_str);
height_str += "[\\s]*px";
WebRegularExpression height_regex(WebString::fromUTF8(height_str.c_str()),
WebKit::WebTextCaseSensitive);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment