mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 19:25:43 +00:00
68f1504992
I've chosen this approach mainly because there's no other good way to guarantee the model is correct than holding the snapshots alive until a style refresh. What I tried before this (storing them in a sort of "immutable element data") is a pain, since we call into style from the frame constructor and other content notifications, which makes keeping track of which snapshots should be cleared an which shouldn't an insane task. Ideally we'd have a single entry-point for style, but that's not the case right now, and changing that requires pretty non-trivial changes to the frame constructor. MozReview-Commit-ID: FF1KWZv2iBM --HG-- extra : rebase_source : b02d516ea164fc567110338411bf6ba251d53dab
25 lines
709 B
C++
25 lines
709 B
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef mozilla_ServoElementSnapshotTable_h
|
|
#define mozilla_ServoElementSnapshotTable_h
|
|
|
|
#include "mozilla/dom/Element.h"
|
|
#include "nsClassHashtable.h"
|
|
#include "nsHashKeys.h"
|
|
#include "ServoElementSnapshot.h"
|
|
|
|
namespace mozilla {
|
|
|
|
class ServoElementSnapshotTable
|
|
: public nsClassHashtable<nsRefPtrHashKey<dom::Element>, ServoElementSnapshot>
|
|
{
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif
|