#include "srcset_slot.h"
Since the various images inside a src attribute share the attribute, we hook them all up to a single SrcSetSlotCollection (which they own).
net_instaweb::SrcSetSlotCollection::SrcSetSlotCollection |
( |
RewriteDriver * |
driver, |
|
|
CommonFilter * |
filter, |
|
|
HtmlElement * |
element, |
|
|
HtmlElement::Attribute * |
attribute |
|
) |
| |
|
explicit |
This will parse the passed in srcset attribute, and create all the slots, and all their resources.
void net_instaweb::SrcSetSlotCollection::Commit |
( |
| ) |
|
This serializes everything back to the attribute. (Which is sadly quadratic, but the size should be small enough that it's more practical than trying to coordinate).
static void net_instaweb::SrcSetSlotCollection::ParseSrcSet |
( |
StringPiece |
input, |
|
|
std::vector< ImageCandidate > * |
out |
|
) |
| |
|
static |
Parses the input srcset attribute into *out (replacing its contents), filling in the url and descriptor fields (but not trying to create resources or fill in slot).
The documentation for this class was generated from the following file: